我有一个事件应该在我创建的新片段中更改文本视图的大小,该文本视图是在我的新片段和旧片段共享的相对布局中创建的:
Fragment1 rightFragment;
rightFragment = new Fragment1();
Bundle args = new Bundle();
args.putInt("args", arguments);
rightFragment.setArguments(args);
android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager()
.beginTransaction();
transaction.replace(R.id.fragment_container, rightFragment);
transaction.addToBackStack(null);
transaction.commit();
TextView textView = (TextView) findViewById(R.id.text);
textView.setTextSize(settings.getFloat("size", 24.0f));
当我在我的活动中执行此代码时,我旧的相对布局中的 textView 被更改,而不是新的。如何使我的新布局中的 textView 工作?