This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 484
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.
 
Those are the largest trousers in the world! Especially when next to this ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!