Buggy code:
public class MainActivity extends AppCompatActivity implements NavigationView . OnNavigationItemSelectedListener { private DatabaseHelper mDatabaseHelper ; private SQLiteDatabase mSqLiteDatabase ; private CreditsFragment creditsFragment ; private ExpensesFragment expensesFragment ; private IncomesFragment incomesFragment ; private RegularExpensesFragment regularExpensesFragment ; private RegularIncomesFragment regularIncomesFragment ; private StatisticsFragment statisticsFragment ; private ToolsFragment toolsFragment ; private InformationFragment informationFragment ; private static int flag = 0 ; public void showDatePickerDialog ( View v ) { } public void onShowStatisticsBtnClick ( View v ) { } public void getLastActions ( List < String > categoryList , List < String > nameList , List < Double > sumList ) { } public void getDataForStatistics ( List < String > dateList , List < String > categoryNameList , List < Double > sumList ) { } @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; Toolbar toolbar = ( ( Toolbar ) ( findViewById ( toolbar ) ) ) ; setSupportActionBar ( toolbar ) ; <START_BUG> mDatabaseHelper = new DatabaseHelper ( this , "finance.db" , null , 6 ) ; <END_BUG> mSqLiteDatabase = mDatabaseHelper . getWritableDatabase ( ) ; DrawerLayout drawer = ( ( DrawerLayout ) ( findViewById ( drawer_layout ) ) ) ; ActionBarDrawerToggle toggle = new ActionBarDrawerToggle ( this , drawer , toolbar , string . navigation_drawer_open , string . navigation_drawer_close ) ; drawer . setDrawerListener ( toggle ) ; toggle . syncState ( ) ; NavigationView navigationView = ( ( NavigationView ) ( findViewById ( nav_view ) ) ) ; navigationView . setNavigationItemSelectedListener ( this ) ; creditsFragment = new CreditsFragment ( ) ; expensesFragment = new ExpensesFragment ( ) ; incomesFragment = new IncomesFragment ( ) ; regularIncomesFragment = new RegularIncomesFragment ( ) ; regularExpensesFragment = new RegularExpensesFragment ( ) ; statisticsFragment = new StatisticsFragment ( ) ; toolsFragment = new ToolsFragment ( ) ; informationFragment = new InformationFragment ( ) ; FragmentTransaction fragmentTransaction = getFragmentManager ( ) . beginTransaction ( ) ; fragmentTransaction . replace ( container , informationFragment ) ; fragmentTransaction . commit ( ) ; drawer . closeDrawer ( START ) ; } public void onClick ( View v ) { } public int parseCategory ( String category ) { } public int addCategory ( String categoryName ) { } public void addDataToLastActions ( int id , String category , String name , String sum ) { } public void addNewExpense ( View v ) { } public void addNewIncome ( View v ) { } public void addNewRegExpense ( View v ) { } public void addNewCredit ( View v ) { } public void addNewRegIncome ( View v ) { } @ Override public void onBackPressed ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ SuppressWarnings ( "StatementWithEmptyBody" ) @ Override public boolean onNavigationItemSelected ( MenuItem item ) { } }

Fix:
mDatabaseHelper = new DatabaseHelper ( this , "finance.db" , null , 7 ) ;