kopia lustrzana https://github.com/TeamNewPipe/NewPipe
Merge pull request #5176 from Isira-Seneviratne/Use_ContextCompat_getDataDir
Use ContextCompat.getDataDir().pull/5184/head
commit
480348f11a
|
@ -11,6 +11,7 @@ import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
|
@ -120,15 +121,14 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
|
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
|
||||||
|
final File homeDir = ContextCompat.getDataDir(requireContext());
|
||||||
|
databasesDir = new File(homeDir, "/databases");
|
||||||
|
newpipeDb = new File(homeDir, "/databases/newpipe.db");
|
||||||
|
newpipeDbJournal = new File(homeDir, "/databases/newpipe.db-journal");
|
||||||
|
newpipeDbShm = new File(homeDir, "/databases/newpipe.db-shm");
|
||||||
|
newpipeDbWal = new File(homeDir, "/databases/newpipe.db-wal");
|
||||||
|
|
||||||
final String homeDir = getActivity().getApplicationInfo().dataDir;
|
newpipeSettings = new File(homeDir, "/databases/newpipe.settings");
|
||||||
databasesDir = new File(homeDir + "/databases");
|
|
||||||
newpipeDb = new File(homeDir + "/databases/newpipe.db");
|
|
||||||
newpipeDbJournal = new File(homeDir + "/databases/newpipe.db-journal");
|
|
||||||
newpipeDbShm = new File(homeDir + "/databases/newpipe.db-shm");
|
|
||||||
newpipeDbWal = new File(homeDir + "/databases/newpipe.db-wal");
|
|
||||||
|
|
||||||
newpipeSettings = new File(homeDir + "/databases/newpipe.settings");
|
|
||||||
newpipeSettings.delete();
|
newpipeSettings.delete();
|
||||||
|
|
||||||
addPreferencesFromResource(R.xml.content_settings);
|
addPreferencesFromResource(R.xml.content_settings);
|
||||||
|
|
Ładowanie…
Reference in New Issue