listfragment simple example

android, android-fragments, fragment

Solution

When using the support library, you need to use `getSupportFragmentManager` (the method name in the support library) instead of `getFragmentManager` (which is the method name in post 3.0).

Problem

Hello i want to get simple list fragment example i have searched out but could not get it so please can any body help me ``` import android.support.v4.app.Fragment; ``` i have searched out but mostly in import android.app.*; so any body help me to find out example so it is not working on my android 2.2 ``` if (savedInstanceState == null) { FragmentTransaction ft = getFragmentManager().beginTransaction(); ListFragment listFragment = new ListFragment(); ft.add(R.id.displayList, listFragment, "List_Fragment"); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ``` i m getting error over getFragmentmanger this example must be in below android 3.0

Original source