summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-09-14 16:27:09 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-09-14 16:27:58 +0100
commit8f1199860b2ced080f24eeaeb5052d0b68a4b9aa (patch)
tree00e03df79367747ea35191de1726a8ce818af8b9
parent9ac86f484b0c278aafbce685ed19d3ea005ee8f8 (diff)
sdremote: unwind a couple of crasher / corner cases
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java13
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java5
2 files changed, 7 insertions, 11 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
index 767bec5a4f57..ca595d5c3bdc 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/PresentationActivity.java
@@ -349,17 +349,12 @@ public class PresentationActivity extends SherlockFragmentActivity {
@Override
public void run() {
CharSequence aTimeString;
- long aTime = mCommunicationService.getSlideShow().getTimer()
- .getTimeMillis();
- if (mTimerOn) {
- aTimeString = DateFormat.format(aTimerFormat, aTime);
- } else {
- aTimeString = DateFormat.format(aTimeFormat,
- System.currentTimeMillis());
- }
+ long aTime = System.currentTimeMillis();
+ if (mTimerOn && mCommunicationService != null)
+ aTime = mCommunicationService.getSlideShow().getTimer().getTimeMillis();
+ aTimeString = DateFormat.format(aTimerFormat, aTime);
mTimeLabel.setText(aTimeString);
timerHandler.postDelayed(this, 50);
-
}
};
diff --git a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
index 6c24ad7b73ae..ba692c31008b 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
@@ -130,7 +130,8 @@ public class SelectorActivity extends SherlockActivity {
@Override
public void onBackPressed() {
- mCommunicationService.stopSearching();
+ if (mCommunicationService != null)
+ mCommunicationService.stopSearching();
Intent aIntent = new Intent(this, CommunicationService.class);
stopService(aIntent);
super.onBackPressed();
@@ -325,4 +326,4 @@ public class SelectorActivity extends SherlockActivity {
return super.onContextItemSelected(item);
}
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */