In the activity create a method name with trialmodule and do what you want to do.
http://stackoverflow.com/questions/4153517/how-exactly-does-the-androidonclick-xml-attribute-differ-from-setonclicklistene On Mon, May 23, 2016 at 2:25 PM, Roy Bettesworth <[email protected]> wrote: > I want to use onclick > > I am using XML as my language. > > " > <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="com.example.roy.buttontest.MainActivity"> > > <TextView > android:layout_width="wrap_content" > android:layout_height="wrap_content" > android:text="Hello World!" > android:id="@+id/textView" /> > > <Button > android:layout_width="wrap_content" > android:layout_height="wrap_content" > android:text="Test Button" > android:id="@+id/button" > android:layout_below="@+id/textView" > android:layout_centerHorizontal="true" > android:layout_marginTop="230dp" > android:onClick="trialmodule" > android:textColor="#bd3030" /> > > </RelativeLayout> > > > " > > > Where and what do I write for the procedure that will be executed for onclick > . > > > It can do anything such as just displaying some text. > > > Thanks > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/android-developers. > To view this discussion on the web visit > https://groups.google.com/d/msgid/android-developers/4fbca365-17d5-47eb-ac64-06f80680bc3e%40googlegroups.com > <https://groups.google.com/d/msgid/android-developers/4fbca365-17d5-47eb-ac64-06f80680bc3e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/CABHzXAQN3oSDpNQ3LHmKvqvKLZqhO7tjgtQ4KrT%3Dp92Y-WxW0A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

