Note that there are some explanatory texts on larger screens.

plurals
  1. POMainActivity does not receive result from StartActivityForResult
    primarykey
    data
    text
    <p>I have the following common problem, easy, yet I don't know what more I can do. I have the MainActivity that starts for result AnotherActivity.</p> <p>In the <code>MainActivity</code> I have (extends <code>Activity</code>):</p> <pre><code>Intent i = new Intent(MainActivity.this, Altele.class); startActivityForResult(i, 0); ... @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Toast something; //toast NOT showing webview.loadUrl(data.getStringExtra("adresa")); } </code></pre> <p>In the <code>AnotherActivity</code> I have (extends <code>ListActivity</code>):</p> <pre><code>@Override protected void onListItemClick(ListView l, View v, int position, long id) { Toast something; //toast showing Intent intentMessage = new Intent(); intentMessage.putExtra("adresa", something); setResult(RESULT_OK, intentMessage); finish(); } </code></pre> <p>Now, whatever I do, the data from <code>AnotherActivity</code> doesn't seem to reach the <code>MainActivity</code>. In this sample here, I skipped on purpose the <code>requestCode</code> and <code>resultCode</code> since it's the same thing. So what I have here, is basically all over the internet, but to me it doesn't work. Any ideas?</p> <p>Source code: <a href="http://www3.zippyshare.com/v/13090519/file.html" rel="nofollow">http://www3.zippyshare.com/v/13090519/file.html</a></p> <p><strong>UPDATE</strong> i've noticed a thing. if i start my second activity for result as soon as the application starts, it's onActivityResult in the main activity gets triggered. if i wait 2 seconds after application's start or try again running the second activity for result, nothing happens anymore.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload