Ist ein Quiz-Spiel und die Antwort kann Text oder Bild sein, ich benutze Gilde Bild, um es zu laden, aber für einige Benutzer können die Bilder nicht laden, auch wenn das Internet ist gut und die Bilder sind von geringer Qualität.Glide Bilder werden manchmal nicht geladen
Ich werde den ganzen Code kopieren, weil ich keine Ahnung habe, ob Gilde Problem ist oder nicht.
if (AppConstant.arQuestionList.get(questionid).getArAnswer().get(i).getAtype()
.equalsIgnoreCase("image")) {
txtOption = new ImageView(this);
try {
Glide.with(QuestionActivity.this).load(AppConstant.arQuestionList.get(questionid)
.getArAnswer().get(i).getAnswer()).override(60, 60).into((ImageView)
txtOption);
}catch (OutOfMemoryError e){
e.printStackTrace();
}
txtOption.setPadding(5, 5, 5, 5);
} else {
txtOption = new TextView(this);
((TextView) txtOption).setText(AppConstant.arQuestionList.get(questionid)
.getArAnswer().get
(i).getAnswer());
((TextView) txtOption).setTextColor(getResources().getColor(R.color.answer_color));
((TextView) txtOption).setTypeface(tf, Typeface.BOLD);
((TextView) txtOption).setGravity(Gravity.CENTER);
txtOption.setPadding(10, 20, 10, 20);
}
Layout-
<LinearLayout
android:id="@+id/answerwrap"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_30"
android:orientation="vertical">
</LinearLayout>
Ich habe versucht, aber immer noch nicht funktioniert. –