|
|
@ -3494,18 +3494,20 @@ public class Helper {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
if (owner.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
|
|
|
if (owner.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
|
|
|
if (selected == null)
|
|
|
|
if (selected == null) {
|
|
|
|
intf.onNothingSelected();
|
|
|
|
intf.onNothingSelected();
|
|
|
|
else
|
|
|
|
ToastEx.makeText(activity, R.string.title_no_key_selected, Toast.LENGTH_LONG).show();
|
|
|
|
|
|
|
|
} else
|
|
|
|
intf.onSelected(selected);
|
|
|
|
intf.onSelected(selected);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
owner.getLifecycle().addObserver(new LifecycleObserver() {
|
|
|
|
owner.getLifecycle().addObserver(new LifecycleObserver() {
|
|
|
|
@OnLifecycleEvent(Lifecycle.Event.ON_START)
|
|
|
|
@OnLifecycleEvent(Lifecycle.Event.ON_START)
|
|
|
|
public void onStart() {
|
|
|
|
public void onStart() {
|
|
|
|
owner.getLifecycle().removeObserver(this);
|
|
|
|
owner.getLifecycle().removeObserver(this);
|
|
|
|
if (selected == null)
|
|
|
|
if (selected == null) {
|
|
|
|
intf.onNothingSelected();
|
|
|
|
intf.onNothingSelected();
|
|
|
|
else
|
|
|
|
ToastEx.makeText(activity, R.string.title_no_key_selected, Toast.LENGTH_LONG).show();
|
|
|
|
|
|
|
|
} else
|
|
|
|
intf.onSelected(selected);
|
|
|
|
intf.onSelected(selected);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|