cannot resolve simbol 'adapter' : I have an error with this code, i don't understand why, but "adapter.notifyDataSetChanged();" don't work, the message of error is: "cannot resolve simbol 'adapter'".
Code:wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

    final String URL = "http://example....";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    rv = (RecyclerView)findViewById(R.id.rv);

    ....

    public class PrintA extends AsyncTask<String, String, List<Model>> {
        ....
        @Override
        protected void onPostExecute(final List<MyModel> result) {
            super.onPostExecute(result);
            if (result != null) {
                MyAdapter adapter = new MyAdapter(result);
                rv.setAdapter(adapter);
            }else{
                Toast.makeText(getApplicationContext(), "no internet",                
            }
        }
    }

    new PrintA().execute(URL);

        rv.addOnScrollListener(new RecyclerView.OnScrollListener(){
            ....
            public class PrintB extends AsyncTask<String, String, List<Model>> {
            ....

            @Override
            protected void onPostExecute(final List<MyModel> result) {
                super.onPostExecute(result);
                if (result != null) {
                    ....
                    adapter.notifyDataSetChanged();
                }else{
                    Toast.makeText(getApplicationContext(), "can't add",                
                }
            }

            @Override
            public void onScrolled(RecyclerView recyclerView, int dx, int dy)
            {
                 ....            
                 new PrintB().execute(URL);
            }
        }