Android : App is opened in browser when coming back from Twitter login page (login page is displayed in browser)

删除回忆录丶 提交于 2019-12-21 21:49:00

问题


I have integrated Twitter into android app. User is displayed login screen for Twitter in browser. When user is done with login, flow should return back to app.

So here actually after login, app's screen is displayed. But when I put all apps in background by pressing home button and then check all opened apps (by long pressing home button) it shows my app and browser as shown below. Browser app has my app screen.i.e. flow is not returned back to my app, rather app is opened in browser.

This is causing issues because when Twitter login is completed, I have to redirect user to another screen for certain reason. Here, user is redirected to other screen, but user is seeing app in browser. If he opens app(actual app, not browser) then he will see older screen and this is a strange behavior of app in user's perspective because he sees 2 different screen s at the same time.

Manifest with activity which should be called when coming back from Twitter login page :

<activity
    android:name="com.company.app.activities.MyActivity"
    android:screenOrientation="portrait"
    android:windowSoftInputMode="adjustPan" >
    <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="MyApp"
            android:scheme="app" />
    </intent-filter>
</activity>

来源:https://stackoverflow.com/questions/24204855/android-app-is-opened-in-browser-when-coming-back-from-twitter-login-page-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!