=+public void onActivityResult(int requestCode, int resultCode, Intent data) //---check if the request code is 1--- if (requestCode

Question:

=+public void onActivityResult(int requestCode, int resultCode, Intent data)

//---check if the request code is 1---

if (requestCode == 1) {

//---if the result is OK---

if (resultCode == RESULT_OK) {

//---get the result using getIntExtra()---

Toast.makeText(this, Integer.toString(

data.getIntExtra("age3", 0)), Toast.LENGTH_SHORT).show();

//---get the result using getData()---

Toast.makeText(this, data.getData().toString(), Toast.LENGTH_SHORT).show();

}

}

}

}

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Beginning Android Programming With Android Studio

ISBN: 9781118707425

4th Edition

Authors: Wei Meng Lee, Jerome F DiMarzio

Question Posted: