> That could be from several dozen (or hundred) alert dialogs. Try switching
> to android.util.Log and see if that clears up the problem.
To avoid java.lang.OutOfMemoryError I use a boolean variable to check
wether the problem is that you are thinking...
class ProximityIntentReceiver extends IntentReceiver
{
@Override
public void onReceiveIntent(Context context, Intent intent)
{
String action = intent.getAction();
if (action.equals(PROXIMITY_ALERT))
{
if (!alert_activated)
{
showAlert("Proximity alert.",0, "Alert
message.", "OK",
false);
alert_activated = true;
}
}
}
}
And yes, it seems that it is.
> You definitely need some permissions. I think I use ACCESS_LOCATION,
> ACCESS_CELL_ID, and the GPS one (I forget the name), just to make sure I
> have what I need.
Yes, the trackbuilder example has android.permission.ACCESS_LOCATION,
android.permission.ACCESS_GPS and I have add
android.permission.ACCESS_CELL_ID.
When I load a Location Provider and then I choose exit option I have
an Application Error:
"An error has ocurred in net.mobilefight.trackbuilder. Error receiving
broadcast null in net.mobilefight.trackbuilder.TrackBuilder
[EMAIL PROTECTED]"
I have removed this error using the unregisterReceiver function into
the exit function.
> If you are merely looking to confirm that you are receiving the intent, I
> would use android.util.Log.
I would like to use the proximity alert to fire an activity, but with
the modifications that I try doesn't work.
myLocationManager.addProximityAlert(LATITUDE_ALERT_1,
LONGITUDE_ALERT_1,
RADIUS_ALERT,
EXPIRATION_ALERT,
intentClass);
where intentClass is an Intent. I put this code into onCreate
function:
intentClass = new Intent(this,alertClass.class);
With this method doesn't work, the activity is not firing. I modify
the ProximityIntentReceiver to fire the Activity.
class ProximityIntentReceiver extends IntentReceiver
{
@Override
public void onReceiveIntent(Context context, Intent intent)
{
String action = intent.getAction();
if (action.equals(PROXIMITY_ALERT))
{
if (!alert_activated)
{
alert_activated = true;
startSubActivity(intentClass, ALERT_CODE);
}
}
}
}
With this code I have the next message error:
Error receiving broadcast Intent
{action=net.mobilefight.trackbuilder.action.PROXIMITY_ALERT
extras=Bundle[{entering=true}]} in
net.mobilefight.trackbuilder.TrackBuilder
[EMAIL PROTECTED]
According to I have read, I think that I can't use startActivity/
startsubActivity into an IntentReceiver I obtain the above error.
Then, if I can't use startActivity/startsubActivity and the function
proximityAlert doesn't work with Intent(this,alertClass.class) how I
can open an activity from an IntentReceiver or directly with the
proximityAlert function?.
I explain you because I would want to open an activity, maybe there is
other way to do it. The idea is that when the GPS point is near of
some alert point I want to show information related of that location.
This information is stored into a SQLite database, the intention of
the activity would be to read from the database.
Thanks for your help, if there is something that happens to you I try
it.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---