mainActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_product_details);
long ProductId = Long.parseLong(i.getStringExtra("product_id"));
long CustomerId = 1;
int sizeId = 1; // this is where i need int value to be passed
int quantity = 201;
}
//here i am getting this id value successfully bt i want that value to be assigned to sideId int in on create method
@Override
public void onClickCheckbox(Integer id) {
Log.d(TAG, String.valueOf(id));
}
interface
public interface OnSizeClickInterface {
void onClickCheckbox(Integer id);
}
adapter
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.checkBox.setText(pList.get(position).getCode());
holder.checkBox.setOnClickListener(view -> onSizeClickInterface.onClickCheckbox(pList.get(position).getId()));
}
this is where i am passing the value everything works fine! as i mentioned i want that id value to be in on create method i hope i will get my answer soon! thanks