[TinyTut] - Open other Activities with an Intent

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

[TinyTut] - Open other Activities with an Intent

Postby plusminus » Fri Nov 23, 2007 8:46 am

[TinyTut] - Open other Activities with an Intent


What you learn: You will learn how easy it is, to start other Activity you coded on your won using Intents.

Difficulty: 0 of 5 :roll:

Description
The following Code sends an Intent to the OS, which will start the Activity, whos class was passed as the first parameter of the Intent:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. startSubActivity(new Intent(this, MySecondActivity.class), 0);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby derek_lan » Fri Dec 28, 2007 6:35 am

tks for your infom
derek_lan
Freshman
Freshman
 
Posts: 8
Joined: Tue Dec 25, 2007 10:31 am

Postby blundell » Tue Nov 18, 2008 2:31 pm

1.0 update to this?

Code: Select all
startActivity(new Intent(this, MySecondActivity.class));
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Postby MrSnowflake » Tue Nov 18, 2008 3:19 pm

Actually an updated version of his code would be:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. startActivityForResult(intent, 0);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Last edited by MrSnowflake on Sun Mar 15, 2009 8:02 pm, edited 1 time in total.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby Arrrnold » Sun Mar 15, 2009 8:00 pm

blundell wrote:1.0 update to this?

Code: Select all
startActivity(new Intent(this, MySecondActivity.class));


My code:
Code: Select all
startActivityForResult(new Intent(CurrentActivity.this,MySecondActivity.class), 0);
Arrrnold
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Mar 15, 2009 7:53 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 6 guests