I am trying to set an Image in ImageView
from URL using Picasso library.
The image is loading from some links like this:
https://pbs.twimg.com/profile_images/638751551457103872/KN-NzuRl.png
But not loading from link like this:
http://imagebin.ca/v/2J37dL9JufmN
I can't figure out what the issue is. I want to load my image from second url, but it's not working.
Here's *MainActivity.java**:
public class MainActivity extends AppCompatActivity {
ImageView a;
String Url;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
a = (ImageView) findViewById(R.id.a);
Url = "MY_URL";
Picasso.with(getApplicationContext())
.load(Url)
.placeholder(R.drawable.bday)
.into(a);
}
}
Here's a snippet from activity_main.xml
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/a" />
</LinearLayout>
I have set required permissions in manifest. I have explored few links similar to this problems but not able to solve this issue. Any help is appreciated.