QQ發送位置(高德地圖)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="#00b4ef"
        android:orientation="horizontal" >

        <ImageButton
            android:id="@+id/mapaddress_back"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="4"
            android:background="#00000000"
            android:src="@mipmap/left_back" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:layout_gravity="center_vertical"
            android:layout_weight="1.5"
            android:background="@drawable/fillet"
            android:orientation="horizontal" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginLeft="10dp"
                android:src="@mipmap/seek" />

            <Button
                android:id="@+id/mapaddress_search"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginLeft="10dp"
                android:background="#00000000"
                android:gravity="center_vertical"
                android:hint="搜索小區/學校/大廈" />
        </LinearLayout>

        <Button
            android:id="@+id/sendlocation"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="3.5"
            android:background="#00000000"
            android:clickable="true"
            android:text="發送" />
    </LinearLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <com.amap.api.maps.MapView
            android:id="@+id/mapaddress_map"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1.5" >
        </com.amap.api.maps.MapView>

        <ImageButton
            android:id="@+id/mapaddress_centerpoint"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:background="#00000000"
            android:src="@mipmap/ingbig" />
    </FrameLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:padding="10dp" >

            <ImageView
                android:layout_width="20dp"
                android:layout_height="10dp"
                android:layout_gravity="center_vertical"
                android:src="@mipmap/gps" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="8dp"
                android:orientation="vertical" >

                <TextView
                    android:id="@+id/mapaddress_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="請選擇地址"
                    android:textColor="@android:color/holo_red_light"
                    android:textSize="18dp" />

                <TextView
                    android:id="@+id/mapaddress_miaoshu"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text=""
                    android:textColor="@android:color/holo_red_light"
                    android:textSize="15dp" />
            </LinearLayout>
        </LinearLayout>

        <ListView
            android:id="@+id/addresslistview"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@android:color/white"
            android:dividerHeight="1dp" />
    </LinearLayout>

</LinearLayout>
mapview
package com.changim.app.ui.chat;

import java.io.FileOutputStream;
import java.util.List;
import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationClientOption.AMapLocationMode;
import com.amap.api.location.AMapLocationListener;
import com.amap.api.maps.AMap;
import com.amap.api.maps.AMap.OnCameraChangeListener;
import com.amap.api.maps.AMap.OnMapScreenShotListener;
import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.LocationSource;
import com.amap.api.maps.MapView;
import com.amap.api.maps.model.CameraPosition;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.MarkerOptions;
import com.amap.api.services.core.LatLonPoint;
import com.amap.api.services.core.PoiItem;
import com.amap.api.services.poisearch.PoiResult;
import com.amap.api.services.poisearch.PoiSearch;
import com.amap.api.services.poisearch.PoiSearch.OnPoiSearchListener;
import com.amap.api.services.poisearch.PoiSearch.SearchBound;
import com.changim.app.R;

import com.changim.app.ui.adapter.AddressAdapter;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class MapAddress extends Activity implements LocationSource, OnCameraChangeListener, AMapLocationListener, OnPoiSearchListener,OnClickListener,OnMapScreenShotListener {

    public  AMap aMap;//地圖對象
    private MapView mapView;//地圖控件
    private OnLocationChangedListener mListener;//位置移動監聽
    private AMapLocationClient mlocationClient;
    private AMapLocationClientOption mLocationOption;
    private static MarkerOptions markerOption;//地圖標記設置項

    private PoiSearch poiSearch;//關鍵字搜索
    private List<PoiItem> list;//存放位置信息
    private ListView addresslistview;//地址選擇列表
    private double longitude,latitude;//經度,維度;
    ImageButton back;
    Button search;//關鍵字搜索按鈕
    TextView name,miaoshu;//地點名稱 位置描述
    Button sendlocation;//分享位置按鈕
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉標題欄
        setContentView(R.layout.mapview);
        info();
        mapView.onCreate(savedInstanceState); // 此方法必須重寫

        init();
        addresslistview.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                                    int position, long id) {
                name.setText(list.get(position).getTitle());
                miaoshu.setText(list.get(position).getSnippet());
                longitude=list.get(position).getLatLonPoint().getLongitude();
                latitude=list.get(position).getLatLonPoint().getLatitude();
            }
        });

    }

    /**
     * 控件信息初始化
     */
    private void info(){
        back=(ImageButton)findViewById(R.id.mapaddress_back);
        mapView = (MapView) findViewById(R.id.mapaddress_map);
        addresslistview=(ListView) findViewById(R.id.addresslistview);
        search=(Button) findViewById(R.id.mapaddress_search);
        name=(TextView) findViewById(R.id.mapaddress_name);
        miaoshu=(TextView) findViewById(R.id.mapaddress_miaoshu);
        sendlocation=(Button) findViewById(R.id.sendlocation);
        search.setOnClickListener(this);
        sendlocation.setOnClickListener(this);
        back.setOnClickListener(this);
    }

    /**
     * 初始化AMap對象
     */
    private void init() {
        if (aMap == null) {
            aMap = mapView.getMap();
            aMap.moveCamera(CameraUpdateFactory.zoomTo(15));
            setUpMap();
        }}
    private void setUpMap() {
        aMap.setLocationSource(MapAddress.this);// 設置定位監聽
        aMap.getUiSettings().setMyLocationButtonEnabled(true);// 設置默認定位按鈕是否顯示
        aMap.setMyLocationEnabled(true);// 設置爲true表示顯示定位層並可觸發定位,false表示隱藏定位層並不可觸發定位,默認是false
        // 設置定位的類型爲定位模式 ,能夠由定位、跟隨或地圖根據面向方向旋轉幾種
        aMap.setMyLocationType(AMap.LOCATION_TYPE_LOCATE);
        aMap.setOnCameraChangeListener(this);


    }
    /**
     * 地圖移動,經緯度改變的監聽
     */
    @Override
    public void onCameraChange(CameraPosition arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onCameraChangeFinish(CameraPosition arg0) {
        // TODO Auto-generated method stub
        LatLonPoint latp=new LatLonPoint(arg0.target.latitude,arg0.target.longitude);
        PoiSearch(latp);
    }

    public void PoiSearch(LatLonPoint lp){
        PoiSearch.Query query = new PoiSearch.Query("","餐飲服務|商務住宅|生活服務","");// 第一個參數表示搜索字符串,第二個參數表示poi搜索類型,第三個參數表示poi搜索區域(空字符串表明全國)
        query.setPageSize(15);// 設置每頁最多返回多少條poiitem
        query.setPageNum(0);// 設置查第一頁
        poiSearch = new PoiSearch(this,query);
        poiSearch.setOnPoiSearchListener(this);
        poiSearch.setBound(new SearchBound(lp, 500, true));//
        poiSearch.searchPOIAsyn();// 異步搜索
    }

    @Override
    public void onPoiSearched(PoiResult arg0, int arg1) {
        list=arg0.getPois();
        AddressAdapter adapter=new AddressAdapter(MapAddress.this,list);
        addresslistview.setAdapter(adapter);
        adapter.notifyDataSetChanged();
    }
    /**
     * 方法必須重寫
     */



    protected void onResume() {
        super.onResume();
        mapView.onResume();
    }

    /**
     * 方法必須重寫
     */
    @Override
    protected void onPause() {
        super.onPause();
        mapView.onPause();
        deactivate();
    }

    /**
     * 方法必須重寫
     */
    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        mapView.onSaveInstanceState(outState);
    }

    /**
     * 方法必須重寫
     */
    @Override
    protected void onDestroy() {
        super.onDestroy();
        mapView.onDestroy();
        if(null != mlocationClient){
            mlocationClient.onDestroy();
        }
    }
    /**
     * 定位成功後回調函數
     */

    public void onLocationChanged(AMapLocation arg0) {
        // TODO Auto-generated method stub

        if (mListener != null && arg0 != null) {
            if (arg0 != null
                    && arg0.getErrorCode() == 0) {

                mListener.onLocationChanged(arg0);// 顯示系統小藍點


            } else {
                String errText = "定位失敗," + arg0.getErrorCode()+ ": " + arg0.getErrorInfo();
                Toast.makeText(this,"定位失敗,請點擊手動定位",Toast.LENGTH_LONG).show();
                Log.e("AmapErr",errText);

            }
        }

    }
    /**
     * 激活定位
     */
    @Override
    public void activate(OnLocationChangedListener arg0) {
        // TODO Auto-generated method stub

        mListener = arg0;
        if (mlocationClient == null) {
            mlocationClient =new AMapLocationClient(this);
            mLocationOption = new AMapLocationClientOption();
            //設置定位監聽
            mlocationClient.setLocationListener(this);
            mLocationOption.setInterval(500000);
            //設置爲高精度定位模式
            mLocationOption.setLocationMode(AMapLocationMode.Hight_Accuracy);
            //設置定位參數
            mlocationClient.setLocationOption(mLocationOption);
            // 此方法爲每隔固定時間會發起一次定位請求,爲了減小電量消耗或網絡流量消耗,
            // 注意設置合適的定位時間的間隔(最小間隔支持爲2000ms),而且在合適時間調用stopLocation()方法來取消定位請求
            // 在定位結束後,在合適的生命週期調用onDestroy()方法
            // 在單次定位狀況下,定位不管成功與否,都無需調用stopLocation()方法移除請求,定位sdk內部會移除
            mlocationClient.startLocation();
        }

    }
    /**
     * 中止定位
     */
    @Override
    public void deactivate() {
        // TODO Auto-generated method stub
        mListener = null;
        if (mlocationClient != null) {
            mlocationClient.stopLocation();
            mlocationClient.onDestroy();
        }
        mlocationClient = null;
    }

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        switch (v.getId()) {
            case R.id.mapaddress_search:
                Intent in=new Intent(this,SearchAddress.class);
                startActivityForResult(in,3001);
                break;
            case R.id.sendlocation:
                if(!miaoshu.getText().toString().equals("")){
                    aMap.getMapScreenShot( this);
                }
                else{
                    Toast.makeText(this,"請選擇地址後再分享",Toast.LENGTH_LONG).show();
                }
                break;
            case R.id.mapaddress_back:
                Intent intent=new Intent();
                intent.putExtra("longitude",0);
                setResult(6600, intent);
                finish();
                break;
            default:
                break;
        }

    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        // TODO Auto-generated method stub
        super.onActivityResult(requestCode, resultCode, data);
        if(!data.getStringExtra("name").equals("")){
            LatLng latp=new LatLng(data.getDoubleExtra("latitude",0),data.getDoubleExtra("longitude",0));
            aMap.moveCamera(CameraUpdateFactory.newLatLng(latp));
            aMap.moveCamera(CameraUpdateFactory.zoomTo(18));

        }
    }

    @Override
    public void onMapScreenShot(Bitmap arg0) {
        // TODO Auto-generated method stub

        try {
            FileOutputStream    out = new FileOutputStream(Environment.getExternalStorageDirectory()+"/"+"locationmap.png");
            if (null != out) {
                arg0.compress(Bitmap.CompressFormat.PNG, 100, out);
                out.flush();
                out.close();
                Toast.makeText(this, "地理位置圖片文件已保存至SDCard下", Toast.LENGTH_LONG).show();
                Intent intent=new Intent();
                intent.putExtra("longitude", longitude);
                intent.putExtra("latitude", latitude);
                intent.putExtra("name", name.getText().toString());
                intent.putExtra("miaoshu", miaoshu.getText().toString());
                intent.putExtra("locationimgpath", Environment.getExternalStorageDirectory() + "/" + "locationmap.png");
                setResult(6600, intent);
                finish();
            }
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            Toast.makeText(this, "沒有sdcard或者sdcard不可用", Toast.LENGTH_LONG).show();
        }


    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {

        if (keyCode == KeyEvent.KEYCODE_BACK
                && event.getRepeatCount() == 0) {
            //do something...
            Intent intent=new Intent();
            intent.putExtra("longitude",0.00);
            setResult(6600, intent);
            finish();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
MapAddressActivity
package com.changim.app.ui.adapter;

import java.util.List;

import com.amap.api.services.core.PoiItem;
import com.changim.app.R;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class AddressAdapter extends BaseAdapter{
    private List<PoiItem>tipList;
    LayoutInflater  flater;

    
    Context context;
    
    public AddressAdapter (Context context,List<PoiItem> tipList) {
        // TODO Auto-generated method stub
        flater=LayoutInflater.from(context);
        this.tipList=tipList;
        
        
        
    }
    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return tipList.size();
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        convertView=flater.inflate(R.layout.mapaddress_left_item,null);
        TextView name,miaoshu;
        name=(TextView) convertView.findViewById(R.id.mapaddress_left_item_name);
        miaoshu=(TextView) convertView.findViewById(R.id.mapaddress_left_item_miaoshu);
        
        
            name.setText(tipList.get(position).getTitle());
            miaoshu.setText(tipList.get(position).getSnippet());
        
        if(position==0){
            //name.setTextColor(Color.RED);
            //miaoshu.setTextColor(Color.RED);
        }
        return convertView;
    }
    

}
AddressAdapter
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" 
    android:padding="10dp"
    android:gravity="center">
    
    <TextView
        android:id="@+id/searchaddressname"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
         android:text="gg"
         android:textSize="23px"/>
 
    <TextView
        android:layout_marginTop="15dp"
        android:id="@+id/searchaddressmiaoshu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="gg"
        android:textSize="16px"/>

</LinearLayout>
address_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    
    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="10dp">

    <ImageView
        android:layout_width="20dp"
        android:layout_height="10dp"
        android:layout_gravity="center_vertical"
        android:src="@mipmap/gps"/>

   <LinearLayout
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_marginLeft="8dp"
       android:orientation="vertical" >
 
    <TextView
        android:id="@+id/mapaddress_left_item_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="gg"
        android:textSize="18dp" />
 
    <TextView
        android:id="@+id/mapaddress_left_item_miaoshu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="gg"
        android:textColor="@android:color/darker_gray"
        android:textSize="15dp" />

        </LinearLayout>
    </LinearLayout>
</LinearLayout>
mapaddress_left_item.xml
package com.changim.app.ui.chat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.changim.app.ui.adapter.SearchAddressAdapter;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;

import com.amap.api.maps.AMap;
import com.amap.api.maps.AMap.InfoWindowAdapter;
import com.amap.api.maps.AMap.OnMarkerClickListener;
import com.amap.api.maps.AMapUtils;
import com.amap.api.maps.SupportMapFragment;
import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.NaviPara;
import com.amap.api.maps.overlay.PoiOverlay;
import com.amap.api.services.core.AMapException;
import com.amap.api.services.core.PoiItem;
import com.amap.api.services.core.SuggestionCity;
import com.amap.api.services.help.Inputtips;
import com.amap.api.services.help.Inputtips.InputtipsListener;
import com.amap.api.services.help.Tip;
import com.amap.api.services.poisearch.PoiResult;
import com.amap.api.services.poisearch.PoiSearch;
import com.amap.api.services.poisearch.PoiSearch.OnPoiSearchListener;
import com.changim.app.R;


/**
 * AMapV1地圖中簡單介紹poisearch搜索
 */
public class SearchAddress extends Activity implements
        TextWatcher,
        OnPoiSearchListener {

    private AutoCompleteTextView searchText;// 輸入搜索關鍵字
    private PoiResult poiResult; // poi返回的結果
    private int currentPage = 0;// 當前頁面,從0開始計數
    private PoiSearch.Query query;// Poi查詢條件類
    private PoiSearch poiSearch;// POI搜索
    private ListView lv;
    private List<Tip> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.address);
        searchText = (AutoCompleteTextView) findViewById(R.id.searchaddress);
        lv=(ListView) findViewById(R.id.address_list);
        searchText.addTextChangedListener(this);// 添加文本輸入框監聽事件

        lv.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                                    int position, long id) {
                // TODO Auto-generated method stub
                System.out.println("00000000000000000000000");
                System.out.println(list.get(position).getName());
                System.out.println(list.get(position).getPoiID());
                System.out.println(list.get(position).getPoint());
                System.out.println(list.get(position).getAdcode());
                Intent intent=new Intent(SearchAddress.this,MapAddress.class);
                intent.putExtra("name",list.get(position).getName());
                intent.putExtra("miaoshu",list.get(position).getDistrict());
                intent.putExtra("latitude",list.get(position).getPoint().getLatitude());
                intent.putExtra("longitude",list.get(position).getPoint().getLongitude());
                setResult(3001,intent);
                finish();
            }
        });


    }


    public void afterTextChanged(Editable s) {

    }


    public void beforeTextChanged(CharSequence s, int start, int count,
                                  int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
        String newText = s.toString().trim();
        Inputtips inputTips = new Inputtips(SearchAddress.this,
                new InputtipsListener() {

                    @Override
                    public void onGetInputtips(List<Tip> tipList, int rCode) {
                        if (rCode == 0) {// 正確返回
                            //List<String> listString = new ArrayList<String>();
                        
                            /*for (int i = 0; i < tipList.size(); i++) {
                        
                                listString.add(tipList.get(i).getDistrict());
                                
                            }*/
                            list=tipList;
                            SearchAddressAdapter adapter=new SearchAddressAdapter(SearchAddress.this, tipList);
                            lv.setAdapter(adapter);
                            adapter.notifyDataSetChanged();
                        }
                    }
                });
        try {
            inputTips.requestInputtips(newText,"成都");// 第一個參數表示提示關鍵字,第二個參數默認表明全國,也能夠爲城市區號

        } catch (AMapException e) {
            e.printStackTrace();
        }
    }


    @Override
    public void onPoiSearched(PoiResult arg0, int arg1) {
        // TODO Auto-generated method stub

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        // TODO Auto-generated method stub
        Intent intent=new Intent(SearchAddress.this,MapAddress.class);
        intent.putExtra("name","");
        setResult(3001,intent);
        finish();
        return super.onKeyDown(keyCode, event);
    }





}
SearchAddress
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="#00b4ef"
        android:orientation="horizontal" >

        <ImageButton
            android:id="@+id/mapaddress_back"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="4"
            android:background="#00000000"
            android:src="@mipmap/left_back" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:layout_gravity="center_vertical"
            android:orientation="horizontal"
            android:layout_weight="2" 
            android:background="@drawable/fillet">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:src="@mipmap/seek"
                android:layout_marginLeft="5dp"/>

           
        <AutoCompleteTextView
            android:id="@+id/searchaddress"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginLeft="5.0dip"
          android:background="@null"
            android:completionThreshold="1"
            android:dropDownVerticalOffset="1.0dip"
            android:hint="請輸入關鍵字"
            android:imeOptions="actionDone"
            android:inputType="text|textAutoComplete"
            android:maxLength="20"
            android:paddingRight="37.0dip"
            android:singleLine="true"
            android:textColor="#000000"
            android:textSize="16.0sp" />

           

        </LinearLayout>

        <Button
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:layout_weight="3.5"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="8dp"
            android:layout_marginRight="5dp"
            android:layout_marginBottom="8dp"
            android:layout_gravity="center_vertical"
            android:textSize="20dp"
            android:textColor="@android:color/white"
            android:background="@drawable/sure"
            android:text="取消"/>
        
    </LinearLayout>

    <ListView
        android:id="@+id/address_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>

</LinearLayout>
address.xml
相關文章
相關標籤/搜索