【发布时间】:2016-02-01 22:58:17
【问题描述】:
下面是我用来填充图像的片段
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Log.i(TAG, "onCreateView");
Bundle bundle = this.getArguments();
View inflatedView = inflater.inflate(R.layout.fragment_picture_grid, container, false);
this.gridView = (GridView) inflatedView.findViewById(R.id.gridview);
this.myImageAdapater = new DeviceImageAdapter(this.getActivity(), bundle.getString("id"), bundle.getString("name"));
我正在使用自定义适配器来设置网格视图,并编写了某些方法来调用 Web 服务。从 web 服务收到响应后,我不会返回调用片段。请帮忙。我是安卓开发新手。
【问题讨论】:
-
如果您永远不会从
DeviceImageAdapter返回,那么该类中可能存在一些错误。您在 logcat 上收到任何崩溃或消息吗?你能提供那个类的代码吗?对了,你是把适配器设置为GridView吗? -
是的,我正在设置适配器
-
我正在从 DEviceImage 适配器类调用一个 web 服务,然后我得到了结果。
-
我在日志中看到,即使在我得到响应之前,我也会来回移动到片段,最后在收到响应时移动到主要活动
-
没有代码真的很难说哪里出了问题。你能提供吗?
标签: android web-services gridview imageview