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

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -