如何克服错误"DEBUG_TAG无法解析为变量"

Aks*_*mle -3 eclipse debugging android

这是我在eclipse中的代码:它正在尝试建立与URL的连接

URL url = new URL(dataString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setReadTimeout(10000 /* milliseconds */);
conn.setConnectTimeout(15000 /* milliseconds */);
conn.setRequestMethod("GET");
conn.setDoInput(true);
conn.connect();
int response = conn.getResponseCode();
Log.d(DEBUG_TAG, "The response is: " + response);
Run Code Online (Sandbox Code Playgroud)

最后一行给出了一个错误,说"DEBUG_TAG无法解析为变量"我该怎么办?

Sin*_*ese 6

你还没有申报DEBUG_TAG.在你的班级上宣布它.

例如:

字符串DEBUG_TAG ="YOUR_APP_NAME"