An existed Layout can not be resolved to a field

我与影子孤独终老i 提交于 2019-12-25 04:07:12

问题


I have a customised view, and at certain moment of the game I am developing, I want to show a confirmation message to the user. For the confirmation message, I created a new xml file in the layout folder, and in the cistomised view og the game I am trying to refer to that layout as follows:

private void showConfirmation() {

LayoutInflater mLayoutInf = LayoutInflater.from(this.mContext);
View confMSG_View = mLayoutInf.inflater(R.layout.confirm_msg, null);
.....
.....
}

But, at this step, eclipse underscores the R.Layout.confirm_msg with red and says it can not be resolved to a field.

Please let me know what I am doing wrong here.

来源:https://stackoverflow.com/questions/26426119/an-existed-layout-can-not-be-resolved-to-a-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!