Por que chamar getWidth () em uma View in onResume () retorna 0?

Tudo o que li diz que você não pode ligargetWidth() ougetHeight() com umView em um construtor, mas estou chamando-os deonResume(). O layout da tela não deveria ter sido desenhado até então?

@Override
protected void onResume() {
    super.onResume();

    populateData();
}

private void populateData() {
    LinearLayout test = (LinearLayout) findViewById(R.id.myview);
    double widthpx = test.getWidth();
}

questionAnswers(2)

yourAnswerToTheQuestion