Sony SmartWatch - how to get host app package name

感情迁移 提交于 2019-12-08 03:54:26
Jerker

Every time your widget extension is receiving an intent from the host application, the package name of the host app is included as an extra in the intent.

String hostAppPackageName = intent.getStringExtra(Widget.Intents.EXTRA_AHA_PACKAGE_NAME);

You could store the package name for later use in your code. This is also how it is done in the utility classes of the SDK, i.e. it is stored as a global variable in the abstract class ExtensionService, which is used by all Sample extensions in the SDK.

Take a look at the SDK utility classes here

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