My problem is this: I have a MyLocationActivity.java
that gives me the location in google maps, the example that I have to send to call that file is to call a fragment that I have declared in my MainActivity.java
and what I want is to send my second activity MyLocationFragment.java
(to that file I call it fragment because with the start tests to show the fragment, but change its internal code to FragmentActivity (for all content code))
Error: incompatible types: MyLocationFragment can not be converted to Fragment
MainActivity.java (drawable layout)
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_mylocation) {
MyLocationFragment myLocationFragment = new MyLocationFragment();
android.support.v4.app.FragmentManager manager = getSupportFragmentManager();
manager.beginTransaction().replace(R.id.map, myLocationFragment).commit();
} else if (id == R.id.nav_gallery) {
} else if (id == R.id.nav_slideshow) {
} else if (id == R.id.nav_manage) {
} else if (id == R.id.nav_share) {
} else if (id == R.id.nav_send) {
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}