Tag: android-layout

define Action bar overflow items

If I define the following items for my action bar: res/menu/action_menu.xml : <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:title=”label”/> <item android:title=”label1″/> <item android:title=”label2″/> <item android:title=”label3″/> <item android:title=”label4″/> </menu> In my Activity: @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.action_menu, menu); return true; } Is there anyway to allow me define certain items […]

White background when Android app start up

Every when my app starts up, there’s a white background displays in a short time. Despite of using splash screen, the problem is still exists. I would like to set the start up screen to black instead of white as default! This is my splash’s screen activity: public class SplashActivity extends Activity { private static […]

How to implement card layout in android

I need information about card layout with some simple example .i am not getting any example. Please help me Thank you

Android: setContentView and LayoutInflater

What is the difference between setContentView and LayoutInflater? And whats the reason that we use inflater in custom toast and setContentView in custom alertbox?

Not able to access ViewStub'child

I am trying to use VIEWSTUB inside the merge tag.and its working well.I’m able to catch onclicklistenr of ViewStub’s parent button.But i want to access the button that is inside the viewstub. 1.Main xml: <merge> <LinearLayout> <Button></Button> <ViewStub></ViewStub> </LinearLayout> </merge> 2.view stub layout <Button android:id=”@+id/button_cancel” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:minWidth=”100dip” android:text=”Next” /> <ImageView android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:id=”@+id/imageView” android:background=”@drawable/golden_gate” […]

ClassCastException when using LinearLayout.LayoutParams

This is the exception: 07-20 19:52:14.193: E/AndroidRuntime(3908): FATAL EXCEPTION: main 07-20 19:52:14.193: E/AndroidRuntime(3908): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams 07-20 19:52:14.193: E/AndroidRuntime(3908): at android.widget.LinearLayout.measureVertical(LinearLayout.java:634) 07-20 19:52:14.193: E/AndroidRuntime(3908): at android.widget.LinearLayout.onMeasure(LinearLayout.java:553) 07-20 19:52:14.193: E/AndroidRuntime(3908): at android.view.View.measure(View.java:12892) 07-20 19:52:14.193: E/AndroidRuntime(3908): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698) 07-20 19:52:14.193: E/AndroidRuntime(3908): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293) 07-20 19:52:14.193: E/AndroidRuntime(3908): at android.view.View.measure(View.java:12892) 07-20 19:52:14.193: E/AndroidRuntime(3908): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1249) […]

ProgressBar Colour

I want to set the Progressbar Colour in My Application as Default progressbar colour is Slight White and My Application also has the White background so it cant be visible properly. So Please give me the Solution for it. Thanks.

Move an Image in circular path in android

I am having an Image, I wanted to move it in circular path onClick() event of button without animation, I don’t know how to do it.. Any help?? This is my main class public class MainActivity extends Activity { MyAnimation animation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); animation =new MyAnimation (); } and […]

Android Relative Layout with sticky footer

I’m relatively new to Android development and I’m having a hard time putting together a certain interface. I’ve looked through many similar questions but none of them give me the answer i’m looking for. I want to put together an XML interface like the following: I want a LinearLayout that acts like a sticky footer […]

RecyclerView adapter showing wrong images

I have a RecyclerView adapter that looks like this: public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerAdapter.ViewHolder> { private static Context context; private List<Message> mDataset; public RecyclerAdapter(Context context, List<Message> myDataset) { this.context = context; this.mDataset = myDataset; } public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnCreateContextMenuListener, View.OnClickListener { public TextView title; public LinearLayout placeholder; public ViewHolder(View view) { […]

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