title: setText() on a textView coming from a subClass in Android
body: <p>First I'm a beginner in Android development !
  In my app, I include a library that help me to create card UI.
  In this library, you have a basic layout where there is a Title, a description and a thumbnails but you can create and inflate a custom layout for having a better filled card.</p>
  
  <p>What I want to do is to change the text of a TextView coming from the sub Class, which is linked to the sub Layout. But everytime I try to invoke the setText method from the MainActivity, I get a NullPointerexception.</p>
  
  <p>There is my sub Class:</p>
  
  <pre><code>    import it.gmariotti.cardslib.library.internal.Card;
      import it.gmariotti.cardslib.library.internal.Card.OnCardClickListener;
      import android.content.Context;
      import android.view.View;
      import android.view.ViewGroup;
      import android.widget.TextView;
      import android.widget.Toast;
  
      public class CustomCardAccueil extends Card{
  
  
  
  
      public TextView TitreExtensionAccueil;
      public TextView DateSortieAccueil;
      public TextView NombreCarteAccueil;
      public TextView DescriptionExtensionAccueil;
      public TextView RareteCarteAccueil;
      public TextView DetailExtensionAccueil;
  
  
      public CustomCardAccueil(Context context) {
          this(context, R.layout.accueil_mycard_inner_content);
      }
  
      /**
       *
       * @param context
       * @param innerLayout
       */
      public CustomCardAccueil(Context context, int innerLayout) {
          super(context, innerLayout);
          init();
      }
  
      /**
       * Init
       */
      private void init(){
  
          //No Header
  
          //Set a OnClickListener listener
          setOnClickListener(new OnCardClickListener() {
              @Override
              public void onClick(Card card, View view) {
                  Toast.makeText(getContext(), "Click Listener card=", Toast.LENGTH_LONG).show();
              }
          });
      }
  
  
  
  
      @Override
      public void setupInnerViewElements(ViewGroup parent, View view) {
  
          TitreExtensionAccueil = (TextView) parent.findViewById(R.id.TitreExtensionAccueil);
  
  
  
      }
  
  }
  </code></pre>
  
  <p>My Layout where there is the TextView that I want to change:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
       &lt;TextView
          android:id="@+id/TitreExtensionAccueil"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerVertical="true"
          android:layout_marginLeft="20dp"
          android:layout_marginTop="20dp"
          android:textStyle="bold"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;TextView
          android:id="@+id/DateSortieAccueil"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/TitreExtensionAccueil"
          android:layout_centerVertical="true"
          android:layout_marginLeft="20dp"
          android:layout_marginTop="20dp"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;TextView
          android:id="@+id/NombreCarteAccueil"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/DateSortieAccueil"
          android:layout_centerVertical="true"
          android:layout_marginLeft="20dp"
          android:layout_marginTop="20dp"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;TextView
          android:id="@+id/DescriptionExtensionAccueil"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/NombreCarteAccueil"
          android:layout_centerVertical="true"
          android:layout_marginLeft="20dp"
          android:layout_marginTop="20dp"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;TextView
          android:id="@+id/RareteCarteAccueil"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/DescriptionExtensionAccueil"
          android:layout_centerVertical="true"
          android:layout_marginLeft="20dp"
          android:layout_marginTop="20dp"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
      &lt;TextView
          android:id="@+id/DetailExtensionAccueil"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/RareteCarteAccueil"
          android:layout_centerVertical="true"
          android:layout_marginLeft="20dp"
          android:layout_marginTop="20dp"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And there is how I try to change the content of TextView in my MainActivity, in the OnCreate:</p>
  
  <pre><code>CustomCardAccueil.TitreExtensionAccueil.setText("Test");
  </code></pre>
  
  <p>There is also the error I get in the logcat of the crash:</p>
  
  <pre><code>Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText.setText(java.lang.CharSequence)' on a null object reference
  </code></pre>
  
  <p>I don't understand the error because the object is initiated (correct me if I'm wrong).
  Also if I try to change the text from the sub class (CustomCardAccueil), it's a success, but I need to do it through my MainActivity.</p>
  
  <p>Any help is appreciated, thanks in advance !</p>