如何将统一打包出来的APK隐藏,然后通过其他APK打开它。我在网上查了半天试了半天。就在要下班的时候试到一种是可以实现的。这边废话不多说,直接上代码。
- 隐藏APK图标,即APK入口,这里需要重新配置Androidmanifests文件,在这个文件里将活动标签里的内容改成下面的代码:
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <data android:scheme="xl" android:host="goods" android:path="/goodsDetail" android:port="8888"/> <!--下面这几行也必须得设置--> <category android:name="android.intent.category.DEFAULT"/> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> </activity>
讯享网
2.在安卓中添加如何打开隐藏应用程序的代码:
讯享网 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("xl://goods:8888/goodsDetail?goodsId=")); startActivity(intent);
这样代码就完成了。至于如何在统一中调用打开隐藏APP的实现我在前面的博客中已经详细的写过了。有需要的可以去看一下。
3.在以上实现完之后,我发现打开隐藏APP的时候,会有短暂白屏,这边也是需要修改AndroidMainfests文件:
android:theme =“@ style / UnityThemeSelector”这句表示窗口样式,修改这句就好了。
只需要将这句改为android:theme =“@ android:style / Theme.Translucent.NoTitleBar
现在就大功告成啦!亲测有效!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/77246.html