Thanks Mark. So is this similar to how I should start my subActivity?
public class guide extends Activity {
public Button onClick(View guide){
startActivity(new Intent(this, SubActivity.class));
return guidebtn;
};
}
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Mark Murphy
Sent: Tuesday, August 11, 2009 4:47 PM
To: [email protected]
Subject: [android-beginners] Re: Two questions
tinyang wrote:
> This will sound like a dumb question, but what is the return type for
> Button?
Button is a class. Classes do not have return types, methods do.
> But what is the correct intent to have for a sub-activity when you
> want it to launch on a specific event (such as onClick)?:
>
> <intent-filter>
>
> <category android:name=/"android.intent.category.LAUNCHER"/ />
>
> </intent-filter>
Generally, you do not need an IntentFilter for that situation. Just
reference the class directly when building the Intent you pass to
startActivity():
startActivity(new Intent(this, MyNextActivity.class));
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Need Android talent? Ask on HADO! http://wiki.andmob.org/hado
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.13.49/2293 - Release Date: 8/10/2009
6:19 PM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---