Android Studio断点在doinbackground中不起作用 [英] Android Studio breakpoints not working in doinbackground
本文介绍了Android Studio断点在doinbackground中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Android Studio在Android应用中调试Asynctask。我的断点在onCreate和onStartCommand中工作,但是所有断点都在doInBackground中工作。我知道代码正在执行,因为我正在向调试日志中写行。
I am trying to debug an Asynctask in my Android app, using Android Studio. My breakpoints are working in onCreate and onStartCommand, but none of the breakpoints are working in doInBackground. I know that the code is executing because I am writing lines to the debug log.
任何想法如何在doInBackground中获得断点?
Any idea how I can get the breakpoints working in doInBackground?
public class BrowseShares extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
}
@Override
protected String doInBackground(String... param) {
Log.d("SMBBrowseService", "doInBackground Started");
try {
String testUser = userId + ":" + passWord;
NtlmPasswordAuthentication testAuth = new NtlmPasswordAuthentication(testUser);
推荐答案
我发现断点只有在我放了代码开头的log.d语句,但不知道为什么
I found that the breakpoints would only work if I put a log.d statement at the start of the code, but have no idea why
这篇关于Android Studio断点在doinbackground中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文