Code:package projet.isetn.com.robotandoird; import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.Toast; public class MainActivity extends AppCompatActivity { ImageButton haut; ImageButton bas; ImageButton droite; ImageButton gauche; Button temperature; Button gaz; Button lum; ImageButton micro; ImageButton camera; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); haut =(ImageButton)findViewById(R.id.haut); haut.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Faire avancer le Robot", Toast.LENGTH_LONG).show(); } }); bas =(ImageButton)findViewById(R.id.bas); bas.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Faire reculer le Robot", Toast.LENGTH_LONG).show(); } }); droite =(ImageButton)findViewById(R.id.droite); droite.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Faire tourner le Robot a droite", Toast.LENGTH_LONG).show(); } }); gauche =(ImageButton)findViewById(R.id.gauche); gauche.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Faire Tourner Le Robot a gauche", Toast.LENGTH_LONG).show(); } }); temperature =(Button)findViewById(R.id.temperature); temperature.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "La Temperature est: ", Toast.LENGTH_LONG).show(); } }); gaz =(Button)findViewById(R.id.gaz); gaz.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Le Niveau De GAZ est: ", Toast.LENGTH_LONG).show(); } }); lum =(Button)findViewById(R.id.lum); lum.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Allumer La lumière", Toast.LENGTH_LONG).show(); } }); micro =(ImageButton)findViewById(R.id.micro); micro.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Activer Le Microphone", Toast.LENGTH_LONG).show(); } }); camera =(ImageButton)findViewById(R.id.camera); camera.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Activer La Camera", Toast.LENGTH_LONG).show(); } }); } /*public void buttonOnClick(View v) { ImageButton button=(Button) v; ((Button) v).setText("/"); } */ }
-----