简体   繁体   中英

Android AppCompat Library usage

I found on many blogs and tutorials links, where clearily written to support AppCompat Library we should use ActionBarActivity to extend Class instead of normal Activity.

So its clear to me, but i have few doubts in my mind regarding extending ActionBarActivity.

Questions are:

  1. what if my class extends Fragment (is there i need to extends ActionBarActivity) while using AppCompat Library?

  2. what if my class extends ListActivity (is there i need to extends ActionBarActivity) while using AppCompat Library (if 'yes' so how ?)

1) ActionBarActivity extends FragmentActivity so you can use fragments with it

2) Instead of using ListActivity you have to add a ListFragment to your ActionBarActivity (or FragmentActivity ). You can add it to android.R.id.content so it occupies the whole screen.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM