I'm triying to migrate my app from actionbarsherlock to Google's actionbarcompat, but ActionBarFragmentActivity does not exist. Do I have to use ActionBarActivity or there is another way?
Thanks in advance, Diego.
Though you can add a Toolbar anywhere within your fragment's view hierarchy, you should generally keep it at the top of the screen. To use the Toolbar in your fragment, provide an ID and obtain a reference to it in your fragment, as you would with any other view.
The fragment is only part of an activity, it basically contributes its UI to that activity.
Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button. In general an ActionBar consists of the following four components: App Icon: App branding logo or icon will be displayed here.
Fragments introduce modularity and reusability into your activity's UI by allowing you to divide the UI into discrete chunks. Activities are an ideal place to put global elements around your app's user interface, such as a navigation drawer.
Look here. This should help you out.
http://android-developers.blogspot.in/2013/08/actionbarcompat-and-io-2013-app-source.html
An Excerpt:
Extend Activity classes from ActionBarCompat: ActionBarCompat contains one Activity class which all of your Activity classes should extend: ActionBarActivity. This class itself extends from FragmentActivity so you can continue to use Fragments in your application. There is not a ActionBarCompat Fragment class that you need to extend, so you should continue using android.support.v4.Fragment as the base class for your Fragments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With