I have done some modifications to my code, following your
indications.
I have created a new class, ProximityIntentReceiver to receive the
PROXIMITY_ALERT action .
class ProximityIntentReceiver extends IntentReceiver
{
@Override
public void onReceiveIntent(Context context, Intent intent)
{
String action = intent.getAction();
if (action.equals(PROXIMITY_ALERT))
showAlert("Proximity alert.",1, "Alert message.", "OK",
false);
}
}
and I have modified MyIntentReceiver class to receive
LOCATION_CHANGED_ACTION action.
class MyIntentReceiver extends IntentReceiver
{
@Override
public void onReceiveIntent(Context context, Intent
intent)
{
String action = intent.getAction();
if (action.equals(LOCATION_CHANGED_ACTION))
if(TrackBuilder.this.doUpdates)
TrackBuilder.this.updateView();
}
}
I register the IntentReceivers into onResume function:
@Override
public void onResume()
{
super.onResume();
doUpdates = true;
registerReceiver(myIntentReceiver, myIntentFilter);
registerReceiver(receiver, proximitylocationIntentFilter);
}
I add the proximity alert into the onCreate function.
myLocationManager.addProximityAlert(LATITUDE_ALERT,
LONGITUDE_ALERT,
RADIUS_ALERT,
EXPIRATION_ALERT,
intent_alert);
In DDMS perspective I saw that I need to add ACCESS_CELL_ID permission
to use proximity alert, it's true? I add it into AndroidManifest.xml .
I run the application and the alert is fired :) But ... I have the
next error:
An error has ocurred in net.mobilefight.trackbuilder.
java.lang.OutOfMemoryError.
I see the alert message and later appears the above error.
Using the DDMS perspective I see a lot of Warnings. I will try to
resolve these Warnings.
Is normal that the mock GPS continue working although the activity is
closed? . When I start the application and I select the GPS provider
the location isn't in the first position.
> Here's a few lines of code from the TourIt sample of my book, which I
> really really really really hope will be ready for you by next Monday:
Thanks, I will wait to Monday.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---