1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| package com.example.dell.achahada;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import com.association_achahada.dell.association_achahada.R;
public class MainActivity extends Activity {
ImageButton restaurant;
private Bundle savedInstanceState;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
addButtonListener();
}
private void addButtonListener() {
// TODO Auto-generated method stub
//----------- Speak button ------------
restaurant = (ImageButton) findViewById(R.id.restaurant);
restaurant.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent e = new Intent("restaurant");
startActivity(e);
}
});
}
} |
Partager