1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-30 23:00:09 -05:00

Fix crash when remote search fails after search screen has been left

Also, change error message to be less technical.
This commit is contained in:
cketti 2012-11-15 21:28:05 +01:00
parent 5accadab00
commit 4eefcb3a31
2 changed files with 6 additions and 2 deletions

View File

@ -1139,6 +1139,7 @@ http://k9mail.googlecode.com/
<string name="remote_search_sending_query">Sending query to server</string>
<string name="remote_search_downloading">Fetching %d results</string>
<string name="remote_search_downloading_limited">Fetching %1$d of %2$d results</string>
<string name="remote_search_error">Remote search failed</string>
<string name="account_settings_search">Search</string>
<string name="account_settings_remote_search_enabled">Enable server search</string>

View File

@ -1428,11 +1428,14 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
class MessageListActivityListener extends ActivityListener {
@Override
public void remoteSearchFailed(Account acct, String folder, final String err) {
//TODO: Better error handling
mHandler.post(new Runnable() {
@Override
public void run() {
Toast.makeText(getActivity(), err, Toast.LENGTH_LONG).show();
Activity activity = getActivity();
if (activity != null) {
Toast.makeText(activity, R.string.remote_search_error,
Toast.LENGTH_LONG).show();
}
}
});
}