How to set ToolTipText over any widget's view (example WebView, TextView) of your Android app?

Publié le: 27 mars 2023
sur la chaîne: Programmer World
377
4

In this video it shows the steps to set tool tip text over a widget. In this it shows the steps with WebView and TextView but same can be done for other widgets.

It uses setTooltipText API to set the desired text for the Tool tip.

I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: [email protected]

Complete source code and other details/ steps of this video are posted in the below link:
https://programmerworld.co/android/ho...


However, the main Java code is copied below also for reference:

package com.programmerworld.tooltiponwidget;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

private WebView webView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

webView = findViewById(R.id.webView);
webView.loadUrl("https://programmerworld.co");
webView.setTooltipText("This is programmer world website");

TextView textView = findViewById(R.id.textView);
textView.setTooltipText("This is tool tip example");
}
}


-


Sur cette page du site, vous pouvez voir la vidéo en ligne How to set ToolTipText over any widget's view (example WebView, TextView) of your Android app? durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Programmer World 27 mars 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 377 fois et il a aimé 4 téléspectateurs. Bon visionnage!