Android Button Highlight

In android, we can highlight the button through custom images. Here is a example that will give you about how to set a image when the button is focused, pressed and focused pressed.

Android Dialog with Radio Buttons

Now we can see a easy example of how to use radio groups, actions, and radio buttons dialog in android mobiles.

Example for Android Dialog Radio Buttons :-

[sourcecode language="java"]
public class ExampleApp extends Activity {
protected void onCreate(Bundle savedInstanceState) {
final CharSequence[] PhoneModels = {"iPhone", "Nokia", "Android"};
AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);

Android ToggleButton

Android Toggle Button is used to set the button as checked or unchecked. We can set this toggle button to Yes or No also. We can change the toggle button text when the stage changes. We can set text for both On stage (ex: - “YES”) & Off stage (ex: - “NO”).

Default Text of ON Stage is "ON" & OFF Stage is "OFF".

Android RadioButton Example

RadioButton is used to select any one option from the given group.

In Android by using RadioGroup only we can use RadioButton. We can add any number of RadioButtons to a single RadioGroup.

Android Button Size

We can set Android button size manuallly by using the button property 'android:layout_height' & 'android:layout_width'.

Android Button Background Color

Android Button Background Color Example -

We can set the button background color by using the button property 'android:background' .

Android Widgets Button Image

Android Button Background Image Example:-

We can set the Background image for a button by using the button property 'android:background'.

Android Button Click

Today let us see an example for the Android button onclick -

[sourcecode language="java"]
<Button android:text="@+id/Button01"
android:layout_height="wrap_content" />

Onclick Action:- Edit your Java code like this

[sourcecode language="java"]
public class SamButton extends Activity {
Private Button butexample;
protected void onCreate(Bundle savedInstanceState) {
// Declaring Button
butexample =

Android- Button Transparent

Here we are going to see how to make a button transparent in Android...

[sourcecode language="css"]

<Button android:background="@android:color/transparent"
android:textColor="#ffffff" />

By using android:background="@android:color/transparent" the button background will become transparent


Android Text Color

In Android, we can set text color for textview, edittext, buttons, etc...




Syndicate content