broadcastreceiver

how to update fragment on clock time

浪子不回头ぞ 提交于 2019-12-13 03:17:39
问题 I'm trying to update fragment on clock time, say for example 8PM, with below logic. Unfortunately, it doesn't update the fragment. Any help/reference would be appreciated. What I did: registered an AlarmManager in app's Application class as below: alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent().setAction(AppConstants.INTENT_ACTION_UPDATE_DASHBOARD); alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0); // Set the alarm to

Cannot get BroadcastReceiver working

。_饼干妹妹 提交于 2019-12-13 02:56:38
问题 I want to use the HEADSETHOOK button (keycode 79) on my Samsung earphones but cannot get it to work. I am, essentially, following the answer given in this SO question. My phone is a Samsung Galaxy S7 running Android v8. The relevant part of my manifest is: <receiver android:name=".MainActivity$HeadsetBtnReceiver" android:enabled="true" > <intent-filter android:priority="10000000" > <action android:name="android.intent.action.MEDIA_BUTTON" /> </intent-filter> </receiver> <activity android:name

Android broadcast gps turned on update location

ε祈祈猫儿з 提交于 2019-12-13 02:48:49
问题 Well even having a lot of reading here, i can't figure out the issue. It looks like i never get gps turned on event. After some checking in debug, the flag isGps is correct. But as a result, user alert works nice but not update location. I just want to add a marker when gps is turned on and it looks like something is not correctly synchronised here. And that even with high accuraty location. I use this code from my fragment. public class MapDialogFragment extends DialogFragment implements

Android. Error. Pop SMS notification after reboot

白昼怎懂夜的黑 提交于 2019-12-13 02:39:18
问题 I have problem. After my application is installed, SMS broadcast is intercepted successfully . But after reboot, all intercepted SMS broadcast still popup in Notification Bar (from Standard Sms application) Broadcastreceiver: public class OwnSmsBroadcastextends BroadcastReceiver{ private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"; public void onReceive(Context context, Intent intent) { final Bundle bundle = intent.getExtras(); if (intent.getAction().equals

Handling Parse Push Notifications in Android

牧云@^-^@ 提交于 2019-12-13 02:37:56
问题 I am using Parse API in order to handle push notifications. In our Android application, I want to accomplish two things: 1) If we have received a Push Notification with the application is closed and the user clicks on the notification, I want to be able to understand that the application is being opened via a push notification. 2)If we receive a push notification while the application is open, I want to handle this and do some extra work. In both cases, I want to be aware that the application

Using broadcast receiver android to close app

你离开我真会死。 提交于 2019-12-13 02:26:15
问题 Hi am trying to use broadcast receiver to trigger some action Activity A will broadcast action "ACTION_EXIT" and come to Main Activity. Whenever Main Activity receive the broadcast "ACTION_EXIT" it will close the app. My code on Activity A (to send broadcast) Intent broadcastIntent = new Intent(Beacon_MainActivity.this, MainActivity.class); broadcastIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); broadcastIntent.setAction("com.package.ACTION_EXIT"); sendBroadcast(broadcastIntent); finish();

I am unable to get a SMS Broadcast Receiver to work on Android 4.1.3 on HTC one

纵然是瞬间 提交于 2019-12-13 02:11:43
问题 I am new to this. I am working on a simple SMS receiver that catches incoming text messages, does some logic with them and then forwards them to my email for more permanent storage. The broadcast receiver is registered in my manifest and the code works great when I test on the Galaxy S3. However, when I install it on a HTC One it seems that the Boradcast Receiver is never fired. Just wondering if anyone else has run into this on HTC and if there is any suggested course of action. It's

Broadcast Receiver to detect change in mobile network

半腔热情 提交于 2019-12-13 02:03:51
问题 I am looking for a way to make my Android app do something every time there is a change in mobile network , i.e. going from 2g to 3g, 4g to wifi etc. All I can find for broadcast receivers are the ones that execute on loss or gain of network connection. 回答1: Have you looked into using a PhoneStateListener? The LISTEN_DATA_CONNECTION_STATE and LISTEN_SERVICE_STATE flags look promising. 来源: https://stackoverflow.com/questions/5518719/broadcast-receiver-to-detect-change-in-mobile-network

Setting Reminder/trigger alarm on user defined date and time

强颜欢笑 提交于 2019-12-13 01:43:47
问题 I have trouble implementing Reminder for my app.i did research but couldnt find proper solution. what i want is: i am developing an android app which has one feature to remind users about the selected event 30 min before event start. i will be displaying the date and time of the event in textview,on click of reminder button reminder will set 30min before event. how can i proceed to implement this. Note: i dont want to use date/time picker, specific date and time will be taken directly from

Receive an read SMS with correct encoding and convert to UTF8

喜夏-厌秋 提交于 2019-12-13 01:43:37
问题 I am writing a BroadcastReceiver to receive SMS messages. I will need to compare the message with a string that was set by the user in the settings, but the string can be non-ASCII. The below code works only for SMS-es that contain only ASCII characters. How can I convert the message to UTF8 encoding? public class SmsReceiver extends BroadcastReceiver { final static String TAG = "SmsReceiver"; public SmsReceiver() { } @Override public void onReceive(final Context context, final Intent intent)