java - Unable to run CameraView on next activity on android studios -


im pretty new android programming hence need help. when run program, able display 1st page(ip address keying in page) , when click connect button, unable run next activity

i have added 3 relevant manifest camera permission & hardware usage.

i user key in ip address (which checked against matcher) , if matches, lead next activity camera. have tried individually run ip address matcher , camera on 2 different projects , work fine.

on side note, @ times keep getting nullpointerexception think able fix using if statements onclicklistener , addview ones in mainactivity class

this mainactivity class

public class mainactivity extends appcompatactivity {  private edittext ipaddr; private string ipaddress; private static final string ipaddress_pattern =         "^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +                 "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +                 "([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\." +                 "([01]?\\d\\d?|2[0-4]\\d|25[0-5])$";  private camera mcamera = null;  @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);      button connectbutton = (button) findviewbyid(r.id.connectbutton);     ipaddr = (edittext)findviewbyid(r.id.ipaddr);      if (connectbutton != null) {         connectbutton.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view v)             {                 ipaddress = ipaddr.gettext().tostring();                  if(checkipaddressformat(ipaddress))                 {                     intent changepageintent = new intent(mainactivity.this,cameraview.class);                     startactivity(changepageintent);                     log.d("error","able go next class");                 }                 else                 {                     toast.maketext(mainactivity.this, "this invalid ip", toast.length_short).show();                 }              }         });     }     try     {         mcamera = camera.open();         log.d("error","get camera");     }     catch(exception e)     {         log.d("error","failed camera" + e.getmessage());     }      if(mcamera !=null)     {         cameraview mcameraview = new cameraview(mainactivity.this, mcamera);         framelayout camera_view = (framelayout)findviewbyid(r.id.camera_view);         if (camera_view != null) {             camera_view.addview(mcameraview);         }         log.d("error","able preview camera" );     }  }   private boolean checkipaddressformat(string qducipaddress)  // using method called checkipaddressformat , using string qducipaddress {     boolean checkipaddressformatresult = false;     pattern pattern = pattern.compile(ipaddress_pattern);     matcher matcher = pattern.matcher(qducipaddress);     checkipaddressformatresult = matcher.matches();      return checkipaddressformatresult; }   } 

cameraview class

public class cameraview extends surfaceview implements surfaceholder.callback {     private surfaceholder mholder;     private camera mcamera; public cameraview(context context, camera camera) {     super(context);     mcamera = camera;     mcamera.setdisplayorientation(90);     mholder = getholder();     mholder.addcallback(this);     mholder.settype(surfaceholder.surface_type_hardware); }   @override public void surfacecreated(surfaceholder surfaceholder) {     try     {         mcamera.setpreviewdisplay(surfaceholder);         mcamera.startpreview();         log.d("error", "good");     }     catch (ioexception e)     {         log.d("error","camera error on surfacecreated"+ e.getmessage());     } }  @override public void surfacechanged(surfaceholder surfaceholder, int format, int width, int height) {     if (mholder.getsurface() == null)         return;      mcamera.stoppreview();      try     {         mcamera.setpreviewdisplay(mholder);         mcamera.startpreview();     }     catch (ioexception e)     {         log.d("error","camera error on surfacechanged" + e.getmessage());     } }  @override public void surfacedestroyed(surfaceholder surfaceholder) {     mcamera.stoppreview();     mcamera.release(); } } 

the following logcat

01-01 18:35:09.773 15622-15622/? d/androidruntime: >>>>>> androidruntime start com.android.internal.os.runtimeinit <<<<<< 01-01 18:35:09.773 15622-15622/? d/androidruntime: checkjni on 01-01 18:35:09.988 15622-15622/? i/ethernet: loading ethernet jni class 01-01 18:35:10.047 15622-15622/? d/androidruntime: calling main entry com.android.commands.pm.pm                                                     --------- beginning of /dev/log/system 01-01 18:35:10.070 1415-1433/system_process w/activitymanager: no content provider found permission revoke: file:///data/local/tmp/com.video.newfirstworkingapp 01-01 18:35:10.808 1415-1433/system_process w/activitymanager: no content provider found permission revoke: file:///data/local/tmp/com.video.newfirstworkingapp 01-01 18:35:10.898 1415-1417/system_process d/dalvikvm: gc_concurrent freed 383k, 13% free 10545k/12103k, paused 2ms+3ms 01-01 18:35:10.941 1415-1433/system_process d/dalvikvm: gc_for_alloc freed 99k, 14% free 10507k/12103k, paused 42ms 01-01 18:35:10.996 1415-1433/system_process d/dalvikvm: gc_for_alloc freed 86k, 14% free 10514k/12103k, paused 37ms 01-01 18:35:11.093 1415-1433/system_process d/dalvikvm: gc_for_alloc freed 211k, 12% free 10754k/12103k, paused 39ms 01-01 18:35:11.386 1415-1417/system_process d/dalvikvm: gc_concurrent freed 637k, 11% free 10872k/12103k, paused 3ms+3ms 01-01 18:35:11.492 1415-1417/system_process d/dalvikvm: gc_concurrent freed 698k, 11% free 10870k/12103k, paused 3ms+3ms 01-01 18:35:11.601 1415-1417/system_process d/dalvikvm: gc_concurrent freed 701k, 11% free 10874k/12103k, paused 3ms+3ms 01-01 18:35:11.707 1415-1417/system_process d/dalvikvm: gc_concurrent freed 700k, 11% free 10879k/12103k, paused 3ms+4ms 01-01 18:35:11.832 1415-1417/system_process d/dalvikvm: gc_concurrent freed 729k, 11% free 10889k/12103k, paused 3ms+4ms 01-01 18:35:11.886 1415-1433/system_process i/packagemanager: removing non-system package:com.video.newfirstworkingapp 01-01 18:35:11.890 1415-1430/system_process i/activitymanager: force stopping package com.video.newfirstworkingapp uid=10067 01-01 18:35:11.984 1415-1433/system_process i/packagemanager: package com.video.newfirstworkingapp codepath changed /data/app/com.video.newfirstworkingapp-1.apk /data/app/com.video.newfirstworkingapp-2.apk; retaining data , using new 01-01 18:35:11.992 1415-1433/system_process i/packagemanager: running dexopt on: com.video.newfirstworkingapp 01-01 18:35:14.125 15633-15633/? d/dalvikvm: dexopt: couldn't find field landroid/app/notification;.actions 01-01 18:35:14.992 15633-15633/? d/dalvikvm: dexopt: load 245ms, verify+opt 1076ms 01-01 18:35:15.472 1415-1430/system_process i/activitymanager: force stopping package com.video.newfirstworkingapp uid=10067 01-01 18:35:15.472 1415-1433/system_process w/packagemanager: code path pkg : com.video.newfirstworkingapp changing /data/app/com.video.newfirstworkingapp-1.apk /data/app/com.video.newfirstworkingapp-2.apk 01-01 18:35:15.472 1415-1433/system_process w/packagemanager: resource path pkg : com.video.newfirstworkingapp changing /data/app/com.video.newfirstworkingapp-1.apk /data/app/com.video.newfirstworkingapp-2.apk 01-01 18:35:15.543 1415-1417/system_process d/dalvikvm: gc_concurrent freed 652k, 10% free 10927k/12103k, paused 3ms+7ms 01-01 18:35:15.644 1415-1433/system_process d/packagemanager: new package installed in /data/app/com.video.newfirstworkingapp-2.apk 01-01 18:35:15.742 1415-1433/system_process i/activitymanager: force stopping package com.video.newfirstworkingapp uid=10067 01-01 18:35:15.785 1583-1583/com.android.launcher d/dalvikvm: gc_explicit freed 202k, 8% free 9639k/10439k, paused 3ms+5ms 01-01 18:35:15.914 1624-1624/android.process.acore d/dalvikvm: gc_explicit freed 250k, 6% free 8022k/8455k, paused 2ms+4ms 01-01 18:35:15.972 1415-1429/system_process d/dalvikvm: gc_explicit freed 931k, 15% free 10320k/12103k, paused 4ms+5ms 01-01 18:35:15.976 1415-1429/system_process d/packagemanager: generateservicesmap(android.accounts.accountauthenticator): 1 services unchanged 01-01 18:35:15.984 1415-1429/system_process d/packagemanager: generateservicesmap(android.content.syncadapter): 4 services unchanged 01-01 18:35:15.984 1415-1429/system_process d/backupmanagerservice: received broadcast intent { act=android.intent.action.package_removed dat=package:com.video.newfirstworkingapp flg=0x10000010 (has extras) } 01-01 18:35:16.019 1415-1429/system_process d/packagemanager: generateservicesmap(android.accounts.accountauthenticator): 1 services unchanged 01-01 18:35:16.019 1415-1429/system_process d/packagemanager: generateservicesmap(android.content.syncadapter): 4 services unchanged 01-01 18:35:16.043 1415-1429/system_process w/resourcetype: failure getting entry 0x7f060000 (t=5 e=0) in package 0 (error -75) 01-01 18:35:16.062 1415-1429/system_process d/backupmanagerservice: received broadcast intent { act=android.intent.action.package_added dat=package:com.video.newfirstworkingapp flg=0x10000010 (has extras) } 01-01 18:35:16.062 1415-1429/system_process v/backupmanagerservice: updatepackageparticipantslocked: com.video.newfirstworkingapp 01-01 18:35:16.293 1415-1429/system_process d/backupmanagerservice: received broadcast intent { act=android.intent.action.package_replaced dat=package:com.video.newfirstworkingapp flg=0x10000010 (has extras) } 01-01 18:35:16.293 1415-1429/system_process v/backupmanagerservice: updatepackageparticipantslocked: com.video.newfirstworkingapp 01-01 18:35:16.320 2403-2404/com.android.gallery3d d/dalvikvm: gc_concurrent freed 438k, 8% free 7802k/8455k, paused 1ms+2ms 01-01 18:35:16.367 1415-1417/system_process d/dalvikvm: gc_concurrent freed 575k, 14% free 10417k/12103k, paused 3ms+5ms 01-01 18:35:16.558 1415-1433/system_process d/dalvikvm: gc_explicit freed 324k, 15% free 10325k/12103k, paused 7ms+6ms 01-01 18:35:16.617 15622-15622/? d/androidruntime: shutting down vm 01-01 18:35:16.629 15622-15626/? d/dalvikvm: gc_concurrent freed 101k, 83% free 458k/2560k, paused 0ms+0ms 01-01 18:35:16.629 15622-15628/? d/jdwp: got wake-up signal, bailing out of select 01-01 18:35:16.629 15622-15628/? d/dalvikvm: debugger has detached; object registry had 1 entries 01-01 18:35:16.636 15622-15638/? i/androidruntime: note: attach of thread 'binder thread #3' failed 01-01 18:35:17.054 15645-15645/? d/androidruntime: >>>>>> androidruntime start com.android.internal.os.runtimeinit <<<<<< 01-01 18:35:17.054 15645-15645/? d/androidruntime: checkjni on 01-01 18:35:17.297 15645-15645/? i/ethernet: loading ethernet jni class 01-01 18:35:17.367 15645-15645/? d/androidruntime: calling main entry com.android.commands.am.am 01-01 18:35:17.375 1415-1609/system_process i/activitymanager: start {act=android.intent.action.main cat=[android.intent.category.launcher] flg=0x10000000 cmp=com.video.newfirstworkingapp/.mainactivity} pid 15645 01-01 18:35:17.445 15645-15645/? d/androidruntime: shutting down vm 01-01 18:35:17.453 15645-15649/? d/dalvikvm: gc_concurrent freed 102k, 81% free 487k/2560k, paused 1ms+0ms 01-01 18:35:17.453 15645-15651/? d/jdwp: got wake-up signal, bailing out of select 01-01 18:35:17.453 15645-15651/? d/dalvikvm: debugger has detached; object registry had 1 entries 01-01 18:35:17.461 15645-15655/? i/androidruntime: note: attach of thread 'binder thread #3' failed 01-01 18:35:17.476 15656-15656/? d/dalvikvm: not late-enabling checkjni (already on) 01-01 18:35:17.480 1415-1415/system_process i/activitymanager: start proc com.video.newfirstworkingapp activity com.video.newfirstworkingapp/.mainactivity: pid=15656 uid=10067 gids={1006} 01-01 18:35:17.504 15656-15662/? d/dalvikvm: debugger has detached; object registry had 1 entries 01-01 18:35:17.582 15656-15656/? w/dalvikvm: vfy: unable find class referenced in signature (landroid/view/searchevent;) 01-01 18:35:17.582 15656-15656/? i/dalvikvm: not find method android.view.window$callback.onsearchrequested, referenced method android.support.v7.view.windowcallbackwrapper.onsearchrequested 01-01 18:35:17.582 15656-15656/? w/dalvikvm: vfy: unable resolve interface method 19589: landroid/view/window$callback;.onsearchrequested (landroid/view/searchevent;)z 01-01 18:35:17.582 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x72 @ 0x0002 01-01 18:35:17.586 15656-15656/? i/dalvikvm: not find method android.view.window$callback.onwindowstartingactionmode, referenced method android.support.v7.view.windowcallbackwrapper.onwindowstartingactionmode 01-01 18:35:17.586 15656-15656/? w/dalvikvm: vfy: unable resolve interface method 19593: landroid/view/window$callback;.onwindowstartingactionmode (landroid/view/actionmode$callback;i)landroid/view/actionmode; 01-01 18:35:17.586 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x72 @ 0x0002 01-01 18:35:17.605 1583-1583/com.android.launcher d/openglrenderer: flushing caches (mode 1) 01-01 18:35:17.644 15656-15656/? i/dalvikvm: not find method android.view.viewgroup.onwindowsystemuivisibilitychanged, referenced method android.support.v7.widget.actionbaroverlaylayout.onwindowsystemuivisibilitychanged 01-01 18:35:17.644 15656-15656/? w/dalvikvm: vfy: unable resolve virtual method 19488: landroid/view/viewgroup;.onwindowsystemuivisibilitychanged (i)v 01-01 18:35:17.644 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x6f @ 0x0008 01-01 18:35:17.707 15656-15656/? i/dalvikvm: not find method android.view.viewgroup.onrtlpropertieschanged, referenced method android.support.v7.widget.toolbar.onrtlpropertieschanged 01-01 18:35:17.707 15656-15656/? w/dalvikvm: vfy: unable resolve virtual method 19482: landroid/view/viewgroup;.onrtlpropertieschanged (i)v 01-01 18:35:17.707 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x6f @ 0x0007 01-01 18:35:17.711 15656-15656/? i/dalvikvm: not find method android.content.res.typedarray.getchangingconfigurations, referenced method android.support.v7.widget.tinttypedarray.getchangingconfigurations 01-01 18:35:17.711 15656-15656/? w/dalvikvm: vfy: unable resolve virtual method 440: landroid/content/res/typedarray;.getchangingconfigurations ()i 01-01 18:35:17.711 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x6e @ 0x0002 01-01 18:35:17.715 15656-15656/? i/dalvikvm: not find method android.content.res.typedarray.gettype, referenced method android.support.v7.widget.tinttypedarray.gettype 01-01 18:35:17.715 15656-15656/? w/dalvikvm: vfy: unable resolve virtual method 462: landroid/content/res/typedarray;.gettype (i)i 01-01 18:35:17.715 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x6e @ 0x0002 01-01 18:35:17.750 1583-1583/com.android.launcher d/openglrenderer: flushing caches (mode 0) 01-01 18:35:17.785 15656-15656/? i/dalvikvm: not find method android.content.res.resources.getdrawable, referenced method android.support.v7.widget.resourceswrapper.getdrawable 01-01 18:35:17.785 15656-15656/? w/dalvikvm: vfy: unable resolve virtual method 403: landroid/content/res/resources;.getdrawable (ilandroid/content/res/resources$theme;)landroid/graphics/drawable/drawable; 01-01 18:35:17.785 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x6e @ 0x0002 01-01 18:35:17.785 15656-15656/? i/dalvikvm: not find method android.content.res.resources.getdrawablefordensity, referenced method android.support.v7.widget.resourceswrapper.getdrawablefordensity 01-01 18:35:17.785 15656-15656/? w/dalvikvm: vfy: unable resolve virtual method 405: landroid/content/res/resources;.getdrawablefordensity (iilandroid/content/res/resources$theme;)landroid/graphics/drawable/drawable; 01-01 18:35:17.785 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x6e @ 0x0002 01-01 18:35:17.808 15656-15657/? d/dalvikvm: gc_concurrent freed 238k, 5% free 7910k/8263k, paused 3ms+3ms 01-01 18:35:17.824 15656-15656/? i/dalvikvm: not find method android.view.viewgroup$marginlayoutparams.resolvelayoutdirection, referenced method android.support.constraint.constraintlayout$layoutparams.resolvelayoutdirection 01-01 18:35:17.824 15656-15656/? w/dalvikvm: vfy: unable resolve virtual method 19424: landroid/view/viewgroup$marginlayoutparams;.resolvelayoutdirection (i)v 01-01 18:35:17.828 15656-15656/? d/dalvikvm: vfy: replacing opcode 0x6f @ 0x0002 01-01 18:35:17.836 1233-1233/? i/cameraservice: opening camera 0 01-01 18:35:17.836 1233-1233/? i/camerahardwaresec: int android::hal_camera_device_open(const hw_module_t*, const char*, hw_device_t**): open camera 0 01-01 18:35:17.836 1233-1233/? i/seccamera: name of input channel[0] ov3640 01-01 18:35:17.855 1233-1233/? i/seccamera: name of input channel[0] ov3640 01-01 18:35:17.855 1233-1233/? i/seccamera: initcamera : initialized 01-01 18:35:17.855 1233-1233/? i/seccamera: name of input channel[0] ov3640 01-01 18:35:17.855 1233-1233/? d/camerahardwaresec: getpreviewmaxsize return 640,480  01-01 18:35:17.855 1233-1233/? d/camerahardwaresec: getsnapshotmaxsize return 640,480  01-01 18:35:17.855 1233-1233/? i/camerahardwaresec: int android::hal_camera_device_open(const hw_module_t*, const char*, hw_device_t**): opened camera 0 (0x767998) 01-01 18:35:17.859 1233-15672/? i/camerahardwaresec: int android::camerahardwaresec::previewthreadwrapper(): starting 01-01 18:35:17.859 1233-15672/? i/camerahardwaresec: int android::camerahardwaresec::previewthreadwrapper(): calling mseccamera->stoppreview() , waiting 01-01 18:35:17.859 1233-15672/? w/seccamera: int android::seccamera::stoppreview(): doing nothing because m_flag_camera_start 0 01-01 18:35:17.863 1233-1233/? i/awesomeplayer: setdatasource_l('/system/media/audio/ui/camera_click.ogg') 01-01 18:35:17.875 1233-1233/? i/awesomeplayer: setdatasource_l('/system/media/audio/ui/videorecord.ogg') 01-01 18:35:17.894 15656-15656/? d/error: camera 01-01 18:35:17.894 15656-15656/? d/error: able preview camera 01-01 18:35:17.941 15656-15656/? d/libegl: loaded /system/lib/egl/libgles_android.so 01-01 18:35:17.945 15656-15656/? d/libegl: loaded /vendor/lib/egl/libegl_powervr_sgx540_120.so 01-01 18:35:17.953 15656-15656/? d/libegl: loaded /vendor/lib/egl/libglesv1_cm_powervr_sgx540_120.so 01-01 18:35:17.957 15656-15656/? d/libegl: loaded /vendor/lib/egl/libglesv2_powervr_sgx540_120.so 01-01 18:35:18.039 15656-15656/? d/openglrenderer: enabling debug mode 0 01-01 18:35:18.140 1415-1445/system_process i/activitymanager: displayed com.video.newfirstworkingapp/.mainactivity: +704ms 

logcat after connect button clicked

1-01 18:35:30.965 1487-1489/com.android.systemui d/dalvikvm: gc_concurrent freed 202k, 7% free 8406k/9031k, paused 2ms+2ms 01-01 18:35:30.988 1487-1487/com.android.systemui d/dalvikvm: gc_for_alloc freed 207k, 10% free 8198k/9031k, paused 23ms 01-01 18:35:31.074 1487-1487/com.android.systemui d/dalvikvm: gc_for_alloc freed 311k, 10% free 8198k/9031k, paused 19ms 01-01 18:35:31.566 2417-2419/com.android.vending d/dalvikvm: gc_concurrent freed 370k, 8% free 8093k/8775k, paused 2ms+2ms 01-01 18:35:31.652 2417-2417/com.android.vending d/finsky: [1] 5.onfinished: installation state replication succeeded. 01-01 18:35:38.265 1415-1573/system_process i/activitymanager: start {cmp=com.video.newfirstworkingapp/.cameraview} pid 15656 01-01 18:35:38.273 1233-1407/? d/audiohardware: audiohardware pcm playback exiting standby. 01-01 18:35:38.273 1233-1407/? d/audiohardware: openpcmout_l() mpcmopencnt: 0 01-01 18:35:38.304 15656-15656/com.video.newfirstworkingapp d/error: able go next class 01-01 18:35:38.316 15656-15656/com.video.newfirstworkingapp d/dalvikvm: newinstance failed: no <init>() 01-01 18:35:38.316 15656-15656/com.video.newfirstworkingapp d/androidruntime: shutting down vm 01-01 18:35:38.316 15656-15656/com.video.newfirstworkingapp w/dalvikvm: threadid=1: thread exiting uncaught exception (group=0x40a451f8) 01-01 18:35:38.320 15656-15656/com.video.newfirstworkingapp e/androidruntime: fatal exception: main                                                                               java.lang.runtimeexception: unable instantiate activity componentinfo{com.video.newfirstworkingapp/com.video.newfirstworkingapp.cameraview}: java.lang.instantiationexception: can't instantiate class com.video.newfirstworkingapp.cameraview; no empty constructor                                                                                   @ android.app.activitythread.performlaunchactivity(activitythread.java:1880)                                                                                   @ android.app.activitythread.handlelaunchactivity(activitythread.java:1981)                                                                                   @ android.app.activitythread.access$600(activitythread.java:123)                                                                                   @ android.app.activitythread$h.handlemessage(activitythread.java:1147)                                                                                   @ android.os.handler.dispatchmessage(handler.java:99)                                                                                   @ android.os.looper.loop(looper.java:137)                                                                                   @ android.app.activitythread.main(activitythread.java:4424)                                                                                   @ java.lang.reflect.method.invokenative(native method)                                                                                   @ java.lang.reflect.method.invoke(method.java:511)                                                                                   @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:784)                                                                                   @ com.android.internal.os.zygoteinit.main(zygoteinit.java:551)                                                                                   @ dalvik.system.nativestart.main(native method)                                                                                caused by: java.lang.instantiationexception: can't instantiate class com.video.newfirstworkingapp.cameraview; no empty constructor                                                                                   @ java.lang.class.newinstanceimpl(native method)                                                                                   @ java.lang.class.newinstance(class.java:1319)                                                                                   @ android.app.instrumentation.newactivity(instrumentation.java:1023)                                                                                   @ android.app.activitythread.performlaunchactivity(activitythread.java:1871)                                                                                   @ android.app.activitythread.handlelaunchactivity(activitythread.java:1981)                                                                                    @ android.app.activitythread.access$600(activitythread.java:123)                                                                                    @ android.app.activitythread$h.handlemessage(activitythread.java:1147)                                                                                    @ android.os.handler.dispatchmessage(handler.java:99)                                                                                    @ android.os.looper.loop(looper.java:137)                                                                                    @ android.app.activitythread.main(activitythread.java:4424)                                                                                    @ java.lang.reflect.method.invokenative(native method)                                                                                    @ java.lang.reflect.method.invoke(method.java:511)                                                                                    @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:784)                                                                                    @ com.android.internal.os.zygoteinit.main(zygoteinit.java:551)                                                                                    @ dalvik.system.nativestart.main(native method)  01-01 18:35:38.340 1415-1426/system_process w/activitymanager:   force finishing activity com.video.newfirstworkingapp/.cameraview 01-01 18:35:38.340 1415-1426/system_process w/activitymanager:   force finishing activity com.video.newfirstworkingapp/.mainactivity 01-01 18:35:38.386 1415-1417/system_process d/dalvikvm: gc_concurrent freed 538k, 14% free 10459k/12103k, paused 3ms+4ms 01-01 18:35:38.840 1415-1429/system_process w/activitymanager: activity pause timeout activityrecord{414ef840 com.video.newfirstworkingapp/.cameraview} 01-01 18:35:41.285 1233-1407/? d/audiohardware: audiohardware pcm playback going standby. 01-01 18:35:41.285 1233-1407/? d/audiohardware: closepcmout_l() mpcmopencnt: 1 01-01 18:35:49.031 1415-1429/system_process w/activitymanager: activity destroy timeout activityrecord{413ef6b8 com.video.newfirstworkingapp/.mainactivity} 01-01 18:35:49.031 1415-1429/system_process w/activitymanager: activity destroy timeout activityrecord{414ef840 com.video.newfirstworkingapp/.cameraview} 

you trying start activity, cameraview isn't activity, here:

            intent changepageintent = new intent(mainactivity.this,cameraview.class);             startactivity(changepageintent); 

if want activity holding surfaceview , should create new class extending activity , implement surfaceview there.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -