Camerakit-android: Can't create handler inside thread that has not called Looper.prepare()

Created on 8 Oct 2017  路  8Comments  路  Source: CameraKit/camerakit-android

java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.(Handler.java:200)
at android.os.Handler.(Handler.java:114)
at android.widget.Toast$TN$2.(Toast.java:343)
at android.widget.Toast$TN.(Toast.java:343)
at android.widget.Toast.(Toast.java:103)
at android.widget.Toast.makeText(Toast.java:262)
at com.example.zzapp.MainActivity$2.onPictureTaken(MainActivity.java:129)
at com.wonderkiln.camerakit.CameraView$CameraListenerMiddleWare.onPictureTaken(CameraView.java:524)
at com.wonderkiln.camerakit.Camera1$3$1.onStillProcessed(Camera1.java:308)
at com.wonderkiln.camerakit.ProcessStillTask.run(ProcessStillTask.java:47)
at java.lang.Thread.run(Thread.java:760)

Most helpful comment

Use this its work for me ....
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(), "Status = " + message , Toast.LENGTH_LONG).show();
}
});

All 8 comments

This error is not related to the library, I bet you are not using Toast properly, check your implementation. Don't call it from worker thread

You are right

no problem, please close the issue if its resolved for you

thx

Use this its work for me ....
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(), "Status = " + message , Toast.LENGTH_LONG).show();
}
});

Use this its work for me ....
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(), "Status = " + message , Toast.LENGTH_LONG).show();
}
});

thanx this works for me

Use this its work for me ....
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(), "Status = " + message , Toast.LENGTH_LONG).show();
}
});

You saved my day, thank you a lot!

Use this its work for me ....
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(), "Status = " + message , Toast.LENGTH_LONG).show();
}
});

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MuhammedRefaat picture MuhammedRefaat  路  3Comments

mhwu1103 picture mhwu1103  路  6Comments

nethergrim picture nethergrim  路  5Comments

cabflip picture cabflip  路  3Comments

ritesh94 picture ritesh94  路  6Comments