• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

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: 491
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.
 
Rancher
Posts: 3353
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.
 
A feeble attempt to tell you about our stuff that makes us money
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!