本文整理汇总了Java中android.os.Bundle.writeToParcel方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.writeToParcel方法的具体用法?Java Bundle.writeToParcel怎么用?Java Bundle.writeToParcel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Bundle
的用法示例。
在下文中一共展示了Bundle.writeToParcel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: playFromUri
import android.os.Bundle; //导入方法依赖的package包/类
public void playFromUri(Uri uri, Bundle extras) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
if (uri != null) {
_data.writeInt(1);
uri.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(16, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
示例2: playFromSearch
import android.os.Bundle; //导入方法依赖的package包/类
public void playFromSearch(String string, Bundle extras) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(string);
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(15, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
示例3: onNavigationEvent
import android.os.Bundle; //导入方法依赖的package包/类
public void onNavigationEvent(int navigationEvent, Bundle extras) throws RemoteException {
Parcel _data = Parcel.obtain();
try {
_data.writeInterfaceToken("android.support.customtabs.ICustomTabsCallback");
_data.writeInt(navigationEvent);
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(2, _data, null, 1);
} finally {
_data.recycle();
}
}
示例4: extraCallback
import android.os.Bundle; //导入方法依赖的package包/类
public void extraCallback(String callbackName, Bundle args) throws RemoteException {
Parcel _data = Parcel.obtain();
try {
_data.writeInterfaceToken("android.support.customtabs.ICustomTabsCallback");
_data.writeString(callbackName);
if (args != null) {
_data.writeInt(1);
args.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(3, _data, null, 1);
} finally {
_data.recycle();
}
}
示例5: send
import android.os.Bundle; //导入方法依赖的package包/类
public void send(int resultCode, Bundle resultData) throws RemoteException {
Parcel _data = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeInt(resultCode);
if (resultData != null) {
_data.writeInt(1);
resultData.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(1, _data, null, 1);
} finally {
_data.recycle();
}
}
示例6: sendControlAction
import android.os.Bundle; //导入方法依赖的package包/类
public void sendControlAction(String deviceId, String action, Bundle extra) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(deviceId);
_data.writeString(action);
if (extra != null) {
_data.writeInt(1);
extra.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(7, _data, _reply, 0);
ExceptionUtils.readExceptionFromParcel(_reply);
} finally {
_reply.recycle();
_data.recycle();
}
}
示例7: sendPush
import android.os.Bundle; //导入方法依赖的package包/类
public void sendPush(Bundle bundle, String deId) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
if (bundle != null) {
_data.writeInt(1);
bundle.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
_data.writeString(deId);
this.mRemote.transact(4, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
示例8: onEvent
import android.os.Bundle; //导入方法依赖的package包/类
public void onEvent(String event, Bundle extras) throws RemoteException {
Parcel _data = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(event);
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(1, _data, null, 1);
} finally {
_data.recycle();
}
}
示例9: playFromMediaId
import android.os.Bundle; //导入方法依赖的package包/类
public void playFromMediaId(String uri, Bundle extras) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(uri);
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(14, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
示例10: updateVisuals
import android.os.Bundle; //导入方法依赖的package包/类
public boolean updateVisuals(ICustomTabsCallback callback, Bundle bundle) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
boolean _result;
try {
_data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
if (bundle != null) {
_data.writeInt(1);
bundle.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(6, _data, _reply, 0);
_reply.readException();
_result = 0 != _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
示例11: writeToParcel
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
Bundle bundle = new Bundle();
if (this.accessToken != null) {
bundle.putString(OauthConfig.BundleKey.KEY_ACCESS_TOKEN, this.accessToken);
}
if (this.expireTime != 0) {
bundle.putLong(OauthConfig.BundleKey.KEY_EXPIRE_TIME, this.expireTime);
}
bundle.writeToParcel(dest, flags);
}
示例12: writeToParcel
import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
Bundle bundle = new Bundle();
bundle.putString(KEY_CLIENT_ID, this.cliendId);
bundle.writeToParcel(dest, flags);
this.accessTokenManager.writeToParcel(dest, flags);
}
示例13: mayLaunchUrl
import android.os.Bundle; //导入方法依赖的package包/类
public boolean mayLaunchUrl(ICustomTabsCallback callback, Uri url, Bundle extras, List<Bundle> otherLikelyBundles) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
boolean _result;
try {
_data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
if (url != null) {
_data.writeInt(1);
url.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
if (extras != null) {
_data.writeInt(1);
extras.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
_data.writeTypedList(otherLikelyBundles);
this.mRemote.transact(4, _data, _reply, 0);
_reply.readException();
_result = 0 != _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
示例14: extraCommand
import android.os.Bundle; //导入方法依赖的package包/类
public Bundle extraCommand(String commandName, Bundle args) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
Bundle _result;
try {
_data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
_data.writeString(commandName);
if (args != null) {
_data.writeInt(1);
args.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(5, _data, _reply, 0);
_reply.readException();
if (0 != _reply.readInt()) {
_result = Bundle.CREATOR.createFromParcel(_reply);
} else {
_result = null;
}
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
示例15: createDeepCopy
import android.os.Bundle; //导入方法依赖的package包/类
@SuppressLint("ParcelClassLoader")
private Bundle createDeepCopy(Bundle original) {
Parcel temp = Parcel.obtain();
original.writeToParcel(temp, 0);
temp.setDataPosition(0);
Bundle copy = temp.readBundle();
temp.recycle();
return copy;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:10,代码来源:InvalidationGcmUpstreamSender.java