无法从TextView上的对话框设置数据

时间:2011-03-04 12:06:01

标签: android dialog textview

我从Dialog读取数据,但我无法在TextView上设置该数据。

我做错了什么?

2 个答案:

答案 0 :(得分:1)

// We can't imagine what you are doing wrong, without seeing your source code.  
TextView facePalm = (TextView)findViewById(R.id.youtextview);
facePalm.setText("Like Octavian Damiean said you should improve your question.");

答案 1 :(得分:1)

自定义对话框时,应该这样做:

LayoutInflater inflater = LayoutInflater.from(this);
final View layoutview = inflater.inflate(R.layout.rootview, null);
final TextView title=(TextView) layoutview.findViewById(R.id.text);