Q: How do i get id of autocomplete textview out of two autocomplete textview on item selected from its list? This is mysearchActivity.java
    package com.example.mumbailocal;

import android.support.v7.app.ActionBarActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Toast;

public class SearchTrainActivity extends ActionBarActivity implements OnItemClickListener {
    private AutoCompleteTextView actv1;
    private AutoCompleteTextView actv2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {


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

        actv1=(AutoCompleteTextView) findViewById(R.id.autoCompleteTextView1);
        actv2=(AutoCompleteTextView) findViewById(R.id.autoCompleteTextView2);
        String[] stations=getResources().getStringArray(R.array.stations_list);
        ArrayAdapter<String> adapter1=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,stations);


        actv1.setAdapter(adapter1);
        actv2.setAdapter(adapter1);

        actv1.setOnItemClickListener(this);
        actv2.setOnItemClickListener(this);



    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.search_train, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }


    @Override
    public void onItemClick(AdapterView<?> parent, View v, int pos, long rowindex) {
         String selection = (String)parent.getItemAtPosition(pos);

         Log.i("id is "+v.getId(), selection, null);
         Toast.makeText(getApplicationContext(),"parent "+parent.getId()+"view "+v.getId()+" row "+rowindex, Toast.LENGTH_LONG).show();
        // TODO Auto-generated method stub


    }
}

I have two AutocompleteTextviews first is From & other is To.
Now i have to validate both fields by getting values entered in both text .ie source and destination!!
But i m not able to get id .ie source or destination which textview is selected currently!!
How to acheive this ?!! 

A: onClick suggestes, that the "long rowindex" is the id of the selected item.
