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


Java Parcel类代码示例

本文整理汇总了Java中android.os.Parcel的典型用法代码示例。如果您正苦于以下问题:Java Parcel类的具体用法?Java Parcel怎么用?Java Parcel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Parcel类属于android.os包,在下文中一共展示了Parcel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeToParcel

import android.os.Parcel; //导入依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeValue(this.iD);
    dest.writeString(this.name);
    dest.writeValue(this.packageBaseID);
    dest.writeString(this.packageBase);
    dest.writeString(this.version);
    dest.writeString(this.description);
    dest.writeString(this.uRL);
    dest.writeValue(this.numVotes);
    dest.writeValue(this.popularity);
    dest.writeString(this.outOfDate);
    dest.writeString(this.maintainer);
    dest.writeValue(this.firstSubmitted);
    dest.writeValue(this.lastModified);
    dest.writeString(this.uRLPath);
    dest.writeStringList(this.depends);
    dest.writeStringList(this.makeDepends);
    dest.writeStringList(this.optDepends);
    dest.writeStringList(this.conflicts);
    dest.writeStringList(this.provides);
    dest.writeStringList(this.license);
    dest.writeStringList(this.keywords);
}
 
开发者ID:rascarlo,项目名称:AURdroid,代码行数:25,代码来源:AurInfoResult.java

示例2: LoginClient

import android.os.Parcel; //导入依赖的package包/类
public LoginClient(Parcel source) {
    Object [] o = source.readParcelableArray(LoginMethodHandler.class.getClassLoader());
    handlersToTry = new LoginMethodHandler[o.length];
    for (int i = 0; i < o.length; ++i) {
        handlersToTry[i] = (LoginMethodHandler) o[i];
        handlersToTry[i].setLoginClient(this);
    }
    currentHandler = source.readInt();
    pendingRequest = source.readParcelable(Request.class.getClassLoader());
    loggingExtras = Utility.readStringMapFromParcel(source);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:12,代码来源:LoginClient.java

示例3: writeToParcel

import android.os.Parcel; //导入依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeLong(this.id);
    dest.writeString(this.url);
    dest.writeInt(this.total_count);
    dest.writeInt(this.plusOne);
    dest.writeInt(this.minusOne);
    dest.writeInt(this.laugh);
    dest.writeInt(this.hooray);
    dest.writeInt(this.confused);
    dest.writeInt(this.heart);
    dest.writeString(this.content);
    dest.writeParcelable(this.user, flags);
    dest.writeByte(this.viewerHasReacted ? (byte) 1 : (byte) 0);
    dest.writeByte(this.isCallingApi ? (byte) 1 : (byte) 0);
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:17,代码来源:ReactionsModel.java

示例4: testVoterParcelMale

import android.os.Parcel; //导入依赖的package包/类
@Test
public void testVoterParcelMale() {
    Voter voter = new Voter(firstName, lastName, Gender.MALE);


    Parcel parcel = Parcel.obtain();
    voter.writeToParcel(parcel, 0);

    // After you're done with writing, you need to reset the parcel for reading:
    parcel.setDataPosition(0);

    // Reconstruct object from parcel and asserts:
    Voter createdFromParcel = Voter.CREATOR.createFromParcel(parcel);

    assertEquals(voter.getFirstName(), createdFromParcel.getFirstName());
    assertEquals(voter.getLastName(), createdFromParcel.getLastName());
    assertEquals(voter.getGender(), createdFromParcel.getGender());
}
 
开发者ID:digital-voting-pass,项目名称:polling-station-app,代码行数:19,代码来源:TestVoter.java

示例5: readIntStringMap

import android.os.Parcel; //导入依赖的package包/类
public static Map<Integer, String> readIntStringMap(Parcel in){
    boolean isNull = in.readByte() == (byte) 1;
    if(isNull){
        return null;
    }

    int size = in.readInt();
    Map<Integer, String> map = new HashMap<>(size);
    for(int i = 0; i < size; i++){
        Integer key = readObjectInteger(in);
        String value = in.readString();
        map.put(key, value);
    }

    return map;
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:17,代码来源:ParcelUtils.java

示例6: createFromParcel

import android.os.Parcel; //导入依赖的package包/类
@SuppressWarnings({
    "unchecked"
})
public List createFromParcel(Parcel in) {
    List instance = new List();
    instance.dt = ((int) in.readValue((int.class.getClassLoader())));
    instance.temp = ((Temp) in.readValue((Temp.class.getClassLoader())));
    instance.pressure = ((double) in.readValue((double.class.getClassLoader())));
    instance.humidity = ((int) in.readValue((int.class.getClassLoader())));
    in.readList(instance.weather, (Weather.class.getClassLoader()));
    instance.speed = ((double) in.readValue((double.class.getClassLoader())));
    instance.deg = ((int) in.readValue((int.class.getClassLoader())));
    instance.clouds = ((int) in.readValue((int.class.getClassLoader())));
    instance.rain = ((double) in.readValue((double.class.getClassLoader())));
    return instance;
}
 
开发者ID:aschattney,项目名称:dagger-test-example,代码行数:17,代码来源:List.java

示例7: writeToParcel

import android.os.Parcel; //导入依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeLong(id);
    dest.writeString(mimeType);
    dest.writeParcelable(uri, 0);
    dest.writeLong(size);
    dest.writeLong(duration);
}
 
开发者ID:zhihu,项目名称:Matisse,代码行数:9,代码来源:Item.java

示例8: createFromParcel

import android.os.Parcel; //导入依赖的package包/类
@Override
public AlbumItem createFromParcel(Parcel parcel) {
    switch (parcel.readInt()) {
        case VIDEO:
            return new Video(parcel);
        case GIF:
            return new Gif(parcel);
        case RAW:
            return new RAWImage(parcel);
        default:
            return new Photo(parcel);
    }
}
 
开发者ID:kollerlukas,项目名称:Camera-Roll-Android-App,代码行数:14,代码来源:AlbumItem.java

示例9: isReadyRemote

import android.os.Parcel; //导入依赖的package包/类
/**
 * 检查所有的服务是否已经就位(已经添加到{@link ServiceManagerThread})
 * @return
 */
private boolean isReadyRemote(){
	Parcel data = Parcel.obtain();
	Parcel reply = Parcel.obtain();
	try {
		mRemoteServiceManager.transact(ServiceContext.READY_REMOTE, data, reply, 0);
		int result = reply.readInt();
		
		if(result == ServiceContext.SUCCESS) {
			
			log("remote service manager ready");
			
			return true;
		}
		
		log("remote service manager not ready");
		
		return false;
	} catch (RemoteException e) {
		e.printStackTrace();
		log("getService exception");
		return false;
	} finally {
		data.recycle();
		reply.recycle();
	}
}
 
开发者ID:devyok,项目名称:DroidIPC,代码行数:31,代码来源:ServiceManagerImpl.java

示例10: DataBean

import android.os.Parcel; //导入依赖的package包/类
protected DataBean(Parcel in)
{

    this.roomStatus = in.readInt();
    this.liveStatus = in.readInt();
    this.url = in.readString();
    this.title = in.readString();
    this.cover = in.readString();
    this.online = in.readInt();
    this.roomid = in.readInt();
}
 
开发者ID:WeDevelopTeam,项目名称:HeroVideo-master,代码行数:12,代码来源:UserLiveRoomStatusInfo.java

示例11: writeToParcel

import android.os.Parcel; //导入依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.key);
    dest.writeString(this.value);
    dest.writeString(this.oldValue);
    dest.writeInt(this.selectionStart);
    dest.writeInt(this.selectionEnd);
    dest.writeByte(this.isFoucused ? (byte) 1 : (byte) 0);
}
 
开发者ID:nekocode,项目名称:Hubs,代码行数:10,代码来源:PropertyVO.java

示例12: SavedState

import android.os.Parcel; //导入依赖的package包/类
/**
 * Called from {@link #CREATOR} to create an instance of SavedState form the given parcel
 * <var>source</var>.
 *
 * @param source Parcel with data for the new instance.
 */
protected SavedState(@NonNull Parcel source) {
	super(source);
	this.dateVisible = source.readLong();
	this.dateSelected = (Long) source.readValue(Long.class.getClassLoader());
	this.selectedDayMonthPosition = source.readInt();
	this.locale = (Locale) source.readSerializable();
	this.adapterState = source.readParcelable(UiConfig.class.getClassLoader());
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:15,代码来源:CalendarView.java

示例13: readFromParcel

import android.os.Parcel; //导入依赖的package包/类
private void readFromParcel(Parcel in) {
    if (in.readInt() == 1) {
        mDevice = BluetoothLeDevice.CREATOR.createFromParcel(in);
    }
    if (in.readInt() == 1) {
        mScanRecord = ScanRecordCompat.parseFromBytes(in.createByteArray());
    }
    mRssi = in.readInt();
    mTimestampNanos = in.readLong();
}
 
开发者ID:Twelvelines,项目名称:AndroidMuseumBleManager,代码行数:11,代码来源:ScanResultCompat.java

示例14: writeToParcel

import android.os.Parcel; //导入依赖的package包/类
@Override
public void writeToParcel(Parcel parcel, int i) {
    parcel.writeString(id);
    parcel.writeString(name);
    parcel.writeString(description);
    parcel.writeString(status.name());
    parcel.writeLong(publishedAt != null ? publishedAt.getTime() : -1L);
    parcel.writeInt(enabledCount);
    parcel.writeLong(lastRunAt != null ? lastRunAt.getTime() : -1L);
    parcel.writeString(url);
    parcel.writeString(embeddedUrl);
    parcel.writeTypedList(services);
}
 
开发者ID:IFTTT,项目名称:IFTTTSDK-Android,代码行数:14,代码来源:Applet.java

示例15: WheelSavedState

import android.os.Parcel; //导入依赖的package包/类
private WheelSavedState(Parcel in) {
    super(in);
    this.mProgress = in.readFloat();
    this.mTargetProgress = in.readFloat();
    this.isSpinning = in.readByte() != 0;
    this.spinSpeed = in.readFloat();
    this.barWidth = in.readInt();
    this.barColor = in.readInt();
    this.rimWidth = in.readInt();
    this.rimColor = in.readInt();
    this.circleRadius = in.readInt();
    this.linearProgress = in.readByte() != 0;
    this.fillRadius = in.readByte() != 0;
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:15,代码来源:ProgressWheel.java


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