Android Problem calling TextView from second layout file

后端 未结 4 588
情书的邮戳
情书的邮戳 2021-01-24 08:34

Hey guys the main layout xml file for my activity is R.layout.date_list_layout as it is used as follows

 public void onCreate(Bundle savedInstanceState) {
 super         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-24 09:34

    You first need ot inflate the other xml layout file in order to be able to do stuff on the TextView.

    (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE).inflate(R.layout.display_item);
    

提交回复
热议问题