3

Can anyone tell me the difference between startActivity and startActivityForResult?

Is startActivity used to call Activity asynchronously and startActivityForResult for a synchronous call?

Are startActivity(intent) and startActivityForResult(intent,-1) same?

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
Hunt
  • 8,215
  • 28
  • 116
  • 256

3 Answers3

11

Both startActvity() and startActivityForResult() are ASYNCHRONOUS.

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
Rogério Limas
  • 111
  • 2
  • 4
10

There is no startSubActivity() in Android. It was replaced a long time ago by startActivityForResult().

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
2
  1. There is no startSubActivity() in Android. It was replaced a long time ago by startActivityForResult().
  2. The difference between them is that:
    startActivityForResult() starts an activity and expects something in return; startActivity() just starts an activity without worrying about getting any result.
  3. No. Both startActvity() and startActivityForResult() are ASYNCHRONOUS.
  4. Yes. startActivity(intent) and startActivityForResult(intent,-1) do the same.
naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259