Call a Fragment from an Activity (from OnClickListener)
<p>I have a button inside my Activity and when I click on this button I want to call a Fragment. </p>

<p>For example if I want to call an Activity I can use the intent but if I want to call a Fragment, how can I do that?</p>

<p>I have checked other questions but I have not found an answer to what I'm asking. </p>

<pre><code>btnHome.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

        }
    });
</code></pre>

<p>What am I going to put inside this?</p>