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