Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In my Activity:
- Intent location = new Intent(context,LocationService.class);
- getApplicationContext.startService(location);
- ls = LocationService.ls;
- ls.start(); --> This statement is giving me nullPointerException.
- LocationService:
- public static LocationService ls;
- public void onCreate(Bundle savedInstanceState) {
- running = true;
- ls = this;
- }
- public int onStartCommand(Intent intent, int x, int y)
- {
- ls = this;
- running = true;
- return START_STICKY;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement