mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Fixing fragment instance restore
This commit is contained in:
@@ -13,6 +13,7 @@ import android.widget.AdapterView.OnItemSelectedListener;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.ActivityComponent;
|
||||
import org.briarproject.android.fragment.BaseFragment;
|
||||
import org.briarproject.android.identity.CreateIdentityActivity;
|
||||
import org.briarproject.android.identity.LocalAuthorItem;
|
||||
@@ -57,9 +58,18 @@ public class ChooseIdentityFragment extends BaseFragment
|
||||
@Inject
|
||||
protected volatile IdentityManager identityManager;
|
||||
|
||||
@Inject
|
||||
public ChooseIdentityFragment() {
|
||||
public static ChooseIdentityFragment newInstance() {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
ChooseIdentityFragment fragment = new ChooseIdentityFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectFragment(ActivityComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,6 +114,11 @@ public class ChooseIdentityFragment extends BaseFragment
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
loadLocalAuthors();
|
||||
}
|
||||
|
||||
|
||||
@@ -94,11 +94,11 @@ public class KeyAgreementActivity extends BriarFragmentActivity implements
|
||||
STEPS));
|
||||
switch (step) {
|
||||
case STEP_QR:
|
||||
startFragment(activityComponent.newShowQrCodeFragment());
|
||||
startFragment(ShowQrCodeFragment.newInstance());
|
||||
break;
|
||||
case STEP_ID:
|
||||
default:
|
||||
startFragment(activityComponent.newChooseIdentityFragment());
|
||||
startFragment(ChooseIdentityFragment.newInstance());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.widget.Toast;
|
||||
import com.google.zxing.Result;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.AndroidComponent;
|
||||
import org.briarproject.android.ActivityComponent;
|
||||
import org.briarproject.android.api.AndroidExecutor;
|
||||
import org.briarproject.android.fragment.BaseEventFragment;
|
||||
import org.briarproject.android.util.CameraView;
|
||||
@@ -86,9 +86,18 @@ public class ShowQrCodeFragment extends BaseEventFragment
|
||||
private volatile KeyAgreementTask task;
|
||||
private volatile boolean waitingForBluetooth;
|
||||
|
||||
@Inject
|
||||
public ShowQrCodeFragment() {
|
||||
public static ShowQrCodeFragment newInstance() {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
|
||||
ShowQrCodeFragment fragment = new ShowQrCodeFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectFragment(ActivityComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user