When I click on empty field between images I have nullPointerException but when I click there I would like to get name of this group, Can I do this ?
code:
gallery.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent arg0)
{
GalleryItem item = (GalleryItem)arg0.item;
try
{
actualPath = item.getParentItem().getText()+"/";
actualPath += item.getText();
//....
//.... other operations
catch(NullPointerException e)
{
System.out.println("Null selection");
//..
}
}
and second question related with updating existing groups / items ..
I wrote code which removes one group when I load the same directory again and add new at first position but then index of group is changing and I have problem with identification .. so I think update group at the same position will be better
but It doesn't work for me
// code.... search the same name of group
// if find secondly the same group in arrayList delete first group from gallery
for(int j = 0; j < gallery.getItemCount(); j++)
{
if(actualFolderPath.equals(gallery.getItem(j).getText()))
{
gallery.remove(j);
}
}
//....
//..
And it works .. but how can I update ? when I add gallery.refresh(j); It's doesn't work ...in Java doc I saw Gallery#updateStructuralValues(GalleryItem changedGroup, boolean keepLocation) but I don't see this method, Thanks
[Updated on: Wed, 05 December 2012 14:39]
Report message to a moderator