View RSS Feed

Android Developer

  1. Starting an Android Activity for a Result

    by , 02-11-2012 at 09:56 AM
    Start the activity using startActivityForResult() when you want to get a result from the activity. Implement the onActivityResult() method to get the result from activity. In this method, subsequent activity will return result in Intent.

    In below code, we want to pick the contact.

    Java Code: This is the code to start an activity for a result
    private void pickContact() {
        // Create an intent to "pick" a contact, as defined by the content provider URI
        Intent intent = new Intent(Intent.ACTION_PICK,
    ...