0

I have little experience in programming for android, so I turn to you. The fact is that I created a program for myself to practice my skills. Right now I have one ListView and the ListView has one ImageView and a TextView to fill in successfully through an Adapter. On ImageView I get a picture from the server, the problem is that when the server is local everything works fine, but if the real server then the picture does not load.

url="http://192.168.0.1/image/" or url="http://mysite/image/"

view = inflter.inflate(R.layout.list_item, null);
final ImageView icon = (ImageView) view.findViewById(R.id.GoodsIcon);

    try {
       Glide.with(url+GoodsList[i].GOODS_MEDIUM_IMAGE_NAME).into(icon);
    } catch (Resources.NotFoundException e) {
       Toast.makeText(view.getContext(), e.getMessage(), Toast.LENGTH_LONG).show();
    }

try catch does not catch errors, even when the server is real.

<ImageView
    android:id="@+id/GoodsIcon"
    android:layout_width="100dp"
    android:layout_height="130dp"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:layout_alignParentBottom="true"
    android:layout_marginStart="0dp"
    android:layout_marginTop="0dp"
    android:layout_marginBottom="2dp"
    android:adjustViewBounds="true"
    android:fontFamily="@font/bebas_neue_light"
    android:scaleType="fitEnd" />

In the manifest I have already added all access.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Notes: I also take the text for the TextView from the server, even on the real server the text loads successfully

0 Answers0