title: Android: Changing the height of root view of a layout programmatically
body: <p>I'm new to Android. Can anyone tell me how to change the height of <code>RootView</code> of a layout programmatically in Android? The code I've tried is given below</p>
  
  <pre><code>LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
              View view = inflater.inflate(R.layout.sample, null);
              view.getRootView().getLayoutParams().height = value;
  </code></pre>
  
  <p>After executing this I'm getting a <code>NullPointerException</code> on the above line.
  Can anyone help me? Thanks in advance.</p>