dans la première activité j'ai deux bouton radio et bouton et je veux quand l'un d'eux et appuyez sur le bouton intention de deuxième activité et et montrer toast auto mon code est ci-dessous et mon application force fermervérifier radioButton sélectionné de la deuxième activité
première activité
@Override
public void onClick(View view) {
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radioGroup2);
int selection = radioGroup.getCheckedRadioButtonId();
if (selection==R.id.rb4) {
Intent intent = new Intent(getApplicationContext(),MyActivity2.class);
intent.putExtra("art","0") ;
startActivity(intent);
}
else if (selection==R.id.rb5) {
Intent i = new Intent(getApplicationContext(),MyActivity2.class);
i.putExtra("sport","1") ;
startActivity(i);
}
}
});
deuxième activité
String value = getIntent().getExtras().getString("art");
String value2 = getIntent().getExtras().getString("sport");
if (value.equals("0")){
Toast.makeText(getApplicationContext(), "this is my Toast message1)",
Toast.LENGTH_LONG).show();
}
else if (value2.equals("1")){
Toast.makeText(getApplicationContext(), "this is my Toast message2)",
Toast.LENGTH_LONG).show();
}
pouvez-vous publier votre journal des erreurs –
3-31 06: 28: 31.190: ERREUR/PGA (520): PgaSocketWriteAllHdipc: hd_ipc_send() échoué – chy