Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>If I use requestLocationUpdates then GPS is always working. And this is a waste of battery. Maybe there is some way, for example, to pause this for a several minutes? I mean use GPS every 5 minutes for example from one location fetching to next. How to realize this?</p> </blockquote> <p>addProximityAlert() uses GPS every 4 minutes. If you want to use GPS every x minutes, run a Service and get <a href="http://developer.android.com/reference/android/location/LocationManager.html#requestSingleUpdate%28java.lang.String,%20android.app.PendingIntent%29" rel="nofollow">single shot fixes</a> every x minutes, and manually check if it is present around that area.</p> <blockquote> <p>If SOME_CLASS_HERE - some activity class, then how I could know if exactly this event called it? Because when ProximityAlert is triggered I need to call some activity's function as well. How could I do this?</p> </blockquote> <p>Not entirely sure what you are asking here </p> <p>Here is how to use a pending intent </p> <pre><code> PendingIntent pendingIntent; Intent intent = new Intent(); intent.setClass(mContext, yourActivity.class); pendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0); </code></pre> <p><a href="http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK" rel="nofollow">FLAG_ACTIVITY_NEW_TASK</a> : This makes the launched activity the root activity for a task. If a task is already running for the activity you are now starting, <em>then a new activity will not be started</em>; instead, the current task will simply be brought to the front of the screen with the state it was last in.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload