Android LocationManager encapsulation issue -
Android LocationManager encapsulation issue -
i'm trying phone call requestlocationupdates method eclipse says arguments wrong.
the main activity set :
public class mainactivity extends activity implements locationlistener{... }
and code errors :
final locationmanager locationmanager = (locationmanager) getsystemservice(context.location_service); tracklocation.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { boolean tracking = false; if (!tracking){ locationmanager.requestlocationupdates(locationmanager.gps_provider, 0, 0, this); } else { // } } });
the locationmanager.... line works fine outside onclicklistener.
what should right parameter fix?
thanks in advance
replace "this" "mainactivity.this".
if have "this", passing in onclicklistener instead of activity.
android encapsulation locationmanager
Comments
Post a Comment