listview +icons+ sqlite

by carmelo » Tue, 23 Mar 2010 01:51:52 GMT

Sponsored Links
 Hi! I'm trying to read datas from a db, display them into a list with
icons ( not fixed but changing in base of the value read in the db). I
know how to do this thing, reading values from a simple array:

public class DynamicDemo extends ListActivity {
TextView selection;
String[] items={"cinema", "cinema", "sport", "sport", "music", "art",
"shopping", "shopping", "music"};

public void onCreate(Bundle icicle) {
                setListAdapter(new IconicAdapter());

class IconicAdapter extends ArrayAdapter {
                IconicAdapter() {
                super(DynamicDemo.this, R.layout.row, items);

public View getView(int position, View convertView, ViewGroup parent)

        LayoutInflater inflater=getLayoutInflater();
        View row=inflater.inflate(R.layout.row, parent, false);

        //set view for text
        TextView label=(TextView)row.findViewById(;

        //set view for icon
        ImageView icon=(ImageView)row.findViewById(;

        //select correct icon
        if (items[position].equals("cinema")) {
        if (items[position].equals("sport")){
        if (items[position].equals("art")){
        if (items[position].equals("shopping")){
        if (items[position].equals("music"))    {

But I cannot find a way to do the same thing using the cursor with the
result of the query. Anyone can help?


Other Threads

1. Google WebElements Discussions and Android Apps


We've added a Google Conversation Web Element 
(  for each app at 
AndAppStore using the title of the app followed by a space and "[Android 
Application]" (e.g. the AndAppStore Client discussion URL is
 , they're global conversations so app authors, app review sites, or anyone 
else can add them into their own page using the same Topic URL if they want to. 

At the moment they're only on the desktop web interface to AndAppStore because 
the Google implementation doesn't work well with the android browser (constant 
refreshes, nothing shown in the conversation box, etc.), but hopefully someone 
will think about that at some point and we'll add it in to the android browser 
interface as well.




* Written an Android App? - List it at *

Funky Android Limited is registered in England & Wales with the
company number 6741909. The registered head office is Kemp House,
152-160 City Road, London, EC1V 2NX, UK.

The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's


2. Deleting buffer cache for IO throughput


We are writing an application to measure throughput speed of SD card
on ARM-based Android target using Java APIs.

When we execute the application twice for read operation, results are
seen to be affected with buffer cache.

For example, first read throughput is 275 KBps and second read
throughput is 350KBps.

Application is simple Java-based application, it is .jar app. It is
not using the Application class  and hence, not having
AndroidManifest.xml present. ().

Is there any way to clear the buffer cache after each run of the
application ?

Thanks and Regards,

3. Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)

4. how to have onItemClickListener for setListAdapter(new EfficientAdapter(this));?

5. How to create a simple list of names, with personal image for each row

6. socket (server and client)_

7. Does the android 1.5 browser support navigator.geolocation?