I have at my app dialog which sends data to host activity. In Java I had to implement interface from this dialog and everything worked fine. At kotlin I saw that my listener isn't called anyway. At my dialog I have two buttons which call activity class:
okFilter.setOnClickListener(view1 -> {
dismiss();
Intent intent = new Intent(getContext(), HomeScreen.class);
intent.putExtra("filter_data",data);
intent.putExtra("id",4);
startActivity(intent);
});
and I have also interface:
public interface OnButtonClick {
void onDialogClickListener(Integer job_type, HashMap<String, String> filter_data);
}
but onDialogClickListener
isn't used anyway :( Then I have implemented this interface at hosting activity:
override fun onDialogClickListener(job_type: Int?, filter_data: java.util.HashMap<String, String>?) {
bottom_navigation_t.selectedItemId = R.id.full_jobAgent
val jobList = JobList()
val bundle = Bundle()
bundle.putInt("offset", 1)
bundle.putSerializable("filter_data", data)
jobList.arguments = bundle
transaction.replace(R.id.contentContainerT, jobList).addToBackStack(null).commit()
}
and it doesn't work. This fun isn't called and I catch only intent data. In Java it worked, what I did wrong?