这是我得到的错误,但我没有得到任何关于如何修复它的快速修复。它只是给了我错误。我是修复 Android 应用程序错误的新手。
引发错误的代码位:
Toast.makeText(CameraPreview2.this, "Cancelled!", Toast.LENGTH_LONG).show();
错误:
The method makeText(Context, CharSequence, int) in the type Toast is not
applicable for the arguments (CameraPreview2<detailLayout>, String, int)
完整的代码是:
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();
...