Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.lang.NumberFormatException: unable to parse '' as integer
    text
    copied!<p>i want to set the calculation result in TextView named total[] from the value of EditText named point[] .but i am able to parse the value and put it in the TextView . it give me an error in logcat </p> <pre><code>06-27 02:27:01.467: E/AndroidRuntime(275): Caused by: java.lang.NumberFormatException: unable to parse '' as integer </code></pre> <p>this is an error in logcat. i want to add integer values to the textview continuously from the edittext on the same layout</p> <pre><code>public class player_name extends Activity { LinearLayout player_name; TableLayout ply_name; Bundle b,b1; List&lt;TextView&gt; allEds = new ArrayList&lt;TextView&gt;(); List&lt;Button&gt; allplus = new ArrayList&lt;Button&gt;(); List&lt;Button&gt; allminus = new ArrayList&lt;Button&gt;(); List&lt;EditText&gt; alledit = new ArrayList&lt;EditText&gt;(); List&lt;TextView&gt; alltotal = new ArrayList&lt;TextView&gt;(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.player_name); b1 = getIntent().getExtras(); String[] result = b1.getStringArray("playerName"); player_name = (LinearLayout) findViewById(R.id.player_name); ply_name = new TableLayout(this); player_name.addView(ply_name); TableLayout.LayoutParams tableRowParams=new TableLayout.LayoutParams (TableLayout.LayoutParams.MATCH_PARENT,TableLayout.LayoutParams.MATCH_PARENT,1.0f); TextView[] ed1 = new TextView[result.length+1]; Button[] plus = new Button[result.length+1]; Button[] minus = new Button[result.length+1]; EditText[] point = new EditText[result.length+1]; TextView[] total = new TextView[result.length+1]; TableRow[] TR= new TableRow[result.length+1]; int[] totalscore = null; String[] temp = null; Button btnResult = new Button(player_name.this); btnResult.setText(" click here to get RESULT"); for(int i=0;i&lt;=(result.length-1);i++) { ed1[i] = new TextView(player_name.this); plus[i] = new Button(player_name.this); minus[i] = new Button(player_name.this); point[i] = new EditText(player_name.this); total[i] = new TextView(player_name.this); TR[i] = new TableRow(player_name.this); allEds.add(ed1[i]); alltotal.add(total[i]); alledit.add(point[i]); allplus.add(plus[i]); allminus.add(minus[i]); TR[i].addView(ed1[i]); TR[i].addView(point[i]); TR[i].addView(plus[i]); TR[i].addView(minus[i]); TR[i].addView(total[i]); ply_name.addView(TR[i]); TR[i].setLayoutParams(tableRowParams); totalscore[i] =Integer.parseInt(point[i].getText().toString()); temp[i] = "" + totalscore[i]; ed1[i].setId(i); ed1[i].setHeight(50); ed1[i].setWidth(70); ed1[i].setText(result[i]); ed1[i].setTextColor(Color.CYAN); total[i].setId(i); total[i].setHeight(50); total[i].setWidth(70); total[i].setText(""+0); total[i].setTextColor(Color.CYAN); point[i].setId(i); point[i].setHeight(50); point[i].setWidth(120); point[i].setHint(result[i]+"\'s"); point[i].setInputType(InputType.TYPE_CLASS_NUMBER); point[i].setTextColor(Color.BLACK); plus[i].setId(i); plus[i].setHeight(50); plus[i].setWidth(50); plus[i].setText("+"); plus[i].setTextColor(Color.BLACK); minus[i].setId(i); minus[i].setHeight(50); minus[i].setWidth(50); minus[i].setText("-"); minus[i].setTextColor(Color.BLACK); plus[i].setOnClickListener(new OnClickListener() { public void onClick(View v) { } }); minus[i].setOnClickListener(new OnClickListener() { public void onClick(View v) { } }); } LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); player_name.addView(btnResult, lp); btnResult.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent1 = new Intent(player_name.this,result.class); startActivity(intent1); } }); } } </code></pre>
 

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