[J2SE] android menu 資料連結問題?
各位大大好
小弟我 目前在寫android 的應用程式
目前遇到了一個問題 因為我要運用 下面一個類別的變數 該如何把
menu 與 下面一個類別做連結呢? 謝謝 我是用Eclipse 的
public boolean onOptionsItemSelected(MenuItem item)
{
switch(item.getItemId()){
case 1:
onLocationChanged(Location loc);-------> X 顯示錯誤
int s= 5; -------->示意
return true;
case 2:
onLocationChanged(Location loc);-------------------->X 顯示錯誤
int s= 10; ------> 示意
return true;
}
return true;
}
public class MyLocationListener implements LocationListener {
public void onLocationChanged(Location loc) {
if (loc != null) {
//show location in TextView
TextView TV =(TextView)findViewById(R.id.latlon);
String strlat = Double.toString(loc.getLatitude());
String strlon = Double.toString(loc.getLongitude());
String imageUrl = s; --------> 要讓menu 來修改 s變書
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.111.80.31
推
04/02 02:01, , 1F
04/02 02:01, 1F
推
04/02 02:04, , 2F
04/02 02:04, 2F
※ 編輯: PHILLLU 來自: 140.111.80.31 (04/02 02:10)
→
04/02 02:12, , 3F
04/02 02:12, 3F
→
04/02 02:14, , 4F
04/02 02:14, 4F
討論串 (同標題文章)