abir-cse
abir-cse

Reputation: 546

Loading external web links from other app to my Browser

I have built an Android Browser where I want to load external web links from other apps. Here I have added this code on AndroidManifest.xml . So when I am open http/https link from other app, it's showing my app in the browser list.

<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="http" />
            <data android:scheme="https" />
        </intent-filter>

Now, by which key name I will get that data into my browser ??? Suppose, if I send a web link which key is "url", then I load that url by this way,

    Intent intent = getIntent();
    String url = intent.getStringExtra("url");

    if(url!=null) {
        Intent i = new Intent(Intent.ACTION_VIEW);
        i.setData(Uri.parse(url));
        startActivity(i);
        finish();
    }

I do not know by which key name other app is send data to open with external browser. How can I solve this ?

Upvotes: 0

Views: 190

Answers (1)

JEGADEESAN S
JEGADEESAN S

Reputation: 618

http://www.vogella.com/tutorials/AndroidIntent/article.html

Refer the link. In this, they explained how to use explict intent for make communication between two application. Also their example perfectly satisfy your need.

Upvotes: 1

Related Questions