title: Why intent makes my application crashed?
body: <p>I just want to ask you why using intent makes my system crashed? I've used same codes before and it works, then when I use it again now it won't. What do you think the problem guys? </p>
  
  <p>MANIFEST</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name=".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=".Login"
          android:label="@string/title_activity_login" &gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>MainActivity</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  public void okay(View view) {
      Intent i = new Intent(this, Login.class);
      startActivity(i);
  </code></pre>
  
  <h1>2nd Activity (If I clicked the main activity, I just want this activity pop)</h1>
  
  <pre><code>public class Login extends ActionBarActivity {
  ListView listView;
  ArrayAdapter&lt;String&gt; adapter;
  String[] grocery_categories = {"Beverages", "Bakery", "Canned Goods", "Condiments", "Dairy", "Snacks", "Frozen Foods",
                                  "Meat", "Produce", "Cleaners", "Paper Goods", "Personal Care", "Others"};
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_login);
      listView = (ListView) findViewById(R.id.list_view);
      adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, grocery_categories);
      listView.setAdapter(adapter);
      listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; listView, View view, int position, long id) {
              String grocery = (String) listView.getAdapter().getItem(position);
              Intent intent = new Intent(listView.getContext(),Login.class);
              listView.getContext().startActivity(intent);
              //or create other intents here
          }
      });
  
  }
  </code></pre>
  
  <p>XML of MainActivity </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"  tools:context=".MainActivity"
  android:id="@+id/rl_main_activity"&gt;
  
  &lt;ImageView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/mobile_grocery_bckgrnd"
      android:src="@drawable/mobile_grocery"
      android:scaleType="centerCrop"
      /&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="MOBILE GROCERY"
      android:id="@+id/mobile_grocery_app"
      android:textSize="45dp"
      android:textColor="#000000"
      android:gravity="center"
  
      android:textStyle="bold|italic"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true" /&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Application"
      android:id="@+id/application"
      android:textColor="#000000"
      android:textSize="25dp"
      android:layout_below="@+id/mobile_grocery_app"
      android:layout_centerHorizontal="true" /&gt;
  
  &lt;EditText
      android:layout_width="200dp"
      android:layout_height="wrap_content"
      android:id="@+id/username"
      android:layout_alignParentBottom="true"
      android:layout_alignRight="@+id/application"
      android:layout_alignEnd="@+id/application"
      android:layout_marginBottom="135dp"
      android:hint="Username"
      android:textColorHint="#000000"
      /&gt;
  
  &lt;EditText
      android:layout_width="200dp"
      android:layout_height="wrap_content"
      android:id="@+id/password"
      android:layout_alignTop="@+id/username"
      android:layout_alignRight="@+id/username"
      android:layout_alignEnd="@+id/username"
      android:layout_marginTop="52dp"
      android:hint="Password"
      android:textColorHint="#000000"
      android:password="true" /&gt;
  
  &lt;Button
      style="?android:attr/buttonStyleSmall"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="OK"
      android:id="@+id/ok"
      android:layout_below="@+id/password"
      android:layout_alignLeft="@+id/application"
      android:layout_alignStart="@+id/application"
      android:onClick="okay" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>XML of Login Activity (2nd Activity) </p>
  
  <p></p>
  
  <pre><code>&lt;ImageView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:id="@+id/login_bckgrnd"
      android:src="@drawable/login_bckgrnd"
      android:scaleType="centerCrop"
      /&gt;
  
  &lt;ListView
      android:id="@+id/list_view"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
  
  
  &lt;/ListView&gt;
  </code></pre>
  
  <p></p>
  
  <p>Manifest</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.admin.mobilegroceryapp" &gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".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=".Login"
              android:label="@string/title_activity_login" &gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>logcat</p>
  
  <pre><code>  .085    2019-2087/? I/InputDispatcher﹕ Delivering touch to current input target: action: 0x0
  09-29 01:54:28.085    2019-2087/? I/InputDispatcher﹕ Delivering touch to current input target: action: 0x0
  09-29 01:54:28.085    2019-2087/? I/InputDispatcher﹕ Delivering touch to current input target: action: 0x0
  09-29 01:54:28.085    2019-2087/? I/InputDispatcher﹕ Delivering touch to current input target: action: 0x0
  09-29 01:54:28.085    2019-2087/? I/InputDispatcher﹕ Delivering touch to current input target: action: 0x0
  09-29 01:54:28.190    2019-2088/? I/InputReader﹕ Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=]
  09-29 01:54:28.285  30351-30351/? I/dalvikvm﹕ Could not find method android.graphics.Bitmap.getAllocationByteCount, referenced from method com.facebook.imagepipeline.a.d.a.a
  09-29 01:54:28.285  30351-30351/? W/dalvikvm﹕ VFY: unable to resolve virtual method 625: Landroid/graphics/Bitmap;.getAllocationByteCount ()I
  09-29 01:54:28.285  30351-30351/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0006
  09-29 01:54:28.355  30482-30482/? D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 0ms
  09-29 01:54:28.355    2019-2074/? D/BatteryService﹕ update start
  09-29 01:54:28.360    2019-2079/? D/KeyguardViewMediator﹕ setHidden false
  09-29 01:54:28.360    1732-1732/? I/SurfaceFlinger﹕ id=13169 Removed TcreenSaver idx=4 MapSz=10
  </code></pre>
  
  <p>Hope some pro help me to my problem. Somebody says It's simple but I can't resolved sir.</p>