开发者

GPS and SensorManager values should update camera preview

开发者 https://www.devze.com 2023-03-04 11:38 出处:网络
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 abl

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消