-1

First, the English writing skills are lacking.

  1. Use Device: galaxy note2 (android 4.4.2)
  2. Problems

    • A Activity -> Intent -> B Activity
    • B Activity -> Return Intent -> A Activity not Call onActivityResult
    • Come to debugging, The 'onPause' of A Activity and 'onResume' of A Activity is run before B Activity switch.
    • So be 'onActivityResult' is first run is not getting the 'onActivityResult' behavior.
  3. In normal operation, but it 'nexus 5(android 5.1.1)'

Youngki Kim
  • 21
  • 1
  • 5

2 Answers2

1

You should setResult(int resultCode, Intent data).

documentation

Tin Megali
  • 771
  • 5
  • 25
0
 Intent intent = new Intent(A.this , B.class);
 setResult(Activity.RESULT_OK, intent);

In onActivityResult

 public void onActivityResult(int requestCode, int resultCode, Intent data) {
 if (resultCode == 0) 
    //do here anything
 }

Read this Example

Neeraj Kumar
  • 3,851
  • 2
  • 19
  • 41