Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Also Fixed issue related to DragNDropSimpleadapter background data list... #12

Merged
merged 1 commit into from Apr 6, 2015

Conversation

krazykira
Copy link
Contributor

-Fixed issue ( notifyDataSetChanged was not working when background data attached with DragNDropSimpleadapter was changed). This was causing the app to crash due to index out of bound exception.

  • Updated Support Library Version to 21.0.3
  • Updated Android Target Version to 5.0.1

…ist change after initialization. (Made notifyDataSetChanged change background data set)

- Updated Support Library Version to 21.0.3
- Updated Android Target Version to 5.0.1
@krazykira
Copy link
Contributor Author

If there is any problems understanding what was fixed then i assume you try to run the DragNDropSimpleAdapter with below class. You will notice that it will crash.
public class DragListActivity extends Activity {
    private DragNDropListView lv_list;
    private DragNDropSimpleAdapter mAdapter;
    private ArrayList<Map<String, Object>> items;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_draglist);
        super.onCreate(savedInstanceState);
        initUi();
        fillStudentList();
    }

    private void initUi() {
        items = new ArrayList<>();
        lv_list = (DragNDropListView) findViewById(R.id.lv_dragList);
        mAdapter = new DragNDropSimpleAdapter(this, items, R.layout.listitem_drag_n_drop, new String[] { "name" },
                new int[] { R.id.text }, R.id.handler);
        lv_list.setDragNDropAdapter(mAdapter);

    }

    private void fillStudentList() {
        for (int i = 0; i < 20; i++) {
            HashMap<String, Object> item = new HashMap<String, Object>();
            item.put("name", "Name " + i);
            item.put("_id", "id " + i);

            items.add(item);
        }
        mAdapter.notifyDataSetChanged();

    }
}

@krazykira
Copy link
Contributor Author

@fidanov @gipi @vlyutskanov could you guys take a look at it and merge it ?

fidanov added a commit that referenced this pull request Apr 6, 2015
-Also Fixed issue related to DragNDropSimpleadapter background data list...
@fidanov fidanov merged commit ffcb305 into terlici:master Apr 6, 2015
@fidanov
Copy link
Contributor

fidanov commented Apr 6, 2015

Thanks!

@krazykira
Copy link
Contributor Author

@fidanov ur welcome. Glad to help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants