Category : notifications

I have notification and i want to increment saved int value after user tap notifictaion. I don’t want user see activity. I tried to use BroadcastReceiver subclass but it don’t work My code: Intent newIntent = new Intent(context, MyTap.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, newIntent, 0); public class MyTapextends extends BroadcastReceiver { ..

Read more

I have "HomeActivity" with different fragments. I want to clear all backstack in HomeActivity when I click on pendingIntent (HomeActivity). In case any other fragment is open, It should get cleared when I click on pendingIntent. Andoidmanifest.XML <activity android:screenOrientation="portrait" android:launchMode = "singleTask" android:taskAffinity="" android:excludeFromRecents="true" android:name=".HomeActivity" android:label="@string/title_activity_home" android:theme="@style/AppTheme.NoActionBar" /> Notification Intent Code is as below: Intent ..

Read more

I have notification.mp3 file into the res->raw folder. But when the notification is triggered it produces the default sound.I am getting notification from firebase push notification, It is working. This is how I made notification Uri soundUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.notification); NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext, CHANNEL_ID); builder.setCustomBigContentView(notificationLayoutExpanded); builder.setSmallIcon(R.drawable.ic_notifications); builder.setContentTitle(message); builder.setSound(soundUri, ..

Read more

I have two apps with exact same codes for notification handling. When app is running in background and new notification is received, One app is considering that notification as "Uncategorized" and another app is considering it as "Miscellaneous" I need the notification to be Miscellaneous in my both the apps. Plz let me know what ..

Read more

I am working on a custom media player notification. When I wanna attach an action to button I faced with error below. ERROR : Unable to start service Intent { act=left flg=0x10000000 cmp=com.//package_name// /.model.media_player$NotificationIntentService bnds=[630,195][780,345] } U=0: not found class media_player(val applicationContext: Context?, val playPauseButton: ImageButton, var selectedAudio: AudioModel) { private val channelId = "com.project_education.relaxandfocusfree.model" ..

Read more

I’m trying to create an app that block all notifications. I have tried this code that i found but it isnt working. Does anyone know how to do this? import android.content.Intent; import android.os.Build; import android.os.IBinder; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import android.util.Log; import androidx.annotation.RequiresApi; @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2) public class Block_All_Notifications extends NotificationListenerService { @Override public IBinder ..

Read more