Tag: android

CollapsingToolbarLayout ImageView is not scrollable

Using cheesesquare – android support library example is it possible to make the Header ImageView scroll-able? <android.support.design.widget.AppBarLayout android:id=”@+id/appbar” android:layout_width=”match_parent” android:layout_height=”@dimen/detail_backdrop_height” android:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar” android:fitsSystemWindows=”true”> <android.support.design.widget.CollapsingToolbarLayout android:id=”@+id/collapsing_toolbar” android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_scrollFlags=”scroll|exitUntilCollapsed” android:fitsSystemWindows=”true” app:contentScrim=”?attr/colorPrimary” app:expandedTitleMarginStart=”48dp” app:expandedTitleMarginEnd=”64dp”> <ImageView android:id=”@+id/backdrop” android:layout_width=”match_parent” android:layout_height=”match_parent” android:scaleType=”centerCrop” android:fitsSystemWindows=”true” app:layout_scrollFlags=”scroll” app:layout_collapseMode=”parallax” /> … </android.support.design.widget.CollapsingToolbarLayout> <android.support.v4.widget.NestedScrollView android:layout_width=”match_parent” android:layout_height=”match_parent” android:fillViewport=”true” app:layout_behavior=”@string/appbar_scrolling_view_behavior”> …. Notice that i’ve added added android:fillViewport=”true” to […]

Two panel UI with Fragments vs Separate activities

I am starting a Honeycomb application that will have a basic two panel layout, one panel on the left for the menu and one on the right for the main functionality of each section. Contrary to the available samples of the Fragments API the content displayed on the right panel consists of a completely different […]

How do I get the ripple effect for menu items on my custom toolbar?

I have a toolbar with the following layout <android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/my_toolbar” android:layout_height=”wrap_content” android:layout_width=”match_parent” android:minHeight=”?attr/actionBarSize” android:background=”@color/primary_dark” android:theme=”@style/ToolbarTheme”/> and the theme I’m using <style name=”ToolbarTheme” parent=”AppTheme”> <item name=”android:textColorPrimary”>@color/white</item> <item name=”android:popupBackground”>@color/white</item> <item name=”android:textColor”>@color/black</item> <item name=”actionMenuTextColor”>@color/black</item> <item name=”android:textColorSecondary”>@color/white</item> </style> Now on pre-lollipop devices the selectable background for the menu items works just fine but on lollipop there’s no background […]

Saved state exception

I’m getting the following exception with my app. I believe this happens when the user leaves the app for a long time then returns to it. I am unable to replicate it however it is showing up in my crash logs a lot. I have no idea why this is happening so any suggestions are […]

time going back on Android

I am developing an app, and from time to time I am getting this weird message: W/SystemClock(11814): time going backwards: prev 9003590393023(ioctl) vs now 9003584533648(ioctl), tid=11856 what does it mean? why does it happen? thanks!

How to create Renderscript scripts on Android Studio, and make them run?

Background I want to research about creating Renderscript scripts on Android and Renderscript in general, and over the past year, Android-Studio became the only IDE that Google supports for Android apps development. The problem For this, I’ve found multiple websites, as such: https://developer.android.com/guide/topics/renderscript/compute.html#writing-an-rs-kernel How to use the Renderscript Support Library with Gradle http://developer.android.com/guide/topics/renderscript/compute.html https://futurestud.io/blog/how-to-use-the-renderscript-support-library-with-gradle-based-android-projects/ http://developer.android.com/guide/topics/renderscript/advanced.html […]

Android – Prevent text truncation in SearchView suggestions?

The suggestions that appear in the default ListView beneath my SearchView contain text that is truncated. I would like the text to be displayed in its entirety (on multiple lines if necessary). I have come up with two possible ways to solve this but, with no examples to be found on the net, I was […]

Android Studio default “Tabbed Activity”, how to swipe through fragments?

Complete beginner here.. I have used the “Tabbed Activity” default from the New Project Wizard. I am trying to get it to swipe through 3 different fragments, however I simply cant see where to tell the program to do it. Do I load them in as an array, if yes where should I do it […]

Android: Bluetooth failed to get port number

I’m running into a problem using Bluetooth in my app. It seems that after 28 BluetoothSocket/BluetoothServerSockets have been created, all of the ports are taken. The sockets don’t need to be opened simultaneously, it’s just 28 sockets since Bluetooth was enabled. This can be reproduced using the BluetoothChat sample provided in the Android Samples. Simply […]

Android SD card issues

I currenlty have a few problems with developing an APP and using the external SD card. The first problem is that I check if there is a SD card mounted. This function returns a true even if there is no SD card inserted. I’ve used/tried the following code: https://stackoverflow.com/a/12721994 http://tsicilian.wordpress.com/2012/04/24/android-persistence-external-storage-sd-card/ from developer.android.com Every Android-compatible device […]

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