Open cahyofendhi opened 6 years ago
Same issue here. Followed like sample application. Also have tried compositeDisposable.dispose(); //may not needed compositeDisposable.clear();
onDestry() is calling fine on activity destroy. Problem is location sensor icon is not stopping showing.
Thanks, Any idea is welcome.
Followed the sample. Change the BaseActivity class like following. I have tested it. Please check and let me know if it works for you. Thanks.
package com.github.florent37.rxgps.sample;
import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity;
import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable;
public class BaseActivity extends AppCompatActivity {
private static CompositeDisposable compositeDisposable;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
compositeDisposable = new CompositeDisposable();
}
@Override
protected void onDestroy() {
compositeDisposable.clear();
super.onDestroy();
}
@Override
protected void onStop() {
compositeDisposable.clear();
super.onStop();
}
public void addDisposable(Disposable disposable){
this.compositeDisposable.add(disposable);
}
}
i have problem to stop get request location, after intent to another activity, request location still live, i have tried
in destroy but not working, how to solve this