1
    //calling Activity written in kotlin but activity is 
    //not started and giving below-mentioned exception

Exception: android.content.ActivityNotFoundException: Unable to find explicit activity class com.myApp.personal/com.myApp.personal.camera.CameraActivityKt have you declared this activity in your AndroidManifest.xml?

    //while Registered in manifest file: 
   <activity 
   android:name=
   ".camera.CameraActivity"android:screenOrientation="fullSensor"/>



    try{ 
       File f = setUpPhotoFile(prefixString); mCurrentPhotoPath =
       f.getAbsolutePath();
       Intent intent = new Intent(this, CameraActivityKt.class);
       intent.putExtra(IConstant.PATH, mCurrentPhotoPath);    
       startActivityForResult(intent, actionCode); 
    } 
    catch(Exception ex) {
       e.printStackTrace(); 
    }
Jaymin
  • 2,879
  • 3
  • 19
  • 35
Amrit Chakradhari
  • 270
  • 1
  • 4
  • 15

1 Answers1

0

I got the Solution Kotlin activity will called like this from a java class:

  Intent intent = new Intent(this, CameraActivity.class);
  intent.putExtra(IConstant.PATH, mCurrentPhotoPath);
 ((Activity) mContext).startActivityForResult(intent, actionCode);
Amrit Chakradhari
  • 270
  • 1
  • 4
  • 15