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
rientation="vertical"
android:id="@+id/contacts3map"
>
</LinearLayout>
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
rientation="vertical"android:id="@+id/contacts3map"
>
</LinearLayout>
