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);

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.

Ritu Singh
Posts: 3
Joined: Tue Dec 22, 2009 9:52 am


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.
User avatar
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.
Experienced Developer
Experienced Developer
Posts: 77
Joined: Sat Nov 21, 2009 1:21 pm


Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 8 guests