0

I want to select multiple item simultaneously, and import to my app, for example 3 gpx to my app and when I finish the first one, the app throws me the second one until the array finish (the number of gpx, files, I have) I'm using OSMAND and something of the clipData or get gpxUri is not working

osmandapi\OsmAndHelper.java is where the function of intent is

 private void sendRequest(OsmAndIntentBuilder intentBuilder) {
        try {
            Uri uri = intentBuilder.getUri();
            Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            intent.addFlags(intentBuilder.getFlags());
            intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
            Map<String, String> extraData = intentBuilder.getExtraData();
 
 if (extraData != null) {
             for (String key : extraData.keySet()) {
             intent.putExtra(key, extraData.get(key));
             }
            }
            if (intentBuilder.getGpxUri() != null) {
            ClipData clipData = ClipData.newRawUri("Gpx", intentBuilder.getGpxUri());
            intent.setClipData(clipData);
            intentBuilder.getGpxUri();
          for (int i= 0; i< ClipData.newRawUri("Gpx", intentBuilder.getGpxUri()).getItemCount(); i++) {
               }
            }
           if (isIntentSafe(intent)){
                mActivity.startActivityForResult(intent, mRequestCode);
            } else {
                mOsmandMissingListener.osmandMissing();
            }
} catch (Exception e) {
            Toast.makeText(mActivity, e.getMessage(), Toast.LENGTH_LONG).show();
        }
    }

Thank you.

  • 1
    What do you want to do with ACTION_VIEW? That is for one file only so using EXTRA_ALLOW_MULTIPLE makes no sense. Further we have no idea why you mention an onActivityResult() or ClipData. Rewrite your post and mention/write the code in the sequence it is executed. – blackapps Jan 17 '23 at 09:24

0 Answers0