How add long click function in sketchware
Long click in Sketchware project
Friends.... as you know that in SKETCHWARE long click function is only available for list view. This function is not available for textview, imageview, button etc.
After reading this article you can know how to put long click option for these.
In below example I will show this long click function for button. You can follow the similar code and similar processes for others.
First of all add a button having id button1.
![]() |
| SKETCHWARE Tutorial |
Now in "on create" add an "add source directly " block and paste the following code.
![]() |
| SKETCHWARE Tutorial |
button1.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View _view) {
@Override
public boolean onLongClick(View _view) {
Then add the function of long click as your wish e.g I have added the toast block.
Then add another another "add source directly " block and close the code of the first "add source directly " block by the following code.
return true;
}
});
}
});
Now save and run the application.
For any doubt about it you can watch the following YouTube video.





Comments
Post a Comment