Now I had created new xml file named as showchedulerlistview. and in
that I write following
<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android";
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:cacheColorHint="#00000000"
    android:id="@android:id/list">
</ListView>

and my Activity is as
public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.showchedulerlistview);
        System.out.println ("After setting setcontentview()");
        try
        {
                sampleDB =  this.openOrCreateDatabase(SAMPLE_DBNAME,
MODE_PRIVATE, null);
                System.out.println ("Inside try...");
                c = sampleDB.rawQuery ("SELECT _id,RoomName,
SwitchName,StartDate,TotalTime,StopDate,TotalStopTime FROM
SchedulerTable ORDER BY StartDate",null);

                System.out.println (c.getCount()+"%%%%");
                startManagingCursor(c);
                String[] columns = new String[] {"RoomName",
"SwitchName","StartDate","TotalTime","StopDate","TotalStopTime"};
                int[] names = new int[] {R.id.roomName,
R.id.switchName,R.id.startDate,R.id.totalTime,R.id.stopDate,R.id.totalStopTime};

                myAdapter = new SimpleCursorAdapter(this,
R.layout.showscheduler, c, columns,names);
                setListAdapter(myAdapter);
        }
        catch (SQLiteException se)
        {
                se.printStackTrace();
        }
    }

But still it add labels at each row. How is it?



On Jan 4, 8:07 am, TreKing <[email protected]> wrote:
> On Mon, Jan 3, 2011 at 9:02 PM, pramod.deore <[email protected]>wrote:
>
> > But my activity extends from ListActivity and when I add setContentView(),
> > then Logcat gives following error
>
> So follow the instructions - the error tells you exactly what the problem
> is.
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to