我有一個ListView,當我點擊單個項目時,它會轉到單個項目視圖。在每個單個項目查看頁面中都有一個位置按鈕。當點擊位置按鈕時,我需要進入谷歌地圖。android:geo使用intent的位置
長和緯度像這樣保存在數據庫中。 我想要動態地調用此列中的每個單元 ,數據被存儲這樣的,
的數據被存儲爲解析數據庫內的對象,而不是作爲字符串
{「lat」:25.1250241,「lng」:55.3752069}
任何人都知道請告訴我如何從中獲取數據?
btn = (Button) findViewById(R.id.button5) ;
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
btn = (Button) findViewById(R.id.button56) ;
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
String data = String.format("geo:%s,%s", latitude, longitude);
intent.setData(Uri.parse(data));
startActivity(intent);
}
});
意味着你需要從中獲取數據的代碼 「{」 LAT 「:25.1250241,」lng「:55.3752069}」this String。 –
是的,這是一個單元格內的數據@Chetan –
看到我的回答在 –