title: Add button in top right toolbar corner programmatically
body: <p>I'm trying to add a button in the top right corner of a toolbar, this is my code:</p>
  
  <pre><code>   mToolbar = (Toolbar) getActivity().findViewById(R.id.toolbar);
  
      verified_btn = new Button(getActivity());
      verified_btn.setBackgroundResource(R.drawable.ic_done_black_24dp);
  
      RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(Toolbar.LayoutParams.WRAP_CONTENT, Toolbar.LayoutParams.WRAP_CONTENT);
  
      params.addRule(RelativeLayout.ALIGN_PARENT_END);
      params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
      params.width = 80;
      params.height = 80;
  
      verified_btn.setLayoutParams(params);
      verified_btn.setOnClickListener(this);
      mToolbar.addView(verified_btn);
  </code></pre>
  
  <p>but this is the result:</p>
  
  <p><a href="https://i.stack.imgur.com/SYq5q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SYq5q.png" alt="enter image description here"></a></p>
  
  <p>I have tried different way, but is always there, how I can do?</p>