1, to an activity to add a dialog theme, resulting in the following problem, in eclipse but no error
<activity android:name= ". Dialogactivity " android:label=" @string/title_activity_dialog " android:theme=" @ Android:style/theme.dialog " > </activity>
Error message:
Java.lang.IllegalStateException:You need to use a theme.appcompat Theme (or descendant) with this activity.
2, add requestwindowfeature in activity (Window. Feature_no_title); (Does not show the title), the eclipse also did not error, but in Android studio error
1 @Override 2 protected void onCreate (Bundle savedinstancestate) {3 Super . OnCreate (savedinstancestate); 4 requestwindowfeature (window.feature_no_title); 5 Setcontentview (r.layout.activity_dialog); 6 }
Workaround:
The activity created by Android Studio is mainactivity extends actionbaractivity. Change the actionbaractivity back to activity and then guide the package.
Android developed some common error resolution methods from eclipse to Android studio