title: Android Custom Array Adapter to read CSV files
body: <p>I am a newbie to android application development. I am currently working on a project which deals with the import of csv files which consists of only one column and many rows , onto my android project. I am able to read those csv files onto my project using csv adapters and array adapters and I didn't use any string arrays. Only used csvadapter and array adapters. Now in the list view where all the csv datas are presented, I am having a concern where when clicked on an item in the list I wanted to toast the item name. I tried out all possible combinations but it displays me only a toast saying string@somerandomvalue. Request someone to help me on this. Thanks in advance.</p>
  
  <p>The following is my csvadapter class. The .csv files are in placed in assets folder.. </p>
  
  <pre><code>public class CSVAdapter extends ArrayAdapter&lt;clock&gt;{
      Context ctx;
      public CSVAdapter(Context context,int textViewResourceId)
      {
          super (context,textViewResourceId);
          this.ctx = context;
          loadArrayFromFile();
      }
      @Override
  public View getView(final int pos,View convertView,final ViewGroup parent){
      TextView mView=(TextView)convertView;
      if(null == mView){
          mView = new TextView(parent.getContext());
          mView.setTextSize(28);
      }
      mView.setText(getItem(pos).getTime());
      return mView;
  }
  </code></pre>
  
  <p>And this is my class to read that .csv array into GUI</p>
  
  <pre><code>public class mrvtoparanur extends Activity {
  CSVAdapter mAdapter;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.mrvtoparanur);
        final ListView mList = (ListView)findViewById(R.id.mrvtoparanurlist);
        mAdapter=new CSVAdapter(this,-1);
        mList.setAdapter(mAdapter);   
        mList.setOnItemClickListener(new OnItemClickListener()
        {
            @Override
          public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                  long arg3) {
              Toast.makeText(getApplicationContext(), "you selected item number"+arg2, Toast.LENGTH_SHORT).show();
  
            }});
  }
  </code></pre>
  
  <p><strong>Request someone to help on the Toast in the second class java file. In the msg "YOU SELECTED ITEM NUMBER" the arg2 gives the item id.. In a similar way i want to display or toast the item name instead of item ID. Pls help me someone</strong></p>
  
  <p>This is clock.java file... Please refer below.</p>
  
  <pre><code> public class clock {
      private String t;
  
      public String getTime() {
          return t;
      }
  
      public void setTime(String t) {
          this.t = t;
      }
  }
  </code></pre>