Questions tagged [instancestate]

19 questions
-1
votes
2 answers

keep data retained of listview when switching between activities

i am struggling to keep data or items of list view when i leave one activity to another, for my example i created simple app on click will add number increased to a list view so each click create an item like 1 another click add 2 and so on. the…
-2
votes
1 answer

Android SaveInstanceState

I have two activities, say A and B. Activity A has a Text View, two buttons B1 to increment the counter and B2 to navigate to activity B. I have entered some text into Text View and incremented the counter value. I navigate to activity B by clicking…
Praful C
  • 162
  • 1
  • 3
  • 14
-2
votes
5 answers

Best way to pass objects to fragments as parameter

I need to pass objects to my fragments in order to initialize them. Currently I am doing this with ((MyActivity)getActivity()).getX(). (direct access to the activity) However, I would like to pass the required objects as parameter. I definitely do…
-2
votes
2 answers

Android Save Instance State

I have created two activities A and B. In the Activity A, using onSaveInstanceState method I am saving bundle value ex(outState.putString("selectSaveDate", this.CalSelectedDate)) and going to the Activity B. When I hit back button to the Activity A…
1
2