O Android onNewIntent Uri é sempre nulo
No método onNewIntent () da minha atividade,getIntent().getData();
é sempre nulo. Definitivamente vai para este método antes de ir paraonCreate()
ou qualquer outra função do ciclo de vida. Ele retorna aqui de um navegador, não sei porquegetIntent().getData()
é nulo embora.
esta atividade inicia o navegador como estecontext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(requestToken.getAuthenticationURL())));
e retorna aqui
@Override
public void onNewIntent(Intent intent){
super.onNewIntent(intent);
Uri uri = getIntent().getData();
if (uri != null && uri.toString().startsWith(TwitterConstants.CALLBACK_URL)) {...}
}
mas uri é sempre nulo.
manifestar coisas:
<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";
O que estou perdendo aqui? obrigado