I was creating a dynamic Text View and I need to know which one of those Text views was clicked by the user i read that i need to use getTag() method but it keeps return null when i try it this is my activity code in java:

```
        for(int i=0;i<size;i++){
        TextView temp = new TextView(this);
        temp.setId(i);
        temp.setId(i);
        String s = "";
        temp.setText(s);
        temp.setTextColor(Color.RED);
        mylieniarlayout.addView(temp);
        tv[i] = temp;
    }
    final TextView answertv = findViewById(R.id.answertv);
    mylieniarlayout.setOnClickListener(new View.OnClickListener() {
        @SuppressLint("SetTextI18n")
        @Override
        public void onClick(View v) {
            Toast.makeText(getBaseContext(),"ID: "+ v.getTag(), Toast.LENGTH_SHORT).show();
            answertv.setText("Clicked ID: " + v.getTag());
        }
    });

```