Im新的android。鍵字符串數組預期的字符串[],但值是一個java.util.ArrayList
如何從一個類的數組值到另一個類使用Intent?
我想是這樣的... 1日活動...
Intent videointent = new Intent(Focusarea.this,Videoplayer.class); videointent.putExtra("string-array", resim_list); startActivity(videointent);
第二活性
Intent intent=getIntent(); String [] Array = intent.getStringArrayExtra("string-array");
即時得到此爲警告,並即時得到空作爲第二次活動的價值..
W/Bundle(521): Key string-array expected String[] but value was a java.util.ArrayList. The default value <null> was returned. W/Bundle(521): Attempt to cast generated internal exception: W/Bundle(521): java.lang.ClassCastException: java.util.ArrayList W/Bundle(521): at android.os.Bundle.getStringArray(Bundle.java:1459) W/Bundle(521): at android.content.Intent.getStringArrayExtra(Intent.java:3630) W/Bundle(521): at com.example.TEENEINSTIEN.Videoplayer.onCreate(Videoplayer.java:20) W/Bundle(521): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
with startActivity。照常。 – Blackbelt 2013-05-06 12:47:43
是resim_list的一個String數組嗎? – Blackbelt 2013-05-06 13:04:37
ArrayList –
2013-05-06 13:06:42