]> hydra-www.ietfng.org Git - acmetensortoys-watchviz/commitdiff
.substring sadness
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 13 Jun 2016 06:07:27 +0000 (02:07 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 13 Jun 2016 06:07:27 +0000 (02:07 -0400)
app/src/main/java/com/acmetensortoys/watchviz/MainActivity.java

index 3aa4b72bf35ba5fdab8568276edbd28dfde00e36..72ec65719f18b8f9a1029b38b5e36c82d5a474b9 100644 (file)
@@ -72,7 +72,8 @@ public class MainActivity extends WearableActivity
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
-        mDebugView.setText(cyclercb.getClass().getSimpleName().substring(0,10));
+        String name = cyclercb.getClass().getSimpleName();
+        mDebugView.setText(name.substring(0,Math.min(10,name.length())));
     }
     private void nextCyclerCB() {
         synchronized(this) {