Now, it is best to use IntentService for this task like the official documentation has given an example of. To support my claim, here is a quote from the Android documentation: “The method is synchronous and may take a long time to do its work, so you should not call it from the main, user interface (UI) thread of your app.” As noted by many here (and in the Android documentation here), anything relating to Geocoder needs to be done apart from the main thread of your app.List listAdresses = geocoder.getFromLocationName("London", 10) Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault())
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |