Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Firstly, I think its very important that you read up on <a href="http://developer.android.com/reference/android/os/AsyncTask.html" rel="nofollow">AsyncTask</a> because your implementation does not correctly utilize how it is designed to work. You've caused yourself more issues if I'm honest :)</p> <p>To solve your problem based on your current implementation its important you see how the <a href="http://developer.android.com/reference/android/os/AsyncTask.html#execute%28Params...%29" rel="nofollow">execute()</a> function works in combination with <a href="http://developer.android.com/reference/android/os/AsyncTask.html#doInBackground%28Params...%29" rel="nofollow">doInBackground()</a>. </p> <p>Execute takes a string array for its arguments, so in Project2 you could do something like this:</p> <pre><code>String url = ""; String request = ""; asyncTask.execute(url, request); </code></pre> <p>Then in your ASyncTask, the doInBackground method receives the arguments you used for the execute method. As your passing the values you require between classes, your doInBackground method could look something like this:</p> <pre><code>@Override protected String doInBackground(String... aServerConnectionString) { String url, request; if (aServerConnectionString[0] != null) { url = aServerConnectionString[0]; } if (aServerConnectionString[1] != null) { request = aServerConnectionString[1]; } </code></pre> <p>This way your ASyncTask can remove all its string related stuff as it will rely on Project2/3 to pass through the strings.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload