Search in sources :

Example 1 with FetchChannelsListener

use of com.odysee.app.listener.FetchChannelsListener in project odysee-android by OdyseeTeam.

the class MainActivity method fetchOwnChannels.

public void fetchOwnChannels() {
    ClaimListTask task = new ClaimListTask(Claim.TYPE_CHANNEL, null, Lbryio.AUTH_TOKEN, new ClaimListResultHandler() {

        @Override
        public void onSuccess(List<Claim> claims) {
            Lbry.ownChannels = Helper.filterDeletedClaims(new ArrayList<>(claims));
            for (FetchChannelsListener listener : fetchChannelsListeners) {
                listener.onChannelsFetched(claims);
            }
        }

        @Override
        public void onError(Exception error) {
            Log.e("FetchingChannels", "onError: ".concat(error.getLocalizedMessage()));
        }
    });
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Also used : ClaimListResultHandler(com.odysee.app.tasks.claim.ClaimListResultHandler) ClaimListTask(com.odysee.app.tasks.claim.ClaimListTask) FetchChannelsListener(com.odysee.app.listener.FetchChannelsListener) Claim(com.odysee.app.model.Claim) JSONException(org.json.JSONException) LbryUriException(com.odysee.app.exceptions.LbryUriException) ExecutionException(java.util.concurrent.ExecutionException) SQLiteException(android.database.sqlite.SQLiteException) LbryioRequestException(com.odysee.app.exceptions.LbryioRequestException) LbryioResponseException(com.odysee.app.exceptions.LbryioResponseException) ApiCallException(com.odysee.app.exceptions.ApiCallException) AuthTokenInvalidatedException(com.odysee.app.exceptions.AuthTokenInvalidatedException) ParseException(java.text.ParseException)

Aggregations

SQLiteException (android.database.sqlite.SQLiteException)1 ApiCallException (com.odysee.app.exceptions.ApiCallException)1 AuthTokenInvalidatedException (com.odysee.app.exceptions.AuthTokenInvalidatedException)1 LbryUriException (com.odysee.app.exceptions.LbryUriException)1 LbryioRequestException (com.odysee.app.exceptions.LbryioRequestException)1 LbryioResponseException (com.odysee.app.exceptions.LbryioResponseException)1 FetchChannelsListener (com.odysee.app.listener.FetchChannelsListener)1 Claim (com.odysee.app.model.Claim)1 ClaimListResultHandler (com.odysee.app.tasks.claim.ClaimListResultHandler)1 ClaimListTask (com.odysee.app.tasks.claim.ClaimListTask)1 ParseException (java.text.ParseException)1 ExecutionException (java.util.concurrent.ExecutionException)1 JSONException (org.json.JSONException)1