Application Launcher Text - Application Name in two lines
Asked Answered
G

3

20

Currently i am developing an application whose name is long , so i would like to display name in two line same as "Quick Calendar" and "Search People" in an attached home screen widget:

Please show me a way to implement this ?? is it possible to do so?

alt text

Gagman answered 3/12, 2010 at 13:21 Comment(0)
T
22

Use \\n for a newline character.

Toreador answered 3/12, 2010 at 13:35 Comment(8)
thanx for the support, but where do i written \\n ?? should i written it into the AndroidManifest.xml file, i have written the app name as android:label="@string/app_name" in the AndroidManifest.xml fileGagman
@PM - Paresh Mayani: "but where do i written \\n ??" -- wherever you need it. In your case, you should have a res/values/strings.xml file for that string resource you are using in the manifest. If nothing else, use the advanced tools known as "search" or "grep" to find where the words are in the files in your project directory.Toreador
ok i changed the "app_name" string inside the strings.xml as "demo\nApplication" and then that string i have used insdie the AndroidManifest.xmlGagman
After changing as above, its working SUCCESSFULLY. Found Really really helpfulGagman
not working for me, I just see "first\nsecond" with the slash n. any idea?Trypsin
It only works in Emulator '\n' and shows invalid icon error while uploading to market.Anatollo
@Toreador \\n doesn't work for me shows up as 'MyApp\nName' from strings.xml as <string name="app_name">MyApp\nName</string> . I think it's getting cut at 11th character . any idea ?Moller
@Annu: No, sorry.Toreador
V
3

Use \n \r but remember to enclose the string in quotes "... \n ... "

Velarize answered 30/12, 2013 at 20:24 Comment(0)
N
0

use XML escape for new line " &#10;" this will work

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">"namr &#10; namr"</string>
</resources>
Nejd answered 3/8, 2023 at 16:14 Comment(1)
How did you get this to work? It still is showing as Normal with Ellipses for meTavern

© 2022 - 2024 — McMap. All rights reserved.