Suppose I have a Button like what is in the following:
I want once this button is clicked a ImageView
(popup message) appears in the top of this button, something like this:
But I do not know how put a View as an overlay on top of another View, Just I know this can be achieved by FrameLayout
. Please suppose I want to embed this capability into the Button (in the other phrases I want to create a custom button with a method called showPopup(...)
like Textview
's setError(...)
)
Can any one please help me? Thanks
How about taking a look at the Quick Action Dialog?
It is an old article (We're talking Android 2.2 territory), but should still work for the latest devices and OS.
The example uses a contextual popup with buttons, but should be easily modifiable to just show text or whatever you want. There is an example further in that shows use alongside a button.