Failed to allocate to 1850507580 byte allocation with 1048480 free bytes and 382MB until OOM

0

I'm putting a 728k image into an ImageView and when I run the app in android studio gives this stick in the application:

  

java.lang.OutOfMemoryError: Failed to allocate to 1850507580 byte allocation with 1048480 free bytes and 382MB until OOM

Does anyone know why this is so?

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.gustavo.easypasse.LoginActivity"
tools:showIn="@layout/activity_login">

<LinearLayout
    android:layout_width="368dp"
    android:layout_height="150dp"
    android:layout_marginTop="50dp"
    android:orientation="horizontal"
    app:layout_constraintTop_toTopOf="parent"
    tools:layout_editor_absoluteX="8dp"
    android:id="@+id/linearLayout">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="wrap_content"
        android:layout_height="150dp"
        android:layout_weight="1"
        app:srcCompat="@drawable/logo_easy_passe_b" />
</LinearLayout>

<LinearLayout
    android:id="@+id/linearLayout2"
    android:layout_width="0dp"
    android:layout_height="50dp"
    android:layout_marginEnd="8dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="30dp"
    android:layout_weight="1"
    android:orientation="horizontal"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/linearLayout"
    app:layout_constraintHorizontal_bias="0.0">

    <EditText
        android:id="@+id/edtCPF"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:ems="10"
        android:hint="CPF"
        android:inputType="textPersonName" />

</LinearLayout>

<LinearLayout
    android:layout_width="0dp"
    android:layout_height="50dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginTop="8dp"
    android:layout_weight="1"
    android:orientation="horizontal"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
    android:layout_marginStart="8dp"
    android:layout_marginEnd="8dp"
    android:id="@+id/linearLayout3">

    <EditText
        android:id="@+id/edtSenha"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:ems="10"
        android:hint="Senha"
        android:inputType="textPersonName" />
</LinearLayout>

<LinearLayout
    android:layout_width="0dp"
    android:layout_height="50dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginTop="41dp"
    android:orientation="horizontal"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/linearLayout3"
    android:layout_marginStart="8dp"
    android:layout_marginEnd="8dp"
    android:id="@+id/linearLayout4">

    <Button
        android:id="@+id/btnAcesse"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Acesse" />
</LinearLayout>

<LinearLayout
    android:layout_width="0dp"
    android:layout_height="50dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginTop="7dp"
    android:orientation="horizontal"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/linearLayout4">

    <Button
        android:id="@+id/btnCadastro"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="Cadastro" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>

    
asked by anonymous 13.10.2017 / 22:59

0 answers