Created
November 30, 2013 11:41
-
-
Save triskell/7718008 to your computer and use it in GitHub Desktop.
Helloworld activity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onStart(){ | |
super.onStart(); | |
Button b = (Button)findViewById(R.id.buttonHello); | |
b.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
String name = ((EditText)findViewById(R.id.etNom)).getText().toString(); | |
Toast.makeText(view.getContext(), "Hello world from " + name + " !", Toast.LENGTH_LONG) | |
.show(); | |
Intent helloIntent = new Intent("hwb.helloworldbis.HELLO"); | |
helloIntent.putExtra("name", name); | |
startActivity(helloIntent); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment