2016-11-09 33 views
-2

含有從活動到活動繪製圖像整數數組列表如何通過意圖相同的ArrayList如何穿過意圖

int[] imageId = {R.drawable.image, R.drawable.image, R.drawable.image,R.drawable.image, R.drawable.image}; 
+2

只是'intent.putExtra(「images」,imageId)' – shhp

回答

0

當前活動傳遞包含從活性可繪製圖像,以活動整數數組列表

Intent myIntent = new Intent(current.this, New.class); 
myIntent.putExtra("images", imageId); 
startActivity(myIntent); 

New.class

Bundle b = getIntent().getExtras();   
if(b!=null) 
{ 
ArrayList<Integer> arr = (ArrayList<Integer>)b.getIntegerArrayListExtra("images"); 

}