android-notifications

How can i open Activity when notification click

倾然丶 夕夏残阳落幕 提交于 2020-08-25 08:05:06
问题 I need use notification with click event, i have notification method but this method don't open my activity. My code: private void sendNotification(String msg) { NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setContentTitle("EXX") .setSmallIcon(R.drawable.ic_launcher) .setStyle(new NotificationCompat.BigTextStyle() .bigText(msg)) .setContentText(msg) .setOngoing(true); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); } is this possible, thanks. 回答1

Android - How to create a Notification with Action [duplicate]

你说的曾经没有我的故事 提交于 2020-08-24 05:00:20
问题 This question already has answers here : Android notification .addAction deprecated in api 23 (4 answers) Closed 2 years ago . I'm creating a notification like this. Notification.Builder builder = new Notification.Builder(context); builder.setContentTitle(notifyMessage1) .setContentText(notifyMessage2) .setSmallIcon(R.mipmap.ic_launcher); Notification notification = builder.build(); I want to add a action to my notification with builder.addAction(); To realize addAction(icon, title,

Android 9 Api 28 Notification not showing

不问归期 提交于 2020-08-11 06:15:30
问题 I'm trying to show notification but it's not working for both Oreo and Pie version. It's working in kitkat version. I tried all the possible condition i can do, i don't know what else i'm missing here Here is my code: String idChannel = "my_channel_01"; Intent mainIntent; mainIntent = new Intent(ChecklistOptionActivity.this, CashCountOptionActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, mainIntent, 0); NotificationManager mNotificationManager =

Android 9 Api 28 Notification not showing

[亡魂溺海] 提交于 2020-08-11 06:14:33
问题 I'm trying to show notification but it's not working for both Oreo and Pie version. It's working in kitkat version. I tried all the possible condition i can do, i don't know what else i'm missing here Here is my code: String idChannel = "my_channel_01"; Intent mainIntent; mainIntent = new Intent(ChecklistOptionActivity.this, CashCountOptionActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, mainIntent, 0); NotificationManager mNotificationManager =

After notification, I would like to exit and go back to main screen?

情到浓时终转凉″ 提交于 2020-08-10 03:39:32
问题 I am testing out android notifications for the first time. I am on a page with a list of contacts and I click one to trigger my notification. The notification lands me on a page with these buttons snooze quick text I click snooze, then I click 10 minutes button and at this point, I call finish(); System.exit(0); which I found in this post https://stackoverflow.com/questions/6014028/closing-application-with-exit-button However, the app does not exit but rather goes back to the snooze and quick

How to add android notification channel id for flutter app to fix notification while app is on background

我只是一个虾纸丫 提交于 2020-08-02 09:58:21
问题 In my flutter app the function onResume and onLunch not working on android platform, while they work fine on IOS, i receive the following message on console instead of printed strings in those functions: "W/FirebaseMessaging(24847): Missing Default Notification Channel metadata in AndroidManifest. Default value will be used." onMessage function works fine, the problem is when the app is in background my guess is that it has something to do with android notification channel id which should be

How to add android notification channel id for flutter app to fix notification while app is on background

懵懂的女人 提交于 2020-08-02 09:57:33
问题 In my flutter app the function onResume and onLunch not working on android platform, while they work fine on IOS, i receive the following message on console instead of printed strings in those functions: "W/FirebaseMessaging(24847): Missing Default Notification Channel metadata in AndroidManifest. Default value will be used." onMessage function works fine, the problem is when the app is in background my guess is that it has something to do with android notification channel id which should be

Two or more Foreground Notification with Progress is replacing each other while updating its progress

北慕城南 提交于 2020-07-30 08:02:40
问题 I have a service that will run a upload task in foreground then showing a progress in the notification. Since a user may upload multiple times with different id request then there will be two or more foreground service that will run. Everything works fine but what I want is to show all task's notification with progress with this code. NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID_DEFAULT) .setSmallIcon(R.drawable.ic_file_upload_white_24dp)

Two or more Foreground Notification with Progress is replacing each other while updating its progress

杀马特。学长 韩版系。学妹 提交于 2020-07-30 08:02:12
问题 I have a service that will run a upload task in foreground then showing a progress in the notification. Since a user may upload multiple times with different id request then there will be two or more foreground service that will run. Everything works fine but what I want is to show all task's notification with progress with this code. NotificationCompat.Builder builder = new NotificationCompat.Builder(this, CHANNEL_ID_DEFAULT) .setSmallIcon(R.drawable.ic_file_upload_white_24dp)

How to play YouTube in Background with Android Webview?

泪湿孤枕 提交于 2020-07-19 06:22:32
问题 I want to "minimize" the application, leaving it in background doing exactly the same that when the ghostbutton mode is pressed when the user clicks a button (but don't finish it) How can I do that? So far I'm able to create a Activity . I've initialize my members and load the WebView with "https://www.youtube.com". I'm also able to create a Service that lets me minimize the Activity , but what I want is to minimize the Activity that I've my WebView loaded. Problem When the Activity paused,