android – How to add border around TableLayout?-ThrowExceptions

Exception or error: Below is my table code. My screen looks like this http://imgur.com/dFP298o but I wanna make it looks like this http://imgur.com/YuYJiJx. How can I add borders around each row and around table layout? <TableLayout android:id=”@+id/table2″ android:layout_width=”fill_parent” android:layout_below=”@+id/test_button_text23″ android:layout_marginLeft=”45dp” android:layout_marginBottom=”25dp” android:layout_marginRight=”45dp” android:layout_height=”fill_parent” android:stretchColumns=”*” > <TableRow android:layout_width=”match_parent” android:layout_height=”match_parent” > <TextView android:gravity=”left” android:text=”Quantity” android:textStyle=”bold” /> <TextView …

How to set the elevation of an AppBarLayout programmatically in the Android Support Library v24.0.0?-ThrowExceptions

Exception or error: When upgrading from the Android Support Library v23.4.0 to v24.0.0, setting the elevation to 0 programmatically to an AppBarLayout stopped working: appBayLayout.setElevation(0); It does work when setting the elevation in the XML. How to solve: Edit The AppBarLayout from v24.0.0 uses a StateListAnimator that defines the elevation depending on its state. So …

Android get layout height and width in a fragment-ThrowExceptions

Exception or error: I am working on a fragment and I want to get the dimension of a layout contained in the xml fragment layout. When I try the code RelativeLayout myLayout = view.findViewById(R.id.myLayout); myLayout.getHeight(); it returns 0. I need these dimensions to put inside myLayout other objects. I try to use: myLayout.getViewTreeObserver().addOnGlobalLayoutListener( new ViewTreeObserver.OnGlobalLayoutListener(){ …

Android DrawerLayout doesn't show the right indicator icon-ThrowExceptions

Exception or error: I’m trying to use the new DrawerLayout for a list. The problem is though I set the drawer listener, the indicator on the actionbar is still the arrow icon instead of the 3-line icon which I intends to draw. The following is the OnCreate function: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_front_page); …

android – z-index in Relative layout-ThrowExceptions

Exception or error: I need to place a TextView above the Button in RelativeLayout. But it is not working: TextView is always under the Button, even if I move it before the button. I also tried bringChildToFront() function to move textview on front, but no luck. <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/rlBottom” android:layout_width=”fill_parent” android:layout_height=”match_parent”> <Button android:id=”@+id/bVio” android:layout_width=”wrap_content” android:layout_height=”50dip” …

android – Unexplained gap/padding to the left, between Toolbar, and LinearLayout-ThrowExceptions

Exception or error: I have the following structure in the layout file of my Android studio project, and I see unexplained left padding between the parent element (Toolbar) and it’s immediate child element (LinearLayout). Layout Text <Toolbar android:layout_width=”fill_parent” android:layout_height=”600dp” android:id=”@+id/toolbar” android:background=”#313B45″ android:weightSum=”1″> <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <ImageView android:id=”@+id/headerimage” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:scaleType=”fitXY” android:layout_gravity=”left|top” android:layout_weight=”1″/> <TextView android:layout_width=”fill_parent” …