Created
June 16, 2015 20:11
-
-
Save arussellsaw/38d28bf7c032f2c6eaf7 to your computer and use it in GitHub Desktop.
Android Fragments not being fragments?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MarkerDetails extends Fragment { | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
return inflater.inflate(R.layout.marker_details, container, false); | |
} | |
} | |
class SomeActivity extends FragmentActivity { | |
public void newMarker(View view) { | |
FragmentManager fragmentManager = getFragmentManager(); | |
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); | |
MarkerDetails markerDetails = new MarkerDetails(); | |
fragmentTransaction.add(R.id.map_container, markerDetails); //MarkerDetails is not an instance of Fragment ?!?! | |
fragmentTransaction.commit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment