Advertisement
Guest User

Untitled

a guest
Apr 29th, 2012
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. In my Activity:
  2.  
  3. Intent location = new Intent(context,LocationService.class);
  4. getApplicationContext.startService(location);
  5. ls = LocationService.ls;
  6. ls.start(); --> This statement is giving me nullPointerException.
  7.  
  8. LocationService:
  9.  
  10.  
  11. public static LocationService ls;
  12. public void onCreate(Bundle savedInstanceState) {
  13. running = true;
  14. ls = this;
  15. }
  16. public int onStartCommand(Intent intent, int x, int y)
  17. {
  18. ls = this;
  19. running = true;
  20. return START_STICKY;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement