Fragment

Replace fragment with another fragment

 FragmentManager fm = getSupportFragmentManager();
 FragmentTransaction ft = fm.beginTransaction();
 ft.replace(R.id.content, fragment, TAG);
 ft.addToBackStack(TAG);
 ft.commit();

Passing data between Fragments in the same Activity

Fragment A:

Bundle b = new Bundle();
b.putString("Key", "YourValue");
b.putInt("YourKey", 1);

FragmentB fragB = new FragmentB();
fragB.setArguments(b); 
getFragmentManager().beginTransaction().replace(R.id.your_container, fragB);

Fragment B:

Bundle b = this.getArguments();
if(b != null){
   int i = b.getInt("YourKey");
   String s =b.getString("Key");
}

Nhận xét

Bài đăng phổ biến từ blog này

Hướng dẫn cài đặt NAS Buffalo

Phần 3. Cài đặt Mediatomb cho Nas buffalo

Cách thêm file .sqlite hay .db vào project android trong android studio.