why Context context = View.getRootView.getContext(); won't work? : i don't know how that code work. What's wrong with that ? Why its not work ? How i can replace it ?

The android studio said that cannot resolve symbol getRootView.

`@Override
    public void onClick(View v) {


        Context context = View.getRootView.getContext();

        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        final View formElementsView = inflater.inflate(R.layout.activity_add_menu,null,false);

        final EditText menu_id = (EditText) formElementsView.findViewById(R.id.ed1);
        final EditText menu_name = (EditText) formElementsView.findViewById(R.id.ed2);
        final EditText menu_price = (EditText) formElementsView.findViewById(R.id.ed3);
        final EditText menu_desc = (EditText) formElementsView.findViewById(R.id.ed4);

        new AlertDialog.Builder(context)
                .setView(formElementsView)
                .setTitle("Create Menu")
                .setPositiveButton("Add",
                        new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                dialog.cancel();
                            }
                        }).show();
    }`