Tag: android-layout

OnItemClickListener of spinner

I am able to get Spinner in action bar this way; array of items in re/values/languages.xml <string-array name=”languages”> <item>Finnish</item> <item>French</item> <item>German</item> <item>Slovakian</item> <item>Polish</item> </string-array> In res/menu/main.xml <item android:id=”@+id/menuSort” android:actionLayout=”@layout/spinner” android:showAsAction=”ifRoom” android:title=”@string/choose”/> In res/layout/spinner.xml <Spinner android:id=”@+id/spinner” android:layout_width=”150dp” android:layout_height=”wrap_content” android:entries=”@array/languages”/> And finally activity class; public class Base_Activity extends Activity { @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, […]

segmented controls type in Android app

I try to make buttons like those on the desk of android: This button are similar to the uisegmentedcontrol for Iphone. I don’t find a easy way to do this in Android. For the moment, I use the Button explain here: http://blog.bookworm.at/2010/10/segmented-controls-in-android.html But the result seems not so good compared to the desk button. There […]

NullPointerException in dissapearence animation of RecyclerView from support v.23.2.0

In new RecyclerView we can use wrap_content for height (or for width). So Google fixed bug – https://code.google.com/p/android/issues/detail?id=74772 But not all is well in the end. I try to use animation of dissapearence when remove item from RecyclerView. So i use method of Adapter – notifyItemRemoved(int) with any argument and RecyclerView cause NullPointerException. Xml code: […]

Grid view item not hightlight when press

My app has a grid view, By default, Its item does not highlight when I click on it (I don’t know why? ). I try to add it a list selector as below, But it does not work too, <GridView android:id=”@android:id/list” android:layout_width=”fill_parent” android:layout_height=”match_parent” android:layout_above=”@+id/load_more_process_id” android:layout_alignParentTop=”true” android:drawSelectorOnTop=”false” android:listSelector=”@drawable/grid_selector” > </GridView> Here my selector: <selector xmlns:android=”http://schemas.android.com/apk/res/android” > […]

How to implement multi-windowed layout (like the default browser) (Editor with several open files)

I am writing an editor (of sorts) which I want to be able to have multiple windows open at the same time, and I want to be able to navigate between windows as can be done in the default browser (Internet) application. See picture: http://i.imgur.com/LM6Nz.png for clarification. My question is how to implement these windows; […]

Controlling two ViewPager Together

I need to synchronize the two ViewPager together. The requirement is something like on scrolling the ViewPager-1 and the ViewPager-2 should also scroll by certain amount. The Image shown below will make you more clear with my question. You can also help me with some tutorials link. Thanks.

Android : The rounded corners work different in different Android version

I have problem with the corners tag. This is my shape file. <stroke android:width=”1dp” android:color=”#ff999999″ /> <size android:height=”40dp” /> <gradient android:angle=”90″ android:centerColor=”#f5f5f5″ android:endColor=”#fcfcfc” android:startColor=”#efefef” android:type=”linear” /> <corners android:bottomLeftRadius=”0dip” android:bottomRightRadius=”8dip” android:topLeftRadius=”8dip” android:topRightRadius=”0dip” /> But when I set it for view’s background. It display different shape in Android 2.2 and Android 4.0.3 . When it is running […]

how to colour the outline of my text black in xml for android

i want to make the white coloured text in my android app have a black outline. I do not want to colour the textview so if that is your help then no i already know how to do this. I want to make this happen by using a drawable file in xml format. so is […]

Difference: android:background and android:src?

Possible Duplicate: What is the difference between src and background of ImageView What is the difference between android:background and android:src? Is their working same?

Customize FragmentTabHost set TabWidget on bottom

currently I’m trying to implement the FragmentTabHost for my project. I’m still new on this fragments but I found it very great in terms of reusing the layouts, etc which is why I wanted to push myself further on to it. Now I read the tutorials on how to create a Tabs with fragment and […]

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