2

I use AIDE to code apps. I want to implement swipe menu ListView library link in my app. I added the dependency and XML Layout as said But getting error at the line listView.setMenuCreator(creator);

The error is no setMenuCreator() found

The code used as said in with

SwipeMenuCreator creator = new SwipeMenuCreator() {

        @Override
        public void create(SwipeMenu menu) {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            openItem.setBackground(new ColorDrawable(Color.rgb(0xC9, 0xC9,
                    0xCE)));
            // set item width
            openItem.setWidth(dp2px(90));
            // set item title
            openItem.setTitle("Open");
            // set item title fontsize
            openItem.setTitleSize(18);
            // set item title font color
            openItem.setTitleColor(Color.WHITE);
            // add to menu
            menu.addMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                    getApplicationContext());
            // set item background
            deleteItem.setBackground(new ColorDrawable(Color.rgb(0xF9,
                    0x3F, 0x25)));
            // set item width
            deleteItem.setWidth(dp2px(90));
            // set a icon
            deleteItem.setIcon(R.drawable.ic_delete);
            // add to menu
            menu.addMenuItem(deleteItem);
        }
    };
    // set creator
    mListView.setMenuCreator(creator);
Enzokie
  • 7,365
  • 6
  • 33
  • 39
user5524159
  • 553
  • 5
  • 16

2 Answers2

1

About the mListView's type,you should use SwipeMenuListView but not the Listview.

LangZXG
  • 11
  • 1
0

Got the answer Instead of swipemenullistview listvview I was using ListView listvview Wrote declaring the variables

user5524159
  • 553
  • 5
  • 16