Activity Recognition

I want to detect activity and get location,, only when user enter his/her vehicle