Hi everyone,

I have developed an app in which there is an *editbox(Search_Location*) and
a search *button(Find_Loc_Button)* and below  a google map. When i launch
the app it works fine with showing google map. But my problem is when i
intend to search a location in the editbox and press the button there is no
change in google map. I have debugged but there show a message *"Couldn't
get connection factory client" . *My code in the button event is:

        btnSearch.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                String addressInput = adress.getText().toString();
                try {
                        List<Address> foundAdresses =
gc.getFromLocationName( addressInput, 5);
                        if(foundAdresses !=null && foundAdresses.size()>0){
                        for (int i = 0; i < foundAdresses.size(); ++i) {
                            Address x = foundAdresses.get(i);
                            lat = x.getLatitude();
                            lon = x.getLongitude();
                            navigateToLocation((lat * 1000000), (lon *
1000000), myMap);
                      }
                    }
                   }
                 catch (Exception e) {
               }
            }
        });

      public static void navigateToLocation(double latitude, double
longitude, MapView mv) {
                      GeoPoint p = new GeoPoint((int) latitude, (int)
longitude);
                      mv.displayZoomControls(true);
                      MapController mc = mv.getController();
                      mc.animateTo(p);
                      int zoomlevel = mv.getMaxZoomLevel();
                      mc.setZoom(zoomlevel - 1);
                      mv.setSatellite(false);
       }
 I should also mention you that i have used *apiKey  *in my *main.xml *file
and  *INTERNET*, *ACCESS_FINE_LOCATION, **ACCESS_COARSE_LOCATION *permissions
in my *manifest *file. I have used Toast to see the Address after clicking
the button but nothing was happened.
So what can i do now?
Please Help me.
*With Regards
Md. Fazla Rabbi*

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to