救救孩子吧
救救孩子吧
  • 发布:2023-11-24 12:28
  • 更新:2023-11-24 12:50
  • 阅读:229

离线打包安卓Apk 配置android.intent.category.HOME不生效

分类:uni-app

离线打包安卓Apk 下载官方sdk ASX项目编辑

期望:APP设置中出现主屏幕应用

结果:配置未生效. 请告知原因或者依赖版本问题

AndroidManifest.xml 文件内容如下

<?xml version="1.0" encoding="utf-8"?>  
<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
    package="io.xxx">  

    <application  
        android:allowBackup="true"  
        android:allowClearUserData="true"  
        android:icon="@drawable/icon"  
        android:label="@string/app_name"  
        android:largeHeap="true"  
        android:supportsRtl="true">  
        <activity  
            android:name="io.dcloud.PandoraEntry"  
            android:configChanges="orientation|keyboardHidden|keyboard|navigation"  
            android:label="@string/app_name"  
            android:launchMode="singleTask"  
            android:hardwareAccelerated="true"  
            android:theme="@style/TranslucentTheme"  
            android:screenOrientation="user"  
            android:windowSoftInputMode="adjustResize" >  
            <intent-filter>  
                <action android:name="android.intent.action.MAIN" />  
                <category android:name="android.intent.category.LAUNCHER" />  
                <!-- 新增的 -->  
                <category android:name="android.intent.category.HOME" />  
            </intent-filter>  
        </activity>  
        <activity  
            android:name="io.dcloud.PandoraEntryActivity"  
            android:launchMode="singleTask"  
            android:configChanges="orientation|keyboardHidden|screenSize|mcc|mnc|fontScale|keyboard|smallestScreenSize|screenLayout|screenSize|uiMode"  
            android:hardwareAccelerated="true"  
            android:permission="com.miui.securitycenter.permission.AppPermissionsEditor"  
            android:screenOrientation="user"  
            android:theme="@style/DCloudTheme"  
            android:windowSoftInputMode="adjustResize">  
            <intent-filter>  
                <category android:name="android.intent.category.DEFAULT" />  
                <category android:name="android.intent.category.BROWSABLE" />  
                <action android:name="android.intent.action.VIEW" />  
                <data android:scheme=" " />  
            </intent-filter>  
        </activity>  
        <meta-data  
            android:name="dcloud_appkey"  
            android:value="xxxxx" />  
    </application>  

</manifest>
2023-11-24 12:28 负责人:无 分享
已邀请:
救救孩子吧

救救孩子吧 (作者)

问题已解决
application下第一个activity修改为以下即可

<activity  
            android:name="io.dcloud.PandoraEntry"  
            android:configChanges="orientation|keyboardHidden|keyboard|navigation"  
            android:label="@string/app_name"  
            android:launchMode="singleTask"  
            android:hardwareAccelerated="true"  
            android:theme="@style/TranslucentTheme"  
            android:screenOrientation="user"  
            android:windowSoftInputMode="adjustResize" >  
            <intent-filter>  
                <action android:name="android.intent.action.MAIN" />  
                <category android:name="android.intent.category.LAUNCHER" />  
                <!-- 下面两行是新增的 -->  
                <category android:name="android.intent.category.HOME" />  
                <category android:name="android.intent.category.DEFAULT" />  
            </intent-filter>  
        </activity>

要回复问题请先登录注册