0

So i have public class GPSTracker extends Activity { .. } and after that public final class GPSTracker implements LocationListener . the second one i found in a tutorial, the whole location tracking process happens here, but as far as i understand, i need to include onCreateOptionsMenu and onCreate methods in order to make it work. The question is; How do i put these two together?

here is the full code, so that you can analyze better.

Any help would be much appreciated. Thanks in advance.

Luch Filip
  • 1,103
  • 3
  • 13
  • 13

2 Answers2

1

Cou can combine them as following:

public class GPSTracker extends Activity implements LocationListener {
}

and put all your code of both classes into this one. The onCreatOptionsMenu is only necessary if you're using a menu. The onCreate should be used because your GPSTracker class is an Activity.

Mirco Widmer
  • 2,139
  • 1
  • 20
  • 44
0

You can not have two public classes in same file but you may include another public class within one. public class A{ public class B{ //some code } }

OR

You can have following implementation. public class GPSTracker extends Activity implements LocationListener{}

genius
  • 37
  • 6