Gomathi
Gomathi

Reputation: 29

Android list view show it button visible and invisible?

I am Android developer .I am used in json parser . i have to stored all data in Array List .What are the issue means i got custom id .They given 0 and 1 value passed.When i will get 0 means add button visible otherwise 1 will get in means custom button visible.How to check it in get View method.

I have added Array List .

Upvotes: 0

Views: 751

Answers (2)

Karan_Rana
Karan_Rana

Reputation: 2823

Use the following code inside your get view method:

button.setVisibility((value==0)?View.VISIBLE:View.GONE);

Upvotes: 0

itsrajesh4uguys
itsrajesh4uguys

Reputation: 4638

just use the condition something like below

if (yourvalue.equals("0")
{ 

button.setVisibility(View.VISIBLE);
}
else
{

button.setVisibility(View.GONE);
}

Upvotes: 1

Related Questions