broadcastreceiver

SMS listener make some application force close

旧街凉风 提交于 2019-12-13 04:42:42
问题 I'm creating at the moment a SMS Broadcast Receiver. I also use GoSMS in my phone. The problems is: if i dont set android:priority or set value less than 2147483647 (this is GoSms's priority) for my receiver, i cannot receive the message. When i set android:priority ="2147483647" , my app can receive the message but, some application in my phone have been force close: 08-01 17:52:47.775: E/AndroidRuntime(3501): FATAL EXCEPTION: main 08-01 17:52:47.775: E/AndroidRuntime(3501): java.lang

Shared preferences not setting boolean inside boot_received broadcast receiver

有些话、适合烂在心里 提交于 2019-12-13 04:42:15
问题 I am trying to create the option to start my service on boot. The broadcast receiver works great by itself, but when I add in the option it never sets it to true. Here is the code. public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(Intent.ACTION_BOOT_COMPLETED)) { SharedPreferences prefs = context.getSharedPreferences("startatboot",0); boolean startatboot = prefs.getBoolean("startatboot", false); if (startatboot) { context

how to make a broadcast receiver catch ( menu, volume, home… ) button click?

天涯浪子 提交于 2019-12-13 04:38:13
问题 i want my broadcast receiver to be invoked when clicking on(menu, volume or any other possible button). Is that possible?? Please help me Regards 回答1: Yes it is possible but don't waste your time to build an application, which is based upon menu button(hardware buttons like HTC phones) as some phones don't support menu buttons instead they offer you touch like LG phones. You can add functionality to Power button, Volume Buttons Up and Down. Here is the tutorial for you as a newbie. http://www

Android ICS not receiving data sms

北战南征 提交于 2019-12-13 04:19:48
问题 My application has a static broadcast receiver that listens to specific data sms on port 50011 to wake up the application and run. I tested the app on a wide range of android devices (android 2.1 -> android 2.3.4) and it is working perfectly. However, I am trying it now on Samsung Galaxy Nexus running Android 4.0.2 and it is failing to receive the binary sms. The OS doesn't seem to consume that SMS as it is not showing any relevant messages in logcat. Is anyone familiar with that issue? Here

Update ProgressBar from a Service started by a BroadcastReceiver

大憨熊 提交于 2019-12-13 04:16:47
问题 This is the scenario: i have a BroadcastReceiver that listen to the ACTION_PHONE_STATE_CHANGED, and when it changes it starts a Service. This service make a query con the CallLog, and when something increases i want to show it on several ProgressBar on the MainActivity, but how can i do that? I was thinking on creating an Application class thats subclasses the MainActivity and the Service, and then i could have the corresponding references, or am i wrong? Thanks in advance 回答1: There are some

BroadcastReceiver doesnt start from service

青春壹個敷衍的年華 提交于 2019-12-13 04:07:35
问题 I need to start a broadcastreceiver from a service and it's not working, i followed some tutorials and everything seems to be right but its not. Here is my code: public class ServiceNotif extends Service{ smsReceiver receiver; private static final IntentFilter intentFilter = new IntentFilter("android.provider.Telephony.SMS_RECEIVED"); @Override public void onCreate() { // TODO Auto-generated method stub super.onCreate(); Log.w("A intrat in service"," "); Toast.makeText(getBaseContext(), "A

how to pass data from broadcast to service?

情到浓时终转凉″ 提交于 2019-12-13 04:07:21
问题 hello guys can any one tell me how to send data from broad cast to service and how to receive this data inside the service class because it dose not work with me shuld i receive it inside ((onStartCommand)) or ((onStart)) or inside ((onReceive)) and what i should do in the Maninafest String data="hello"; Intent intent1=new Intent(context,Myservice.class); intent1.putExtra("Data",data); context.startService(intent1); //when i receive data from broad cast public int onStartCommand(Intent intent

How to inject the creation of a BroadcastReceiver object in Fragment using Dagger2?

霸气de小男生 提交于 2019-12-13 03:39:39
问题 I need to inject the creation of NetReceiver object into my Fragment but I get the following error: error: [Dagger/MissingBinding] com.example.myapp.NetReceiver.OnNetCallback cannot be provided without an @Provides-annotated method. Let me show you what I have tried. This is my NetReceiver class: public class NetReceiver extends BroadcastReceiver { private OnNetCallback onNetCallback; @Inject public NetReceiver(OnNetCallback onNetCallback) { this.onNetCallback = onNetCallback; } @Override

Error receiving BroadcastReceiver messages

送分小仙女□ 提交于 2019-12-13 03:37:57
问题 I have a BroadcastReceiver, implemented in an Activity Class, which accepts incoming messages via Google Cloud Message. I want to use this class as a chat, so after i have incoming messages, I use a void: public void Chatpat(String name, String message){ chatinput.add(name); chatinput.add(message); Chat chat_data[] = new Chat[chatinput.size()]; chatinput.toArray(); ChatAdapter adapter = new ChatAdapter(this, R.layout.listview_item_row, chat_data); chatList = (ListView) findViewById(R.id

AlarmManager Not called next day if the app sleeps for abt 1 day

白昼怎懂夜的黑 提交于 2019-12-13 03:23:39
问题 I am developing an android app which shows a notification every 12 hour if the time is saved in the database. So everytime a data is entered or edited in the database ,I cancel the current alarmmanager and start a fresh new one so that I dont miss one. Also on reboot I have called the alarmmanager. On the broadcast receiver, the database is checked for entry and if found a notification is set and the app is opened automatically. So when I test the app by changing the date manually,the app