当前位置: 首页>>代码示例>>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;未经允许,请勿转载。