¡@

Home 

2014/10/16 ¤W¤È 08:22:48

android Programming Glossary: retain

Understanding Fragment's setRetainInstance(boolean)

http://stackoverflow.com/questions/11182180/understanding-fragments-setretaininstanceboolean

the documentation public void setRetainInstance boolean retain Control whether a fragment instance is retained across Activity.. boolean retain Control whether a fragment instance is retained across Activity re creation such as from a configuration change.. be called. I have some questions Does the fragment also retain it's view or will this be recreated on configuration change..

How many Activities vs Fragments?

http://stackoverflow.com/questions/12363790/how-many-activities-vs-fragments

the separate Phone Activities . Would it not be easier to retain the 1 Activity model in both cases using the same logic of switching..

does android support JDBC

http://stackoverflow.com/questions/1728476/does-android-support-jdbc

of bloat making it less likely people will download and retain your application. In short I wouldn't go this route. share..

EditText items in a scrolling list lose their changes when scrolled off the screen

http://stackoverflow.com/questions/3036296/edittext-items-in-a-scrolling-list-lose-their-changes-when-scrolled-off-the-scre

on here and what I need to do to force the EditText to retain its edits Thanks Ian android scrolling edittext share improve..

ScrollView .scrollTo not working? Saving ScrollView position on rotation

http://stackoverflow.com/questions/3263259/scrollview-scrollto-not-working-saving-scrollview-position-on-rotation

i think i'm trying to do something fairly basic.. Simply retain the scrollbar position of a ScrollView on orientation change.....

How to save state during orientation change in Android if the state is made of my classes?

http://stackoverflow.com/questions/3915952/how-to-save-state-during-orientation-change-in-android-if-the-state-is-made-of-m

versions of Android and with the compatibility library retained fragments are usually the best way to handle keeping expensive.. activity destruction creation. And as Dianne pointed out retaining nonconfiguration data was for optimizing things like thumbnail.. But back when I first answered this in 2010 If you want to retain your own non view state data you can actually pass an arbitrary..

retain the fragment object while rotating

http://stackoverflow.com/questions/5164126/retain-the-fragment-object-while-rotating

the fragment object while rotating I have developed an app.. even though before rotating it wasn't What is the way to retain the fragment object while rotating I used setRetainInstance.. share improve this question By default android will retain the fragment objects In your code you are setting the homeFragment..

Restoring state of TextView after screen rotation?

http://stackoverflow.com/questions/5179686/restoring-state-of-textview-after-screen-rotation

am confused ... Can some one help me out to find a way to retain data in TextView too android views orientation onconfigurationchanged..

Android 3.0 - what are the advantages of using LoaderManager instances exactly?

http://stackoverflow.com/questions/5603504/android-3-0-what-are-the-advantages-of-using-loadermanager-instances-exactly

and well working For example will your implementation retain the loaded Cursor across activity configuration changes so it..

Select + copy text in a TextView?

http://stackoverflow.com/questions/6025818/select-copy-text-in-a-textview

the editable none option or inputType none but those still retain the framed background of an EditText which I don't want Thanks..

Android Fragments. Retaining an AsyncTask during screen rotation or configuration change

http://stackoverflow.com/questions/8417885/android-fragments-retaining-an-asynctask-during-screen-rotation-or-configuratio

same basic design logic. What would be the proper way to retain the AsyncTask during a configuration change and if its still.. boolean to have your fragment instance retained across configuration changes. Note that this is the recommended.. docs. If for some reason you really don't want to use a retained fragment there are other approaches you can take. Note that..

When a Fragment is replaced and put in the back stack (or removed) does it stay in memory?

http://stackoverflow.com/questions/8482606/when-a-fragment-is-replaced-and-put-in-the-back-stack-or-removed-does-it-stay

the back stack . Note that when Activity is destroyed and retains state like when you turn the device to landscape mode it doesn't.. like when you turn the device to landscape mode it doesn't retain the exact Fragment objects in the stack only their states Fragment.FragmentState.. are re created every time activity gets re created with retained state. Hope this helps. PS So in short Yes you can run out..

Android Activity Life Cycle - What are all these methods for?

http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for

or in the background. Stopped activities still try to retain their state and member information for as long as possible but..

How to transition from managedQuery to LoaderManager/CursorLoader?

http://stackoverflow.com/questions/8899497/how-to-transition-from-managedquery-to-loadermanager-cursorloader

and implementing your class so that it will for example retain the loaded Cursor over Activity won't be simple. The bottom..

VideoView onResume loses buffered portion of the video

http://stackoverflow.com/questions/9987042/videoview-onresume-loses-buffered-portion-of-the-video

confirm VideoView can be hacked to behavior what you want retain buffering after surface destroyed. I've tested on my Samsung.. m4v video from remote http server is successfully retained when I open a new activity and go back. Basically the workaround..

Understanding Fragment's setRetainInstance(boolean)

http://stackoverflow.com/questions/11182180/understanding-fragments-setretaininstanceboolean

Fragment's setRetainInstance boolean Starting with the documentation public void setRetainInstance boolean retain Control whether a fragment instance is retained across Activity re creation such as from a configuration change . This can.. Starting with the documentation public void setRetainInstance boolean retain Control whether a fragment instance is retained across Activity re creation such as from a configuration change . This can only be used with fragments not in the back.. onAttach Activity and onActivityCreated Bundle will still be called. I have some questions Does the fragment also retain it's view or will this be recreated on configuration change what exactly is retained Will the fragment be destroyed when..

How many Activities vs Fragments?

http://stackoverflow.com/questions/12363790/how-many-activities-vs-fragments

a lot of the logic in the main Tablet Activity and in the separate Phone Activities . Would it not be easier to retain the 1 Activity model in both cases using the same logic of switching Fragments in and out just using a different layout..

does android support JDBC

http://stackoverflow.com/questions/1728476/does-android-support-jdbc

EditText items in a scrolling list lose their changes when scrolled off the screen

http://stackoverflow.com/questions/3036296/edittext-items-in-a-scrolling-list-lose-their-changes-when-scrolled-off-the-scre

scrolled off the screen. Can anyone please tell me what's going on here and what I need to do to force the EditText to retain its edits Thanks Ian android scrolling edittext share improve this question But...if I then scroll the list far enough..

ScrollView .scrollTo not working? Saving ScrollView position on rotation

http://stackoverflow.com/questions/3263259/scrollview-scrollto-not-working-saving-scrollview-position-on-rotation

Ok.. I must be overlooking something real simple here but i think i'm trying to do something fairly basic.. Simply retain the scrollbar position of a ScrollView on orientation change... Here is the code for my onSaveInstanceState and onRestoreInstanceState....

How to save state during orientation change in Android if the state is made of my classes?

http://stackoverflow.com/questions/3915952/how-to-save-state-during-orientation-change-in-android-if-the-state-is-made-of-m

state android share improve this question EDIT On newer versions of Android and with the compatibility library retained fragments are usually the best way to handle keeping expensive to recreate data alive across activity destruction creation... way to handle keeping expensive to recreate data alive across activity destruction creation. And as Dianne pointed out retaining nonconfiguration data was for optimizing things like thumbnail generation that are nice to save for performance reasons.. for properly saving and restoring activity state. But back when I first answered this in 2010 If you want to retain your own non view state data you can actually pass an arbitrary object specifically for orientation changes using onRetainNonConfigurationInstance..

retain the fragment object while rotating

http://stackoverflow.com/questions/5164126/retain-the-fragment-object-while-rotating

the fragment object while rotating I have developed an app in Honeycomb and I am using fragments. This is my app I have.. is recreated and which make F1 as the fragment object even though before rotating it wasn't What is the way to retain the fragment object while rotating I used setRetainInstance true but it didn't work for me And I have added the fragment.. homeFragment fragmentTransaction.commit android android 3.0 share improve this question By default android will retain the fragment objects In your code you are setting the homeFragment in your onCreate function. That is why it is allways..

Restoring state of TextView after screen rotation?

http://stackoverflow.com/questions/5179686/restoring-state-of-textview-after-screen-rotation

data in the Editview remains but Textview data is cleared. I am confused ... Can some one help me out to find a way to retain data in TextView too android views orientation onconfigurationchanged share improve this question If you want to force..

Android 3.0 - what are the advantages of using LoaderManager instances exactly?

http://stackoverflow.com/questions/5603504/android-3-0-what-are-the-advantages-of-using-loadermanager-instances-exactly

and even then are you going to implement something as complete and well working For example will your implementation retain the loaded Cursor across activity configuration changes so it doesn't need to be re queried when the new instances is created..

Select + copy text in a TextView?

http://stackoverflow.com/questions/6025818/select-copy-text-in-a-textview

a TextView. Tried a few things like making an EditText use the editable none option or inputType none but those still retain the framed background of an EditText which I don't want Thanks Update This is 99 there all I'd want is for the selection..

Android Fragments. Retaining an AsyncTask during screen rotation or configuration change

http://stackoverflow.com/questions/8417885/android-fragments-retaining-an-asynctask-during-screen-rotation-or-configuratio

in fragments that being said I would like to maintain the same basic design logic. What would be the proper way to retain the AsyncTask during a configuration change and if its still runing show a progressDialog taking into consideration that.. actually make this a lot easier. Just use the method Fragment.setRetainInstance boolean to have your fragment instance retained across configuration changes. Note that this is the recommended replacement for Activity.onRetainnonConfigurationInstance.. for Activity.onRetainnonConfigurationInstance in the docs. If for some reason you really don't want to use a retained fragment there are other approaches you can take. Note that each fragment has a unique identifier returned by Fragment.getId..

When a Fragment is replaced and put in the back stack (or removed) does it stay in memory?

http://stackoverflow.com/questions/8482606/when-a-fragment-is-replaced-and-put-in-the-back-stack-or-removed-does-it-stay

gone GC will not be able to collect any of the Fragments in the back stack . Note that when Activity is destroyed and retains state like when you turn the device to landscape mode it doesn't retain the exact Fragment objects in the stack only their.. . Note that when Activity is destroyed and retains state like when you turn the device to landscape mode it doesn't retain the exact Fragment objects in the stack only their states Fragment.FragmentState objects i.e. actual fragments in the back.. objects i.e. actual fragments in the back stack are re created every time activity gets re created with retained state. Hope this helps. PS So in short Yes you can run out of memory by adding Fragments to back stack as well as by adding..

Android Activity Life Cycle - What are all these methods for?

http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for

completely obscured by another activity are considered stopped or in the background. Stopped activities still try to retain their state and member information for as long as possible but stopped activities are considered to be the lowest priority..

How to transition from managedQuery to LoaderManager/CursorLoader?

http://stackoverflow.com/questions/8899497/how-to-transition-from-managedquery-to-loadermanager-cursorloader

UI thread friendly but it will involve a lot more code... and implementing your class so that it will for example retain the loaded Cursor over Activity won't be simple. The bottom line is that LoaderManager Loader will do this automatically..

VideoView onResume loses buffered portion of the video

http://stackoverflow.com/questions/9987042/videoview-onresume-loses-buffered-portion-of-the-video

to hack the original VideoView source code and Now I can confirm VideoView can be hacked to behavior what you want retain buffering after surface destroyed. I've tested on my Samsung Galaxy S2 which works as expected in my case the video buffering.. S2 which works as expected in my case the video buffering streaming m4v video from remote http server is successfully retained when I open a new activity and go back. Basically the workaround is create you own VideoView class by copying the source..