我正在尝试从基于app-engine构建的移动后端启动项目(https://cloud.google.com/developers/articles/mobile-backend-starter-api-reference)中检索单个条目。
我知道我想要的实体的ID,但无法弄清楚为什么我的代码会提供nullpointerexception
if(this.getIntent().hasExtra("rideId")){
updateRide = this.getIntent().getExtras().getString("rideId");
Log.e(TAG, updateRide);
CloudCallbackHandler<CloudEntity> handler = new CloudCallbackHandler<CloudEntity>() {
@Override
public void onComplete(final CloudEntity result) {
// do something helpful
}
@Override
public void onError(final IOException exception) {
handleEndpointException(exception);
}
};
newPost.setId(updateRide);
mProcessingFragment.getCloudBackend().get(newPost, handler); // this line gives the exception
}
我已确认意图包正在发送正确的ID字符串