Question

How do I draw a rotating arrow depending on the true north and location of the user? I will be using it as a marker on a map. It will work just like those in navigation applications. I'm currently thinking of overriding the onSensorChanged and calling drawMyLocation from there to draw the rotated arrow. However, it seems to be resource intensive since the a new rotated bitmap will always be created inside the drawMyLocation. Plus I can't access the Canvas object of MyLocationOverlay. Do you have any methods that you can suggest?

Was it helpful?

Solution

You must have to use sensor manager, and compass. Take a class with canvas. in ondraw method paint the cursor. Implement that in your activity. It will rotate according to the sensor result like compass.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top