Error:(31, 55) 错误: 不兼容的类型: MyFragment5无法转换为Fragment
send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String text = editText.getText().toString();
MyFragment5 fragment5 = new MyFragment5();
Bundle bundle = new Bundle();
bundle.putString("name", text);
fragment5.setArguments(bundle);
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.layout1, fragment5, "fragment5555");
fragmentTransaction.commit();
Toast.makeText(Main4Activity.this,"向Fragment发送数据"+text,Toast.LENGTH_SHORT).show();
}
});
请问是怎么回事