package com.xbsaykat.easy24admin.Market; import android.content.Context; import android.provider.Settings; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.squareup.picasso.Picasso; import com.xbsaykat.easy24admin.R; public class DeleteMArketingShow extends RecyclerView.ViewHolder { public DeleteMArketingShow(@NonNull View itemView) { super(itemView); } public void setDetails(final Context context, final String Name, final String Phone ,final String ID) { TextView Marketername = itemView.findViewById(R.id.marketername); TextView Marketerphone = itemView.findViewById(R.id.marketerphone); TextView MarketerID= itemView.findViewById(R.id.id); TextView Delete = itemView.findViewById(R.id.iddelete); Marketername.setText("Marketer Name : "+Name); Marketerphone.setText("Number : "+Phone); MarketerID.setText("ID : "+ID); Delete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { try { DatabaseReference AddMarketerRef = FirebaseDatabase.getInstance().getReference().child("Marketers").child(ID); AddMarketerRef.removeValue(); }catch (Exception IO){ } } }); } }