broadcastreceiver

Intercept INSTALL_REFERRER and then forward on to Google AnalyticsReceiver

眉间皱痕 提交于 2020-01-21 06:58:26
问题 I have written an install receiver to determine when an app has been installed via the Market. However, I also want to pass the INSTALL_REFERRER broadcast onto other receivers such as the Google Analytics AnalyticsReceiver if it is installed within the app. Importantly, I do NOT know if other receivers are installed as my receiver will be used by other developers within their apps. Currently, I receive the broadcast and when complete I call: AnalyticsReceiver receiver = new AnalyticsReceiver(

Android pending Intent - Alarm - same code six(6) apps

倖福魔咒の 提交于 2020-01-17 14:01:21
问题 I found something strange yesterday. While testing app with localization versions(different apps-dif. packages, the same code) I found one interesting bug - the app sets alarm with the AlarmManager and pending Intent - when the broadcast is fired , only one app gets activated and executes the pending intent and all others apps(only different language) are not reacting at all. Is this android bug?? I'm expecting that the set Alarm will trigger every one app that has it's own set Alarm but

AlarmManager is not executing the class in time?

非 Y 不嫁゛ 提交于 2020-01-17 12:26:13
问题 In my project I want to change a flag value in SharedPreference in particular time every day ,I have implemented the AlarmManager but It is not performing the task . My function to call my receiver class : public void changeAttendaceFlag(){ Log.d(TAG,"changeAttendaceFlag !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY,14); calendar.set(Calendar.MINUTE,23); calendar.set(Calendar.SECOND,10); Intent activateLogin = new Intent

Android: java.lang.IllegalStateException: No receiver allowed to receive com.google.android.c2dm.permission.SEND

孤街醉人 提交于 2020-01-17 11:17:15
问题 Hey guys I am trying to implement GCM to my app. However I keep getting this annoying error for some reason: java.lang.IllegalStateException: No receiver allowed to receive com.google.android.c2dm.permission.SEND Here is my manifest file: <!-- GCM --> <!-- GCM requires Android SDK version 2.2 (API level 8) or above. --> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="com.google

Android: java.lang.IllegalStateException: No receiver allowed to receive com.google.android.c2dm.permission.SEND

老子叫甜甜 提交于 2020-01-17 11:17:04
问题 Hey guys I am trying to implement GCM to my app. However I keep getting this annoying error for some reason: java.lang.IllegalStateException: No receiver allowed to receive com.google.android.c2dm.permission.SEND Here is my manifest file: <!-- GCM --> <!-- GCM requires Android SDK version 2.2 (API level 8) or above. --> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="com.google

AlarmManager not invoking the task?

☆樱花仙子☆ 提交于 2020-01-17 07:57:09
问题 I want to execute a auto-logout after 10 PM everyday in my application, for that that I have implemented a AlarmManager task but it is not invoking .For testing purpose I have given the other timing .(e.g calendar.set(Calendar.HOUR_OF_DAY,15); calendar.set(Calendar.MINUTE,59); calendar.set(Calendar.SECOND,30); ) AlarmManager Code: sign_in_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { hideKeyboard(LoginActivity.this); //implementation of auto

ANDROID:- not able to get the available wifi list using ScanResult

一曲冷凌霜 提交于 2020-01-17 06:56:11
问题 I'm trying to list available wifi network by ScanResult. Can anyone tell me what's wrong in my code? I'm not getting the desired output. Here's My code: public class Activity_scanwifi extends AppCompatActivity { Switch aSwitch; TextView textView; WifiManager wifiManager; WifiInfo wifiInfo; String info; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.scanwifi); aSwitch=(Switch) findViewById(R.id.s); textView=(TextView)

AlarmManager Does not work when Activity in background

孤者浪人 提交于 2020-01-16 18:35:32
问题 In my App, I'm using AlarmManager for transmitting keep-alive every day once a day. I'm using the following code for starting athe AlaramManager Calendar calendar = DateUtils .getNextKeepAliveTime(keepAliveHours, keepAliveMinutes); Intent intent = new Intent(this, AlarmReceiver.class); PendingIntent sender = PendingIntent.getBroadcast(getApplicationContext(), ALARM_REQUEST_CODE, intent, 0); // PendingIntent.FLAG_UPDATE_CURRENT); // Get the AlarmManager service Log.d(TAG, "cal: " + calendar

AlarmManager Does not work when Activity in background

北慕城南 提交于 2020-01-16 18:35:09
问题 In my App, I'm using AlarmManager for transmitting keep-alive every day once a day. I'm using the following code for starting athe AlaramManager Calendar calendar = DateUtils .getNextKeepAliveTime(keepAliveHours, keepAliveMinutes); Intent intent = new Intent(this, AlarmReceiver.class); PendingIntent sender = PendingIntent.getBroadcast(getApplicationContext(), ALARM_REQUEST_CODE, intent, 0); // PendingIntent.FLAG_UPDATE_CURRENT); // Get the AlarmManager service Log.d(TAG, "cal: " + calendar

How to call this even when the app hasn't even started

妖精的绣舞 提交于 2020-01-16 18:03:40
问题 So my app shows a notification icon on headset plugin, and it destroys itself also if the headset is removed. But that only works if the application has been opened. How could I make it so it detects the headphone plugin and runs the icon in the background? Here is the class the detects if the headset has been plugged in or not public class MusicIntentReceiver extends BroadcastReceiver { int NOTIFICATION_ID = 1234567890; NotificationManager mNotificationManager; @Override public void