you need to build set a Table using SQLITE in android
TableBeach
COLUMN_BEACH_ID,
COLUMN_BEACH_TITLE
COLUMN.LAT
COLUMN.LONG
other thing ...............
TableRestaurants
TableCafes
each fragment only load that data base that key
BeachFragment extends Fragment implements
LoaderManager.LoaderCallbacks<Cursor> {
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
String[] projection = new String[]{TableBeach.COLUMN_BEACH_ID,
TableBeach.COLUMN_BEACH_TITLE};
String selection = null;
String[] selectionArgs = null;
String sortOrder = null;
return new CursorLoader(getActivity(),
XYZattractionsProvider.CONTENT_URI, projection, selection,
selectionArgs, null);
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
mAdapter.swapCursor(data);
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
mAdapter.swapCursor(null);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_beach) {
fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.content_surf_main,
BeachFragment.newInstance("dog","girl"))
.addToBackStack(null)
.commit();
// / Handle the camera action
} else if (id == R.id.nav_restaurants) {
fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.content_surf_main,
RestaurantsFragment.newInstance("dog","girl"))
.addToBackStack(null)
.commit();
} else if (id == R.id.nav_ cafes) {
fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.content_surf_main,
CafesFragment.newInstance("dog","girl"))
.addToBackStack(null)
.commit();
} else if (id == R.id.nav_manage) {
} else if (id == R.id.nav_share) {
} else if (id == R.id.nav_send) {
}
Peter Stevenson
Waikuku Beach SLSC
E-mail [email protected]
Mobile 027 313 1415
On Sun, Jul 10, 2016 at 1:11 AM, Tom Lear <[email protected]> wrote:
> Hi,
>
> I'm trying to make a tourist app for a particular area, I'm not 100%
> familiar with Android studio. How would I go about putting Google's sample
> "xyz attractions" into separate drawers or fragments. So for example in my
> app, I would have beaches/ restaurants/ cafes in different 'pages' which
> are selected from a menu.
>
> I've made an app with a navigation drawer but I'm not sure how to
> implement XYZ attractions into this.
>
> All help would be greatly appreciated as I'm only 16.
>
> Thanks.
>
> * https://github.com/googlesamples/android-XYZTouristAttractions
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/c62ac529-324c-4d78-b9cc-42b363b45ca8%40googlegroups.com
> <https://groups.google.com/d/msgid/android-developers/c62ac529-324c-4d78-b9cc-42b363b45ca8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/CADX5xAuinWKgY-3dvnw9%3DbswDe%3DtcAKA%3DM-%2B8DCCHd4Pkb_XYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.