Sunday, 15 January 2012

android - Calling method with a button and bad GPS data -



android - Calling method with a button and bad GPS data -

i've application logs info start using method. have button shows toast @ moment, start logging.

the main question is, how start method, using button?

also gps puts me @ -9, 53 in tanzania. not in tanzania, i'm along way away.

any help great.

thanks.

code

private onclicklistener startlistener = new onclicklistener() { public void onclick(view v) { toast.maketext(getapplicationcontext(), "the start button clicked.", toast.length_long).show(); } public void onlocationchanged(location arg0) { double longitude = arg0.getlongitude(); double latitude = arg0.getlatitude(); string long = new decimalformat("##.##").format(longitude); string lat = new decimalformat("##.##").format(latitude); location = long + "," + lat; locationtext.settext(location); }

answer of question 2: exchanged latitude , longitude, 53, -9 near limerick, ireland. question 1: basic tutorial show how phone call method triggered button click.

android button gps

No comments:

Post a Comment