これが私のデータベース ヘルパーです (KEY_NAME = ? のときに KEY_LOCATION を選択する必要があります)。
public nranges getCafego(String cafesname) {
DataAccessClass dataAcessClass = new DataAccessClass(con);
SQLiteDatabase db = dataAcessClass.getReadableDatabase();
Cursor cursor = db.query(TABLE_NAME, new String[] { KEY_ID,
KEY_NAME, KEY_LOCATION },
KEY_NAME + "=?", new String[] { String.valueOf(cafesname) }, null, null,
null, null);
if (cursor != null)
cursor.moveToFirst();
nranges rng = new nranges();
rng.setId(Integer.parseInt(cursor.getString(cursor
.getColumnIndex(KEY_ID))));
rng.setName(cursor.getString(cursor
.getColumnIndex(KEY_NAME)));
rng.setLocation(cursor.getString(cursor
.getColumnIndex(KEY_LOCATION)));
// return Note
return rng;
}
そして、これがKEY_LOCATIONを文字列として取得し、テキストビューで提供する必要がある私のアクティビティです
Intent i=getIntent();
String MyCafeName =i.getExtras().getString("MyCafeName");
txtcafename.setText(MyCafeName);
nrangehelper bud3=new nrangehelper(cafelistselected.this); // my database helper which name is (nrangehelper)
bud3.getCafego(MyCafeName); //Mycafename is the name of cafe which i need to select to get its location
// what to do next?????