Reputation: 321
I have one application. I need to display map view when we click on map button. Actually this map button is in one class and google map is in another class. Now How can we call one map activity class from another activity class.
Please help me!
Upvotes: 0
Views: 1829
Reputation: 28675
For the button, in the xml layout, set android:clickable="true"
and android:onClick="showMap"
, then in your first activity/class, it's like this:
public void showMap(View v) {
Intent intent = new Intent(this, Map.class);
startActivity(intent);
}
(Map.class being the class/name of your activity with the map. You need to adjust the name to your case.)
Upvotes: 1