Register / Login
Win a copy of
Java EE 8 High Performance
this week in the
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
Manuel Alberto Quero
posted 8 years ago
I've just started with Android platform. I'd like to use a proximity alert. My code is as follows:
//Code for receiver registration lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Intent intent = new Intent(PROXIMITY_ALERT); PendingIntent pi = PendingIntent.getBroadcast(getApplicationContext(), 0, intent, 0); lm.addProximityAlert(lat, lon, 10000f, 1000000, pi); IntentFilter filter = new IntentFilter(PROXIMITY_ALERT); registerReceiver(new ProximityReceiver(), filter);
I'm using telnet command to provide position parameters, but the receiver never gets called.
I have read that some other people have the same problem, is there any problem with the code or it is an emulator problem??
Thanks in advance,
Boost this thread!
Application not run in the background
how to start application after pressing a particular number?
Problem in starting activity from broadcast receivers
How to find out programatically that file is already exist or not?
Create service to run after time