내 활동의 onNewIntent() 메소드에서 getIntent().getData();
은 항상 null입니다. onCreate()
또는 다른 라이프 사이클 기능을 사용하기 전에이 방법으로 이동합니다. 그것은 브라우저에서 여기에 반환, 왜 getIntent().getData()
null입니다 모르겠다.Android onNewIntent Uri는 항상 null입니다.
이 활동이 context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(requestToken.getAuthenticationURL())));
같은 브라우저를 시작하고 여기에
@Override
public void onNewIntent(Intent intent){
super.onNewIntent(intent);
Uri uri = getIntent().getData();
if (uri != null && uri.toString().startsWith(TwitterConstants.CALLBACK_URL)) {...}
}
을 반환하지만 URI는 항상 null입니다.
매니페스트 재료 : 내가 여기에 무엇을
<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";
를 놓친 거지? thanks
hm, http : // androidforums.com/introduction/218621-twitter4j-oauth-android-simple.html' 그들은 setIntent를 호출하지 않습니다. – CQM
그래, 그들은 getIntent가 아닌 intent 인수를 사용합니다.) 방법. – Michael
나는 그것을 간과했다! 고마워, 나는 이것에 많은 시간을 보냈다! – CQM