Android: setting up a google map class. bit of advice required.

Posted by Capsud on Stack Overflow See other posts from Stack Overflow or by Capsud
Published on 2010-05-28T17:54:35Z Indexed on 2010/05/28 19:52 UTC
Read the original article Hit count: 229

Filed under:
|
|
|

Hey there,

Ok so this is what i've got.

Button anandabutton = (Button) findViewById(R.id.anandaAddressButton);
anandabutton.setOnClickListener(new View.OnClickListener() {

    public void onClick(View view) {
        Intent myIntent = new Intent(view.getContext(),MapClass.class);
        startActivityForResult(myIntent,0);

    }

});

This method opens up my MapClass class which at the moment I just have set to show the location of one place.

But I have a load of buttons and rather than making a lot of different mapClass classes for each button, I am wondering can I just use the one class and depending on what button 'id' is pressed, it will check an 'if statement' and then put in the correct coordinates into the method to display the map. It would be a lot neater than coding up like 20-30 classes.

I'm not sure if i've explained that right so if not let me know.

Thanks for any help.

© Stack Overflow or respective owner

Related posts about android

Related posts about google-maps