android-notifications

Android Notification with BigPicture style and BigText style

*爱你&永不变心* 提交于 2019-12-11 13:56:52
问题 Does anyone can help me out here.How to implement BigPictureStyle notification with multiline summary text in android.I am able to do by reducing text size which I don't want to.Please help me out on this. Can we combine two types of notification like big picture and big text style?Does any one know about this? 回答1: From your requirement i can figured out that you have to create custom layout for notification because basically you can not combine both BigPicture and BitText style so you have

Send an Android Notification before an Activity has been launched

怎甘沉沦 提交于 2019-12-11 13:07:43
问题 EDIT: The problem below disappeared with no changes in code. The notifications started appearing properly upon later reboots. This is at most an intermittent issue. I have an application that starts up a background service when the phone boots. After a certain event is detected, I would like to send a notification to the user, allowing the user to elect to start my MainActivity if the user taps on the notification. The problem is that Android seems to disallow sending notifications if no

Receive a notification issue and open a fragment

核能气质少年 提交于 2019-12-11 11:55:22
问题 I am working on application notification when a user receives a friend request notification and clicks on the notification the application has to redirect him to the user profile who have sent the request. I am facing more than a problem: first, if the application running in the background the receiver can receive a notification, but if the application is running, the receiver application crash after the sender sends a notification and it doesn't show the notification. the second problem is

Notification Won't Appear on Android TV

☆樱花仙子☆ 提交于 2019-12-11 11:52:23
问题 I am playing with notifications on Android TV. I have not been able to get a notification to appear on the screen though. I am using the Nexus player which is on Android 6.0. When I run this code on my phone, the notification appears. But on TV, the notification does not appear. Am I missing something? @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); showNotification(); } private void showNotification() {

Why MediaSession not changing the lock screen background (may be Bitmap size problem: read for more info)?

南笙酒味 提交于 2019-12-11 10:38:34
问题 I am stuck in this problem from last 6 days after deep research through media session I found this important line Album artwork for display on the lock screen. The image is a bitmap with a maximum size of 320x320dp (if larger, it's scaled down). Now, Here is my code of media session and Notification... MEDIA SESSION @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private void initMediaSession() { if (mediaSessionManager != null) return; mediaSessionManager = (android.media.session

How can I cancel unshown notifications in android

安稳与你 提交于 2019-12-11 10:08:48
问题 Hi I am new to notifications, I wrote this code for notifications. PendingIntent pendingIntent = PendingIntent.getActivity(context, leadidforstatus, myIntent, Intent.FLAG_ACTIVITY_NEW_TASK); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.noti) .setContentTitle("LMS notification") .setContentIntent(pendingIntent) .setContentText(intent.getStringExtra("messagenotify")) .setAutoCancel(true); i = (int) System.currentTimeMillis();

Action buttons are not shown in notification

烂漫一生 提交于 2019-12-11 09:07:01
问题 I want to display action buttons in notification bar. Notification works but I cannot see any button . I have read Android Developer document and different examples on the Internet but I could not find any big difference with my code. I have done like following: public void showNotification(Context context) { NotificationManager mNotifyMgr = (NotificationManager); context.getSystemService(Context.NOTIFICATION_SERVICE); NotificationCompat.Builder = new NotificationCompat.Builder(context);

Notification doesn't show in Ginger Bread but works in JellyBean

十年热恋 提交于 2019-12-11 09:06:27
问题 I am trying to show notification but it works perfectly in Jelly Bean and in Ginger Bread it doesn't work. No errors/issue. I just want to cancel the notification once its clicked. Minimum Api level is 10. Here is the code. NotificationManager notifyManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); NotificationCompat.Builder notification = new NotificationCompat.Builder( context); notification.setSmallIcon(R.drawable.ic_launcher); notification

How to sound notifications sound when new Message arrives from Firebase Realtime Data base

寵の児 提交于 2019-12-11 08:01:40
问题 I'm using below code in my chat applicaiton where it uses RealTime Firebase Data base to chat among users. I would like to use an notification sound when new message arrives and also have an option on toolbar to turn it off or on. Is it possible. Here is the code of Chat_Room package com.nepalpolice.mnemonics.chat; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.support.annotation.Nullable; import

How to send a notification when the app is closed?

感情迁移 提交于 2019-12-11 07:59:58
问题 I want a notification to happen whenever a child is added from my firebase database. I have the below code working within onChildAdded() while the app is running or in the background, but obviously not when it's closed. I read something about starting a service but was a bit overwhelmed. NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mRecyclerView.getContext()) .setSmallIcon(R.drawable.icon) .setContentTitle("Title") .setContentText("Content Text"); Intent