简体   繁体   English

直到完成某个Android应用程序(Java)为止

[英]Making an Android App (Java) 'Wait' Until Something Finishes

I have this app that originally has you take a picture, shows you a progress bar, and uploads it to a website. 我有一个本来可以给您拍照的应用程序,为您显示进度条,并将其上传到网站。

What I want to add is something so that before the progress bar shows, an Intent starts an activity that loads a layout with a dropdown menu that allows you to choose a descriptor for the picture. 我要添加的东西是,以便在进度条显示之前,一个Intent启动一个活动,该活动使用下拉菜单加载一个布局,该菜单允许您选择图片的描述符。 Following this, once you hit the 'OK' button on this new layout, the program should return back to where it had left off and display the progress bar. 此后,一旦您点击此新布局上的“确定”按钮,程序便应返回到上次停止的位置并显示进度条。

Does anyone have any ideas on how to achieve this? 有人对如何实现这一目标有任何想法吗?

It seems that all I really want is some way to tell the program to stall for a while to call an intent, and when the user hits 'OK', the code may resume. 看来,我真正想要的只是某种方式告诉程序暂停一段时间以调用意图,并​​且当用户单击“确定”时,代码可以恢复。

您应该使用OnActivityResult()。有关http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent,int )下的链接的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM