简体   繁体   中英

Android Hyperlinks in Pop up

I want a popup box to come up and I want the text in the box to hyperlink any valid links in the box. In my example, it is a email address. I am using an AlertDialog currently, is there someway to make the link clickable, or should I try something else?

i'm not seeing you code. is it a custom dialog?? you can place button in AlerDialog

AlertDialog alertDialog = new AlertDialog.Builder(a).create();
    alertDialog.setTitle(title);
    alertDialog.setMessage(message);
    alertDialog.setButton2("OK", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int which) {
          //place what you want to do here 
              return ;
    } });
alertDialog.show();

Depending on the complexity of what you want to do, you might consider Creating a Custom Dialog with a TextView in it. You could then use the android:autoLink attribute on the TextView in the layout xml.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM