android-savedstate

Android View - What is automatically saved and restored in an Activity

﹥>﹥吖頭↗ 提交于 2019-12-03 14:12:35
I am a beginner with Android. In Android, some generic elements can be automatically saved/restored in onSaveInstanceState / onRestoreInstanceState . For example, an EditText saves/restores the Text property, a RatingBar saves/restores the Rating property... I see from some tests but I can't find anything about this in the documentation. How can I know what is saved/restored implicitly, without my intervention? For example, where I can find that the EditText.Text is automatically saved/restored? I specifically don't want test all properties. Edit from JRG answer : https://developer.android.com

How do I retrieve the previous fragment upon opening an app from background? (app that wasn't killed)

两盒软妹~` 提交于 2019-12-02 03:02:17
I have a pretty unique issue where I am trying to retrieve previous fragment that was there before I went to the homescreen via the current fragment( last visible fragment) Not to confuse any further, here's the steps to repro my issue 1 ) launch the mainactivity, from there open fragment A via a button click (say button A) 2) from fragment A , press another button ,say B, which will open fragment B. 3) Fragment B has a close and save button , pressing which leads me back to the previous backstack fragment A ( activity.backpressed()) 4) Now, I have a scenario where I am calling fragment B, by

Android - Navigation Up from Activity to Fragment

拥有回忆 提交于 2019-11-28 01:46:41
问题 I'm developing some application and I have one problem. I have : 1. Activity A (Navigation Drawer pattern) with ListFragment in FrameLayout: xml: <FrameLayout ...> </FrameLayout> <LinearLayout ...> </LinearLayout> </android.support.v4.widget.DrawerLayout> Activity B which shows the detail data of ListView in ListFragment. How can I go back (using Navigation Up Button) from activity B to Activity A with saving UI of the ListFragment (Activity re-creates if I go back using Home Back). Btw, if I