0.9.2 intstaller crash on startup fix

This commit is contained in:
Chris 2019-12-02 21:58:39 -05:00
parent 8bca8c2082
commit 8091d0934b
2 changed files with 8 additions and 3 deletions

View File

@ -85,6 +85,11 @@ public class ConfigEditorFragment extends Fragment {
private void getModFiles()
{
File modFolder = new File(MOD_DIR);
//Make the directory in case it's not there
if (!modFolder.exists())
modFolder.mkdir();
for (File file : modFolder.listFiles())
{
recursiveFileCheck(file);

View File

@ -49,6 +49,9 @@ public class MainActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.view_pager);
//Request the permissions for storage first.
requestPermissions();
//Find the ViewPager and TabLayout ids
mViewPager = findViewById(R.id.view_pager);
mTabLayout = findViewById(R.id.tab_layout);
@ -64,9 +67,6 @@ public class MainActivity extends AppCompatActivity {
//Setup the ViewPager adapter and TabLayout with ViewPager
mViewPager.setAdapter(mTabAdapter);
mTabLayout.setupWithViewPager(mViewPager);
//Request the permissions for storage access
requestPermissions();
}
catch (Exception e)
{