【发布时间】:2018-04-04 00:37:45
【问题描述】:
我没有更新我的条目,在我尝试更新之前,我使用 client.entries().async().unPublish(entry) 取消发布条目,它可以工作,但是当我尝试使用下面的代码更新时,我收到以下消息:@987654322 @
我做错了什么?
final CMAClient client =
new CMAClient
.Builder()
.setAccessToken(contentfulConnection.getCMA_TOKEN())
.build();
final CMASystem sys = new CMASystem();
sys.setId(entryID).setVersion(CurrentVersion);
CMAEntry entry;
entry.setField("name", "en-US", "TEST").setSystem(sys);
entry.setSpaceId(SPACE_ID);
entry.setID("entryID");
client.entries().async().update(entry, new CMACallback<CMAEntry>() {
@Override protected void onSuccess(CMAEntry entry) {
// Successfully created a new entry.
new AlertDialog.Builder(ctx).setTitle("Contentful")
.setMessage("Creation of an entry was successful." +"\n\nResult:
" +
entry).show();
} }
@Override protected void onFailure(RuntimeException exception) {
// An error occurred! Inform the user.
new AlertDialog.Builder(ctx)
.setTitle("Contentful Error")
.setMessage("Could not create an entry." +
"\n\nReason: " + exception.toString())
.show();
System.out.println(exception.toString());
super.onFailure(exception);
}
}
);
【问题讨论】:
标签: android contentful