Button showmapButton = (Button)findViewById(R.id.showmap);
showmapButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(HomePage.this,
ShowMap.class);
intent.putExtra("username", value);
startActivity(intent);
}
});
In my main menu i have a button 'ShowMap' Everytime i click on showmap my map will hit a null pointer exception causing the program to crash. 'ShowMap' works fi ne if i launch straight to that page without having a need to click button to call that activity.
I tried changing all my files to "extends MapActivity" instead of regular activitiy but the program will still crash whenever i click on show map