English 中文(简体)
我有两个活动:搜索(物品研究)和下载(how下载)。 我如何显示巴斯瓦拉在下载活动方面的进展?
原标题:I have two Activities: SearchActivity (search for items) and DownloadsActivity (show downloads). How do I show ProgressBar in DownloadsActivity?

I m writing a simple downloader app which has two activities: SearchActivity: shows a list of items you can download given a query. pressing an item should start downloading the item, but stay in the SearchActivity. Pressing an item currently runs an AsyncTask to handle the downloading logic

下载 活动:显示目前下载的项目和进展清单 每个项目的律师协会(百分比)。

除了“进步”之外,我还确定了一切。 我不禁要问,怎样才能正确更新下载活动的“进步银行”。 在“AyncTask”下载中,在“搜索行动”范围内,如果对“下载行动”进行观察,我如何更新各自在下载方面取得的进展。

最佳回答

您可能为下载目的使用service部分。 这将使你能够从该处内部管理AsyncTasks(或仅仅是单独的胎面)。 其后,任何活动均可检索特定下载情况,在服务对象上采用某种方法(由您撰写),实际上,服务对象正在管理所有下载。 奥赫,同样,你可能希望开始下载。

BTW为了从活动范围内检索服务对象,需要首先对服务进行约束,然后使用IBinder界面获得试射。 可在 rel=“nofollow”>here查询。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签