Back to project page example-lock-app.
The source code is released under:
Apache License
If you think the Android project example-lock-app listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.lockapp.fragments.others; /* ww w.j av a 2 s.c om*/ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.lockapp.R; import com.lockapp.fragments.FragmentUtils; import com.lockapp.fragments.PromptUtils; public class PromptFragment extends Fragment { FragmentUtils utils = new PromptUtils() { @Override public void swapFragment() { if (getActivity() != null) { Fragment promptFragment = new ControlsFragment(); getFragmentManager().beginTransaction().replace(R.id.content, promptFragment) .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE) .commit(); } } }; @Override public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedState) { return utils.onCreateView(getActivity(), inflater, parent, savedState); } @Override public void onResume() { super.onResume(); utils.onResume(); } @Override public void onPause() { utils.onPause(); super.onPause(); } }