コード例 #1
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   mAdapter = new ListViewAdapter();
   mAdapter.setOnItemClickListener(this);
   mAppInfos = DataSource.getInstance().getData();
   for (AppInfo info : mAppInfos) {
     DownloadInfo downloadInfo = DownloadManager.getInstance().getDownloadProgress(info.getUrl());
     if (downloadInfo != null) {
       info.setProgress(downloadInfo.getProgress());
       info.setDownloadPerSize(
           getDownloadPerSize(downloadInfo.getFinished(), downloadInfo.getLength()));
       info.setStatus(AppInfo.STATUS_PAUSE);
     }
   }
 }
コード例 #2
0
 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   listView.setAdapter(mAdapter);
   mAdapter.setData(mAppInfos);
 }