文件名称:全国城市检索
文件大小:135KB
文件格式:RAR
更新时间:2018-01-17 09:30:25
city
package cc.lifelink.cn;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
public class City_cnActivity extends Activity {
private DBManager dbm;
private SQLiteDatabase db;
private Spinner provinceSpinner;
private Spinner citySpinner=null;
private Spinner districtSpinner=null;
private String province=null;
private String city=null;
private String district=null;
/*------------------*/
// private TextView provinceView;
// private TextView cityView;
// private TextView districtView;
// private ImageView provinceImageView;
// private ImageView cityImageView;
// private ImageView districtImageView;
//
// private PopupWindow mPopupWindow;
// private ListView provinceListView
/*------------------*/
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
provinceSpinner=(Spinner)findViewById(R.id.spinner1);
citySpinner=(Spinner)findViewById(R.id.spinner2);
districtSpinner=(Spinner)findViewById(R.id.spinner3);
provinceSpinner.setPrompt("鐪?鐩磋緰甯?);
citySpinner.setPrompt("鍩庡競");
districtSpinner.setPrompt("鍦板尯");
provinceSpinner.setOnItemSelectedListener(new ProvinceOnSelectedListener());
districtSpinner.setOnItemSelectedListener(new DistrictOnSelectedListener());
citySpinner.setOnItemSelectedListener(new CityOnSelectedListener());
dbm = new DBManager(this);
provinceSpinner();
// initUI();
}
// private void initUI(){
// provinceView = (TextView) findViewById(R.id.tv_province);
// cityView = (TextView) findViewById(R.id.tv_city);
// districtView = (TextView) findViewById(R.id.tv_district);
// provinceImageView = (ImageView) findViewById(R.id.iv_province);
// cityImageView = (ImageView) findViewById(R.id.iv_city);
// districtImageView = (ImageView) findViewById(R.id.iv_district);
//
// LayoutInflater inflater = LayoutInflater.from(this);
// LinearLayout prvinceLayout = (LinearLayout) View.inflate(this, R.layout.popup_province, null);
// provinceListView = (ListView) prvinceLayout.findViewById(R.id.lv_province);
// mPopupWindow = new PopupWindow(prvinceLayout, 150, 280);
// mPopupWindow.setBackgroundDrawable(new BitmapDrawable());
// mPopupWindow.setFocusable(true);
// mPopupWindow.setOutsideTouchable(true);
// mPopupWindow.update();
// }
//
// private class ImageViewClickListener implements OnClickListener{
//
//
// @Override
// public void onClick(View v) {
// switch (v.getId()) {
// case R.id.iv_province:
// mPopupWindow.showAtLocation(mLinearLayout, Gravity.LEFT
// | Gravity.TOP, arrayOfInt[0]+10, arrayOfInt[1]+41);
// break;
// case R.id.iv_city:
//
// break;
// case R.id.iv_district:
//
// break;
//
// default:
// break;
// }
// }
//
// }
public void provinceSpinner(){
dbm.openDatabase();
db = dbm.getDatabase();
Cursor cursor=null;
List
【文件预览】:
city_cn
----.project(1KB)
----project.properties(361B)
----proguard.cfg(1KB)
----src()
--------cc()
----AndroidManifest.xml(733B)
----res()
--------raw()
--------drawable-ldpi()
--------drawable-hdpi()
--------drawable()
--------drawable-mdpi()
--------layout()
--------drawable-xhdpi()
--------values()
----.settings()
--------org.eclipse.wst.common.project.facet.core.xml(122B)
--------org.eclipse.jdt.core.prefs(364B)
--------org.eclipse.core.resources.prefs(88B)
----assets()
----gen()
--------cc()
----.classpath(700B)
----bin()
--------resources.ap_(53KB)
--------classes()
--------AndroidManifest.xml(733B)
--------dexedLibs()
--------jarlist.cache(119B)
--------res()
--------classes.dex(13KB)