Long press – toast massage

sometime we noticed that when long press any content they create a toast massage and show details about self.

Today i explain code for long press toast massage action. look below.

Code

textview1.setOnLongClickListener(new View.OnLongClickListener() {@Override public boolean onLongClick(View v) {Toast.makeText(getApplicationContext(),”your massage“,Toast.LENGTH_LONG).show();return false;
}
});

How apply this code

it’s very easy just copy the code and past were you want.

Can I also use this code in sketchwere

yes this is a java code block and you can also use in sketchwere and also any java project. For use in sketchwere simple add source directly block and past this code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.