我需要为Widget配置活动指定完整的类名(包括包名),如下所示:
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:configure="my.package.MyConfigActivity"
...
>
</appwidget-provider>
但是当我编译我的应用程序并查看生成的清单文件时,我发现活动的名称已更改为md52e27f5924a30b693e8c2cbed2aefe779.MyConfigActivity
。
如何获取此生成的名称或将其设置为某个位置以便可预测,我可以在appwidget-provider Xml配置文件中使用它?
答案 0 :(得分:2)
如果您未通过Attribute
一些例子:
[Activity(Label = "ActivityNaming", Name = "com.sushihangover.playscript.MyBigBadGame", MainLauncher = true, Icon = "@mipmap/icon")]
public class MainActivity : Activity
{
~~~
}
<activity android:icon="@mipmap/icon" android:label="ActivityNaming" android:name="com.sushihangover.playscript.MyBigBadGame">
<intent-filter>
~~~~~
</intent-filter>
</activity>
[BroadcastReceiver(Name = "com.sushihangover.greatapp.MyReceiver")]
public class MyBroadCastReceiver : BroadcastReceiver
{
public override void OnReceive(Context context, Intent intent)
{
~~~~
}
}
<receiver android:name="com.sushihangover.greatapp.MyReceiver" />