activity A 跳向 activity B 时,传递一个List<对象> 出现黑屏现 象,有网友说是oncreate事件加载过多数据,list.size()==500左右的时候就开始黑屏。
解决方案 »
- emulator-arm.exe 已停止工作?
- [Kernel FileSystem] Porting Android UMS 问题求教
- 多个Activity使用一个系统menu的问题
- 求教,Android程序怎样预先带有大量数据?
- ubuntu 11安装android ADT失败,求解!!!!
- android增强短信的一个bug
- Android 编译ffmpeg
- android的pad
- 用 delphi XE开发android程序的人多吗?
- android activity 生命周期怎么和别人的有所不同,设置启动模式也没什么用
- 关于多个ListView用ViewFlipper实现横向滑动的问题
- 如何计算MP3的时长
就是activity A 向activity B里面传递一个list<String> activity B显示list里面的String 一次只显示一个元素。由于list.size()比较大。然后就黑屏。
activity A(IPRIndex.java):
List<MyPages> wordpagelist = new ArrayList<MyPages>();
try
{
wordpagelist = readWordByPage(Constant.FILE_PATH);
} catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
int pageNum = 1;
Constant.KEYWORD = "";
Object[] wordpagearray = wordpagelist.toArray();
Intent it = new Intent(IPRIndex.this, LoadDocReader.class);
Bundle bundle = new Bundle();
bundle.putInt("pageNum", pageNum);
bundle.putSerializable("wordTextList",
wordpagearray);
bundle.putString("fileName", curClickName);
it.putExtras(bundle);
startActivity(it);
activity B(LoadDocReader.java):
Bundle bundle = this.getIntent().getExtras();
curPage = bundle.getInt("pageNum");
myPageList = (Object[]) bundle.getSerializable("wordTextList");
currentFileName = bundle.getString("fileName");
myPageLength = myPageList.length;
btn_topage.setText("转到(第" + curPage + "页/共" + myPageLength + "页)");
MyPages mypage = (MyPages) myPageList[curPage - 1];
byte[] bitmapbyte = mypage.getBitmapbyte();
在Handler 里 handleMessage()中处理, 这样就可以解决啦 楼主试试吧!