当前位置: 首页>>代码示例>>Java>>正文


Java Parcel.writeBundle方法代码示例

本文整理汇总了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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:23,代码来源:FragmentState.java

示例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;
    }
}
 
开发者ID:jiangchunyu,项目名称:IPCCommunication,代码行数:31,代码来源:ClientUtils.java

示例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);
}
 
开发者ID:Twelvelines,项目名称:AndroidMuseumBleManager,代码行数:11,代码来源:AdRecord.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:ParcelUtils.java

示例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);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:16,代码来源:Station.java

示例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;
}
 
开发者ID:devyok,项目名称:DroidIPC,代码行数:13,代码来源:BundleReceiver.java

示例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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:PlaybackStateCompat.java

示例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();
    }
}
 
开发者ID:guardian,项目名称:toolargetool,代码行数:16,代码来源:TooLargeTool.java

示例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);
}
 
开发者ID:Datatellit,项目名称:xlight_android_native,代码行数:8,代码来源:Parcelables.java

示例10: writeToParcel

import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel (Parcel dest, int flags) {
    dest.writeBundle(data);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Message.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:MaterialEditTextPreference.java

示例12: writeToParcel

import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeBundle(params);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:5,代码来源:ShareMedia.java

示例13: writeToParcel

import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(requestCode);
    dest.writeInt(resultCode);
    dest.writeBundle(resultBundle);
}
 
开发者ID:LonelyMushroom,项目名称:aarLibrary,代码行数:7,代码来源:ResultRecord.java

示例14: writeToParcel

import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeBundle(dialogBundle);
}
 
开发者ID:Bregnet,项目名称:TextView_CustomEdit_CustomColor,代码行数:6,代码来源:ColorPickerPreference.java

示例15: writeToParcel

import android.os.Parcel; //导入方法依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    dest.writeBundle(mState);
}
 
开发者ID:Break369,项目名称:MyLife,代码行数:6,代码来源:ElasticDrawer.java


注:本文中的android.os.Parcel.writeBundle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。