Picasso没有在android 4.4上加载一些网址

问题描述 投票:1回答:1

我正在尝试使用Picasso加载一些我从客户端后端获得的图像但是在android 4.4上它不起作用。来自互联网的所有其他网址我尝试工作正常,除了我从后端获得的那些。

private ImageView imageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        imageView = (ImageView) findViewById(R.id.image);
        Picasso.with(this)
                .load("https://sdo.gsfc.nasa.gov/assets/img/latest/latest_2048_HMIIC.jpg")
                .into(imageView);
    }

如果我用网上的任何其他网址替换https://sdo.gsfc.nasa.gov/assets/img/latest/latest_2048_HMIIC.jpg,它将正常工作。

我得到的日志:

09-04 08:16:42.261 18094-18094/? D/dalvikvm: Late-enabling CheckJNI
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve interface method 17054: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve interface method 17056: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve interface method 17060: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve virtual method 475: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
09-04 08:16:42.361 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
09-04 08:16:42.371 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
09-04 08:16:42.371 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve virtual method 497: Landroid/content/res/TypedArray;.getType (I)I
09-04 08:16:42.371 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008
09-04 08:16:42.441 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.widget.FrameLayout.startActionModeForChild, referenced from method android.support.v7.widget.ActionBarContainer.startActionModeForChild
09-04 08:16:42.441 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve virtual method 17491: Landroid/widget/FrameLayout;.startActionModeForChild (Landroid/view/View;Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
09-04 08:16:42.441 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x6f at 0x0002
09-04 08:16:42.451 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList
09-04 08:16:42.451 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve virtual method 284: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
09-04 08:16:42.451 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
09-04 08:16:42.461 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
09-04 08:16:42.461 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve virtual method 438: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
09-04 08:16:42.461 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
09-04 08:16:42.461 18094-18094/com.witanowski.myapplication I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
09-04 08:16:42.461 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve virtual method 440: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
09-04 08:16:42.461 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
09-04 08:16:42.471 18094-18094/com.witanowski.myapplication E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
09-04 08:16:42.471 18094-18094/com.witanowski.myapplication W/dalvikvm: VFY: unable to resolve instanceof 144 (Landroid/graphics/drawable/RippleDrawable;) in Landroid/support/v7/widget/AppCompatImageHelper;
09-04 08:16:42.471 18094-18094/com.witanowski.myapplication D/dalvikvm: VFY: replacing opcode 0x20 at 0x000c
09-04 08:16:42.511 18094-18094/com.witanowski.myapplication W/Settings: Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
09-04 08:16:42.531 18094-18094/com.witanowski.myapplication D/Picasso: Main        created      [R0] Request{https://btv.leankr.com/api/v1/thumbs/640x360/RTL9/programs/RTL9__112-Unite-durgence.jpg}
09-04 08:16:42.531 18094-18134/com.witanowski.myapplication D/Picasso: Hunter      executing    [R0]+9ms 
09-04 08:16:42.531 18094-18132/com.witanowski.myapplication D/Picasso: Dispatcher  enqueued     [R0]+8ms 
09-04 08:16:42.601 18094-18094/com.witanowski.myapplication I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: RGURRAM_AU_LINUX_ANDROID_LNX.LA.3.5.2.2_RB1.04.04.04.087.030+PATCH[ES]_msm8974_LNX.LA.3.5.2.2_RB1__release_ENGG ()
                                                                          OpenGL ES Shader Compiler Version: E031.24.00.15
                                                                          Build Date: 08/12/14 Tue
                                                                          Local Branch: 
                                                                          Remote Branch: quic/LNX.LA.3.5.2.2_rb1
                                                                          Local Patches: 8b00bd16f3c1d9d35a2fa902df5e679888d2b2e3 Fixes an llvm crash with mini dEQP apk
                                                                                           38bad22e162dead4e008444520a0144c78a347bd Fixes a potential dEQP crash.
                                                                                           ce345e1c45c2ae2d1fb2cb125c8d2574f1af5f95 Rev
09-04 08:16:42.621 18094-18094/com.witanowski.myapplication D/OpenGLRenderer: Enabling debug mode 0
09-04 08:16:42.711 18094-18094/com.witanowski.myapplication I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@43ae7788 time:21977122
09-04 08:16:43.771 18094-18132/com.witanowski.myapplication D/Picasso: Dispatcher  retrying     [R0]+1246ms 
09-04 08:16:43.781 18094-18164/com.witanowski.myapplication D/Picasso: Hunter      executing    [R0]+1253ms 
09-04 08:16:44.731 18094-18132/com.witanowski.myapplication D/Picasso: Dispatcher  retrying     [R0]+2201ms 
09-04 08:16:44.731 18094-18181/com.witanowski.myapplication D/Picasso: Hunter      executing    [R0]+2204ms 
09-04 08:16:44.751 18094-18132/com.witanowski.myapplication D/Picasso: Dispatcher  batched      [R0]+2224ms for error
09-04 08:16:44.951 18094-18094/com.witanowski.myapplication D/Picasso: Main        errored      [R0]+2429ms 
09-04 08:16:44.961 18094-18132/com.witanowski.myapplication D/Picasso: Dispatcher  delivered    [R0]+2430ms 
android picasso
1个回答
0
投票

我认为后端图像尺寸太大,所以毕加索需要花时间加载到imageview上。所以使用毕加索的占位符和错误方法并等待20秒我认为它会加载。

Picasso.get()
    .load(url)
    .placeholder(R.drawable.user_placeholder)
    .error(R.drawable.user_placeholder_error)
    .into(imageView);
© www.soinside.com 2019 - 2024. All rights reserved.