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>
相关推荐
simplepeng10 小时前
我们都知道但总是忽略的5个Jetpack Compose细节
android·android jetpack
刮风那天11 小时前
Android 如何提高进程优先级避免被查杀?
android
修行者对66612 小时前
安卓阿里云镜像
android
刮风那天13 小时前
Android AMS创建进程不用Binder而用Socket?
android·java·binder
知行合一。。。15 小时前
Python--05--面向对象(继承,多态)
android·开发语言·python
张小潇16 小时前
AOSP15 WMS/AMS系统开发 -窗口动画源码分析
android
程序员陆业聪17 小时前
Shadow核心原理:壳子Activity与代理机制的精妙设计
android
plainGeekDev18 小时前
Android 开发者再不转Kotlin,真的来不及了
android·kotlin
赏金术士18 小时前
第五章:数据层—网络请求与Repository
android·kotlin·compose
初雪云18 小时前
让安卓发版再简单一点,体验一键自动化发布
android·运维·自动化