Help wanted regarding Location, Timer and Service
<p>Here is my code:</p>

<p>main service class</p>

<pre><code>public class SimpleService extends Service {
Timer mytimer;
private String provider;

//LocationManager locationManager;
//LocationListener mlocListener;
//private Handler toasthandler = new Handler();

@Override
public IBinder onBind(Intent arg0) {
    // TODO Auto-generated method stub
    return null;
}

@Override
public void onCreate() {
    super.onCreate();
    Toast.makeText(this,"Service created ...", Toast.LENGTH_LONG).show();
    mytimer = new Timer();
    mytimer.schedule(new TimerTask() {

        @Override
        public void run() {
            // TODO Auto-generated method stub
            toastHandler.sendEmptyMessage(0);


        }
    },0,1000);

}

@Override
public void onDestroy() {
    super.onDestroy();
    Toast.makeText(this, "Service destroyed ...", Toast.LENGTH_LONG).show();
    mytimer.cancel();
}
private final Handler toastHandler=new Handler()
{
    public void handleMessage(Message msg) 
    {
        getdata();
    };
};
public void getdata()
{
    LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    LocationListener mlocListener = new MyLocationListener();
    mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
            mlocListener);
    // Initialize the location fields


}
public class MyLocationListener implements LocationListener {
    @Override
    public void onLocationChanged(Location loc) {
        loc.getLatitude();
        loc.getLongitude();
        String Text = "My current location is: " + "Latitude = "
                + loc.getLatitude() + "Longitude = " + loc.getLongitude();
        Toast.makeText(getApplicationContext(), Text, Toast.LENGTH_SHORT)
                .show();
        Log.d("TAG", "Starting..");
    }

    @Override
    public void onProviderDisabled(String provider) {
        Toast.makeText(getApplicationContext(), "Gps Disabled",
                Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onProviderEnabled(String provider) {
        Toast.makeText(getApplicationContext(), "Gps Enabled",
                Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
    }
} //End of Class MyLocationListener */

}
</code></pre>

<p>Here I used timer in service to call <code>requestLocationUpdate()</code> method after each and every 1 second, but this method doesn't get called. When I press button from DDMS than all TAG.D print at a time. 
Output in log cat looks like this:</p>

<pre><code>05-11 15:47:29.763: DEBUG/dalvikvm(308): GC_EXPLICIT freed 47 objects / 2264 bytes in 59ms
05-11 15:47:34.904: DEBUG/dalvikvm(190): GC_EXPLICIT freed 88 objects / 3856 bytes in 151ms
05-11 15:47:36.294: DEBUG/TAG(3677): Starting..
05-11 15:47:36.294: DEBUG/TAG(3677): Starting..
05-11 15:47:36.294: DEBUG/TAG(2449): Starting..
05-11 15:47:36.524: DEBUG/TAG(3677): Starting..
05-11 15:47:36.534: DEBUG/TAG(3677): Starting..
05-11 15:47:36.544: DEBUG/TAG(3677): Starting..
05-11 15:47:36.554: DEBUG/TAG(3677): Starting..
05-11 15:47:36.564: DEBUG/TAG(3677): Starting..
05-11 15:47:36.574: DEBUG/TAG(3677): Starting..
05-11 15:47:36.594: DEBUG/TAG(3677): Starting..
05-11 15:47:36.604: DEBUG/TAG(3677): Starting..
05-11 15:47:36.614: DEBUG/TAG(3677): Starting..
05-11 15:47:36.624: DEBUG/TAG(3677): Starting..
05-11 15:47:36.635: DEBUG/TAG(3677): Starting..
05-11 15:47:36.644: DEBUG/TAG(3677): Starting..
05-11 15:47:36.664: DEBUG/TAG(3677): Starting..
05-11 15:47:36.674: DEBUG/TAG(3677): Starting..
05-11 15:47:36.694: DEBUG/TAG(3677): Starting..
05-11 15:47:36.704: DEBUG/TAG(3677): Starting..
05-11 15:47:36.714: DEBUG/TAG(3677): Starting..
05-11 15:47:36.734: DEBUG/TAG(3677): Starting..
05-11 15:47:44.394: DEBUG/dalvikvm(58): GREF has increased to 401
05-11 15:47:47.734: DEBUG/dalvikvm(2449): GC_EXPLICIT freed 372 objects / 20424 bytes in 149ms
05-11 15:47:53.663: DEBUG/SntpClient(58): request time failed: java.net.SocketException: Address family not supported by protocol
</code></pre>

<p>Can you please tell what's going on wrong in the code?</p>
