beginTransaction.add报错
public void onClick(View arg0) { Intent intent=new Intent(Shopping_cart.this,MainActivity.class); startActivity(intent); number=edittext.getText()+""; Bundle bundle=new Bundle(); bundle.putString("name", name); bundle.putString("monney", monney); bundle.putString("number", number); SecondFragment secondfragment=new SecondFragment(); secondfragment.setArguments(bundle); android.app.FragmentManager fragmentManager=getFragmentManager(); android.app.FragmentTransaction beginTransaction=fragmentManager.beginTransaction(); beginTransaction.add(R.id.relativelayout,secondfragment,"secondfragment"); beginTransaction.commit();
网上说需要导入V4的包,可是我确实导入V4包了
The method add(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SecondFragment, String)
这个是add的错误信息,整不明白了,求解