I am very new in Android and I was wondering what really happens if I do not use "setOnClickListener" My layout because it seems that my app can still run without any errors Can someone tell me me?
Example:
myLayout = (linear timer) findViewById (R.id.myLayout); MyLayout.setOnClickListener (this); MyLayout2 = (Linear Layout) Find VVBIID (RID.Mailout2);
When you setOnClickListener
to it
This means that when a button or whatever your object is clicked, this activity handles the event (originally decides what happens next).
Your code still runs because you do not have to handle one click event if you do not want onClickListener
if not your app will not crash.
Depending on what you are trying to achieve, you probably have a LinearLayout
.
Comments
Post a Comment