title: Android - Check Switch State by reading file
body: <p>I am trying to check get my switch to check (read) a file in a kernel path and set the state at app launch. The possible values are just 0 or 1. 0 means the switch should show as "off"... 1 mean as "on".</p>
  
  <p>My code does not seem to be working though... can someone help me troubleshoot?</p>
  
  <p>Code:</p>
  
  <pre><code>mySwitch = (Switch) findViewById(R.id.mySwitch);
  
          //Switch check
          List&lt;String&gt; stdout = Shell.SU.run("cat " + Files.DT2W_PATH);
          for (String s : stdout) {
              if (Integer.valueOf(s) == 0)
                  continue;
              mySwitch.setChecked(false);
  
          }
  </code></pre>