title: Update main layout from listview adapter click
body: <p>In my main.xml I have a linearLayout-userinfo which contains a Textview-username. The layout has (VISIBILITY:GONE),  and then a <code>ListView</code> below the userinfo layout.</p>
  
  <p>I want to make visible the linearLayout-userinfo when I click a <code>ImageView</code> inside the <code>ListView</code> and pass username to the textview.</p>
  
  <p>I have the following in my adapter code but doesn't work:</p>
  
  <pre><code>img.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              String owner_username =  ((Map&lt;String, String&gt;)getItem(position)).get("owner_username");
              TextView username     = (TextView) findViewById(R.id.userinfo);
              username.setText(owner_username);
              LinearLayout userinfo = (LinearLayout) parent.findViewById(R.id.userinfo);
              userinfo.setVisibility(View.VISIBLE);
              Toast.makeText(view.getContext(), "ImageView clicked for the row = " + position, Toast.LENGTH_SHORT).show();
          }
      });
  </code></pre>