GPS and SensorManager values should update camera preview
Hi everyone I wish to update my camera preview whenever there is a chang开发者_运维知识库e in GPSlocation and Sensor Manager values, i am currently using two services for this purpose,but i am not able to receive the updates on my preview. Is it possible to combine these services into one and then use intents and broadcastReceivers? or any alternative is present? Please guide me on this Thanks
Use just one Service
to keep track of GPS and Sensor data and use a ResultReceiver
or Messenger
and Message
to pass back updates to the Handler
in your Activity
.
Edit:
Sorry, forgot to mention that you pass the ResultReceiver
or Message
as a parcelable extra in the Intent
you use to start the Service
.
精彩评论