title: How to use a method across multiple activities and in my recycler adapter
body: <p>I am making an Android timer application using Java and Android Studio.
  I have the following simple time converter method which converts milliseconds to seconds then formats seconds to ss:mm which is used in two different activities:</p>
  <pre><code>private String convertTime(long time) {
          int mins = (int) (time / 1000) / 60;
          int secs = (int) (time / 1000) % 60;
          return String.format(Locale.getDefault(), &quot;%02d:%02d&quot;, mins, secs);
      }
  </code></pre>
  <p>I also have a very similar method for use in my recycler adapter, but it doesn't convert to seconds:</p>
  <pre><code>private String convertTime(long time) {
          int mins = (int) time / 60;
          int secs = (int) time % 60;
          return  String.format(Locale.getDefault(), &quot;%02d:%02d&quot;, mins, secs);
      }
  </code></pre>
  <p>Which is the best way to implement this method so there is minimal reused code? I initially created an interface and implemented the method where needed, but I don't think this is the best way. Thanks.</p>