My Android App Crashes After Adding "@android:style/theme.dialog" In The Androidmanifest.xml
Actually, my app is a sample from the book: Beginning Android 4 Development. It's very simple - I just want to apply a dialog theme to an activity. MainActivity.java: package com.
Solution 1:
The reason you are having this problem is because the activity you are trying to apply the dialog theme to is extending ActionBarActivity
which requires the AppCompat
theme to be applied.
So change
android:theme="@android:style/Theme.Dialog"
to
android:theme="@style/Theme.AppCompat"
For more info see You need to use a Theme.AppCompat
Solution 2:
You can apply the solution posted by Giru Bhai above or you can extends Activity instead of extends ActionBarActivity and organize imports.
publicclassActionTextextendsActivity {
Solution 3:
have you tried some thing like
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Dialog" >
Set your dialog theme to activity and it will work
Post logcat if problem persists
Post a Comment for "My Android App Crashes After Adding "@android:style/theme.dialog" In The Androidmanifest.xml"