title: How to check an Android device is HDPI or MDPI without extending Activity in class?
body: <p>I have one class which does not extends any Activity. i want to find out that user uses LDPI,MDPI,HDPI or XHDPI screen using code. any idea? I have used <code>DisplayMetrics metrics = new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(metrics);</code> but it needs an Activity to extend. i want that without extending activity.</p>