I have three files such as
- activity class
- db handler class
- fragment class
From my resource file, on a button click I am calling a method (add). The method is defined in the DB Class. and I am trying to call it from the fragment class related with the res file. But when I do I am getting an error:
Could not find a method add(View) in the activity class MainActivity for onClick handler on view class android.widget.Button with id 'btStartCall'
I think I need to initialize the method in activity class to use it. But I am not sure how to do it. Can anyone help me with a simple example?