【问题标题】:Android Studio doesn't recognize my resource directoryAndroid Studio 无法识别我的资源目录
【发布时间】:2019-08-04 16:49:09
【问题描述】:

我创建了一个 Android 资源目录,其中包含带有一些菜单更改的 xml 文件。每当我尝试使用 MenuInflater 时,Android Studio 都无法识别我的目录,该目录称为菜单。我已经尝试重建项目,我该怎么办?

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater menuInflater = getMenuInflater();
    menuInflater.inflate(R.menu.note_add); <- the "menu" is a directory, that is not being seen by android studio
    return super.onCreateOptionsMenu(menu);
}
  • 此目录在 res 文件夹中创建。

【问题讨论】:

    标签: java android xml


    【解决方案1】:

    检查菜单目录是否在 res 文件夹中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-30
      • 2014-07-10
      • 1970-01-01
      • 1970-01-01
      • 2014-10-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多