Android Studio Can't resolve fragmentActivity and ViewPager imports

后端 未结 5 1690
野性不改
野性不改 2021-01-13 10:11

I follow the tutorial of developing swipe-able tabs. When I import:

import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;         


        
5条回答
  •  长情又很酷
    2021-01-13 10:36

    1. Make sure you have downloaded the Android Support Repository using the SDK Manager.
    2. Open the build.gradle file for your application.
    3. Add the support library to the dependencies section. For example, to add the v4 support library, add the following lines:

      dependencies { ... compile "com.android.support:support-v4:18.0.+" }

提交回复
热议问题