appcompatactivity

can't resolve AppCompatActivity

柔情痞子 提交于 2019-11-27 04:15:32
问题 After renaming application package name, Android Studio displayed this error can't resolve symbol AppCompatActivity Things I tried: Clean project Clean Android Studio cache Clean Gradle cache Re-installed IDE File-> Invalidate cache/restart But nothing really helped. The project build successfully, but I can not use syntax highlighting. I used com.android.support:appcompat-v7:23.1.1 Screenshots 回答1: Okay, to anybody who might stumble upon this now, Android Studio is very, very, very weird.

How to display menu item with icon and text in AppCompatActivity

烈酒焚心 提交于 2019-11-27 01:41:15
I tried different combinations in xml file: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"> <item android:id="@+id/action_create_alarm" android:icon="@drawable/ic_action_accept" android:orderInCategory="100" android:title="@string/menu_create_alarm" app:showAsAction="ifRoom|withText" /> </menu> or <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android

Material Design, AppCompat, and Backwards Compatibility

本小妞迷上赌 提交于 2019-11-26 23:07:26
I'm trying to understand the principles of using Material Design a bit better (I'm new to this area and have been reading documentations and tutorials, but the subject is still a bit vague to me), and I'll be glad for some help. What I've tried so far is having 2 folders (values and values-21) with a styles.xml file per each of them - values/styles.xml: <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"></style> values-v21/styles.xml: <style name="AppTheme" parent="android:Theme.Material.NoActionBar"></style> The problem begins where I try to use activities that inherit from

'ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1' [duplicate]

夙愿已清 提交于 2019-11-26 21:10:35
This question already has an answer here: Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1 4 answers I want to try Intellij Platform for android development but even after fresh it shows gradle failures. Please help. I have tried tweaking the line implementation 'com.android.support:appcompat-v7:29.+' to some other versions but to no avail. Here is my module level gradle apply plugin: 'com.android.application' android { compileSdkVersion 29 buildToolsVersion "29.0.1" defaultConfig { applicationId "com.example.myapplication" minSdkVersion 23 targetSdkVersion 29

Getting exception : java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14

牧云@^-^@ 提交于 2019-11-26 17:16:25
问题 I updated Android Studio and the android design library recently since then I am getting an exception java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14 . Not sure what is the problem, I tried almost everything, its working in lollipop 5.1 device(nexus 4) but it does not work in Android 4.4 device and 4.02 device. It was working before the updation in all versions. I tried all solutions mentioned in stackoverflow but nothing worked for me. Also tried removing the

Do not request Window.FEATURE_ACTION_BAR issue

自作多情 提交于 2019-11-26 14:13:57
问题 I'm trying to build my app but without success.. I tried several way but nothing was worked. The exception is: Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead. My style.xml is: <resources> <style name="AppTheme" parent="Theme.AppCompat.Light"> <!-- theme customizations --> <item name="colorPrimary">@color

How to display menu item with icon and text in AppCompatActivity

自闭症网瘾萝莉.ら 提交于 2019-11-26 09:39:22
问题 I tried different combinations in xml file: <menu xmlns:android=\"http://schemas.android.com/apk/res/android\" xmlns:app=\"http://schemas.android.com/apk/res-auto\" xmlns:tools=\"http://schemas.android.com/tools\" tools:context=\".MainActivity\"> <item android:id=\"@+id/action_create_alarm\" android:icon=\"@drawable/ic_action_accept\" android:orderInCategory=\"100\" android:title=\"@string/menu_create_alarm\" app:showAsAction=\"ifRoom|withText\" /> </menu> or <menu xmlns:android=\"http:/

Material Design, AppCompat, and Backwards Compatibility

浪子不回头ぞ 提交于 2019-11-26 09:14:00
问题 I\'m trying to understand the principles of using Material Design a bit better (I\'m new to this area and have been reading documentations and tutorials, but the subject is still a bit vague to me), and I\'ll be glad for some help. What I\'ve tried so far is having 2 folders (values and values-21) with a styles.xml file per each of them - values/styles.xml: <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\"></style> values-v21/styles.xml: <style name=\"AppTheme\" parent=\

&#39;ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1&#39; [duplicate]

孤人 提交于 2019-11-26 06:49:05
问题 This question already has an answer here: Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1 4 answers I want to try Intellij Platform for android development but even after fresh it shows gradle failures. Please help. I have tried tweaking the line implementation \'com.android.support:appcompat-v7:29.+\' to some other versions but to no avail. Here is my module level gradle apply plugin: \'com.android.application\' android { compileSdkVersion 29

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

时光毁灭记忆、已成空白 提交于 2019-11-26 02:34:51
I'm coming from iOS where it's easy and you simply use a UIViewController. However, in Android things seem much more complicated, with certain UIComponents for specific API Levels. I'm reading BigNerdRanch for Android (the book is roughly 2 years old) and they suggest I use Activity to host my FragmentActivities . However, I thought Activity was deprecated. 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