title: ListView listing the key in hashmap as list items and displaying the value of hash map as WebView
body: <p>I have JsonArray of object sent by servlet to android client.</p>
  
  <pre><code>Eg: {"PDF":    [{"pdf":"resume.pdf","html":"http://localhost:8080/Files/Sample/resume.html"},{"pdf":"profile.pdf","html":"http://localhost:8080/Files/Sample/profile.html"}]}. 
  </code></pre>
  
  <p>In this example I'am having pdf and html as key. At client end Iam parsing it through json object and listing the value of "pdf" as list items in listview, I mean resume.pdf first item, and profile.pdf as second item.</p>
  
  <p>Now when i click on resume.pdf then corresponding html should open in web view. I coded till listing the items, but facing confusion as how to pass the url as intent to another activity to start WebView.</p>
  
  <p>This is my OnCreate method where on item click listener is enabled...</p>
  
  <pre><code>public class MainActivity extends ListActivity {
  private ProgressDialog pDialog;
  String html;
  // URL to get contacts JSON
  private static String url = "http://ipaddress/LoginValidation/LoginCredentials";
  // JSON Node names
  private static final String TAG_FILES = "PDF";
  private static final String TAG_PDF = "pdf";
  private static final String TAG_HTML = "html";
  // contacts JSONArray
  JSONArray pdftohtml = null;
  ListView lv;
  // Hashmap for ListView
  ArrayList&lt;HashMap&lt;String, String&gt;&gt; fileList;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Bundle extras = getIntent().getExtras();
      fileList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      lv = getListView();
      // Listview on item click listener
      lv.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                  int position, long id) {
  </code></pre>
  
  <p><strong>//What to write to get only corresponding html value of pdf file</strong></p>
  
  <pre><code>Intent in = new Intent(getApplicationContext(),HtmlWebViewActivity.class);
              //in.putExtra(TAG_HTML,);
  
              startActivity(in);
  
          }
  
      });
  
      new GetFiles().execute();
  
  }
  </code></pre>
  
  <p>This is my Async Task</p>
  
  <pre><code>private class GetFiles AsyncTask&lt;Void, Void, Void&gt; {
      @Override
      protected Void doInBackground(Void... arg0) {
          ServiceHandler sh = new ServiceHandler();
          // Making a request to url and getting response
          String jsonStr = sh.makeServiceCall(url, ServiceHandler.GET);
          Log.d("Response: ", "&gt; " + jsonStr);
          if (jsonStr != null) {
              try {
                  JSONObject jsonObj = new JSONObject(jsonStr);
                  // Getting JSON Array node
                  pdftohtml = jsonObj.getJSONArray(TAG_FILES);
                  // looping through All Contacts
                  for (int i = 0; i &lt; pdftohtml.length(); i++) {
                      JSONObject c = pdftohtml.getJSONObject(i);
                      String pdf = c.getString(TAG_PDF);
                      html=c.getString(TAG_HTML);
                      HashMap&lt;String, String&gt; file = new HashMap&lt;String, String&gt;();
                      // adding each child node to HashMap key =&gt; value
                      file.put(TAG_PDF, pdf);
                      file.put(TAG_HTML, html);
                      fileList.add(file);
                  }
                  System.out.println("TAG PDF"+TAG_PDF);
              } catch (JSONException e) {
                  e.printStackTrace();
              }
          } else {
              Log.e("ServiceHandler", "Couldn't get any data from the url");
          }
          return null;
      }
      @Override
      protected void onPostExecute(Void result) {
          // TODO Auto-generated method stub
          super.onPostExecute(result);
          // Dismiss the progress dialog
          if (pDialog.isShowing())
              pDialog.dismiss();
          /**
           * Updating parsed JSON data into ListView
           * */
          ListAdapter adapter = new SimpleAdapter(MainActivity.this,
                  fileList, R.layout.listitem, new String[] { TAG_PDF }, new int[] {
                          R.id.pdf });
          setListAdapter(adapter);
  
      }
  </code></pre>
  
  <p>As you can see in my Async task iam using json to parse the response and getting the "pdf" and "html" key values in filellist(arraylist) , then in post execute using adapter displaying only "pdf" values as list item. Now how to get the corresponding "html" values in ItemClickListener in <strong>OnCreateMethod</strong></p>