I have a method to insert data into server like this:

```
public void doInsert(){

    try {
        // setiap parameter yang akan dikirim melalui http
        // harus encode agar
        // dapat terbaca dengan baik oleh server
        String no_imei = URLEncoder.encode(noImei.getText().toString(), "utf-8");
        String nik = URLEncoder.encode(user.getText().toString(), "utf-8");
        String pass = URLEncoder.encode(password.getText().toString(), "utf-8");
        url += "?no_imei=" + no_imei + "&&nik=" + nik + "&&password=" + pass;
        getRequest(url);
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

```

Another method that I have:

```
public void getRequest(String Url) {

    HttpClient client = new DefaultHttpClient();
    HttpGet request = new HttpGet(url);
    try {
        HttpResponse response = client.execute(request);
        Toast.makeText(this, "Tambah Data " + request(response) + " ",Toast.LENGTH_SHORT).show();
    } catch (Exception ex) {

        //Toast.makeText(this, "Tambah Data Gagal !", Toast.LENGTH_SHORT).show();
      }
}

```

And like this:

```
public static String request(HttpResponse response) {

    String result = "";
    try {
        InputStream in = response.getEntity().getContent();
        BufferedReader reader = new BufferedReader(
        new InputStreamReader(in));
        StringBuilder str = new StringBuilder();
        String line = null;
        while ((line = reader.readLine()) != null) {

            str.append(line + "\n");

        }
        in.close();
        result = str.toString();
        } catch (Exception ex) {
        result = "Error";
        }
        return result;

}

```

onClick method:

```
private View.OnClickListener onSave=new View.OnClickListener() 
{
    public void onClick(View v) 
    {
        //Dbhelper helper = new Dbhelper(UserForm.this);  
        Cursor c = helper.Login(almagId);

        if (noImei.getText().toString().equals("")||
            user.getText().toString().equals("")||
            password.getText().toString().equals("")
            ) {
            Toast.makeText(UserForm.this, "Data Harus di isi", Toast.LENGTH_LONG).show();

    }else if(c.moveToFirst()){
        if(noImei.getText().equals(c.getString(0))||
                user.getText().equals(c.getString(1))){
            Toast.makeText(UserForm.this, "Data Sudah ada", Toast.LENGTH_LONG).show();
            helper.close();
        }
    }else
    {
        doInsert(); 
        helper.insertUser(noImei.getText().toString(),user.getText().toString(),password.getText().toString());
            //Toast.makeText(UserForm.this, "Data Berhasil disimpan", Toast.LENGTH_LONG).show();

    }
        startActivity(new Intent(UserForm.this,MenuUtama.class));
        user.setText("");
        password.setText("");
         return;
    }
};

```

In the `onClick` method when response from server SUCCESS I want to do some activity. How can I do that? I tried with condition *if* my activity not running.