onclick

Android Listview Onclick

By using setOnClickItemListener() we can get the clicked item in android listview.

Android Button Click

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

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

Onclick Action:- Edit your Java code like this

[sourcecode language="java"]
public class SamButton extends Activity {
Private Button butexample;
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.main);
// Declaring Button
butexample =

Syndicate content