setting a background connection to a site
<p>i am doing a application now that is able to read a message from a site</p>

<p>now i am doing the part on deleting a message via a link</p>

<p>the text is stored on <a href="http://www.example.com/test/file.txt" rel="nofollow">http://www.example.com/test/file.txt</a>
i have a php script on <a href="http://www.example.com/test/delete.php" rel="nofollow">http://www.example.com/test/delete.php</a> which once the site is loaded, file.txt will become "" which is null</p>

<p>how do i create such a request to the site without alerting the user? it is working perfectly on the my comp browser</p>

<p>i have put this method into onLongClickListener</p>

<pre><code>    public boolean onLongClick(View v)
{
    String webURL = "http://example.net/test/delete.php";
    URL url;
    try 
    {
        url = new URL(webURL);

        /* Open a connection to that URL. */
        HttpURLConnection ucon = (HttpURLConnection) url.openConnection();

        Context context = getApplicationContext();
        Toast toast = Toast.makeText(context, "Message Deleted!", Toast.LENGTH_SHORT);
        toast.show();
    } 

    catch (Exception e) 
    {
        e.printStackTrace();
    }
    return true;
}
</code></pre>
