• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

passing methods between java files  RSS feed

 
Greenhorn
Posts: 1
Android Eclipse IDE IntelliJ IDE
  • Mark post as helpful
  • send pies
  • 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: 480
10
Android Open BSD Slackware
  • Mark post as helpful
  • send pies
  • 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.
 
Master Rancher
Posts: 3270
33
  • Mark post as helpful
  • send pies
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!