App crashes when trying to fullscreen activity

user4558283

Hi I'm using the code below to hide actionbar and fullscreen my activity

android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"

But with this code I get runtime error and app just crashes anyone know whats the problem?

Logcat:

       
E/AndroidRuntime(1081): FATAL EXCEPTION: main
E/AndroidRuntime(1081): Process: com.example.directmate, PID: 1081
E/AndroidRuntime(1081): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.directmate/com.example.directmate.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
E/AndroidRuntime(1081):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
E/AndroidRuntime(1081):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
E/AndroidRuntime(1081):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime(1081):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime(1081):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(1081):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(1081):     at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime(1081):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(1081):     at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(1081):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime(1081):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime(1081):     at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(1081): Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
E/AndroidRuntime(1081):     at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:111)
E/AndroidRuntime(1081):     at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
E/AndroidRuntime(1081):     at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
E/AndroidRuntime(1081):     at com.example.directmate.MainActivity.onCreate(MainActivity.java:22)
E/AndroidRuntime(1081):     at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime(1081):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime(1081):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
E/AndroidRuntime(1081):     ... 11 more
Morteza

It's probably related to your activities extend part, with this code you added to your manifest you need to extend Activity instead of ActionbarActivity

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

App crashes when trying to start a new activity

From Dev

App Crashes When Trying to Set Wallpaper as Activity Background

From Dev

App crashes when trying to reuse toolbar by extending custom activity

From Dev

App crashes when switching activity

From Dev

My app crashes when opening tablayout activity

From Dev

App crashes when start an Activity inside scheduleAtFixedRate

From Dev

App crashes when I open another activity

From Dev

Android App crashes when intent a new activity

From Dev

App crashes when trying to implement multilingual support

From Dev

App crashes when trying to show AlertDialog in thread

From Dev

Meteor app crashes when trying to populate collections

From Dev

App crashes when trying to record audio

From Dev

App crashes when trying to open a fragment with listview

From Dev

App crashes when trying to connect to Neura service

From Dev

App crashes when trying to save to SQLite database

From Java

This part of code crashes my app trying to change activity

From Dev

Transparent activity crashes the app

From Dev

App crashes on restarting activity

From Dev

App crashes on launch of Activity

From Dev

App crashes when i switch to another activity that contains recycler view

From Dev

Why Android App crashes when attempting to start new activity

From Dev

Android app crashes when retrieving int from an intent in another activity

From Dev

app crashes when opening another activity in Navigation Drawer

From Dev

Going Fullscreen Through MainActivity Crashes the App

From Dev

App won't display and crashes in fullscreen

From Dev

App crashes when trying to add a row into table by pressing a button

From Dev

App crashes when trying to display three panoramic photos on one screen

From Dev

Visual Studio crashes when trying to associate Cordova app with store

From Dev

App crashes when nothing is entered in the TextBoxes I'm trying to parse

Related Related

  1. 1

    App crashes when trying to start a new activity

  2. 2

    App Crashes When Trying to Set Wallpaper as Activity Background

  3. 3

    App crashes when trying to reuse toolbar by extending custom activity

  4. 4

    App crashes when switching activity

  5. 5

    My app crashes when opening tablayout activity

  6. 6

    App crashes when start an Activity inside scheduleAtFixedRate

  7. 7

    App crashes when I open another activity

  8. 8

    Android App crashes when intent a new activity

  9. 9

    App crashes when trying to implement multilingual support

  10. 10

    App crashes when trying to show AlertDialog in thread

  11. 11

    Meteor app crashes when trying to populate collections

  12. 12

    App crashes when trying to record audio

  13. 13

    App crashes when trying to open a fragment with listview

  14. 14

    App crashes when trying to connect to Neura service

  15. 15

    App crashes when trying to save to SQLite database

  16. 16

    This part of code crashes my app trying to change activity

  17. 17

    Transparent activity crashes the app

  18. 18

    App crashes on restarting activity

  19. 19

    App crashes on launch of Activity

  20. 20

    App crashes when i switch to another activity that contains recycler view

  21. 21

    Why Android App crashes when attempting to start new activity

  22. 22

    Android app crashes when retrieving int from an intent in another activity

  23. 23

    app crashes when opening another activity in Navigation Drawer

  24. 24

    Going Fullscreen Through MainActivity Crashes the App

  25. 25

    App won't display and crashes in fullscreen

  26. 26

    App crashes when trying to add a row into table by pressing a button

  27. 27

    App crashes when trying to display three panoramic photos on one screen

  28. 28

    Visual Studio crashes when trying to associate Cordova app with store

  29. 29

    App crashes when nothing is entered in the TextBoxes I'm trying to parse

HotTag

Archive