Closed euniceg82 closed 8 years ago
Hi!
To use encrypt in an Activity it is likely any other place, if the question is about thread, you can back to main thread using activity's method runOnUiThread
:
encryption.decryptAsync(encryptedText, new Encryption.Callback() {
@Override
public void onSuccess(String decryptedText) {
// runOnUiThread is an activity method.
runOnUiThread(new Runnable() {
@Override
public void run() {
// Do anything in main thread
}
});
}
@Override
public void onError(Exception exception) {}
});
naturally you can also create your own Handler
and back to any thread that you want even the UI.
Got it. Hoping that it would solve the "lag/hang" in app. Thanks!
You're welcome.
The encrypt/decrypt can take a while, you can adjust some parameters and/or think in a UI/UX to deal with the delay.
So I'm going to close the issue, any doubts fell free to ask.
Hi, how would I use the encrypt/decrypt async in Activity? I already implemented the Encryption.Callback. What should I do next? Thanks!