Question: I want to fetch json data from json object.
My json data is:`{"avg":2.5}` and my android code is 

```
public class AsyncTaskParseJson extends AsyncTask < String, String, String > {

        final String TAG = "AsyncTaskParseJson.java";

        // set your json string url here
        String yourJsonStringUrl = "http://www.bsservicess.com/photoUpload/star_avg.php?bookName=" + book_name;

        // contacts JSONArray

        @Override
        protected void onPreExecute() {}

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

            try {
                JSONParser jParser = new JSONParser();

                // get json string from url
                JSONObject json = jParser.getJSONFromUrl(yourJsonStringUrl);

                // get the array of users
                JSONObject dataJsonArr = json.getJSONObject(str);

                String c = dataJsonArr.getString("avg");
                na = c;
                starts = Float.parseFloat(c);

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

            return null;
        }

        @Override
        protected void onPostExecute(String strFromDoInBg) {
            super.onPostExecute(strFromDoInBg);

            netRate.setRating(starts);
            Toast.makeText(mybookview.this, Float.toString(starts), Toast.LENGTH_SHORT).show();
        }

```

But somehow its not working.I have trie every tutorial and evrything but nothing works.plz help me

Answer: 
Just store the values on the submit buttons. 

```
<button name="foo" value="bar"> Button 1 </button>
<button> Button 2 </button>

```
Give different name for your button, for example `"button1"` and `"button2"`, and when you click that button with the name `"button1"` , you can save the hidden field value, if you click `"button2"` just ignore the hidden field.