Android :: TextView Line Breaks / Setting I'm Missing?
Aug 28, 2009I am trying to insert line breaks into a string resource so they appear in a TextView. I put in "
" but all I get is "
" appearing. Is there a setting I'm missing?
I am trying to insert line breaks into a string resource so they appear in a TextView. I put in "
" but all I get is "
" appearing. Is there a setting I'm missing?
My code is pretty standard.. sReport contains the text I would like output to the text file, and it contains several" "line breaks that render fine in a textview, but in the text file they're non-existent. There must be something easy i'm missing..
try {
FileOutputStream fOut = new FileOutputStream(sDir + sFile);
//write
fOut.write( sReport.getBytes() );
// Close output stream
fOut.flush();
fOut.close();
} catch (IOException e) {
e.printStackTrace();
}
I recently bought my first Android phone and have a problem with the stock email app. Emails are displayed so that words are broken between lines like the example below:
This is a mockup of the problem I am having with the email reader on my Samsung Skyrocket.
I would like to manually add a line break to my TextView. Now sure how I can do this.
View 1 Replies View Relatedi want to wrap text to next line any one guide me what is the solution?
View 1 Replies View RelatedI have a TextView inside a ScrollView. Let's say the ScrollView is named s and the TextView is named t.
I have many lines to be displayed in the TextView and at the same time I want to scroll the view to a specific line.
So I did this:
t.setText(aVeryLongString);
int y = t.getLayout().getLineTop(40); // e.g. I want to scroll to line 40
s.scrollTo(0, y);
But it won't scroll, except the second time. It seems that on the first time the code finishes, the ScrollView knows how much the total height of the TextView is.
So I think there must be something to force calculating the needed height before the scrollTo call. How to do that (or otherwise)?
I have a full-screen TextView holding a long Spanned that requires scrolling. The TextView's getLineCount() gives me the total number of lines used for the entire block of text but I'd like to know how many lines of text are currently visible on the screen.
Or, better yet, is there a way to figure out the range of lines currently visible on the screen? For example, as the view scrolls, can I tell that lines 20-60 are currently visible?
I am creating a button widget with icon and text. Single word text is getting divided into two lines. There is enough room on the screen for the button widget to grow. But it still wraps the text to next line. How do I force it to be single line ? This is how I setup th button widget. <Button android:id="@+id/delete" android:text=" @string/delete" android: drawableTop="@drawable/ic_menu_post_delete" style="@style/ OnScreenActionIcon" />
View 2 Replies View RelatedI have a problem with ListView, it seems a bug, setting a textsize for textview of a ListView, not all separator line are shown! (ListView doesn't show all item separator)...
you can see the in this screenshoot: http://yfrog.com/myselezione002p
I have prepared a little testcase for this issue: [url]
I set a toggle breakpoint at line 36 of the main class, of APIDemos 8, the debug begins at the OnCreate but never processes another line in the class. Why is that?
Here's the code starting a line 36. Code...
Here is my color XML
CODE:.............
Here is my Java code:
CODE:............
This works when I use Color.RED or Color.GREEN, but when I use my own colors. The color doesn't show up.
In the string.xml file i use the following tag
<color name="mycolor1">#F5DC49</color>
if i use : textview1.setTextColor(Color.CYAN);
it works, But :textview1.setTextColor(R.color.mycolor1);
This is not working.how to use the color tag in android?
I have an activity with a ListView which is populated through a custom ArrayAdapter. There is an array of objects which have a Boolean property called 'isRead'. Based on the value of this property, I want to set the typeface of one of the TextViews in the row to either 'normal' or 'bold'. I also set the color of the text to either 'gray' or 'black When the Activity initially starts up, everything works as expected. If isRead is true, the text is gray with a normal font. Once I scroll down the list and then scroll up again, the text of an object where isRead is true is colored gray, but the font is bold. Code...
View 1 Replies View RelatedI am using a header for a Listview. ListView header has three columns. Say a,b,c. I am using two LinearLayouts to design ListView header as shown below:
CODE:............
Now i want to fix the width of columns a, b, c respectively. How to set width of these columns ? Again, is it a good practise to use LinearLayout for this ? Please Advise.
I simply populate the database from a text file where each line is a new entry into the table so a line would look like this "This is on first line.This is on second line" and it is stored as text.Is there a reason that it isn't displaying the characters properly? It must be something to do with the string being in the database.
View 3 Replies View RelatedJust had an odd problem with a TextView. Setting the visibility doesn't seem to work but doing the same on say a ScrollView does. Is this normal?
View 3 Replies View RelatedSetting the background color programatically of an android TextView doesn't seem to work.
I'm I missing something!
CODE:.............
I also have this file (colors.xml) in my res/values folder
CODE:................
Also, setting the text color causes the TextView to disappear.
CODE:..................
We are using TextView's Ellipsize function to scrolling text in it and there many other controls in our window. We noticed CPU would go up to 50% if text started scrolling. After digging deeper, we found all controls in our layout kept drawing when texts scrolling. We wonder why? And how to avoid all controls redrawing?
View 8 Replies View RelatedI have a none branded/unlocked Desire with firmware version 2.10.405.2, now, there used to be an option in older firmware versions, how old i can't remeber, to enable a sound notification for SD Card events, such as unmounting, mounting, etc, but this option seems to have been removed, at least on my phone, could someone please take a look through thier phone settings and confirm if this option is there, or not, i used to enable this option when connecting to the PC so i would know when the SD Card had unmounted/mounted.
View 3 Replies View Relatedmy camera flash works just fine but when i switch to the camcorder app i cant use the flash. it symbol is there but its grayed out and i cant turn it on. is there a setting im missing or another app that will let me use the flash with video recording?
View 2 Replies View RelatedI downloaded songs and added album art via mp3tag
i done it successfully but now they are on my hero and there are some missing ,,
is there some setting that maybe causing this , because i have added the album art again and it just wont appear on my hero
I have a text file in my res/raw directory. I want to read the file line by line, but FileReader and BufferedReader fail, because of Android's security restriction. How else can I do it?
View 1 Replies View RelatedRecently I have been having issues with viewing my email messages in the Yahoo Mail App. When I open some messages all is see is line after line of code instead of the message text. It doesn't seem to matter what the source email is (gmail, hotmail, etc). Some emails are ok some are not. Anyone else have this problem? Any fixes?
View 1 Replies View RelatedIn my project, in the res/drawable directory I have:
CODE:.......................
When I put the app on my HTC Hero, it works fine. But if I reboot the phone, the application icon stops using the icon.png, and instead begins to use the go_bg.png. The button that uses the go.xml no longer works either. Rebooting the phone basically breaks the app. I can reinstall the app and it again works fine all up until I reboot.
I know of two ways to get the app on the phone, first using Eclipse and second using the HTC Sync software that came with the phone. Installing the app either way produces the same issues in the end.
I've tried renaming the button image names and the xml file. Nothing helps there.
My phone is the HTC Hero. In Eclipse I'm building using the 1.5 SDK.
Any idea why rebooting my phone breaks my app?
You can no longer send the ACTION_ATTACH_DATA intent with an image URI to a custom content provider without crashing the Gallery app. This bug was reported more than a month ago. It is a stupid bug that is super easy to fix, and as soon as Froyo was open sourced a patch was submitted. Still Froyo was officially released and the bug remains leaving developers who use this with an app that is no longer compatible and no easy way to work around it for 2.2. There are other bugs that also have not been acknowledged. This 'open' thing is great but it is not of much use this way.
View 2 Replies View RelatedThe CSS for my webapp gets completely misaligned when the mobile device is rotated to landscape (target devices are iphone and android). I tried using the javascript solution explained here in order to get my app to switch between a portrait.css and a landscape.css file on orientation change, but that still didn't work. It even messed up the portrait.css once they were both posted to the live server (although it worked on my local machine).The url for the app is http://mobile.geekstats.com/ Does anyone know how I can fix the landscape css?
View 1 Replies View RelatedWe are currently looking into methods how to implement tabs. TabHost has serious limitations and is no option. Instead, we are experimenting with our own tab solution, which has its own task (activity stack) for each tab.
It's working well except that there's transition animation performed by the system when launching a new task the first time. The NO_ANIMATION parameter passed to startActivity has no effect in this case. The animation breaks the app visually - is there a way to prevent it?
I have recently updated my app to a build target of SDK version 8 in order to include the App2SD feature for my users. However I have had reports of devices on SDK 3 (1.5) having problems starting the application, with the following stack trace: If i change the build target back to version 4 as it was previously this issue goes away, also if i remove any graphical resources from my XML files this issue goes away.
View 2 Replies View RelatedI want to do something like that. For example, I have a textview with String
Alibaba love Mary so muck. In that String alibaba and Mary have a event to open something but I can't know how to use event for Mary and Alibaba seperately
I have a Samsung Galaxy S II and before I could transfer all of my music, pictures and everything else just fine. I recently got an update (AT&T) for ICS and now transferring 1 (3.32MB) .mp3 has taken upwards of an hour now.
View 1 Replies View Related