-1
我已經編寫了地理編碼代碼..但不幸的是它不起作用,即屏幕上沒有顯示任何東西......我附上代碼.. 。可有人告訴我什麼是在code..thanks因爲你不告訴任何顯示在屏幕上被顯示在屏幕上android geocoder ---當我運行應用程序時,屏幕上沒有任何顯示
public class geocoder extends Activity {
// private TextView output;
private LocationManager mgr;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mgr = (LocationManager) getSystemService(LOCATION_SERVICE);
Geocoder geocoder = new Geocoder(this, Locale.US);
// output = (TextView) findViewById(R.id.output);
String staddress = "Georgia Tech, Atlanta, GA";
// List<Address> loc = null;
try{
List<Address> loc = geocoder.getFromLocationName(staddress, 5);
}
catch(IOException e) {
Log.e("IOException", e.getMessage());
}
// output = (TextView) findViewById(R.id.output);
}
}