android-simple-tooltip
android-simple-tooltip copied to clipboard
Display tooltip when pressing on the button
Goal: When you press the button, the tooltip shall display.
Problem: What syntax code do I need to add?
Thank you!
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
View yourView = findViewById(R.id.btn_data);
new SimpleTooltip.Builder(this)
.anchorView(yourView)
.text("Texto do Tooltip")
.gravity(Gravity.END)
.modal(true)
.dismissOnOutsideTouch(true)
.dismissOnInsideTouch(false)
.showArrow(true)
.build()
.show();
}
}
Please, take a look at the Sample Project. All examples are made with a button click.