I'm new to Android and I was wondering if is possible to have an Android button element that has an embedded tooltip? I would like to have an image on the button, that when pressed opens up a dialog/tootip overlay of some sort. So not a hover tooltip, but a clickable element that goes somewhere other than where the button click goes. If someone could guide me as to the best practice for this that would be great!
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="5dip"
android:paddingRight="5dip">
<Button android:id="@+id/settings_predefined_message_btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/settings_predefined_messages"
android:background="@drawable/selector_longbutton_witharrow"
style="@style/ButtonTextStyle"
android:layout_marginTop="10dip"
android:gravity="center" />
(In response to your last comment about setting on view on top of another.)
Simple, you could use multiple LinearLayouts like this:
Your LinearLayout (and maybe the TextView) should have one OnClickListener to do the main feature, the ImageButton will have a second OnClickListener for the tooltip.
Or you could use a RelativeLayout to position the tooltip ImageButton with an OnClickListener on top of the TextView with its own OnClickListener.
You can pass either of these custom view to an ActionBar to build the tabs for you, if you like. Hope that helps.
Addition
An (ugly!) RelativeLayout example: