Search in sources :

Example 1 with GetNotificationsRemoteOperation

use of com.owncloud.android.lib.resources.notifications.GetNotificationsRemoteOperation in project android by nextcloud.

the class NotificationsActivity method fetchAndSetData.

private void fetchAndSetData() {
    Thread t = new Thread(() -> {
        initializeAdapter();
        RemoteOperation getRemoteNotificationOperation = new GetNotificationsRemoteOperation();
        final RemoteOperationResult result = getRemoteNotificationOperation.execute(client);
        if (result.isSuccess() && result.getNotificationData() != null) {
            final List<Notification> notifications = result.getNotificationData();
            runOnUiThread(() -> populateList(notifications));
        } else {
            Log_OC.d(TAG, result.getLogMessage());
            // show error
            runOnUiThread(() -> setEmptyContent(getString(R.string.notifications_no_results_headline), result.getLogMessage()));
        }
        hideRefreshLayoutLoader();
    });
    t.start();
}
Also used : RemoteOperation(com.owncloud.android.lib.common.operations.RemoteOperation) GetNotificationsRemoteOperation(com.owncloud.android.lib.resources.notifications.GetNotificationsRemoteOperation) RemoteOperationResult(com.owncloud.android.lib.common.operations.RemoteOperationResult) GetNotificationsRemoteOperation(com.owncloud.android.lib.resources.notifications.GetNotificationsRemoteOperation) Notification(com.owncloud.android.lib.resources.notifications.models.Notification)

Aggregations

RemoteOperation (com.owncloud.android.lib.common.operations.RemoteOperation)1 RemoteOperationResult (com.owncloud.android.lib.common.operations.RemoteOperationResult)1 GetNotificationsRemoteOperation (com.owncloud.android.lib.resources.notifications.GetNotificationsRemoteOperation)1 Notification (com.owncloud.android.lib.resources.notifications.models.Notification)1