Activity Issue

All your problems with Audio, Video and Images.

Activity Issue

Postby vipulshah2010 » Wed Mar 10, 2010 10:26 am

I have coded two activities.

i.e
Activity A ---> Activity B
My flow is like that

but when i m on activity B and press my home button.
and again open the app.my app shows Activity B but i want it should start from Activity A
Since it is my Entry Point.i think when i m clicking my home button my activity is running in background.
so how to kill it when i click home button.
plz help
thnx in advance. :)
vipulshah2010
Junior Developer
Junior Developer
 
Posts: 14
Joined: Tue Feb 09, 2010 7:50 am
Location: India

Top

Re: Activity Issue

Postby pmws » Wed Mar 10, 2010 11:24 am

vipulshah2010 wrote:I have coded two activities.

i.e
Activity A ---> Activity B
My flow is like that

but when i m on activity B and press my home button.
and again open the app.my app shows Activity B but i want it should start from Activity A
Since it is my Entry Point.i think when i m clicking my home button my activity is running in background.
so how to kill it when i click home button.
plz help
thnx in advance. :)


Try calling finish on onStop in your Activity B;
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. @Override
  2. public void onStop() {
  3. super.onStop();
  4. finish();
  5. }
Parsed in 0.029 seconds, using GeSHi 1.0.8.4
pmws
Developer
Developer
 
Posts: 37
Joined: Thu Sep 24, 2009 12:23 pm

Postby pranav09 » Fri Mar 12, 2010 2:03 pm

Hi vipulshah2010,

I tried to call B activity from A activity and it was working fine. I couldn't got any problem. I have two activities named FirstActivity.java & SecondActivity.java

This is my code which i have used.

..
...
Intent i = new Intent(FirstActivity.this, SecondActivity.class);
startActivity(i);
...
..
Actually, i have one button on FirstActivity.java and it's call the SecondActivity using above code. And when i press home key of the emulator and again start the application, it's start FirstActivity.

Enjoy......
User avatar
pranav09
Senior Developer
Senior Developer
 
Posts: 128
Joined: Mon Jan 19, 2009 12:01 pm
Location: Ahmedabad, India

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 10 guests