Question: Hello I'm working with android android and doing some task in a async task. I want to call the async task and pass on string as a parameter. I've search google but with no luck, here is my code to call the async task

```
new warkah_detail().execute(id_warkah);

```

and here is my async task 

```
class warkah_detail extends AsyncTask<String, String, String>
{
    @Override
    protected void onPreExecute()
    {
        pDialog = new ProgressDialog(warkah.this);
        pDialog.setMessage("Fetching Details...");
        pDialog.setIndeterminate(false);
        pDialog.setCancelable(false);
        pDialog.show();
    }

    @Override
    protected String doInBackground(String... args)
    {
        try
        {
            List<NameValuePair> params = new ArrayList<NameValuePair>();
            params.add(new BasicNameValuePair("id_warkah", id_warkah));
            json = jParser.makeHttpRequest(url_warkah, "POST", params);

```

Those code raise an error like this `Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()`

What is the best way to pass string to async task? I will appreciate any help. Thanks.

[UPDATE]
I had removed the toast, but I still not receive the correct string that pass to async task from the called. Any idea?

Answer: 
```
Toast.makeText(getApplicationContext(), "ID : " + id_warkah, Toast.LENGTH_LONG).show();

```

Toast needs to be excuted on the UI Thread. Move it on the `onPostExcuted` or use `runOnUiThread`

your `String` is `args[0]`. You should read the documentation for `varargs`
add new warkah\_detail(id\_warkah).execute(); instead of new warkah\_detail().execute(id\_warkah);
and write a constructor for defining your parameter.