-3
 super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
            this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);

    ImageView ImageMenuUtama = (ImageView) findViewById(R.id.backgroundDpn);
    Picasso.with(this).load( "http://cloudofoasis.com/api/Ivan/Gambar/bkgutama.jpg")
            .placeholder(R.drawable.placeholder)
            .fit()
            .error(R.drawable.error)
            .into(ImageMenuUtama);

}

and this picture show the code error placeholder(R.drawable.placeholder) and error(R.drawable.error):

placeholder(R.drawable.placeholder) and error(R.drawable.error)

Zoe
  • 27,060
  • 21
  • 118
  • 148
sweetpoem
  • 33
  • 1
  • 6

1 Answers1

0

You have to add image with name "placeholder" and "error" in drawable folder

STEP TO ADD DRAWABLE :

  1. Copy image from your computer
  2. Right click on drawable folder and click paste

    drawable folder

  3. Choose drawable directory

    drawable directory

  4. Give it name "placeholder", and click ok

    give it name

zihadrizkyef
  • 1,849
  • 3
  • 23
  • 46