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

Iqbal Singh
  • 101
  • 1
  • 7

2 Answers2

2

It's tooltipText , just add this like below:

<Button
    ...
    android:tooltipText="{Hint String}" />
Makoto Hata
  • 281
  • 1
  • 8
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,787
  • 4
  • 35
  • 60