I follow the tutorial of developing swipe-able tabs. When I import:
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
To add the Android Support Library to an existing Android Project:
Right click on your project Select Android Tools Select Add Support Library.
Usually even after you add through SDK manager,you have to individually add in this process.This will set up the jar files needed.
I have solved it. I installed everything but I did not import the external library into my library. It was not installed automatically during creation of the new project. So I just opened the project structure and imported the dependencies -> add support-v4 library.
Btw, thanks you guys for helping me a lot and posting the suggestion to me.
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.+" }
If you had installed all tools and configed it, Try to do like this in your IDE menu : Build-> Clean Project