beginTransaction.add報(bào)錯(cuò)
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();
網(wǎng)上說(shuō)需要導(dǎo)入V4的包,可是我確實(shí)導(dǎo)入V4包了
The method add(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SecondFragment, String)
這個(gè)是add的錯(cuò)誤信息,整不明白了,求解
2016-04-20
把secondFragment代碼貼出來(lái)看下
2015-12-15
你這個(gè)肯定是有問(wèn)題的。