Fixes issue #95 - Content not refreshed when an account is added
This commit is contained in:
parent
33f55accd9
commit
68262542c8
|
@ -98,6 +98,7 @@ import fr.gouv.etalab.mastodon.fragments.DisplayStatusFragment;
|
||||||
import fr.gouv.etalab.mastodon.fragments.TabLayoutSettingsFragment;
|
import fr.gouv.etalab.mastodon.fragments.TabLayoutSettingsFragment;
|
||||||
import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
|
import fr.gouv.etalab.mastodon.sqlite.AccountDAO;
|
||||||
|
|
||||||
|
import static fr.gouv.etalab.mastodon.helper.Helper.ADD_USER_INTENT;
|
||||||
import static fr.gouv.etalab.mastodon.helper.Helper.CHANGE_THEME_INTENT;
|
import static fr.gouv.etalab.mastodon.helper.Helper.CHANGE_THEME_INTENT;
|
||||||
import static fr.gouv.etalab.mastodon.helper.Helper.CHANGE_USER_INTENT;
|
import static fr.gouv.etalab.mastodon.helper.Helper.CHANGE_USER_INTENT;
|
||||||
import static fr.gouv.etalab.mastodon.helper.Helper.HOME_TIMELINE_INTENT;
|
import static fr.gouv.etalab.mastodon.helper.Helper.HOME_TIMELINE_INTENT;
|
||||||
|
@ -1022,6 +1023,8 @@ public abstract class BaseMainActivity extends AppCompatActivity
|
||||||
if( !toolbar_search.isIconified() ) {
|
if( !toolbar_search.isIconified() ) {
|
||||||
toolbar_search.setIconified(true);
|
toolbar_search.setIconified(true);
|
||||||
}
|
}
|
||||||
|
}else if (extras.getInt(INTENT_ACTION) == ADD_USER_INTENT){
|
||||||
|
this.recreate();
|
||||||
}
|
}
|
||||||
}else if( Intent.ACTION_SEND.equals(action) && type != null ) {
|
}else if( Intent.ACTION_SEND.equals(action) && type != null ) {
|
||||||
if ("text/plain".equals(type)) {
|
if ("text/plain".equals(type)) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class UpdateAccountInfoAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||||
protected void onPostExecute(Void result) {
|
protected void onPostExecute(Void result) {
|
||||||
|
|
||||||
Intent mainActivity = new Intent(this.contextReference.get(), MainActivity.class);
|
Intent mainActivity = new Intent(this.contextReference.get(), MainActivity.class);
|
||||||
mainActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
mainActivity.putExtra(Helper.INTENT_ACTION, Helper.ADD_USER_INTENT);
|
||||||
this.contextReference.get().startActivity(mainActivity);
|
this.contextReference.get().startActivity(mainActivity);
|
||||||
((Activity) this.contextReference.get()).finish();
|
((Activity) this.contextReference.get()).finish();
|
||||||
|
|
||||||
|
|
|
@ -190,6 +190,7 @@ public class Helper {
|
||||||
public static final int HOME_TIMELINE_INTENT = 2;
|
public static final int HOME_TIMELINE_INTENT = 2;
|
||||||
public static final int CHANGE_THEME_INTENT = 3;
|
public static final int CHANGE_THEME_INTENT = 3;
|
||||||
public static final int CHANGE_USER_INTENT = 4;
|
public static final int CHANGE_USER_INTENT = 4;
|
||||||
|
public static final int ADD_USER_INTENT = 5;
|
||||||
//Settings
|
//Settings
|
||||||
public static final String SET_TOOTS_PER_PAGE = "set_toots_per_page";
|
public static final String SET_TOOTS_PER_PAGE = "set_toots_per_page";
|
||||||
public static final String SET_ACCOUNTS_PER_PAGE = "set_accounts_per_page";
|
public static final String SET_ACCOUNTS_PER_PAGE = "set_accounts_per_page";
|
||||||
|
|
Loading…
Reference in New Issue