Christopher Walker wrote:
> I am new to android development. To introduce myself to android
> development, I am writing a simple game involving vikings.In this
> game, I presently have to activities: one entitled "Vikings" for the
> menu and one entitled "Campaign" for the game itself. The menu is
> rather basic; it includes a button for quitting and a button for
> beginning the game. As part of the code for newGame's onClick() event,
> there is a call to the Campaign activity. Here is the code (Note that
> NEW_GAME is defined in the Vikings class):
>
> public void onClick(View v) {
> /** TODO
> * Call Campaign activity. */
> Intent i = new Intent(Vikings.this, Campaign.class);
> startActivityForResult(i, NEW_GAME);
> }
>
> I assume this should lead into the constructor for the Campaign class,
> which so far looks like this:
>
> @Override
> public void onCreate(Bundle savedInstanceState) {
> /** TODO */
> super.onCreate(savedInstanceState);
> setContentView(R.layout.campaign);
> }
>
> As far as I can tell, there should be nothing wrong with this code;
> however, I get a crash whenever I try the program on either a physical
> device or the emulator.
You will want to examine your Java stack trace, using adb logcat, DDMS,
or the DDMS perspective in Eclipse, to figure out where your crash is
and its cause.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Android Training in US: 14-18 June 2010: http://bignerdranch.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en