android5.1 launcher2去掉桌面应用图标

1.launcher的桌面应用位置

2.APK源码

3.无源码应用改launcher

//####################################################################//

1.路径:\packages\apps\Launcher2\res\xml\default_workspace.xml

\packages\apps\Launcher2\res\xml\default_workspace.xml

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<favorites xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher">
    <!-- Far-left screen [0] -->

    <!-- Left screen [1] -->
    <!--appwidget
        launcher:packageName="com.android.settings"
        launcher:className="com.android.settings.widget.SettingsAppWidgetProvider"
        launcher:screen="1"
        launcher:x="0"
        launcher:y="3"
        launcher:spanX="4"
        launcher:spanY="1" /-->

    <!-- Middle screen [2] -->
    <appwidget
        launcher:packageName="com.android.deskclock"
        launcher:className="com.android.alarmclock.AnalogAppWidgetProvider"
        launcher:screen="2"
        launcher:x="1"
        launcher:y="0"
        launcher:spanX="2"
        launcher:spanY="2" />
    <favorite
        launcher:packageName="com.android.camera2"
        launcher:className="com.android.camera.CameraLauncher"
        launcher:screen="2"
        launcher:x="0"
        launcher:y="3" />

    <!-- Right screen [3] -->
    <favorite
        launcher:packageName="com.android.gallery3d"
        launcher:className="com.android.gallery3d.app.Gallery"
        launcher:screen="3"
        launcher:x="1"
        launcher:y="3" />
    <!--favorite
        launcher:packageName="com.android.settings"
        launcher:className="com.android.settings.Settings"
        launcher:screen="3"
        launcher:x="2"
        launcher:y="3" /-->

    <!-- Far-right screen [4] -->

    <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
    <favorite
        launcher:packageName="com.android.dialer"
        launcher:className="com.android.dialer.DialtactsActivity"
        launcher:container="-101"
        launcher:screen="0"
        launcher:x="0"
        launcher:y="0" />
    <favorite
        launcher:packageName="com.android.contacts"
        launcher:className="com.android.contacts.activities.PeopleActivity"
        launcher:container="-101"
        launcher:screen="1"
        launcher:x="1"
        launcher:y="0" />
    <favorite
        launcher:packageName="com.android.mms"
        launcher:className="com.android.mms.ui.ConversationList"
        launcher:container="-101"
        launcher:screen="3"
        launcher:x="3"
        launcher:y="0" />
    <!--favorite
        launcher:packageName="com.android.browser"
        launcher:className="com.android.browser.BrowserActivity"
        launcher:container="-101"
        launcher:screen="4"
        launcher:x="4"
        launcher:y="0" /-->
</favorites>

注解掉了:com.android.settings和com.android.browser

有效果!

launcher:title,图标下面的文字,目前只支持引用,不能直接书写字符串。

launcher:icon,图标引用。

launcher:uri,链接地址。

launcher:packageName,应用程序的包名。

launcher:className,应用程序的启动类名。

launcher:screen,图标所在的屏幕编号。

launcher:x,图标在横向排列上的序号。

launcher:y,图标在纵向排列上的序号。

参考链接:(34条消息) adb安装完apk没有桌面图标 - CSDNicon-default.png?t=M5H6https://www.csdn.net/tags/NtTacg0sMTM3OTYtYmxvZwO0O0OO0O0O.html

2.APK源码

\packages\apps\Browser\AndroidManifest.xml

            <!-- We are also the main entry point of the browser. -->
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.DEFAULT" />
           -     <category android:name="android.intent.category.LAUNCHER" />
           +     <!-- category android:name="android.intent.category.LAUNCHER" /-->
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.APP_BROWSER" />
            </intent-filter>

注解掉                <category android:name="android.intent.category.LAUNCHER" />

因为Launcher是根据应用清单文件里,可以作为参考。

3.无源码launcher内改

\packages\apps\Launcher3\src\com\android\launcher3\LauncherModel.java

for (int i = 0; i < apps.size(); i++) {
    LauncherActivityInfoCompat app = apps.get(i);
+    if("com.android.browser".equals(apps.get(i).getApplicationInfo().packageName)){
+        continue;
+    }
    mBgAllAppsList.add(new AppInfo(mContext, app, user, mIconCache, mLabelCache));
}

过滤掉com.android.browser包,仅做参考launcher3修改,launcher2并无找到对呀位置。

参考链接:

(34条消息) Android5.1 Launcher3 隐藏指定应用图标_西门萝卜的博客-CSDN博客_launcher3隐藏应用icon-default.png?t=M5H6https://blog.csdn.net/paullovazxq/article/details/52154468?spm=1001.2101.3001.6650.14&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-14-52154468-blog-114277562.pc_relevant_antiscanv4&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-14-52154468-blog-114277562.pc_relevant_antiscanv4&utm_relevant_index=17

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

旋风旋风

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值