broadcastreceiver

BroadcastReceiver is not working

冷暖自知 提交于 2019-12-07 13:54:47
问题 I have implemented this broadcast reciever: public class ServiceManager extends BroadcastReceiver { private final String BOOT_ACTION = "android.intent.action.BOOT_COMPLETED"; private final String BOOT_ACTION_FIRST_LAUNCH = "android.intent.action.PACKAGE_FIRST_LAUNCH"; private final String BOOT_ACTION_RESTARTED = "android.intent.action.PACKAGE_RESTARTED"; @Override public void onReceive(Context context, Intent intent) { // All registered broadcasts are received by this String action = intent

Android - Extract text from SMS

試著忘記壹切 提交于 2019-12-07 10:58:52
问题 I want to be able to extract text from received SMS's. I'm not sure whether I should use content providers or the sms message is included in the intent received by broadcast receiver. I have a broadcast receiver waiting for SMS's, and want to inspect the contents of the received message. Thank you. 回答1: You can create SmsMessage instances from the Intent in your BroadcastReceiver as follows: Bundle bundle = intent.getExtras(); Object[] pdus = (Object[])bundle.get("pdus"); SmsMessage[]

Problem with BroadcastReceiver (Receiver not registered error) [duplicate]

无人久伴 提交于 2019-12-07 09:58:51
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Receiver not registered exception error? I have a TabActivity and the 'content' of each TabSpec is my own GuideListActivity class. There are seven tabs (one for each day of the week) and each GuideListActivity shows TV Guide info for one TV channel / one day of the week. The TabActivity maintains which channel number the user is viewing guide details for and when the user changes to view another channel's info,

Broadcast Receiver does not trigger when Mobile Screen Locks

[亡魂溺海] 提交于 2019-12-07 09:46:17
问题 When I install the app everything works fine. I am able to print Message body every time I send a message until I lock mobile screen. After that, the app stops printing incoming messages. I tried many ways to overcome this problem but with no luck. Please help me... public class SmsReceiveActivity extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sms); receiver = new BroadcastReceiver() {

How to get BroadcastReceiver for Action :android.intent.action.MAIN and android.intent.category.HOME in My Android Application

别来无恙 提交于 2019-12-07 08:47:37
问题 Every One Can i Get BroadcastReceiver for This Intent when i press home Key : Starting activity: Intent { act=android.intent.action.MAIN cat= [android.intent.category.HOME] flg=0x10200000 cmp=com.htc.launcher/.Launcher } I don't want to Consider com.htc.luncher as it will we different for Other Android Device . Here i my Simple Class For BroadcastReceiver : public class HomeBrodcast extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { Bundle bundle =

Wifi Broadcastreceiver onreceive

我怕爱的太早我们不能终老 提交于 2019-12-07 08:30:28
I have problems with the wifi broadcast receiver. It doesn't receive anything, onReceive is never called. Here's my code: public final class WifiChangeReceiver extends BroadcastReceiver { boolean portableHotspot = true; @Override public void onReceive(final Context context, Intent intent) { boolean alreadyPresent = false; String action = intent.getAction(); if(action.equals(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) { WifiManager w = (WifiManager) context .getSystemService(Context.WIFI_SERVICE); List<ScanResult> l = w.getScanResults(); myApp myApp = (myApp)context.getApplicationContext();

Not Receiving Parse Push Notifications on Android in Custom BroadcastReceiver

走远了吗. 提交于 2019-12-07 08:27:00
问题 I can successfully send a push notification using Parse with the following data, but can't receive the message in my custom Broadcast Receiver. Following the Parse Android notification guide: https://parse.com/docs/push_guide#receiving/Android. Any help would be appreciated! Sending the push: ParseQuery<ParseInstallation> userQuery = ParseInstallation.getQuery(); userQuery.whereContainedIn("user", arg0); JSONObject data= null; try { data = new JSONObject("{\"title\" : \"Hush!\"," + "\"intent\

AlarmManager never calling onReceive in AlarmReceiver/BroadcastReceiver

瘦欲@ 提交于 2019-12-07 08:14:11
问题 I still cannot get my AlarmReceiver class' onReceive method to fire. Does anything stick out as wrong with this implementation? All this is supposed to do is wait a certain period of time (preferably 6 days) and then pop up a notification. (Can you believe there isn't a built in system for this? crontab anyone!?) MyActivity and BootReceiver both set up an alarm under the necessary conditions. AlarmService kicks out a notification. And AlarmReceiver is supposed to catch the alarm and kick off

Android BroadcastReceiver onReceive() called twice on android 5.1.1 even after one register

萝らか妹 提交于 2019-12-07 08:13:51
问题 I Could not figure out what is wrong with below code. I also checked about registering receiver twice. But that's also not the case. or may be I am missing something. Could any please help. I really need it. :( import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.os.IBinder; import android.telephony.TelephonyManager; import android.util

BroadcastReceiver works for a while, then stops

∥☆過路亽.° 提交于 2019-12-07 07:51:15
问题 I'm developing an android app that responds to incoming calls. I've set up a broadcast receiver, set the permission and intent filter in the manifest file, and a lot of the time, it works. I can kill all apps, reboot the phone and it still works.. However, sometimes it doesn't react, and after this happens once, it doesn't respond after a reboot either. I've been struggling with this for about a month and it's driving me bananas. I really need my app to respond every time an incoming call is