0

I'm following the tutorial here. I am using the ADT bundle (I cleaned everything out and re-downloaded since encountering this problem). I used the SDK manager to install the Google Play Services. I am using SDK version 19 and platform version 4.4.2

I copied "google-play-services_lib" successfully, but got 2 "Unable to resolve target 'android-9'" messages.

I then created the maps demo project and got "Unable to resolve target 'android-16' (this confused me quite a bit, as I couldn't find any place where version 16 was even mentioned, it was either 19, 17, or 9) as well as a ton of unresolved imports. Looking at the Android tab of properties, I saw the reference had a red X next to it (it referenced ..\..\libproject\google-play-serviced_lib instead of ../google-play-services_lib). I updated the reference, getting rid of almost every unresolved import.

At this point I am still getting "The import android.support.v4.app.FragmentActivity cannot be resolved" in the file "SaveStateDemoActivity.java" (as well as a few other errors stemming from this problem). I'm not sure what my problem is, and there is no mention of any of this in the tutorial. This is a somewhat related question, but it seems to be a very different situation. I'm also having a very difficult time understanding the best response.

Community
  • 1
  • 1

1 Answers1

0

This is a somewhat related question, but it seems to be a very different situation.

This is the answer to your problem. FragmentActivity (a subclass of Activity) is a class of the support library. This library is made to help developers manage application compatibility with older devices.

Fragment was introduced in API 11 (Android 3.0 HoneyComb).

So if you want to make your app run on older devices (API < 11) you have to add this library to your project in order to use FragmentActivity class.

Read this from the doc

Community
  • 1
  • 1
S.Thiongane
  • 6,883
  • 3
  • 37
  • 52