You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
926 B
31 lines
926 B
package htdinc.howtodrink;
|
|
|
|
import android.content.Context;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.widget.Button;
|
|
import android.widget.Toast;
|
|
|
|
public class MainActivity extends AppCompatActivity {
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_main);
|
|
|
|
final Button bouton = (Button) findViewById(R.id.button);
|
|
bouton.setOnClickListener(new View.OnClickListener(){
|
|
public void onClick(View v)
|
|
{
|
|
Context context = getApplicationContext();
|
|
CharSequence text = "Ceci est un boutton bite !";
|
|
int duration = Toast.LENGTH_SHORT;
|
|
|
|
Toast.makeText(context,text,duration).show();
|
|
|
|
}
|
|
});
|
|
}
|
|
}
|