本文整理匯總了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);
}