Code example for Handler

Methods: post

0
            @Override 
            protected String doInBackground(String... msg) {
                    // Executed in worker thread 
                    String result = "";
                    try { 
                            final String categoryVersion = FacilitiesDB.updateCategories(mContext, mFacilitiesLoadedHandler );
                            mFacilitiesLoadedHandler.post(new Runnable() {
                                 public void run() { 
                                	 Global.setVersion("local", "map", "category_list", categoryVersion, mContext);
                                 } 
                            }); 
 
                            final String locationVersion = FacilitiesDB.updateLocations(mContext, mFacilitiesLoadedHandler );
                            mFacilitiesLoadedHandler.post(new Runnable() {
                                 public void run() { 
                                	 Global.setVersion("local", "map", "location", locationVersion, mContext);
                                 } 
                            }); 
 
                            final String problemTypeVersion = FacilitiesDB.updateProblemTypes(mContext,mFacilitiesLoadedHandler);
                            mFacilitiesLoadedHandler.post(new Runnable() {
                                 public void run() { 
                                	 Global.setVersion("local", "facilities", "problem_type", problemTypeVersion, mContext);
                                 } 
                            }); 
                            result = "success";