zoukankan      html  css  js  c++  java
  • 改动app的默认设置(包含改动默认launcher)

    1、改为自己的launcher

    ComponentName component = new ComponentName(
    context.getPackageName(), MainActivity.class.getName());//红色为自己的launcher入口
    ComponentName[] components = new ComponentName[] {
    new ComponentName("com.android.launcher",
    "com.android.launcher2.Launcher"), component };
    pm.clearPackagePreferredActivities("com.android.launcher");//清除默认launcher
    pm.addPreferredActivity(filter, IntentFilter.MATCH_CATEGORY_EMPTY,
    components, component);

    2、改为系统的launcher


    ComponentName component = new ComponentName("com.android.launcher",
    "com.android.launcher2.Launcher");
    ComponentName[] components = new ComponentName[] {
    new ComponentName(context.getPackageName(), MainActivity.class.getName()), component };
    pm.clearPackagePreferredActivities("com.android.launcher");
    pm.addPreferredActivity(filter, IntentFilter.MATCH_CATEGORY_EMPTY,
    components, component);


    3、參考资料

    http://blog.csdn.net/wh_19910525/article/details/39025425

    http://blog.csdn.net/lwyygydx/article/details/42873829

    http://www.07net01.com/2014/09/79947.html

    http://blog.csdn.net/jia4525036/article/details/18036765


  • 相关阅读:
    马拉车算法
    E. You 题解(思维)
    马拉车练习2
    The Boomsday Project 题解(玄学dp)
    Journey to Un'Goro 题解(思维+剪枝搜索)
    Black and white 题解(思维+prim)
    Rise in Price 题解(dp+随机数据)
    高斯消元
    马拉车练习1
    概率期望问题
  • 原文地址:https://www.cnblogs.com/yangykaifa/p/6734315.html
Copyright © 2011-2022 走看看