onconfigurationchanged

android : How to prevent resizing the window when displaying the virtual keyboard

守給你的承諾、 提交于 2019-11-29 11:01:15
问题 I am using a tabbed application. There is an EditText my application. When I click on the EditText, the window is getting resized and the virtual keyboard is displaying at the bottom of the window. But the four tabs are displaying at the top of the keyboard. I do not want to display my tabs, when the keyborad is displaying. Or I do not want to resize my window. My need is just to hide the tabs and other things below the EditText. I use all options with 'android:windowSoftInputMode' in my

Best way to store SparseBooleanArray in Bundle?

半腔热情 提交于 2019-11-29 02:33:57
问题 When a config change happens, my ListView Checkbox states get lost, which I understand why. I try to implement public void onSaveInstanceState(final Bundle outState) in one of my Fragments. So I'm just wondering what's the easiest way to store my SparseBooleanArray in the outState . Also, I'm a bit confused, as ListView has the method: getListView().getCheckedItemPositions(); What's this good for? 回答1: In my case, I ended up doing it by implementing a Parcelable wrapper around the

Restoring state of TextView after screen rotation?

淺唱寂寞╮ 提交于 2019-11-26 15:55:01
In my app I have TextView and EditText . Both have data in it. When the screen orientation changes the data in the EditText remains, but TextView data is cleared. Can some one help me out to find a way to retain data in TextView too? If you want to force your TextView to save its state you must add freezesText attribute: <TextView ... android:freezesText="true" /> From documentation on freezesText : If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. By default this is disabled; it can be useful

Restoring state of TextView after screen rotation?

谁说我不能喝 提交于 2019-11-26 06:00:01
问题 In my app I have TextView and EditText . Both have data in it. When the screen orientation changes the data in the EditText remains, but TextView data is cleared. Can some one help me out to find a way to retain data in TextView too? 回答1: If you want to force your TextView to save its state you must add freezesText attribute: <TextView ... android:freezesText="true" /> From documentation on freezesText : If set, the text view will include its current complete text inside of its frozen icicle

Prevent dialog dismissal on screen rotation in Android

时光总嘲笑我的痴心妄想 提交于 2019-11-26 02:50:45
问题 I am trying to prevent dialogs built with Alert builder from being dismissed when the Activity is restarted. If I overload the onConfigurationChanged method I can successfully do this and reset the layout to correct orientation but I lose sticky text feature of edittext. So in solving the dialog problem I have created this edittext problem. If I save the strings from the edittext and reassign them in the onCofiguration change they still seem to default to initial value not what was entered