broadcastreceiver

How to get alert dialog only after disconnect call?

扶醉桌前 提交于 2019-12-02 14:01:23
In my app i am doing one thing that,when the call is disconnected by caller or receiver,one alert dialog should appear with cellphone number.it all works fine but issue is alert dialog is also appearing when i am getting call,but i only want only after disconnection,i don't know what is mistake i am making following is my code..can any one help? public class MyCallReceiver extends BroadcastReceiver { private String incomingNumber; @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals

Android - Stop broadcast receiver being killed with service

久未见 提交于 2019-12-02 13:31:43
问题 I have built an application which implements a number of broadcast receivers and registers them within a service based on user settings. The service is bound to an activity which calls some of its methods. When a broadcast receiver is called it starts the service (or calls onstart of the service if it is already running) and passes it a string telling the service what to do. My problem is when the activity is destroyed (back button) the service is also destroyed which in turn kills the

Do I need to acquire wake lock when invoking a BroadcastReceiver

こ雲淡風輕ζ 提交于 2019-12-02 12:52:04
In the book Pro Android 4 By Satya Komatineni , Dave MacLean I've found: Android acquires a partial wake lock when invoking a broadcast service and releases it when it returns from the service in the main thread Does it mean that the Android OS ensures that the device will wake up for the time of going through onReceive of BroadcastReceiver ? In my case the BroadcastReceiver should get an intent from Google Play Services (GoogleLocationServices and to be precise Geofences api ). Where is it documented? EDIT: I've also found it here : because it is guaranteed that the BroadcastReceiver

Create an automatic launch-able Broadcast Receiver in Android

妖精的绣舞 提交于 2019-12-02 12:39:14
Problem: I am willing to create an application that simply starts as a background process and whenever a new message comes into the device it should log it into a file or simply display a toast message. I have read a lot of blogs and tried to follow the steps as mentioned. But, I keep on sending messages on my device and nothing displayed not even in device log. I want to run it on devices from Froyo to Lollipop. So, I am not willing to use new Telephony API which supports API 19 and later versions. Manifest File <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com

Android broadcastreceiver not triggering when app is not running

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 12:31:29
问题 Following this guide https://developer.android.com/training/monitoring-device-state/battery-monitoring.html I made a receiver that should log battery info to a file every time charger is plugged or unplugged. The activity reads the content of this file and displays it on screen. This is supposed to work always regardless of the app running, but it doesn't. It only registers if the app is open/in memory, when I clear the memory or reboot it stops working. Manifest: <receiver android:name="

Need to perform some activity during the unistallation of an Android app

六月ゝ 毕业季﹏ 提交于 2019-12-02 12:02:23
I am working on an app in which i need to log, if user uninstalls the app. So i am following this approach How can an app detect that it's going to be uninstalled? But i am facing the same problem as in this post Can't get receiver when the app uninstall . As my phone is Android 4.4... Can anybody post the exact solution (code) to solve this problem??? Edit: During uninstallation QUERY_PACKAGE_RESTART intent should be broadcasted but i am not recieving it. I declared it in manifest as well i created a broadcastreceiver which is listening for this intent... I did it exactly same way as Can't

BroadcastReceiver does not receive Broadcast from IntentService

岁酱吖の 提交于 2019-12-02 11:47:20
问题 I'm trying to send a broadcast from an IntentService to the activity that started it, this is how i register the Receiver in the activity: private BroadcastReceiver mInitializer; @Override protected void onCreate(Bundle savedInstanceState) { .... mInitializer = new InitializationReceiver(); IntentFilter initializer = new IntentFilter(); initializer.addAction(IntentConstants.Tasks.INITIALIZE); initializer.addAction(IntentConstants.Initialization.INITIALIZE_IS_FIRST_START); initializer

SMS Broadcast Receiver not working

送分小仙女□ 提交于 2019-12-02 11:45:38
问题 Alright, I have tried every solution on Stack and nothing works.My current method registers the "SmsListener" receiver from the MainActivity. All I'm trying to do is initialize the onReceive method. There are no errors; It simply isn't picking up a broadcast. What am I doing wrong? Pasting the applicable code here. Anything else that may be needed please just ask. Update: Here is a similar unresolved issue Listen Android incoming SMS when Google Hangout or other app receives it I am testing

BroadcastReceiver doesn't get called when using it for push notification

不羁的心 提交于 2019-12-02 11:24:55
I am trying to use GCM push notification of Android in a plugin. I am getting the valid registration ID from Google server. But when I send any data from server, the BroadcastReceiver doesn't get called at all. I think the issue is with the permissions in manifest, here's the portion of manifest that I am using - <receiver android:name="com.creator.gcm.GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.creator.test" /> </intent-filter> <!-- Receive the

password protected uninstall in android 4+ versions [programmatically]

*爱你&永不变心* 提交于 2019-12-02 10:31:48
问题 i want my app to have a password protected uninstall ... (like app lock) im using folling code it works on Android 2.3 but not on Android 4+ versions MANIFEST FILE <receiver android:name="fyp.invisibleink.UninstallIntentReceiver" > <intent-filter android:priority="0" > <action android:name="android.intent.action.QUERY_PACKAGE_RESTART" /> <data android:scheme="package" /> </intent-filter> </receiver> Uninstalling Activity code ublic class Uninstalling extends Activity { @Override protected