DEV Community

Naushi Fatima
Naushi Fatima

Posted on

How To set Compass Directions In Android Studio Java

I have a Compass App, I want to set Current direction in my TextView whenever the direction changed, like this but it check the last condition only.

        if (direction >= 240 && direction <= 20) {
            tvHeading.setText("North: "+Float.toString(degree) + " Degrees")
        }
        else if (direction > 20 && direction <=

Top comments (0)