In my broadcast receiver activity I need to run some code when an alert is fired which I can get working no problem, but I need to make sure my Map activity is on the screen when this code is run, so I am trying to start the Map activity with an intent but this crashes the application and I do not know why.
I have this broadcast receiver for ACTION_MEDIA_BUTTON which actually works for both Android 2.x and Android 4.1, but for some strange reason, on Android 2.x (only), I get each even twice (for a single click on the pause button, of course):
public class RemoteControlReceiver extends BroadcastReceiver {
private static long prevEventTime = 0;
@Override
public void onReceive(Context ctx, Inte
I create an application with alarm manager and broadcast receiver and i want pass string from main activity to public class MyScheduleReceiver extends BroadcastReceiver(i have alarm manager inside) and then to public class MyStartServiceReceiver extends BroadcastReceiver for pass data to static function....In main activity save this variable from editbox with shared preferences.But i can not use s
this is my receiver.viewChanger is my original class .
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
viewChanger vc = new viewChanger();
if(action.equals("android.intent.action.TIME_TICK")){
vc.setDateView(context);
}else if(action.equals("android.intent.action.BATTERY_CHANGED")){
int level
I am trying to setup a BroadcastReceiver to handle scheduled events. I have been following http://mobile.tutsplus.com/tutorials/android/android-fundamentals-schedu... , and had the feature working, or so I believed.
I want to install an apk file and set a broadcast-receiver in order to catch information concerning install status.
I have prepared a BroadcastReceiver class :
public class newPackageReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d("DEBUG"," test for application install/uninstall");
}
}
In the main activity, I fi
I make a simple Android Apps that will update its view when an SMS is received.
Hi friends i have a problem...
Actually i use this code to open my application in certain time..the app is working fine but when the device is in sleep mode not working..??
public class MyBroadCastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context ctx, Intent intent) {
Intent intent = new Intent(ctx, ActivityMain.class);
intent.addFlags(Intent.FL
When i'm using startActivity from a receiver like this:
public void onReceive(final Context context, final Intent intent) {
Intent i = new Intent();
i.setClass(context, NewClass.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
i.addFlags(Intent.FLAG_AC