Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android.support.v4 import not working

I've seen questions like this, but it's not exactly what I'm looking for.

I was following the tutorial on how to build an RSS Android parser and reader from here. Along the way, some code included importing fragmentactivityand fragment. Both imports failed. Experimentation showed me that when importing the fragment, it should be imported as

    import android.app.fragment;

rather than

    import android.support.v4.app.fragment;

which was in the code for this RSS reader.

Trying the same thing with

    import android.app.fragmentactivity;

doesn't work, when it calls for

    import android.support.v4.app.fragmentactivity;

Does anyone know why it's failing to import this properly? Reading the Android Documentation doesn't seem to help. Please let me know if I need to add anything! Thanks.

like image 637
javathunderman Avatar asked Jun 04 '26 05:06

javathunderman


1 Answers

You have to import the appropriate Android Support Library. Google has a thoroughly written document here: https://developer.android.com/tools/support-library/setup.html

However, the setup is kind of different depending on your IDE (Eclipse, Android Studio, etc.) From my personal experience, Android Studio is the easiest to get started with the nasty build logistics.

like image 67
Al Wang Avatar answered Jun 06 '26 17:06

Al Wang