title: Getter Method not working after doInBackground
body: <p>Im trying to have a few getter methods for a few strings to get returned after getting them from an online JSON. In order to save space I decided to put that all in an object and call them from there.</p>
  
  <p>Object:</p>
  
  <pre><code>public class InventoryItem extends AsyncTask&lt;Void,Void,Void&gt;{
          String imageURL = "";
          String itemName = "";
          String itemDesc = "";
          String itemRarity = "";
          String itemType = "";
          JSONObject itemJson = null;
  
          InventoryItem(JSONObject json){
              itemJson = json;
              Log.d("StringSubclass","Inventory Item");
          }
  
          @Override
          protected Void doInBackground(Void... voids) {
              Log.d("StringSubclass","doInBG Inventory Item");
              try {
                  imageURL = "http://www.bungie.net"+itemJson.getJSONObject("Response").getJSONObject("data").getJSONObject("inventoryItem").getString("icon");
                  Log.d("StringSubclass",imageURL);
                  itemName = itemJson.getJSONObject("Response").getJSONObject("data").getJSONObject("inventoryItem").getString("itemName");
                  itemDesc = itemJson.getJSONObject("Response").getJSONObject("data").getJSONObject("inventoryItem").getString("itemDescription");
                  itemRarity = itemJson.getJSONObject("Response").getJSONObject("data").getJSONObject("inventoryItem").getString("tierTypeName");
                  itemType = itemJson.getJSONObject("Response").getJSONObject("data").getJSONObject("inventoryItem").getString("itemTypeName");
  
              } catch (JSONException e) {
                  e.printStackTrace();
              }
  
  
              return null;
          }
  
  
          public String getItemType() {
              return itemType;
          }
  
          public String getItemRarity() {
              return itemRarity;
          }
  
          public String getItemDesc() {
              return itemDesc;
          }
  
          public String getItemName() {
              return itemName;
          }
  
          public String getImageURL() {
              return imageURL;
          }
      }
  </code></pre>
  
  <p>The problem is that the getter methods at the end send back "" even though I changed their value in doInBackground.</p>
  
  <p>This is how I called getImageURL():</p>
  
  <pre><code>InventoryItem subclass = new InventoryItem(makeJSON(HOST+"Manifest/6/"+subclassHash+"/"));
              subclass.execute();
              Log.d("StringSubclass",subclass.getImageURL());
              intentHome.putExtra("SubclassImageURL",subclass.getImageURL());
  </code></pre>
  
  <p>makeJSON():</p>
  
  <pre><code> public JSONObject makeJSON(String url){
          JSONObject json = null;
          String apiKey = "36c346318fa54fc6bc659ad6321a6d41";
          try {
              URL obj = new URL(url);
              HttpURLConnection con = (HttpURLConnection) obj.openConnection();
  
              con.setRequestMethod("GET");
              con.setRequestProperty("X-API-KEY", apiKey);
  
              BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
              String inputLine;
              String response = "";
  
              while ((inputLine = in.readLine()) != null) {
                  response += inputLine;
              }
  
              in.close();
  
              JsonParser parser = new JsonParser();
              JsonObject gson = (JsonObject) parser.parse(response);
              json = new JSONObject(gson.toString());
  
  
          } catch (ProtocolException e) {
              e.printStackTrace();
          } catch (MalformedURLException e) {
  
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          } catch (JSONException e) {
              e.printStackTrace();
          }
          return json;
      }
  </code></pre>
  
  <p>I checked the URL and it is working fine in chrome.</p>
  
  <p>Any help will be appreciated.
  I kind of new to this so please explain as much as possible.
  Thanks</p>