我是新学习者
当我从我买的书中复制练习代码时,它告诉我 putExtra 没有为 Bundle 定义
我可以改用 putLong 吗?或者是什么?
public class ReminderEditActivity extends FragmentActivity {
@Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.reminder_edit_activity);
Fragment fragment = getSupportFragmentManager().findFragmentByTag(ReminderEditFragment.DEFAULT_EDIT_FRAGMENT_TAG);
if (fragment == null) {
fragment = new ReminderEditFragment();
Bundle args = new Bundle();
args.putExtra(ReminderProvider.COLUMN_ROWID, getIntent().getLongExtra(ReminderProvider.COLUMN_ROWID, 0L));
fragment.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager ().beginTransaction();
transaction.add (R.id.edit_container, fragment, ReminderEditFragment.DEFAULT_EDIT_FRAGMENT_TAG);
transaction.commit();
}
}
}