Browse Source

Notifications fix

pull/24/head
Ezerous 8 years ago
parent
commit
f51787cc4d
  1. 11
      app/src/main/java/gr/thmmy/mthmmy/receiver/Receiver.java

11
app/src/main/java/gr/thmmy/mthmmy/receiver/Receiver.java

@ -65,14 +65,15 @@ public class Receiver extends BroadcastReceiver {
String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension( String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(
MimeTypeMap.getFileExtensionFromUrl(file.getAbsolutePath())); MimeTypeMap.getFileExtensionFromUrl(file.getAbsolutePath()));
Intent chooser = new Intent();
chooser.setAction(android.content.Intent.ACTION_VIEW); Intent chooserIntent = new Intent(Intent.ACTION_VIEW);
chooser.setDataAndType(Uri.fromFile(file), type); chooserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
chooser.setFlags(FLAG_ACTIVITY_NEW_TASK); chooserIntent.setDataAndType(Uri.fromFile(file), type);
chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Intent chooser = Intent.createChooser(chooserIntent, "Open With...");
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, chooser, PendingIntent.FLAG_CANCEL_CURRENT); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, chooser, PendingIntent.FLAG_CANCEL_CURRENT);
builder.setContentIntent(pendingIntent); builder.setContentIntent(pendingIntent);
} else } else
Report.w(TAG, "File doesn't exist."); Report.w(TAG, "File doesn't exist.");
} }

Loading…
Cancel
Save