How to get character from number of buttons that buttons added in GridView using Tag and position in Android
<p>Buttons added in GridView programmatically the total number of buttons depend on word length. Each button contains a letter of word, i want to get that letter when click the button using tag,
how can i get?
here is the code:</p>

<pre><code>public View getView(final int position, View convertView, ViewGroup arg2) {

View v = convertView;
    if (v == null) 
    {  
         LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         v = vi.inflate(R.layout.buttonlist, null);
    } 

    final Button btn= (Button)v.findViewById(R.id.letterbtn);
    btn.setText(word[position]+"");
    btn.setOnClickListener(new OnClickListener(){
        public void onClick(View v) 
        {
            btn.setTag(btn);
            Object tag=btn.getTag();

            btn.setVisibility(View.GONE);
            function(position); 
        }

    });
</code></pre>
