how to show draw route on andriod
I created six categories on my map's menu .. . I want to show the contents of the six categories of map on one route at my application, but from yesterday my  application always force close  ..can anybody help me ..?
this is my source code :


	
	//mendeklarasikan setiap variabel dan objek-objek yang akan digunakan dalam class
	private SQLiteDatabase db = null;
	private Cursor tmiiCursor = null;
	private DataTmii datatmii = null;
	private LinearLayout Linear01;
	private Spinner dari,ke;
	public static final String ID = "id";
	public static final String KODE = "kode";
	public static final String OBJ = "obj";
	public static final String KET = "ket";
	public static final String LAT = "lat";
	public static final String LNG = "lng";

		static final String[] TMII= new String[] {"Anjungan","Museum","Tempat Ibadah","Taman","Wahana Rekreasi","Kereta Gantung","SHS-23 Aeromovel Indonesia","Kereta Api Mini","Mobil Keliling"
		,"Perahu Angsa","Sepeda Keliling","Graha Wisata Remaja","Hotel Desa Wisata","Puri Caping Gunung","Pondok Pecel Madiun","Pasar Tiban","Gerbang Kalamakara"};

	static final String[] ANJUNGAN= new String[] {"Anjungan NAD","Anjungan Sumatra Utara","Anjungan Sumatra Barat","Anjungan Sumatra Selatan","Anjungan Kepulauan Riau","Anjungan Jambi","Anjungan Bengkulu","Anjungan Riau","Anjungan Bangka Belitung","Anjungan Lampung","Anjungan Banten"
		,"Anjungan DKI Jakarta","Anjungan Jawa Barat","Anjungan Jawa Tengah","Anjungan DI Yogyakarta","Anjungan Jawa Timur","Anjungan Bali","Anjungan Nusa Tenggara Barat","Anjungan Nusa Tenggara Timur","Anjungan Kalimantan Barat","Anjungan Kalimantan Selatan","Anjungan Kalimantan Timur"
		,"Anjungan Kalimantan Tengah","Anjungan Sulawesi Utara","Anjungan Gorontalo","Anjungan Sulawesi Tengah","Anjungan Sulawesi Barat","Anjungan Sulawesi Tenggara","Anjungan Maluku","Anjungan Maluku Utara","Anjungan Papua Barat","Anjungan Papua","Anjungan Sulawesi Selatan"};

	static final String[] MUSEUM= new String[] {"Museum Indonesia","Museum Asmat","Museum Pusaka","Museum Timor Timur","Museum Penerangan","Museum Perangko Indonesia","Museum Keprajuritan Indonesia","Museum Olahraga"
		,"Museum Fauna Komodo Indonesia","Museum Serangga","Museum Minyak Gas & Bumi","Museum Listrik dan Energi Baru","Museum Telekomunikasi","Museum Bayt Al Qur'an & Museum Istiqlal","Museum Museum Purna Bhakti Pertiwi","Museum Transportasi",};

	static final String[] TEMPATIBADAH= new String[] {"Masjid Pangeran Diponegoro","Gereja Katolik Santa Catharina","Gereja Kristen Protestan Haleluya","Pura Penataran Agung Kertabhumi","Wihara Arya Dwipa Arama","Sasono Adiroso Pangeran Sambernyowo","Klenteng Kong Miao"};	

	static final String[] TAMAN= new String[] {"Taman Prasasti APEC","Taman Reptilia","Taman Akuarium Air Tawar","Monumen Persahabatan Negara Non Blok","Taman Budaya Tionghoa","Taman Melati"
		,"Taman Kupu-Kupu","Taman Apotik Hidup","Taman Bekisar","Taman Burung","Taman Bunga Keong Mas","Taman Kaktus"};

	static final String[] REKREASI= new String[] {"Teater Tanah Airku","Desa Seni","Sasana Kriya","Snowbay","Istana Anak Indonesia","Pusat Peragaan IPTEK"
		,"Pemancingan Telaga Mina","Teater IMAX Keong Mas","Teater 4 Dimensi","Balon Udara Raksasa","Pasar Buku Langka"};

	String loadata;
	String dlat = "";
	String dlng = "";
	String klat ="";
	String klng ="";
	String spin_dari,spin_ke;
	
		TextView textView, keterangan;
        LinearLayout linearLayout;
        MapView mapView;
        View view;
        private Road mRoad;
        double ke_lat, ke_lng, dari_lat, dari_lng;

      //Methode onCreate ini dipanggil ketika aplikasi pertama kali dijalankan atau saat di-load.
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
             // Inisialisasi Database yang digunakan.
                ProgressDialog myProgressDialog = ProgressDialog.show(MapRouteActivity.this, "Loading", "Mohon Tunggu...!!!", true);
              	new Thread() { 
                      public void run() { 
                           try{ 
							 loadata = ListPeta.petapa;
                        	datatmii = new DataTmii(MapRouteActivity.this);
                       		db = datatmii.getWritableDatabase();
                       		datatmii.createTable(db);
                       		datatmii.generateData(db);   
                           } catch (Exception e) {  } 
                           // Dismiss the Dialog 
                      } 
                 }.start();
                 myProgressDialog.dismiss();
                 setContentView(R.layout.rutemap);
                 mapView = (MapView) findViewById(R.id.mapview);
                 mapView.setBuiltInZoomControls(true);

               //Inisialisasi objek-objek yang digunakan ke dalam variabel yang telah ditentukan dan tampilan awal peta.
                dari = (Spinner) findViewById(R.id.spin_dari);
                ke = (Spinner) findViewById(R.id.spin_ke);
				if (loadata=="tmii"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TMII);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TMII);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
				else if (loadata=="anjungan"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, ANJUNGAN);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, ANJUNGAN);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
				else if (loadata=="museum"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, MUSEUM);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, MUSEUM);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
				else if (loadata=="tempatibadah"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TEMPATIBADAH);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TEMPATIBADAH);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
				else if (loadata=="taman"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TAMAN);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TAMAN);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
			else if (loadata=="rekreasi"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, REKREASI);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, REKREASI);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
			}
        }
		
        public void Rutekan(final View view){
        	final ProgressDialog myProgressDialog = ProgressDialog.show(MapRouteActivity.this, "Loading", "Mohon Tunggu...!!!", true);
          	new Thread() { 
                  public void run() { 
                       try{
                    	   Thread.sleep(1000); 
                    	   spin_dari = dari.getSelectedItem().toString();
                    	   spin_ke = ke.getSelectedItem().toString();
    		
                    	   //Menentukan posisi objek awal dengan objek tujuan untuk memperoleh nilai koordinat keduanya dari database.
                    	  tmiiCursor = db.rawQuery("SELECT ID, OBJ, KET, LAT, LNG "
                    			   + "FROM tmii where OBJ='" + spin_dari
                    			   + "' ORDER BY OBJ", null);
                    	   if (tmiiCursor.moveToFirst()) {
                    		   dlat = tmiiCursor.getString(3);
                    		   dlng = tmiiCursor.getString(4);
                    		   for (; !tmiiCursor.isAfterLast(); tmiiCursor.moveToNext()) {
                    			   dlat = tmiiCursor.getString(3);
                    			   dlng = tmiiCursor.getString(4);
                    		   }
                    	   }
                    	   dari_lat = Double.parseDouble(dlat);
                    	   dari_lng = Double.parseDouble(dlng);
	        
                    	   tmiiCursor = db.rawQuery("SELECT ID, OBJ, KET, LAT, LNG "
                    			   + "FROM tmii where OBJ='" + spin_ke
                    			   + "' ORDER BY OBJ", null);
                    	   if (tmiiCursor.moveToFirst()) {
                    		   klat = tmiiCursor.getString(3);
                    		   klng = tmiiCursor.getString(4);
                    		   for (; !tmiiCursor.isAfterLast(); tmiiCursor.moveToNext()) {
                    			   klat = tmiiCursor.getString(3);
                    			   klng = tmiiCursor.getString(4);
                    		   }
                    	   }
                    	   ke_lat = Double.parseDouble(klat);
                    	   ke_lng = Double.parseDouble(klng);
        	
                    	   double fromLat = dari_lat, fromLon = dari_lng, toLat = ke_lat, toLon = ke_lng;
                    	   String url = RoadProvider.getUrl(fromLat, fromLon, toLat, toLon);
                    	   InputStream is = getConnection(url);
                    	   mRoad = RoadProvider.getRoute(is);
                    	   mHandler.sendEmptyMessage(0);
                       } catch (Exception e) {  } 
                       // Dismiss the Dialog
                       myProgressDialog.dismiss(); 
                  } 
             }.start();
             Linear01.setVisibility(view.GONE);
      	     keterangan.setText("Dari " + dari.getSelectedItem().toString() + " Ke " + ke.getSelectedItem().toString());
        }

        //Menangani informasi rute.
        Handler mHandler = new Handler() {
                public void handleMessage(android.os.Message msg) {
                        textView.setText(mRoad.mDescription);
                        MapOverlay mapOverlay = new MapOverlay(mRoad, mapView);
                        List<Overlay> listOfOverlays = mapView.getOverlays();
                        listOfOverlays.clear();
                        listOfOverlays.add(mapOverlay);
                        mapView.invalidate();
                };
        };

        private InputStream getConnection(String url) {
                InputStream is = null;
                try {
                        URLConnection conn = new URL(url).openConnection();
                        is = conn.getInputStream();
                } catch (MalformedURLException e) {
                        e.printStackTrace();
                } catch (IOException e) {
                        e.printStackTrace();
                }
                return is;
        }
        
        @Override
        public boolean onSearchRequested() {
        	Linear01.setVisibility(view.VISIBLE);
            return false;  // don't go ahead and show the search box
        }

        @Override
        protected boolean isRouteDisplayed() {
                return false;
        }
        
        public void onDestroy() {
    		super.onDestroy();
    		tmiiCursor.close();
    		db.close();
    	}



        ArrayList<GeoPoint> mPoints;

        public MapOverlay(Road road, MapView mv) {
                mRoad = road;
                if (road.mRoute.length > 0) {
                        mPoints = new ArrayList<GeoPoint>();
                        for (int i = 0; i < road.mRoute.length; i++) {
                                mPoints.add(new GeoPoint((int) (road.mRoute[i][1] * 1000000),
                                                (int) (road.mRoute[i][0] * 1000000)));
                        }
                        int moveToLat = (mPoints.get(0).getLatitudeE6() /*+ (mPoints.get(
                                        mPoints.size() - 1).getLatitudeE6() - mPoints.get(0)
                                        .getLatitudeE6()) / 2*/);
                        int moveToLong = (mPoints.get(0).getLongitudeE6() /*+ (mPoints.get(
                                        mPoints.size() - 1).getLongitudeE6() - mPoints.get(0)
                                        .getLongitudeE6()) / 2*/);
                        GeoPoint moveTo = new GeoPoint(moveToLat, moveToLong);

                        MapController mapController = mv.getController();
                        mapController.animateTo(moveTo);
                        mapController.setZoom(18);
                }
        }

        //Methode ini berfungsi menangani layer marker rute.
        @Override
        public boolean draw(Canvas canvas, MapView mv, boolean shadow, long when) {
                super.draw(canvas, mv, shadow);
                drawPath(mv, canvas);
                return true;
        }

      //Methode ini berfungsi menangani penggambaran marker rute.
        public void drawPath(MapView mv, Canvas canvas) {
                int x1 = -1, y1 = -1, x2 = -1, y2 = -1;
                Paint paint = new Paint();
                paint.setColor(Color.GREEN);
                paint.setStyle(Paint.Style.STROKE);
                paint.setStrokeWidth(3);
                for (int i = 0; i < mPoints.size(); i++) {
                        Point point = new Point();
                        mv.getProjection().toPixels(mPoints.get(i), point);
                        x2 = point.x;
                        y2 = point.y;
                        if (i > 0) {
                                canvas.drawLine(x1, y1, x2, y2, paint);
                        }
                        x1 = x2;
                        y1 = y2;
                }
        }
        
        
}


if there's someone help me.. please show where's my mistake.. thank u





how to show draw route on andriod
===

I created six categories on my map's menu .. . I want to show the contents of the six categories of map on one route at my application, but from yesterday my  application always force close  ..can anybody help me ..?
this is my source code :


	
	//mendeklarasikan setiap variabel dan objek-objek yang akan digunakan dalam class
	private SQLiteDatabase db = null;
	private Cursor tmiiCursor = null;
	private DataTmii datatmii = null;
	private LinearLayout Linear01;
	private Spinner dari,ke;
	public static final String ID = "id";
	public static final String KODE = "kode";
	public static final String OBJ = "obj";
	public static final String KET = "ket";
	public static final String LAT = "lat";
	public static final String LNG = "lng";

		static final String[] TMII= new String[] {"Anjungan","Museum","Tempat Ibadah","Taman","Wahana Rekreasi","Kereta Gantung","SHS-23 Aeromovel Indonesia","Kereta Api Mini","Mobil Keliling"
		,"Perahu Angsa","Sepeda Keliling","Graha Wisata Remaja","Hotel Desa Wisata","Puri Caping Gunung","Pondok Pecel Madiun","Pasar Tiban","Gerbang Kalamakara"};

	static final String[] ANJUNGAN= new String[] {"Anjungan NAD","Anjungan Sumatra Utara","Anjungan Sumatra Barat","Anjungan Sumatra Selatan","Anjungan Kepulauan Riau","Anjungan Jambi","Anjungan Bengkulu","Anjungan Riau","Anjungan Bangka Belitung","Anjungan Lampung","Anjungan Banten"
		,"Anjungan DKI Jakarta","Anjungan Jawa Barat","Anjungan Jawa Tengah","Anjungan DI Yogyakarta","Anjungan Jawa Timur","Anjungan Bali","Anjungan Nusa Tenggara Barat","Anjungan Nusa Tenggara Timur","Anjungan Kalimantan Barat","Anjungan Kalimantan Selatan","Anjungan Kalimantan Timur"
		,"Anjungan Kalimantan Tengah","Anjungan Sulawesi Utara","Anjungan Gorontalo","Anjungan Sulawesi Tengah","Anjungan Sulawesi Barat","Anjungan Sulawesi Tenggara","Anjungan Maluku","Anjungan Maluku Utara","Anjungan Papua Barat","Anjungan Papua","Anjungan Sulawesi Selatan"};

	static final String[] MUSEUM= new String[] {"Museum Indonesia","Museum Asmat","Museum Pusaka","Museum Timor Timur","Museum Penerangan","Museum Perangko Indonesia","Museum Keprajuritan Indonesia","Museum Olahraga"
		,"Museum Fauna Komodo Indonesia","Museum Serangga","Museum Minyak Gas & Bumi","Museum Listrik dan Energi Baru","Museum Telekomunikasi","Museum Bayt Al Qur'an & Museum Istiqlal","Museum Museum Purna Bhakti Pertiwi","Museum Transportasi",};

	static final String[] TEMPATIBADAH= new String[] {"Masjid Pangeran Diponegoro","Gereja Katolik Santa Catharina","Gereja Kristen Protestan Haleluya","Pura Penataran Agung Kertabhumi","Wihara Arya Dwipa Arama","Sasono Adiroso Pangeran Sambernyowo","Klenteng Kong Miao"};	

	static final String[] TAMAN= new String[] {"Taman Prasasti APEC","Taman Reptilia","Taman Akuarium Air Tawar","Monumen Persahabatan Negara Non Blok","Taman Budaya Tionghoa","Taman Melati"
		,"Taman Kupu-Kupu","Taman Apotik Hidup","Taman Bekisar","Taman Burung","Taman Bunga Keong Mas","Taman Kaktus"};

	static final String[] REKREASI= new String[] {"Teater Tanah Airku","Desa Seni","Sasana Kriya","Snowbay","Istana Anak Indonesia","Pusat Peragaan IPTEK"
		,"Pemancingan Telaga Mina","Teater IMAX Keong Mas","Teater 4 Dimensi","Balon Udara Raksasa","Pasar Buku Langka"};

	String loadata;
	String dlat = "";
	String dlng = "";
	String klat ="";
	String klng ="";
	String spin_dari,spin_ke;
	
		TextView textView, keterangan;
        LinearLayout linearLayout;
        MapView mapView;
        View view;
        private Road mRoad;
        double ke_lat, ke_lng, dari_lat, dari_lng;

      //Methode onCreate ini dipanggil ketika aplikasi pertama kali dijalankan atau saat di-load.
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
             // Inisialisasi Database yang digunakan.
                ProgressDialog myProgressDialog = ProgressDialog.show(MapRouteActivity.this, "Loading", "Mohon Tunggu...!!!", true);
              	new Thread() { 
                      public void run() { 
                           try{ 
							 loadata = ListPeta.petapa;
                        	datatmii = new DataTmii(MapRouteActivity.this);
                       		db = datatmii.getWritableDatabase();
                       		datatmii.createTable(db);
                       		datatmii.generateData(db);   
                           } catch (Exception e) {  } 
                           // Dismiss the Dialog 
                      } 
                 }.start();
                 myProgressDialog.dismiss();
                 setContentView(R.layout.rutemap);
                 mapView = (MapView) findViewById(R.id.mapview);
                 mapView.setBuiltInZoomControls(true);

               //Inisialisasi objek-objek yang digunakan ke dalam variabel yang telah ditentukan dan tampilan awal peta.
                dari = (Spinner) findViewById(R.id.spin_dari);
                ke = (Spinner) findViewById(R.id.spin_ke);
				if (loadata=="tmii"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TMII);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TMII);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
				else if (loadata=="anjungan"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, ANJUNGAN);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, ANJUNGAN);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
				else if (loadata=="museum"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, MUSEUM);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, MUSEUM);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
				else if (loadata=="tempatibadah"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TEMPATIBADAH);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TEMPATIBADAH);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
				else if (loadata=="taman"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TAMAN);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, TAMAN);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
        }
			else if (loadata=="rekreasi"){
                ArrayAdapter adapter_dari = new ArrayAdapter(this,android.R.layout.simple_spinner_item, REKREASI);
                adapter_dari.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                dari.setAdapter(adapter_dari);
                ArrayAdapter adapter_ke = new ArrayAdapter(this,android.R.layout.simple_spinner_item, REKREASI);
                adapter_ke.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                ke.setAdapter(adapter_ke);
                textView = (TextView) findViewById(R.id.description);
                keterangan = (TextView) findViewById(R.id.ket);
                Linear01=(LinearLayout) findViewById(R.id.linear01);
			}
        }
		
        public void Rutekan(final View view){
        	final ProgressDialog myProgressDialog = ProgressDialog.show(MapRouteActivity.this, "Loading", "Mohon Tunggu...!!!", true);
          	new Thread() { 
                  public void run() { 
                       try{
                    	   Thread.sleep(1000); 
                    	   spin_dari = dari.getSelectedItem().toString();
                    	   spin_ke = ke.getSelectedItem().toString();
    		
                    	   //Menentukan posisi objek awal dengan objek tujuan untuk memperoleh nilai koordinat keduanya dari database.
                    	  tmiiCursor = db.rawQuery("SELECT ID, OBJ, KET, LAT, LNG "
                    			   + "FROM tmii where OBJ='" + spin_dari
                    			   + "' ORDER BY OBJ", null);
                    	   if (tmiiCursor.moveToFirst()) {
                    		   dlat = tmiiCursor.getString(3);
                    		   dlng = tmiiCursor.getString(4);
                    		   for (; !tmiiCursor.isAfterLast(); tmiiCursor.moveToNext()) {
                    			   dlat = tmiiCursor.getString(3);
                    			   dlng = tmiiCursor.getString(4);
                    		   }
                    	   }
                    	   dari_lat = Double.parseDouble(dlat);
                    	   dari_lng = Double.parseDouble(dlng);
	        
                    	   tmiiCursor = db.rawQuery("SELECT ID, OBJ, KET, LAT, LNG "
                    			   + "FROM tmii where OBJ='" + spin_ke
                    			   + "' ORDER BY OBJ", null);
                    	   if (tmiiCursor.moveToFirst()) {
                    		   klat = tmiiCursor.getString(3);
                    		   klng = tmiiCursor.getString(4);
                    		   for (; !tmiiCursor.isAfterLast(); tmiiCursor.moveToNext()) {
                    			   klat = tmiiCursor.getString(3);
                    			   klng = tmiiCursor.getString(4);
                    		   }
                    	   }
                    	   ke_lat = Double.parseDouble(klat);
                    	   ke_lng = Double.parseDouble(klng);
        	
                    	   double fromLat = dari_lat, fromLon = dari_lng, toLat = ke_lat, toLon = ke_lng;
                    	   String url = RoadProvider.getUrl(fromLat, fromLon, toLat, toLon);
                    	   InputStream is = getConnection(url);
                    	   mRoad = RoadProvider.getRoute(is);
                    	   mHandler.sendEmptyMessage(0);
                       } catch (Exception e) {  } 
                       // Dismiss the Dialog
                       myProgressDialog.dismiss(); 
                  } 
             }.start();
             Linear01.setVisibility(view.GONE);
      	     keterangan.setText("Dari " + dari.getSelectedItem().toString() + " Ke " + ke.getSelectedItem().toString());
        }

        //Menangani informasi rute.
        Handler mHandler = new Handler() {
                public void handleMessage(android.os.Message msg) {
                        textView.setText(mRoad.mDescription);
                        MapOverlay mapOverlay = new MapOverlay(mRoad, mapView);
                        List<Overlay> listOfOverlays = mapView.getOverlays();
                        listOfOverlays.clear();
                        listOfOverlays.add(mapOverlay);
                        mapView.invalidate();
                };
        };

        private InputStream getConnection(String url) {
                InputStream is = null;
                try {
                        URLConnection conn = new URL(url).openConnection();
                        is = conn.getInputStream();
                } catch (MalformedURLException e) {
                        e.printStackTrace();
                } catch (IOException e) {
                        e.printStackTrace();
                }
                return is;
        }
        
        @Override
        public boolean onSearchRequested() {
        	Linear01.setVisibility(view.VISIBLE);
            return false;  // don't go ahead and show the search box
        }

        @Override
        protected boolean isRouteDisplayed() {
                return false;
        }
        
        public void onDestroy() {
    		super.onDestroy();
    		tmiiCursor.close();
    		db.close();
    	}



        ArrayList<GeoPoint> mPoints;

        public MapOverlay(Road road, MapView mv) {
                mRoad = road;
                if (road.mRoute.length > 0) {
                        mPoints = new ArrayList<GeoPoint>();
                        for (int i = 0; i < road.mRoute.length; i++) {
                                mPoints.add(new GeoPoint((int) (road.mRoute[i][1] * 1000000),
                                                (int) (road.mRoute[i][0] * 1000000)));
                        }
                        int moveToLat = (mPoints.get(0).getLatitudeE6() /*+ (mPoints.get(
                                        mPoints.size() - 1).getLatitudeE6() - mPoints.get(0)
                                        .getLatitudeE6()) / 2*/);
                        int moveToLong = (mPoints.get(0).getLongitudeE6() /*+ (mPoints.get(
                                        mPoints.size() - 1).getLongitudeE6() - mPoints.get(0)
                                        .getLongitudeE6()) / 2*/);
                        GeoPoint moveTo = new GeoPoint(moveToLat, moveToLong);

                        MapController mapController = mv.getController();
                        mapController.animateTo(moveTo);
                        mapController.setZoom(18);
                }
        }

        //Methode ini berfungsi menangani layer marker rute.
        @Override
        public boolean draw(Canvas canvas, MapView mv, boolean shadow, long when) {
                super.draw(canvas, mv, shadow);
                drawPath(mv, canvas);
                return true;
        }

      //Methode ini berfungsi menangani penggambaran marker rute.
        public void drawPath(MapView mv, Canvas canvas) {
                int x1 = -1, y1 = -1, x2 = -1, y2 = -1;
                Paint paint = new Paint();
                paint.setColor(Color.GREEN);
                paint.setStyle(Paint.Style.STROKE);
                paint.setStrokeWidth(3);
                for (int i = 0; i < mPoints.size(); i++) {
                        Point point = new Point();
                        mv.getProjection().toPixels(mPoints.get(i), point);
                        x2 = point.x;
                        y2 = point.y;
                        if (i > 0) {
                                canvas.drawLine(x1, y1, x2, y2, paint);
                        }
                        x1 = x2;
                        y1 = y2;
                }
        }
        
        
}


if there's someone help me.. please show where's my mistake.. thank u




