getIntent.getData() returns null
<p>I'm new to Android.</p>

<p>Right now, I am very frustrated with a problem.</p>

<p>I have an activity where its <code>launchMode</code> is set as <code>singleInstance</code>. In this activity, I have a <code>WebView</code> where I want to load url's according to how I am accessing it (i.e. from another application, from within the same application). In doing so, I'm relying on my intents and their data.</p>

<p>Here's some excerpts of my activity's code.</p>

<pre><code>@Override
public void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    setIntent(intent);
    Log.d(TAG, "onNewIntent: " + intent.toString());

    Uri uri = getIntent().getData();
    if(uri != null) {
        Log.d(TAG, "uri: " + uri.toString());
        if (uri.toString().contains("ok")) {
            Log.d(TAG, "uri contains ok");
        }
    }
}

protected void onResume() {
    super.onResume();
    Log.d(TAG, "onResume intent: " + getIntent().toString());

    if(getIntent()!=null) {
        Uri uri = getIntent().getData();

        if(uri != null &amp;&amp; order == null) {
            Log.d(TAG, "uri: " + uri.toString());
            if (uri.toString().contains("ok")) {
                web.loadUrl("my_order_success");
            } else {
                web.loadUrl("my_order_cancel");
                finish();
            }
        } else {
            Log.d(TAG, "no uri");
            if(getIntent().hasExtra("orderInfo")) {
                order = getIntent().getParcelableExtra("orderInfo");
                Log.d(TAG, "order: " + order.toString());
            }
           web.loadUrl("my default loading page");
        }
    } 
    ...
}
</code></pre>

<p>I was frustrated with in my <code>onResume</code> where the log would show me "no uri". This, as I understand it, means that the intent that this activity is running on has no data field being passed with the intent. However, from the log in <code>onNewIntent</code>, I get the message "uri contains ok" which, as I understand it, means that intent HAS data.</p>

<p>Here's my log:</p>

<pre><code>01-11 16:25:30.081 8584-8584/com.bringit.bringitrecyclerviewtest D/KakaoPayActivity: onNewIntent: Intent { act=android.intent.action.VIEW dat=bringit_kakao://ok flg=0x10400000 cmp=com.bringit.bringitrecyclerviewtest/.KakaoPayActivity }
01-11 16:25:30.081 8584-8584/com.bringit.bringitrecyclerviewtest D/KakaoPayActivity: uri: bringit_kakao://ok
01-11 16:25:30.081 8584-8584/com.bringit.bringitrecyclerviewtest D/KakaoPayActivity: uri contains ok
01-11 16:25:30.171 8584-8584/com.bringit.bringitrecyclerviewtest D/KakaoPayActivity: onResume intent: Intent { act=android.intent.action.VIEW dat=bringit_kakao://ok flg=0x10400000 cmp=com.bringit.bringitrecyclerviewtest/.KakaoPayActivity }
01-11 16:25:30.171 8584-8584/com.bringit.bringitrecyclerviewtest D/KakaoPayActivity: no uri
</code></pre>

<p>How would this be possible? Does the intent that's being set to the activity via <code>setIntent</code> not carry through to <code>onResume</code>? I mean both in <code>onNewIntent</code> and <code>onResume</code>, I call <code>getIntent().getData()</code> but they show different results.</p>

<p>What would be a viable solution to resolve this issue? Thanks in advance.</p>