java - Notifications won't open file -
i tring open uploaded file through notifications, not working, notification appears once click on it, nothing happens.
this notification part of code :
uri uri= ringtonemanager.getdefaulturi(ringtonemanager.type_notification); intent = new intent(); i.setaction(android.content.intent.action_view); i.addflags(intent.flag_activity_new_task); i.setdataandtype(uri.parse("file://"+file_path), f.getstring("type") ); i.setflags(intent.flag_activity_clear_top); pendingintent contentintent = pendingintent.getactivity(main.this, 0, , 0); mnotifymanager = (notificationmanager) getsystemservice(context.notification_service); mbuilder = new notificationcompat.builder( babupmain.this); mbuilder.setcontenttitle("test").addaction(android.r.drawable.alert_dark_frame, "hi",contentintent) .setcontenttext("click open file") .setlights(0xfff89829, 300, 5000) .setonlyalertonce(true) .setsound(uri) .setsmallicon(android.r.drawable.ic_input_add); mnotifymanager.notify( notification_id , mbuilder.build());
i haven't used notificationcompat, don't know if this, created intent , had use
pendingintent contentintent = pendingintent.getactivity(this,0, i, pendingintent.flag_cancel_current);
to tie intent of opening file notification
Comments
Post a Comment