why “Open” button after installing apk on android device is disabled?

岁酱吖の 提交于 2020-01-03 00:47:41

问题


I have two projects and I want to combine them together.When I install each of them separately on device ,"Open" button (in page that has been represented after successful installation) is enabled.But when I combine them,"Open" button will be disabled, although installation process will be completed successful.I guess that this error is because of manifest file,but I am not sure.Thanks you in regards your time.


回答1:


I can't say for certain without seeing your manifest, but my guess is that when you combined the two projects, you ended up with two activities that each included:

<intent-filter>
    <action android:name="android.intent.action.MAIN" />`
    <category android:name="android.intent.category.LAUNCHER" />`
</intent-filter>

If you make sure to only say that in the activity you want to open with the "Open" button, I imagine it will work.

Edit: To be clear, it's fine to have multiple entry points like this, but it still seems likely to explain that "Open" button being disabled, since it's ambiguous what it should do.




回答2:


I had similar issue after merging code and it turned out that there was an illegal value in AndroidManifest.xml file. Removing the illegal value fixed the issue. So, make sure to validate your file for errors.



来源:https://stackoverflow.com/questions/10995977/why-open-button-after-installing-apk-on-android-device-is-disabled

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