0

How to add border on Layouts in Android

[code langauage=”xml”] <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#33ffffff" /> <solid android:color="#33ffffff" /> </shape> </item> <item android:top="1dp" android:bottom="1dp"> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="#33ffffff" /> <solid android:color="#33ffffff" /> </shape> </item> </layer-list> [/code] then add this to… Continue Reading

0

Get Value of a Edit Text field in Android

XML Button Code [code language=”css”] <EditText android:id="@+id/name" android:width="250px" /> [/code] Java Code to get the value of Edit Text [code language=”css”] down vote accepted By using getText(): Button mButton; EditText mEdit; /** Called when the activity is first created. */… Continue Reading

0

Android Radio Button and Radio Group Example Code

main.xml [code language=”css”] <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:textSize="20dp" android:textStyle="bold" android:textColor="#fff" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:text="How was today’s tutorial ?"></TextView> <RadioGroup android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_height="wrap_content" android:layout_weight="1" android:id="@+id/rgOpinion"> <RadioButton android:layout_width="wrap_content" android:id="@+id/radio0" android:layout_height="wrap_content" android:checked="true" android:text="Excellent"></RadioButton> <RadioButton android:id="@+id/radioButton1"… Continue Reading

0

Android Switching Activity With Animation

When you start an activity or finish the current activity the transition between the activities can be animated using the method overridePendingTransition. You have to give the resource Id of the animation resource to use for the incoming activity and… Continue Reading