title: How to add two functions in one onClick method?
body: <p>The code below is an <code>onClick()</code> method for a Button.<br>
  It keeps giving me an error.<br>
  If I delete the <code>startActivity()</code>, then it works fine.  </p>
  
  <p>How can I use a POST method when I click the Button, and also move to another Activity?</p>
  
  <pre><code>public void onClick(View view) {
      switch (view.getId()) {
          case R.id.register:
              if (!validate())
                  Toast.makeText(getBaseContext(), "Enter user information!", Toast.LENGTH_LONG).show();
              // call AsynTask to perform network operation on separate thread
              new HttpAsyncTask().execute(herokuServer);
              startActivity(new Intent(this, FoodPreference.class));
              break;
      }
      startActivity(new Intent(Register1Activity.this, FoodPreference.class));
  }
  </code></pre>
  
  <blockquote>
    <p>THE ERROR:
        04-27 19:41:26.066    1974-1974/com.opshun_test.opshun_test E/AndroidRuntime﹕      FATAL EXCEPTION: main
            Process: com.opshun_test.opshun_test, PID: 1974
            android.content.ActivityNotFoundException: Unable to find explicit activity class {com.opshun_test.opshun_test/com.opshun_test.opshun_test.FoodPreference}; have you declared this activity in your AndroidManifest.xml?
                at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1761)
                at android.app.Instrumentation.execStartActivity(Instrumentation.java:1485)
                at android.app.Activity.startActivityForResult(Activity.java:3736)
                at android.app.Activity.startActivityForResult(Activity.java:3697)
                at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:817)
                at android.app.Activity.startActivity(Activity.java:4007)
                at android.app.Activity.startActivity(Activity.java:3975)
                at com.opshun_test.opshun_test.Register1Activity.onClick(Register1Activity.java:173)
                at android.view.View.performClick(View.java:4756)
                at android.view.View$PerformClick.run(View.java:19749)
                at android.os.Handler.handleCallback(Handler.java:739)
                at android.os.Handler.dispatchMessage(Handler.java:95)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5221)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
    04-27 19:41:26.106    1974-2307/com.opshun_test.opshun_test I/output﹕ org.apache.http.client.methods.HttpPost@5b541ce</p>
  </blockquote>