user3509581
user3509581

Reputation: 83

How can I declare map class in android and call it from another activity?

I am creating an app in android.

In this app I want to show google Map after clicking on a button.

I have declared the button and listener.

But my problem is I want to call another activity class in the action listener and show google map.

But it is not working, I changed emulator from google to Android it worked but calling google api shows me error.

How can i fix this ?

Upvotes: 3

Views: 109

Answers (1)

Jitesh Upadhyay
Jitesh Upadhyay

Reputation: 5260

to navigate from one activity to MapActivity use the code on the button listener as follows

Intent intent = new Intent(context, MyMapActivity .class);
                            startActivity(intent);

do not forget to register MyMapActivity in yours manifest, to write code for MyMapActivity please follow

http://codebybrian.com/2012/12/06/google_maps_android_v2_sample.html

Upvotes: 1

Related Questions