sam
sam

Reputation: 9

Unable to set data from a Dialog on a TextView

I read data from a Dialog but I'm unable to set that data on a TextView.

What am I doing wrong?

Upvotes: 0

Views: 339

Answers (2)

wangyanhua
wangyanhua

Reputation: 11

When you customize a dialog, you should do it like this:

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

Upvotes: 1

Reno
Reno

Reputation: 33792

// 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.");

Upvotes: 1

Related Questions