Here is my Android manifest file:
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".view.MainActivity" android:label="@string/app_name" android:screenOrientation="reverseLandscape"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <data android:host="mocha" android:path="/RTT/reset" android:scheme="content" /> </intent-filter> </activity> <activity android:name="ihpc.mocha.fakertt.view.SessionTimeOutActivity" android:label="@string/app_name" android:screenOrientation="reverseLandscape"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:host="mocha" android:path="/RTT/sessionTimeOut" android:scheme="content" /> </intent-filter> </activity> </application>
This shows that I registered an implicit intent here
<data android:host="mocha" android:path="/RTT/reset" android:scheme="content" />
Now when I call it from another application
Intent gameInfoIntent = new Intent(Intent.ACTION_VIEW); gameInfoIntent.setData(Uri.parse("content://mocha/RTT" + "/reset")); gameInfoIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PackageManager packageManager = getPackageManager(); List<ResolveInfo> activities = packageManager .queryIntentActivities(gameInfoIntent, 0); boolean isIntentSafe = activities.size() > 0; if (isIntentSafe) { startActivity(gameInfoIntent); finish(); } else { }
It does not show activity for
"content://mocha/RTT/reset"
I tried to call this form of code the same activity as for the testing purpose, but the result is the same.
Please suggest me where and what am I doing wrong?
UPDATE:
I can trigger session activity by putting suggested code in comments. I updated my manifest as follows:
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="mocha" android:path="/RTT/reset" android:scheme="content" /> </intent-filter> </activity> <activity android:name="ihpc.mocha.fakertt.view.SessionTimeOutActivity" android:label="@string/app_name" android:screenOrientation="reverseLandscape"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:host="mocha" android:path="/RTT/sessionTimeOut" android:scheme="content" /> </intent-filter> </activity> </application>
But I still canβt name the main activity.
source share