title: Unforunately app has stopped ,Converter app
body: <p>I was practicing making this converter app, it's a simple converter but when i launch my app in my phone it says "Unfortunately, "app" has stopped". This converter is based on a Vogella Android Tutorial about making a converter. I just added a few things myself.</p>
  
  <pre><code>import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.CompoundButton;
  import android.widget.EditText;
  import android.widget.ImageButton;
  import android.widget.RadioButton;
  import android.widget.RadioGroup;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import org.w3c.dom.Text; 
  
  import java.text.DecimalFormat;
  
  
  public class MainActivity extends ActionBarActivity {
  TextView dollarText;
  TextView euroText;
  EditText enterText;
  EditText result;
  RadioButton dollarRadio;
  RadioButton euroRadio;
  RadioButton deci;
  ImageButton imgB;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      enterText = (EditText)findViewById(R.id.enterNumbers);
      result = (EditText)findViewById(R.id.result);
      RadioGroup newRadio = (RadioGroup)findViewById(R.id.radioGroup);
      euroText = (TextView)findViewById(R.id.euroTextView);
      dollarText = (TextView)findViewById(R.id.dollarTextView);
      imgB = (ImageButton)findViewById(R.id.buttonConvert);
      imgB.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              switch(v.getId()){
                  case R.id.buttonConvert:
                      dollarRadio = (RadioButton)findViewById(R.id.radioButtonLek);
                      euroRadio = (RadioButton)findViewById(R.id.radioButtonEuro);
                      if(enterText.getText().length() == 0){
                          Toast.makeText(v.getContext(),"Please enter numbers",Toast.LENGTH_SHORT).show();
                      }
                      double userInput = Double.parseDouble(enterText.getText().toString());
                      if(dollarRadio.isChecked()){
                          result.setText(String.valueOf(convertToDollar(userInput)));
                          dollarRadio.setChecked(true);
                          euroRadio.setChecked(false);
                      }else{
                          result.setText(String.valueOf(convertToEuro(userInput)));
                          dollarRadio.setChecked(false);
                          euroRadio.setChecked(true);
                      }
                      break;
              }
          }
      });
  
      newRadio.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(RadioGroup group, int checkedId) {
              if(dollarRadio.isChecked()){
                  euroText.setText("Dollar");
                  dollarText.setText("Euro");
              }else{
                  euroText.setText("Euro");
                  dollarText.setText("Dollar");
              }
          }
      });
  
      deci.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
              DecimalFormat newDeci = new DecimalFormat("0.##");
              String s = newDeci.format(result);
              result.setText(s);
          }
      });
  }
  public static double convertToDollar(double euro){
      return euro / 0.88;
  }
  public static double convertToEuro(double dollar){
      return dollar * 0.88;
  }
  }
  </code></pre>
  
  <p>log:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.kushtrimmhconverter.converter/com.example.kushtrimmhconverter.converter.MainActivity}: java.lang.NullPointerException
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2092)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117)
          at android.app.ActivityThread.access$700(ActivityThread.java:134)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1218)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:137)
          at android.app.ActivityThread.main(ActivityThread.java:4867)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
          at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.NullPointerException
          at com.example.kushtrimmhconverter.converter.MainActivity.onCreate(MainActivity.java:78)
          at android.app.Activity.performCreate(Activity.java:5047)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2056)
  </code></pre>
  
  <p>...</p>
  
  <pre><code> at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117)
          at android.app.ActivityThread.access$700(ActivityThread.java:134)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1218)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:137)
          at android.app.ActivityThread.main(ActivityThread.java:4867)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
          at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.NullPointerException
          at com.example.kushtrimmhconverter.converter.MainActivity.onCreate(MainActivity.java:78)
          at android.app.Activity.performCreate(Activity.java:5047)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2056)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117)
          at android.app.ActivityThread.access$700(ActivityThread.java:134)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1218)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:137)
          at android.app.ActivityThread.main(ActivityThread.java:4867)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:511)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>