Android Open Source - MentorMe Async






From Project

Back to project page MentorMe.

License

The source code is released under:

MIT License

If you think the Android project MentorMe listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.codepath.wwcmentorme.helpers;
/*from   w  w w.j  a  v  a2 s .c om*/
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Looper;

public class Async {
  private static class RunnableTask extends AsyncTask<Object, Object, Object> {
    private final Runnable mRunnable;

    public RunnableTask(final Runnable runnable) {
      mRunnable = runnable;
    }

    @Override
    protected Object doInBackground(Object... params) {
      mRunnable.run();
      return null;
    }
  }

  public static interface Block<V> {
    public abstract void call(V result);
  }

  public static void dispatch(final Runnable runnable) {
    new RunnableTask(runnable).execute(null, null, null);
  }

  private static final Handler MAIN_HANDLER = new Handler(
      Looper.getMainLooper());

  public static void dispatchMain(final Runnable runnable) {
    MAIN_HANDLER.post(runnable);
  }

  public static void dispatchMain(final Runnable runnable, final long delayMs) {
    MAIN_HANDLER.postDelayed(runnable, delayMs);
  }
}




Java Source Code List

com.codepath.wwcmentorme.activities.AppActivity.java
com.codepath.wwcmentorme.activities.ChatActivity.java
com.codepath.wwcmentorme.activities.EditProfileActivity.java
com.codepath.wwcmentorme.activities.HomeActivity.java
com.codepath.wwcmentorme.activities.MapActivity.java
com.codepath.wwcmentorme.activities.MentorListActivity.java
com.codepath.wwcmentorme.activities.ThankMentorActivity.java
com.codepath.wwcmentorme.activities.UserListActivity.java
com.codepath.wwcmentorme.activities.ViewProfileActivity.java
com.codepath.wwcmentorme.adapters.ChatAdapter.java
com.codepath.wwcmentorme.adapters.DrawerListAdapter.java
com.codepath.wwcmentorme.adapters.MentorListAdapter.java
com.codepath.wwcmentorme.app.MentorMeApp.java
com.codepath.wwcmentorme.data.DataService.java
com.codepath.wwcmentorme.fragments.AbstractEditProfileFragment.java
com.codepath.wwcmentorme.fragments.EditProfileExperiencesFragment.java
com.codepath.wwcmentorme.fragments.EditProfileLocationFragment.java
com.codepath.wwcmentorme.fragments.EditProfileSkillsFragment.java
com.codepath.wwcmentorme.fragments.RefineResultsDialogFragment.java
com.codepath.wwcmentorme.helpers.Async.java
com.codepath.wwcmentorme.helpers.Constants.java
com.codepath.wwcmentorme.helpers.MentorMeReceiver.java
com.codepath.wwcmentorme.helpers.NotificationCenter.java
com.codepath.wwcmentorme.helpers.RoundedImageView.java
com.codepath.wwcmentorme.helpers.UIUtils.java
com.codepath.wwcmentorme.helpers.Utils.java
com.codepath.wwcmentorme.helpers.ViewHolder.java
com.codepath.wwcmentorme.models.Message.java
com.codepath.wwcmentorme.models.Rating.java
com.codepath.wwcmentorme.models.Request.java
com.codepath.wwcmentorme.models.User.java