Android APP转成launcher

一、背景

使用场景,需要开机的时候,自动启动app,解决方案为将Android app转成 launcher app,可实现效果。

二、实现

在app入口activity 的配置文件(AndroidManifest.xml)对应位置,添加

复制代码
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />

案例代码:

复制代码
  <activity
            android:name=".ui.activity.splash.SplashActivity"
            android:exported="true"
            android:largeHeap="true"
            android:persistent="true"
            android:theme="@style/Left_Right_AnimTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.HOME" />
            </intent-filter>

        </activity>
相关推荐
哲科软件4 小时前
跨平台开发的抉择:Flutter vs 原生安卓(Kotlin)的优劣对比与选型建议
android·flutter·kotlin
jyan_敬言10 小时前
【C++】string类(二)相关接口介绍及其使用
android·开发语言·c++·青少年编程·visual studio
程序员老刘11 小时前
Android 16开发者全解读
android·flutter·客户端
福柯柯12 小时前
Android ContentProvider的使用
android·contenprovider
不想迷路的小男孩12 小时前
Android Studio 中Palette跟Component Tree面板消失怎么恢复正常
android·ide·android studio
餐桌上的王子12 小时前
Android 构建可管理生命周期的应用(一)
android
菠萝加点糖12 小时前
Android Camera2 + OpenGL离屏渲染示例
android·opengl·camera
用户20187928316712 小时前
🌟 童话:四大Context徽章诞生记
android
yzpyzp12 小时前
Android studio在点击运行按钮时执行过程中输出的compileDebugKotlin 这个任务是由gradle执行的吗
android·gradle·android studio
aningxiaoxixi12 小时前
安卓之service
android