مدیریت کاربران مشترک
بروز خطا
امتیازات دریافتی
FragmentTransaction
اسنیپ
length : 0
words : 0
lines : 0
MyFragmentB fragmentB = new MyFragmentB();
//To replace Fragment:
getFragmentManager().beginTransaction()
.replace(R.id.container, fragmentB)
.addToBackStack(MyFragmentA.class.getSimpleName())
.commit();
//To Add Fragment:
getFragmentManager().beginTransaction()
.add(R.id.container, fragmentB)
.addToBackStack(MyFragmentA.class.getSimpleName())
.commit();
//To pass Bundle to Fragment(From Activity to Fragment OR Fragment to Fragment) :
Bundle bundle = new Bundle();
bundle.putString("String", "String text");
bundle.putInt("Integer", Integer value);
bundle.putDouble("Double", Double value);
bundle.putBoolean("Boolean", Boolean value);
...
fragmentB.setArguments(bundle);
//To get Bundle in Fragment:
getArguments().getString("String");//String text
getArguments().getInt("Integer");//Integer value
getArguments().getDouble("Double");//Double value
getArguments().getBoolean("Boolean");//Boolean value
حقوق مادی و معنوی تمامی آثار و محتویات عرضه شده در این وب سایت، متعلق به شرکت «فوژان رسانه ایده هوشمند» و پدیدآورندگان آثار بوده و حسب مورد دارای مجوز از مراجع ذی صلاح می باشد.
کپی برداری از مطالب این سایت حتی با ذکر منبع جایز نیست.