kotlin return to previous activity
snippet in kotlin

kotlin return to previous activity

user3866

if you use fragment u should use

getActivity().onBackPressed();
if you use single activity u can use

finish();