0

I have three activities in my application ... I use an intent to navigate between the activities. My third activity contains a method that fetch data from a web service. When I press back button on the 3rd activity I go back to the second activity. But when I again come to 3rd activity from the second activity it starts downloading data again. Please help me!

I am using handler in my 3rd screen..

Second activity uses following code

Intent intent=new Intent(Screen2.this,Screen3.class);
startActivity(intent);

Thanks in advance guys.

Yury
  • 20,618
  • 7
  • 58
  • 86
Pinakin Kansara
  • 2,273
  • 3
  • 22
  • 35

3 Answers3

0

Make use of savedInstance bundle....

Get more info from

Saving Android Activity state using Save Instance State

Community
  • 1
  • 1
Sai Mukesh
  • 401
  • 4
  • 11
0

First finish the second activity moving to the third activity.

From third activity call the second activity

SathishBabu S
  • 382
  • 3
  • 11
0

Try this link: Android Intents - Tutorial.
Using this tutorial

startActivityForResult(); 
Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
Nitesh Khosla
  • 875
  • 8
  • 20