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>
相关推荐
程序员江同学36 分钟前
ovCompose + AI 开发跨三端的 Now in Kotlin App
android·kotlin·harmonyos
2501_915106321 小时前
Xcode 上传 ipa 全流程详解 App Store 上架流程、uni-app 生成 ipa 文件上传与审核指南
android·macos·ios·小程序·uni-app·iphone·xcode
消失的旧时光-19431 小时前
Kotlinx.serialization 使用讲解
android·数据结构·android jetpack
灿烂阳光g2 小时前
SELinux 策略文件编写
android·linux
.豆鲨包2 小时前
【Android】Viewpager2实现无限轮播图
android·java
xiangxiongfly9152 小时前
Android CoordinatorLayout+AppBarLayout+CollapsingToolbarLayout实现折叠置顶效果
android·折叠
柿蒂3 小时前
从if-else和switch,聊聊“八股“的作用
android·java·kotlin
Jerry4 小时前
Compose 5 个简短动画,让您的应用脱颖而出
android
PenguinLetsGo5 小时前
你的App是否有出现过幽灵调用?
android
没有了遇见5 小时前
Android ViewPager2 嵌套 RecyclerView 滑动冲突解决方案
android