title: Getting decimal number from edittext
body: <p>I know something similar has already been asked, but I'm having some trouble to get a decimal number that come from keyboard.</p>
  
  <p>My Java code in the onCreate method should be:</p>
  
  <pre><code>textS0 = (EditText)findViewById(R.id.editS0);
  Button btn_S0 = (Button)findViewById(R.id.getS0);
  
  btn_S0.setOnClickListener(new View.OnClickListener() 
  {
      public void onClick(View v)
      {
          //how should I get here the number from keyboard?
          //I think  I should be something like
          //double S0=textS0.getText()....
      }
  });
  </code></pre>
  
  <p>And that's what my XML file contains</p>
  
  <pre><code>&lt;EditText
         android:id="@+id/editS0"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:ems="10"
         android:hint="@string/S0"
         android:inputType="numberDecimal" /&gt;
  &lt;Button
         android:id="@+id/getS0"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/setS0" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>