Results 1 to 4 of 4
  1. #1
    polhallen is offline Member
    Join Date
    Oct 2012
    Rep Power

    Default methods with args (How call it?)

    Hello all! :-) I'm obviously newbie

    I've a method like this:

    public void putText(String text){
    int sdk = android.os.Build.VERSION.SDK_INT;
    if(sdk < 11) {
    android.text.ClipboardManager clipboard = (android.text.ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVIC E);

    this code check version of android sdk

    I don't understand I can start this method because has the args

    Using putText() I've an error:

    The method setText(String) in the type MyApp is not applicable for the arguments ()

    how I resolve?


  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default Re: methods with args (How call it?)

    You need to pass a String object into the method when calling it. If you haven't done so, consider going through some introductory Java tutorials before trying Android coding. It can save you from a world of pain and frustration. Please have a look here.

  3. #3
    Darkzombies is offline Senior Member
    Join Date
    Nov 2012
    Rep Power

    Default Re: methods with args (How call it?)

    Simple, it needs the string input for it to return. I.E. putText("EXAMPLE"); rather than putText(); I agree with Fubarable, if you really don't even know that much, you should probably do some tutorials before even attempting.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

Similar Threads

  1. how can main call other methods?
    By rahuld.exe in forum New To Java
    Replies: 1
    Last Post: 04-06-2012, 02:19 PM
  2. Java Noob, trying to call methods from another methods
    By gabrielpr12 in forum New To Java
    Replies: 8
    Last Post: 11-17-2011, 10:07 PM
  3. how to call or use methods inside interface?
    By akhmad in forum New To Java
    Replies: 2
    Last Post: 11-10-2010, 10:55 AM
  4. Call Static Methods Outside Classes
    By Insomniac Riot in forum New To Java
    Replies: 4
    Last Post: 05-11-2010, 11:03 PM
  5. How to call methods of different classes
    By adeeb in forum New To Java
    Replies: 2
    Last Post: 06-06-2008, 07:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts