Commit 210b7b7e authored by Nicolas Fella's avatar Nicolas Fella

Show notification when file cannot be opened because no app is available

parent 5bf0118b
......@@ -354,4 +354,5 @@
<string name="plugin_photo_desc">Launch the camera app to ease taking and transferring pictures</string>
<string name="findmyphone_preference_key_ringtone" translatable="false">findmyphone_ringtone</string>
<string name="no_app_for_opening">No suitable app found to open this file</string>
</resources>
......@@ -21,6 +21,7 @@
package org.kde.kdeconnect.Plugins.SharePlugin;
import android.app.DownloadManager;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
......@@ -202,6 +203,10 @@ public class CompositeReceiveFileJob extends BackgroundJob<Device, Void> {
shareNotification.show();
}
reportResult(null);
} catch (ActivityNotFoundException e) {
shareNotification.setFinished(getDevice().getContext().getString(R.string.no_app_for_opening));
shareNotification.show();
} catch (Exception e) {
isRunning = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment