android-configchanges

Avoiding manually handling configuration changes

淺唱寂寞╮ 提交于 2019-11-30 09:45:55
问题 This project is an extension of the Master/Detail flow template that can be found in Android Studio. The difference is that this application uses a single Activity and a ViewPager that manages three Fragments. The third Fragment is the Master (list) Fragment, which contains a clickable RecycleView. When a list item is clicked, it switches the Fragment with the Child (detail) Fragment. While the project works, I'd like to avoid using android:configChanges= "orientation|keyboardHidden

Getting “Fragment did not create a view” after addition of other Fragment without UI

对着背影说爱祢 提交于 2019-11-29 17:54:21
问题 I'm having a really weird problem. I have a common fragment that is added in almost every activity of my app. This fragment shows a small version of the player bar. So it listens some broadcasts to update the current music's name and has some controls, like play/pause. Like I said, I add this fragment in almost every activity of my app and I've never had any problem with it. But now, I needed to create a new Fragment that has no UI and that is retained (setRetainInstance(true)). After the

Avoiding manually handling configuration changes

自古美人都是妖i 提交于 2019-11-29 16:36:27
This project is an extension of the Master/Detail flow template that can be found in Android Studio. The difference is that this application uses a single Activity and a ViewPager that manages three Fragments. The third Fragment is the Master (list) Fragment, which contains a clickable RecycleView. When a list item is clicked, it switches the Fragment with the Child (detail) Fragment. While the project works, I'd like to avoid using android:configChanges= "orientation|keyboardHidden|screenSize" in the manifest. How should I do this? If the attribute is removed, mListener in ItemListFragment is

Orientation change in Honeycomb

南楼画角 提交于 2019-11-28 23:16:23
I have an activity that shouldn't be recreated after an orientation change. I added the following to the activity declaration in the manifest: android:configChanges="orientation" On Android 2.3 this works perfectly. On HONEYCOMB_MR2 onCreate is called anyway when change the orientation. Is there something else that needs to be done on HONEYCOMB_MR2 to prevent recreating the activity after an orientation change? Apparently using orientation|screenSize (?) prevents onCreate on Honeycomb and (so far) does not seem to break anything in previous Android versions. android:configChanges="orientation

Orientation change in Honeycomb

浪尽此生 提交于 2019-11-27 14:38:43
问题 I have an activity that shouldn't be recreated after an orientation change. I added the following to the activity declaration in the manifest: android:configChanges="orientation" On Android 2.3 this works perfectly. On HONEYCOMB_MR2 onCreate is called anyway when change the orientation. Is there something else that needs to be done on HONEYCOMB_MR2 to prevent recreating the activity after an orientation change? 回答1: Apparently using orientation|screenSize (?) prevents onCreate on Honeycomb