Questions tagged [android-savedstate]

For questions related to Android's onSaveInstanceState and onRestoreInstanceState methods.

197 questions
0
votes
0 answers

android.os.Parcelable android.widget.GridView.onSaveInstanceState()' on a null?

I am making News app and I have Gridview inside fragment and I have implemented onSaveInstanceState and onRestoreInstanceState when configuration changes. below an error which I am getting FATAL EXCEPTION: main …
0
votes
1 answer

Original intent bundle retained upon screen rotation?

Is the original info passed to an activity at creation (e.g. an Intent Bundle from getIntent().getExtras()) retained when the screen orientation is changed? Can I just call getIntent().getExtras() again after rotation to obtain the info again? Or…
0
votes
2 answers

How to save fragment onButtonClick and load on next program start

I have an app where I have a fragment.Let's call it mainScreen. In mainScreen there's a button and onClick() opens second fragment. Let's call it FragmentHomePage. In FragmentHomePage i have a retrofit. There's a button named logOut. My problem is,…
Hayk Mkrtchyan
  • 2,835
  • 3
  • 19
  • 61
0
votes
2 answers

How to save View's state after pause?

When my app completes some async tasks, it notifies UI about it. For example: user clicks on "Do work" button inside of my application -> async work started and switches to another app -> state is saved then "work" inside my app is finished and…
Alexandr
  • 3,859
  • 5
  • 32
  • 56
0
votes
3 answers

Save custom object on screen rotate in Fragment or Activity

I know this question is very common and I have read so many different answers but none fits in my problem. In my application, I have an activity and in rhye activity I load a fragment. I also send some data(in the form of Bundle) to the fragment. So…
0
votes
1 answer

Why Savedinstance values get null when returning back to that activity in Marshmallow?

I created an application which gets values from previous activity as extras and uses that values in that activity. And the values are then sent to another activity. But when I returned back from the moving activity to previous activity the extra…
user8231819
0
votes
2 answers

How to display list of high score both on device and globally

I have read several tutorials but can't pin down exactly what I need I am trying to add a list of high score(about 10 rows) from people that have played the game on my device, then in another tab, I want to have list of high scores from players…
user8389198
0
votes
1 answer

Android and Dagger 2 submodules

If I'm using Dagger 2 with scoped submodules, it makes it easier not to pass parcelables between activities but if the app experiences process death and our Object graph is destroyed, how do you handle recovering from that? The only thing I can…
Stampede10343
  • 844
  • 1
  • 6
  • 21
0
votes
1 answer

Execute operation from fragment after onRestoreInstanceState

I have a custom view that performs some network operations. From that operation result the view builds UI. The view contains a list of cards that are fetched via internet. This view is used in multiple places. Lets say one of them is my…
deathangel908
  • 8,601
  • 8
  • 47
  • 81
0
votes
1 answer

Saving multiple checkboxes using saved preferences in android?

i have an app with 7 checkboxes, 1 text feild and a save button..... i want users to be able to select any amount of the checkboxes as they want and type in the text field and click save..... then when they open the app again the correct checkboxes…
skapaid
  • 169
  • 4
  • 17
0
votes
2 answers

Calling second Intent in onActivityResult of nested Fragment won't call onActivityResult again

I call the Camera intent in a nested fragment and get the image in onActivityResult in the fragment without any problems. As I want to crop the image I call a (second) intent in the onActivityResult to pass the image to the Crop intent. However, the…
0
votes
0 answers

RecyclerView Adapter null after restoring Fragment

I have a RecyclerView inside a fragment that is in a ViewPager. The problem is, when the view is restored, the RecyclerView is null and its adapter, which I need to update the contents, is also null. How do I save the adapter state so that it…
0
votes
1 answer

How to save all things of a listview in a fragment?

I have a fragment in which I have put a listview which gets its content from internet , When I click a row and come back to the listview it gets data again, but i want to keep last state of listview , how can I do that ? public View…
0
votes
2 answers

Getting data from one activity and storing in another activity at app relaunch

I have a game activity that the user gets points by clicking a button. What I want to do is pass those points to the main activity, the first activity the user sees. So for example, the user goes to the game activity, gets some points and quits the…