Code example for ExecutorService

Methods: submit

0
                Message message = handler.obtainMessage(0, profile); 
                handler.sendMessage(message); 
    		} 
    	}; 
    	 
    	executor.submit(task); 
    } 
     
    private Profile defaultProfile(String userJid) { 
    	Profile profile = new DefaultProfile(); 
    	profile.setUserId(userJid); 
    	return profile; 
    } 
     
    private AsyncProfileLoader() { 
    	// 
    } 
 
    public interface ProfileCallback { 
        public void profileLoaded(String userJid, Profile profile); 
    }