title: Getting images dynamically and placing at their correct position in Android
body: <p>I have got the html string when i fetched data from url through XML parsing. Now in this html string. There is an multiple image tag. I fetched all the src=" " from this html string.</p>
  
  <p>Now the problem is i dont know before-hand that how much images will come and what will be there position. I will fetch the images but the problem is how could i show these images at their correct position. I use text view</p>
  
  <p>This is my text view layout where i have to show images at their correct position(where they lies in html string)</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
  android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:paddingBottom="@dimen/activity_vertical_margin"
  tools:context="com.example.talha.appforblog.ColoumnView"
  &gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/ColoumnView" /&gt;
  
  &lt;TextView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/textView"
      android:layout_alignParentTop="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:maxLines = "1000"
  
      android:scrollbars = "vertical"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Here i got the src tag</p>
  
  <pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
      try {
              urlBlogtitle = mainBlogPost.get(position).title; // getting title of the clicked item
              //Log.d(TAG, urlBlogtitle);
              summarygetter = databaseChecker(urlBlogtitle);
              Log.d(TAG, summarygetter);
          Pattern p = Pattern.compile("src\\s*=\\s*['\"]([^'\"]+)['\"]");
          Matcher m = p.matcher(summarygetter);
              while (m.find()) {
                  try {
  
                      String srcResult = m.group(1);
                  Log.d("yahan immage ka src a rha", m.group(1));
              }
                  catch(Exception e)
                  {
                      Log.d("test","exceptiojn iin img");
                  }
  
              }
              if (summarygetter == "false") {
                  new DownloadXmlTaskContent(getActivity()).execute(URL);
              } else {
                  Log.d(TAG, "ab database se uthaya");
                  startingIntent(summarygetter);
  
              }
  
              // Notify the active callbacks interface (the activity, if the
              // fragment is attached to one) that an item has been selected.
              //mListener.onFragmentInteraction(DummyContent.ITEMS.get(position).id);
  
      }
      catch(Exception e){
          Log.d("test",""+e);
      }
  }
  </code></pre>
  
  <p>This is my html string</p>
  
  <pre><code>So we are doing it again. I know what you are thinking, that everybody keeps writing these articles what’s the difference. Well I had the same confusion when I started. So I came up with idea of one interesting fact about each university. Let’s just hope I can keep this up.
  &lt;a href="http://rarelyknownthings.com/wp-content/uploads/2015/10/graduation_hat.png"&gt;&lt;img class="alignnone size-full wp-image-288" src="http://rarelyknownthings.com/wp-content/uploads/2015/10/graduation_hat.png" alt="graduation_hat" width="620" height="443" /&gt;&lt;/a&gt;
  This article will state world’s top 10 engineering universities. The criteria is set on the basis of research done.
  &lt;!--nextpage--&gt;
  &lt;h3&gt;&lt;strong&gt;10 : Harvard University&lt;/strong&gt;&lt;/h3&gt;
  In the 10&lt;sup&gt;th&lt;/sup&gt; position comes Harvard. Now some of you might think that’s not right, but apparently it is. I’m following QS format and Harvard comes at the 10&lt;sup&gt;th&lt;/sup&gt; position in engineering universities. Established in 1636 its one of the most prestigious universities of the world. Not to mention United States oldest higher learning university.
  &lt;img class="aligncenter wp-image-209 size-full" src="http://rarelyknownthings.com/wp-content/uploads/2015/10/harward.png" alt="harvard" width="975" height="488" /&gt;
  The interesting fact about Harvard is the Harvard Library. It was established 2 years later in 1638 and holds more than 18 million volumes. Not to mention the library system consists of 73 libraries. (Beat this figure!) In the overall world ranking it comes at 2&lt;sup&gt;nd&lt;/sup&gt; position.
  &amp;nbsp;
  &lt;!--nextpage--&gt;
  &lt;h3&gt;&lt;strong&gt;9 : Oxford University
  &lt;/strong&gt;&lt;/h3&gt;
  There’s no clear date of Oxford’s establishment. But evidence point to 1096 so we’ll go with that. Now the main era begin after the establishment of Cambridge University. I’ll go into that later. The university holds 38 colleges and is mostly self-govern tutorial based. The famous thing about the university is its scholarships from being 100 years old like Rhodes scholarship, to some recent.
  &lt;img class="aligncenter wp-image-218 size-full" src="http://rarelyknownthings.com/wp-content/uploads/2015/10/oxford.png" alt="oxford" width="975" height="609" /&gt;
  The most interesting fact about the university is that it holds world’s largest university press. (I don’t even know what they do with such a big press) In the world overall ranking Oxford comes at 6&lt;sup&gt;th&lt;/sup&gt; position.
  &lt;!--nextpage--&gt;
  &lt;h3&gt;&lt;strong&gt;8 : University of California, Berkeley (UCB)&lt;/strong&gt;&lt;/h3&gt;
  Berkeley was established in 1868. It was a merger between different colleges of California. It’s not very old as compared to the others but they made their name in a very short time. The university’s pride is its award winning alumni and the research section where they spend millions of dollars for this part. There are 72 Nobel Prizes, nine Wolf Prizes, seven Fields Medals and many more included in this list.
  &lt;img class="aligncenter size-full wp-image-221" src="http://rarelyknownthings.com/wp-content/uploads/2015/10/ucb.png" alt="ucb" width="975" height="543" /&gt;
  The university’s interesting fact is that these guys love finding things. In this attempt they found not only 6 different periodic table’s element but also along with Berkeley 16 chemical elements that’s the highest number for any university. Berkeley is ranked 26&lt;sup&gt;th&lt;/sup&gt; in the overall world ranking.
  &lt;!--nextpage--&gt;
  &lt;h3&gt;&lt;strong&gt;7 : Imperial College London&lt;/strong&gt;&lt;/h3&gt;
  The Imperial College doesn’t really have a great start like the other. It was established 1907. At that time it was only a technology and engineering university. Later on some of the medical schools attached to it making its way to biomedical. Right now there are four faculties in total. There are a lot of big names like Nicholas Tombazis (McLaren and Ferrari Chief Designer) and Alexander Fleming coming from here.
  &lt;img class="aligncenter wp-image-213 size-full" src="http://rarelyknownthings.com/wp-content/uploads/2015/10/imperial2.png" alt="imperial2" width="975" height="731"
  </code></pre>