stevedc Posted February 24, 2012 Share Posted February 24, 2012 Hello there, I have A problem, I am trying to write A game for android, and I started to write it step by step. And now I want to go to my menu but the app always crashes after I showed my logo. This is my base code package com.technopolis.app; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.TextView; public class TechnopolisAppActivity extends Activity{ /** Called when the activity is first created. */ //@Override public static DataClass data=new DataClass(); public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void dutchclick(View view) throws InterruptedException { ImageView logo=new ImageView(this); logo.setImageResource(R.drawable.logo); logo.setBackgroundColor(Color.WHITE); setContentView(logo); int lang=1; TechnopolisAppActivity.data.setlang(lang); int count=0; while(count!=60000) { count++; } count=0; while(count!=60000) { count++; } Intent intent=new Intent(this,MenuActivity.class); this.startActivity(intent); } And this is the MenuActivity where it need to go package com.technopolis.app; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class MenuActivity extends Activity { //@Override public static DataClass data=new DataClass(); public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.menu); int lang=0; lang=MenuActivity.data.getlang(); TextView tv = new TextView(this); tv.setText(lang); setContentView(tv); } } Quote Link to comment Share on other sites More sharing options...
tliebeck Posted March 2, 2012 Share Posted March 2, 2012 You'll want to get a logcat from the phone/emulator you're using to test. It will eshow you a stack trace for the exception. Just run "adb logcat" from a console. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.