This is what worked for me.
In the Project panel, right click on the project name, and
select Open Module Settings
from the popup menu.
then change the Compile SDK Version
to the minimum version available (the minimum sdk version you set in the project).
wait for android studio to load everything.
It will give you some errors, ignore those.
Now go to your java file and android studio will suggest you import
import android.support.v4.app.FragmentActivity;
Import it, then go back to Open Module Settings
and change the compile sdk version back to what it was before.
Wait for things to load and voila.