activity.xmlfile
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/framelayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</RelativeLayout>
MainActivity class
File: MainActivity.javapackage com.desivegitable.com.mymanson; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.desivegitable.com.mymanson.Fragment.FragHome; import com.desivegitable.com.mymanson.R; public class MainActivity extends AppCompatActivity { @Overrideprotected void onCreate(Bundle savedInstanceState)
{ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); FragHome fragHome =new FragHome(); getSupportFragmentManager().beginTransaction().replace(R.id.framelayout,fragHome).commit(); } }
No comments:
Post a Comment