I have the an intent filter defined in the manifest file for one of my activities. When I am trying to start this activity from the adb shell, using the following command :
$ adb shell am start
-W -a android.intent.action.VIEW
-d "example://gizmos" com.example.android
I am getting the following error :
Starting: Intent { act=android.intent.action.VIEW dat=http://www.example.com/gizmos pkg=com.example.android }
Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=http://www.example.com/gizmos flg=0x10000000 pkg=com.example.android }
Please help.
Here is the manifest entry :
<activity
android:name="com.example.android.activity.ExampleActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" >
<intent-filter android:label="Search" >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos” -->
<data
android:host="gizmos"
android:scheme="example" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data
android:host="www.example.com"
android:pathPrefix="gizmos"
android:scheme="http" />
</intent-filter>
</activity>
Edit Your AndroidManifest.xml as follow:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos” -->
<data
android:host="gizmos"
android:scheme="example" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data
android:host="www.example.com"
android:pathPrefix="gizmos"
android:scheme="http" />
</intent-filter>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With