0
我有一个keyguard appwidget,我正在启动一些不同的意图。看来我可以启动/系统应用程序(MMS,设置等)。但并非/数据应用(铬例如)PendingIntent未启动/数据应用程序
我有以下PendingIntentTemplate定义:
Intent startApplicationIntent = new Intent();
PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, startApplicationIntent, 0);
mainLayout.setPendingIntentTemplate(R.id.stackview, pendingIntent);
在我RemoteViewsFactory,我有以下FillInIntent:
Intent i = pm.getLaunchIntentForPackage(pkgName);
i.addCategory(Intent.CATEGORY_LAUNCHER);
i.setAction(Intent.ACTION_MAIN);
stackviewRemoteView.setOnClickFillInIntent(R.id.stackview_image, i);
有没有错误,意图只是解锁了键盘。 它也绝对不是空的toString()方法显示如下:
Intent { act=android.intent.action.MAIN cat=
[android.intent.category.LAUNCHER] flg=0x10000000
pkg=com.android.chrome
cmp=com.android.chrome/com.google.android.apps.chrome.Main }
是不是有什么特别的,我需要的非系统应用程序呢?我认为getLaunchIntentForPackage会为我提供启动应用程序所需的所有功能,就像启动主屏幕时启动应用程序一样。