1, import android.support.v4.app.FragmentActivity;
Refer to this stackoverflow answer, I added after the effect is this:
On Android Studio, File > Project Structure (Ctrl + Alt + Shift + S) Select app, tab dependecies< /c2>, and in the +, put the libraries, then you'll use:
2. This error occurred after adding the module above:
Error:execution failed for task ': App:dexdebug '.
> com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process ' command ' C:\Program Files\java\jdk1.8.0_20\bin\java.exe ' finished with Non-zero exit value 2
Refer to StackOverflow's answer.
Probably dont add suport-v4 library correctly in your project. Check this:1) You have the Add this library to all modules that need it (If you had more than the module in the your project like Mai N module and Library module). 2) Check that the dont add this library twice. Finally if this didn ' t resolve your problem try to remove the this library from your imported libraries list and your project Modules dependency list and import and add it again from one source to your project, then try rebuild the project or rest Art The IDE.
I have added this jar package repeatedly: Android-support-v4.jar. At that time already knew my question should be not to add this jar package, therefore directly adds in the Project Libs folder, but did not know why still had some problems, so I added this library dependency according to the above steps. So, repeat.
Some small problems with Android