// Path: src/org/oscim/app/App.java
// public class App extends Application {
// 
// 	public final static Logger log = LoggerFactory.getLogger(App.class);
// 
// 	public static Map map;
// 	public static MapView view;
// 	public static Resources res;
// 	public static TileMap activity;
// 
// 	public static POISearch poiSearch;
// 	public static RouteSearch routeSearch;
// 
// 	@Override
// 	public void onCreate() {
// 		super.onCreate();
// 		res = getResources();
// 	}
// 
// 	public static void lockOrientation(Activity activity) {
// 		Display display = ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
// 		int rotation = display.getRotation();
// 		int tempOrientation = activity.getResources().getConfiguration().orientation;
// 		int orientation = 0;
// 		switch (tempOrientation)
// 		{
// 			case Configuration.ORIENTATION_LANDSCAPE:
// 				if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_90)
// 					orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
// 				else
// 					orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
// 				break;
// 			case Configuration.ORIENTATION_PORTRAIT:
// 				if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_270)
// 					orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
// 				else
// 					orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
// 		}
// 		activity.setRequestedOrientation(orientation);
// 	}
// }


import org.oscim.app.App;
import org.oscim.app.R;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
/*
 * Copyright 2010, 2011, 2012 mapsforge.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.app.preferences;



/**
 * Activity to edit the application preferences.
 */
public class EditPreferences extends PreferenceActivity {
	@SuppressWarnings("deprecation")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferences);

		Preference button = (Preference) findPreference("clear_cache");
		button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
			@Override
			public boolean onPreferenceClick(Preference arg0) {
// Path: src/org/oscim/app/App.java
// public class App extends Application {
// 
// 	public final static Logger log = LoggerFactory.getLogger(App.class);
// 
// 	public static Map map;
// 	public static MapView view;
// 	public static Resources res;
// 	public static TileMap activity;
// 
// 	public static POISearch poiSearch;
// 	public static RouteSearch routeSearch;
// 
// 	@Override
// 	public void onCreate() {
// 		super.onCreate();
// 		res = getResources();
// 	}
// 
// 	public static void lockOrientation(Activity activity) {
// 		Display display = ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
// 		int rotation = display.getRotation();
// 		int tempOrientation = activity.getResources().getConfiguration().orientation;
// 		int orientation = 0;
// 		switch (tempOrientation)
// 		{
// 			case Configuration.ORIENTATION_LANDSCAPE:
// 				if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_90)
// 					orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
// 				else
// 					orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE;
// 				break;
// 			case Configuration.ORIENTATION_PORTRAIT:
// 				if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_270)
// 					orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
// 				else
// 					orientation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
// 		}
// 		activity.setRequestedOrientation(orientation);
// 	}
// }


// Path: src/org/oscim/app/preferences/EditPreferences.java
import org.oscim.app.App;
import org.oscim.app.R;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;

/*
 * Copyright 2010, 2011, 2012 mapsforge.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.app.preferences;



/**
 * Activity to edit the application preferences.
 */
public class EditPreferences extends PreferenceActivity {
	@SuppressWarnings("deprecation")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferences);

		Preference button = (Preference) findPreference("clear_cache");
		button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
			@Override
			public boolean onPreferenceClick(Preference arg0) {
				App.activity.getMapLayers().deleteCache();