簡體   English   中英

Android 彈出超鏈接

[英]Android Hyperlinks in Pop up

我想要一個彈出框出現,我希望框中的文本超鏈接框中的任何有效鏈接。 在我的示例中,它是一個 email 地址。 我目前正在使用 AlertDialog,是否有辦法使鏈接可點擊,或者我應該嘗試其他方法嗎?

我沒有看到你的代碼。 是自定義對話框嗎?? 您可以在 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();

根據您想要執行的操作的復雜性,您可能會考慮創建一個包含TextView的自定義對話框。 然后,您可以在布局 xml 中的TextView上使用android:autoLink屬性。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM