分享

如何删除Status?bar?中的未接电话图标

 android之情殇 2012-08-30

如何删除Status bar 中的未接电话图标

(2011-04-14 16:35:50)
该方法采用反射方式:
private static final String METHOD_GET_ITELEPHONY = "getITelephony";
private static final String METHOD_CANCEL_MISSEDCALLS_NOTIFICATION =                   "cancelMissedCallsNotification";

private void cancelMissedCallsNotification() {
      Object tm = mContext.getSystemService(Context.TELEPHONY_SERVICE);
      Class c = tm.getClass();
      Method getTel = null;

      try {
           getTel = c.getDeclaredMethod(METHOD_GET_ITELEPHONY, (Class[]) null);
       } catch (Exception e) {
       e.printStackTrace();
       }

       getTel.setAccessible(true);
       try {
          Object r = getTel.invoke(tm, null); // ITelephony
          Class rc = r.getClass();
          Method getCan = null;
          getCan = rc.getDeclaredMethod(
                   METHOD_CANCEL_MISSEDCALLS_NOTIFICATION, (Class[]) null);
          Object ro = getCan.invoke(r, null);

        } catch (Exception e) {
         e.printStackTrace();
        }
}

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多