Android: Start Activity from preferences.xml

后端 未结 12 1973
轮回少年
轮回少年 2020-12-04 13:16

I would like to start an Activity from a default preferences.xml, with < intent > tag. The Activities are well tested, the problem is not with that. (I\'m extending Prefe

12条回答
  •  Happy的楠姐
    2020-12-04 13:33

    Caution! The value of targetPackage should be the package id of the app, as declared in the root element of your AndroidManifest.xml file (which you define in your Gradle build file). It is not necessary the same as the Java package of your Activity class (people usually put them in a subpackage of "ui").

    So in your specific case, I bet you the targetPackage should be "my.notifier", not "my.notifier.ui" (I would have to see the manifest to be sure).

提交回复
热议问题