How to remove Title Bar from Activity extending ActionBarActivity or AppcompatActivity with Dialog Theme

I had same issue and needed to do something like following to resolve (note use of “windowNoTitle” instead of “android:windowNoTitle”) <style name=”Theme.MyDialog” parent=”@style/Theme.AppCompat.Light.Dialog”> <item name=”windowActionBar”>false</item> <item name=”windowNoTitle”>true</item> </style>

can’t resolve AppCompatActivity

Okay, to anybody who might stumble upon this now, Android Studio is very, very, very weird. Solution : Go to your build.gradle file and in your dependencies find the appcompat one, something like compile ‘com.android.support:appcompat-v7:XX.X.X’ Change it to compile ‘com.android.support:appcompat-v7:XX.X.+’ Then click on Sync Now on the top right of the editor. All the red … Read more

How to display menu item with icon and text in AppCompatActivity

@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. // getMenuInflater().inflate(R.menu.menu_patient_home_screen, menu); menu.add(0, 1, 1, menuIconWithText(getResources().getDrawable(R.mipmap.user_2), getResources().getString(R.string.action_profile))); menu.add(0, 2, 2, menuIconWithText(getResources().getDrawable(R.mipmap.add_user), getResources().getString(R.string.action_add_user))); menu.add(0, 3, 3, menuIconWithText(getResources().getDrawable(R.mipmap.switch_profile), getResources().getString(R.string.action_switch_profile))); menu.add(0, 4, 4, menuIconWithText(getResources().getDrawable(R.mipmap.logout), getResources().getString(R.string.action_sign_out))); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle … Read more

How to fix: “You need to use a Theme.AppCompat theme (or descendant) with this activity”

Your application has an AppCompat theme <application android:theme=”@style/AppTheme”> But, you overwrote the Activity (which extends AppCompatActivity) with a theme that isn’t descendant of an AppCompat theme <activity android:name=”.MainActivity” android:theme=”@android:style/Theme.NoTitleBar.Fullscreen” > You could define your own fullscreen theme like so (notice AppCompat in the parent=) <style name=”AppFullScreenTheme” parent=”Theme.AppCompat.Light.NoActionBar”> <item name=”android:windowNoTitle”>true</item> <item name=”android:windowActionBar”>false</item> <item name=”android:windowFullscreen”>true</item> <item name=”android:windowContentOverlay”>@null</item> … Read more

What’s the enhancement of AppCompatActivity over ActionBarActivity?

As Chris wrote, new deprecated version of ActionBarActivity (the one extending AppCompatActivity class) is a safe to use backward compatibility class. Its deprecation is just a hint for you asking to use new AppCompatActivity directly instead. AppCompatActivity is a new, more generic implementation which uses AppCompatDelegate class internally. If you start a new development, then … Read more

Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?

I thought Activity was deprecated No. So for API Level 22 (with a minimum support for API Level 15 or 16), what exactly should I use both to host the components, and for the components themselves? Are there uses for all of these, or should I be using one or two almost exclusively? Activity is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)