Shan
Shan

Reputation: 2832

Clicking on Back button leads to my app's homescreen

I have an application (TextOnly Browser) that enables a user to read any url in textonly mode (For e.g if we click on a url from Facebook) it will open the url in TextOnly app and when I click on back button it goes back to Facebook

The back button works with all apps except twitter when I click on a tweet the below image will be displayed.There are 3 links in the screen

a) If I click on the first link and then click on back button from app it goes to my app instead of "Twitter" app b) If I click on the Second and third links and then click on back button from app it goes to twitter app

My question is why a) happens and that too it happens only for Twitter

enter image description here

    <activity android:name=".Details2"  android:noHistory="true" android:label="TextOnly">
            <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="http"/> 
            <data android:scheme="https"/>
            </intent-filter>

Upvotes: 0

Views: 105

Answers (1)

GovindRathod
GovindRathod

Reputation: 887

if you take a webview for your browser then you should override your back key as describe

@Override
    public void onBackPressed() {
        if(myWebView.canGoBack() == true){
            myWebView.goBack();
        }else{
            super.onBackPressed();
        }
    }

hope it'll works.

Upvotes: 1

Related Questions