當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。