is there anyway to listen on UIevents such as button click on main/ui thread? without interacting directly on each UI's callbacks(e.g onClickListener) ?
I just want to listen to any thing it fires from ui events, I've been digging around but I only find something that posts message to the ui thread from another thread, what I want is just listen to UI thread when for example a button is clicked,
findViewById(R.id.button_1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// some button click stuffs here
}
});
// this is where I want to listen from ui events (e.g click),
// and determine what type of view that triggered that event
// or how to get the actual view object that triggered it
I'm assuming that this could already be asked(It will be fine if this will be marked as duplicate, but please provide a related post if there is/are), every time I try to search for something like "listen to main thread", I cant find something like what exactly I need, Any help would be greatly appreciated, or any related links.
Edit: the current situation is, there is no way for me to interact with an existing code, so I'm trying to find a way to listen on those UI events without touching the actual codes(via separate module/library), I dont know if this is possible to achieve though