安卓开机直接显示app,不进入系统自带的launcher,有什么方法?

superSNH 2016-08-17 01:36:27
安卓开机直接显示app,不进入主界面,应该怎么弄?
就像天猫盒子一样,开机就是他们的操作界面,直接进入了应用,。
技术上的
...全文
2843 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
需要root权限 现在大多数手机厂商禁止开机自启动
小爷要吃肉 2018-01-11
  • 打赏
  • 举报
回复
引用 10 楼 Seven__Yu 的回复:
是的话 将配置文件中的起始activity改为如下 <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
正解
Seven__Yu 2017-12-29
  • 打赏
  • 举报
回复
是的话 将配置文件中的起始activity改为如下 <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
Seven__Yu 2017-12-29
  • 打赏
  • 举报
回复
你说的是launcher吗???
_周星星 2017-12-28
  • 打赏
  • 举报
回复
开机是有广播的 监听广播 System.out.println("自启动程序即将执行"); if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { Intent mBootIntent = new Intent(context, LoadingActivity.class); //下面这句话必须加上才能开机自动运行app的界面 mBootIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(mBootIntent); }
文明游戏 2017-12-25
  • 打赏
  • 举报
回复
把app做成launcher,然后修改默认启动的launcher是你的app就好了。天猫盒子肯定是改了framework源码的。阉割掉很多东西的,他的launcher就是他的app
qq_21042009 2017-12-22
  • 打赏
  • 举报
回复
我最近也在做相关的,楼主解决了吗?
zisuchen 2017-12-22
  • 打赏
  • 举报
回复
一、修改ActivityManagerService.java的startHomeActivityLocked方法 boolean startHomeActivityLocked(int userId, String reason) { if (mFactoryTest == FactoryTest.FACTORY_TEST_LOW_LEVEL && mTopAction == null) { // We are running in factory test mode, but unable to find // the factory test app, so just sit around displaying the // error message and don't try to start anything. return false; } //mtk add start final PackageManager mPm = mContext.getPackageManager(); Intent homeIntent=new Intent(); homeIntent.addCategory(Intent.CATEGORY_HOME); homeIntent.setAction(Intent.ACTION_MAIN); homeIntent.addCategory(Intent.CATEGORY_DEFAULT); ResolveInfo info = mPm.resolveActivity(homeIntent, PackageManager.MATCH_DEFAULT_ONLY); if("android".equals(info.activityInfo.packageName)){ //if there is a default Launcher? ComponentName DefaultLauncher=new ComponentName("com.android.launcher3","com.android.launcher3.Launcher"); //here set the package name and class name of default launcher. ArrayList<ResolveInfo> homeActivities = new ArrayList<ResolveInfo>(); ComponentName currentDefaultHome = mPm.getHomeActivities(homeActivities); ComponentName[]mHomeComponentSet = new ComponentName[homeActivities.size()]; for (int i = 0; i < homeActivities.size(); i++) { final ResolveInfo candidate = homeActivities.get(i); Log.d(TAG,"homeActivitie: candidate = "+candidate); final ActivityInfo activityInfo= candidate.activityInfo; ComponentName activityName = new ComponentName(activityInfo.packageName, activityInfo.name); mHomeComponentSet[i] = activityName; } IntentFilter mHomeFilter = new IntentFilter(Intent.ACTION_MAIN); mHomeFilter.addCategory(Intent.CATEGORY_HOME); mHomeFilter.addCategory(Intent.CATEGORY_DEFAULT); List<ComponentName>Activities=new ArrayList(); mPm.replacePreferredActivity(mHomeFilter, IntentFilter.MATCH_CATEGORY_EMPTY,mHomeComponentSet, DefaultLauncher); } //mtk add end Intent intent = getHomeIntent(); ActivityInfo aInfo = resolveActivityInfo(intent, STOCK_PM_FLAGS, userId); ......
superSNH 2016-08-24
  • 打赏
  • 举报
回复
引用 3 楼 tufujian 的回复:
设置home就行了,我们刚刚做的这种开机启动的应用
怎么设置home?可以说明一下大概操作吗、?
tufujian 2016-08-17
  • 打赏
  • 举报
回复
设置home就行了,我们刚刚做的这种开机启动的应用
csdn_faith 2016-08-17
  • 打赏
  • 举报
回复
将自定义的lancher设置成为default lancher,我们公司之前做过这个,可惜我不是负责这个模块,网上应该有资料能查。记得给分哦!
ink_s 2016-08-17
  • 打赏
  • 举报
回复
开机启动 需要root权限 等于电脑的管理员权限

80,337

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧