double mLatitude=35.41;
double mLongitude=139.46;
float mRadius=500f;
long expiration=-1;
Intent mIntent = new Intent ("Você entrou na área demarcada");
PendingIntent mFireIntent = PendingIntent.getBroadCast(this,-1,mIntent,0);
mLocationManager.addProximityAlert(mLatitude, mLongitude, mRadius, expiration, mFireIntent);
It will not work naturally because it is incomplete. It is not necessary to instantiate LocationManager
and also to register BroadcastReceiver
which, as I understand it, works almost like a listener .
The IntentFilter
associated with some action is still missing. And that's my problem.
How to register BroadcastReceiver for the required action, which is triggered by the addProximityAlert
method?
I did not find anything similar to, for example,
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_CAMERA_BUTTON);
intentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
registerReceiver(intentReceiver, intentFilter);
I would watch the click of a camera button.
is the instantiation at another point in the code of a particular class that has extended% with%, whose unique% method of% would filter if there would be such a click on the camera button)There, parallel to my problem, the monitored action is the click of the camera.
How to make a similar one, so as to record the effective response of the intentReceiver
method?