Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display title of dialog in multi line?

Suppose I have a dialog which is opened from java file . I want to set multiline title of these dialog box.

  dialog = new Dialog(context);
  dialog.setContentView(R.layout.issue_attachment_preview);     
  String title=getString(R.string.previewImageDialogTitle)+"\n ["+attachment.filename+"]";
  dialog.setTitle(title);
  dialog.setCancelable(true);   

But it does not display title in multiline , please suggest me any usable link or example.

like image 823
Sushant Bhatnagar Avatar asked Dec 12 '22 06:12

Sushant Bhatnagar


1 Answers

TextView tv = (TextView) dialog.findViewById(android.R.id.title);
tv.setSingleLine(false);
like image 60
user3581306 Avatar answered Jan 08 '23 01:01

user3581306