• 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
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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: 3276
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!