Reputation: 607
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.
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);
Upvotes: 2
Views: 1414
Reputation: 607
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
Upvotes: 3