If you think the Android project advanced-tourist-map listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Copyright 2010, 2011 mapsforge.org//fromwww.java2s.com
*
* 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.mapsforge.geocoding.widget;
import java.io.Serializable;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
publicclass State implements Serializable {
privatestaticfinallong serialVersionUID = 1909742759063153887L;
publicstaticfinalint VIEW_INPUT = 0;
publicstaticfinalint VIEW_RESULTS = 1;
publicint view = VIEW_INPUT;
publicint queryCity = -1;
// public int queryPlace = -1;
public String queryRoad = null;
publicvoid serializeToEditor(Editor editor) {
editor.clear();
editor.putInt("view", this.view);
editor.putInt("queryCity", this.queryCity);
// editor.putInt("queryPlace", this.queryPlace);
editor.putString("queryRoad", this.queryRoad);
editor.commit();
}
publicvoid deserializeFromPreferences(SharedPreferences preferences) {
this.view = preferences.getInt("view", VIEW_INPUT);
this.queryCity = preferences.getInt("queryCity", -1);
// this.queryPlace = preferences.getInt("queryPlace", -1);
this.queryRoad = preferences.getString("queryRoad", "");
}
}