本文整理汇总了Java中android.os.Parcel.writeBundle方法的典型用法代码示例。如果您正苦于以下问题:Java Parcel.writeBundle方法的具体用法?Java Parcel.writeBundle怎么用?Java Parcel.writeBundle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Parcel
的用法示例。
在下文中一共展示了Parcel.writeBundle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
public void writeToParcel(Parcel dest, int flags) {
int i;
int i2 = 1;
dest.writeString(this.mClassName);
dest.writeInt(this.mIndex);
dest.writeInt(this.mFromLayout ? 1 : 0);
dest.writeInt(this.mFragmentId);
dest.writeInt(this.mContainerId);
dest.writeString(this.mTag);
if (this.mRetainInstance) {
i = 1;
} else {
i = 0;
}
dest.writeInt(i);
if (!this.mDetached) {
i2 = 0;
}
dest.writeInt(i2);
dest.writeBundle(this.mArguments);
dest.writeBundle(this.mSavedFragmentState);
}
示例2: send
import android.os.Parcel; //导入方法依赖的package包/类
/**
* 向服务端发送消息
* @param code 消息类型
* @param bundle 消息体
* @return 返回值为服务器的返回
* @throws Exception
*/
public Bundle send(int code, Bundle bundle) throws Exception {
if (mIBinder == null) {
throw new NullPointerException("IBinder is Null");
}
Bundle result = null;
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeBundle(bundle);
mIBinder.transact(code,
_data, _reply, 0);
_reply.readException();
result = _reply.readBundle();
} catch (Exception e) {
e.printStackTrace();
throw new Exception(e);
} finally {
_reply.recycle();
_data.recycle();
return result;
}
}
示例3: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(final Parcel parcel, final int arg1) {
final Bundle b = new Bundle(getClass().getClassLoader());
b.putInt(PARCEL_RECORD_LENGTH, mLength);
b.putInt(PARCEL_RECORD_TYPE, mType);
b.putByteArray(PARCEL_RECORD_DATA, mData);
parcel.writeBundle(b);
}
示例4: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
public static Parcel writeToParcel(Parcelable instance, String key) {
Bundle bundle = new Bundle();
bundle.putParcelable(key, instance);
Parcel parcel = Parcel.obtain();
parcel.writeBundle(bundle);
return parcel;
}
示例5: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeParcelable(mStationImage, flags);
dest.writeString(mStationImageFile.toString());
dest.writeString(mStationName);
dest.writeString(mStationPlaylistFile.toString());
dest.writeParcelable(mStreamUri, flags);
dest.writeString(mPlaylistFileContent);
dest.writeBundle(mStationFetchResults);
dest.writeByte((byte) (mPlayback ? 1 : 0)); // if mPlayback == true, byte == 1
dest.writeString(mMimeType);
dest.writeInt(mChannelCount);
dest.writeInt(mSampleRate);
dest.writeInt(mBitrate);
}
示例6: onTransact
import android.os.Parcel; //导入方法依赖的package包/类
@Override
protected boolean onTransact(int code, Parcel data, Parcel reply, int flags)
throws RemoteException {
if(code == ServiceContext.TRANSACT_BUNDLE_SENDER) {
Bundle bundle = data.readBundle();
Bundle result = onReceiver(bundle);
reply.writeBundle(result);
}
return true;
}
示例7: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(this.mState);
dest.writeLong(this.mPosition);
dest.writeFloat(this.mSpeed);
dest.writeLong(this.mUpdateTime);
dest.writeLong(this.mBufferedPosition);
dest.writeLong(this.mActions);
TextUtils.writeToParcel(this.mErrorMessage, dest, flags);
dest.writeTypedList(this.mCustomActions);
dest.writeLong(this.mActiveItemId);
dest.writeBundle(this.mExtras);
}
示例8: sizeAsParcel
import android.os.Parcel; //导入方法依赖的package包/类
/**
* Measure the size of a typed {@link Bundle} when written to a {@link Parcel}.
*
* @param bundle to measure
* @return size when written to parcel in bytes
*/
public static int sizeAsParcel(@NonNull Bundle bundle) {
Parcel parcel = Parcel.obtain();
try {
parcel.writeBundle(bundle);
return parcel.dataSize();
} finally {
parcel.recycle();
}
}
示例9: writeStringMap
import android.os.Parcel; //导入方法依赖的package包/类
public static void writeStringMap(Parcel parcel, Map<String, String> stringMap) {
Bundle b = new Bundle();
for (Map.Entry<String, String> entry : stringMap.entrySet()) {
b.putString(entry.getKey(), entry.getValue());
}
parcel.writeBundle(b);
}
示例10: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel (Parcel dest, int flags) {
dest.writeBundle(data);
}
示例11: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(isDialogShowing ? 1 : 0);
dest.writeBundle(dialogBundle);
}
示例12: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeBundle(params);
}
示例13: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(requestCode);
dest.writeInt(resultCode);
dest.writeBundle(resultBundle);
}
示例14: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeBundle(dialogBundle);
}
示例15: writeToParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeBundle(mState);
}