Intend not work in Recycleview.onclicklistener :  
This is my Adapter class i need to click the Recycleview list and go to the next page but Intend is not work in this class the app gets crashed how do i work with the intend in this ...



   package com.onebook.locationsaver;
    
    import android.app.Activity;
    import android.content.Context;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.provider.ContactsContract;
    import android.util.Log;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.AdapterView;
    import android.widget.LinearLayout;
    import android.widget.RelativeLayout;
    import android.widget.TextView;
    import android.widget.Toast;
    
    import androidx.annotation.NonNull;
    import androidx.recyclerview.widget.RecyclerView;
    import androidx.recyclerview.widget.RecyclerView.ViewHolder;
    
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.List;
    
    
    import static android.content.ContentValues.TAG;
    import static androidx.core.content.ContextCompat.startActivity;
    
    
    public class SaveListAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<SaveListAdapter.ViewHolder>  {
    Context context;
        public List<DatabseMode> databasemodelist;
        private DatabseMode databseMode;
        ArrayList<DatabseMode> newlist =new ArrayList<>();
        Context a;
    
    
    
        public SaveListAdapter(Context context, List<DatabseMode> databasemodelist) {
    
            this.databasemodelist=databasemodelist;
    
    
            for (int i = databasemodelist.size() - 1; i >= 0; i--) {
                newlist.add(databasemodelist.get(i));
                this.a=context;
            }
        }
    
        @NonNull
        @Override
        public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
            LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
            View listItem= layoutInflater.inflate(R.layout.recycle_view_icon, parent, false);
            ViewHolder VH=new ViewHolder(context,listItem) {
                @Override
                public String toString() {
                    return super.toString();
                }
            };
            return VH;
    
        }
    
    
        @Override
        public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
    
    
            databseMode= (newlist.get(position));
    
            holder.name.setText(databseMode.getname());
            holder.detail.setText(databseMode.getdetail());
    
            /*holder.layout.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Toast.makeText(SaveListAdapter.this,"Item is selected",Toast.LENGTH_LONG).show();
    *//*
                    Intent intent=new Intent(a.getApplicationContext(),LocationEdit.class);
                    intent.putExtra("potition",getItemId(position ));
                    a.startActivity(intent);*//*
    
                }
            });*/
        }
    
    
    
        @Override
        public int getItemCount() {
            return databasemodelist.size();
        }
    
    
        public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    
            public TextView name,detail;
            public LinearLayout layout;
            private Context context;
            List<DatabseMode> databasemodelist;
    
            public ViewHolder(Context context,View itemView) {
                super(itemView);
                this.name = (TextView) itemView.findViewById(R.id.textView);
                this.detail=itemView.findViewById(R.id.textview00);
                this.context=context;
                itemView.setOnClickListener(this);
                //layout= (LinearLayout) itemView;
            }
    
    
    
            @Override
            public void onClick(View v) {
                int position=getLayoutPosition();
                DatabseMode databseMode=databasemodelist.get(position);
                Intent intent=new Intent(context,LocationEdit.class);
                intent.putExtra("id",databseMode.getname());
                context.startActivity(intent);
                Toast.makeText(context,"this the text",Toast.LENGTH_SHORT).show();
            }
        }
    
    }

The above is the adapter for recycleview 


    package com.onebook.locationsaver;
    
    import android.app.Activity;
    import android.content.Context;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.EditText;
    import android.widget.LinearLayout;
    import android.widget.ListView;
    import android.widget.TextView;
    import android.widget.Toast;
    
    import androidx.annotation.Nullable;
    import androidx.appcompat.app.AppCompatActivity;
    import androidx.recyclerview.widget.LinearLayoutManager;
    import androidx.recyclerview.widget.RecyclerView;
    
    import java.util.ArrayList;
    import java.util.List;
    
    public class LocationList extends AppCompatActivity {
    
        private RecyclerView recyclerViewsavedata;
        private RecyclerView.Adapter getdataadapter;
        private List<DatabseMode> databasemodelist;
        private DatabaseHelper databaseHelper ;
        ListView listView;
        private Context context;
    
    
        @Override
        protected void onCreate(@Nullable Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.locationlist);
    
    
    
            databasemodelist =new ArrayList<>();
            databaseHelper =new DatabaseHelper(this);
    
            recyclerViewsavedata=findViewById(R.id.recyclerView);
            recyclerViewsavedata.setHasFixedSize(true);
            recyclerViewsavedata.setLayoutManager(new LinearLayoutManager(this));
    
    
            databasemodelist=databaseHelper.getAllCotacts();
    
    
            //listView.setAdapter(new Listviewadapter(LocationList.this,databasemodelist));
            getdataadapter=new SaveListAdapter((Activity) context,databasemodelist);
            recyclerViewsavedata.setAdapter(getdataadapter);
            recyclerViewsavedata.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
    
                    Toast.makeText(LocationList.this,"This item is selecton",Toast.LENGTH_SHORT).show();
                }
            });
        }
    }


The above is the Recycleview class ane one help me please i'm struggle on this for 4 days onclick in the recycle view is not working in my applilation 
