Skip to content

Instantly share code, notes, and snippets.

@amitpatelx
Created March 25, 2019 18:02
Show Gist options
  • Save amitpatelx/4c5a7b11ae1546c7f87590c1f1840cc1 to your computer and use it in GitHub Desktop.
Save amitpatelx/4c5a7b11ae1546c7f87590c1f1840cc1 to your computer and use it in GitHub Desktop.
public interface MyOnClickListener {
void onClick(View v);
boolean onLongClick(View v);
}
/**
* Interface definition for a callback to be invoked when a view is clicked.
*/
public interface OnClickListener {
/**
* Called when a view has been clicked.
*
* @param v The view that was clicked.
*/
void onClick(View v);
}
/**
* Interface definition for a callback to be invoked when a view has been clicked and held.
*/
public interface OnLongClickListener {
/**
* Called when a view has been clicked and held.
*
* @param v The view that was clicked and held.
*
* @return true if the callback consumed the long click, false otherwise.
*/
boolean onLongClick(View v);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment