Friday, March 28, 2014

Jump to another Activity Intent error


Java:
 
Button mybutton = (Button) findViewById (R.id.buttonPage1);
mybutton.setOnClickListener (new OnClickListener () {
@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
Intent intent = new Intent ();
intent.setClass (MainActivity.this, SecondActivity.class);
startActivity (intent);
}
});

Style:
 
android: id = "@ + id/textViewPage1"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "This is Home" />

Other documents:
SecondActivity.java
activity_second.xml

Situations arise:
Each time you click MainActivity the Button (Go to the second page) button, the program always wrong exit.
Error message as follows:


Is that why? New learning Android development, thank you.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
SecondActivity.java to declare what the Manifest inside.
  

Reply:
On the second floor right. .
Reply:
cited a floor tantahe reply:
SecondActivity.java to declare what the Manifest inside.
  

Thank you. From. NET C # platform to turn the children can not afford to hurt the paper. . . Java and skip directly to Android. . . Great God seeking contact, there is a problem at any time to ask. . .
Reply:
reference to the third floor Yalehorance reply:
Quote: references to a floor tantahe reply:

SecondActivity.java to declare what the Manifest inside.
  

Thank you. From. NET C # platform to turn the children can not afford to hurt the paper. . . Java and skip directly to Android. . . Great God seeking contact, there is a problem at any time to ask. . .

Java still have to be familiar with it, does not take much time, do not be too concerned about the details first.
There are questions which ask it directly, where a lot of the great God.

No comments:

Post a Comment