在我关注文本视图的android项目中,我正在替换一个片段,但是我想在创建它时如何做到这一点。 我可以使用输入管理器吗?
signUpPhoneNUmber.setOnFocusChangeListener(new OnFocusChangeListener(){
@Override
public void onFocusChange(View v, boolean hasFocus) {if(hasFocus) {
//Insert the fragment by replacing any existing fragment
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction. replace(R.id.RelativeLayout01,cardContactList);
transaction.addToBackStack(null);
transaction.commit();
}
}
});