0

I use the OKHTTP library to have Picasso auto-cache photos. I run this with a class. But I do not see the photos with Picasso when I'm working like this. I ran it by adding Android Manifest. "android: name.Global" I have removed the photo from it. What is the problem ? I'm sorry for my terrible english. Thanks in advance.

My build.gradle;

implementation 'com.squareup.okhttp3:okhttp:3.10.0'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'com.squareup.picasso:picasso:2.71828'

My Global.java

import android.app.Application;
import com.jakewharton.picasso.OkHttp3Downloader;
import com.squareup.picasso.Picasso;
public class Global extends Application {
@Override
public void onCreate() {
    super.onCreate();

    Picasso picasso = new Picasso.Builder(this)
            .downloader(new OkHttp3Downloader(this,Integer.MAX_VALUE))
            .build();
    picasso.setIndicatorsEnabled(true);
    picasso.setLoggingEnabled(true);
    Picasso.setSingletonInstance(picasso);

}
}

My Android MAnifest.xml;

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:name=".Global"

My java for Picasso;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    // Inflate the layout for this fragment
    view = inflater.inflate(R.layout.fragment_promotion, container, 
    false);

    IntroImage01 = (KenBurnsView)view.findViewById(R.id.IntroImage01);

    mDatabase.child("IntroImage01").addValueEventListener(new 
    ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            String url = dataSnapshot.getValue(String.class);

            Picasso.get()
                    .load(url)
                    .into(IntroImage01);
        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });

My codes work, but as I said, I do not see pictures when I add global.

ico3d
  • 41
  • 6

0 Answers0