title: Converting dp to px without Context
body: <p>There is a very neat way of converting dp to px without Context, and it goes like this:</p>
  
  <pre><code>public static int dpToPx(int dp) {
      float density = Resources.getSystem().getDisplayMetrics().density;
      return Math.round((float) dp * density);
  }
  </code></pre>
  
  <p>In every Google's example on <a href="https://github.com/googlesamples" rel="noreferrer">Google GitHub page</a> they are using the following approach:</p>
  
  <pre><code>public static int convertDpToPixel(Context ctx, int dp) {
      float density = ctx.getResources().getDisplayMetrics().density;
      return Math.round((float) dp * density);
  }
  </code></pre>
  
  <p>So is there something wrong with the first approach? For me it works fine in all my apps, but I want to know is there some case where it might fail?</p>