redirect to a new screen from browser
I am using epi twitter to show tweets in my application. My first activity has a login button. If I click the login button it opens the browser and then I login and it again redirects back to my application. what I want to do is to start a new activity i.e open up a new screen and display the tweets as soon as the browser redirects , but I hav开发者_JAVA百科e to click on the login button again to go to the next screen. I used on resume function but it dint help.
Why not start your second activity immediately from the click of your login button with an extra set in the intent to indicate a login is required. In your second activity , if the"login" extra is set in the intent then launch the browser immediately. When the browser returns, your second activity will be the one displayed.
Got it!! needed to edit the manifest with two things
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
and
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="login"/>
精彩评论