title: ANDROID: Starting another activity but nothing happend
body: <p>I followed EVERYTHING at the <a href="http://developer.android.com/training/basics/firstapp/starting-activity.html" rel="nofollow">http://developer.android.com/training/basics/firstapp/starting-activity.html</a> but I am not able to start the second activity. I just type a text then when I hit the "send button" nothing happens. </p>
  
  <p>I have searched and tried this two times already.. <strong>PLEASE HELP MEEE :((</strong> :(</p>
  
  <p><strong>Here is my MainActivity.java</strong></p>
  
  <pre><code>package com.example.myfirstapp;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v7.app.ActionBarActivity;
   import android.view.LayoutInflater;
   import android.view.Menu;
   import android.view.MenuItem;
   import android.view.View;
   import android.view.ViewGroup;
   import android.widget.EditText;
  
  
   public class MainActivity extends ActionBarActivity {
     public final static String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      if (savedInstanceState == null) {
          getSupportFragmentManager().beginTransaction()
                  .add(R.id.container, new PlaceholderFragment())
                  .commit();
      }
  }
  
  
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  
  /**
   * A placeholder fragment containing a simple view.
   */
  public static class PlaceholderFragment extends Fragment {
  
      public PlaceholderFragment() {
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.fragment_main, container, false);
          return rootView;
      }
  }
  
  
  /** Called when the user clicks the Send button */
  public void sendMessage(View view) {
      Intent intent = new Intent(this, DisplayMessageActivity.class);
      EditText editText = (EditText) findViewById(R.id.edit_message);
      String message = editText.getText().toString();
      intent.putExtra(EXTRA_MESSAGE, message);
      startActivity(intent);
  
  }
  }
  </code></pre>
  
  <p><strong>Here is my FragmentMan.xml</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="horizontal"&gt;
  
  &lt;EditText
      android:id="@+id/edit_message"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:hint="@string/edit_message" /&gt;
  
  &lt;Button
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="@string/button_send" /&gt;
  
  &lt;Button
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="@string/button_send"
  android:onClick="sendMessage" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>Here is my DisplayMessageActivity.java</strong></p>
  
  <pre><code> package com.example.myfirstapp;
  
   import android.content.Intent;
   import android.os.Bundle;
   import android.support.v4.app.Fragment;
   import android.support.v7.app.ActionBarActivity;
     import android.view.LayoutInflater;
    import android.view.MenuItem;
      import android.view.View;
    import android.view.ViewGroup;
      import android.widget.TextView;
  
      public class DisplayMessageActivity extends ActionBarActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  
       super.onCreate(savedInstanceState);
  
          // Get the message from the intent
          Intent intent = getIntent();
          String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
  
          // Create the text view
          TextView textView = new TextView(this);
          textView.setTextSize(40);
          textView.setText(message);
  
          // Set the text view as the activity layout
          setContentView(textView);
  
      if (savedInstanceState == null) {
          getSupportFragmentManager().beginTransaction()
                  .add(R.id.container, new    PlaceholderFragment()).commit();
      }
  }
  
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
      if (id == R.id.action_settings) {
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  
  /**
   * A placeholder fragment containing a simple view.
   */
  public static class PlaceholderFragment extends Fragment {
  
      public PlaceholderFragment() {
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.fragment_display_message,
                  container, false);
          return rootView;
      }
  }
  
    }
  </code></pre>
  
  <p><strong>Fragment_Display_message</strong></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context="com.example.myfirstapp.DisplayMessageActivity$PlaceholderFragment" &gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/hello_world" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>MyFirstAppManifest.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.myfirstapp"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="19" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name="com.example.myfirstapp.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.example.myfirstapp.DisplayMessageActivity"
          android:label="@string/title_activity_display_message"
          android:parentActivityName="com.example.myfirstapp.MainActivity" &gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.example.myfirstapp.MainActivity" /&gt;
      &lt;/activity&gt;
    &lt;/application&gt;
  
    &lt;/manifest&gt;
  </code></pre>
  
  <p>To many redss on the logcat lol </p>
  
  <pre><code>    04-11 02:19:09.402: E/AndroidRuntime(2091): FATAL EXCEPTION: main
  04-11 02:19:09.402: E/AndroidRuntime(2091): Process: com.example.myfirstapp, PID: 2091
  04-11 02:19:09.402: E/AndroidRuntime(2091): java.lang.IllegalStateException: Could not find a method sendMessage(View) in the activity class com.example.myfirstapp.MainActivity for onClick handler on view class android.widget.Button
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at android.view.View$1.onClick(View.java:3810)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at android.view.View.performClick(View.java:4438)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at android.view.View$PerformClick.run(View.java:18422)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at android.os.Handler.handleCallback(Handler.java:733)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at android.os.Handler.dispatchMessage(Handler.java:95)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at android.os.Looper.loop(Looper.java:136)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at android.app.ActivityThread.main(ActivityThread.java:5017)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at java.lang.reflect.Method.invokeNative(Native Method)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at java.lang.reflect.Method.invoke(Method.java:515)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at dalvik.system.NativeStart.main(Native Method)
  04-11 02:19:09.402: E/AndroidRuntime(2091): Caused by: java.lang.NoSuchMethodException: sendMessage [class android.view.View]
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at java.lang.Class.getConstructorOrMethod(Class.java:472)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at java.lang.Class.getMethod(Class.java:857)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     at android.view.View$1.onClick(View.java:3803)
  04-11 02:19:09.402: E/AndroidRuntime(2091):     ... 11 more
  04-11 02:22:41.052: E/AndroidRuntime(2145): FATAL EXCEPTION: main
  04-11 02:22:41.052: E/AndroidRuntime(2145): Process: com.example.myfirstapp, PID: 2145
  04-11 02:22:41.052: E/AndroidRuntime(2145): java.lang.IllegalStateException: Could not find a method sendMessage(View) in the activity class com.example.myfirstapp.MainActivity for onClick handler on view class android.widget.Button
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at android.view.View$1.onClick(View.java:3810)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at android.view.View.performClick(View.java:4438)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at android.view.View$PerformClick.run(View.java:18422)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at android.os.Handler.handleCallback(Handler.java:733)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at android.os.Handler.dispatchMessage(Handler.java:95)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at android.os.Looper.loop(Looper.java:136)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at android.app.ActivityThread.main(ActivityThread.java:5017)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at java.lang.reflect.Method.invokeNative(Native Method)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at java.lang.reflect.Method.invoke(Method.java:515)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at dalvik.system.NativeStart.main(Native Method)
  04-11 02:22:41.052: E/AndroidRuntime(2145): Caused by: java.lang.NoSuchMethodException: sendMessage [class android.view.View]
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at java.lang.Class.getConstructorOrMethod(Class.java:472)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at java.lang.Class.getMethod(Class.java:857)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     at android.view.View$1.onClick(View.java:3803)
  04-11 02:22:41.052: E/AndroidRuntime(2145):     ... 11 more
  04-11 02:24:42.032: E/FragmentManager(2198): No view found for id 0x7f05003c (com.example.myfirstapp:id/container) for fragment PlaceholderFragment{b2d206c0 #0 id=0x7f05003c}
  04-11 02:24:42.032: E/FragmentManager(2198): Activity state:
  </code></pre>