Code example for DialogFragment

import static; 
import static; 
import static; 
public class SherlockDialogFragment extends DialogFragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener {
    private SherlockFragmentActivity mActivity;
    public SherlockFragmentActivity getSherlockActivity() { 
        return mActivity;
    public void onAttach(Activity activity) {
        if (!(activity instanceof SherlockFragmentActivity)) {
            throw new IllegalStateException(getClass().getSimpleName() + " must be attached to a SherlockFragmentActivity.");
        mActivity = (SherlockFragmentActivity)activity;
Contextual code suggestions in your IDE  Get Codota for Java