title: Error when start activity and upload Database
body: <p>When I click a Button I starting a new activity, called Profilo.java. My code is:</p>
  
  <blockquote>
    <p>package com.example.prenotazione_esame;</p>
    
    <p>import android.app.Activity; import android.app.AlertDialog; import
    android.content.DialogInterface; import android.database.Cursor;
    import android.database.sqlite.SQLiteDatabase; import android.os.*;
    import android.view.Menu; import android.view.MenuItem; import
    android.widget.Button; import android.widget.EditText; import
    android.view.View; import android.view.View.OnClickListener; import
    android.widget.Toast;</p>
  
  <pre><code>public class Profilo extends Activity {
  private LoginDataBase dbLogin;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      int id = getIntent().getExtras().getInt("id");
      setContentView(R.layout.profilo);
      SQLiteDatabase db = dbLogin.getWritableDatabase();
  }
  </code></pre>
    
    <p>}       </p>
  </blockquote>
  
  <p>this LoginDataBase.java</p>
  
  <pre><code>public class LoginDataBase extends SQLiteOpenHelper {
      private static final String DB_NAME="Login_DB";
      private static final int DB_VERSION=1;
  
      public LoginDataBase(Context context){
          super(context,DB_NAME,null,DB_VERSION);
      }
      @Override 
       public void onCreate(SQLiteDatabase db) { 
          String sql="";
          sql+= "CREATE TABLE T_LOGIN (";
          sql+= " _id_LOGIN INTEGER PRIMARY KEY AUTOINCREMENT,";
          sql+= " USERNAME TEXT NOT NULL,";
          sql+= " PASSWORD TEXT NOT NULL";
          sql+=")";
          db.execSQL(sql);
  
          String sql2="";
          sql2+= "CREATE TABLE T_PROFILO (";
          sql2+= " _id_PROFILO INTEGER PRIMARY KEY AUTOINCREMENT,";
          sql2+= " NOME TEXT NOT NULL,";
          sql2+= " COGNOME TEXT NOT NULL,";
          sql2+= " ETA TEXT NOT NULL,";
          sql2+= " SESSO TEXT(1) NOT NULL,";
          sql2+= " CODICE_FISCALE TEXT NOT NULL,";
          sql2+= " CITTA TEXT NOT NULL,";
          sql2+= " INDIRIZZO TEXT NOT NULL,";
          sql2+= " TELEFONO TEXT NOT NULL,";
          sql2+= " _id_L INTEGER NOT NULL,";
          sql2+= " FOREIGN KEY(_id_L) REFERENCES T_LOGIN(_id_LOGIN)";
          sql2+= ")";
          db.execSQL(sql2);
       } 
  
       @Override 
       public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 
          // Aggiornamento delle tabelle 
       } 
  }
  </code></pre>
  
  <p>the problem is when I try to take my database db. My app crash.
  Where is the problem?</p>