本文整理了Java中android.os.Bundle.remove()
方法的一些代码示例,展示了Bundle.remove()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.remove()
方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:remove
暂无
代码示例来源:origin: facebook/facebook-android-sdk
parameters.remove("image");
return;
} catch (JSONException ex) {
JSONObject image = new JSONObject(imageStr);
putImageInBundleWithArrayFormat(parameters, 0, image);
parameters.remove("image");
} catch (JSONException exception) {
代码示例来源:origin: facebook/facebook-android-sdk
public static boolean putJSONValueInBundle(Bundle bundle, String key, Object value) {
if (value == null) {
bundle.remove(key);
} else if (value instanceof Boolean) {
bundle.putBoolean(key, (boolean) value);
} else if (value instanceof boolean[]) {
bundle.putBooleanArray(key, (boolean[]) value);
} else if (value instanceof Double) {
bundle.putDouble(key, (double) value);
} else if (value instanceof double[]) {
bundle.putDoubleArray(key, (double[]) value);
} else if (value instanceof Integer) {
bundle.putInt(key, (int) value);
} else if (value instanceof int[]) {
bundle.putIntArray(key, (int[]) value);
} else if (value instanceof Long) {
bundle.putLong(key, (long) value);
} else if (value instanceof long[]) {
bundle.putLongArray(key, (long[]) value);
} else if (value instanceof String) {
bundle.putString(key, (String) value);
} else if (value instanceof JSONArray) {
bundle.putString(key, value.toString());
} else if (value instanceof JSONObject) {
bundle.putString(key, value.toString());
} else {
return false;
}
return true;
}
代码示例来源:origin: android-hacker/VirtualXposed
} else {
if (mStripAuthTokenFromResult) {
result.remove(AccountManager.KEY_AUTHTOKEN);
代码示例来源:origin: robolectric/robolectric
@Test
public void remove() {
bundle.putFloat("foo", 5f);
bundle.putFloat("foo2", 5f);
bundle.remove("foo");
assertThat(bundle.containsKey("foo")).isFalse();
assertThat(bundle.containsKey("foo2")).isTrue();
}
代码示例来源:origin: k9mail/k-9
extras.remove(EXTRA_URI_CONTENT);
intent.putExtras(extras);
getContext().startActivity(intent);
代码示例来源:origin: facebook/facebook-android-sdk
queryParams.remove(ServerProtocol.FALLBACK_DIALOG_PARAM_BRIDGE_ARGS);
queryParams.remove(ServerProtocol.FALLBACK_DIALOG_PARAM_METHOD_RESULTS);
queryParams.remove(ServerProtocol.FALLBACK_DIALOG_PARAM_VERSION);
queryParams.putInt(
NativeProtocol.EXTRA_PROTOCOL_VERSION, NativeProtocol.getLatestKnownVersion());
代码示例来源:origin: android-hacker/VirtualXposed
for (String key : extras.keySet()) {
if (key.startsWith("_VA_")) {
targetBundle.remove(key);
代码示例来源:origin: konmik/nucleus
return null;
}).when(bundle).remove(anyString());
doAnswer(new Answer() {
@Override
代码示例来源:origin: stackoverflow.com
@Override
public void onCreate(Bundle savedInstanceState) {
// If the bundle is not null, get your Parcelable :
LatLng myLatLng = null;
if(savedInstanceState != null) {
myLatLng = (LatLng) savedInstanceState.getParcelable("myLatLng");
// Remove your Parcelable from the bundle, else it will crash :
savedInstanceState.remove("myLatLng");
}
// Forward the call :
_mapView.onCreate(savedInstanceState);
setUpMapIfNeeded();
}
代码示例来源:origin: syncthing/syncthing-android
private void updateVersioning(Bundle arguments) {
if (mFolder != null){
mVersioning = mFolder.versioning;
} else {
mVersioning = new Folder.Versioning();
}
String type = arguments.getString("type");
arguments.remove("type");
if (type.equals("none")){
mVersioning = new Folder.Versioning();
} else {
for (String key : arguments.keySet()) {
mVersioning.params.put(key, arguments.getString(key));
}
mVersioning.type = type;
}
attemptToApplyVersioningConfig();
updateVersioningDescription();
mFolderNeedsToUpdate = true;
}
代码示例来源:origin: ManbangGroup/Phantom
/**
* 清除Fragment状态相关的key
*
* @param outState
*/
private void removeFragmentState(Bundle outState) {
outState.remove(FRAGMENTS_TAG);
outState.remove(NEXT_CANDIDATE_REQUEST_INDEX_TAG);
outState.remove(ALLOCATED_REQUEST_INDICIES_TAG);
outState.remove(REQUEST_FRAGMENT_WHO_TAG);
}
代码示例来源:origin: stackoverflow.com
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
//solution of fragment.getActivity() is null
outState.remove("android:support:fragments");
}
代码示例来源:origin: chat-sdk/chat-sdk-android
savedInstanceState.remove(LIST_POS);
代码示例来源:origin: stackoverflow.com
private void removeExtraFromBundle(String key){
Bundle bundle = getArguments();
if(bundle != null){
String value = null;
value = bundle.getString(key);
if(value != null){
bundle.remove(key);
}
}
}
代码示例来源:origin: evernote/android-intent
protected T setUris(@Nullable ArrayList<Uri> uris, @Nullable String mimeType) {
if (uris == null || uris.isEmpty() || TextUtils.isEmpty(mimeType)) {
mIntent.setType(null);
mArgs.remove(Intent.EXTRA_STREAM);
return self();
} else {
mIntent.setType(mimeType);
return putParcelableArrayList(Intent.EXTRA_STREAM, uris);
}
}
代码示例来源:origin: evernote/android-intent
protected T putStringArrayList(@NonNull String key, @Nullable ArrayList<String> value) {
if (value == null || value.isEmpty()) {
mArgs.remove(key);
} else {
mArgs.putStringArrayList(key, value);
}
return self();
}
代码示例来源:origin: evernote/android-intent
protected T putParcelableArrayList(@NonNull String key, @Nullable ArrayList<? extends Parcelable> value) {
if (value == null) {
mArgs.remove(key);
} else {
mArgs.putParcelableArrayList(key, value);
}
return self();
}
代码示例来源:origin: OneDrive/onedrive-picker-android
/**
* Makes sure that the {@link PickerResult#fromBundle(Bundle)} method
* returns a null picker result if the link was not found.
*/
public void testNoLinkFound() {
// Setup
mBundle.remove("link");
// Act
final IPickerResult result = PickerResult.fromBundle(mBundle);
// Verify
assertNull(result);
}
代码示例来源:origin: openwalletGH/openwallet-android
@Override
public void onClick(View v) {
Keyboard.hideKeyboard(getActivity());
if (listener != null) {
Bundle args = getArguments() == null ? new Bundle() : getArguments();
args.remove(Constants.ARG_MESSAGE);
args.putString(Constants.ARG_PASSWORD, password.getText().toString());
listener.onPasswordConfirmed(args);
}
}
});
代码示例来源:origin: apsun/NekoSMS
@Override
public void onNewArguments(Bundle args) {
if (args == null) {
return;
}
Uri messageUri = args.getParcelable(ARG_MESSAGE_URI);
if (messageUri != null) {
args.remove(ARG_MESSAGE_URI);
showMessageDetailsDialog(messageUri);
BlockedSmsLoader.get().markAllSeen(getContext());
}
}
内容来源于网络,如有侵权,请联系作者删除!