mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Move hotspot help ActivityResultLauncher into method
This commit is contained in:
@@ -48,10 +48,8 @@ public class HotspotHelpFragment extends Fragment {
|
||||
|
||||
private HotspotViewModel viewModel;
|
||||
private final ActivityResultLauncher<String> launcher =
|
||||
registerForActivityResult(new CreateDocument(), uri -> {
|
||||
showButton();
|
||||
if (uri != null) viewModel.exportApk(uri);
|
||||
});
|
||||
registerForActivityResult(new CreateDocument(),
|
||||
this::onDocumentCreated);
|
||||
private Button button;
|
||||
private ProgressBar progressBar;
|
||||
|
||||
@@ -88,6 +86,11 @@ public class HotspotHelpFragment extends Fragment {
|
||||
viewModel.getSavedApkToUri().observeEvent(this, this::shareUri);
|
||||
}
|
||||
|
||||
private void onDocumentCreated(@Nullable Uri uri) {
|
||||
showButton();
|
||||
if (uri != null) viewModel.exportApk(uri);
|
||||
}
|
||||
|
||||
private void shareUri(Uri uri) {
|
||||
Intent i = new Intent(ACTION_SEND);
|
||||
i.putExtra(EXTRA_STREAM, uri);
|
||||
|
||||
Reference in New Issue
Block a user