• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

passing methods between java files

 
Greenhorn
Posts: 1
Android IntelliJ IDE Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am on android studio and I am trying to use a class method in other java files. I have the classes in the permissionHelper.java file and I am currently trying to reference them in the homePage.java file. I will have to use them in other files too though. With the current code, I get the  "getToastDisplay in permissionHelper cannot be applied to: expected parameters:  actual argument:" error. Anybody know how to solve this issue? Any help is appreciated.

permissionHelper.java :




homePage.java:











 
Ranch Hand
Posts: 607
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java does not work like this.
try to instatiate the method as static in the helperclass, then control you pass the right parameters.
 
Rancher
Posts: 5116
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

expected parameters:  actual argument:


It would be helpful if you copied the full text of the error message and paste it in your post.

The getToastDisplay method defined in permissionHelper takes arguments.  The code that is trying to call it doesn't provide any arguments.
 
reply
    Bookmark Topic Watch Topic
  • New Topic