The problem is this line:
((EditText) findViewById(R.id.editText_Time))
.setText(intent.getExtras().getInt("tempo"));
getInt
returns an int
, so the method setText(int resId)
will be called and will search the resource with the value returned by getInt("tempo")
which not exists and hence the ResourceNotFoundException
.
I assume that you want to set the text with the integer returned by getInt
(i.e call the method setText(CharSequence text)
). So do:
((EditText) findViewById(R.id.editText_Time))
.setText(String.valueOf(intent.getExtras().getInt("tempo")));
Also don't call getExtras()
multiple times. Call it once:
Bundle b = getIntent().getExtras();
if(b.getInt("requestCode") == 1){ //Richiesta modifica
((EditText) findViewById(R.id.editText_Time)).setText(String.valueOf(b.getInt("tempo")));
((EditText) findViewById(R.id.editText_Name)).setText(b.getString("nome"));
//((EditText) findViewById(R.id.editText_URL)).setText(b.getString("url"));
id_to_edit = b.getInt("id");
}