android-notifications

Automatic reply for whatsapp messages approach

末鹿安然 提交于 2019-12-01 10:51:03
问题 I have seen few applications on play store that supports automatic reply for WhatsApp, I searched the internet to find out the approach, but all I found was this piece of code Uri uri = Uri.parse("smsto:" + "99********"); Intent i = new Intent(Intent.ACTION_SENDTO, uri); i.putExtra("sms_body", "Hey!"); i.setPackage("com.whatsapp"); startActivity(i); It will open the WhatsApp and take you to that particular contact if you have saved and it will paste the given text but it will not send the

Go back to previous screen on backbutton pressed after responding to notification

我的未来我决定 提交于 2019-12-01 10:50:56
问题 I am using code similar to Creating a simple notification to create and show a notification from a network call. The issue is that I want the activity that responds to the notification to do it's business and then on a backbutton click, put the previously active activity back in the foreground, with it's back stack intact. This is regardless of if the previously active activity was part of my app or somebody elses. Currently it is following the generated TaskStackBuilder. Leading it back up

Group notifications on a wearable from the micro app

穿精又带淫゛_ 提交于 2019-12-01 09:40:50
问题 I build a micro app for a wearable now I'm working with notifications on the device. Here is my example code: NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setContentTitle(title) .setContentText(message) .setSmallIcon(icon) .setGroup(groupKey); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); notificationManager.notify(id, builder.build()); This notification is never shown and it does not matter if I have one or multiple

How to close any activity of my application by clicking on a notification?

那年仲夏 提交于 2019-12-01 09:27:27
问题 When I click on a notification apply the following: intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); In all "startActivity" of the app I applied the next flag: intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); The startActivity my notification does the following: Call activity "Splash" and is called "Main". Casulidad If I was in "Main" pulse notification, closes the current (working properly). But if I am in

How to check which notification id is clicked?

梦想与她 提交于 2019-12-01 08:42:34
问题 My application is receiving GCM notifications. I have different type of notifications and at some point the user can have more than one notification in the status bar. However I need to know which one exactly he clicked on. In the GCM onMessage Im setting them with NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); manager.notify(Integer.parseInt(notification_id), notification); I need to get that notification_id after the click on the notification. I

Processing notifications in Xamarin Forms Android

北城以北 提交于 2019-12-01 07:48:53
问题 I'm using the library https://github.com/aritchie/notifications and I can create and schedule notifications properly. I wish to process them in Android so that depending on the notification - it will navigate to a particular page when the user taps on it. I've found that the below event is fired when I tap on a notification (in my Android Project) protected override void OnNewIntent(Intent intent) { } However, I can't find any info in the intent from my notification in order to build up

Different notification sound not working in Oreo

若如初见. 提交于 2019-12-01 07:06:31
问题 I am facing some Notification related issue in Oreo Version only. I follow this link and successfully got custom sound after uninstall/install the app as he has suggested. Now problem is that I want to use two custom sound in my app, For that, I have code like: private void sendNotification(NotificationBean notificationBean) { String textTitle = notificationBean.getTitle(); String alert = notificationBean.getMessage().getAlert(); int orderId = notificationBean.getMessage().getOrderId();

Launch a fragment in my Android application from the notification bar

强颜欢笑 提交于 2019-12-01 06:47:32
How do I start a fragment in my Android application from a notification in the notification bar? I've tried to implement this answer of creating my own action and then setting the action to the intent, but I'm unsure how to use it and what is required additionally - like adding something to the Manifest. I've got a notification class that receives a context, a message and then an action. I then want to filter on that action to determine which fragment to launch, but I don't know how to launch a fragment as opposed to launching an activity. Here is my Notifications.java class (incomplete):

android lollipop notification background colour

ⅰ亾dé卋堺 提交于 2019-12-01 06:35:58
Is it possible to change the background colour of notifications in android lollipop. I noticed that some notifications are white, some light grey and some are dark grey. (source: gottabemobile.com ) (source: sftcdn.net ) You can see the music player notification has a dark grey background. and in the second screenshot some are light grey. How do I set this colour? And is it possible to completely change the colour e.g. any hex code. Or can you select them from a template such as material dark material light. Thanks for taking the time to answer That background is set by the material design

Restart Application on Notification Received

倖福魔咒の 提交于 2019-12-01 05:53:22
问题 I have developed an application which has the functionality of receiving notifications from server. The problem is, when I click on a notification that I have received, it opens a new instance of my application itself . This behavior is ok, if my app is not in the foreground , but if it is and I try to open a notification, a new instance of my app is created and thus overlapping the previously opened instance of the app. I don't want this to happen, so when I click on the notification if my