android-notifications

android.app.PendingIntent cannot be accessed ouside the package

倾然丶 夕夏残阳落幕 提交于 2019-12-11 00:36:37
问题 I'm trying to make notification, but it keeps telling me that PendingIntent in android.app.PendingIntent is not public it cannot be accessed outside the package this is the full method: final Runnable m_Runnable = new Runnable() { public void run() { FirebaseDatabase.getInstance().getReference("messages").endAt(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { //Toast.makeText(Chat.this,user.getUid(),Toast

How to set repeating alarm using setExact and how to cancel the same?

匆匆过客 提交于 2019-12-11 00:35:58
问题 I am setting notifications using alarm manager and broadcast receiver. I have tried to use setInexactRepeating method of an alarm manager but it dose not raise alarms at exact time above API 19. So I got a suggestion to use setExact method and set alarms manually. I don't know how can I do this. Do I need to calculate dates for every week for a year? Also the alarms I am creating I want to delete the same if the event is deleted. How can I cancel this? Using cancel method I have tried to

Get updates from a server in the background using Pull notification - Android

巧了我就是萌 提交于 2019-12-10 21:07:05
问题 I want to implement a feature in an android app, which periodically pulls information from a server even when the app is in the background / not running. It should invoke a web service and check for updates at least 3-4 times in a day, and if available pull and show them in the notification bar. When the user clicks on the notification it should open up the app screen. Is that feasible using pull notification technology? Are there any constraints? Can you share some tutorials that will help

notification.setOngoing(true) does not work in Android 8.1

会有一股神秘感。 提交于 2019-12-10 19:43:22
问题 build.setOngoing(true); build.setAutoCancel(false); notification.flags= Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT; setOngoing is not working if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { /* Create or update. */ _notificationChannel = new NotificationChannel("TubeMateGo", "Downlaod File Notification", NotificationManager.IMPORTANCE_DEFAULT); mNotifyManager.createNotificationChannel(_notificationChannel); build = new NotificationCompat.Builder(getBaseContext(),

java.lang.SecurityException: Permission Denial: getIntentSender() from pid=1484, uid=10151, (need uid=1000)

空扰寡人 提交于 2019-12-10 19:24:50
问题 I am getting this error specifically on HTC DESIRE 626GPLUS DUAL SIM with Android 4.4.2 java.lang.SecurityException: Permission Denial: getIntentSender() from pid=1484, uid=10151, (need uid=1000) is not allowed to send as package android at android.os.Parcel.readException(Parcel.java:1472) at android.os.Parcel.readException(Parcel.java:1426) at android.app.INotificationManager$Stub$Proxy.cancelAllNotifications(INotificationManager.java:271) at android.app.NotificationManager.cancelAll

cancel notification with remoteInput not working

六月ゝ 毕业季﹏ 提交于 2019-12-10 17:46:58
问题 I am showing a notification with RemoteInput like this: RemoteInput remoteInput = new RemoteInput.Builder("key_add_note") .setLabel("add note") .build(); PendingIntent AddNotePendingIntent = PendingIntent.getBroadcast(getApplicationContext(), (int) txn.get_id(), new Intent(getApplicationContext(), AddNoteBroadcastReceiver.class) .putExtra(Constants.IntentExtras.STA_TXN_ID, txn.get_id()), PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Action action = new NotificationCompat.Action

Adding actions to a notification in jellybean ignores the custom layout set with setContent

这一生的挚爱 提交于 2019-12-10 17:34:11
问题 I'm creating a notification with a custom layout using setContent, and it works fine. But when I'm adding actions to the notification with addAction(), my custom layout is being ignored and it shows up the android's default notification layout. When I shrink the notification (using the two fingers gesture) my custom layout shows, so it seems the "expanded" form uses a different layout which I cannot set. Screenshots (With the actions, and then after swiping two fingers up to shrink it) As you

Custom notification marquee text doesnt work android

泪湿孤枕 提交于 2019-12-10 15:48:39
问题 Hi im trying to make part of my text in the notification manager marquee but doesnt work i tried this: <TextView android:id="@+id/title_text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ellipsize="marquee" android:fadingEdge="horizontal" android:gravity="bottom" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:focusable="true" android:focusableInTouchMode="true" android:singleLine="true" android:textSize="15sp" android

Foreground Service being killed on Notification click

时间秒杀一切 提交于 2019-12-10 14:32:57
问题 In Android 4.4.2 clicking on my Foreground Service notification is killing my process. On older devices (Samsuing Tab 2 running 4.2.2), I can swipe away the Activity from Recent Tasks and still have my Service running fine in the background. Then when I click on the Notification my app Activity starts again quite happily. However, once I click the Notification on my Nexus 7 running 4.4.2 my process is killed (which up until the click is running happily in the background). The PendingIntent

Create Notification App in Android?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 11:42:51
问题 I want to create a sample project to show notification on click of button then when the user selects it open that activity in my app or open a url on selection of that. I have done something but I'm unable to complete the functionality. First I am getting error to use this: @SuppressLint("NewApi") If I am not using this I am getting the error on here Notification noti = new Notification.Builder(this) Activity Code public class NotificationExample extends Activity implements OnClickListener{