• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help changing Java code into a method addText (String text).

 
Eli Kook
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone, I have a homework assignment for my study Android application development that I need help with, I am only a beginner.
In my code (I did not write it, its a part of the study) in the methods onCreate, onSrart, onRestart, onResume, onPause, onStop I repeat the following line each time:

ausgabe += "First Activity - \"onStart\" durchlaufen\"n;
tvAnzeige.setText(ausgabe);

My assignment is to store these two lines in a method addText(String text) so that each time I will only invoke this method instead of using the repetition.
My question is how do I do this? A pseudocode will be very helpful.
I thank you in advance for any help or information.


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first step is to declare a method with a single parameter. Do you know how to that? If not, do you know how to create a method without any parameters?
 
Eli Kook
Greenhorn
Posts: 27
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic