小编Mou*_*ika的帖子

NoSuchMethodError:android中的com.android.app.fragment getContext

我在GridView类别和类别图像中的php webservices获取此错误是在数组列表中我必须在网格视图中显示它们thrpough web services但是getData()中出现错误,因为NoSuchMethodError请尝试帮助我提前谢谢.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.activity_customerhomepage, container, false);
    gridView = (GridView) rootView.findViewById(R.id.gridView);
    ids = new ArrayList<>();
    categorys = new ArrayList<>();
    category_imgs = new ArrayList<>();

    //Calling the getData method
    getData();
    return rootView;
}

private void getData() {

    final ProgressDialog loading = ProgressDialog.show(getContext(), "Please wait...", "Fetching data...", false, false);

    //Creating a json array request to get the json from our api
    JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(DATA_URL,
            new Response.Listener<JSONArray>() {
                @Override …
Run Code Online (Sandbox Code Playgroud)

android

7
推荐指数
1
解决办法
3457
查看次数

标签 统计

android ×1