thanks for the help,
"I'm stumped"
Jeff
Preamble: database in and out is working; cursor is returning correct columns, this code is based on Notepad.
I am attempting to display one column from a table to a textView.
I have been trying everything, but still the same error. .
Any thoughts??
thanks
Code:
java.lang.IllegalArgumentException: column '_id' does not exist
***
import static android.provider.BaseColumns._ID;
...
private static final String[] PROJECTION = new String[] {
_ID, //BASECOLUMNS
//Meds.sSOURCE,
Meds.sPRODUCT, };
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.mphrlist_item,
cursor,
new String[] { "PRODUCT" }, //from
new int[] { android.R.id.text1 }); //to
OUTPUT FROM THE LOG TRACE
11-19 18:10:29.457: ERROR/MPhrList(194): OnCreate
11-19 18:10:29.887: ERROR/MPhrList(194): OnCreate cursor.getCount = 4
11-19 18:10:29.897: ERROR/MPhrList(194): OnCreate cursor.getColumnName0 = _ID
11-19 18:10:29.897: ERROR/MPhrList(194): OnCreate cursor.getColumnName1 = PRODUCT
11-19 18:10:39.296: WARN/ActivityManager(50): Launch timeout has expired, giving up wake lock!
- Show quoted text -
Manifest.xml
<activity android:name=".MPhrList"
android:label="@string/title_mphrs_list"
>
<!-- view all meds-->
<intent-filter android:label="@string/new_med_label">
<action android:name="android.intent.action.INSERT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/vnd.csi.meds" />
</intent-filter>
</activity>
mphrlist.xml
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_vertical"
android:paddingLeft="5dip"
android:singleLine="true"
/>


. Is it working now?
