Ravi Rao
Ravi Rao

Reputation: 401

In Android, Opening http links within the application using webview inside tabs

I wanted to handle the link inside the existing tabview in my android application. For example, say I'm having 3 tabs and currently I'm on tab 3 which displays a list containing few links. On click on those links, I want to open a webview inside tab 3 itself with the clicked url.

I've already tried configuring

<intent-filter>
    <category android:name="android.intent.category.DEFAULT" />
    <action android:name="android.intent.action.VIEW" />
    <data android:scheme="com.package.name" />  
</intent-filter>

and then changing the url to

com.package.name://actual_http_url

In this scenario, what happens is the activity which is configured with the above specific intent-filter gets created and starts, but above the existing activity, not within the tab. Any ideas? Is there any simpler way of implementing this?

Upvotes: 0

Views: 726

Answers (1)

Cephron
Cephron

Reputation: 1587

If my experience with this has been any indicator, it is actually surprisingly complicated; I don't believe there's any way to do this without using an ActivityGroup in the tab.

Check out this link: http://ericharlow.blogspot.com/2010/09/experience-multiple-android-activities.html This tutorial was of huge help to me when I was trying to do something similar.

Edit: also, here's a more generalized version of your question. In the end, it points to the same tutorial, but you can see someone else's attempts as they went along: How to manage multiples activities under a single tab of TabActivity

Upvotes: 1

Related Questions