首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >断点调试永远不会进入子类

断点调试永远不会进入子类
EN

Stack Overflow用户
提问于 2013-02-04 08:31:25
回答 1查看 122关注 0票数 0

我的列表视图没有填充我从MySQL数据库中提取的数据。我已经测试了web服务,一切都很完美。我正在调试它,我注意到当我在我的异步任务中设置断点时,它永远不会出现在那里。我离开了execute命令,但它从未进入内部。一切运行正常,没有任何错误。我是个新手,很困惑,请温文点。

代码语言:javascript
复制
public class Favorites extends Activity{
  UserFunctions userFunctions  = new UserFunctions();
  ArrayList<String> zipcodes = new ArrayList<String>(0);
  ArrayAdapter<String> arrayAdapter1;

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.favoritespage);
  arrayAdapter1 = new ArrayAdapter<String>(Favorites.this,android.R.layout.activity_list_item,zipcodes);
  new DownloadDataTask().execute();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
  // Inflate the menu; this adds items to the action bar if it is present.
  getMenuInflater().inflate(R.menu.activity_main_screen, menu);
  return true;
}

private class DownloadDataTask extends AsyncTask<JSONArray, JSONArray, ArrayList<String> > {
  @Override
  protected ArrayList<String> doInBackground(JSONArray... params) {
    JSONArray json = userFunctions.ziplistrequest("37.5", "140.45", "20");
    for(int i=0; i < json.length() ; i++) {
      JSONObject jarray = null;
      try {
        jarray = json.getJSONObject(i);
        String zip = jarray.getString("ZIPCODE");
        zipcodes.add(zip);
        arrayAdapter1.add(zip);
        Log.d(zip,"Output");
      } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return zipcodes;
  }
  protected void onPostExecute(){
    ListView listView = (ListView) findViewById(R.id.list);
    listView.setAdapter(arrayAdapter1);
  }
}

如果需要任何额外的答案,请让我知道。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-04 19:29:47

好东西。我将添加我的评论作为对Q&A闭包和纯粹的SO point贪婪的回答:)

如果将调试点直接放在异步任务doInBackground上,会发生什么?清理和构建您的项目(如果使用Eclipse IDE),以防出现一些编译器/类生成问题

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14678998

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档