> 
> I am working on a application where I have to add *cardView* to
>  *recyclerView* *dynamically*, but it is not working.
> 
> 
> This is my code :-
> 
> 
> 

```
Button okBTN;
     EditText enterCornerNumberET;
     private RecyclerView mRecyclerView;
     private CornerListAdapter mAdapter;
 public int cornervalue;

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.corner_list);

  okBTN = (Button)findViewById(R.id.okBTN);

        enterCornerNumberET = (EditText)findViewById(R.id.enterCornerNumberET);

 mRecyclerView = (RecyclerView)findViewById(R.id.recycler_view);

 mRecyclerView.setHasFixedSize(true);
        mLayoutManager = new LinearLayoutManager(this);
        mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mRecyclerView.setLayoutManager(mLayoutManager);

 okBTN.setOnClickListener(this);

  @Override
    public void onClick(View v) {

        switch (v.getId()){

 case R.id.okBTN:

                cornervalue = Integer.valueOf(enterCornerNumberET.getText().toString().trim());

                Toast.makeText(CornerListActivity.this, ""+cornervalue, Toast.LENGTH_SHORT).show();

                createCornerList(cornervalue);

               /*if(enterCornerNumberET.getText().toString().trim()==null){

                    Toast.makeText(CornerListActivity.this, "Please enter corner number", Toast.LENGTH_SHORT).show();

                }else{

                    createCornerList(cornervalue);

                }*/

                break;

}
}

 private void createCornerList(int cornervalue) {

        for (int i = 0; i < cornervalue; i++) {

            mAdapter=new CornerListAdapter(this,roofCornerArrayList);
            mRecyclerView.setAdapter(mAdapter);
        }
    }

```

> 
> Please have a look and let me know what mistake I am doing here. Thanks in advance. :)
> 
> 
>