'Error:(101)Error:Expectedresourceoftypestyleable[ResourceType]'

  发布日期:   2017-06-01
  最新修改:   2020-05-21
  阅读次数:   35 次

我们在顶部加入

@SuppressWarnings("ResourceType")压制该异常即可正常打包

@SuppressWarnings("ResourceType")
 @TargetApi(19)
  public SystemBarTintManager(Activity activity) {

    Window win = activity.getWindow();
    ViewGroup decorViewGroup = (ViewGroup) win.getDecorView();

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
     // check theme attrs
      int[] attrs = { android.R.attr.windowTranslucentStatus,
         android.R.attr.windowTranslucentNavigation };
     TypedArray a = activity.obtainStyledAttributes(attrs);
      try {
       mStatusBarAvailable = a.getBoolean(0, false);
       mNavBarAvailable = a.getBoolean(1, false);
      } finally {
       a.recycle();
      }

     // check window flags
     WindowManager.LayoutParams winParams = win.getAttributes();
     int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
      if ((winParams.flags & bits) != 0) {
        mStatusBarAvailable = true;
     }
     bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
      if ((winParams.flags & bits) != 0) {
        mNavBarAvailable = true;
      }
   }

   mConfig = new SystemBarConfig(activity, mStatusBarAvailable,
        mNavBarAvailable);
    // device might not have virtual navigation keys
    if (!mConfig.hasNavigtionBar()) {
     mNavBarAvailable = false;
   }

   if (mStatusBarAvailable) {
      setupStatusBarView(activity, decorViewGroup);
   }
   if (mNavBarAvailable) {
     setupNavBarView(activity, decorViewGroup);
    }

 }

   转载规则

《'Error:(101)Error:Expectedresourceoftypestyleable[ResourceType]'字》GajAngels 采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可。