View.Invisible - images stay on the screen

jimmychoo

New Member
I trying to set visibility of my imageview , button and textview. But they still there when I run the program.I tried the View.GONE but that just remove all the textview, imageview and button. But I just want to hide and then show.\[code\] list.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { if(baglanti.DegerDogruMu() == true) { ekvar = true; **// If true there is an attachment** gelen = baglanti.EkinIsmi(); } else { ekvar = false; **// False = no attachment** } }\[/code\]Then I put the result in the intent.\[code\]final Intent intent = new Intent(ListeleActivity.this, GoruntuleActivity.class);intent.putExtra(ekvarm?, ekvar);startActivity(intent);\[/code\]And the other Activitycall this method for with adding the "ekvar"\[code\] public void ListOnClicklendiginde(final int position , ArrayList<String> bodyliste , ArrayList<String> kimdenlist , ArrayList<String> konulist, boolean ekvarm? , ArrayList<String> ekinismi) {**// First I hide the "attachment things"** dosyaAdi.setVisibility(View.INVISIBLE); atacResim.setVisibility(View.INVISIBLE); ekButton.setVisibility(View.INVISIBLE);**// If there is an attachment then visible the things. (I debug for the no attachment email and it fall the false so the statement is working ok)** if( ekvarm? == true) { dosyaAdi.setVisibility(View.VISIBLE); atacResim.setVisibility(View.VISIBLE); ekButton.setVisibility(View.VISIBLE); } else { dosyaAdi.setVisibility(View.INVISIBLE); atacResim.setVisibility(View.INVISIBLE); ekButton.setVisibility(View.INVISIBLE); } }\[/code\]XML:\[code\]<RelativeLayout android:id="@+id/ekTablo" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_x="8dp" android:layout_y="102dp" > <ImageView android:id="@+id/imageViewAttachment" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:src="http://stackoverflow.com/questions/10367211/@drawable/ic_email_attachment" /> <TextView android:id="@+id/dosyaAdi" android:layout_width="210dp" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:textAppearance="?android:attr/textAppearanceLarge" /> <ImageButton android:id="@+id/imageButtonEkIndir" android:layout_width="50dp" android:layout_height="16dp" android:layout_centerVertical="true" android:layout_toRightOf="@+id/dosyaAdi" android:src="http://stackoverflow.com/questions/10367211/@drawable/ic_indir" /> </RelativeLayout>\[/code\]The red squaresAt the picture they have to hide
NqdOn.png
 
Back
Top