Note that there are some explanatory texts on larger screens.

plurals
  1. POPassing parameter other activity
    text
    copied!<p>Top of my code</p> <pre><code> package com.br.openeed.engtoolspro; import android.app.Activity; import android.app.AlertDialog; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import android.widget.TextView; public class TubulaoDados extends Activity { // WIDGETS Spinner spTsolo; Button btCalcular; EditText etCarga, etMenorbase; TextView tvMenorbase, tvCm; // VARIABLES double valorCarga, valorTsolo, valorMenorbase, cargaKgf, verificacaoOblongada, verificacaoOblongada2, maiorBase, menorBase, areaFuste, diametroFuste, valorAlturabase, volumeBase; </code></pre> <p>I have the following method that is called after the calculations of the User:</p> <pre><code>// Writes the results to other activity public void chamaResultados() { Intent ITubulaoDados = new Intent(TubulaoDados.this, TubulaoResultados.class); ITubulaoDados.putExtra("resultadoDiametrofuste", diametroFuste); startActivity(ITubulaoDados); } </code></pre> <p>In another activity'm have:</p> <pre><code> package com.br.openeed.engtoolspro; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.widget.TextView; public class TubulaoResultados extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.tubulaoresultados); final TextView tvResultadofuste; Intent ITubulaoDados = getIntent(); final String resultadoFuste; if (ITubulaoDados != null) { tvResultadofuste.setText(Double.parseDouble(diametroFuste)); Log.i("TubulaoResultados","resultadoDiametrofuste" + diametroFuste); } } } </code></pre> <p><strong>I can not work, I am beginner and do not understand where ta wrong, I think the variable that I created in another activity is not being recognized this</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload