Android onNewIntent Uri jest zawsze zerowy
W mojej działalności metoda onNewIntent (),getIntent().getData();
jest zawsze zerowy. To zdecydowanie idzie do tej metody przed pójściemonCreate()
lub dowolna inna funkcja cyklu życia. Wraca tutaj z przeglądarki, nie wiem dlaczegogetIntent().getData()
ma jednak wartość null.
ta aktywność uruchamia taką przeglądarkęcontext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(requestToken.getAuthenticationURL())));
i wraca tutaj
@Override
public void onNewIntent(Intent intent){
super.onNewIntent(intent);
Uri uri = getIntent().getData();
if (uri != null && uri.toString().startsWith(TwitterConstants.CALLBACK_URL)) {...}
}
ale uri jest zawsze zerowy.
rzeczy manifestujące:
<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";
czego tu brakuje? dzięki