client/android/ZUMOAPPNAME/app/src/main/java/com/example/zumoappname/ToDoActivity.java
/**
     * Refresh the list with the items in the Table
     */
Refresh the list with the items in the Table
Refresh the list with the items in the Table
private void refreshItemsFromTable() {
        AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>(){
            @Override
            protected Void doInBackground(Void... params) {
                try {
                    final List<ToDoItem> results = refreshItemsFromMobileServiceTable();
                    runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            mAdapter.clear();
                            for (ToDoItem item : results) {
                                mAdapter.add(item);
                            }
                        }
                    });
                } catch (final Exception e){
                    createAndShowDialogFromTask(e, "Error");
                }
                return null;
            }
        };
        runAsyncTask(task);
    }
private void refreshItemsFromTable ( ) { AsyncTask < Void , Void , Void > task = new AsyncTask < Void , Void , Void > ( ) { @ Override protected Void doInBackground ( Void ... params ) { try { final List < ToDoItem > results = refreshItemsFromMobileServiceTable ( ) ; runOnUiThread ( new Runnable ( ) { @ Override public void run ( ) { mAdapter . clear ( ) ; for ( ToDoItem item : results ) { mAdapter . add ( item ) ; } } } ) ; } catch ( final Exception e ) { createAndShowDialogFromTask ( e , "Error" ) ; } return null ; } } ; runAsyncTask ( task ) ; }
Refresh the list with the items in the Table
Refresh the list with the items in the Table
// Get the items that weren't marked as completed and add them in the // adapter //Offline Sync //final List<ToDoItem> results = refreshItemsFromMobileServiceTableSyncTable();