アクティビティ間でデータを渡しているというエラーが表示されます。次のエラーが表示されます。
01-07 17:14:06.063: E/AndroidRuntime(5653): FATAL EXCEPTION: main
01-07 17:14:06.063: E/AndroidRuntime(5653): java.lang.RuntimeException: Unable to start activity ComponentInfo{it.chri.regi/conti.Elenco_c_riep}: android.content.res.Resources$NotFoundException: String resource ID #0x1
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.app.ActivityThread.access$600(ActivityThread.java:141)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.os.Handler.dispatchMessage(Handler.java:99)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.os.Looper.loop(Looper.java:137)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.app.ActivityThread.main(ActivityThread.java:5103)
01-07 17:14:06.063: E/AndroidRuntime(5653): at java.lang.reflect.Method.invokeNative(Native Method)
01-07 17:14:06.063: E/AndroidRuntime(5653): at java.lang.reflect.Method.invoke(Method.java:525)
01-07 17:14:06.063: E/AndroidRuntime(5653): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
01-07 17:14:06.063: E/AndroidRuntime(5653): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-07 17:14:06.063: E/AndroidRuntime(5653): at dalvik.system.NativeStart.main(Native Method)
01-07 17:14:06.063: E/AndroidRuntime(5653): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x1
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.content.res.Resources.getText(Resources.java:239)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.widget.TextView.setText(TextView.java:3844)
01-07 17:14:06.063: E/AndroidRuntime(5653): at conti.Elenco_conti_riep.SaldoConti(Elenco_conti_riep.java:113)
01-07 17:14:06.063: E/AndroidRuntime(5653): at conti.Elenco_conti_riep.onCreate(Elenco_conti_riep.java:74)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.app.Activity.performCreate(Activity.java:5133)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
01-07 17:14:06.063: E/AndroidRuntime(5653): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
これは渡す私のコードです:
tvConto.setText(d.bund+"");
tvId.setText(d.id+"");
list.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
Dettaglio d = dettagli.get(position);
Intent sin_ent = new Intent(Ei.this, Enti_riep.class);
Bundle extras = new Bundle();
extras.putString("id", d.id+"");
extras.putString("bund", d.bund+"");
singole_ent .putExtras(extras);
startActivity(sin_ent);
この前者は次のことを受け取ります。
Bundle extras = getIntent().getExtras();
String id_ricevuto = (i.getStringExtra("id"));
String c_ricevuto = (i.getStringExtra("bund"));