How to find the Width of the a view before the view is displayed? I do not want to add a custom view and tap the dimensions in the OnChanged().
I like to use this technique as per my answer on a related question:
Post a runnable from onCreate() that will be executed when the view has been created:
contentView = findViewById(android.R.id.content);
contentView.post(new Runnable()
{
public void run()
{
contentHeight = contentView.getHeight();
}
});
This code will run on the main UI thread, after onCreate() has finished.