Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error starting an activity

Tags:

deep-linking

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>
like image 748
user2331595 Avatar asked Mar 06 '14 09:03

user2331595


1 Answers

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>
like image 177
KiranKiki Avatar answered Oct 30 '22 22:10

KiranKiki