1.

I am using getLastLocation() method for getting my last Latitude and Longitude to displaying my last location on Google map. But getLastLocation() method is returning null. Can you tell me why?

Answer»

The first method is called 'onCreate()', which fires when the system first creates the activity. On activity CREATION, the activity enters the Created state.

The LAST method is guaranteed called ‘onPause()’. The system calls this method as the first indication that the user is leaving your activity (though it does not ALWAYS MEAN the activity is being destroyed), but you should save you work/variables/state here. Other methods e.g. onStop, onDestroy may be called or not depends on the system.



Discussion

No Comment Found

Related InterviewSolutions