You need to inicializate dbLogin.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int id = getIntent().getExtras().getInt("id");
setContentView(R.layout.profilo);
///NEW
LoginDataBase dbLogin = new LoginDataBase (this, "NAMEOFDATABASE", null, 1);
///END OF NEW
SQLiteDatabase db = dbLogin.getWritableDatabase();
}
}
You class LoginDataBase must have a constructor similar than this:
public class LoginDataBase extends SQLiteOpenHelper {
private static final String DB_NAME="Login_DB";
private static final int DB_VERSION=1;
public LoginDataBase (Context contexto, String name,
CursorFactory factory, int version) {
super(contexto, name, factory, version);
}
Or you can also change this and continue with your constructor:
///NEW
LoginDataBase dbLogin = new LoginDataBase (this);
///END OF NEW