去掉targetSdkVersion

或改为targetSdkVersion =13或更小。。

 

不改targetSdkVersion的办法:
在onCreate() 里setContentView()之后加入如下代码即可。
try {
    window.addFlags(WindowManager.LayoutParams.class.getField("FLAG_NEEDS_MENU_KEY").getInt(null));
  }
  catch (NoSuchFieldException e) {
    // Ignore since this field won't exist in most versions of Android
  }
  catch (IllegalAccessException e) {
    Log.w(TAG, "Could not access FLAG_NEEDS_MENU_KEY in addLegacyOverflowButton()", e);
  }

相关文章:

  • 2021-05-12
  • 2022-12-23
  • 2022-01-03
  • 2022-01-06
  • 2021-11-26
  • 2021-08-12
  • 2021-08-03
猜你喜欢
  • 2021-10-20
  • 2021-04-20
  • 2021-04-09
  • 2022-02-03
  • 2022-12-23
  • 2021-12-23
  • 2021-12-06
相关资源
相似解决方案