android get url from edit text and use it in rest api to upload data
<p>Here is my android rest request code but the where i get the <code>url</code> from edit text using its id but "<code>getString</code>" gets flagged(can't be resolved). Please help </p>

<pre><code>class RESTRequest
{

   //final String ADD_STROKE_URL = "";

    final String ADD_STROKE_URL = new String[]{ getString(R.id.buttonUploadURL)};

    public Boolean success = null;
    private JSONObject params;
    private String strokeId;
    private HashSet&lt;Point&gt; localPoints;
    private StrokeManagerCallback callback;


    public static String encode(Object x) {
        try {
            return URLEncoder.encode(String.valueOf(x),"UTF-8");
        } catch (UnsupportedEncodingException e) {
            return(String.valueOf(x));
        }
    }


    public RESTRequest(JSONObject params,String strokeId,Set&lt;Point&gt; points,StrokeManagerCallback callback)
    {
        this.params = params;

        this.strokeId = strokeId;

        this.localPoints = new HashSet&lt;Point&gt;();
        this.localPoints.addAll(points);

        this.callback = callback;

        new ExecuteREST().execute();

    }

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

        protected String doInBackground(Void ...arg0)
        {

            /* Build URL query */
            StringBuffer local = new StringBuffer(ADD_STROKE_URL);
            if(params != null)
            {
                local.append("?");
                Iterator&lt;?&gt; k = params.keys();
                while(k.hasNext()){
                    try {
                        String key = (String) k.next();
                        Object value = params.get(key);

                        local.append(encode(key));
                        local.append("=");
                        local.append(encode(value));
                        if(k.hasNext()){
                            local.append("&amp;");
                        }
                    }
                    catch (JSONException e) {e.printStackTrace();}
                }
            }

            HttpURLConnection urlConn = null;
            StringBuffer response = new StringBuffer("error");
            try
            {
                URL url = new URL(local.toString());
                urlConn = (HttpURLConnection) url.openConnection();
                urlConn.setRequestMethod("GET");
                urlConn.setDoInput(true);
                urlConn.setUseCaches(false);
                urlConn.setRequestProperty("Content-Type", "application/json");
                urlConn.connect();

                //Get Response
                InputStream is = urlConn.getInputStream();
                BufferedReader rd = new BufferedReader(newInputStreamReader(is));
                String line;
                response = new StringBuffer();
                try{
                    while((line = rd.readLine()) != null) {
                        response.append(line);
                    }
                }
                finally{
                    if(urlConn != null){
                        urlConn.disconnect();
                        urlConn = null;
                    }
                    if(rd != null){
                        rd.close();
                        rd = null;
                    }
                }

                if(callback != null){
                    callback.onSuccess(strokeId, localPoints);
                }
            } catch (ConnectException e) {
                callback.onFailure(strokeId, localPoints);
            } catch (UnknownHostException e) {
                callback.onFailure(strokeId, localPoints);
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (EOFException e) {
                response = new StringBuffer("No response from server");
            } catch (IOException e) {
                e.printStackTrace();
            } catch (RuntimeException e) {
                e.printStackTrace();
            }
            finally{
                if(urlConn != null){
                    urlConn.disconnect();
                }
            }
            return response.toString();
        }
    }
</code></pre>