broadcastreceiver

Sending new intent to broadcast receiver gives extras values from previous intent

懵懂的女人 提交于 2019-12-10 13:28:55
问题 I am broadcasting a intent which will be received by a broadcast receiver, as application is still running and new intent is fired by Alarm Service but the receiver is showing the previous intent value. As per docs broadcast receiver is no longer active after returning onReceive(), so receiver should show next intent values which is fired by alarm service, but it is not happening, can any one tell correct approach. This is from activity to broadcast intent: Intent intent = new Intent(SCH

Call an activity method from a BroadcastReceiver. Is it possible?

笑着哭i 提交于 2019-12-10 13:27:50
问题 I'm stuck developing an app because I need to call a method of my activity when a BroadcastReceiver is triggered. I want the BroadcastReceiver to detect when a network connection goes down and call a method of my activity which I've already written. I've been searching and I found that more people had asked this before but nobody got an answer about how to do it. I think that maybe android's API doesn't allow it. If it's impossible to call a method of my activity from the BroadcastReceiver

Bluetooth Device Button Press Should Trigger Onclick Listener in the app

拈花ヽ惹草 提交于 2019-12-10 13:22:47
问题 I'm trying to make an app which triggers an on click listener in the app when a button is pressed on the paired bluetooth device. After googling for several hours I think I am unable to send keycode of the button of the bluetooth device to broadcast receiver where if the keycode matchs then i can call the on click listener or maybe my approach and understanding is wrong so Could anyone please guide me or point me towards the right approach? Thanks in advance Bluetooth device: Bluetooth Selfie

Starting service on boot to to do work every 15 minutes

核能气质少年 提交于 2019-12-10 12:19:41
问题 So, i have gone through internet looking for solution, but didnt find anything that combines what I need. I need this: if mobile gets restarted, I need to start a service on boot that will every 15 minutes send data to my server. I made code that is working for boot, but don't know how to implement timer. Do I need 2 broadcast receivers and 2 services or? My broadcast receiver: public class BrReceiver extends BroadcastReceiver { final public static String ONE_TIME = "onetime"; @Override

Launch Activity in android via Dialpad using Secret Code

给你一囗甜甜゛ 提交于 2019-12-10 11:49:53
问题 I just want to launch activity via Secret Code . Although , there are many solutions available for this problem but none of them worked for me. It seems like BroadcastReceiver is not listening . I am using Mi4i MIUI 7. Here's my code. Please Help!! MainActivity.java package com.example.jatin.myapplication2; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState

Android, permission denial using BOOT_COMPLETED intent

牧云@^-^@ 提交于 2019-12-10 11:41:09
问题 I have a BootReceiver and is using android.intent.action.BOOT_COMPLETED to reconfigure whatever alarms the user made in my app, before phone was powerd off. Im using AlarmManager to set the alarms again. The alarms are stored in a SQLite database. public class BootReceiver extends BroadcastReceiver { private Context mContext; @Override public void onReceive(Context c, Intent intent) { mContext = c; try { cursor.moveToFirst(); do { Intent i = new Intent(mContext, AlarmReceiver.class); i

Permission denial on BroadCast SMS intent

雨燕双飞 提交于 2019-12-10 11:38:53
问题 can my activity broadcast this intent from itself Intent i = new Intent("android.provider.Telephony.SMS_RECEIVED"); sendBroadcast(i); I am able to send this broadcast and receive it back (from a broadcast receiver setup in the application) , but this is not a global broadcast , i.e. it is not received by the default SMS application. furthermore i am getting this error in the logcat Permission Denial: broadcasting Intent { act=android.provider.Telephony.SMS_RECEIVED } from com.smartanuj.scale

Query supported languages for SpeechRecognizer using BroadcastReceiver intent

心不动则不痛 提交于 2019-12-10 11:24:52
问题 I'm having trouble querying for supported languages using the SpeechRecognizer.ACTION_GET_SUPPORTED_LANGUAGES. private void queryLanguages() { Intent i = new Intent(RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS); sendOrderedBroadcast(i, null); } Now, I know it says the BroadcastReceiver is specified in RecognizerIntent.DETAILS_META_DATA, but I'm not sure as to how I can access that. So basically what I'm asking is how do I create an Intent to retrieve the available languages data? 回答1: This is

Static BroadcastReceiver not Working after Installation from ADB

元气小坏坏 提交于 2019-12-10 11:17:34
问题 I working on a project that need to launch an app by broadcasting a customized intent "com.example.demo.action.LAUNCH" via adb. My plan is to statically register a broadcast receiver "LaunchAppReceiver" that will launch the app when receiving the customized intent. I installed the .apk by calling adb install -r <pakcageName> then I sent the intent by calling adb shell am broadcast -a com.example.demo.action.LAUNCH However, nothing happened after the intent was sent. It seemed the broadcast

Push Notification receiver is not working

耗尽温柔 提交于 2019-12-10 11:08:55
问题 I'm implementing push notification service i my app, I followed the tutorial on Android developers.com, but unfortunately, i did not receive any notifications. I'm receiving the registration id successfully, but,the device doesn't receive any notifications from the back end, although the back ed service receives a successful response. p.s : I'm sure from the implementation of the back end service that sends the notification to Google cloud servers. Could any one help me solving this problem..