ImportActivity intent filters. (#466)

* ImportActivity intent filters.

* add intent_filter to work with Locus and OsmAnd

* extent intent filters

Co-authored-by: Peter Storch <peter.storch@gmail.com>
This commit is contained in:
Román Martínez
2020-10-21 22:52:39 +02:00
committed by GitHub
parent 917b8f4056
commit d4483819eb
2 changed files with 152 additions and 15 deletions
@@ -16,6 +16,7 @@
package de.dennisguse.opentracks.io.file.importer;
import android.content.ClipData;
import android.os.Bundle;
import androidx.annotation.NonNull;
@@ -44,6 +45,8 @@ public class ImportActivity extends FragmentActivity implements ImportProgressDi
if (savedInstanceState == null || !savedInstanceState.getBoolean(BUNDLE_ACTIVITY_RECREATED, false)) {
if (getIntent().getData() != null) {
ImportProgressDialogFragment.showDialog(getSupportFragmentManager(), getIntent().getData(), false);
} else if (getIntent().getClipData().getItemCount() > 0) {
ImportProgressDialogFragment.showDialog(getSupportFragmentManager(), getIntent().getClipData().getItemAt(0).getUri(), false);
} else {
// Started from DirectoryChooserActivity
ImportProgressDialogFragment.showDialog(getSupportFragmentManager(), getIntent().getParcelableExtra(EXTRA_DIRECTORY_URI_KEY), true);