我有一个内容提供商,我正在插入数据。我试图将这些数据转换为URI并将其传递给Intent。该类名为AddTaskActivity.class:
for (var i = 0; i < game_frame.length; i++) {
var obj = game_frame[i];
for (var key in obj){
console.log(key['fields']['StateOfGame']);
if (i['fields']['StateOfGame'] == 2){
do_something;
}
}
}
我在这个类中设置数据,在我的TaskDetailActivity onCreate()方法中,我试图检索它,如下所示:
private void saveItem() {
//Insert a new item
ContentValues values = new ContentValues(4);
values.put(TaskColumns.DESCRIPTION, mDescriptionView.getText().toString());
values.put(TaskColumns.IS_PRIORITY, mPrioritySelect.isChecked() ? 1 : 0);
values.put(TaskColumns.IS_COMPLETE, 0);
values.put(TaskColumns.DUE_DATE, getDateSelection());
Uri mNewUri;
mNewUri = getContentResolver().insert(DatabaseContract.CONTENT_URI, values);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(mNewUri);
TaskUpdateService.insertNewTask(this, values);
finish();
}
可能是什么问题?