将参数从Activity传递到Fragment 从Activity中传递参数: Bundle bundle = new Bundle(); bundle.putInt("color", Color.RED); f.setArguments(bundle); 在Fragment中获取参数: Bundle bundle = this.getArguments(); int color = bundle.getInt("color");