有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java无法解析主机名意味着如何在安卓 studio的异步任务中解析主机名

无法解析主机名 以下是下面的片段:

public class Main2Activity extends Activity {

// button to show progress dialog
Button btnShowProgress;

// Progress Dialog
private ProgressDialog pDialog;
ImageView my_image;
// Progress dialog type (0 - for Horizontal progress bar)
public static final int progress_bar_type = 0;

// File url to download
private static String file_url = "https://www.tutorialspoint.com/images/tp-logo-diamond.png";
}                                                                          

共 (1) 个答案

  1. # 1 楼答案

    检查您是否未在AndroidMenifext中使用internet权限。xml

    <uses-permission android:name="android.permission.INTERNET" />
    

    也可以在运行时请求相同的权限