title: Activity intent -- Unfortunately has stopped
body: <p>I want to use a button intent Activity to Activity.
  This is my program.</p>
  
  <p>this is my XML:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/container"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.example.ibaby_single_picture.MainActivity" &gt;
  
  &lt;Button
      android:id="@+id/btn"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text = "123"
      &gt;&lt;/Button&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>this is my java(activity):</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Button btn = (Button)findViewById(R.id.btn);        
      btn.setOnClickListener(listener);
  }   
  private Button.OnClickListener listener = new Button.OnClickListener(){
      @Override
      public void onClick(View v) {
          Intent intent = new Intent();
          intent.setClass(getApplicationContext(),informationActivity.class);
          startActivity(intent);
      }
  }; 
  }
  </code></pre>
  
  <p>this is my AndroidManifest:</p>
  
  <pre><code>&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.ibaby_single_picture.MainActivity"
          android:label="@string/app_name" 
          android:screenOrientation="portrait"&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;    //↓I have written this.
      &lt;activity android:label="iBaby" android:name=".informationActivity"&gt;&lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>I don't know where is the mistake.
  Could someone help me?
  Thanks a lot!!!!!!!</p>
  
  <p>Is this stacktrace?</p>
  
  <pre><code>09-20 01:21:35.944: E/AndroidRuntime(28696):    at java.lang.reflect.Method.invokeNative(Native Method)
  09-20 01:21:35.944: E/AndroidRuntime(28696):    at java.lang.reflect.Method.invoke(Method.java:515)
  09-20 01:21:35.944: E/AndroidRuntime(28696):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
  09-20 01:21:35.944: E/AndroidRuntime(28696):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
  09-20 01:21:35.944: E/AndroidRuntime(28696):    at dalvik.system.NativeStart.main(Native Method)
  09-20 01:21:35.944: E/AndroidRuntime(28696): Caused by: java.lang.NoSuchMethodException: gotoinformationActivity [class android.view.View]
  09-20 01:21:35.944: E/AndroidRuntime(28696):    at java.lang.Class.getConstructorOrMethod(Class.java:472)
  09-20 01:21:35.944: E/AndroidRuntime(28696):    at java.lang.Class.getMethod(Class.java:857)
  09-20 01:21:35.944: E/AndroidRuntime(28696):    at android.view.View$1.onClick(View.java:3835)
  09-20 01:21:35.944: E/AndroidRuntime(28696):    ... 11 more
  </code></pre>
  
  <p>This is my informationActivity. I used Tabhost extends Activity.</p>
  
  <pre><code>public class informationActivity extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.information_tabhost);
  
      getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  
  
      ActionBar.Tab tab1 = getActionBar().newTab();
      tab1.setText("1");
      tab1.setTabListener(new TabListener1(new information0()));
  
      ActionBar.Tab tab2 = getActionBar().newTab();
      tab2.setText("2");
      tab2.setIcon(android.R.drawable.ic_menu_edit);
      tab2.setTabListener(new TabListener1(new information1()));
  
      ActionBar.Tab tab3 = getActionBar().newTab();
      tab3.setText("3");
      tab3.setIcon(android.R.drawable.ic_menu_search);
      tab3.setTabListener(new TabListener1(new information2()));
  
      ActionBar.Tab tab4 = getActionBar().newTab();
      tab3.setText("3");
      tab3.setIcon(android.R.drawable.ic_menu_search);
      tab3.setTabListener(new TabListener1(new information3()));
  
      getActionBar().addTab(tab1);
      getActionBar().addTab(tab2);
      getActionBar().addTab(tab3);
      getActionBar().addTab(tab4);
  }
  
  private class TabListener1 implements ActionBar.TabListener {
      private Fragment fragment;
      public TabListener1(Fragment fragment) {
          this.fragment = fragment;
      }
  
      public void onTabReselected(Tab tab, FragmentTransaction ft) {
      }
  
      public void onTabSelected(Tab tab, FragmentTransaction ft) {
  
          ft.add(R.id.tabsample1, fragment);
      }
  
  
      public void onTabUnselected(Tab tab, FragmentTransaction ft) {
  
          ft.remove(fragment);
      }
  }
  }
  </code></pre>
  
  <p>And this is my information_tabhost.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:id="@+id/tabsample1" &gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Really thanks,everyone!</p>