Skip to content

what if i am using Arraylist<Item> #1

Description

@ndhanif

Hi thanks for your use-full tutorial i watched on youtube. i have an issue after i watched your tutorial. you are using ArrayList when you add item on the listView. in my case i am using ArrayList. Item is a different class where i use setter and getter method.

when i try to read the file

try {
stream = new FileInputStream ( readFrom );
stream.read ( content );

        String s = new String ( content );
        s = s.substring ( 1, s.length () - 1 );



        String split[] = s.split ( ", " );

        listOfItem = new ArrayList<> ( Arrays.asList (split));

        mAdapter = new CustomAdapter_1 ( getContext (), listOfItem );
        recyclerView.setAdapter ( mAdapter );
    } catch (Exception e) {
        e.printStackTrace ();
    }

listofitem is reference from ArrayList.

this is where i am getting an error
listOfItem = new ArrayList<> ( Arrays.asList (split));

can you please solve my issue i really appreciate for your time. thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions