Ask your own question, for FREE!
Computer Science 29 Online
OpenStudy (anonymous):

Hello, ive been programming in java lately,specifically android, and i've run into a problem in java. I have been trying to use methods in java. For example purposes: here is my situation with different code: I want to use a the method methodexample from main2.java in mainactivity.java however whenever i call upon the method, it of course has plenty of priblems, such as cannot use "this" and so on. however when i do get a working method, and i call upon and use it in my coding in mainactivity.java. nothing happens, there is no error it says. Can anyone help?

OpenStudy (anonymous):

I don't know about this but one thing I must say: \[\huge \color{green}{\textbf{Welcome To Openstudy..} {\checkmark} }\]

OpenStudy (anonymous):

Thank you :)

OpenStudy (anonymous):

I'm not sure about that, but I think that one day I read that you need to use an activity for every method, try to search this, maybe it will help you. Good luck.

OpenStudy (anonymous):

i think for function calling mainactivity.java should be your by default created class and you should create and call the function within same class.can you post your "mainactivity.java ,main.xml and android manifest " files here

OpenStudy (anonymous):

if you want to call methode from other class with the key word "this", you must extend your class in the second class and use this.yourmethode(); (inheritance); or you can instanciate you first class in the seconde class and use the reference to call your methode if you want past this part of your code, perhaps I can help you ?

OpenStudy (anonymous):

Ummm Just Try To do a New Installation On Ya Pc Download Windows 7

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
YoungBlood: pfp wonu2019t let me switch
1 hour ago 1 Reply 0 Medals
Austinsbabygirl4life: Do you think guys would survive on periods?
4 hours ago 22 Replies 2 Medals
alyviahwillis: if anyone has any questions feel free to DM me... I don't mind at all.
6 hours ago 0 Replies 0 Medals
Rosee5656: how do I level up!??!? >,
4 hours ago 14 Replies 4 Medals
Abby13915: I made an alpaca for my fashion club
10 hours ago 3 Replies 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!