I\'m new to Android development, I\'m trying to load image from url using Picasso, but it failed when I navigate to the Picasso loading activity.
Below is the code t
From what I see, you spent a reference to the instance of the activity Context context = this;
outside Oncreat method (), so be getting NullPointerException
Here
Picasso.with(context).load("http://postimg.org/image/wjidfl5pd/").into(ImageView1);
the context
variable is null
Change this:
//Declaring Variable
ImageView ImageView1 = (ImageView)findViewById(R.id.forthImage);
Context context = this;
By:
//In onCreate()
ImageView ImageView1 = (ImageView)findViewById(R.id.forthImage);
Picasso.with(this).load("http://postimg.org/image/wjidfl5pd/").into(ImageView1);