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>
相关推荐
睡觉待开机40 分钟前
【Android】03-Android 开发机器配置要求
android
Rverdoser2 小时前
非线性优化--NLopt算法(Android版本和Python示例)
android·python·算法
大胃粥3 小时前
Android V app 冷启动(6) Transition 数据化
android
帅次3 小时前
Flutter:StatelessWidget vs StatefulWidget 深度解析
android·flutter·ios·小程序·swift·webview·android-studio
好看资源平台4 小时前
安卓逆向环境搭建(Windows/Linux双平台)
android·linux·windows
林奋斗同学4 小时前
Android GMS集成
android
_一条咸鱼_5 小时前
Android Glide 框架线程管理模块原理的源码级别深入分析
android
_一条咸鱼_5 小时前
Android Retrofit 框架注解定义与解析模块深度剖析(一)
android
法欧特斯卡雷特5 小时前
Kotlin Sequence 真的如此不堪吗?
android·后端·编程语言
pengyu5 小时前
系统化掌握Flutter开发之GestureDetector(一):筑基之旅
android·flutter·dart