use of org.videolan.vlc.StartActivity in project vlc-android by videolan.
the class MainActivity method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
switch(resultCode) {
case PreferencesActivity.RESULT_RESCAN:
startService(new Intent(Constants.ACTION_RELOAD, null, this, MediaParsingService.class));
break;
case PreferencesActivity.RESULT_RESTART:
case PreferencesActivity.RESULT_RESTART_APP:
Intent intent = new Intent(MainActivity.this, resultCode == PreferencesActivity.RESULT_RESTART_APP ? StartActivity.class : MainActivity.class);
finish();
startActivity(intent);
break;
case PreferencesActivity.RESULT_UPDATE_SEEN_MEDIA:
for (Fragment fragment : getSupportFragmentManager().getFragments()) if (fragment instanceof VideoGridFragment)
((VideoGridFragment) fragment).updateSeenMediaMarker();
break;
case PreferencesActivity.RESULT_UPDATE_ARTISTS:
final Fragment fragment = getCurrentFragment();
if (fragment instanceof AudioBrowserFragment)
((AudioBrowserFragment) fragment).updateArtists();
}
} else if (requestCode == ACTIVITY_RESULT_OPEN && resultCode == RESULT_OK) {
MediaUtils.openUri(this, data.getData());
} else if (requestCode == ACTIVITY_RESULT_SECONDARY) {
if (resultCode == PreferencesActivity.RESULT_RESCAN) {
forceRefresh(getCurrentFragment());
}
}
}
use of org.videolan.vlc.StartActivity in project vlc-android by GeoffreyMetais.
the class MainActivity method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == Constants.ACTIVITY_RESULT_PREFERENCES) {
switch(resultCode) {
case PreferencesActivity.RESULT_RESCAN:
startService(new Intent(Constants.ACTION_RELOAD, null, this, MediaParsingService.class));
break;
case PreferencesActivity.RESULT_RESTART:
case PreferencesActivity.RESULT_RESTART_APP:
Intent intent = new Intent(MainActivity.this, resultCode == PreferencesActivity.RESULT_RESTART_APP ? StartActivity.class : MainActivity.class);
finish();
startActivity(intent);
break;
case PreferencesActivity.RESULT_UPDATE_SEEN_MEDIA:
for (Fragment fragment : getSupportFragmentManager().getFragments()) if (fragment instanceof VideoGridFragment)
((VideoGridFragment) fragment).updateSeenMediaMarker();
break;
case PreferencesActivity.RESULT_UPDATE_ARTISTS:
final Fragment fragment = getCurrentFragment();
if (fragment instanceof AudioBrowserFragment)
((AudioBrowserFragment) fragment).updateArtists();
}
} else if (requestCode == Constants.ACTIVITY_RESULT_OPEN && resultCode == RESULT_OK) {
MediaUtils.openUri(this, data.getData());
} else if (requestCode == Constants.ACTIVITY_RESULT_SECONDARY) {
if (resultCode == PreferencesActivity.RESULT_RESCAN) {
forceRefresh(getCurrentFragment());
}
}
}
use of org.videolan.vlc.StartActivity in project vlc-android by videolan.
the class MainTvActivity method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
switch(resultCode) {
case PreferencesActivity.RESULT_RESCAN:
startService(new Intent(Constants.ACTION_RELOAD, null, this, MediaParsingService.class));
;
break;
case PreferencesActivity.RESULT_RESTART:
case PreferencesActivity.RESULT_RESTART_APP:
Intent intent = getIntent();
intent.setClass(this, resultCode == PreferencesActivity.RESULT_RESTART_APP ? StartActivity.class : MainTvActivity.class);
finish();
startActivity(intent);
break;
}
}
}
use of org.videolan.vlc.StartActivity in project vlc-android by GeoffreyMetais.
the class MainTvActivity method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
switch(resultCode) {
case PreferencesActivity.RESULT_RESCAN:
startService(new Intent(Constants.ACTION_RELOAD, null, this, MediaParsingService.class));
;
break;
case PreferencesActivity.RESULT_RESTART:
case PreferencesActivity.RESULT_RESTART_APP:
Intent intent = getIntent();
intent.setClass(this, resultCode == PreferencesActivity.RESULT_RESTART_APP ? StartActivity.class : MainTvActivity.class);
finish();
startActivity(intent);
break;
}
}
}
Aggregations