问题描述
- 关于Fragment 中 用getActivity()报空的问题
- Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case 1:
ImageView mImageView = new ImageView(getActivity());这个位置报空
mImageView.setImageBitmap(map);
mImageView.setScaleType(ScaleType.CENTER);
mListImage.add(mImageView);
Log.e(""mListImage----->"" mListImage.size() + """");
mViewpageAdapter = new ViewPagerAdapter(mListImage);
mViewPage.setAdapter(mViewpageAdapter);
mViewpageAdapter.notifyDataSetChanged();
break;
}
}
};
求大神们帮忙解答
时间: 2024-11-17 22:58:46