Skip to content
Snippets Groups Projects
Commit a1a4a2c5 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Fix MainActivity restart after settings change

parent 2486424f
No related branches found
No related tags found
No related merge requests found
......@@ -653,11 +653,13 @@ public class MainActivity extends AudioPlayerContainerActivity implements Search
if (resultCode == PreferencesActivity.RESULT_RESCAN)
mMediaLibrary.scanMediaItems(true);
else if (resultCode == PreferencesActivity.RESULT_RESTART) {
final Intent intent = getIntent();
if (intent != null && intent.getAction() != null) {
finish();
startActivity(intent);
}
Intent intent = getIntent();
if (intent == null)
intent = new Intent(MainActivity.this, MainActivity.class);
if (intent.getAction() == null)
intent.setAction(Intent.CATEGORY_LAUNCHER);
finish();
startActivity(intent);
}
} else if (requestCode == ACTIVITY_RESULT_OPEN && resultCode == RESULT_OK){
MediaUtils.openUri(this, data.getData());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment