title: Android : want to access to a textview in a viewholder in my mainactivity
body: <p>I am so sorry for my bad English, but here is my problem : </p>
  
  <p>I use a  custom ListView  like ArrayAdapter and I create my ArrayAdapter as a intern class in my main Activity like that :  </p>
  
  <pre><code>    /*This is my Main Activity*/
      public class  KhassaideActivity extends Activity {
  
      ViewHolder holder;
      KhassaideAdapterbi listadapter ;
      ListView l ; 
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
        l= (ListView) findViewById(R.id.listDieuzbou);
        listadapter = new KhassaideAdapterbi(this, R.layout.affichage_khassaide, rowItems);
        l.setAdapter(listadapter);
      }
  
      /*This is my intern class ArrayAdapter*/
      private class KhassaideAdapterbi  extends ArrayAdapter&lt;RowItem&gt;{
  
      Context context;
      public KhassaideAdapterbi(Context context, int resourceId,
              List&lt;RowItem&gt; items) {
  
          super(context, resourceId, items);
          this.context = context;
      }
  
      public class ViewHolder {
      ImageView imageView;
      TextView trad;
      TextView trans;
      TextView number;
  }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
  
          RowItem rowItem = getItem(position);
  
          LayoutInflater mInflater = (LayoutInflater) context
                  .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
  
          if (convertView == null) {
  
   holder = new ViewHolder();
              convertView = mInflater.inflate(R.layout.affichage_khassaide, null);
  
              holder.number = (TextView) convertView.findViewById(R.id.number);
              holder.trad = (TextView) convertView.findViewById(R.id.traduction);
              holder.trans = (TextView) convertView.findViewById(R.id.transcription);
              holder.imageView = (ImageView) convertView.findViewById(R.id.arabe);
              convertView.setTag(holder);
          }
          else
              holder = (ViewHolder) convertView.getTag();
  
          holder.trad.setText(rowItem.getTitle());
          holder.trans.setText(rowItem.getDesc());
          holder.imageView.setImageResource(rowItem.getImageId());
          holder.number.setText(rowItem.getNumber());
          return convertView;
      }
  
  
  
  }
  </code></pre>
  
  <p>So in my main Activity I want to access and share the values of the two TextView when the user click on a menu item like that :</p>
  
  <pre><code>    case R.id.action_share:
  
          Intent sendIntent = new Intent();
          sendIntent.setAction(Intent.ACTION_SEND);
          sendIntent.putExtra(Intent.EXTRA_TEXT, listadapter.holder.trad.getText());
          sendIntent.setType("text/plain");
          startActivity(Intent.createChooser(sendIntent, getResources().getText(R.string.send_to)));
  </code></pre>
  
  <p>But I get a NullPointerException at this line <strong>listadapter.holder.trad.getText()</strong></p>
  
  <p>Is anyone have a solution for that? Thank you in advance. And sorry once again for this bad english</p>