Android: How to set a default value for an argument variable












17














Android function



PHP example:



function HaHa($a = "Test")
{
print $a;
}


The question is how to do it in android...



public void someFunction(int ttt = 5)
{
// something
}


The solution above doesn't work, how can I do it?



Thanks!










share|improve this question
























  • I don't think we can do that in Java. and I just can make a wild guess, if I remember correctly, that this is a feature that is supposed to be in Java 7. So in this case, one can check the variable ttt for being null, and if its null, assign a value to it.
    – Aman Alam
    Apr 7 '11 at 12:55






  • 1




    Related: Does Java support default parameter values?
    – eldarerathis
    Apr 7 '11 at 12:57










  • Possible duplicate of Java optional parameters
    – T.Todua
    Jan 12 '17 at 8:29
















17














Android function



PHP example:



function HaHa($a = "Test")
{
print $a;
}


The question is how to do it in android...



public void someFunction(int ttt = 5)
{
// something
}


The solution above doesn't work, how can I do it?



Thanks!










share|improve this question
























  • I don't think we can do that in Java. and I just can make a wild guess, if I remember correctly, that this is a feature that is supposed to be in Java 7. So in this case, one can check the variable ttt for being null, and if its null, assign a value to it.
    – Aman Alam
    Apr 7 '11 at 12:55






  • 1




    Related: Does Java support default parameter values?
    – eldarerathis
    Apr 7 '11 at 12:57










  • Possible duplicate of Java optional parameters
    – T.Todua
    Jan 12 '17 at 8:29














17












17








17


1





Android function



PHP example:



function HaHa($a = "Test")
{
print $a;
}


The question is how to do it in android...



public void someFunction(int ttt = 5)
{
// something
}


The solution above doesn't work, how can I do it?



Thanks!










share|improve this question















Android function



PHP example:



function HaHa($a = "Test")
{
print $a;
}


The question is how to do it in android...



public void someFunction(int ttt = 5)
{
// something
}


The solution above doesn't work, how can I do it?



Thanks!







java variables arguments default






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 22 '18 at 8:44









Yogesh Suthar

26.7k175891




26.7k175891










asked Apr 7 '11 at 12:53









M.V.

95472652




95472652












  • I don't think we can do that in Java. and I just can make a wild guess, if I remember correctly, that this is a feature that is supposed to be in Java 7. So in this case, one can check the variable ttt for being null, and if its null, assign a value to it.
    – Aman Alam
    Apr 7 '11 at 12:55






  • 1




    Related: Does Java support default parameter values?
    – eldarerathis
    Apr 7 '11 at 12:57










  • Possible duplicate of Java optional parameters
    – T.Todua
    Jan 12 '17 at 8:29


















  • I don't think we can do that in Java. and I just can make a wild guess, if I remember correctly, that this is a feature that is supposed to be in Java 7. So in this case, one can check the variable ttt for being null, and if its null, assign a value to it.
    – Aman Alam
    Apr 7 '11 at 12:55






  • 1




    Related: Does Java support default parameter values?
    – eldarerathis
    Apr 7 '11 at 12:57










  • Possible duplicate of Java optional parameters
    – T.Todua
    Jan 12 '17 at 8:29
















I don't think we can do that in Java. and I just can make a wild guess, if I remember correctly, that this is a feature that is supposed to be in Java 7. So in this case, one can check the variable ttt for being null, and if its null, assign a value to it.
– Aman Alam
Apr 7 '11 at 12:55




I don't think we can do that in Java. and I just can make a wild guess, if I remember correctly, that this is a feature that is supposed to be in Java 7. So in this case, one can check the variable ttt for being null, and if its null, assign a value to it.
– Aman Alam
Apr 7 '11 at 12:55




1




1




Related: Does Java support default parameter values?
– eldarerathis
Apr 7 '11 at 12:57




Related: Does Java support default parameter values?
– eldarerathis
Apr 7 '11 at 12:57












Possible duplicate of Java optional parameters
– T.Todua
Jan 12 '17 at 8:29




Possible duplicate of Java optional parameters
– T.Todua
Jan 12 '17 at 8:29












6 Answers
6






active

oldest

votes


















12














No, Java does not support default values for function parameteres. There's an interesting post about borrowing language features here: http://java.dzone.com/news/default-argument-values-java






share|improve this answer





















  • I thought so but native functions support it somehow... I can't actually remember one... Or for example JSONArray can be built from different sources: String, JSONTokener x, Collection collection or blank... I thought there could be work around
    – M.V.
    Apr 7 '11 at 13:02










  • Well work around for me is to put String inside and can add or remove arguments...
    – M.V.
    Apr 7 '11 at 13:03










  • In this article it is great workaround... Thanks!
    – M.V.
    Apr 7 '11 at 14:16










  • Glad you found it helpful :)
    – Bendihossan
    Apr 7 '11 at 14:36










  • thank you for No.
    – Muhammad Saqib
    Jan 30 '17 at 17:34



















10














You can abuse overloading like this:



int someMethod() { return someMethod(42); }
int someMethod(int arg) { .... }





share|improve this answer





























    7














    No need to overload anything, just write:



    public int getScore(int score, Integer... bonus)
    {
    if(bonus.length > 0)
    {
    return score + bonus[0];
    }
    else
    {
    return score;
    }
    }





    share|improve this answer





















    • I think this is better. It can be simplified such as return bonus.length > 0 ? score + bonus[0] : score;
      – Sithu
      Feb 25 '16 at 7:25










    • I like your way.
      – Malv
      Nov 21 '18 at 9:00



















    3














    you can use 3 dots syntax:



    public void doSomething(boolean... arg1) {
    boolean MyArg1= (arg1.length >= 1) ? arg1 : false;
    }





    share|improve this answer































      1














      You can use overloading a function .
      The overloading is also okay but in case you need default values for multiple arguments you will end up creating having many methods with all possible combination of default arguments, for the example you use imagine you want to have a default value for the 3 arguments. you will end up with this



      public void methodA(A arg1) {  }
      public void methodA( B arg2,) { }
      public void methodA(C arg3) { }
      public void methodA(A arg1, B arg2) { }
      public void methodA(A arg1, C arg3) { }
      public void methodA( B arg2, C arg3) { }
      public void methodA(A arg1, B arg2, C arg3) { }


      So here's the hack i did for me , you can also use



      public static void main(String args)
      {
      defaultParameter();
      defaultParameter(true);
      }

      public static void defaultParameter(Boolean ...gender)
      {
      boolean genderBoolean = false; // It the default value you want to give
      if(gender.length == 1)
      {
      genderBoolean = gender[0]; // Overrided Value
      }
      System.out.println(genderBoolean);
      }


      The above code will genrate result



      false
      true


      I find out here the example java-default-parameter-values






      share|improve this answer





























        0














        Java doesn't support a syntax that will do what you want.



        Perhaps at the start of someFunction(int), you could just check the incoming value, and assign a different value if you don't like what's coming in.



        if (ttt == 0) ttt = 5;


        Please note this question appears to have nothing to do with android, and so is improperly tagged.






        share|improve this answer





















          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f5581360%2fandroid-how-to-set-a-default-value-for-an-argument-variable%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          6 Answers
          6






          active

          oldest

          votes








          6 Answers
          6






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          12














          No, Java does not support default values for function parameteres. There's an interesting post about borrowing language features here: http://java.dzone.com/news/default-argument-values-java






          share|improve this answer





















          • I thought so but native functions support it somehow... I can't actually remember one... Or for example JSONArray can be built from different sources: String, JSONTokener x, Collection collection or blank... I thought there could be work around
            – M.V.
            Apr 7 '11 at 13:02










          • Well work around for me is to put String inside and can add or remove arguments...
            – M.V.
            Apr 7 '11 at 13:03










          • In this article it is great workaround... Thanks!
            – M.V.
            Apr 7 '11 at 14:16










          • Glad you found it helpful :)
            – Bendihossan
            Apr 7 '11 at 14:36










          • thank you for No.
            – Muhammad Saqib
            Jan 30 '17 at 17:34
















          12














          No, Java does not support default values for function parameteres. There's an interesting post about borrowing language features here: http://java.dzone.com/news/default-argument-values-java






          share|improve this answer





















          • I thought so but native functions support it somehow... I can't actually remember one... Or for example JSONArray can be built from different sources: String, JSONTokener x, Collection collection or blank... I thought there could be work around
            – M.V.
            Apr 7 '11 at 13:02










          • Well work around for me is to put String inside and can add or remove arguments...
            – M.V.
            Apr 7 '11 at 13:03










          • In this article it is great workaround... Thanks!
            – M.V.
            Apr 7 '11 at 14:16










          • Glad you found it helpful :)
            – Bendihossan
            Apr 7 '11 at 14:36










          • thank you for No.
            – Muhammad Saqib
            Jan 30 '17 at 17:34














          12












          12








          12






          No, Java does not support default values for function parameteres. There's an interesting post about borrowing language features here: http://java.dzone.com/news/default-argument-values-java






          share|improve this answer












          No, Java does not support default values for function parameteres. There's an interesting post about borrowing language features here: http://java.dzone.com/news/default-argument-values-java







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 7 '11 at 12:58









          Bendihossan

          99931125




          99931125












          • I thought so but native functions support it somehow... I can't actually remember one... Or for example JSONArray can be built from different sources: String, JSONTokener x, Collection collection or blank... I thought there could be work around
            – M.V.
            Apr 7 '11 at 13:02










          • Well work around for me is to put String inside and can add or remove arguments...
            – M.V.
            Apr 7 '11 at 13:03










          • In this article it is great workaround... Thanks!
            – M.V.
            Apr 7 '11 at 14:16










          • Glad you found it helpful :)
            – Bendihossan
            Apr 7 '11 at 14:36










          • thank you for No.
            – Muhammad Saqib
            Jan 30 '17 at 17:34


















          • I thought so but native functions support it somehow... I can't actually remember one... Or for example JSONArray can be built from different sources: String, JSONTokener x, Collection collection or blank... I thought there could be work around
            – M.V.
            Apr 7 '11 at 13:02










          • Well work around for me is to put String inside and can add or remove arguments...
            – M.V.
            Apr 7 '11 at 13:03










          • In this article it is great workaround... Thanks!
            – M.V.
            Apr 7 '11 at 14:16










          • Glad you found it helpful :)
            – Bendihossan
            Apr 7 '11 at 14:36










          • thank you for No.
            – Muhammad Saqib
            Jan 30 '17 at 17:34
















          I thought so but native functions support it somehow... I can't actually remember one... Or for example JSONArray can be built from different sources: String, JSONTokener x, Collection collection or blank... I thought there could be work around
          – M.V.
          Apr 7 '11 at 13:02




          I thought so but native functions support it somehow... I can't actually remember one... Or for example JSONArray can be built from different sources: String, JSONTokener x, Collection collection or blank... I thought there could be work around
          – M.V.
          Apr 7 '11 at 13:02












          Well work around for me is to put String inside and can add or remove arguments...
          – M.V.
          Apr 7 '11 at 13:03




          Well work around for me is to put String inside and can add or remove arguments...
          – M.V.
          Apr 7 '11 at 13:03












          In this article it is great workaround... Thanks!
          – M.V.
          Apr 7 '11 at 14:16




          In this article it is great workaround... Thanks!
          – M.V.
          Apr 7 '11 at 14:16












          Glad you found it helpful :)
          – Bendihossan
          Apr 7 '11 at 14:36




          Glad you found it helpful :)
          – Bendihossan
          Apr 7 '11 at 14:36












          thank you for No.
          – Muhammad Saqib
          Jan 30 '17 at 17:34




          thank you for No.
          – Muhammad Saqib
          Jan 30 '17 at 17:34













          10














          You can abuse overloading like this:



          int someMethod() { return someMethod(42); }
          int someMethod(int arg) { .... }





          share|improve this answer


























            10














            You can abuse overloading like this:



            int someMethod() { return someMethod(42); }
            int someMethod(int arg) { .... }





            share|improve this answer
























              10












              10








              10






              You can abuse overloading like this:



              int someMethod() { return someMethod(42); }
              int someMethod(int arg) { .... }





              share|improve this answer












              You can abuse overloading like this:



              int someMethod() { return someMethod(42); }
              int someMethod(int arg) { .... }






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 7 '11 at 15:20









              Ingo

              31.7k54489




              31.7k54489























                  7














                  No need to overload anything, just write:



                  public int getScore(int score, Integer... bonus)
                  {
                  if(bonus.length > 0)
                  {
                  return score + bonus[0];
                  }
                  else
                  {
                  return score;
                  }
                  }





                  share|improve this answer





















                  • I think this is better. It can be simplified such as return bonus.length > 0 ? score + bonus[0] : score;
                    – Sithu
                    Feb 25 '16 at 7:25










                  • I like your way.
                    – Malv
                    Nov 21 '18 at 9:00
















                  7














                  No need to overload anything, just write:



                  public int getScore(int score, Integer... bonus)
                  {
                  if(bonus.length > 0)
                  {
                  return score + bonus[0];
                  }
                  else
                  {
                  return score;
                  }
                  }





                  share|improve this answer





















                  • I think this is better. It can be simplified such as return bonus.length > 0 ? score + bonus[0] : score;
                    – Sithu
                    Feb 25 '16 at 7:25










                  • I like your way.
                    – Malv
                    Nov 21 '18 at 9:00














                  7












                  7








                  7






                  No need to overload anything, just write:



                  public int getScore(int score, Integer... bonus)
                  {
                  if(bonus.length > 0)
                  {
                  return score + bonus[0];
                  }
                  else
                  {
                  return score;
                  }
                  }





                  share|improve this answer












                  No need to overload anything, just write:



                  public int getScore(int score, Integer... bonus)
                  {
                  if(bonus.length > 0)
                  {
                  return score + bonus[0];
                  }
                  else
                  {
                  return score;
                  }
                  }






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 3 '13 at 8:35









                  Hamzeh Soboh

                  4,42052850




                  4,42052850












                  • I think this is better. It can be simplified such as return bonus.length > 0 ? score + bonus[0] : score;
                    – Sithu
                    Feb 25 '16 at 7:25










                  • I like your way.
                    – Malv
                    Nov 21 '18 at 9:00


















                  • I think this is better. It can be simplified such as return bonus.length > 0 ? score + bonus[0] : score;
                    – Sithu
                    Feb 25 '16 at 7:25










                  • I like your way.
                    – Malv
                    Nov 21 '18 at 9:00
















                  I think this is better. It can be simplified such as return bonus.length > 0 ? score + bonus[0] : score;
                  – Sithu
                  Feb 25 '16 at 7:25




                  I think this is better. It can be simplified such as return bonus.length > 0 ? score + bonus[0] : score;
                  – Sithu
                  Feb 25 '16 at 7:25












                  I like your way.
                  – Malv
                  Nov 21 '18 at 9:00




                  I like your way.
                  – Malv
                  Nov 21 '18 at 9:00











                  3














                  you can use 3 dots syntax:



                  public void doSomething(boolean... arg1) {
                  boolean MyArg1= (arg1.length >= 1) ? arg1 : false;
                  }





                  share|improve this answer




























                    3














                    you can use 3 dots syntax:



                    public void doSomething(boolean... arg1) {
                    boolean MyArg1= (arg1.length >= 1) ? arg1 : false;
                    }





                    share|improve this answer


























                      3












                      3








                      3






                      you can use 3 dots syntax:



                      public void doSomething(boolean... arg1) {
                      boolean MyArg1= (arg1.length >= 1) ? arg1 : false;
                      }





                      share|improve this answer














                      you can use 3 dots syntax:



                      public void doSomething(boolean... arg1) {
                      boolean MyArg1= (arg1.length >= 1) ? arg1 : false;
                      }






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Dec 27 '18 at 20:12

























                      answered Jan 12 '17 at 8:31









                      T.Todua

                      29.8k11131130




                      29.8k11131130























                          1














                          You can use overloading a function .
                          The overloading is also okay but in case you need default values for multiple arguments you will end up creating having many methods with all possible combination of default arguments, for the example you use imagine you want to have a default value for the 3 arguments. you will end up with this



                          public void methodA(A arg1) {  }
                          public void methodA( B arg2,) { }
                          public void methodA(C arg3) { }
                          public void methodA(A arg1, B arg2) { }
                          public void methodA(A arg1, C arg3) { }
                          public void methodA( B arg2, C arg3) { }
                          public void methodA(A arg1, B arg2, C arg3) { }


                          So here's the hack i did for me , you can also use



                          public static void main(String args)
                          {
                          defaultParameter();
                          defaultParameter(true);
                          }

                          public static void defaultParameter(Boolean ...gender)
                          {
                          boolean genderBoolean = false; // It the default value you want to give
                          if(gender.length == 1)
                          {
                          genderBoolean = gender[0]; // Overrided Value
                          }
                          System.out.println(genderBoolean);
                          }


                          The above code will genrate result



                          false
                          true


                          I find out here the example java-default-parameter-values






                          share|improve this answer


























                            1














                            You can use overloading a function .
                            The overloading is also okay but in case you need default values for multiple arguments you will end up creating having many methods with all possible combination of default arguments, for the example you use imagine you want to have a default value for the 3 arguments. you will end up with this



                            public void methodA(A arg1) {  }
                            public void methodA( B arg2,) { }
                            public void methodA(C arg3) { }
                            public void methodA(A arg1, B arg2) { }
                            public void methodA(A arg1, C arg3) { }
                            public void methodA( B arg2, C arg3) { }
                            public void methodA(A arg1, B arg2, C arg3) { }


                            So here's the hack i did for me , you can also use



                            public static void main(String args)
                            {
                            defaultParameter();
                            defaultParameter(true);
                            }

                            public static void defaultParameter(Boolean ...gender)
                            {
                            boolean genderBoolean = false; // It the default value you want to give
                            if(gender.length == 1)
                            {
                            genderBoolean = gender[0]; // Overrided Value
                            }
                            System.out.println(genderBoolean);
                            }


                            The above code will genrate result



                            false
                            true


                            I find out here the example java-default-parameter-values






                            share|improve this answer
























                              1












                              1








                              1






                              You can use overloading a function .
                              The overloading is also okay but in case you need default values for multiple arguments you will end up creating having many methods with all possible combination of default arguments, for the example you use imagine you want to have a default value for the 3 arguments. you will end up with this



                              public void methodA(A arg1) {  }
                              public void methodA( B arg2,) { }
                              public void methodA(C arg3) { }
                              public void methodA(A arg1, B arg2) { }
                              public void methodA(A arg1, C arg3) { }
                              public void methodA( B arg2, C arg3) { }
                              public void methodA(A arg1, B arg2, C arg3) { }


                              So here's the hack i did for me , you can also use



                              public static void main(String args)
                              {
                              defaultParameter();
                              defaultParameter(true);
                              }

                              public static void defaultParameter(Boolean ...gender)
                              {
                              boolean genderBoolean = false; // It the default value you want to give
                              if(gender.length == 1)
                              {
                              genderBoolean = gender[0]; // Overrided Value
                              }
                              System.out.println(genderBoolean);
                              }


                              The above code will genrate result



                              false
                              true


                              I find out here the example java-default-parameter-values






                              share|improve this answer












                              You can use overloading a function .
                              The overloading is also okay but in case you need default values for multiple arguments you will end up creating having many methods with all possible combination of default arguments, for the example you use imagine you want to have a default value for the 3 arguments. you will end up with this



                              public void methodA(A arg1) {  }
                              public void methodA( B arg2,) { }
                              public void methodA(C arg3) { }
                              public void methodA(A arg1, B arg2) { }
                              public void methodA(A arg1, C arg3) { }
                              public void methodA( B arg2, C arg3) { }
                              public void methodA(A arg1, B arg2, C arg3) { }


                              So here's the hack i did for me , you can also use



                              public static void main(String args)
                              {
                              defaultParameter();
                              defaultParameter(true);
                              }

                              public static void defaultParameter(Boolean ...gender)
                              {
                              boolean genderBoolean = false; // It the default value you want to give
                              if(gender.length == 1)
                              {
                              genderBoolean = gender[0]; // Overrided Value
                              }
                              System.out.println(genderBoolean);
                              }


                              The above code will genrate result



                              false
                              true


                              I find out here the example java-default-parameter-values







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Aug 19 '16 at 11:14









                              Jigar Shah

                              312




                              312























                                  0














                                  Java doesn't support a syntax that will do what you want.



                                  Perhaps at the start of someFunction(int), you could just check the incoming value, and assign a different value if you don't like what's coming in.



                                  if (ttt == 0) ttt = 5;


                                  Please note this question appears to have nothing to do with android, and so is improperly tagged.






                                  share|improve this answer


























                                    0














                                    Java doesn't support a syntax that will do what you want.



                                    Perhaps at the start of someFunction(int), you could just check the incoming value, and assign a different value if you don't like what's coming in.



                                    if (ttt == 0) ttt = 5;


                                    Please note this question appears to have nothing to do with android, and so is improperly tagged.






                                    share|improve this answer
























                                      0












                                      0








                                      0






                                      Java doesn't support a syntax that will do what you want.



                                      Perhaps at the start of someFunction(int), you could just check the incoming value, and assign a different value if you don't like what's coming in.



                                      if (ttt == 0) ttt = 5;


                                      Please note this question appears to have nothing to do with android, and so is improperly tagged.






                                      share|improve this answer












                                      Java doesn't support a syntax that will do what you want.



                                      Perhaps at the start of someFunction(int), you could just check the incoming value, and assign a different value if you don't like what's coming in.



                                      if (ttt == 0) ttt = 5;


                                      Please note this question appears to have nothing to do with android, and so is improperly tagged.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Apr 7 '11 at 13:02









                                      Thane Anthem

                                      3,58932223




                                      3,58932223






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Stack Overflow!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.





                                          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                          Please pay close attention to the following guidance:


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f5581360%2fandroid-how-to-set-a-default-value-for-an-argument-variable%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Monofisismo

                                          Angular Downloading a file using contenturl with Basic Authentication

                                          Olmecas