android-notifications

Disabling notification also disables toast messages of the app

眉间皱痕 提交于 2020-01-01 07:24:06
问题 In my android app , I have implemented push notification.My problem is from my device if I disable notification messages for the app, even the toast messages get disabled. Is this a usual phenomenon or do I need to change anything ? Please let me know how can I overcome this. 回答1: Yes,it's a usual phenomenon.Click here but it's in Chinese.Hope this can help you. In such case,it is need to write a Toast by your self.I can provide a demo but it is not complete.You can do some modification to

Android Wear Specific Notification

泄露秘密 提交于 2020-01-01 04:24:28
问题 The WearableNotifications.Builder setLocalOnly method can be used for displaying a notification on a phone only, and not mirror it to a Wear device. Is there a way to do the opposite, so creating a notification that will display only on the Wear device? 回答1: Actually you can do it using .setMinPriority() on the wearable notification (while it's not official, it works for now) Notification summaryNotification = new WearableNotifications.Builder(builderG) .setGroup(GROUP_KEY_MESSAGES,

What the purpose of setGroup() in Notification.Builder?

 ̄綄美尐妖づ 提交于 2020-01-01 03:44:06
问题 I have a some troubles with understanding of goal of setGroup() method. As docs said : ...Grouped notifications may display in a cluster or stack on devices which support such rendering.... Here it is the first question : What it is this rendering? What's so special about it?! I create a method which show a custom text message : public static void showNotification(Context context, String title, String message, PendingIntent pendingIntent) { notificationMessages.add(message);

how to send notifications from a website to an android app [closed]

[亡魂溺海] 提交于 2020-01-01 02:42:24
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I have made a website in html using a bit of javascript and php. I have made an android application using eclipse and java. what code or software or technique do i need to employ to allow my website to send notifications to my applications. And eventually send notifications from my

A notification of the foreground service doesn't show on Android 8.+

假如想象 提交于 2019-12-31 04:58:08
问题 My foreground service doesn't show a notification when it works on Android Oreo. It works perfectly on Android versions from 15 to 25. When I do targetSdkVersion from 26 to 25 this issue disappears. But this solution seems not good. I prepared test project with this issue. What should I do for fixing it on Android Oreo with targetSdkVersion 26 ? My foreground service, SoundService.java(full source): public class SoundService extends Service implements MediaPlayer.OnErrorListener, MediaPlayer

Notification icon turns white in Marshmallow

蹲街弑〆低调 提交于 2019-12-30 14:45:15
问题 I am trying to use a colorful image with transparent background as notification icon. This works fine in older android versions but when i tested it on Marshmallow(6.0), it turns white. I tried to find the solution on google and tried them but no success. Here is my code: NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(icon, message, when); String title = context.getString(R

How to open Fragment on click of push notification

匆匆过客 提交于 2019-12-30 13:54:34
问题 My Firebasemessagingservice class code for passing intent: private void showNotification(String message){ Intent intent=new Intent(this, DrawerActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra("data", message); PendingIntent pendingIntent=PendingIntent.getActivity(this,0,intent,PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder builder=new NotificationCompat.Builder(this) .setAutoCancel(true) .setContentTitle("Registry") .setContentText(message)

How to add vertical line to RemoteView for custom Android Notifications?

萝らか妹 提交于 2019-12-30 10:37:27
问题 I'm struggling to add a vertical line to a custom Android Notification. I've tried adding a view like this to my Relative Layout: <View android:id="@+id/line_vertical" android:layout_width="1dip" android:layout_height="fill_parent" android:layout_centerVertical="true" android:layout_toRightOf="@id/image_logo" android:background="#0000FF" /> But when I fire the notification, I get the following Exception: android.app.RemoteServiceException: Bad notification posted from package XXX: Couldn't

Show Notification of Firebase Message onReceived when App is in Background Through api

ⅰ亾dé卋堺 提交于 2019-12-30 09:55:54
问题 I have built a chat application . It is working fine . both users can chat easily but where I get Stuck is if one user's app is at background and screen is off , user is unable to be notified of that received message. What I want now is in my application is when userA sends message to userB , and userB mobile is idle but application is running in background, userB can get notification about that message. and userB can open the chat activity and read the message . My firebase notification is

How to increase the ringer & notification volume programmatically in android

和自甴很熟 提交于 2019-12-30 04:57:12
问题 I am trying to enable the ringer normal mode and increase the volume programmatically. AudioManager mobilemode = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE); // int streamMaxVolume = mobilemode.getStreamMaxVolume(AudioManager.STREAM_RING); switch (mobilemode.getRingerMode()) { case AudioManager.RINGER_MODE_SILENT: Log.i("MyApp","Silent mode"); mobilemode.setRingerMode(AudioManager.RINGER_MODE_NORMAL); mobilemode.setStreamVolume (AudioManager.STREAM_MUSIC,mobilemode