hi i have created an app. I already have a coding to find the latitude and longitude of a place. But in that coding i have button and when the button is clicked the values get displayed
In my app i have a button named start, when i click the button it moves over to a new page. In that page i have placed two layouts. In one layout i have placed some textview and edit text data with a ok button. In the other layout i have placed the coding of latitude and longitude.
Now when i click the start button the new page must get opened and at the same time the current latitude and longitude must get displayed.
pls give help me in performing both the operations in the same page.......
You don't need AsyncTask. You just have to update your views with information you obtain in
loadCoords();
.Try something like:
P.S. Just a point: Java Convention advices you to name methods in Camel Case, like this: loadCoords() - the first letter is always small.
You can use a
Toast
message to display the latitude and longitude, and then should open another activity.TheToast
will remain visible for a particular time, and you'll also get your activity opened.