I am trying to set some text in DialogFragment and this text contains some new lines.
I tried all this:
setMessage("This is line A \n This is line b");
setMessage("This is line A \\\n This is line b");
setMessage("This is line A+"System.getProperty("line.separator")"+This is line b");
Does not work.
What advice?
You must set your string as a resource in the strings.xml file and then get it using the getString method.
Take a look here for more details: String Newline resource / n not possible?
I would recommend using a custom layout for your dialog, or you could just use
String message = "First sentence \r\n Second sentence \r\n ..."
Source: https://habr.com/ru/post/1501688/More articles:Raspberry PI IP - raspberry-piRoutes: resources, using a member or collection for a custom action? - ruby-on-railshttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1501685/why-does-listtostring-and-vectortostring-return-a-nice-representation-but-not-arraytostring&usg=ALkJrhgNc_kjW7m24o0NcbiOhHnsIuEGewAd Integration for Winforms Application in C # - c #Is it possible to get the database file name in a shelf using the file object attribute? (Python) - pythonRunning SSIS 2008 package on SQL2012 instance - sql-server-2008Linq left an external connection to a custom comparator - c #Is a stream needed while reading from a socket stream? - javaSession does not destroy? - phpHow to access controller function from model in Yii? - phpAll Articles