Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Suppose i have a actvity named "" which has a method dosearch().

there is fragment class named "" and it is called from "" class

can i call dosearch() method in

if possible how to call?

and i want to call this dosearch() method on click of a button in class.

What I have tried:

i tried calling a method from a activity in fragment class of another activity..but did not work?
Updated 5-Oct-17 9:29am

1 solution

In order to call the dosearch() method from within the fragment class, you'd either need to make the dosearch() method static, or you would need a SearchActivity object.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900