How to put value in Textview from array of image
<p>i have here a code for selection of image wherein when you click image its name will be displayed in a Textview, but my problem is that, what code should i use to automatically display the image name on my second Textview whenever i select different image.
Here's my code, </p>

<pre><code>public class MaingameActivity extends Activity {
    private Gallery gallery;



    @Override
    public void onCreate(Bundle savedInstanceState) {


    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    gallery = (Gallery) findViewById(R.id.examplegallery);
    gallery.setAdapter(new AddImgAdp(this));

    gallery.setOnItemClickListener(new OnItemClickListener() {

    public void onItemClick(AdapterView parent, View v, int position, long id) {
    // Displaying the position when the gallery item in clicked


        if (position == 0) {
            Toast.makeText(MaingameActivity.this, "heart", Toast.LENGTH_SHORT).show();
            TextView selects = (TextView) findViewById(R.id.txt1);
              selects.setText("heart"); 

        }
         if (position == 1) {
            Toast.makeText(MaingameActivity.this, "lungs", Toast.LENGTH_SHORT).show();
            TextView selects = (TextView) findViewById(R.id.txt2);
              selects.setText("lungs");
        }
         if (position == 2) {
            Toast.makeText(MaingameActivity.this, "brain", Toast.LENGTH_SHORT).show();
            TextView selects = (TextView) findViewById(R.id.txt3);
              selects.setText("brain");


        }
    }
    });
    Button clear = (Button)findViewById(R.id.clear);
    clear.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            ((TextView) findViewById(R.id.txt1)).setText("");
            ((TextView) findViewById(R.id.txt2)).setText("");
            ((TextView) findViewById(R.id.txt3)).setText("");
        }
    });
    Button pause = (Button)findViewById(R.id.pause);
    pause.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v) {
            moveTaskToBack(true);
        }

    });

    }



    public class AddImgAdp extends BaseAdapter {
    int GalItemBg;
    private Context cont;

    // Adding images.
    private Integer[] Imgid = {
    R.drawable.abdomen, R.drawable.bladder, R.drawable.kidney, R.drawable.largeintestine, R.drawable.liver, R.drawable.lungs, R.drawable.stomach
    };

    public AddImgAdp(Context c) {
    cont = c;
    TypedArray typArray = obtainStyledAttributes(R.styleable.BodyPartsGame);
    GalItemBg = typArray.getResourceId(R.styleable.BodyPartsGame_android_galleryItemBackground, 0);
    typArray.recycle();
    }

    public int getCount() {
    return Imgid.length;
    }

    public Object getItem(int position) {
    return position;
    }

    public long getItemId(int position) {
    return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
    ImageView imgView = new ImageView(cont);

    imgView.setImageResource(Imgid[position]);
    // Fixing width &amp; height for image to display
    imgView.setLayoutParams(new Gallery.LayoutParams(80, 70));
    imgView.setScaleType(ImageView.ScaleType.FIT_XY);
    imgView.setBackgroundResource(GalItemBg);

    return imgView;
    }
}
</code></pre>
