I want to build a "goals" layout on my app, but, i want that every time user touches a badge, there appears a hint on it for 2 seconds, then dissapear. Otherwise, if user touches outside de hint, it will also dissappear.
Asked
Active
Viewed 779 times
-2
-
Bad question: what have you tried? Anyway, search for "android tooltipview" might help. – shkschneider Dec 04 '14 at 15:21
-
Here is answer to your question. Check first answer: http://stackoverflow.com/questions/21031488/android-popupwindow-with-tooltip-arrow – Vikasdeep Singh Dec 04 '14 at 15:46
2 Answers
0
You need PopUpWindow.
You will find methods which will dismiss popup window if touched outside like this.
mPopWindowInstance.setTouchInterceptor(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_OUTSIDE) { mPopWindowInstance.dismiss(); return true; } return false; } });
And you can use your own timers to dismiss it after any specified time.
Check the link below.
http://developer.android.com/reference/android/widget/PopupWindow.html
http://mrbool.com/how-to-implement-popup-window-in-android/28285
and as Micheal suggested. you can use Toasts to display some hints. But popup windows can be shown as hints exactly above the buttons getting clicked and can have animation style of popping up. Looks good from ui prospective.
Hope this helps

Rohit Sharma
- 13,787
- 8
- 57
- 72
0
I think you are looking for toast messages!
check this link: http://developer.android.com/guide/topics/ui/notifiers/toasts.html

Michael
- 815
- 1
- 6
- 23