app/src/main/java/com/example/akshika/opencvtest/MainActivity.java
@Override
    public void onCreate(Bundle savedInstanceState) {

        Log.i(TAG, "called onCreate");
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        setContentView(R.layout.layout);

        if(ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, REQUEST_PERMISSION);
        }

        mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.tutorial1_activity_java_surface_view);
        mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
        mOpenCvCameraView.setCvCameraViewListener(this);
        tvName = (TextView) findViewById(R.id.text1);
        tvName.setText(coords + "");


    }
/**
     * Called when the activity is first created.
     */
Called when the activity is first created.
Called when the activity is first created .
@Override
    public void onCreate(Bundle savedInstanceState) {
        Log.i(TAG, "called onCreate");
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        setContentView(R.layout.layout);
        if(ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, REQUEST_PERMISSION);
        }
        mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.tutorial1_activity_java_surface_view);
        mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
        mOpenCvCameraView.setCvCameraViewListener(this);
        tvName = (TextView) findViewById(R.id.text1);
        tvName.setText(coords + "");
    }
@ Override public void onCreate ( Bundle savedInstanceState ) { Log . i ( TAG , "called onCreate" ) ; super . onCreate ( savedInstanceState ) ; getWindow ( ) . addFlags ( WindowManager . LayoutParams . FLAG_KEEP_SCREEN_ON ) ; setContentView ( R . layout . layout ) ; if ( ContextCompat . checkSelfPermission ( this , Manifest . permission . CAMERA ) != PackageManager . PERMISSION_GRANTED ) { ActivityCompat . requestPermissions ( this , new String [ ] { Manifest . permission . CAMERA } , REQUEST_PERMISSION ) ; } mOpenCvCameraView = ( CameraBridgeViewBase ) findViewById ( R . id . tutorial1_activity_java_surface_view ) ; mOpenCvCameraView . setVisibility ( SurfaceView . VISIBLE ) ; mOpenCvCameraView . setCvCameraViewListener ( this ) ; tvName = ( TextView ) findViewById ( R . id . text1 ) ; tvName . setText ( coords + "" ) ; }
Called when the activity is first created.
Called when the activity is first created .