private void updateListView(int position) {
   List<DownloadJob> jobs = null;
   switch (position) {
     case 1:
       jobs = mDownloadMan.getQueuedDownloads();
       break;
     case 2:
       jobs = mDownloadMan.getCompletedDownloads();
       break;
     default:
       jobs = mDownloadMan.getAllDownloads();
       break;
   }
   if (lastNavPosition == position && jobs != null && jobs.size() == mAdapter.getCount()) {
     mAdapter.notifyDataSetChanged();
   } else {
     mAdapter.setData((ArrayList<DownloadJob>) jobs);
     mListView.setVisibility(View.VISIBLE);
     mStateView.setVisibility(View.GONE);
   }
   mBar.setTitle("共" + mAdapter.getCount() + "个下载项");
   if (jobs.isEmpty()) {
     mStateView.setText(getString(R.string.no_download));
     mStateView.setVisibility(View.VISIBLE);
     mListView.setVisibility(View.GONE);
   }
 }
 // @Override
 // public boolean onCreateOptionsMenu(Menu menu) {
 // menu.add(0,R.id.edit_query,0,"编辑").setIcon(R.drawable.ic_menu_mark).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
 // return true;
 // }
 @Override
 protected void onStart() {
   super.onStart();
   mDownloadMan.registerDownloadObserver(this);
   mAdapter.notifyDataSetChanged();
 }