error with SimpleCursorAdapter

Put your problem here if it does not fit any of the other categories.

error with SimpleCursorAdapter

Postby fbesoain » Sun Aug 16, 2009 1:16 am

hi guys,

I've read a lot and I cant find the solution for my problem yet, seems like today is not my day programming in andorid, well my problem is with the SimpleCursorAdapter:


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. db.open();
  2.  
  3.    
  4.  
  5.             Cursor c = db.getTitle("1");
  6.  
  7.             startManagingCursor(c);
  8.  
  9.            
  10.  
  11.             Toast.makeText(this, c.getString(1) +" "+ c.getString(0),
  12.  
  13.                     Toast.LENGTH_LONG).show();
  14.  
  15.         l
  16.  
  17.            ListAdapter adapter = new SimpleCursorAdapter(this,
  18.  
  19.                    R.layout.prueba, c,
  20.  
  21.                             new String[] { db.KEY_NUMBER,db.KEY_COMPANY  },
  22.  
  23.                             new int[] { R.id.text1 , R.id.text2});
  24.  
  25.             setListAdapter(adapter);
  26.  
  27.            
  28.  
  29.            
  30.  
  31.              
  32.  
  33.    db.close();
  34.  
  35.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


the cursor is working I chech it before with toast.make, so I have results from the query.

my lauyout is this:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_width="fill_parent"
  8.  
  9.    android:layout_height="fill_parent"
  10.  
  11.    >
  12.  
  13.  
  14.  
  15.  
  16.  
  17. <ListView android:id="@+id/ListView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></ListView>
  18.  
  19. <TextView android:id="@+id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" />
  20.  
  21.  
  22.  
  23. <TextView android:id="@+id/text2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@android:id/text1" />
  24.  
  25.  
  26.  
  27. </LinearLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


If someone have some idea, really I will appreciate it so much
fbesoain
Freshman
Freshman
 
Posts: 6
Joined: Wed May 06, 2009 2:29 am
Location: Chile

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests