Witajcie,
jak przekazać wartość typu View (button) ,co na razie udało mi się w warunku If
if (isAllAnswered) {
boolean isGoodAnswer = checkAnswers();
Toast.makeText(getApplicationContext(), "isGoodAnswer value is: " + isGoodAnswer, Toast.LENGTH_SHORT).show();
if (isGoodAnswer) {
intent.putExtra("KEY_ANSWER", "Good Answer");
intent.putExtra("KEY_BUTTON", mapButton.getId()); //Ta linia kodu
}
do tej klasy
public class AnswerActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_answer);
TextView textViewDisplayResult = (TextView) findViewById(R.id.text_view_display_result);
String answer = "";
Bundle bundle = getIntent().getExtras();
if (bundle != null) {
if (bundle.containsKey("KEY_ANSWER"))
answer = bundle.getString("KEY_ANSWER");
int mapButton = bundle.getInt("KEY_BUTTON"); // Coś tu kombinuje ale nie wychodzi
Chce uzyskać taki efekt (załącznik).