Bug fixes
This commit is contained in:
parent
c459dc9a8d
commit
1540c289c8
@ -60,7 +60,7 @@ public class MyLocationService extends Service {
|
||||
private void trackGPS() {
|
||||
handler.postDelayed(runnable = new Runnable() {
|
||||
public void run() {
|
||||
handler.postDelayed(runnable, delay);
|
||||
|
||||
System.out.println("Inside handler");
|
||||
/*Intent intent = new Intent(MainActivity.this,MyLocationService.class);
|
||||
startService(intent);*/
|
||||
@ -75,6 +75,8 @@ public class MyLocationService extends Service {
|
||||
|
||||
}
|
||||
}, delay);
|
||||
handler.postDelayed(runnable, delay);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,6 @@
|
||||
package ru.visionlab.constant;
|
||||
|
||||
public class LatLong {
|
||||
public static final double newLat= 22.5118;
|
||||
public static final double newLong= 88.4001;
|
||||
}
|
@ -3,4 +3,5 @@ package ru.visionlab.constant;
|
||||
public class Url {
|
||||
|
||||
public static final String Base_url= "https://reqres.in/api/";
|
||||
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ import android.widget.Toast;
|
||||
|
||||
import cn.pedant.SweetAlert.SweetAlertDialog;
|
||||
import ru.Service.MyLocationService;
|
||||
import ru.visionlab.constant.LatLong;
|
||||
import ru.visionlab.femdemo.login.LoginActivity;
|
||||
import ru.visionlab.femdemo.register.RegisterActivityNew;
|
||||
import ru.visionlab.femdemo.views.EmployeeActivity;
|
||||
@ -243,11 +244,10 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
double lat=LocationGps.getLatitude();
|
||||
double longi=LocationGps.getLongitude();
|
||||
|
||||
double newLat = 22.5150;
|
||||
double newLong = 88.3930;
|
||||
|
||||
|
||||
float[] results = new float[1];
|
||||
Location.distanceBetween(lat,longi,newLat,newLong,results);
|
||||
Location.distanceBetween(lat,longi,LatLong.newLat,LatLong.newLong,results);
|
||||
distance = results[0];
|
||||
Toast.makeText(this,String.valueOf(distance)+" metres from location",Toast.LENGTH_SHORT).show();
|
||||
if(distance > 400){
|
||||
@ -267,14 +267,10 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
double lat=LocationNetwork.getLatitude();
|
||||
double longi=LocationNetwork.getLongitude();
|
||||
|
||||
double newLat = 22.5118;
|
||||
double newLong = 88.4001;
|
||||
|
||||
/*double newLat = 22.5150;
|
||||
double newLong = 88.3930; */
|
||||
|
||||
float[] results = new float[1];
|
||||
Location.distanceBetween(lat,longi,newLat,newLong,results);
|
||||
Location.distanceBetween(lat,longi, LatLong.newLat,LatLong.newLong,results);
|
||||
float distance = results[0];
|
||||
Toast.makeText(this,String.valueOf(distance)+" metres from location",Toast.LENGTH_LONG).show();
|
||||
if(distance > 400){
|
||||
@ -396,5 +392,10 @@ public class CheckInActivity extends AppCompatActivity {
|
||||
.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed () {
|
||||
Toast.makeText(CheckInActivity.this,"Ongoing process . Please logout to go back.",Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user