title: I can't pass value from onPostExecute to another activity?
body: <p>I have bellow code and i need to pass value of <code>onPostExecute</code> to another with <code>intent</code> but it get me <code>crash</code>. below is <code>Logins.class</code> that i need to pass value of <code>onPostExecute</code> to <code>MainActivity.class</code>:</p>
  
  <pre><code>public class Logins extends Activity {
      String NAMESPACE = "http://tempuri.org/";
      String METHOD_NAME = "Login";
      String SOAP_ACTION = "http://tempuri.org/Login";
      String URL = "http://test.com/MobileWebService/Related.asmx";
      public String Webresponse = "IS NULL ?";
      @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              MyLogin task = new MyLogin();
  
              task.execute(new String[] { URL });
          }
      public String[] test(String user,String pass)
      {
          String[] stvalue = {user,pass};
          new MyLogin().execute(stvalue);
          return stvalue;
      }
  
  private class MyLogin extends AsyncTask&lt;String, String, String&gt; {
  
      @Override
      protected String doInBackground(String... urls) {
          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
          request.addProperty("username", urls[0]);
          request.addProperty("pass", urls[1]);
          request.addProperty("device", "0");
          request.addProperty("security", 128110);
  
          SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                  SoapEnvelope.VER11);
          envelope.dotNet = true;
          envelope.setAddAdornments(false);
          envelope.implicitTypes = true;
          envelope.setOutputSoapObject(request);
          HttpTransportSE conn = new HttpTransportSE(URL);
          conn.setXmlVersionTag("&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;");
          try {
              conn.call(SOAP_ACTION, envelope);
              SoapPrimitive response = (SoapPrimitive) envelope
                      .getResponse();
              Webresponse = response.toString();
              Log.i("LOG", Webresponse);
          }
          catch (Exception e) {
              e.printStackTrace();
              Log.i("xxx", e.toString());
          }
          return Webresponse;
      }
      @Override
      protected void onPostExecute(String result) {
          // someMethod(result);
          Intent intent = new Intent(Logins.this, MainActivity.class);
          intent.putExtra("EXTRA_SESSION_ID", result);
          startActivity(intent);
      }
   }
  }
  </code></pre>
  
  <p>And here is my <code>Activity.class</code> :</p>
  
  <pre><code> public class MainActivity extends Activity {
          EditText UserName;
          EditText PassWord;
          Button Login;
          String mUserName;
          String mPassWord;
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
              UserName = (EditText) findViewById(R.id.edtUserName);
              PassWord = (EditText) findViewById(R.id.edtPasswprd);
              Login = (Button) findViewById(R.id.btnLogin);
  
              Login.setOnClickListener(new OnClickListener() {
                  @Override
                  public void onClick(View arg0) {
                      mUserName = UserName.getText().toString().trim();
                      mPassWord = PassWord.getText().toString().trim();
                      if (mUserName.length() &gt; 0 &amp;&amp; mPassWord.length() &gt; 0) {
  
                          Logins lt = new Logins();
                          lt.test(mUserName, mPassWord);
  
  ---I need get value from here---&gt;Bundle bundle = getIntent().getExtras();---BUT CRASH----
                          String uId = bundle.getString("EXTRA_SESSION_ID"); 
                          Log.i("OK", uId);
      } else {
                          Toast.makeText(
                                  G.context,
                                  G.context.getResources().getString(
                                          R.string.btn_LoginError), Toast.LENGTH_LONG)
                                  .show();
                      }
                  }
              });
  
  
          }
      }
  </code></pre>
  
  <p>My <code>LogCat</code> is :</p>
  
  <pre><code>AndroidRuntime
  at com.test.MainActivity$1.onClick(MainActivity.java:53)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/JNXuf.png" alt="enter image description here"></p>