通过getResources().getConfiguration().orientation可获取当前环境。

 
  
  1. if (getResources().getConfiguration().orientation==Configuration.ORIENTATION_LANDSCAPE) 
  2.     p_w_picpathView.setBackgroundDrawable(getResources().getDrawable(R.drawable.p_w_picpath_land)); 
  3. else 
  4.     p_w_picpathView.setBackgroundDrawable(getResources().getDrawable(R.drawable.p_w_picpath));