Android Problem calling TextView from second layout file

后端 未结 4 584
情书的邮戳
情书的邮戳 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:17

    What you are doing should not be done unless you are embedding the layout in the current layout (layout 1) and in that case you need to use include layout.

    In case you want to access data and set it from one activity to another. Use SharedPreference to store the text in this activity and when the other activity launches which used the second layout as its content view, you can use this SP to access the data and set the text view.

提交回复
热议问题