0

I wanted to show information about a button on long pressing that button, like in the image shown below. I am new to android and any help would be highly appreciated .Image

2 Answers2

2

It's tooltipText , just add this like below:

<Button
    ...
    android:tooltipText="{Hint String}" />
Makoto Hata
  • 271
  • 1
  • 7
0

If it's a button (or infact any View), use the setOnLongClickListener method.

button.setOnLongClickListener(new OnLongClickListener() { 
        @Override
        public boolean onLongClick(View v) {
            // TODO Auto-generated method stub
            return true;
        }
    });

Refer: Android: long click on a button -> perform actions

Sparker0i
  • 1,601
  • 3
  • 32
  • 55