title: imageview not showing, wieght and height 0
body: <p>Hello and thank you for taking the time to read this. I am a beginner in Android though I have experience in C# and C++. I am currently generating a qr with a button that is supposed to turn an invisible imageview visible. here is my xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.ChargeActivity&quot;&gt;
  
      &lt;include layout=&quot;@layout/toolbar&quot; /&gt;
  
      &lt;EditText
          android:id=&quot;@+id/currency_amount&quot;
          android:layout_width=&quot;200dp&quot;
          android:layout_height=&quot;40dp&quot;
          android:layout_centerHorizontal=&quot;true&quot;
          android:layout_marginTop=&quot;272dp&quot;
          android:inputType=&quot;numberDecimal&quot;
          android:hint=&quot;Ingrese el monto&quot;
          app:layout_anchor=&quot;@+id/include&quot;
          app:layout_anchorGravity=&quot;center&quot; /&gt;
  
      &lt;Spinner
          android:id=&quot;@+id/spinner&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;match_parent&quot;
          android:layout_alignParentTop=&quot;true&quot;
          android:layout_alignParentEnd=&quot;true&quot;
          android:layout_alignParentBottom=&quot;true&quot;
          android:layout_centerHorizontal=&quot;true&quot;
          android:layout_marginTop=&quot;-143dp&quot;
          android:layout_marginEnd=&quot;-12dp&quot;
          android:layout_marginBottom=&quot;3dp&quot; /&gt;
  
  
      &lt;Button
          android:id=&quot;@+id/generateqr_button&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_centerInParent=&quot;true&quot;
          android:gravity=&quot;center&quot;
          android:onClick=&quot;onClick&quot;
          android:text=&quot;Generar QR&quot;
          app:layout_anchor=&quot;@+id/include&quot;
          app:layout_anchorGravity=&quot;center&quot; /&gt;
  
      &lt;ListView
          android:id=&quot;@+id/transactions&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;300dp&quot;
          android:layout_alignParentStart=&quot;true&quot;
          android:layout_alignParentBottom=&quot;true&quot;
          android:layout_marginBottom=&quot;19dp&quot; /&gt;
  
      &lt;ImageView
          android:id=&quot;@+id/qr_image&quot;
          android:layout_width=&quot;300dp&quot;
          android:layout_height=&quot;300dp&quot;
          android:layout_centerInParent=&quot;true&quot;
          /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>and here is my java</p>
  <pre><code>public class ChargeActivity extends AppCompatActivity {
  
      public static final String ARG_USER = &quot;USER&quot;;
      String user = &quot;&quot;;
      private Bitmap bitmap;
      private ImageView qrImage;
      private String inputValue;
      private EditText amount;
      private ListView transactions;
  
      private Spinner spinner;
      private static final String[] currencies = {&quot;Bolivars&quot;, &quot;Petros&quot;, &quot;Dollars&quot;};
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_charge);
  
          user = getIntent().getStringExtra(ARG_USER);
  
  
  
          qrImage = findViewById(R.id.qr_image);
          qrImage.setVisibility(View.GONE);
  
          Toolbar toolbar = findViewById(R.id.toolbar);
          toolbar.setTitle(user);
          setSupportActionBar(toolbar);
  
          // Get a support ActionBar corresponding to this toolbar
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
          setContentView(R.layout.activity_charge);
          //Spinner Setup
          spinner = (Spinner) findViewById(R.id.spinner);
          final ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(ChargeActivity.this,
                  android.R.layout.simple_spinner_item, currencies);
          adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          spinner.setAdapter(adapter);
          //ListView Setup
          transactions = findViewById(R.id.transactions);
          ArrayList&lt;String&gt; transaction_list = new ArrayList&lt;String&gt;();
          transaction_list.add(&quot;bolaeyunke te ha enviado 1920 petros&quot;);
          transaction_list.add(&quot;bolaeyunke te ha enviado 1932232320 bolivares&quot;);
          transaction_list.add(&quot;bolaeyunke te ha enviado 1923230 dolares&quot;);
          transaction_list.add(&quot;El Comandante te ha enviado 120 petros&quot;);
          ArrayAdapter transaction_adapter = new ArrayAdapter(ChargeActivity.this, android.R.layout.simple_list_item_1, transaction_list);
          transactions.setAdapter(transaction_adapter);
          //Generate QR button setup
          Button generateQRButton = findViewById(R.id.generateqr_button);
          generateQRButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  amount = findViewById(R.id.currency_amount);
                  String montos = amount.getText().toString();
                  inputValue =  user + &quot;;&quot; + adapter.getItem(spinner.getSelectedItemPosition()).toString()+&quot;;&quot;+amount.getText().toString();
                  //setting up for qr display
                  WindowManager manager = (WindowManager) getSystemService(WINDOW_SERVICE);
                  Display display = manager.getDefaultDisplay();
                  Point point = new Point();
                  display.getSize(point);
                  int width = point.x;
                  int height = point.y;
                  int smallerDimension = width &lt; height ? width : height;
                  smallerDimension = smallerDimension * 3 / 4;
  
                  QRGEncoder qrgEncoder = new QRGEncoder(inputValue, null, QRGContents.Type.TEXT, smallerDimension);
                  qrgEncoder.setColorBlack(Color.RED);
                  qrgEncoder.setColorWhite(Color.BLUE);
                  try {
                      // Getting QR-Code as Bitmap
                      bitmap = qrgEncoder.getBitmap();
                      // Setting Bitmap to ImageView
  
  
                      qrImage.setImageBitmap(Bitmap.createScaledBitmap(bitmap, 120, 120, false));
  
                      qrImage.setVisibility(View.VISIBLE);
                      //Still need to implement an escape from showing the qr image
  
                  } catch (Exception e) {
                      e.getMessage();
                  }
              }
          });
  
      }
  </code></pre>
  <p>My imageview not only stays invisible, but when I debug, I see that the width and height are 0 for the imageview. I get no errors but it just does not show. I added the bitmap resizing after reading through some questions and thinking that that was the problem.</p>