Don't load resources when activity is not attached
This commit is contained in:
parent
c07f94e877
commit
754c0f2b93
1 changed files with 19 additions and 3 deletions
|
@ -132,16 +132,32 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
|
|||
}
|
||||
|
||||
public void networkError() {
|
||||
showToast(getString(R.string.status_network_error), Toast.LENGTH_LONG);
|
||||
// FIXME: This is a hack. Fix the Handler madness!
|
||||
Context context = getActivity();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
showToast(context.getString(R.string.status_network_error), Toast.LENGTH_LONG);
|
||||
}
|
||||
|
||||
public void invalidIdError() {
|
||||
showToast(getString(R.string.status_invalid_id_error), Toast.LENGTH_LONG);
|
||||
Context context = getActivity();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
showToast(context.getString(R.string.status_invalid_id_error), Toast.LENGTH_LONG);
|
||||
}
|
||||
|
||||
|
||||
public void fetchingAttachment() {
|
||||
showToast(getString(R.string.message_view_fetching_attachment_toast), Toast.LENGTH_SHORT);
|
||||
Context context = getActivity();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
showToast(context.getString(R.string.message_view_fetching_attachment_toast), Toast.LENGTH_SHORT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue