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?
I don't know about this but one thing I must say: \[\huge \color{green}{\textbf{Welcome To Openstudy..} {\checkmark} }\]
Thank you :)
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.
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
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 ?
Ummm Just Try To do a New Installation On Ya Pc Download Windows 7
Join our real-time social learning platform and learn together with your friends!