Android Question Inline Java Try/Catch statement

Jack Howard

Member
Licensed User
Longtime User
I am new to using inline Java.

I have a couple of routines working.

But I don't seem able to get the Try catch Syntax correct.

public int Cam2_Test() {
BA.Log("Cam2_Test START");
Int_Test_Result=0;
String_Test_Result =null;
// manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);

Try {
String_Test_Result = "T1"; // manager.getCameraIdList()[0];
// } Catch //(CameraAccessException e) {
}catch(Exception e){
// String_Test_Result ="Failed";
BA.Log("Crash");
// //e.printStackTrace();
}
BA.Log("Cam2_Test END");
BA.Log(String_Test_Result);
return Int_Test_Result;
}

On the try line I get
src\anywheresoftware\b4a\samples\camera\main.java:580: error: not a statement
 

Jack Howard

Member
Licensed User
Longtime User
Thanks Roycefer, the help on this forum and Erels examples really helps us starters, I just need to "TRY" harder in Java :)
 
Upvote 0
Top