标签: java android
我的fragment1有变量x,第二个片段有Edit Text,
fragment1
x
Edit Text
//this code in fragment 1 onCreateView double x = 1.111111 //txt1 is in fragment2 EditText txtx =(EditText)rootView.findViewById(R.id.txt1);
当我执行以下操作时,应用程序崩溃:
txtx.setText(x);