我想实现addOnDestinationChangedListener,但是没有运气。我已经尝试过自己实现,但ID不匹配
$end = \Carbon\Carbon::parse($request->tgl_mulai)->addDays(3);
我尝试记录它,这是结果
NavController mController = Navigation.findNavController(this,R.id.nav_auth_fragment);
mController.addOnDestinationChangedListener((controller,destination,arguments) -> {
switch (destination.getId()){
case R.id.action_loginFragment_to_numberEntryFragment:
Toast.makeText(this,"Welcome to number Entry",Toast.LENGTH_SHORT).show();
break;
case R.id.action_numberEntryFragment_to_otpFragment:
Toast.makeText(this,"Enter your OTP",Toast.LENGTH_SHORT).show();
break;
case R.id.action_otpFragment_to_userRegistrationFragment:
Toast.makeText(this,"Your number is verified!",Toast.LENGTH_SHORT).show();
break;
default:
break;
}
});