Jump to content
Android Forum - A Community For Android Users and Enthusiasts

Crashing without any reason


stevedc
 Share

Recommended Posts

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);
}
}

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...