Android 中 Activity 之间的进度条?

发布于 2024-08-27 18:13:03 字数 70 浏览 3 评论 0原文

当单击网格项时,我想在显示的下一个活动的时间之间显示进度条。那么第二个活动有一个自定义列表视图。我还想显示一个进度条。怎么办?

when click the grid item, i want to show a progressbar between the time of next Activity shown. then the second activity has a custom listview. there also i want to show a progressbar. how to do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦年海沫深 2024-09-03 18:13:03

我只是在自学,还没有机会检查源代码,但我知道 RedditIsFun 应用程序(当然是 Reddit)在加载下一个内容之间执行此操作链接和加载评论。查看来源。

I'm just learning myself and I haven't had a chance to inspect the source, but I know that the RedditIsFun app (for Reddit, of course) does this in-between loading the next links, and loading comments. Check out the source.

∞琼窗梦回ˉ 2024-09-03 18:13:03

您应该尝试一下,

首先在 Activity 中创建 ProgressDilog。 。 。

private ProgressDialog progressDialog;

现在,在您想要花一些时间的任何操作中设置进度对话框

progressDialog = ProgressDialog.show(FoodDriveModule.this, "", "Loading...");

现在使用线程来处理进度栏

new Thread() 
   {
    public void run() 
    {
    try
    {
     sleep(1500);
// Now Do some Task whatever u want to do
   } 
   catch(Exception e)
   {
     Log.e("tag",e.getMessage());
   }
}.start();

就是这样。希望这会对您有所帮助。

You should try this,

First Create the ProgressDilog in Activity. . .

private ProgressDialog progressDialog;

Now, Set the ProgressDialog in the Any action where u want to Take Some time

progressDialog = ProgressDialog.show(FoodDriveModule.this, "", "Loading...");

Now use Thread to Handle the Progressbar

new Thread() 
   {
    public void run() 
    {
    try
    {
     sleep(1500);
// Now Do some Task whatever u want to do
   } 
   catch(Exception e)
   {
     Log.e("tag",e.getMessage());
   }
}.start();

Thats it. Hope this will help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文