Java Code Examples for android.support.v4.util.SimpleArrayMap#get()

The following examples show how to use android.support.v4.util.SimpleArrayMap#get() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GooglePlayReceiver.java    From firebase-jobdispatcher-android with Apache License 2.0 6 votes vote down vote up
/**
 * Stops the job if it is running.
 *
 * <p>Needed to avoid possibility of sending job result before the reschedule request is received
 * by Google Play services.
 */
static void onSchedule(Job job) {
  // Stop if running
  synchronized (callbacks) {
    SimpleArrayMap<String, JobCallback> jobs = callbacks.get(job.getService());
    if (jobs == null) { // not running
      return;
    }
    JobCallback jobCallback = jobs.get(job.getTag());
    if (jobCallback == null) { // not running
      return;
    }
  }
  JobInvocation key =
      new JobInvocation.Builder()
          .setTag(job.getTag())
          .setService(job.getService())
          .setTrigger(job.getTrigger())
          .build();
  ExecutionDelegator.stopJob(key, false /* must not send the result */);
}
 
Example 2
Source File: LayoutInflaterCompat.java    From Neptune with Apache License 2.0 5 votes vote down vote up
/**
 * 处理android support库Fragment的缓存
 */
private void resetSupportFragmentClassMap(Context context, String fname) {
    SimpleArrayMap<String, Class<?>> classMap = getSupportFragmentClassMap();
    if (classMap != null) {
        Class<?> clazz = classMap.get(fname);
        if (clazz != null && !verifyClassLoader(context, clazz)) {
            PluginDebugLog.runtimeFormatLog(TAG, "find same support fragment class name in LayoutInflater cache and remove it %s", fname);
            clazz = null;
            classMap.remove(fname);
        }
    }
}
 
Example 3
Source File: GetTokenQuickTest.java    From gcm with Apache License 2.0 5 votes vote down vote up
@Override
public void execute(Logger logger, Context context, SimpleArrayMap<Integer, String> params) {
    final String senderId = params.get(R.id.home_sender_id);

    InstanceIdHelper instanceIdHelper = new InstanceIdHelper(context);
    instanceIdHelper.getTokenInBackground(senderId, "GCM", null);
}