Android studio - how can I add a textview to a linear layout with an onlick listener : how can I add a textview to a linear layout with a onlick button listener? At the moment, the button onclick listener will produce a textview but i don't like it because it looks messy and unorganised

I tried doing this: 
varlinear.addView(varkebabTotal);
but it caused an error. 

I have looked at other examples but they didn't explain how it will work with an onlick listener.

Below I added the code for what happens when the button is clicked

    varKebab.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    String name = "Kebab Wrap";
                    if (menu.containsKey(name)) {
                        kebabquantity = list.get(name);
    
                        if (kebabquantity == null) {
                            kebabquantity = 0;
                        }
                        kebabquantity++;
                        list.put(name, kebabquantity);
    
                        //kebab qty calc
                         double kebabTotal = kebabquantity * menu.get(name);
    
                        overallTotal = overallTotal + menu.get(name);
                        varkebabTotal.setText(String.format("%s %s @ £%s = £%.2f", kebabquantity.toString(), name, menu.get(name), kebabTotal));
                        varTotalPrice.setText(String.format("Total = £%.2f", overallTotal));
    
                        varlinear.addView(varkebabTotal); // this line caused an error
    
    
                    }
        
                }
            });

What I need is for the textview to be added onto a linear layout where it will look organised and nice. Whenever the button is clicked again, it should replace the old textview and update it again