我有一个使用自定义URL方案的Android应用程序 . 适用于在常规Android设备上打开应用程序,但在Kindle Fire设备上没有任何反应 .
我的应用程序正在接收链接,我如何处理它是我有一个虚拟活动,不显示处理链接并打开正确的活动 - 或发送广播当前打开的活动来处理信息 . 我可以在日志中看到亚马逊正在尝试打开该活动,因此它根本不会打开应用程序 .
有没有人有任何关于如何解决这个问题的建议?
这是我的清单中的虚拟活动 .
<activity android:name=".LinkHandlerActivity"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<data android:scheme="myscheme" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
这是我的虚拟活动中的代码,用于打开正确的活动
private void broadcastLink(Bundle bundle) {
if (LinkManager.getInstance() == null) {
Intent intent = new Intent(this, LoginActivity.class);
intent.putExtra("info", bundle);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
} else {
Intent intent = new Intent("deep-link-received");
// You can also include some extra data.
intent.putExtra("message", "This is my message!");
intent.putExtra("info", bundle);
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
finish();
}
}
这是在Silk Browser中点击链接时设备的日志
03-09 10:56:47.274 463-765/? I/ActivityManager: START u0 {xxxx} from pid 6800
03-09 10:56:47.274 463-765/? W/ActivityManager: Input dispatching paused for current ActivityRecord: ActivityRecord{424a4c48 u0 com.testlink.testlinkapp/.LinkHandlerActivity t14}
03-09 10:56:47.321 8868-8868/? I/Activity: No ActvityExender defined. Proceed with default activity behavior.
03-09 10:56:47.321 463-473/? D/AmazonTransitionManager: openingActivityName = com.testlink.testlinkapp.LinkHandlerActivity, animationType = Activity open/close (tablet:FADE phone:SLIDE)
03-09 10:56:47.329 463-807/? I/ActivityManager: Next activity is on the same task, skipping moveHomeToTop()
谢谢