Tag: android-5.0-lollipop

Camera2 API – How to set long exposure times

I’m trying to capture images with 30 seconds exposure times in my app (I know it’s possible since the stock camera allows it). But SENSOR_INFO_EXPOSURE_TIME_RANGE (which it’s supposed to be in nanoseconds) gives me the range : 13272 – 869661901 in seconds it would be just 0.000013272 – 0.869661901 Which obviously is less than a […]

Style a SearchView widget using support library v21

Chris Banes mentioned here that the AppCompat library now has Lollipop’s updated SearchView API. I am following the instructions straight from the blog post, but I don’t see any effect. Below is a snippet from my values/styles.xml <style name=”AppTheme” parent=”Theme.AppCompat.Light.DarkActionBar”> <item name=”colorPrimary”>@color/color_primary</item> <item name=”searchViewStyle”>@style/CustomSearchViewStyle</item> </style> <style name=”CustomSearchViewStyle” parent=”Widget.AppCompat.SearchView”> <item name=”queryBackground”>@color/orange</item> <item name=”searchIcon”>@drawable/test</item> </style>

Set windowTranslucentStatus=true when android lollipop or higher

I’d like to set windowTranslucentStatus to true when the user is on lollipop and above because otherwise (at least on kitkat) the app bar appears inside the system bar. On lollipop it is fine. Without making separate styles.xml for each version which apparently you shouldn’t have to do anymore how can I set it in […]

Can't call void android.view.View.setElevation(float) on null object in lapism/SearchView

I am using library lapism/SearchView (https://github.com/lapism/SearchView) in my project. But i get following runtime exception only on Android 5.0: A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: can’t call void android.view.View.setElevation(float) on null object A/art: art/runtime/check_jni.cc:65] in call to CallVoidMethodV A/art: art/runtime/check_jni.cc:65] from void android.animation.PropertyValuesHolder.nCallFloatMethod(java.lang.Object, long, float) A/art: art/runtime/check_jni.cc:65] “main” prio=5 tid=1 Runnable A/art: art/runtime/check_jni.cc:65] | […]

ActivityOptions.makeSceneTransitionAnimation doesn't seem to exist

Android L introduced a new animations feature: animating between similar Views in different activities. It’s documented here. I’ve tried to use ActivityOptions.makeSceneTransitionAnimation, but it doesn’t seem to be visible in the SDK (or in the jar at all), so I tried using reflection, and it returns a null value. Has anyone else got it working?

file path return null always in lollipop android

this is my code when i’m getting image from internal storage (gallery). In lollipop file path return always null. if (requestCode == PICK_IMAGE) { if(resultCode == RESULT_OK){ //image successfully picked // launching upload activity Uri selectedImage = data.getData(); String[] filePathColumn = { MediaStore.Images.Media.DATA }; Cursor cursor = getContentResolver().query(selectedImage,filePathColumn, null, null, null); cursor.moveToFirst(); columnindex = cursor.getColumnIndex(MediaStore.Images.Media.DATA); […]

Android unbounded ripple and background

it is possible to create a RippleDrawable defining an unbounded ripple and at the same time a background color? I’ve tried everything but when i define a shape and its color the ripple is not unbounded anymore. Also in this page https://developer.android.com/reference/android/graphics/drawable/RippleDrawable.html there is no reference about adding an unbounded ripple over a shape. I’ve […]

Change AppBarLayout height programatically in Android

I’m trying to implement Flexible Space with image pattern, using this tutorial. Everything works fine. Notice the height definition of the AppBarLayout which is 192dp. I’d like to make the height 1/3 of the screen instead, to match this google example for the pattern here. Here’s the code in the activity’s onCreate (the layout xml […]

Displaying UI widgets in Cardview in android L

I am trying to create an application in cardview, the cardview contains two textviews which needs to be placed next to each other, but the textviews are getting overlapped. Is there any mechanism to place elements like its done in RelativeLayout(layout_below or layout_toRightOf) for Cardviews. I am able to do this by adding shadows to […]

Align-Center SlidingTabLayout

After I moved my app to 5.0, I had to move from the basic tabs to the slidingTabLayout that a google developer provides . The problem is, I can’t figure out how to center both buttons in a way that they get both centered like the old one. Btw, I’m not talking about the style, […]

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