Commit b120cfbc authored by Geoffrey Métais's avatar Geoffrey Métais

Refresh views on Media Library rescan

parent 65409562
......@@ -689,9 +689,12 @@ public class MainActivity extends AudioPlayerContainerActivity implements Filter
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
if (resultCode == PreferencesActivity.RESULT_RESCAN)
if (resultCode == PreferencesActivity.RESULT_RESCAN) {
for (Fragment fragment : getSupportFragmentManager().getFragments())
if (fragment instanceof MediaBrowserFragment)
((MediaBrowserFragment) fragment).clear();
mMediaLibrary.scanMediaItems(true);
else if (resultCode == PreferencesActivity.RESULT_RESTART) {
} else if (resultCode == PreferencesActivity.RESULT_RESTART) {
Intent intent = new Intent(MainActivity.this, StartActivity.class);
finish();
startActivity(intent);
......
......@@ -245,9 +245,10 @@ public class MainTvActivity extends BaseTvActivity implements IVideoBrowser, OnI
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
if (resultCode == PreferencesActivity.RESULT_RESCAN)
if (resultCode == PreferencesActivity.RESULT_RESCAN) {
MediaLibrary.getInstance().scanMediaItems(true);
else if (resultCode == PreferencesActivity.RESULT_RESTART) {
update();
} else if (resultCode == PreferencesActivity.RESULT_RESTART) {
Intent intent = getIntent();
intent.setClass(this, StartActivity.class);
finish();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment