I'm following Big Nerd Ranch Guide (edition from 2015). In chapter 7, we are starting with fragments. The author explained why we should use support libraries, like this:
Authors wrote:The support library includes a complete implementation of fragments that work all the way back
to API level 4. In this book, we will use the support implementation of fragments rather than the
implementation built into the Android OS. This is a good idea because the support library is quickly
updated when new features are added to the fragments API. To use those new features, you can update
your project with the latest version of the support library.
I followed their instructions on how to add app dependencies. My build.gradle (Module app) file, looks like this:
In my Activity, android studio is complaining:
Saying: Cannot resolve Fragment, FragmentActivity, FragmentManager. I also tried some suggestions from SO:
I just checked with my main app, and it has the following dependencies:
But then, I switched to extending android.support.v7.app.AppCompatActivity rather than android.support.v4.app.FragmentActivity (the latter is getting a bit long in the tooth, and the former extends it, so there should be few issues using that instead).
posted 3 months ago
What did you type in Search box for adding dependencies to get android.support.v7.app.AppCompatActivity ?