Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在对话框内更改新的文本视图_Android_Dialog_Android Linearlayout - Fatal编程技术网

Android 在对话框内更改新的文本视图

Android 在对话框内更改新的文本视图,android,dialog,android-linearlayout,Android,Dialog,Android Linearlayout,我在一个对话框中构建了一个线性布局,这里的问题是我想更改这个布局的文本视图,但我不知道如何,,有什么帮助吗?与使用普通视图时的方法相同 TextView text = (TextView) dialog.findViewById(R.id.TextView01); text.setText("Hello"); 它崩溃了!!我想因为setContentView,我正在使用setContentView正在使用的另一个布局的id!

我在一个对话框中构建了一个线性布局,这里的问题是我想更改这个布局的文本视图,但我不知道如何,,有什么帮助吗?

与使用普通视图时的方法相同

TextView text = (TextView) dialog.findViewById(R.id.TextView01);
text.setText("Hello");

它崩溃了!!我想因为setContentView,我正在使用setContentView正在使用的另一个布局的id!