android-broadcastreceiver

Boot BroadcastReceiver does not work on Xiaomi devices

十年热恋 提交于 2019-12-28 04:06:28
问题 I have a following BroadcastReceiver which should run after boot completion. I have tested it on my Xiaomi device (Redmi 1s) , it's not running, while on other devices like Samsung it's running as expected. public class DeviceBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show(); } } } I have set

Android: AlarmManager is not getting fired

那年仲夏 提交于 2019-12-25 08:56:48
问题 I am trying to generate an alarm on a scheduled time in future. Below is the code MainActivity.java import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android

How to store call records in SD Card?

做~自己de王妃 提交于 2019-12-25 08:24:49
问题 I am trying to store incoming and outgoing calls record in my SD Card. but the issue is that i am not able to find that in my SD Card. Following is my Code Can any one help DeviceAdminDemo.java public class DeviceAdminDemo extends DeviceAdminReceiver { @Override public void onReceive(Context context, Intent intent) { super.onReceive(context, intent); context.stopService(new Intent(context, TService.class)); Intent myIntent = new Intent(context, TService.class); context.startService(myIntent);

Sending broadcast to restart service to keep-alive not working correctly

时光毁灭记忆、已成空白 提交于 2019-12-25 08:21:35
问题 I have an Android service that in onDestroy() method I'm sending a broadcast to restart my service. It's work on sony and samsung rom! but not work in Xiaomi or Huawei rom. How do I handle this? This is my code. Manifest: <receiver android:name=".Receiver.AppStartReceiver" android:enabled="true"> <intent-filter> <action android:name="example.app.start" /> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> Service: public class NotificationsService

IntentService does broadcast but onReceive doesn't receive broadcast

笑着哭i 提交于 2019-12-25 06:52:00
问题 (NOTE that at the end of this Question I have an EDIT in which I have replaced one method with what the Answer said to do in order to fix the problem of onReceive never getting called and added onDestroy to fix a new problem that cropped up after fixing first problem. ) Here's how I attempted to capture the broadcast data, but onReceive never gets called since Log.w never displays anything: public class MatchesActivity extends Activity implements DatabaseConnector.DatabaseProcessListener {

Xamarin Android: get one app's state information from another

时间秒杀一切 提交于 2019-12-25 03:22:59
问题 I have two Xamarin Android apps -- let's call them "Archy" and "Mehitabel". Archy has some persistent state information (which, let's say for the sake of argument, is in a SQLite DB). If a certain thing happens to Mehitabel, she needs to know a piece of that state information. To accomplish this feat, I have Mehitabel send an intent to Archy. Archy has a broadcast receiver that hears it, gathers the necessary state, and fires a different intent back to Mehitabel. Here's the code from Archy:

Is my broadcast receiver explicit or implicit?

我的梦境 提交于 2019-12-24 17:53:12
问题 after reading some manuals (1,2) about this I still need help. I am targeting my app to android O and on android 7.0 it work fine but on 8.1 I don`t seem to get any broadcast. So, if targeting android O in manifest and running on 7.0 and using implicit broadcast should it still work? Can you please help me determine if my broadcast is explicit or implicit? I am using Awareness API... Manifest: <receiver android:name=".DetectionBroadcastReceiver" > <intent-filter> <action android:name=

Android boot completed notification not received after reboot

谁都会走 提交于 2019-12-23 04:54:32
问题 I have a broadcast receiver registered in the application manifest to receive the BOOT_COMPLETED notification. After restarting the mobile device I receive no notification. However, I do receive the notification when I open my application. Please assist. Receive boot completed permission from my manifest: <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> Receiver from my manifest: <receiver android:name=".BootCompletedReceiver"> <intent-filter> <action android:name=

Android AlarmManager is not triggering alarm on next day when idle

大憨熊 提交于 2019-12-23 04:29:18
问题 I know there are dozens of similar threads on SO about this topic but I just couldn't find one that really solves the problem / or identifies the root cause. First of all, I'm targetting SDK 22 (Android 5.1) which means I could use the AlarmManager + WakefulBroadcastReceiver + IntentService even if this is not the latest way of doing things. I'm not interested in the JobScheduler etc solutions, I just want to understand what is happening and why. The phone I'm testing on has Android 8.0, but

Android AlarmManager is not triggering alarm on next day when idle

房东的猫 提交于 2019-12-23 04:29:09
问题 I know there are dozens of similar threads on SO about this topic but I just couldn't find one that really solves the problem / or identifies the root cause. First of all, I'm targetting SDK 22 (Android 5.1) which means I could use the AlarmManager + WakefulBroadcastReceiver + IntentService even if this is not the latest way of doing things. I'm not interested in the JobScheduler etc solutions, I just want to understand what is happening and why. The phone I'm testing on has Android 8.0, but