Handling blocking issues
public class MainActivity extends Activity {
private GeoUniq geoUniq;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.geoUniq = GeoUniq.getInstance(this);
this.geoUniq.enable();
}
@Override
protected void onStart() {
super.onStart();
// This is to automatically handle location permission and other possible issues that would prevent GeoUniq to work correctly
this.setErrorListener();
}
/**
* Sets an Error listener to automatically handle those situations that would prevent the SDK to work properly
*/
private void setErrorListener(){
this.geoUniq.setErrorListener(new GeoUniq.IErrorListener() {
@Override
public void onError(GeoUniq.RequestResult requestResult) {
if(requestResult.hasResolution()){
requestResult.startResolution(MainActivity.this);
}
}
});
}
}Last updated
Was this helpful?