java中通过反射得到StatusBarManager

来源:互联网 发布:破解rar密码软件 编辑:程序博客网 时间:2024/05/22 08:36

通过反射调用StatusBarManager中的setStatusBarIconColor函数



public static void setStatusBarIconColor(Context context,int color)
{
try {
          Object service = context.getSystemService(STATUSBAR);
          if (service != null) {
              Method expand = service.getClass().getMethod(SETSTATUSBARCOLOR,int.class);
  
              expand.invoke(service,color);
          }
      } catch (Exception e) {
          e.printStackTrace();
      }
}

0 0