How to check whether GridView is Empty or not in Android?
===

I have add buttons in GridView using base adapter, that buttons depend on word length when click the button then hide. After clicking all buttons the gridview is make empty i want to check, if GridView is Empty Display another buttons. I want to check whether GridView is empty or not in GridViewActivity.java

Here is the code.

GridViewActivity.java


	public void onCreate(Bundle savedInstanceState) 
	{
        super.onCreate(savedInstanceState);
        setContentView(R.layout.spellword);
        
        txt=(TextView)findViewById(R.id.txtview);
        image=(ImageView)findViewById(R.id.imgview1);
        
        map.put("melon", R.drawable.melon);
        image.setImageResource(map.get("melon"));
       
        
        gridView=(GridView)findViewById(R.id.grid1);
        gridView.setAdapter(new SpellAdapter(this,words,word));
       
        detector = new SimpleGestureFilter(this, this);
        
	}

SpellAdapter.java




public class SpellAdapter extends BaseAdapter{
	
	public Context context;
	public char[] word;
	
	public SpellAdapter(Context context, char[] word, String orglWord)
	{
		this.context=context;
		this.word=word;
		
	}
	
	public int getCount() {
		count=word.length;
		return count;
	}

	public Object getItem(int position) {
		
		return null;
	}

	public long getItemId(int position) {
		
		return 0;
	}

	
	public View getView(final int position, View convertView, ViewGroup arg2) {
		
		View v = convertView;
        if (v == null) 
        {  
        	 LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
             v = vi.inflate(R.layout.buttonlist, null);
        } 
			
        final Button btn= (Button)v.findViewById(R.id.letterbtn);
        
		btn.setText(word[position]+"");
		
		btn.setOnClickListener(new OnClickListener(){
			
			public void onClick(View v) 
			{
				letters=btn.getText();
				String word = letters.toString();
				btn.setVisibility(View.GONE);
						
			}
		
			
		});
		
		return v; 
	}
	
	
	
	
}


