Home Foros Foro dudas Foro de Android Es posible disponer de soporte y comprar el curso? Respuesta a: Es posible disponer de soporte y comprar el curso?

Respuesta a: Es posible disponer de soporte y comprar el curso?

Home Foros Foro dudas Foro de Android Es posible disponer de soporte y comprar el curso? Respuesta a: Es posible disponer de soporte y comprar el curso?

#7944

Luis Prieto
Participante

Hola, ya tengo la aplicación completa, tan solo tengo que resolver un problema que surge con la excepción:

Se me sigue cayendo el programa si no meto datos en la entrada
<pre style=”background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 9,0pt;”><span style=”color: #000080; font-weight: bold;”>public void </span>calculo_radio (View vista) {

EditText entrada1 = (EditText) findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Sx</span>);
EditText entrada2 = (EditText) findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Sy</span>);
EditText entrada3 = (EditText) findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Tangencial</span>);
<b></b><i></i><u></u>
<pre style=”background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 9,0pt;”><span style=”color: #000080; font-weight: bold;”>try </span>{

<span style=”color: #000080; font-weight: bold;”>double </span>n1 = Double.<span style=”font-style: italic;”>parseDouble</span>(entrada1.getText().toString());
<span style=”color: #000080; font-weight: bold;”>double </span>n2 = Double.<span style=”font-style: italic;”>parseDouble</span>(entrada2.getText().toString());
<span style=”color: #000080; font-weight: bold;”>double </span>n3 = Double.<span style=”font-style: italic;”>parseDouble</span>(entrada3.getText().toString());
Intent radio = <span style=”color: #000080; font-weight: bold;”>new </span>Intent(<span style=”color: #000080; font-weight: bold;”>this</span>, Dibujar_Circulo.<span style=”color: #000080; font-weight: bold;”>class</span>);

radio.putExtra(<span style=”color: #008000; font-weight: bold;”>”numero1″</span>, n1);
radio.putExtra(<span style=”color: #008000; font-weight: bold;”>”numero2″</span>, n2);
radio.putExtra(<span style=”color: #008000; font-weight: bold;”>”numero3″</span>, n3);

startActivity(radio);//va otra actividad

}<span style=”color: #000080; font-weight: bold;”>catch </span>(Exception e){

EditText numero_resetSx= (EditText)findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Sy</span>);
EditText numero_resetSy= (EditText)findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Sx</span>);
EditText numero_resetTag= (EditText)findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Tangencial</span>);
numero_resetSx.setText(<span style=”color: #008000; font-weight: bold;”>”0″</span>);
numero_resetSy.setText(<span style=”color: #008000; font-weight: bold;”>”0″</span>);
numero_resetTag.setText(<span style=”color: #008000; font-weight: bold;”>”0″</span>);

}

También he intentado:

<pre style=”background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 9,0pt;”><span style=”color: #000080; font-weight: bold;”>public void </span>calculo_radio (View vista) {

EditText entrada1 = (EditText) findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Sx</span>);
EditText entrada2 = (EditText) findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Sy</span>);
EditText entrada3 = (EditText) findViewById(R.id.<span style=”color: #660e7a; font-weight: bold; font-style: italic;”>Tangencial</span>);
<pre style=”background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 9,0pt;”><span style=”display: inline !important; float: none; background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”> radio.putExtra(</span><span style=”background-color: transparent; color: #008000; font-family: &quot; courier new&quot;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”>”numero1″</span><span style=”display: inline !important; float: none; background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”>, n1);</span><br style=”background-color: transparent; color: #000000; font-family: &quot; courier new&quot;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;” /><span style=”display: inline !important; float: none; background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”> radio.putExtra(</span><span style=”background-color: transparent; color: #008000; font-family: &quot; courier new&quot;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”>”numero2″</span><span style=”display: inline !important; float: none; background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”>, n2);</span><br style=”background-color: transparent; color: #000000; font-family: &quot; courier new&quot;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;” /><span style=”display: inline !important; float: none; background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”> radio.putExtra(</span><span style=”background-color: transparent; color: #008000; font-family: &quot; courier new&quot;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”>”numero3″</span><span style=”display: inline !important; float: none; background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;”>, n3);</span>
<pre style=”background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 9,0pt;”><span style=”color: #000080; font-weight: bold;”>if </span>(entrada1!=<span style=”color: #000080; font-weight: bold;”>null</span>||entrada2!=<span style=”color: #000080; font-weight: bold;”>null</span>||entrada3!=<span style=”color: #000080; font-weight: bold;”>null</span>) {

n1=<span style=”color: #0000ff;”>0</span>;
n2=<span style=”color: #0000ff;”>0</span>;
n3=<span style=”color: #0000ff;”>0</span>;
}
<pre style=”background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 9,0pt;”><span style=”color: #000080; font-weight: bold;”>else if</span>(entrada1!=<span style=”color: #000080; font-weight: bold;”>null</span>||entrada2!=<span style=”color: #000080; font-weight: bold;”>null</span>||entrada3!=<span style=”color: #000080; font-weight: bold;”>null</span>){

Intent radio = <span style=”color: #000080; font-weight: bold;”>new </span>Intent(<span style=”color: #000080; font-weight: bold;”>this</span>, Dibujar_Circulo.<span style=”color: #000080; font-weight: bold;”>class</span>);

radio.putExtra(<span style=”color: #008000; font-weight: bold;”>”numero1″</span>, n1);
radio.putExtra(<span style=”color: #008000; font-weight: bold;”>”numero2″</span>, n2);
radio.putExtra(<span style=”color: #008000; font-weight: bold;”>”numero3″</span>, n3);

startActivity(radio);

}
<pre style=”background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 9,0pt;”>Pero se me cae de todas manera, por favor, mirad a ver si me podeis echar una mano.

Gracias
<pre style=”background-color: #ffffff; color: #000000; font-family: ‘Courier New’; font-size: 9,0pt;”><b></b><i></i><u></u>