title: Android Condition checking if else statements?
body: <p>some mistake i did in this condition can an help me,i am new to technology?sry to ask this type of questions.</p>
  
  <pre><code>if (((getResources().getConfiguration().screenLayout &amp; 
                  Configuration.SCREENLAYOUT_SIZE_LARGE) == 
                      Configuration.SCREENLAYOUT_SIZE_LARGE)&amp;&amp; config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
              final LinearLayout gridViews = (LinearLayout) findViewById(R.id.grid_id);
              OnNowGridView view = new OnNowGridView(this);
              gridViews.addView(view);
  
              }
  </code></pre>
  
  <ul>
   - 
  </ul>
  
  <hr>
  
  <p>10-28 20:26:47.244: ERROR/AndroidRuntime(305): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.buddytv.android/com.buddytv.android.ui.MainViewActivity}: java.lang.NullPointerException
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at android.os.Handler.dispatchMessage(Handler.java:99)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at android.os.Looper.loop(Looper.java:123)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at java.lang.reflect.Method.invokeNative(Native Method)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at java.lang.reflect.Method.invoke(Method.java:521)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  10-28 20:26:47.244: ERROR/AndroidRuntime(305):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)</p>