title: Shutting down VM
body: <p>I m learning android please help me. It gives me following errors in logcat.</p>
  
  <pre><code>02-27 14:14:42.455: D/dalvikvm(1655): GC_FOR_ALLOC freed 46K, 5% free 2891K/3020K, paused 152ms, total 156ms
  02-27 14:14:42.465: I/dalvikvm-heap(1655): Grow heap (frag case) to 3.668MB for 810016-byte allocation
  02-27 14:14:42.545: D/dalvikvm(1655): GC_FOR_ALLOC freed 2K, 4% free 3680K/3812K, paused 76ms, total 77ms
  02-27 14:14:43.425: I/Choreographer(1655): Skipped 35 frames!  The application may be doing too much work on its main thread.
  02-27 14:14:43.645: D/gralloc_goldfish(1655): Emulator without GPU emulation detected.
  02-27 14:14:48.395: I/Choreographer(1655): Skipped 58 frames!  The application may be doing too much work on its main thread.
  02-27 14:14:49.725: I/Choreographer(1655): Skipped 58 frames!  The application may be doing too much work on its main thread.
  02-27 14:14:52.355: I/Choreographer(1655): Skipped 61 frames!  The application may be doing too much work on its main thread.
  02-27 14:14:55.195: D/AndroidRuntime(1655): Shutting down VM
  02-27 14:14:55.195: W/dalvikvm(1655): threadid=1: thread exiting with uncaught exception (group=0xb3aaaba8)
  02-27 14:14:55.275: E/AndroidRuntime(1655): FATAL EXCEPTION: main
  02-27 14:14:55.275: E/AndroidRuntime(1655): Process: com.example.dreamhome, PID: 1655
  02-27 14:14:55.275: E/AndroidRuntime(1655): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dreamhome/com.example.dreamhome.LoginFormActivity}: java.lang.NullPointerException
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.os.Handler.dispatchMessage(Handler.java:102)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.os.Looper.loop(Looper.java:136)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.app.ActivityThread.main(ActivityThread.java:5017)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at java.lang.reflect.Method.invokeNative(Native Method)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at java.lang.reflect.Method.invoke(Method.java:515)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at dalvik.system.NativeStart.main(Native Method)
  02-27 14:14:55.275: E/AndroidRuntime(1655): Caused by: java.lang.NullPointerException
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at com.example.dreamhome.LoginFormActivity.onCreate(LoginFormActivity.java:45)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.app.Activity.performCreate(Activity.java:5231)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
  02-27 14:14:55.275: E/AndroidRuntime(1655):     ... 11 more
  02-27 14:15:03.295: I/Process(1655): Sending signal. PID: 1655 SIG: 9
  </code></pre>
  
  <p><strong>HomeActivity.java</strong></p>
  
  <pre><code>public class HomeActivity extends Activity 
  {
  Button search_property, log_in, exit;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_home);
  
      search_property=(Button)findViewById(R.id.homebutton1);
      log_in=(Button)findViewById(R.id.homebutton2);
      exit=(Button)findViewById(R.id.homebutton3);
  
  
      search_property.setOnClickListener(new View.OnClickListener()
      {
          public void onClick(View v)
          {
  
              Intent main1=new Intent(HomeActivity.this,EndUserSearchPropertyActivity.class);
              startActivity(main1);
  
          }
      });
  
  
      log_in.setOnClickListener(new View.OnClickListener()
      {
          public void onClick(View v)
          {
  
              Intent main2 = new Intent(HomeActivity.this,LoginFormActivity.class);
              startActivity(main2);
  
          }
      });
  
  
      exit.setOnClickListener(new View.OnClickListener()
      {
          public void onClick(View v)
          {
              finish();
              System.exit(0);
  
          }
      });
  
  
  
      // Show the Up button in the action bar.
      setupActionBar();
  }
  
  /**
   * Set up the {@link android.app.ActionBar}.
   */
  private void setupActionBar() 
  {
  
      getActionBar().setDisplayHomeAsUpEnabled(true);
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) 
  {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.home, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) 
  {
      switch (item.getItemId()) 
      {
          case android.R.id.home:
          // This ID represents the Home or Up button. In the case of this
          // activity, the Up button is shown. Use NavUtils to allow users
          // to navigate up one level in the application structure. For
          // more details, see the Navigation pattern on Android Design:
          //
          // http://developer.android.com/design/patterns/navigation.html#up-vs-back
          //
          NavUtils.navigateUpFromSameTask(this);
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  </code></pre>
  
  <p>this is <strong>LoginFormActivity.java</strong></p>
  
  <pre><code>public class LoginFormActivity extends Activity 
  {
  
   private Button sign_up = null;
   private Button btnSignIn = null;
   LoginDataBaseAdapter loginDataBaseAdapter = null;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_login_form);
  
  
       // create a instance of SQLite Database
      loginDataBaseAdapter=new LoginDataBaseAdapter(this);
      loginDataBaseAdapter=loginDataBaseAdapter.open();
  
  
      final Dialog dialog = new Dialog(LoginFormActivity.this);
  
      // get the Refferences of views
      final  EditText editTextUserName=(EditText)dialog.findViewById(R.id.login_editText1);
      final  EditText editTextPassword=(EditText)dialog.findViewById(R.id.login_editText2);
  
      btnSignIn = (Button)dialog.findViewById(R.id.login_form_button1);
      // Set On ClickListener
      btnSignIn.setOnClickListener(new View.OnClickListener() 
      {
          public void onClick(View v) 
          {
              // get The User name and Password
              String userName = editTextUserName.getText().toString();
              String password = editTextPassword.getText().toString();
  
              // fetch the Password form database for respective user name
              String storedPassword=loginDataBaseAdapter.getSinlgeEntry(userName);
  
              // check if the Stored password matches with  Password entered by user
              if(password.equals(storedPassword))
              {
                  Toast.makeText(LoginFormActivity.this, "Congrats: Login Successfull", Toast.LENGTH_LONG).show();
                  dialog.dismiss();
              }
  
              else
              {
                  Toast.makeText(LoginFormActivity.this, "User Name or Password does not match", Toast.LENGTH_LONG).show();
              }
         }
    });
  
    dialog.show();
    }
  
  
   @Override
   protected void onDestroy() 
   {
       super.onDestroy();
       // Close The Database
       loginDataBaseAdapter.close();
  
  
  
      sign_up = (Button)findViewById(R.id.login_form_button2);
  
      sign_up.setOnClickListener(new View.OnClickListener()
      {
          public void onClick(View v)
          {
  
              Intent main2=new Intent(LoginFormActivity.this,SignupFormActivity.class);
              startActivity(main2);
  
          }
      });
  
  
  
      // Show the Up button in the action bar.
      setupActionBar();
  }
  
  /**
   * Set up the {@link android.app.ActionBar}.
   */
  private void setupActionBar() 
  {
  
      getActionBar().setDisplayHomeAsUpEnabled(true);
  
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) 
  {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.login_form, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) 
  {
      switch (item.getItemId()) 
      {
          case android.R.id.home:
          // This ID represents the Home or Up button. In the case of this
          // activity, the Up button is shown. Use NavUtils to allow users
          // to navigate up one level in the application structure. For
          // more details, see the Navigation pattern on Android Design:
          //
          // http://developer.android.com/design/patterns/navigation.html#up-vs-back
          //
          NavUtils.navigateUpFromSameTask(this);
          return true;
      }
      return super.onOptionsItemSelected(item);
  }
  </code></pre>
  
  <p>}</p>