title: NullPointerException in my program Android
body: <p>I getting error in my code when I press in button. Below gives my code in Java and error with logcat. How fix this bug? Thanks.</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
      TextView example_text, result;
      EditText enter_data;
      Button send_data;
  
      private static final int ACTIVITY_REQUEST_CODE = 1;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          example_text = (TextView) findViewById(R.id.tv_glowna_aktywnosc);
          result = (TextView) findViewById(R.id.tv_wynik_dzialania);
          enter_data = (EditText) findViewById(R.id.etv_wprowadz_druga_liczbe);
          send_data = (Button) findViewById(R.id.btn_przeslij_dane);
  
          send_data.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  SendDataAndWaitOnResult();
  
  
              }
          });
      }
  
      protected void SendDataAndWaitOnResult() {
          Intent intent = new Intent(this, DrugaActivity.class);
          intent.putExtra("firstNumber", enter_data.getText().toString()); // &lt;-- ERROR NUllPointerException
          startActivityForResult(intent, ACTIVITY_REQUEST_CODE);
      }
  
     // ....
  }
  </code></pre>
  
  <p>EDIT:
  Code logcat</p>
  
  <pre><code>04-17 18:27:59.512  30558-30558/kamiszczu.blogspot.com.przyklad_3 E/AndroidRuntime﹕ FATAL EXCEPTION: main
      java.lang.NullPointerException
              at kamiszczu.blogspot.com.przyklad_3.MainActivity.WyslijDaneICzekajNaWynik(MainActivity.java:46)
              at kamiszczu.blogspot.com.przyklad_3.MainActivity$1.onClick(MainActivity.java:37)
              at android.view.View.performClick(View.java:4209)
              at android.view.View$PerformClick.run(View.java:17431)
              at android.os.Handler.handleCallback(Handler.java:725)
              at android.os.Handler.dispatchMessage(Handler.java:92)
              at android.os.Looper.loop(Looper.java:153)
              at android.app.ActivityThread.main(ActivityThread.java:5297)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:511)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
              at dalvik.system.NativeStart.main(Native Method)
  04-17 18:27:59.628      521-540/? E/AppErrorDialog﹕ Failed to get ILowStorageHandle instance
  04-17 18:28:59.559      521-563/? E/InputDispatcher﹕ channel '423b4b28 kamiszczu.blogspot.com.przyklad_3/kamiszczu.blogspot.com.przyklad_3.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
  04-17 18:29:46.020     521-4294/? E/DhcpStateMachine﹕ Error! Failed to handle a DHCP renewal on wlan0
  04-17 18:29:48.674  31151-31624/? E/NativeCrypto﹕ ssl=0x627b70f8 cert_verify_callback x509_store_ctx=0x6235cab0 arg=0x0
  04-17 18:29:48.675  31151-31624/? E/NativeCrypto﹕ ssl=0x627b70f8 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA
  04-17 18:29:50.547      521-537/? E/FWKEXT﹕ Enter GetCurrentOP
  </code></pre>
  
  <p>In file Manifest.xml I have DrugaActivity. Error is in code Java.</p>