title: Justify text in textview
body: <p>In my app first I have textview to show text. Then I want to justify text but in android its not possible to justify text in textview. To justify text I am taking help from <a href="https://stackoverflow.com/questions/1292575/android-textview-justify-text">this link</a>. I am following the answer provided by @Kondzio but its not working. I dont know whats wrong in my code.</p>
  
  <p>Code-</p>
  
  <pre><code>public class Benefits extends Activity{
      private Button back;
      LinearLayout bText;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.benefits);
          WebView view = new WebView(this);
          view.setVerticalScrollBarEnabled(true);
          ((LinearLayout)findViewById(R.id.bText)).addView(view);
          view.loadData(getString(R.string.benef), "text/html", "utf-8");
  
          back.setOnClickListener(new View.OnClickListener(){
          public void onClick(View v)
          {
              finish();
          }
      });
    }
  }
  </code></pre>
  
  <p>Xml-</p>
  
  <pre><code>&lt;LinearLayout 
         android:id="@+id/bText"
         android:orientation="horizontal"
         android:layout_width="fill_parent" 
         android:layout_height="wrap_content"
         android:layout_weight="4"
         android:gravity="center"&gt;            
   &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>In strings.xml-</p>
  
  <pre><code>&lt;string name="benef"&gt;
          &lt;![CDATA[
          &lt;html&gt;
          &lt;head&gt;&lt;/head&gt;
          &lt;body style="text-align:justify;color:gray;background-color:black;"&gt;
           "1.some text\n
            2.some text\n
            .............
   &lt;/body&gt;
  &lt;/html&gt;
  ]]&gt;
  &lt;/string&gt; 
  </code></pre>
  
  <p>I am setting scrollbarenabled to true to make vertical scrolling on my text.</p>