how to access adapter variable in activity in android

how to access adapter variable in activity in android

 ((Add_To_Cart_Sp) context).ItemClick("position");

In Adapter Class :-

Create Method Outside onCreate

    public void ItemClick(String position) {

        getcart(userid);

    }