fixed crashes when back to main screen after removing account

This commit is contained in:
Mariotaku Lee 2015-03-21 23:14:44 +08:00
parent 8ad206a9c8
commit cdf6ba0062
1 changed files with 4 additions and 2 deletions

View File

@ -98,7 +98,6 @@ import org.mariotaku.twidere.util.content.SupportFragmentReloadCursorObserver;
import org.mariotaku.twidere.view.ShapedImageView;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -612,7 +611,10 @@ public class AccountsDashboardFragment extends BaseSupportListFragment implement
final ParcelableAccount[] previousAccounts = mInternalAccounts;
mInternalAccounts = new ParcelableAccount[accounts.length];
int tempIdx = 0;
final List<ParcelableAccount> tempList = Arrays.asList(accounts);
final List<ParcelableAccount> tempList = new ArrayList<>();
for (ParcelableAccount account : accounts) {
tempList.add(account);
}
if (previousAccounts != null) {
for (ParcelableAccount previousAccount : previousAccounts) {
final int idx = indexOfAccount(tempList, previousAccount.account_id);