how can I clear a transparent or translucent canvas

by Romain Guy » Fri, 13 Mar 2009 01:47:45 GMT


Sponsored Links
 Just call Canvas.drawColor(0).






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



Other Threads

1. listactivity problems

I am trying to build a listactivity with listitems that consist of two
textviews. Unfortunately I don't see anything but lines in my list.
Can anyone tell me whats wrong with this code?


in list_item.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical">

     <TextView android:id="@+id/text1"
         android:textSize="16px"
         android:textStyle="bold"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"/>

     <TextView android:id="@+id/text2"
         android:textSize="12px"
         android:textStyle="italic"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"/>
</LinearLayout>

in my class:

public class mylv extends ListActivity
{
        ArrayList<HashMap<String,String>> list = new
ArrayList<HashMap<String,String>>();

        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState)
        {
                super.onCreate(savedInstanceState);

                // add items to the list
                                HashMap<String,String> item1 = new
HashMap<String,String>();
                item1.put("line1", "one");
                item1.put("line2", "two");
                list.add(item1);
                HashMap<String,String> item2 = new HashMap<String,String>();
                item2.put("line3", "three");
                item2.put("line4", "four");
                list.add(item2);
                HashMap<String,String> item3 = new HashMap<String,String>();
                item3.put("line5", "five");
                item3.put("line6", "six");
                list.add(item3);

                // build the list adapter
                ListAdapter adapter = new SimpleAdapter(
                        this,
                        list,
                        R.layout.list_item,
                        new String[] { "label", "description" },
                        new int[] { R.id.text1, R.id.text2 }
                );

                // show the items
                setListAdapter(adapter);
        }
}
--~--~---------~--~----~------------~-------~--~----~

2. Device keyboard backlight

Hi,

I want to create a menu which would help to alter the timeout of the
back-light of the device keyboard...... So, if i know where exactly we
are setting the device-keyboard value most of my problem can be
solved.... PLease let me know if any clues u have.

Thanks.
--~--~---------~--~----~------------~-------~--~----~

3. AutoCompleteTextView with SimpleAdapter

4. Android on solaris

5. about the hardware acceleration of Skia drawing

6. Android and webservices

7. SQLiteDatabase table