-1

I'm using getApplicationContext().getResources().getConfiguration().locale.getDisplayCountry();to get country name I'm getting United states as output but I'm in India. I'm implementing my application in eclipse. Everything will done manifest file

Cœur
  • 37,241
  • 25
  • 195
  • 267
sai
  • 3
  • 2
  • 1
    Same question http://stackoverflow.com/questions/3659809/where-am-i-get-country. The second answer could be a solution for you. – Markus Mar 24 '16 at 14:04
  • You are getting the country name of the language set on your device, which is `English (United States)`. Change the language to `English (India)` and you'll get India after that. – Prerak Sola Mar 24 '16 at 14:05
  • just think in view of user we cant able to know weather he selected his lanuage as English(india). and the above solution is also tried but iam not getting my location exactly if u have any solution help me@prerak sola – sai Mar 24 '16 at 14:14

1 Answers1

1

You're getting the device locale, not your location. Turns out the locale of the device you're using is set to US.

Egor
  • 39,695
  • 10
  • 113
  • 130