Skip to main content

Posts

Showing posts with the label android examples

android button example

In this post we are going to see how to create a simple android application that contains two buttons and how to create the response for the button clicks. Create a new android project named ButtonDemo in eclipse. In  the activity_main.xml add two buttons as shown bellow. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <Button android:id="@+id/button2" android:layout_width="fill_parent" android:layout_he...