2014-02-17 42 views
5

您好我正在開發android應用程序,我使用twitter登錄。我正在使用twitter4j-3.0.5 lib進行twitter身份驗證。所以我的場景是這樣的,登錄成功後它回到我的應用程序,但在後臺它不關閉瀏覽器窗口。當我用twitter窗口點擊我的瀏覽器時仍然存在。微博登錄後關閉瀏覽器窗口android與twitter4J

我的代碼如下所示:

Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(requestToken.getAuthenticationURL())); 
     startActivity(intent); 

<activity 
    android:name="com.example.twitterapp.TwitterWebActivity" 
    android:label="@string/title_activity_twitter_web" > 
    <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:host="com.example.twitterapp" 
     android:scheme="oauth" /> 
    </intent-filter> 
</activity> 

我想關閉Web瀏覽器。有沒有人可以幫助我?需要幫忙。比你。

+0

你找到了解決方案嗎? –

回答

0

add this:
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);開始Activity之前。

+0

謝謝你的迴應會嘗試這個,讓你知道是否有用。 – nilkash

+0

沒有爲我工作 – Analizer