In my activity's onNewIntent() method, getIntent().getData();
is always null. It definitely goes to this method before going to onCreate()
or any other lifecycle function. It returns here from a browser, I don't know why getIntent().getData()
is null though.
this activity starts the browser like this context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(requestToken.getAuthenticationURL())));
and returns here
@Override
public void onNewIntent(Intent intent){
super.onNewIntent(intent);
Uri uri = getIntent().getData();
if (uri != null && uri.toString().startsWith(TwitterConstants.CALLBACK_URL)) {...}
}
but uri is always null.
manifest stuff:
<activity
android:name="myapp.mypackage.TweetFormActivity"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="oauth" android:host="myapp"/>
</intent-filter>
</activity>
static final String CALLBACK_URL = "oauth://myapp";
what am I missing here? thanks