-
1 votesanswersviews
没有每天收到本地警报通知
我尝试设置 AlarmManager.setRepeating() 状态但没有取得任何成功,我尝试在昨天上午10点设置闹钟并且仅在当天收到警报通知,第二天我没有在上午10点收到任何通知 .下面是我的代码,请告诉我代码中出了什么问题 . Intent intent = new Intent(this, AlarmReceiver.class); pendingIntent = PendingInte... -
1 votesanswersviews
为什么不在破坏活动的同时做unregisterReceiver(BroadcastReceiver)会导致内存泄漏?
我知道,当Activity破坏时,不执行unregisterReveiver(BroadcastReceiver)会导致内存泄漏 . 但我不明白为什么它会导致内存泄漏 . 我正在使用LocalBroadcastManager在活动中注册接收器 . 即使活动销毁,BroadcastReceiver也会保存上下文引用? -
1 votesanswersviews
应用程序关闭时,广播接收器和服务不起作用(android)
每个人都有 . 首先,由于AUTO START MANAGER,在我的设备上关闭应用程序时,我的接收器无法工作 . 我感到愚蠢......当我试图解决它时,我学到了非常重要的东西 . 首先是Android 6.0权限请求Broadcast Receivers not working in Android 6.0 Marshmallow 其次:Android - Lollipop上的重复电话状态... -
1 votesanswersviews
广播接收器onReceive()未被调用
广播接收器 mBroadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { Log.i(TAG,"contact list populate broadcast")... -
-1 votesanswersviews
BroadCast Receiver onReceive未调用
我正在尝试从服务发送广播,但它没有在接收器中收到 . 以下是我的代码 Bluetooth Service public class BluetoothService extends Service { public final static String TAG = "com.example.linvor.BluetoothService"; Intent intent1 =... -
0 votesanswersviews
使用广播接收器来接收来电,onReceive没有触发?无法打印日志
在broadcastReceiver中: public void onReceive(final Context context,Intent intent){ Log.e("Current:","entered111!"); String stateStr = intent.getExtras().getString(TelephonyManager... -
49 votesanswersviews
连接Wifi时,CONNECTIVITY_ACTION意图收到两次
在我的应用程序中,我有 BroadcastReceiver ,它通过 <receiver> 标记作为组件启动,过滤 android.net.conn.CONNECTIVITY_CHANGE 意图 . 我的目标只是知道何时 Build 了Wifi连接,所以我在 onReceive() 所做的是: NetworkInfo networkInfo = intent.getParcelable... -
0 votesanswersviews
BroadcastReceiver 无法启动
我正在练习蓝牙应用程序,实际上我已经完成了诸如用户界面,打开,关闭,获取 MAC 地址和已保存设备名称等问题,问题是实际上我想找其他设备,问题是实际上是没有进入方法: 私人最终 BroadcastReceiver mReceive //buscar nuevos public void nuevo(View v) { if (bluetooth.isEnabled()) { ... -
0 votesanswersviews
Wifi-Direct获取WiFiDirectBroadcastReceiver中连接设备的地址
我按照这个文件,使我的Android设备的wifi对等工作: The link to android wifi p2p document 它's working. I'能够连接和发送数据 . 但我也希望在发现设备时从一开始就跟踪它们的状态 . 问题是,当我的BroadcastReceiver中出现 WIFI_P2P_CONNECTION_CHANGED_ACTION 时,我无法知道哪个设备已连接(...