title: Retrieve image from drawable and String convert to Int issue
body: <p>i am currently doing a page which retrieve data from php server and now trying to retrieve and image from drawable by using setImageResource but is not working, i dunno what wrong with it and is it possible for me to just save image name in database then retrieve image by using image name?
  beside that, i try to do a simple plus minus button for quantity but the apps force stop once i click on the button..</p>
  
  <pre><code>public class FoodDetailActivity extends Activity 
  {
  TextView FoodName;
  TextView FoodDesc;
  TextView FoodPrice;
  ImageView FoodImg;
  EditText Number;
  Button plus;
  Button minus;
  Button Addcart;
  
  String fid;
  int number;
  
  // Progress Dialog
  private ProgressDialog pDialog;
  
  // JSON parser class
  JSONParser jsonParser = new JSONParser();
  
  // single product url
  private static final String url_food_details = "http://10.0.2.2/android_user/FoodDetail.php";
  
  // JSON Node names
  private static final String TAG_SUCCESS = "success";
  private static final String TAG_FOOD = "food";
  private static final String TAG_FID = "fid";
  private static final String TAG_FOODNAME = "food_name";
  private static final String TAG_FOODPRICE = "food_price";
  private static final String TAG_FOODDESCRIPTION = "food_description";
  private static final String TAG_FOODURL = "food_url";
  
  @Override
  protected void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_food_detail);
  
  
      // button
      plus = (Button)findViewById(R.id.btn_plus);
      plus.setOnClickListener(increase);
      minus = (Button)findViewById(R.id.btn_minus);
      minus.setOnClickListener(decrease);
      Addcart = (Button)findViewById(R.id.btn_submit);
      Number = (EditText)findViewById(R.id.text_number);
  
      // getting food details from intent
      Intent i = getIntent();
  
      // getting food id (fid) from intent
      fid = i.getStringExtra(TAG_FID);
  
      // Getting complete product details in background thread
      new GetFoodDetails().execute();
  }
  
  // Increase number of quantity
      private OnClickListener increase = new OnClickListener()
      {
          public void onClick(View v) 
          {
              String quantity = Number.getText().toString().trim();
              number = Integer.parseInt(quantity);
              if(number &gt; 0 &amp;&amp; number &lt; 99)
              {
                  number = number + 1;
                  Number.setText(Integer.toString(number));
              }
              else if(number == 99)
              {
                  number = 1;
                  Number.setText(Integer.toString(number));
              }
          }
      };
   // Decrease number of quantity
      private OnClickListener decrease = new OnClickListener()
      {
          public void onClick(View v) 
          {
              String quantity = Number.getText().toString();
              number = Integer.valueOf(quantity);
              if(number &gt; 1 &amp;&amp; number &lt;= 99)
              {
                  number = number - 1;
                  Number.setText(Integer.toString(number));
              }
              else if(number == 1)
              {
                  number = 99;
                  Number.setText(Integer.toString(number));
              }
          }
      };
  
  class GetFoodDetails extends AsyncTask&lt;String, String, String&gt; 
  {
      /**
       * Before starting background thread Show Progress Dialog
       * */
      @Override
      protected void onPreExecute() 
      {
          super.onPreExecute();
          pDialog = new ProgressDialog(FoodDetailActivity.this);
          pDialog.setMessage("Loading food details. Please wait...");
          pDialog.setIndeterminate(false);
          pDialog.setCancelable(true);
          pDialog.show();
      }
  
      /**
       * Getting product details in background thread
       * */
      protected String doInBackground(String... params) 
      {
  
          // updating UI from Background Thread
          runOnUiThread(new Runnable() 
          {
              public void run() 
              {
                  // Check for success tag
                  int success;
                  try {
                      // Building Parameters
                      List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
                      params.add(new BasicNameValuePair("fid", fid));
  
                      // getting product details by making HTTP request
                      // Note that product details url will use GET request
                      JSONObject json = JSONParser.makeHttpRequest(url_food_details, "GET", params);
  
                      // check your log for json response
                      Log.d("Single Food Details", json.toString());
  
                      // json success tag
                      success = json.getInt(TAG_SUCCESS);
  
                      if (success == 1) 
                      {
                          // successfully received food details
                          JSONArray foodObj = json.getJSONArray(TAG_FOOD); // JSON Array
  
                          // get first product object from JSON Array
                          JSONObject food = foodObj.getJSONObject(0);
  
                          // Loader image - will be shown before loading image
                          int loader = R.drawable.loader;
  
                          String image_url = food.getString(TAG_FOODURL);
  
                          // product with this fid found
                          // Edit Text
                          FoodName = (TextView)findViewById(R.id.food_name);
                          FoodPrice = (TextView)findViewById(R.id.food_price);
                          FoodDesc = (TextView)findViewById(R.id.food_desc);
                          FoodImg = (ImageView)findViewById(R.id.img_food);
  
                          // display product data in EditText
                          FoodName.setText(food.getString(TAG_FOODNAME));
                          FoodPrice.setText("RM" + food.getString(TAG_FOODPRICE));
                          FoodDesc.setText(food.getString(TAG_FOODDESCRIPTION));
  
                          // ImageLoader class instance
                          ImageLoader imgLoader = new ImageLoader(getApplicationContext());
  
                          // display image
                          imgLoader.DisplayImage(image_url, loader, FoodImg);
  
                      }
                      else
                      {
                          // no food detail found
                          // Launch error message
                          AlertDialog.Builder ad = new AlertDialog.Builder(FoodDetailActivity.this);
                          ad.setTitle("Error");
                          ad.setMessage("Food Detail is empty!");
                          ad.setPositiveButton("OK", new DialogInterface.OnClickListener() 
                          {
                              public void onClick(DialogInterface dialoginterface, int i)
                              {
  
                              }
                          });
                          ad.show();
                      }
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
          });
  
          return null;
      }
  
      protected void onPostExecute(String file_url) 
      {
          // dismiss the dialog once got all details
          pDialog.dismiss();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The problem had been solve, i using the ImageLoader retrieve image at server side with url store in database.</p>