示例#1
0
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {

    // Instantiate preference manager
    prefs = PreferenceManager.getDefaultSharedPreferences(this);

    // Instantiate Application class and call the setLanguage method
    BusPlus bp = (BusPlus) getApplicationContext();
    bp.setLanguage(prefs.getString("language", "sr"));

    new MenuInflater(this).inflate(R.menu.option_map, menu);

    return (super.onCreateOptionsMenu(menu));
  }
示例#2
0
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Instantiate preference manager
    prefs = PreferenceManager.getDefaultSharedPreferences(this);

    // Instantiate Application class and call the setLanguage method
    BusPlus bp = (BusPlus) getApplicationContext();
    bp.setLanguage(prefs.getString("language", "sr"));

    // Sets the view for this activity
    setContentView(R.layout.map);

    // Instantiate helper object for work on database
    helper = new DataBaseHelper(this);

    // Set up some map view parameters
    mapView = (MyMapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(true);
    mapView.getController().setZoom(17);
    mapView.setOnZoomListener(
        new MyMapView.OnZoomListener() {
          @Override
          public void onZoom() {
            if (all) drawViewMarkers();
          }
        });
    centerMap(44.818061, 20.456524);

    // Set Satellite view on our map, if the preference has been set
    mapView.setSatellite(prefs.getBoolean("map_satellite", false));

    // Get the best location provider and start location thread
    initializeLocationAndStartGpsThread();
  }