简体   繁体   English

具有两个入口点的Android应用程序。 如何知道用户在应用程序对象的onCreate()上单击了哪个

[英]Android application with two entry points. How to know which is clicked by user on onCreate() of application object

I have a android application with two entry points. 我有两个入口点的android应用程序。 ie I have two icon on home screen but internally they are single application. 即我在主屏幕上有两个图标,但在内部它们是单个应用程序。

I want to know how i can set some parameter in Application object depending on the icon click. 我想知道如何根据图标单击在Application对象中设置一些参数。

More precisely, I want to maintain a scope variable which will keep information of the scope of my application based on what icon user has clicked. 更准确地说,我想维护一个范围变量,该变量将根据用户单击的图标保留我的应用程序范围的信息。 Based on this my common screens will behave differently for both of this entry points. 基于此,对于这两个入口点,我的通用屏幕的行为都会有所不同。

Application has getApplicationInfo() and ApplicationInfo has loadIcon(PackageManager pm) - Retrieve the current graphical icon associated with this item. 应用程序具有getApplicationInfo() ,应用程序具有loadIcon(PackageManager pm) -检索与此项目关联的当前图形图标。 Is it enough? 够了吗

I think also that getPackageName() could be used, too, but the author should use different names for both variants of application. 我认为也可以使用getPackageName() ,但是作者应为应用程序的两个变体使用不同的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM