Sunday, 15 January 2012

android - Open existing or new activity from browser -



android - Open existing or new activity from browser -

i trying implement intent filter reason (unknown me) can succeed.

i declared activity in next way:

<activity android:name="com.example.startactivity" android:label="@string/start_activity_title" android:windowsoftinputmode="adjustpan" android:exported="true"> <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="myapp" android:host="terms-signed.com" android:pathprefix="/?"/> </intent-filter> </activity>

the browser tries open uris myapp://terms-signed.com/?documentkey=some-hex

no matter if set such uri in browser address field or if tap on similar link in html page, nil happens.

there no chooser shown, app not become foremost, android not launch app if it's not running. nothing. browser shows page message webpage @ address might temporarily downwards etc.

i using android 4.2.1 / galaxy nexus.

what can done create work?

remove ? pathprefix, not part of path. maybe can remove whole pathprefix parameter, don't have path after host.

edit2: can seen in comments, additionally removing hyphen , .com host declaration resolved issue. best guess browser treat uri web uri because of .com, regardless if using custom scheme.

android android-intent url-scheme

No comments:

Post a Comment