Does AsyncTask run the doInBackground accordingly to each of its parameter order or randomly?

前端 未结 3 1861
甜味超标
甜味超标 2021-01-28 16:14

For example there is an AsyncTask of a String... parameters , if I make a call like this :

AsyncTask someTask         


        
3条回答
  •  余生分开走
    2021-01-28 16:40

    String... is a "vararg", which in this example converts all individual parameters into a String[], where the entries to the array are in the order they got passed into the method.

    So using your example, (String[]) param[0] == string1, param[1] == string2, param[2] == string3 and so forth. This is for the ordering of param entries, as to how each entry in param is used, it depends entirely on your code.

提交回复
热议问题