Android samples: improve implementation, #32

This commit is contained in:
Emux
2016-07-05 21:54:18 +03:00
parent 11caa2a2d3
commit 0061b3ae7e
3 changed files with 81 additions and 85 deletions

View File

@@ -1,16 +1,29 @@
/*
* Copyright 2016 devemux86
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.oscim.android.test;
import org.oscim.android.MapPreferences;
import org.oscim.android.MapView;
import org.oscim.map.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
public abstract class MapActivity extends ActionBarActivity {
public static final Logger log = LoggerFactory.getLogger(MapActivity.class);
public abstract class MapActivity extends AppCompatActivity {
MapView mMapView;
Map mMap;
MapPreferences mPrefs;
@@ -29,6 +42,8 @@ public abstract class MapActivity extends ActionBarActivity {
super.onCreate(savedInstanceState);
setContentView(mContentView);
setTitle(getClass().getSimpleName());
mMapView = (MapView) findViewById(R.id.mapView);
mMap = mMapView.map();
mPrefs = new MapPreferences(MapActivity.class.getName(), this);