Android系统存在多个Launcher时,设置开机进入默认的Launcher

当Android系统有多个Launcher时,通常会提示用户选择。本文介绍了如何通过修改Provision应用和框架文件,设置开机默认启动Google Launcher2,避免每次选择。
摘要由CSDN通过智能技术生成

问题提出:

      当系统存在多个Launcher时,开机完成并解锁后,系统会弹出一个选择框让用户选择
进入哪一个Launcher,如果不想选择,而是想直接进入某一个默认的Launcher,并且
用户在设置->应用程序->管理应用程序->所有应用程序列表,找到之前设置的那个默
认的Launcher,并且取消了默认值,可以重新弹出launcher选框。

解决方法:

      下面以设置Google Launcher2作为默认启动的Launcher为例,
其package name 为 com.android.launcher
launcher activity name 为 com.android.launcher2.Launcher

需要以下两个修改点

1)修改Provision应用

编辑packages/apps/Provision/src/com/android/DefaultActivity.java文件

[java]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. /* 
  2.  * Copyright (C) 2008 The Android Open Source Project 
  3.  * 
  4.  * Licensed under the Apache License, Version 2.0 (the "License"); 
  5.  * you may not use this file except in compliance with the License. 
  6.  * You may obtain a copy of the License at 
  7.  * 
  8.  *      http://www.apache.org/licenses/LICENSE-2.0 
  9.  * 
  10.  * Unless required by applicable law or agreed to in writing, software 
  11.  * distributed under the License is distributed on an "AS IS" BASIS, 
  12.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
  13.  * See the License for the specific language governing permissions and 
  14.  * limitations under the License. 
  15.  */  
  16.   
  17. package com.android.provision;  
  18.   
  19. import android.app.Activity;  
  20. import android.content.ComponentName;  
  21. import android.content.Intent;  
  22. import android.content.IntentFilter;  
  23. import android.content.pm.PackageManager;  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值