Search in sources :

Example 1 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project android-betterpickers by code-troopers.

the class SampleHmsUsingFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.frame_layout);
    Fragment fragment = new SampleHmsFragment();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.frame, fragment);
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) SampleHmsFragment(com.codetroopers.betterpickers.sample.fragment.SampleHmsFragment) Fragment(android.support.v4.app.Fragment) SampleHmsFragment(com.codetroopers.betterpickers.sample.fragment.SampleHmsFragment)

Example 2 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project android-betterpickers by code-troopers.

the class TimePickerBuilder method show.

/**
     * Instantiate and show the Picker
     */
public void show() {
    if (manager == null || styleResId == null) {
        Log.e("TimePickerBuilder", "setFragmentManager() and setStyleResId() must be called.");
        return;
    }
    FragmentTransaction ft = manager.beginTransaction();
    final Fragment prev = manager.findFragmentByTag("time_dialog");
    if (prev != null) {
        ft.remove(prev).commit();
        ft = manager.beginTransaction();
    }
    ft.addToBackStack(null);
    final TimePickerDialogFragment fragment = TimePickerDialogFragment.newInstance(mReference, styleResId);
    if (targetFragment != null) {
        fragment.setTargetFragment(targetFragment, 0);
    }
    fragment.setTimePickerDialogHandlers(mTimePickerDialogHandlers);
    fragment.setOnDismissListener(mOnDismissListener);
    fragment.show(ft, "time_dialog");
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) Fragment(android.support.v4.app.Fragment)

Example 3 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project android-betterpickers by code-troopers.

the class SampleDateUsingFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.frame_layout);
    Fragment fragment = new SampleDateFragment();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.frame, fragment);
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) SampleDateFragment(com.codetroopers.betterpickers.sample.fragment.SampleDateFragment) SampleDateFragment(com.codetroopers.betterpickers.sample.fragment.SampleDateFragment) Fragment(android.support.v4.app.Fragment)

Example 4 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project TakePhoto by crazycodeboy.

the class SimpleFragmentActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_fragment_layout);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.fragment1, fragment = new SimpleFragment(), "test");
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 5 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project photo-picker-plus-android by chute.

the class FragmentUtil method replaceContentWithEmptyFragment.

public static void replaceContentWithEmptyFragment(FragmentActivity activity) {
    FragmentTransaction fragmentTransaction = activity.getSupportFragmentManager().beginTransaction();
    fragmentTransaction.replace(R.id.gcFragments, FragmentEmpty.newInstance(), TAG_FRAGMENT_EMPTY);
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Aggregations

FragmentTransaction (android.support.v4.app.FragmentTransaction)367 Fragment (android.support.v4.app.Fragment)132 FragmentManager (android.support.v4.app.FragmentManager)73 DialogFragment (android.support.v4.app.DialogFragment)26 FragmentActivity (android.support.v4.app.FragmentActivity)25 View (android.view.View)23 FragmentTransaction (android.app.FragmentTransaction)18 Intent (android.content.Intent)18 TextView (android.widget.TextView)18 Button (android.widget.Button)17 Bundle (android.os.Bundle)16 OnClickListener (android.view.View.OnClickListener)16 SherlockFragment (com.actionbarsherlock.app.SherlockFragment)12 TargetApi (android.annotation.TargetApi)6 ActionBar (android.support.v7.app.ActionBar)6 AppCompatActivity (android.support.v7.app.AppCompatActivity)6 Toolbar (android.support.v7.widget.Toolbar)6 FriendsTimeLineFragment (org.qii.weiciyuan.ui.maintimeline.FriendsTimeLineFragment)6 UserInfoFragment (org.qii.weiciyuan.ui.userinfo.UserInfoFragment)6 Transition (android.transition.Transition)5