How to open fragment on a button click from an activity either with intent and without intent in android?
<p>I tried the following code:</p>

<pre><code>Intent in= new Intent(Activity1.this,Fragment.class);
startactivity(in);
</code></pre>