• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Google Maps Android

Gonzo

Newbie
I am trying to put a Marker of a special location, I have tried all the marking ways but cannot figure it out...here is my code

import com.google.android.gms.maps.SupportMapFragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

public class Contacts3 extends FragmentActivity {
private static final String Contacts3 = "Contacts3";

@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
setContentView(R.layout.contacts3);

}

@Override
protected void onResume() {
super.onResume();

SupportMapFragment mMapFragment = SupportMapFragment.newInstance();
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.add(R.id.contacts3map, mMapFragment, Contacts3);
fragmentTransaction.commitAllowingStateLoss();

}

@Override
protected void onPause() {

super.onPause();


FragmentManager fmanager = getSupportFragmentManager();

Fragment fragment = fmanager.findFragmentByTag(Contacts3);
fmanager.beginTransaction().remove(fragment).commitAllowingStateLoss();


}


}

Here is my layout...the map works i just need a marker

<?xml version="1.0" encoding="utf-8"?>


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/contacts3map"
>


</LinearLayout>
 
Are you trying to Alter the code in Google Maps?

Or are you developing something new?

I moved the thread over to the development forum, hope you don't mind.

I think you'll get better help with your question in our development forum. The other experienced devs can give you better assistance. :)
 
Thank you! I did not see where to put this type of question..sorry for putting it in the general area.

I am trying to have two tabs have two different maps and two different markers for two different locations. This makes each tab have its own map but I cannot get a marker to work.
 
Ahhh, ok. I'm not much of a dev myself, so I'm not much help with the code. :o

Also no worries about where you posted your thread, that's why we're here. :)

If you have any questions shoot me a PM, my door is always open. :)
 
in the future put your code into [ code] tags (without the space) to be easier to read. are those your mainactivity and activity_main.xml?

That code has nothing about a marker, so of course you dont have one showing up. what did you try?

EDIT: and why isnt is setup as a fragment, that code works like that? whats your other xml?
 
Back
Top Bottom