I have an AlertDialog whose content is a ScrollView with an image and a button inside. ScrollView works fine (I can "scroll" the bar), but the image does not appear (blank), although the button appears (scrolling to the end). Already on the cell phone of a friend of mine, the image appears. I think the only difference from his cell phone to mine is the Android version: his is 6.0 and my 4 is something. Here is the XML of the layout that I post in AlertDialog:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/imagem_teste" />
<Button
android:id="@+id/bt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:backgroundTint="@color/viewfinder_laser"
android:text="Entendi"
android:textAppearance="@style/TextAppearance.AppCompat.Large.Inverse" />
</LinearLayout>
And the button code that creates and displays the dialog:
btnSobre.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LayoutInflater li = getLayoutInflater();
View view = li.inflate(R.layout.alerta, null);
view.findViewById(R.id.bt).setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
alerta.dismiss();
}
});
AlertDialog.Builder builder = new AlertDialog.Builder(TelaInicial.this);
builder.setTitle("Sobre...");
builder.setView(view);
alerta = builder.create();
alerta.show();
}
}
);
Could anyone tell me why the image does not appear?