how to move from one activity to other using intent class

Put your problem here if it does not fit any of the other categories.

how to move from one activity to other using intent class

Postby ritusingh1 » Tue Dec 22, 2009 10:01 am

Hi frens,

Can anyone please tell me that how to move from one activity to other?
i have used the following code but it is not working.

Intent i = new Intent(this,submainactivity.class);
startActivity(i);
finish();

using this code i want to move to other activity ie submainactivity.
but this code is not working .
as i am a newbie in android can anyone please help me out.

thanx-
Ritu Singh
ritusingh1
Freshman
Freshman
 
Posts: 3
Joined: Tue Dec 22, 2009 9:52 am

Top

Postby achie1266 » Tue Dec 22, 2009 6:53 pm

Can you show the error trace here. Try using logcat to debug and post the relevant error message here.
Can you also use code highlighting feature on the posts to distinguish code from discussion.
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Postby Droid123 » Wed Dec 23, 2009 12:28 am

Yeah, what achie said...

Your code to launch another activity is valid, that's all there is to it (although I'm not sure if finish() gets called..)

You most likely forgot to add your subactivity to the manifest.
Droid123
Experienced Developer
Experienced Developer
 
Posts: 77
Joined: Sat Nov 21, 2009 1:21 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 15 guests