ERROR No package identifier when getting value for resource number

后端 未结 11 2185
醉话见心
醉话见心 2020-12-03 10:21

Both activities are in the same package

Second activity uses second layout file

setContentView(R.layout.main2);

Errors on this line

11条回答
  •  甜味超标
    2020-12-03 10:54

    It is due to typecast error. You have to try this- TextView.setText(Integer.toString(variable_name));

    Here toString is used to convert integer to string for showing text.

提交回复
热议问题