|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.ambient.views.LongOperationExecutor
public final class LongOperationExecutor
Shows the wait-for dialog and runs long running operation in the background.
The start()
method starts the long running operation in new thread.
Exceptions thrown by the runnable are reported using
AmbientApplication.error(Class, boolean, String, Throwable)
.
The Runnable
should periodically check for the interrupted state
(using Thread.currentThread().isInterrupted()
). If it is
interrupted it should finish ASAP. It may do so by throwing an Exception -
exceptions are not reported when the process is interrupted.
Constructor Summary | |
---|---|
LongOperationExecutor(Context context,
int text,
int errorMsg,
Runnable longRunningOp)
Creates the long running operation runner. |
Method Summary | |
---|---|
void |
onCancel(DialogInterface arg0)
|
void |
run()
Internal, do not call. |
void |
start()
Shows the dialog and starts the long-running operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LongOperationExecutor(Context context, int text, int errorMsg, Runnable longRunningOp)
context
- the contexttext
- the text to show on the dialog.errorMsg
- shown when the operation fails.longRunningOp
- the operation to run. It will be executed in its own thread.Method Detail |
---|
public void run()
run
in interface Runnable
public void onCancel(DialogInterface arg0)
onCancel
in interface DialogInterface.OnCancelListener
public void start()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |