When I press the button(named \"current location\") it should shows current location(lat & long) on the textview(named \"tvAddress\") .But it\'s not working as I expect. It\
Just you have wrongly initialized your views. As you can only access the views after setContentView()
method and you have done that totally reverse that is why its throwing error.
Just change your onCreate()
as below:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
manager = (LocationManager) getSystemService(LOCATION_SERVICE);
tvAddress = (TextView) findViewById(R.id.tvaddress);
btncurrent= (Button)findViewById(R.id.btncurrent);