Without any code from your end, what I can suggest is to do something like :
recyclerView.post(new Runnable() {
                @Override
                public void run() {
                     // Execute your AsyncTask here by providing Width
                }
            });
Because the problem I can guess is your RecyclerView is not properly inflated when you call the AsyncTask with width
Also I would suggest you to put the method after you call setAdapter
1
solved IllegalArgumentException: width should be > 0?