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

what if i am using Arraylist<Item> #1

Open
ndhanif opened this issue Aug 18, 2022 · 0 comments
Open

what if i am using Arraylist<Item> #1

ndhanif opened this issue Aug 18, 2022 · 0 comments

Comments

@ndhanif
Copy link

ndhanif commented Aug 18, 2022

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

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

No branches or pull requests

1 participant