大家好,我有一个经纬度数据库。我想将这些值(纬度和经度)从我的数据库放到我的变量TUJUAN
中。我尝试使用此代码,但我不知道如何从我的数据库中查询.. 这是我的代码
public class Arahkan extends FragmentActivity{
static public LatLng TUJUAN;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.arahkan);
DataBaseHelper myDbHelper = new DataBaseHelper(
this.getApplicationContext());
myDbHelper = new DataBaseHelper(this);
try {
myDbHelper.createDataBase();
} catch (IOException ioe) {
throw new Error("Unable to create database");
}
// Open the database
try {
myDbHelper.openDataBase();
} catch (SQLException sqle) {
sqle.printStackTrace();
}
TextView arahkantext = (TextView) findViewById(R.id.text_arah2);
String tampilarah = getIntent().getExtras().getString("key");
if(tampilarah.equalsIgnoreCase("Balong Dalem")){
tempat="Balong Dalem";
}
if(tampilarah.equalsIgnoreCase("Curug Bangkong")){
tempat="CUrug Bangkong"
}
.........
Cursor cur = db.rawQuery(
"SELECT latlng FROM data WHERE nama_tempat='" + tempat + "';", null); I DONT KNOW IN THIS LINE
TUJUAN = new LatLng(???); /// I DONT KNOW IN THIS LINE
}