How to call back (like onActivityResult) after launching activity from browser by clicking url?

Posted by kimilhee on Stack Overflow See other posts from Stack Overflow or by kimilhee
Published on 2011-01-12T05:18:37Z Indexed on 2011/01/12 5:54 UTC
Read the original article Hit count: 147

I succeded to call activity from browser link with tag like this.

<a href="myapp://launch.myapp.com/activity2?var1=linkClicked">my app</a>

of cource I added actvity setting in AndroidManifest.xml like this.

<activity android:name=".Activity2" >
   <intent-filter>
    <action android:name="android.intent.action.VIEW"></action>
    <category android:name="android.intent.category.DEFAULT"></category>
    <category android:name="android.intent.category.BROWSABLE"></category>
         <data android:host="launch.myapp.com" android:scheme="myapp"
         android:pathPrefix="/activity2"></data>
   </intent-filter>
</activity>

I want to call back from the activity2 with a value.

Is there any way to receive some value from the activity that was launched by the browser like above?

In other words I want do something like onActivityResult in the browser and get a value from the activity and set the value on the web page which has launched the activity.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about android