如何在Android中丢失连接后停止进度条旋转

时间:2016-04-19 03:56:37

标签: java android android-progressbar

之后当我按下手机上的后退按钮时,我关闭了wifi或移动数据网络。

进度条旋转不会停止,后退按钮不起作用。

>>> class Thing:
...   @staticmethod
...   def say_hello():
...     print('hello!')
...   Thing.say_hello()
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 5, in Thing
AttributeError: type object 'Thing' has no attribute 'say_hello'
>>>

1 个答案:

答案 0 :(得分:1)

尝试设置进度条的cancelable属性。

mProgressDialog = new ProgressDialog(this);
mProgressDialog.setCancelable(true);