Tag: android-support-library

Android SeekBar can't be full width even set padding 0 in AppCompat 23.1.0

when I update android support lib from 23.0.1 to 23.1.0, I find the SeekBar is not full width any more. this is the test XML file: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:divider=”@drawable/space_divider” android:orientation=”vertical” android:padding=”8dp” android:showDividers=”middle”> <View android:layout_width=”match_parent” android:layout_height=”20dp” android:background=”@android:color/black”/> <!– default SeekBar –> <SeekBar android:layout_width=”match_parent” android:layout_height=”10dp” android:progress=”50″ android:progressTint=”@android:color/holo_red_dark”/> <!– padding=0 –> <SeekBar android:layout_width=”match_parent” […]

Styling the popup menu in Android 5.0

I’m making my app ready for Android 5.0, I’m using the latest compatibility library, here is what my style looks like. <resources> <style name=”AppTheme” parent=”Theme.AppCompat.Light.DarkActionBar”> <item name=”colorPrimary”>@color/theme_accent</item> <item name=”colorAccent”>@color/theme_accent_secondary</item> </style> <style name=”AppThemeDark” parent=”Theme.AppCompat”> <item name=”colorPrimary”>@color/theme_accent</item> <item name=”colorAccent”>@color/theme_accent_secondary</item> </style> </resources> (The ActionBar color is being set programmatically.) Now, I want the overflow/popup menu to have the […]

“Activity has been destroyed” sometimes when populating viewpager with fragments

I am receiving crash reports with my viewpager v22 + FragmentPagerAdapter from all versions of android 4+ and 5+. The viewpager is in a fragment and the pager adapter is using the childFragmentManager It’s happening very rarely, to about 1/200 users. java.lang.IllegalStateException: Activity has been destroyed at android.support.v4.app.FragmentManagerImpl.void enqueueAction(java.lang.Runnable,boolean)(SourceFile:1397) at android.support.v4.app.BackStackRecord.int commitInternal(boolean)(SourceFile:636) at android.support.v4.app.BackStackRecord.int commitAllowingStateLoss()(SourceFile:619) […]

proguard – AppCompat does not support the current theme features after proguard/minify

I’ve updated support libs to v23.0.0 from v22.2.1, after building app (with minifyEnabled true) i have “AppCompat does not support the current theme features” exception: 08-23 05:46:10.168 19437 19437 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{tm.alashow.dotjpg/tm.alashow.dotjpg.ui.activity.MainActivity}: java.lang.IllegalArgumentException: AppCompat does not support the current theme features 08-23 05:46:10.168 19437 19437 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417) 08-23 […]

Providing icon to system chooser via ChooserTargetService, FileProvider and grantUriPermission

I have some images stored in local app connected with certain contexts (like contacts). I’m using direct share (API 23+) via ChooserTargetService to show these to choose from and I want to ChooserTarget instances to have Icon filled with these images. So I thought I can use android.support.v4.content.FileProvider for this (inside ChooserTargetService::onGetChooserTargets): val file = […]

CollapsingToolbarLayout setTitle() not working anymore

The setTitle() method from CollapsingToolbarLayout had some bugs already (like showing only after a scroll, fixed in v22.2.1). Today I updated to v23.0.0, and it is simply not working, like no title is shown. By calling it multiple times with a delay, I can see that sometimes the title is there, but it is really […]

How can I tell which Android Support Library v4 revision I use?

I can see in the Android SDK manager the version installed on my computer (in Android SDK manager), but usually a project uses its own copy from the libs folder. Is there a way I can tell which version is the android-support-v4.jar being used in a specific project besides the file date? Any method is […]

Android colorControlNormal xml attributes doesn't work pre-Lollipop

I’ve been trying to change the color of the EditText line on the bottom, but my EditText still doesn’t wanna change the color, but it’s using the style from Material. I’ve tried to change the color following these answer: link So I have an EditText with the Material form but not the colors I’ve set. […]

Android InstantiationException With Fragment (It Is Public)

I have a Fragment (it is not an inner class, and it does not have any constructor whatsoever) public class PreferenceListFragment extends ListFragment implements OnClickListener I’m getting this crash report on the Android Developer Console: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.redacted.redacted/com.redacted.redacted.PreferenceActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.redacted.redacted.PreferenceListFragment$3: make sure class name exists, is public, and […]

Could not find com.android.support:support-v4:22.0.0. after SDK update

After the sdk update im not able to create a hello world application. My build.gradle looks like this apply plugin: ‘com.android.application’ android { compileSdkVersion 22 buildToolsVersion “22.0.1” defaultConfig { applicationId “com.coders.yo” minSdkVersion 11 targetSdkVersion 22 versionCode 1 versionName “1.0” } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’ } } } dependencies { compile […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.