How to highlight the background of a textView

by manoj » Fri, 02 Jan 2009 05:44:28 GMT


Sponsored Links
 Hi friends,

I am using LinearLayout. I am adding some texts to this layout (as a
list).

When I click the particular text, its background should be changed to
some colour.

I am using the code like:

View text = parent_layout1.findViewById(R.id.text);
text.setBackgroundColor(R.color.solid_blue);

But the background is not highlighted, showing only blank screen.

How do I achieve my goal.

Can any one please help me.

Thanks,
Manoj Kumar.M.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. MotoDroid Susah SMS

RR,

Newbie mau tanya nih....
Saya pake MotoDroid yang diinject nomor Smart.
Sering kali kalau SMS suka nggak nyampe, padahal dah dicoba 5x, tetep aja
pihak yang dikirimi tidak terima SMSnya.

Sampai kesel pengen banting Droidnya, tapi sayang ehhehehe....
Mohon pencerahannya, apakah ini karena Droidnya atau Smart nya yang dodol?

Oya, Droidnya pake UD Froyo eXtreme 3.0.0
Thank you...

*************
Deska Affif
088-1100-GAYA (4292) | Y!: GadgetGaya
www.gadgetgaya.com  |  Light Up Your Gadget!

-- 
"Indonesian Android Community [id-android]" 

2. WQVGA not respecting android:layout_height="fill_parent" for layout.

Hi guys,

I have this layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_height="fill_parent"
  android:layout_width="fill_parent"
  android:background="#FFFFFF">
        <LinearLayout android:id="@+id/MenuTitleLinearLayout"
android:orientation="horizontal" android:layout_width="fill_parent"
android:background="@drawable/titlebarbg"
android:layout_height="44dp">
                <trc.prl.Utility.HTMLTextView android:id="@+id/
HTMLTextViewTitlePreviousMenu" android:layout_width="wrap_content"
android:layout_gravity="left|center_vertical"
android:textColor="#FFFFFF" android:scrollbars="none"
android:textStyle="bold" android:gravity="left|center_vertical"
android:background="@drawable/previoustitlebarbg"
android:paddingLeft="4dp" android:paddingRight="4dp" android:lines="2"
android:layout_height="fill_parent"/>
                <ImageView android:layout_width="wrap_content"
android:layout_gravity="center_vertical" android:background="@drawable/
titleseparator" android:id="@+id/ImageTitleSeparator"
android:layout_height="fill_parent"/>
                <trc.prl.Utility.HTMLTextView android:id="@+id/
HTMLTextViewTitleCurrentMenu" android:layout_marginLeft="4dp"
android:layout_marginRight="4dp" android:scrollbars="none"
android:textColor="#FFFFFF" android:layout_width="fill_parent"
android:layout_weight="1" android:layout_gravity="center_vertical"
android:textStyle="bold" android:gravity="left|center_vertical"
android:lines="2" android:ellipsize="end"
android:layout_height="fill_parent" android:layout_marginBottom="4dp"
android:layout_marginTop="4dp"/>
                <Button android:layout_height="wrap_content" android:id="@+id/
MenuSubscribeButton" android:layout_gravity="center_horizontal|
center_vertical" android:text="Subscribe" android:textColor="#FFFFFF"
android:background="@drawable/greenbuttonselector"
android:textSize="10dp" android:layout_width="60dp"
android:visibility="gone" android:layout_marginRight="4dp"/>
        </LinearLayout>
        <ListView android:id="@android:id/list"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:cacheColorHint="#FFFFFF" android:footerDividersEnabled="true"
android:headerDividersEnabled="true" android:divider="@drawable/
listdivider"></ListView>
</LinearLayout>

When I test on the emulator with a target pointed at API level 7 with
the WQVGA 432 screen size and run the app I see my app with everything
in place nicely, however there's a block of black at the bottom of the
screen, approximately 1/5th of the screen height.  The view isn't
stretching down to fill the entire height of the screen even though
the layout is set to "fill_parent".

Can anyone tell me why this is?  What do I need to do to support WQVGA
432?

Thanks very much,

Rob Hawkey

-- 

3. How comes that the estimate time becomes negative

4. how to change colours in a .xml defined layout in run time

5. Database handling - when do you open and close

6. Power Consumption and SQLite

7. better keyboard