textview

How to click or tap on a TextView text

I know this is so easy (doh...) but I am looking for a way to run a method on tapping or clicking a TextView line of text in an Android App. I keep thinking about button listeners and anonymous method listener calls, but it just does not seem to apply to TextView. Can someone point me at some code snippet to show how clicking or tappin...

RemoteViews setLayoutParams?

Hi, I would like to set the height of a TextView to WRAP_CONTENT remotely. How would I do that, since there is no remoteviews.setLayoutParams(viewId, param) function? I tried remoteviews.setInt.(viewId, "setHeight", -2), but that just sets the height of the TextView to zero... Thanks! ...

TextView Marquee not working

I have tried to use marquee and its not working here is my code, please let me know where im going wrong <TextView android:text="lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00" android:id="@+id/TextView02" android:layout_width="200dip" android:layout_he...

Disabling focus in TextView

Hello, In an Android application I have a ListActivity. After creating it I have a broadcast receiver which has to disable some items in the list. So I have a pice of code ike this one: View child = getListView().getChildAt(i); child.setEnabled(false); It works in the way it changes the color of the disabled views to gray. But I need...

Help Arranging TextView objects on screen in Android

Hi I'm using textview objects to hold labels such as Score, Level etc on my game screen but they don't seem to be displayed where I want them to be. I understand about view hierarchies (parents, children) and am using the gravity tags in the XML layout file but it doesnt seem to have any effect. Could someone just quickly provide a gu...

Two column table on android

Hey everyone. I'm not big into UI programming so this may be an easy thing I overlooked. I am trying have a screen that shows 8 TextView in a 2 column x 4 row table. And, of course, I want the TextViews, that might have different lengths, to be centered. I tried this in a table layout, for obvious reasons but I feel like this is not the ...

Android - Layout question - Textviews top center and bottom center

I have a layout question. Say I have a RelativeLayout appearing at the bottom of my screen. In this, I want to add 2 textviews, in the center, one in the top center and one in the bottom center. |--------------------------| | Text1 | | Text2 | |--------------------------| Something like that :-...

End the ellipse problem with TextViews

Whoa SDK, whoa... So I'm attempting to add an ellipse to the end of my TextView (single line) before it runs off screen. I've read that ellipses are broke (developing for 2.1)? After Google searching, everyone seems to suggest setting inputType to text and maxLines to 1 and you will get an ellipse. There are two problems with this: 1...

Fail on trying to findViewById for nested TextView (within ListView)

Trying to have a ListView (scrollable list) of rows made of two TextViews. I have a list of items from a database that I want to populating into the LinearLayout->ListView->TextView but can't get to the id... Layout somewhat like this instructional link, but have backed away from RelativeLayout and using LinearLayout to get it workin...

TextView- difference between setHeight and setTextSize: Android

what is the difference between setHeight and setTextSize? ...

Text Selection from TextView

Hi I have a large TextView. I want to select and extract particular word or some text from that. Is it possible in Android. If yes then how ...

How do I determine how much text will fit in a TextView in Android?

I have a layout that looks something like this: [TextView 1] [TextView 2] [ TextView 2 spill-over ] Essentially, I need the contents of TextView 2 to wrap to the next line, but start where TextView 1 starts. I was thinking that if I knew how much text would fit into TextView 2 before it runs out of space on line one, I could take the ...

Android TextView respond to html <a> clicks

I have formatted data with commands embedded with tags. I use the HTML class to populate the TextView. Is there a way to intercept the click on the link and get what was clicked? Html.fromHtml("<a href='CMD:Bahai'>Some Command Link</a>"); ...

Having issues with centering text in TextView within a region...

Hi, I'm having issues with TextViews and centering the text within the text region. Specifically, I have a TextView, but when I have text inside that contains letters that straddle down the bottom margin (i.e. p, g, q, y, etc), those letters are getting cut-off. I'm trying to center the text within the region but haven't had much luck...

android:textview adjusts itself to wrong layout_width

<TextView android:layout_height="wrap_content" android:id="@+id/LineNumberTextView" android:hint="Number" android:textSize="15sp" android:layout_width="wrap_content" android:paddingRight="10sp"> </TextView> The above code creates a wrong view: when the text is replaced (in code) to a short (1-3 digits) numbe...

Android: How to add bullet symbol in TextView

I have a TextView and I want to add a bullet symbol in my text through XML. Is it possible? Pleas help ...

Programmatically align a Text view in a RelativeLayout

I can't call setContentView to show XML layouts - I can only get a RelativeLayout which I can programmatically modify. Now, what I need to do is add a simple TextView, aligned at the bottom of that RelativeLayout. With XML it would be as simple as: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orient...

Android set degree symbol to Textview

Hi all! How can I set the degree symbol to an TextView in Android? ...

Android apply style to custom TextView

I have a class, TextViewStyled, which extends TextView In my theme XML, how do I apply a style to all my TextViewStyled widgets on Activities with a chosen theme? I have this simple theme, but I want to limit the Black Gold style to TextViewStyled Widgets without specifying the Black Gold in the TextViewStyled style attribute. This is ...

How to center a title in a TextView with 2 lines?

I know how to center the text in the TextView and how to center the TextView inside its parent layout, but what I'm looking for is how to center a title (text centered but second line starting at the same point). What I'm looking for is this: | Centered | | right! | or this: | Center | Not this (text centered): | ...