title: Inflation Exception in XML of view for inner nested class
body: <p>I have some code that works perfect with no errors if the view class (JavaCameraImageView) is inflated in the XML layout as an external class,  it also works if the class is included in the same .java file external to the main activity class.  however when I tried to use the JavaCameraImageView class as an inner class inside of the main class I get the errors and logcat output shown here.  how do I get this to work as nested inner class?</p>
  
  <p>Logcat result</p>
  
  <pre><code> 01-14 15:17:37.486: E/AndroidRuntime(8347): FATAL EXCEPTION: main
   01-14 15:17:37.486: E/AndroidRuntime(8347): java.lang.RuntimeException:
   Unable to start activity ComponentInfo{com.group.cam/com.group.cam.MainActivity}:
   android.view.InflateException: Binary XML file line #28: Error inflating class
   com.group.cam.MainActivity$JavaCameraImageView
  </code></pre>
  
  <p>XML layout</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/linearLayout1"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  xmlns:opencv="http://schemas.android.com/apk/res-auto"
  tools:context=".MainActivity" &gt;
  
  &lt;FrameLayout
      android:id="@+id/frameLayout1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" &gt;
  
   &lt;view
    class="com.group.cam.MainActivity$JavaCameraImageView"
    android:id="@+id/camera_surface_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
   /&gt;       
  
  &lt;/FrameLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>onCreate method of class MainActivity</p>
  
  <pre><code>        @Override
      public void onCreate(Bundle savedInstanceState) {
  
          if (!OpenCVLoader.initDebug()) {
              // Handle initialization error
          }
  
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.activity_main);
  
          frameLayoutOne = (FrameLayout) findViewById(R.id.frameLayout1);
  
          getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  
          mOpenCvCameraView = (JavaCameraImageView) findViewById(R.id.camera_surface_view);
          mOpenCvCameraView.setCvCameraViewListener(this);
  
  
          mOpenCvCameraView.setMaxFrameSize(reducedDimensions.width, reducedDimensions.height);
  
      } // end on create
  </code></pre>
  
  <p>class JavaCameraImageView that nested as an inner class inside of MainActivity class</p>
  
  <pre><code>   public class JavaCameraImageView extends JavaCameraView {
  
   public JavaCameraImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
         // TODO Auto-generated constructor stub
   }      
  }
  </code></pre>
  
  <p>EDIT: solution to this problem, the JavaCameraImageView class must be made static for it to work as an inner class in this situation</p>
  
  <pre><code>   public static class JavaCameraImageView extends JavaCameraView {
  
   public JavaCameraImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
         // TODO Auto-generated constructor stub
   }      
  }
  </code></pre>