android.os.Bundle.keySet()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(184)

本文整理了Java中android.os.Bundle.keySet()方法的一些代码示例,展示了Bundle.keySet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.keySet()方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:keySet

Bundle.keySet介绍

暂无

代码示例

代码示例来源:origin: facebook/facebook-android-sdk

/**
 * Returns a set of the keys contained in this object.
 * @return A set of the keys.
 */
public Set<String> keySet() {
  return this.bundle.keySet();
}

代码示例来源:origin: facebook/facebook-android-sdk

/**
 * The set of keys that have been set in this instance of CameraEffectArguments
 * @return The set of keys that have been set in this instance of CameraEffectArguments
 */
public Set<String> keySet() {
  return this.params.keySet();
}

代码示例来源:origin: facebook/facebook-android-sdk

public Set<String> keySet() {
  return this.textures.keySet();
}

代码示例来源:origin: stackoverflow.com

public static String bundle2string(Bundle bundle) {
  if (bundle == null) {
    return null;
  }
  String string = "Bundle{";
  for (String key : bundle.keySet()) {
    string += " " + key + " => " + bundle.get(key) + ";";
  }
  string += " }Bundle";
  return string;
}

代码示例来源:origin: stackoverflow.com

public class IncomingCallTracker extends BroadcastReceiver {

  @Override
  public void onReceive(Context context, Intent intent) {

    Bundle bundle = intent.getExtras();

      Set<String> keys = bundle.keySet();
    for (String key : keys) {
        Log.i("MYAPP##", key + "="+ bundle.getString(key));
    }       
  }

}

代码示例来源:origin: stackoverflow.com

import java.util.Iterator;
import java.util.Set;
import android.os.Bundle;

public static void dumpIntent(Intent i){

  Bundle bundle = i.getExtras();
  if (bundle != null) {
    Set<String> keys = bundle.keySet();
    Iterator<String> it = keys.iterator();
    Log.e(LOG_TAG,"Dumping Intent start");
    while (it.hasNext()) {
      String key = it.next();
      Log.e(LOG_TAG,"[" + key + "=" + bundle.get(key)+"]");
    }
    Log.e(LOG_TAG,"Dumping Intent end");
  }
}

代码示例来源:origin: android-hacker/VirtualXposed

public static void writeMeta(Parcel p, Bundle meta) {
  Map<String, String> map = new HashMap<>();
  if (meta != null) {
    for (String key : meta.keySet()) {
      map.put(key, meta.getString(key));
    }
  }
  p.writeMap(map);
}

代码示例来源:origin: android-hacker/VirtualXposed

@Override
protected String toDebugString(long now) {
  if (loginOptions != null) loginOptions.keySet();
  return super.toDebugString(now) + ", updateCredentials"
      + ", " + account
      + ", authTokenType " + authTokenType
      + ", loginOptions " + loginOptions;
}

代码示例来源:origin: commonsguy/cw-omnibus

private void dumpBundleToLog(String msg, Bundle b) {
  Log.d(getClass().getSimpleName(),
    String.format("Task ID #%d", getTaskId()));

  for (String key: b.keySet()) {
   Log.d(getClass().getSimpleName(),
     String.format("(%s) %s: %s", msg, key, b.get(key)));
  }
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

JSONObject dumpBundle(Bundle b, JSONObject json)
 throws JSONException {
 Set<String> keys=b.keySet();
 for (String key : keys) {
  json.put(key, wrap(b.get(key)));
 }
 return (json);
}

代码示例来源:origin: commonsguy/cw-omnibus

protected JSONObject dumpBundle(Bundle b, JSONObject json)
 throws JSONException {
 Set<String> keys=b.keySet();
 for (String key : keys) {
  json.put(key, wrap(b.get(key)));
 }
 return(json);
}

代码示例来源:origin: facebook/facebook-android-sdk

private static boolean isGzipCompressible(GraphRequestBatch requests) {
  for (GraphRequest request : requests) {
    for (String key : request.parameters.keySet()) {
      Object value = request.parameters.get(key);
      if (isSupportedAttachmentType(value)) {
        return false;
      }
    }
  }
  return true;
}

代码示例来源:origin: robolectric/robolectric

@Implementation
protected static void validateSyncExtrasBundle(Bundle extras) {
 for (String key : extras.keySet()) {
  Object value = extras.get(key);
  if (value == null
    || value instanceof Long
    || value instanceof Integer
    || value instanceof Boolean
    || value instanceof Float
    || value instanceof Double
    || value instanceof String
    || value instanceof Account) {
   continue;
  }
  throw new IllegalArgumentException("unexpected value type: " + value.getClass().getName());
 }
}

代码示例来源:origin: JessYanCoding/MVPArms

public List<ConfigModule> parse() {
  List<ConfigModule> modules = new ArrayList<ConfigModule>();
  try {
    ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(
        context.getPackageName(), PackageManager.GET_META_DATA);
    if (appInfo.metaData != null) {
      for (String key : appInfo.metaData.keySet()) {
        if (MODULE_VALUE.equals(appInfo.metaData.get(key))) {
          modules.add(parseModule(key));
        }
      }
    }
  } catch (PackageManager.NameNotFoundException e) {
    throw new RuntimeException("Unable to find metadata to parse ConfigModule", e);
  }
  return modules;
}

代码示例来源:origin: bumptech/glide

Log.v(TAG, "Got app info metadata: " + appInfo.metaData);
for (String key : appInfo.metaData.keySet()) {
 if (GLIDE_MODULE_VALUE.equals(appInfo.metaData.get(key))) {
  modules.add(parseModule(key));

代码示例来源:origin: robolectric/robolectric

private static boolean isBundleEqual(Bundle bundle1, Bundle bundle2) {
 if (bundle1 == null || bundle2 == null) {
  return false;
 }
 if (bundle1.size() != bundle2.size()) {
  return false;
 }
 for (String key : bundle1.keySet()) {
  if (!bundle1.get(key).equals(bundle2.get(key))) {
   return false;
  }
 }
 return true;
}

代码示例来源:origin: commonsguy/cw-omnibus

RestrictionsAdapter(Bundle restrictions) {
 super(getActivity(), android.R.layout.simple_list_item_1,
    new ArrayList<String>());
 ArrayList<String> keys=
   new ArrayList<String>(restrictions.keySet());
 Collections.sort(keys);
 addAll(keys);
 this.restrictions=restrictions;
}

代码示例来源:origin: commonsguy/cw-omnibus

RestrictionsAdapter(Bundle restrictions) {
 super(getActivity(), android.R.layout.simple_list_item_1,
    new ArrayList<String>());
 ArrayList<String> keys=
   new ArrayList<String>(restrictions.keySet());
 Collections.sort(keys);
 addAll(keys);
 this.restrictions=restrictions;
}

代码示例来源:origin: facebook/facebook-android-sdk

private static void serializeParameters(
    Bundle bundle,
    Serializer serializer,
    GraphRequest request
) throws IOException {
  Set<String> keys = bundle.keySet();
  for (String key : keys) {
    Object value = bundle.get(key);
    if (isSupportedParameterType(value)) {
      serializer.writeObject(key, value, request);
    }
  }
}

代码示例来源:origin: facebook/facebook-android-sdk

public static void assertEqualContents(final Bundle a, final Bundle b) {
  for (String key : a.keySet()) {
    if (!b.containsKey(key)) {
      Assert.fail("bundle does not include key " + key);
    }
    Assert.assertEquals(a.get(key), b.get(key));
  }
  for (String key : b.keySet()) {
    if (!a.containsKey(key)) {
      Assert.fail("bundle does not include key " + key);
    }
  }
}

相关文章

Bundle类方法