Restart activity when ViewHolder layout setting is changed

This commit is contained in:
Daniel Schaal 2015-07-10 20:18:28 +02:00
parent 4f188ff74e
commit dbceed7411
2 changed files with 16 additions and 2 deletions

View file

@ -540,8 +540,11 @@ public class NewsReaderListActivity extends PodcastFragmentActivity implements
{
getSlidingListFragment().ReloadAdapter();
if(ThemeChooser.ThemeRequiresRestartOfUI(this)) {
finish();
String oldLayout = data.getStringExtra(SettingsActivity.SP_FEED_LIST_LAYOUT);
String newLayout = PreferenceManager.getDefaultSharedPreferences(this).getString(SettingsActivity.SP_FEED_LIST_LAYOUT,"0");
if(ThemeChooser.ThemeRequiresRestartOfUI(this) || !newLayout.equals(oldLayout)) {
finish();
startActivity(getIntent());
}
} else if(requestCode == RESULT_ADD_NEW_FEED) {

View file

@ -228,6 +228,17 @@ public class SettingsActivity extends PreferenceActivity {
return super.onOptionsItemSelected(item);
}
@Override
protected void onStart() {
super.onStart();
Intent intent = getIntent();
intent.putExtra(
SettingsActivity.SP_FEED_LIST_LAYOUT,
PreferenceManager.getDefaultSharedPreferences(this).getString(SettingsActivity.SP_FEED_LIST_LAYOUT, "0")
);
setResult(RESULT_OK,intent);
}
/** {@inheritDoc} */
@Override
public boolean onIsMultiPane() {