Не все рисованные изображения загружаются с помощью picasso

Я использовал picasso для загрузки моего рисованного изображения, потому что они имеют высокое разрешение.

проблема теперь: не все изображения загружаются, иногда 3 из 4 изображений, показанных в действии, иногда 1 из 4 изображений.

Вот код:

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import com.squareup.picasso.MemoryPolicy;
import com.squareup.picasso.Picasso;




public class SummaryOfTour extends AppCompatActivity {
    Context context;

    ImageView imageView ,imageView1,imageView2,imageView3,imageView4,imageView5;


    static int ms1,ms2,ms3,ms4,ms5;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_summary_of_tour);

        imageView = (ImageView) findViewById(R.id.img1);
        imageView1 = (ImageView) findViewById(R.id.img2);
        imageView2 = (ImageView) findViewById(R.id.img3);
        imageView3 = (ImageView) findViewById(R.id.img4);
        imageView4 = (ImageView) findViewById(R.id.img5);

if(ms1 ==1) {

    Picasso.with(this)
            .load(R.drawable.mp1)
            .resize(1000, 1690)

            .into(imageView);


    Picasso.with(this)
            .load(R.drawable.mp2)
            .resize(1000, 1690)
            .into(imageView1);

    Picasso.with(this)
            .load(R.drawable.mp3)
            .resize(1000, 1690)
            .into(imageView2);

    Picasso.with(this)
            .load(R.drawable.mp4)
            .resize(1000, 1690)
            .into(imageView3);

    Picasso.with(this)
            .load(R.drawable.bg)
            .resize(1000, 1700)
            .into(imageView4);

}
        else if (ms2 ==1) {
            Picasso.with(this)
                    .load(R.drawable.mp11)
                    .resize(1000, 1690)
                    .into(imageView);

            Picasso.with(this)
                    .load(R.drawable.mp22)
                    .resize(1000, 1690)
                    .into(imageView1);

            Picasso.with(this)
                    .load(R.drawable.mp33)
                    .resize(1000, 1690)
                    .into(imageView2);

            Picasso.with(this)
                    .load(R.drawable.mp44)
                    .resize(1000, 1690)
                    .into(imageView3);

            Picasso.with(this)
                    .load(R.drawable.bg)
                    .resize(1000, 1700)
                    .into(imageView4);

        }

else if (ms3 ==1) {
    Picasso.with(this)
            .load(R.drawable.mp111)
            .resize(1000, 1690)
            .into(imageView);

    Picasso.with(this)
            .load(R.drawable.mp222)
            .resize(1000, 1690)
            .into(imageView1);

    Picasso.with(this)
            .load(R.drawable.mp333)
            .resize(1000, 1690)
            .into(imageView2);

    Picasso.with(this)
            .load(R.drawable.mp444)
            .resize(1000, 1690)
            .into(imageView3);

    Picasso.with(this)
            .load(R.drawable.bg)
            .resize(1000, 1700)
            .into(imageView4);

}

else if (ms4 ==1) {
    Picasso.with(this)
            .load(R.drawable.mp1111)
            .resize(1000, 1690)
            .into(imageView);

    Picasso.with(this)
            .load(R.drawable.mp2222)
            .resize(1000, 1690)
            .into(imageView1);

    Picasso.with(this)
            .load(R.drawable.mp5555)
            .resize(1000, 1690)
            .into(imageView2);

    Picasso.with(this)
            .load(R.drawable.mp7777)
            .resize(1000, 1690)
            .into(imageView3);

    Picasso.with(this)
            .load(R.drawable.mp66666)
            .resize(1000, 1700)
            .into(imageView4);

}





    }
}

Вот мой XML:

<LinearLayout 
    android_layout_width="match_parent"
    android_layout_height="match_parent"
    
    android_paddingBottom="@dimen/activity_vertical_margin"
    android_paddingLeft="@dimen/activity_horizontal_margin"
    android_paddingRight="@dimen/activity_horizontal_margin"
    android_paddingTop="@dimen/activity_vertical_margin"
    tools_context="com.sumo.traffic.InfoOfArtInIsland"
    android_background="#87E886"
    android_orientation="vertical">
    <ScrollView
        android_id="@+id/scrollView1"
        android_layout_width="match_parent"
        android_layout_height="500dp" >
        <LinearLayout
            android_layout_width="wrap_content"
            android_layout_height="wrap_content"
            android_orientation="vertical"
            android_weightSum="1">



            <LinearLayout
                android_layout_width="fill_parent"
                android_layout_height="wrap_content"
                android_orientation="horizontal"
                android_layout_marginTop="10dp">
                <ImageView
                    android_layout_width="100dp"
                    android_layout_height="100dp"
                    android_id="@+id/imageView5"
                    android_src="@drawable/loaders"
                    android_layout_alignParentTop="true"
                    android_layout_centerHorizontal="true"
                    android_layout_marginLeft="100dp"
                    android_layout_gravity="right" />
            </LinearLayout>



            <RelativeLayout
                android_layout_width="320dp"
                android_layout_height="550dp"
                android_orientation="horizontal"
                android_layout_marginTop="10dp"
                android_background="#BEFFB6"
                android_layout_marginLeft="10dp">



                <ImageView
                    android_layout_width="fill_parent"
                    android_layout_height="fill_parent"
                    android_id="@+id/img1"

                    android_layout_alignParentTop="true"
                    android_layout_alignStart="@+id/bckgrndViewFlipper1" />
            </RelativeLayout>
            <RelativeLayout
                android_layout_width="320dp"
                android_layout_height="550dp"
                android_orientation="horizontal"
                android_layout_marginTop="10dp"
                android_background="#BEFFB6"
                android_layout_marginLeft="10dp">



                <ImageView
                    android_layout_width="fill_parent"
                    android_layout_height="fill_parent"
                    android_id="@+id/img2"

                    android_layout_alignParentTop="true"
                    android_layout_alignStart="@+id/bckgrndViewFlipper1" />
            </RelativeLayout>

            <RelativeLayout
                android_layout_width="320dp"
                android_layout_height="550dp"
                android_orientation="horizontal"
                android_layout_marginTop="10dp"
                android_background="#BEFFB6"
                android_layout_marginLeft="10dp">



                <ImageView
                    android_layout_width="fill_parent"
                    android_layout_height="fill_parent"
                    android_id="@+id/img3"

                    android_layout_alignParentTop="true"
                    android_layout_alignStart="@+id/bckgrndViewFlipper1" />
            </RelativeLayout>


            <RelativeLayout
                android_layout_width="320dp"
                android_layout_height="550dp"
                android_orientation="horizontal"
                android_layout_marginTop="10dp"
                android_background="#BEFFB6"
                android_layout_marginLeft="10dp">



                <ImageView
                    android_layout_width="fill_parent"
                    android_layout_height="fill_parent"
                    android_id="@+id/img4"

                    android_layout_alignParentTop="true"
                    android_layout_alignStart="@+id/bckgrndViewFlipper1" />
            </RelativeLayout>


            <RelativeLayout
                android_layout_width="320dp"
                android_layout_height="550dp"
                android_orientation="horizontal"
                android_layout_marginTop="10dp"
                android_background="#BEFFB6"
                android_layout_marginLeft="10dp">



                <ImageView
                    android_layout_width="fill_parent"
                    android_layout_height="fill_parent"
                    android_id="@+id/img5"

                    android_layout_alignParentTop="true"
                    android_layout_alignStart="@+id/bckgrndViewFlipper1" />
            </RelativeLayout>







            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

            <!-- to be commented xml block goes here -->

        </LinearLayout>






        <!-- to be commented xml block goes here -->

        <!-- to be commented xml block goes here -->

        <!-- to be commented xml block goes here -->

        <!-- to be commented xml block goes here -->

        <!-- to be commented xml block goes here -->




        <!--       <LinearLayout
                   android_layout_width="fill_parent"
                   android_layout_height="wrap_content"
                   android_orientation="horizontal"
                   android_layout_marginTop="20dp">
                   <ImageButton
                       android_layout_width="wrap_content"
                       android_layout_height="100dp"
                       android_id="@+id/imageButton3"
                       android_background="@drawable/faqz"
                       android_layout_alignParentBottom="true"
                       android_layout_alignParentStart="true"
                       android_layout_marginBottom="10dp"/>

               </LinearLayout>

   -->




    </ScrollView>
</LinearLayout>

2 ответа

  1. Определите Источник изображения в xml-файле….
    android: src= » @drawablw/yourimgname»

    ваше расширение изображения должно быть «.формат PNG»
    Имя изображения не должно начинаться с and Integer ..

  2. Picasso.with(this)
                .placeholder(R.drawable.mp1)
                .resize(1000, 1690)
                .into(imageView);
    

    использовать.заполнитель instend load.