android-pendingintent

Android Widget lose pending intent

旧城冷巷雨未停 提交于 2019-12-11 19:17:20
问题 I'm new on Android and I have a bit issue, I've already searched multiple forums and nothing.. I have a simple widget that shows the battery and on click it opens a activity with Popup Theme. So I have this too files, may be some method wrong? WidgetProvider: public class Widget extends AppWidgetProvider { @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub super.onReceive(context, intent); context.startService(new Intent(context, Service.class

Android - Communications between a widget and its app

点点圈 提交于 2019-12-11 15:09:22
问题 I have a widget that shows various images with text below, and the same UI set up in the app itself. I want the widget to not only be able to open the app, but to open the app based on which picture is showing in the widget and then show that same image in the app. However, I am having a tough time getting this to work. Thanks. 回答1: Let's say there are several images in the ui, you can set different Intent for each image, and these intents each will target a different activity. This post:

Android AlarmManager - Scheduling a recurring Intent to fire off twice a day

爱⌒轻易说出口 提交于 2019-12-11 10:18:55
问题 After reading lots of sample code into this matter, I'm trying to figure out the simplest way to achieve the following: I want to be able to schedule an Intent that calls back to my Alarm BroadcastReceiver, which in turn fires off my Service. However, I want to set up so that it calls said Intent twice a day and to only schedule the alarms if they haven't already been set (likewise for canceling the alarms). However, I am unsure if the following code is the correct way to set and cancel

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();

Clicking notification not opening app/activity

那年仲夏 提交于 2019-12-11 09:41:23
问题 I am having trouble having a notification open the app. I've followed the instructions on the Android docs, but to no avail. It creates the notification no problem, but clicking on it just dismisses it. Please help! Thanks in advance! Why is clicking the notification not opening the app? Intent intent = new Intent(this, MainActivity.class); String type = ""; if (extras.containsKey(KEY_TYPE)) type = extras.getString(KEY_TYPE); String text = ""; if (type.equalsIgnoreCase(TYPE_MATCH_FOUND)) { //

Notification PendingIntent extras always empty

自古美人都是妖i 提交于 2019-12-11 05:13:12
问题 I read about this all day long with different kind of solutions but non worked so far. I have an upload service (IntentService) that sends updates to a ResultReceiver. The receiver creates and manages the Notification. After clicking on the notification (error or success) the MainActivity is loaded. But the bundle is always null. How can I change my code to access/get the bundle? This happens if I'am in another Activity, if the App is in background and if the app is stopped.

Android pending intent not invoked in twilio incoming call

我们两清 提交于 2019-12-11 04:48:13
问题 I am making calling app using twilio sdk i have integrated all stuff and it is in wokring condition. But the problem is when my android app remains in the background for long time then app didn't receive incoming call request , pending intent not invoked by Twilio Here is the code: if (!Twilio.isInitialized()) { /* * Needed for setting/abandoning audio focus during call */ Twilio.initialize(context, new Twilio.InitListener() { /* * Now that the SDK is initialized we can register using a

Reuse current app instance when clicking on Notification [duplicate]

余生长醉 提交于 2019-12-11 04:22:18
问题 This question already has answers here : Resume application and stack from notification (7 answers) Closed 2 years ago . Right now I'm using a PendingIntent to launch my desired Activity from the Notification . But I want to know if it's possible to reuse the current app instance. For example: Launch app, the Launcher Activity is called HomeActivity Navigate to SecondActivity Press the home button Click on the notification from the app and resume SecondActivity But if the user didn't navigate

Android: Transferring Data via ContentIntent

折月煮酒 提交于 2019-12-11 03:41:07
问题 I've got a problem with my Android Application. It receives Messages via Google Cloud Messaging and displays a Notification in the Notificationbar. I want to transfer some Data with the Notification. This Data comes via Google Cloud Messaging and should be attached to the Notification. This is my Code to Display the Notification: private void setNotification(String strTitle, String strMessage, int intPageId, int intCategorieId) { notificationManager = (NotificationManager) this

PendingIntent cause Error

不羁岁月 提交于 2019-12-11 03:18:30
问题 I have a BroadcastReceiver which gets data from Activity by Intent, with PendingIntent. The code work fine but when i'm restarting my device and onReceive calling i am getting Error... I don't know what the error because he appear after my phone restarting and the logchat cannot notice the phone and i don't see the error... Activity: Intent intent = new Intent(addOne.this,AlarmReceiver.class); intent.putExtra("msg", title.getText().toString()); intent.putExtra("note", note.getText().toString(