Launch OneNote using Share Intent in Android

拈花ヽ惹草 提交于 2019-12-12 04:54:53

问题


Apparently Microsoft has added some Share Intent support to the OneNote Android app: http://www.xda-developers.com/massive-facelift-to-microsoft-onenote-for-android-brings-share-intent-and-multi-window-support/

How can I use a Share Intent on Android to launch the OneNote app?


回答1:


You can not directly launch OneNote through the Share Intent. The behaviour that occurs is:

  1. Content is sent to the OneNote app

  2. Page is created with title matching EXTRA_SUBJECT and body as sent in EXTRA_TEXT.

  3. Low priority notification indicating a page has been created fires. Target is set to open OneNote to the View Page activity.

I suppose that if you asked for the Notifications permission you could intercept the Notification and open OneNote yourself at that point.

If you simply want to open OneNote, why not just use something like:

String onPackageName = "com.microsoft.office.onenote";
Intent launchIntent = getPackageManager().
                      getLaunchIntentForPackage(onPackageName);
startActivity(launchIntent);


来源:https://stackoverflow.com/questions/29635269/launch-onenote-using-share-intent-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!