Andoid Apps crashes on phone
<p>I have just started on developing android apps and my first application crashes on my phone.
I am using eclipse as SDK and my phone has andoid ver 2.3.6
Here are the details</p>

<p>activity_main.xml:</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"
    tools:context=".MainActivity" &gt;

    &lt;EditText
        android:id="@+id/edit_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/edit_text"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:ems="10"
        android:hint="@string/edit_text"
        android:inputType="numberDecimal" /&gt;

    &lt;Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/edit_text"
        android:layout_centerHorizontal="true"
        android:onClick="calc_fare"
        android:text="@string/calc_button" /&gt;

    &lt;TextView
        android:id="@+id/result_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/button1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="25dp"
        android:text="@string/result_text"
        android:textAppearance="?android:attr/textAppearanceMedium" /&gt;

&lt;/RelativeLayout&gt;
</code></pre>

<p>Strings.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;resources&gt;

    &lt;string name="app_name"&gt;Taxi Fare Calculator&lt;/string&gt;
    &lt;string name="edit_text"&gt;Enter Meter Reading&lt;/string&gt;&lt;string name="calc_button"&gt;Calculate&lt;/string&gt;&lt;string name="result_text" &gt;Actual Fare&lt;/string&gt;&lt;string name="menu_settings"&gt;Settings&lt;/string&gt;
&lt;/resources&gt;
</code></pre>

<p>mainActivity.java:</p>

<pre><code>package com.example.taxifarecalculator;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.EditText;

public class MainActivity extends Activity {



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;

    }

    public void calc_fare() {
        EditText editText = (EditText) findViewById(R.id.edit_text);
        EditText resultText = (EditText) findViewById(R.id.result_text);
        Double mtr = Double.parseDouble(editText.getText().toString());
        Double fare=mtr*103;
        resultText.setText(fare.toString());


    }

}
</code></pre>

<p>The app hangs and crashes when I press the calc button which ideally should call the calc_fare method which, in turn, should populate the text view</p>

<p>Regards
Parikshit</p>
