Search in sources :

Example 11 with SyncApplyTask

use of com.odysee.app.tasks.wallet.SyncApplyTask in project odysee-android by OdyseeTeam.

the class SignInFragment method processNewWallet.

public void processNewWallet() {
    SyncApplyTask fetchTask = new SyncApplyTask(true, null, new DefaultSyncTaskHandler() {

        @Override
        public void onSyncApplySuccess(String hash, String data) {
            createNewRemoteSync(hash, data);
        }

        @Override
        public void onSyncApplyError(Exception error) {
            showError(error.getMessage());
            Helper.setViewVisibility(walletSyncProgress, View.GONE);
            Helper.setViewText(textWalletSyncLoading, R.string.wallet_sync_op_failed);
            walletSyncStarted = false;
        }
    });
    fetchTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Also used : DefaultSyncTaskHandler(com.odysee.app.tasks.wallet.DefaultSyncTaskHandler) LbryioRequestException(com.odysee.app.exceptions.LbryioRequestException) LbryioResponseException(com.odysee.app.exceptions.LbryioResponseException) ExecutionException(java.util.concurrent.ExecutionException) SyncApplyTask(com.odysee.app.tasks.wallet.SyncApplyTask)

Aggregations

DefaultSyncTaskHandler (com.odysee.app.tasks.wallet.DefaultSyncTaskHandler)11 SyncApplyTask (com.odysee.app.tasks.wallet.SyncApplyTask)11 LbryioRequestException (com.odysee.app.exceptions.LbryioRequestException)8 LbryioResponseException (com.odysee.app.exceptions.LbryioResponseException)8 ExecutionException (java.util.concurrent.ExecutionException)8 SyncSetTask (com.odysee.app.tasks.wallet.SyncSetTask)5 SQLiteException (android.database.sqlite.SQLiteException)2 SpannableString (android.text.SpannableString)2 ApiCallException (com.odysee.app.exceptions.ApiCallException)2 AuthTokenInvalidatedException (com.odysee.app.exceptions.AuthTokenInvalidatedException)2 LbryUriException (com.odysee.app.exceptions.LbryUriException)2 ParseException (java.text.ParseException)2 JSONException (org.json.JSONException)2