title: How to get the value of a textview?
body: <p>I tried:</p>
  
  <pre><code>    TextView textView1 = (TextView) getActivity().findViewById(R.id.date);
      String s1 = textView1.getText().toString();
  </code></pre>
  
  <p>but on the second line falls error:</p>
  
  <pre><code>java.lang.NullPointerException
  at com.ancort.cryptophone.guitest.CAMyTest.testMail_000(CAMyTest.java:94)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
  at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
  at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:192)
  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:177)
  at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1619)
  </code></pre>
  
  <p>Also, I tried</p>
  
  <pre><code>    TextView textView1 = (TextView)findViewByID(R.id.date);
      String s = textView1.getText().toString();
  </code></pre>
  
  <p>But in this case "findViewByID" red highlights with error"cannot resolve method findViewById(int)". I understandthat the class must be extends from Activity class, but my class extends from another class. How to get the value of a textview?</p>