Re: [android-developers] how to get the view size after orientation changed

2011-08-24 Thread Ralph Bergmann
Hi, Am 23.08.11 19:05, schrieb Dianne Hackborn: You need to participate in the view hierarchy as a layout manager, do get the onSizeChanged() calls and such. Code like this is almost guaranteed to be broken. If you want to do stuff based on view layout, implement a layout manager. thank

Re: [android-developers] how to get the view size after orientation changed

2011-08-24 Thread wu kunting
DisplayMetrics metrics = new DisplayMetrics(); WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE); int width = wm.getDefaultDisplay().getWidth(); int height = wm.getDefaulDisplay().getHeight(); 2011/8/23 Ralph Bergmann ra...@dasralph.de Hi,

[android-developers] how to get the view size after orientation changed

2011-08-23 Thread Ralph Bergmann
Hi, where is the right point to get the size of a view after the orientation has changed? I have overwritten the onConfigurationChanged method: public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); final int viewWidth =

Re: [android-developers] how to get the view size after orientation changed

2011-08-23 Thread Dianne Hackborn
You need to participate in the view hierarchy as a layout manager, do get the onSizeChanged() calls and such. Code like this is almost guaranteed to be broken. If you want to do stuff based on view layout, implement a layout manager. On Tue, Aug 23, 2011 at 4:19 AM, Ralph Bergmann