title: NullPointerException: when set TextView value
body: <p>I have a layout file(<code>layout/my_test.xml</code>):</p>
  
  <p>
  </p>
  
  <pre><code>&lt;TextView
        android:id="@+id/my_title"
        android:gravity="left|center_vertical"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        /&gt;
  </code></pre>
  
  <p></p>
  
  <p>My Activity:</p>
  
  <pre><code>import android.support.v4.app.FragmentActivity;
  import android.view.View;
  import android.widget.TextView;
  
  public class MyActivity extends FragmentActivity{
  
      private View myTestView;    
      private TextView actionBarTitle;
  
      @Override
      protected void onCreate(Bundle arg0) {
         super.onCreate(arg0);
  
         myTestView = getLayoutInflater().inflate(R.layout.my_test, null);
         myTitle = (TextView) findViewById(R.id.my_title);
  
         //NullPointerException here !!
         myTitle.setText(getString(R.string.hello));
      }
  }
  </code></pre>
  
  <p>(I am sure the problem is not about the <code>res/strings.xml</code> , because the "hello" string resource has been used in other place which is fine.)</p>
  
  <p><strong>Why</strong> I got <strong>NullPointerException</strong> when I set the <code>TextView</code> content ??</p>
  
  <p>The full error trace:</p>
  
  <pre><code> Caused by: java.lang.NullPointerException
  E/AndroidRuntime(17283):    at com.test.MyActivity.onCreate(MyActivity.java:21)
  E/AndroidRuntime(17283):    at com.eficode.card.CardActivity.onCreate(CarActivity.java:29)
  E/AndroidRuntime(17283):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  E/AndroidRuntime(17283):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669)
  E/AndroidRuntime(17283):    ... 11 more
  </code></pre>