當前位置: 首頁>>代碼示例>>Java>>正文


Java Parcels.wrap方法代碼示例

本文整理匯總了Java中org.parceler.Parcels.wrap方法的典型用法代碼示例。如果您正苦於以下問題:Java Parcels.wrap方法的具體用法?Java Parcels.wrap怎麽用?Java Parcels.wrap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.parceler.Parcels的用法示例。


在下文中一共展示了Parcels.wrap方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FABPressed

import org.parceler.Parcels; //導入方法依賴的package包/類
@OnClick(R.id.fab)
public void FABPressed() {
    Intent result = new Intent();
    Trip aTrip = new Trip();
    aTrip.name = jname.getText().toString();
    aTrip.location = location.getText().toString();
    DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
    aTrip.startDate = fmt.print(startDate);
    aTrip.endDate = fmt.print(endDate);
    // add more code to initialize the rest of the fields
    Parcelable parcel = Parcels.wrap(aTrip);
    result.putExtra("TRIP", parcel);
    setResult(RESULT_OK, result);
    finish();
}
 
開發者ID:gvsucis,項目名稱:mobile-app-dev-book,代碼行數:16,代碼來源:NewJournalActivity.java

示例2: FABPressed

import org.parceler.Parcels; //導入方法依賴的package包/類
@OnClick(R.id.fab)
public void FABPressed() {
    Intent result = new Intent();
    currentTrip.name = jname.getText().toString();
    DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
    currentTrip.startDate = fmt.print(startDate);
    currentTrip.endDate = fmt.print(endDate);
    // add more code to initialize the rest of the fields
    Parcelable parcel = Parcels.wrap(currentTrip);
    result.putExtra("TRIP", parcel);
    setResult(RESULT_OK, result);
    finish();
}
 
開發者ID:gvsucis,項目名稱:mobile-app-dev-book,代碼行數:14,代碼來源:NewJournalActivity.java

示例3: FABPressed

import org.parceler.Parcels; //導入方法依賴的package包/類
@OnClick(R.id.fab)
public void FABPressed() {
    Intent result = new Intent();
    currentTrip.setName(jname.getText().toString());
    DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
    currentTrip.setStartDate(fmt.print(startDate));
    currentTrip.setEndDate(fmt.print(endDate));
    // add more code to initialize the rest of the fields
    Parcelable parcel = Parcels.wrap(currentTrip);
    result.putExtra("TRIP", parcel);
    setResult(RESULT_OK, result);
    finish();
}
 
開發者ID:gvsucis,項目名稱:mobile-app-dev-book,代碼行數:14,代碼來源:NewJournalActivity.java

示例4: toMediaEdit

import org.parceler.Parcels; //導入方法依賴的package包/類
private void toMediaEdit (JournalEntry model, String key) {
    Intent toEdit = new Intent(this, JournalEditActivity.class);
    Parcelable parcel = Parcels.wrap(model);
    toEdit.putExtra ("JRNL_ENTRY", parcel);
    toEdit.putExtra ("JRNL_KEY", key);
    toEdit.putExtra ("DB_REF", entriesRef.getParent().toString());
    startActivity (toEdit);
}
 
開發者ID:gvsucis,項目名稱:mobile-app-dev-book,代碼行數:9,代碼來源:JournalViewActivity.java

示例5: toMediaEdit

import org.parceler.Parcels; //導入方法依賴的package包/類
private void toMediaEdit (JournalEntry model, String key) {
    Intent toEdit = new Intent(this, JournalEditActivity.class);
    Parcelable parcel = Parcels.wrap(model);
    toEdit.putExtra ("JRNL_ENTRY", parcel);
    toEdit.putExtra ("JRNL_KEY", key);
    toEdit.putExtra ("DB_REF", entriesRef.getRef().getParent()
            .toString());
    startActivity (toEdit);
}
 
開發者ID:gvsucis,項目名稱:mobile-app-dev-book,代碼行數:10,代碼來源:JournalViewActivity.java

示例6: FABPressed

import org.parceler.Parcels; //導入方法依賴的package包/類
@OnClick(R.id.fab)
public void FABPressed() {
    Intent result = new Intent();
    currentTrip.setName(jname.getText().toString());
    DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
    currentTrip.setStartDate(fmt.print(startDate));
    currentTrip.setEndDate(fmt.print(endDate));
    if (coverPhotoUrl != null)
        currentTrip.setCoverPhotoUrl(coverPhotoUrl);
    // add more code to initialize the rest of the fields
    Parcelable parcel = Parcels.wrap(currentTrip);
    result.putExtra("TRIP", parcel);
    setResult(RESULT_OK, result);
    finish();
}
 
開發者ID:gvsucis,項目名稱:mobile-app-dev-book,代碼行數:16,代碼來源:TripEditorActivity.java

示例7: toMediaView

import org.parceler.Parcels; //導入方法依賴的package包/類
private void toMediaView (JournalEntry model) {
    Intent toView = new Intent(this, MediaViewActivity.class);
    Parcelable parcel = Parcels.wrap(model);
    toView.putExtra ("JRNL_ENTRY", parcel);
    startActivity (toView);
}
 
開發者ID:gvsucis,項目名稱:mobile-app-dev-book,代碼行數:7,代碼來源:JournalViewActivity.java


注:本文中的org.parceler.Parcels.wrap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。