Can we call two methods at a time in doinbackground method of asynchronous task in android?
<p>I am working on android applications. I need some clarification regarding asynchronous task doinbackground method.</p>

<pre><code>    Code:

    @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            setContentView(R.layout.main);

    LongOperation2 op = new LongOperation2();
                op.execute("");


            }

    public void test1() {
            ArrayList&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;();
            postParameters.add(new BasicNameValuePair("id", id));

            try {
                res1 = CustomHttpClient.executeHttpPost(
                        "http://website.com/folder1/firstpage.php",
                        postParameters);
                System.out.println("response in test1" + res1.trim());

            }

            catch (Exception e) {
                e.printStackTrace();
            }

        }

  public void test2() {
            ArrayList&lt;NameValuePair&gt; postParameters = new ArrayList&lt;NameValuePair&gt;();
            postParameters.add(new BasicNameValuePair("value", value));

            try {
                res2 = CustomHttpClient.executeHttpPost(
                        "http://website.com/folder1/secondpage.php",
                        postParameters);
                System.out.println("response in test2" + res2.trim());

            }

            catch (Exception e) {
                e.printStackTrace();
            }

        }

     private class LongOperation2 extends AsyncTask&lt;String, Void, String&gt; {

            @Override
            protected String doInBackground(String... params) {

                test1();
                                        test2();
                return "Executed";
            }

            @Override
            protected void onPostExecute(String result) {
                dialog1.dismiss();
                try {

                                              Test.this.startActivity(new Intent(Page1.this, Page2.class));
                }

                catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

            }

            @Override
            protected void onPreExecute() {
                dialog1 = ProgressDialog.show(Test.this, "Please wait...",
                        "Retrieving data ...", true);
            }

            @Override
            protected void onProgressUpdate(Void... values) {
            }
        }
</code></pre>

<p>In the above code I have two methods test1() and test2(). In both the methods I am passing parameters to webservice. Now my doubt is can I call both the methods at a time in doInBackground() of asynchronous task? Is that ok? Please let me know or give me suggestion regarding this. Thanks in advance. </p>
