I 2 as
ActivityMain Activity:
package intent.Activity;
import intent.Activity.R;
import intent.demo.Activity1;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class MainActivity1Activity extends Activity {
/ ** Called when the activity is first created. * /
@ Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
final Button bat = (Button) findViewById (R.id.bt1);
bat.setOnClickListener (new OnClickListener ()
{
public void onClick (View arg0)
{
Intent i0 = new Intent ();
i0.setClass (MainActivity1Activity.this, Activity1.class);
startActivity (i0);
}
});
}
}
Jump Activity:
package intent.demo;
import android.app.Activity;
import android.os.Bundle;
import intent.Activity.R;
public class Activity1 extends Activity {
@ Override
protected void onCreate (Bundle savedInstanceState) {
/ / TODO Auto-generated method stub
super.onCreate (savedInstanceState);
setContentView (R.layout.main1);
}
}
AndroidManifest.XM file already registered Activity1, the relevant line is as follows
When running the program: The first page can be normal, but click the jump button when he appeared abnormal termination, which is why?
Know to help solve this, thank you!!
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
activity1 registration did not write startup mode
Reply:
To see what is reported abnormal?
Reply:
The error message is posted out,
Reply:
What's wrong facie reported not to know
Reply:
Error is The application MainActivity1 has stopped unexpectedly.please try again
Reply:
You should all stick out the wrong word is hard to see
Reply:
The application has stopped unexpectedly.please try MainActivity1
Reply:
startActivity (i0); modified to MainActivity1Activity.this.startActivity (i0)
Reply:
Activity will need to configure two
Reply:
Floor positive solutions:
Reply:
Reply:
No comments:
Post a Comment