android-support-library

app:srcCompat does not work for ImageView

谁说我不能喝 提交于 2019-12-10 23:45:37
问题 I'm adding vector drawable support to a library project, and using app:srcCompat to reference the vector drawable. The only view that appears to work is ImageButton and I'm not sure why. Here's the relevant piece of my build.gradle android { defaultConfig { vectorDrawables.useSupportLibrary = true } } dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.0.0' compile 'com.android.support:support-vector-drawable:24.0.0' compile 'com.android.support:animated

AppCompatActivity vs AppCompatDelegate

做~自己de王妃 提交于 2019-12-10 23:15:27
问题 Recently I discovered what is AppCompatDelegate so a natural question arises - is it worse than using AppCompatActivity or do they have their differences and what are they? 回答1: If your activity class is not extending AppCompatActivity but you still want to use some of its features then you can you AppCompatDelegate. You can create Appcompatdelegate with following lines of code in your activity class: private AppCompatDelegate getDelegate() { if (mDelegate == null) { mDelegate =

TabLayout not show icon with android support library 23.2.0

末鹿安然 提交于 2019-12-10 22:17:31
问题 I'v just updated my Android Studio to the latest version. This update comes with the support design library version 23.2.0 I'v used TabLayout with icon in my app (convert Drawable to SpannableString) and it works well with the support design library version 23.1.1 but not version 23.2.0. Any ideas for this problem? 回答1: If you are overriding using TabLayout and overriding addTab(Tab), then override public void addTab(Tab tab, boolean setSelected) and public void addTab(Tab tab, int position,

How to build the Android support package

醉酒当歌 提交于 2019-12-10 21:50:11
问题 In this question, the only fix involves rebuilding the Android support library from it's source. I'm not sure how to do this. In Eclipse, I've tried: File -> Import -> General -> File System -> with path-to-SDK/extras/android/support/v4/src/. This imported all of the files. Then I added android.jar for version 14 to the build path. This still gave me a ton of errors, and I'm not sure how to export a jar with the fixed source. Any help would be greatly appreciated. 回答1: You must add every

Android Support Library and Media Router .jar files cannot be found

删除回忆录丶 提交于 2019-12-10 21:32:24
问题 I am totally new to Xamarin. I want to add map to the default hello world in Xamarin.Android. I have prepared my Manifest step by step from the guide. Also downloaded the support library via sdk manager but I get errors asking me to install SL and SL media Router. Here the manifest: <?xml version="1.0" encoding="utf-8"?> <!-- We need to be able to download map tiles and access Google Play Services--> <uses-permission android:name="android.permission.INTERNET" /> <!-- Allow the application to

Why I can't enforce EditTextPreference to take just numbers?

本秂侑毒 提交于 2019-12-10 18:59:34
问题 GOAL: Use EditTextPreference to take a number input from an user. PROBLEM: I'm using support.v7.preference and, from what I've understood, this library bring problems to creates a custom DialogPreference (HowTo use support.v7.preference with AppCompat and potential drawbacks). Anyway I tried to create a NumberPickerPreference extending DialogPreference but I got ClassCastException . Also I found another approach: programmatically set the input type of an EditTextPreference object like below:

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex' in Android Studio

耗尽温柔 提交于 2019-12-10 18:45:02
问题 I am getting the following error when I run my application where creative sdk is integrated for photo editing option. Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: android/support/multidex/MultiDex$V14.class This is my apps gradle file.Here creative sdk for image editing option is integrated and multidex option is enabled. apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1"

Error when setting contentscrim color on CollapsingToolbarLayout

眉间皱痕 提交于 2019-12-10 18:32:26
问题 My app recently started to crash on any activity or fragment that has a CollapsingToolbarLayout with the following error log: ` Unable to start activity ComponentInfo{com.radioafrica.music/com.radioafrica.music.activity.PlaylistTracks}: android.view.InflateException: Binary XML file line #31: Binary XML file line #31: Error inflating class android.support.design.widget.CollapsingToolbarLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) at android.app

RuntimeException when input exceeds counterMaxLength of TextInputLayout

纵然是瞬间 提交于 2019-12-10 18:23:28
问题 I have a form with a TextInputLayout and TextInputEditText . This is the relevant XML : <android.support.design.widget.TextInputLayout android:id="@+id/signup_til_name" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/activity_horizontal_margin" android:hint="Name" app:counterEnabled="true" app:counterMaxLength="16" app:errorEnabled="true"> <android.support.design.widget.TextInputEditText android:id="@+id/signup_etext_name" android:layout

Use of GridLayout from support library leads to 'NoSuchMethodError: android.support.v4.view.ViewCompat.getLayoutDirection'

馋奶兔 提交于 2019-12-10 17:11:31
问题 I am using GridLayout in my app and it works perfectly. Now I have to support android 3.xx as well, so I included android-support-library-v7. I just changed the import statements for GridLayout and LayoutParams at all places. I can build the project now but when I run the app, it crashes with NoSuchMethodError exception. I followed these steps to include the support library Here is the stacktrace: 03-27 13:37:13.454: E/AndroidRuntime(23016): FATAL EXCEPTION: main 03-27 13:37:13.454: E