This is the error that I’m getting but I’m not getting any Quick Fixes on how to fix it. It just gives me the error. I’m a newbie with fixing errors for an Android app.
The bit of code that is throwing the error:
Toast.makeText(CameraPreview2.this, "Cancelled!", Toast.LENGTH_LONG).show();
The error:
The method makeText(Context, CharSequence, int) in the type Toast is not
applicable for the arguments (CameraPreview2<detailLayout>, String, int)
The full code is:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if (resultCode == RESULT_OK) {
if (requestCode == 1) {
uriVideo = data.getData();
Toast.makeText(CameraPreview2.this, uriVideo.getPath(),
Toast.LENGTH_LONG).show();
}
} else if (resultCode == RESULT_CANCELED) {
uriVideo = null;
Toast.makeText(CameraPreview2.this, "Cancelled!", Toast.LENGTH_LONG)
.show();
...
Impossible to say with the little bit of code you posted but
Toast.makeText(...)does take aContext(which typically is something likethisorClassName.this.) i’m not sure what you passed it but clearly it isn’t a Context.