Can I create Fragment ListActivity with compatibility package v4?

前端 未结 3 1555
一整个雨季
一整个雨季 2021-02-05 21:47

I\'ve been trying to complete tutorial \"Working with fragments\" which was designed for android 3.0+

To acomplish that I\'m using compatibility package v4 (since my API

相关标签:
3条回答
  • 2021-02-05 22:20

    yes you can create the Fragment ListActivity with compatibility with viewpager package v4

    Here is the example

    another example

    0 讨论(0)
  • 2021-02-05 22:24

    Nope, doesn't exist. Stupid support library.

    The solution is easy to create but tedious to maintain. Just copy the native ListActivity class into your project, rename it "FragmentListActivity", and let it extend FragmentActivity instead of Activity. No other tweaks are required and the copy is easy. If you are uncertain you can peak at my code, but it's always best to derive the latest.

    Same goes for GridActivity I would say.

    0 讨论(0)
  • 2021-02-05 22:35

    Look at this question: What to do about ListActivity/MapActivity when converting to Fragments using the compatibility library?

    There is a ListFragment.

    0 讨论(0)
提交回复
热议问题