Toast toast=Toast.makeText(cordova.getActivity(),"请在系统设置开启相机权限",Toast.LENGTH_LONG);
showtoast(toast,4000);
//设置吐司时长
public voidshowtoast(finalToast toast,finalint cnt){
final Timertimer=new Timer();
timer.schedule(newTimerTask() {
@Override
public voidrun() {
toast.show();
}
},0,cnt);
new Timer().schedule(newTimerTask() {
@Override
public voidrun() {
toast.cancel();
timer.cancel();
}
},cnt);
}