This is my code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_getgps);
Intent cas = getIntent();
String setcas = cas.getStringExtra(Login.EXTRA_CAS);
//Toast.makeText(getApplicationContext(), setcas, Toast.LENGTH_SHORT).show(); -na overenie ci sa premenna preniesla z predchadzajucej aktvity
Timer timer = new Timer( );
//timer.scheduleAtFixedRate(void getit, long 5000, long 5000);
timer.schedule(new TimerTask() {
@Override
public void run() {
}
}, Long.parseLong(setcas));}
public void getit(Bundle savedInstanceState){
LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener();
mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 10, mlocListener);
I would like to call method getit from run. but idk how to do it, when I tried use code from method getit in method run, it didn t accept because it found some error with Bundle savedInstanceState... Can someone what I should do?
Thanks