大佬教程收集整理的这篇文章主要介绍了java – 基于应用程序安装顺序的Android自定义权限失败,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
... <uses-permission android:name="com.company.license.PERMISSION" /> ...@H_674_2@>免费应用程式代码检查意图(相关代码):
Intent KeyApp = new Intent("com.company.license.action.AUTH_1"); KeyApp.putExtra("com.company.license.chALLENge",1); //If free app is installed first,an exception is thrown for not having the proper permission. If paid app is installed first,no exception is thrown try { startActivityForResult(KeyApp,COMMING_FROM_KEYAPp); } catch (Exception E) { cancelStartUp(); }@H_674_2@>付费应用清单(相关代码):
<manifest xmlns:android="http://scheR_73_11845@as.android.com/apk/res/android" package="com.company.installer.1" ... <permission android:name="com.company.license.PERMISSION" android:icon="@drawable/icon" android:label="@String/app_name" android:protectionLevel="normal" > </permission> <application android:icon="@drawable/icon" android:label="@String/app_name" android:theme="@android:style/Theme.NoDisplay" > <activity android:name="com.company.license.auth" android:configChanges="keyboardHidden|orientation" android:exported="true" android:permission="com.company.license.PERMISSION" android:theme="@style/Theme.Transparent" > <intent-filter> <action android:name="com.company.license.action.AUTH_1" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name="com.company.installer.redirect" android:configChanges="keyboardHidden|orientation" android:exported="true" android:theme="@style/Theme.Transparent" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
以上是大佬教程为你收集整理的java – 基于应用程序安装顺序的Android自定义权限失败全部内容,希望文章能够帮你解决java – 基于应用程序安装顺序的Android自定义权限失败所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。