Fixed a crash on tablets when posting to task rabbit

pull/14/head
Sam Bosley 14 years ago
parent 9247845670
commit c082d1e672

@ -207,20 +207,22 @@ public class TaskRabbitControlSet extends TaskEditControlSet implements Assigned
*/ */
public void updateDisplay(JSONObject json) { public void updateDisplay(JSONObject json) {
String stateKey = fragment.getActivity().getString(R.string.tr_attr_state_label); if (fragment.getActivity() != null) {
if (json != null && json.has(stateKey)) { String stateKey = fragment.getActivity().getString(R.string.tr_attr_state_label);
String status = json.optString(stateKey); if (json != null && json.has(stateKey)) {
TextView statusText = (TextView) getDisplayView().findViewById(R.id.display_row_edit); String status = json.optString(stateKey);
statusText.setText(status); TextView statusText = (TextView) getDisplayView().findViewById(R.id.display_row_edit);
getDisplayView().setVisibility(View.VISIBLE); statusText.setText(status);
} getDisplayView().setVisibility(View.VISIBLE);
else if (taskRabbitTask != null && taskRabbitTask.getLocalTaskData() != null) { }
TextView statusText = (TextView) getDisplayView().findViewById(R.id.display_row_edit); else if (taskRabbitTask != null && taskRabbitTask.getLocalTaskData() != null) {
statusText.setText(fragment.getActivity().getString(R.string.tr_status_draft)); TextView statusText = (TextView) getDisplayView().findViewById(R.id.display_row_edit);
getDisplayView().setVisibility(View.VISIBLE); statusText.setText(fragment.getActivity().getString(R.string.tr_status_draft));
} getDisplayView().setVisibility(View.VISIBLE);
else { }
getDisplayView().setVisibility(View.GONE); else {
getDisplayView().setVisibility(View.GONE);
}
} }
} }

Loading…
Cancel
Save