Quote:
Originally Posted by wolfenr
Struggled to get this tutorial working on my emulator until I tested it on a real phone which worked fine.
After a bit of research I discovered that Fragments were only introduced in API 11 and my emulator was using API 10 so be aware if you experience issues!
|
I created an emulator using API 17, and the app still crashed. I can't figure out how to get it working in the emulator.
1.) If you want to be able to run this app on an emulator targetting API 10 or older or to run this app on an older smartphone running Android 2.3.x or older than you need to
import android.support.v4.app.Fragment.
2.) If you are creating your own Fragment1.java and Fragment2.java make certain that the filenames are exactly with the first letter in uppercase and all other letters in lowercase. This is because of the lines in main.xml
android:name="net.learn2develop.Fragments.Fragment 1 and
android:name="net.learn2develop.Fragments.Fragment 2
3.) The app crashed unless the main activity extended FragmentActivity not just Activity.