1. Download our Official Android App: Forums for Android!

Apps Broadcast action for GPS state changed

Discussion in 'Android Development' started by duonginfo, Sep 22, 2010.

  1. duonginfo

    duonginfo Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    16
    Joined:
    May 12, 2010

    May 12, 2010
    16
    0
    15
    I create a app that i want to catch the GPS on/off event.How do i find out the GPS device enable through GPS_EVENT_STARTED and GPS_EVENT_STOPED.Is there the broadcast action for GPS state changed?
    Thank for your reading!
     

    Advertisement

  2. vladimirov

    vladimirov Newbie
    Rank:
    None
    Points:
    16
    Posts:
    17
    Joined:
    Apr 26, 2010

    Apr 26, 2010
    17
    2
    16
    I didn't see this ability, but you can make a service that contains GPS listener with overridden next method

    public void onProviderEnabled(String provider)
    public void onProviderDisabled(String provider)

    and you can send broadcasts yourself from them
     
    duonginfo likes this.
  3. duonginfo

    duonginfo Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    16
    Joined:
    May 12, 2010

    May 12, 2010
    16
    0
    15
    thank you vladimirov.It's helpful.
     

Share This Page

Loading...