I have a problem. AddProximityAlert don’ t want wake up my device. I don’ t have any recivier(i can’ t have in this situation, because can’ t unregister it). I just push intent to addProximityIntent in this way:
Intent myIntent = new Intent(cxt, alarmView.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent proximityIntent = PendingIntent.getActivity(cxt, records.get(pos).process,myIntent, 0);
locationManager.addProximityAlert(records.get(pos).x,
records.get(pos).y, records.get(pos).r, // metry
-1, proximityIntent);
I try to insert PowerManager.newWakeLock to myIntent.onCreate, but it doesn’t work(i think because activity not created, before wake?).
It is possilbe to give any parameters to my Intent to wake up my phone or do it in other way ?
(If it possible i aslo want unlock device)
Your onCreate() method in the
alarmViewactivity, should be like :Here I assume the name of the layout file for this activity is
activity_alarm_view.xml