I have handled to exhibit existing user inside a textview. However it are only able to show individually and so i made the decision to make use of listview.

package log1.log2;

import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.SimpleCursorAdapter;

public class AdminMain extends ListActivity {

 DBAdapter db = new DBAdapter(this);

 public void onCreate(Bundle savedInstanceState) 
 {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.listview);

      db = new DBAdapter(this);
   db.open();

   Cursor c = db.getAllUser(); 

   while (c.moveToNext()){

    setListAdapter(new SimpleCursorAdapter(this, 
      R.layout.adminmain, c, 
      new String[] { "Username" }, 
      new int[] {R.id.txtUser}));

   }

   db.close(); 
 }
}

However I received this error message in the logcat.

08-19 04:22:49.331: ERROR/AndroidRuntime(918): java.lang.RuntimeException: Unable to start activity ComponentInfo{log1.log2/log1.log2.AdminMain}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'

I've added listview in listview.xml. I don't realise why the mistake monosodium glutamate informs me that.

I really hope to get useful replies soon! Thanks greatly!

-Dayne


Edited

Hello again

For my xml, I acquired two xml file to create the listview work. First is listview.xml and 2nd is adminmain.xml. For listview.xml, i have placed only listview. As well as for adminmain.xml, I placed textview.

listview.xml:

<?xml version="1.0" encoding="utf-8"?>

<AbsoluteLayout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>

<ListView android:id="@+id/ListView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" />


</AbsoluteLayout>

adminmain.xml:

<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background = "@drawable/image"
xmlns:android="http://schemas.android.com/apk/res/android"
>

<TextView
    android:id="@+id/txtUser"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#ff000000"
    android:text="USERNAMES HERE" 
    android:layout_x="100px"
    android:layout_y="102px"/>


</AbsoluteLayout>

I have attempted changing the R.layout. Exactly the same error message seems.

I really hope somebody can provide us a good tip soon. Appreciate reading through my publish.

-Dayne


After Editing

Here's the content in the log cat:

08-20 04:06:45.326: INFO/ActivityManager(587): Start proc log1.log2 for activity log1.log2/.AdminMain: pid=761 uid=10022 gids={}
08-20 04:06:45.456: DEBUG/dalvikvm(753): LinearAlloc 0x0 used 637060 of 4194304 (15%)
08-20 04:06:49.026: DEBUG/dalvikvm(761): GC freed 3633 objects / 145376 bytes in 166ms
08-20 04:06:51.876: WARN/System.err(658): Can't dispatch DDM chunk 46454154: no handler defined
08-20 04:06:51.886: WARN/System.err(658): Can't dispatch DDM chunk 4d505251: no handler defined
08-20 04:06:51.895: INFO/jdwp(676): received file descriptor 27 from ADB
08-20 04:06:51.926: INFO/jdwp(687): received file descriptor 27 from ADB
08-20 04:06:55.227: WARN/ActivityManager(587): Launch timeout has expired, giving up wake lock!
08-20 04:06:55.757: WARN/ActivityManager(587): Activity idle timeout for HistoryRecord{4367c578 {log1.log2/log1.log2.AdminMain}}
08-20 04:06:56.206: DEBUG/dalvikvm(761): GC freed 3325 objects / 126264 bytes in 142ms
08-20 04:06:56.927: WARN/System.err(687): Can't dispatch DDM chunk 46454154: no handler defined
08-20 04:06:56.927: WARN/System.err(687): Can't dispatch DDM chunk 4d505251: no handler defined
08-20 04:06:56.957: WARN/System.err(676): Can't dispatch DDM chunk 46454154: no handler defined
08-20 04:06:56.957: WARN/System.err(676): Can't dispatch DDM chunk 4d505251: no handler defined
08-20 04:06:56.967: INFO/jdwp(692): received file descriptor 33 from ADB
08-20 04:06:57.026: INFO/jdwp(707): received file descriptor 25 from ADB
08-20 04:06:57.066: WARN/System.err(692): Can't dispatch DDM chunk 46454154: no handler defined
08-20 04:06:57.066: WARN/System.err(692): Can't dispatch DDM chunk 4d505251: no handler defined
08-20 04:07:04.906: WARN/System.err(707): Can't dispatch DDM chunk 46454154: no handler defined
08-20 04:07:04.936: WARN/System.err(707): Can't dispatch DDM chunk 4d505251: no handler defined
08-20 04:07:04.957: INFO/jdwp(761): received file descriptor 26 from ADB
08-20 04:07:05.546: DEBUG/dalvikvm(658): GC freed 2935 objects / 166312 bytes in 264ms
08-20 04:07:09.946: DEBUG/dalvikvm(761): GC freed 3289 objects / 117368 bytes in 170ms
08-20 04:07:10.607: DEBUG/dalvikvm(692): GC freed 3379 objects / 202040 bytes in 326ms
08-20 04:07:15.486: DEBUG/dalvikvm(633): GC freed 2236 objects / 120792 bytes in 205ms
08-20 04:07:16.897: WARN/System.err(761): Can't dispatch DDM chunk 46454154: no handler defined
08-20 04:07:16.897: WARN/System.err(761): Can't dispatch DDM chunk 4d505251: no handler defined
08-20 04:07:30.386: DEBUG/dalvikvm(761): GC freed 4161 objects / 124992 bytes in 184ms
08-20 04:07:35.147: WARN/WindowManager(587): No window to dispatch pointer action 0
08-20 04:07:35.246: WARN/WindowManager(587): No window to dispatch pointer action 1
08-20 04:07:35.346: WARN/WindowManager(587): No window to dispatch pointer action 0
08-20 04:07:35.466: WARN/WindowManager(587): No window to dispatch pointer action 1
08-20 04:07:35.707: WARN/WindowManager(587): No window to dispatch pointer action 0
08-20 04:07:35.827: WARN/WindowManager(587): No window to dispatch pointer action 1

Each time after i click the empty space, this error message can look

08-20 04:07:35.707: WARN/WindowManager(587): No window to dispatch pointer action 0
    08-20 04:07:35.827: WARN/WindowManager(587): No window to dispatch pointer action 1

Many thanks to take your time and effort reading through this! I be thankful!!

-Dayne