Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Simple Android App (2014) Getting Started with Android Running the Fun Facts Project

Mihnea Filipovici
Mihnea Filipovici
512 Points

Fun Facts application has stopped working

So I am trying to run the Fun Facts application for the first time in an emulator (Android 4.4.4, using the Android ARM CPU and 1024 RAM)

It just says "Fun Facts has stopped wroking". Here's what the logcat says:

09-10 16:54:51.070      656-656/com.mihnea.funfacts E/AndroidRuntime FATAL EXCEPTION: main
    Process: com.mihnea.funfacts, PID: 656
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mihnea.funfacts/com.mihnea.funfacts.FunFactsaActivuty}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
            at android.app.ActivityThread.access$800(ActivityThread.java:138)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5026)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
            at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275)
            at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872)
            at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303)
            at android.app.Activity.setContentView(Activity.java:1930)
            at com.mihnea.funfacts.FunFactsaActivuty.onCreate(FunFactsaActivuty.java:14)
            at android.app.Activity.performCreate(Activity.java:5242)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
            at android.app.ActivityThread.access$800(ActivityThread.java:138)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5026)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
            at dalvik.system.NativeStart.main(Native Method)

1 Answer

You cannot combine swipe dismissal and the action bar this is what the log is pointing at.

4.4.4 I believe is the either API level 20 or 21 , the one with the wearable SDK

Of what I can suggest at this point is, try using API 19 4.4.2 and a similar Virtual Device to go with it. Either change the API setting in the manifest file, or easier

1) open the SDK manager and download API 19 if you haven't.
2) Create a new project but select API 19 in build with or target SDK

Hope this helps. Ask again if it doesn't.

Mihnea Filipovici
Mihnea Filipovici
512 Points

Thanks! WOrked perfectly!