Code layout in the datetime picker does not appear

99 views Asked by At

Why when dealing with DateTime picker Does not move to layout ​​found by DateTime picker

Output implementation

This is the class where the existing Aldata Time On Baker :

public class Popactivity extends DialogFragment implements View.OnClickListener {
    View view;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.pop, container, false);

        return view;
    }


    @Override
    public void onClick(View v) {

    }


    public void show(FragmentTransaction manager, Object o) {}
}

This is the class MainActivity

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);



 android.support.v4.app.FragmentTransaction manager =getSupportFragmentManager().beginTransaction();
        Popactivity ppp=new Popactivity();
        ppp.show(manager,null);

pop activity

1

There are 1 answers

4
OneCricketeer On

This method does not need to exist.

public void show(FragmentTransaction manager, Object o) {}

At least, you shouldn't need to override / overload the existing show(FragmentTransaction transaction, String tag) method.

If you delete it, there should be no errors.

This code, for example, compiles fine.

public class MainActivity extends android.support.v7.app.AppCompatActivity {

     public static class PopUpFragment extends android.support.v4.app.DialogFragment {

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.pop, container, false);
            return rootView;
        }
    }

    @Override
    protected void onCreate(Bundle b) {
        super.onCreate(b);
        setContentView(R.layout.activity_main);

        PopUpFragment pop = new PopUpFragment();
        pop.show(getSupportFragmentManager(), null);

    }
}