Back to project page android-location-notes.
The source code is released under:
Apache License
If you think the Android project android-location-notes listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nearsoft.examenboom; //from w ww. j av a2 s .c om import android.os.Bundle; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.nearsoft.examenboom.common.Note; import com.nearsoft.examenboom.database.repository.NoteRepository; import com.nearsoft.examenboom.database.repository.NoteRepositoryImpl; import java.util.List; /** * Created by jsalcido on 7/27/14. */ public class NotesMapFragment extends MapFragment { private NoteRepository mNotesRepository; private List<Note> mNotes; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(false); mNotesRepository = new NoteRepositoryImpl(getActivity()); mNotes = mNotesRepository.allNotes(); } @Override public void onResume() { super.onResume(); for (Note note : mNotes) { MarkerOptions options = new MarkerOptions(); LatLng latLng = new LatLng(note.getLatitude(), note.getLongitude()); options.position(latLng); options.title(note.getTitle()); options.snippet(note.getText()); Marker marker = getMap().addMarker(options); } } }