Fulllscreenviewactivity.java帮我完成android studio中的代码

时间:2018-02-01 11:23:48

标签: java android string android-studio

Android工作室节目 错误:不兼容的类型:int无法转换为字符串

错误来自我的.java文件中的3个。 错误从这里开始....

        `@Override
        public void onResponse(JSONObject response) {
            Log.d(TAG,
                    "Image full resolution json: "+ response.toString());
            try {
                // Parsing the json response
                JSONObject entry = response.getJSONObject(TAG_ENTRY);
                JSONArray mediacontentArry = entry.getJSONObject(
                        TAG_MEDIA_GROUP).getJSONArray(TAG_MEDIA_CONTENT);
                JSONObject mediaObj = (JSONObject) mediacontentArry.get(0);

                String fullResolutionUrl = mediaObj.getString(TAG_IMG_URL);
                // image full resolution widht and height
                final int width = mediaObj.getInt(TAG_IMG_WIDTH);
                final int height = mediaObj.getInt(TAG_IMG_HEIGHT);
                Log.d(TAG, "Full resolution image. url: "+ fullResolutionUrl + ", w: " + width + ", h: " + height);

                ImageLoader imageLoader = AppController.getInstance().getImageLoader();
                // We download image into ImageView instead of
                // NetworkImageView to have callback methods
                // Currently NetworkImageView doesn't have callback
                // methods
                ///
                progressStatus = 0;
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        while (progressStatus<100){
                            progressStatus += 1;
                            handler.post(new Runnable() {
                                @Override
                                public void run() {
                                    pbLoader.setProgress(progressStatus);
                                }
                            });
                            try {
                                Thread.sleep(100);
                            }catch (InterruptedException e)
                            {
                                e.printStackTrace();
                            }
                        }
                    }
                }).start();
                ///
                imageLoader.get(fullResolutionUrl,
                        new ImageLoader.ImageListener() {
                            @Override
                            public void onErrorResponse(
                                    VolleyError arg0) 
                         {
                                Toast.makeText(getApplicationContext(),getString(R.string.msg_wall_fetch_error),
                                        Toast.LENGTH_LONG).show();
                            }
                            @Override
                            public void onResponse(
                                    ImageLoader.ImageContainer response,boolean arg1) {
                                if (response.getBitmap() != null) {
                                    // load bitmap into imageview
                                    fullImageView.setImageBitmap(response.getBitmap());
                                    adjustImageAspect(width, height);
                                    // hide loader and show set &
                                    // download buttons
                                    pbLoader.setVisibility(View.GONE);
                                    llSetWallpaper.setVisibility(View.VISIBLE);
                                    llDownloadWallpaper.setVisibility(View.VISIBLE);
                                    getSupportActionBar().show();
                                }
                            }
                        });
            } catch (JSONException e) {
                e.printStackTrace();
                Toast.makeText(getApplicationContext(),
                        getString(R.string.msg_unknown_error),
                        Toast.LENGTH_LONG).show();
            }
        }
    }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            Log.e(TAG, "Error: " + error.getMessage());
            // unable to fetch wallpapers
            // either google username is wrong or
            // devices doesn't have internet connection
            Toast.makeText(getApplicationContext(),
                    getString(R.string.msg_wall_fetch_error),
                    Toast.LENGTH_LONG).show();
        }
    });`

我是Android开发的新手,我希望有人帮我完成这个fullscreenviewactivity.java文件。 为我纠正代码,以便我可以将其复制并粘贴到该文件中..谢谢

0 个答案:

没有答案