これが私のAndroidマニフェストファイルです:
<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>
ここに暗黙の意図を登録したことを示しています
<data android:host="mocha"
android:path="/RTT/reset"
android:scheme="content" />
別のアプリから呼び出すと
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 {
}
アクティビティが見つかりません
"content://mocha/RTT/reset"
テスト目的でも同じアクティビティからこのコードを呼び出してみましたが、結果は同じです。
どこで何が間違っているのか教えてください。
アップデート:
コメントに提案されたコードを入れることで、セッションタイムアウトアクティビティを呼び出すことができます。マニフェストを次のように更新しました。
<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>
しかし、私はまだメインアクティビティを呼び出すことができません。