Well my problem now is that I am trying to start the SubActivity on the
button click, but when I run it in the emulator, it does not Launch the
SubActivity, and I can't figure out why. Here is all of my code:
public class MainMenu extends Activity {
/** Called when the activity is first created. */
Button guidebtn = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main); //xml file that has the layout needed
guidebtn = (Button) findViewById(R.id.guide); //find the button from
the xml layout
}
public class guide extends Activity {
public Button onClick(View guide){
startActivity(new Intent(this, SubActivity.class));
return guidebtn;
};
}
}
What am I missing?
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Mark Murphy
Sent: Tuesday, August 11, 2009 5:41 PM
To: [email protected]
Subject: [android-beginners] Re: Two questions
tinyang wrote:
> 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;
> };
> }
Well, the startActivity() statement seems OK.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Need help for your Android OSS project? 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/11/2009
6:27 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
-~----------~----~----~----~------~----~------~--~---