I'm having a problem in my app where, even with some of the most basic code (see below), I'm losing a fragment view on rotation.
Everything starts off great:
Until you rotate:
The story is the same the the other way as well:
I'm not sure what is going on. I've tried to follow various tutorials and code examples, checked via logging to make sure that the fragments are being saved and restored, but to no avail. What am I doing wrong?
MainActivity.java
public class MainActivity extends FragmentActivity
{
private FragmentManager fragment_manager;
private CharacterMenuFragment characterMenuFragment;
private CharacterEditFragment characterEditFragment;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_frame);
fragment_manager = getSupportFragmentManager();
if (savedInstanceState != null) {
characterMenuFragment = (CharacterMenuFragment) fragment_manager.getFragment(savedInstanceState, "characterMenuFragment");
characterEditFragment = (CharacterEditFragment) fragment_manager.getFragment(savedInstanceState, "characterEditFragment");
}
if (characterMenuFragment == null) {
Log.i("characterMenuFragment", "making new fragment");
characterMenuFragment = new CharacterMenuFragment();
} else {
Log.i("characterMenuFragment", "re-using old fragment");
}
if (characterEditFragment == null) {
Log.i("characterEditFragment", "making new fragment");
characterEditFragment = new CharacterEditFragment();
} else {
Log.i("characterEditFragment", "re-using old fragment");
}
fragment_manager.beginTransaction().replace(R.id.menu_frame, characterMenuFragment).commit();
fragment_manager.beginTransaction().replace(R.id.content_frame, characterEditFragment).commit();
}
#Override
public void onSaveInstanceState(Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);
fragment_manager.putFragment(savedInstanceState, "characterMenuFragment", characterMenuFragment);
fragment_manager.putFragment(savedInstanceState, "characterEditFragment", characterEditFragment);
}
}
CharacterEditFragment.java
public class CharacterEditFragment extends Fragment {
private View view;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.hello_world, container, false);
return view;
}
}
CharacterMenuFragment.java
public class CharacterMenuFragment extends Fragment {
private View view;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.hello_world, container, false);
return view;
}
}
content_frame.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<FrameLayout
android:id="#+id/menu_frame"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<FrameLayout
android:id="#+id/content_frame"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2" />
</LinearLayout>
hello_world.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/hello_world" />
</LinearLayout>
Try this:
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content_frame);
fragment_manager = getSupportFragmentManager();
if (savedInstanceState != null) {
characterMenuFragment = (CharacterMenuFragment) fragment_manager.getFragment(savedInstanceState, "characterMenuFragment");
characterEditFragment = (CharacterEditFragment) fragment_manager.getFragment(savedInstanceState, "characterEditFragment");
}
if (characterMenuFragment == null) {
Log.i("characterMenuFragment", "making new fragment");
characterMenuFragment = new CharacterMenuFragment();
fragment_manager.beginTransaction().replace(R.id.menu_frame, characterMenuFragment).commit();
} else {
Log.i("characterMenuFragment", "re-using old fragment");
}
if (characterEditFragment == null) {
Log.i("characterEditFragment", "making new fragment");
characterEditFragment = new CharacterEditFragment();
fragment_manager.beginTransaction().replace(R.id.content_frame, characterEditFragment).commit();
} else {
Log.i("characterEditFragment", "re-using old fragment");
}
}
Move the fragment managers into the applicable if statements above. You're just making sure to reuse the existing fragment and only creating one if the fragment doesn't exist.
Related
I am displaying various fragments in an Activity FrameLayout. The first fragment I display is a Google Map. To display a fragment, I swap the FrameLayout with a fragment. Next I display a fragment then push to the backstack. Upon popping the backstack the Google Map becomes very slow and laggy. If I override onBackPressed, remove the pushed fragment from the backstack then recreate the Google Map fragment, the Google Map responds as expected. Overridding onBackPressed seems like a work around.
How come the map is slow and laggy?
Here is my code (without the onBackPressed function I mentioned):
MainActivity
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
displayFragment(new MapFragment());
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
#Override
public boolean onOptionsItemSelected(MenuItem item) {
try {
int id = item.getItemId();
if(id == R.id.displayBlankFragment) {
displayDialogFragment(new BlankFragment());
return true;
}
} catch(Exception e) {
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
}
return super.onOptionsItemSelected(item);
}
private void displayFragment(Fragment fragment) {
FragmentTransaction t = getSupportFragmentManager().beginTransaction();
t.replace(R.id.frame, fragment);
t.commit();
}
private void displayDialogFragment(Fragment fragment) {
FragmentTransaction t = getSupportFragmentManager().beginTransaction();
t.replace(R.id.frame, fragment);
t.addToBackStack(null);
t.commit();
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<FrameLayout
android:id="#+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
</RelativeLayout>
MapFragment
public class MapFragment extends Fragment {
private View view;
public MapFragment() {
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if(view == null) {
view = inflater.inflate(R.layout.fragment_map, container, false);
}
return view;
}
}
fragment_map.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" >
</fragment>
</FrameLayout>
BlankFragment
public class BlankFragment extends Fragment {
public BlankFragment() {
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_blank, container, false);
}
}
fragment_blank.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="#string/hello_blank_fragment"/>
</FrameLayout>
I wrote codes about fragment according to the Google official tutorial
and both of them are almost the same,but why I still got error that couldn't find the TextView.
It consists of four java classes, and three layout files.I may want to work on the landscape,the tricky part is in the landscape,for the portrait works find.Therefore,I would only present the landscape code for well readability.
activity_main.xml(land)
As the demo does,my layout-landscape remains
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/list_fragment"
class="com.example.jimjay.bookapp.List_fragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<fragment
android:id="#+id/content_fragment"
class="com.example.jimjay.bookapp.ContenFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
content_view.xml
This for display text
<TextView
android:id="#+id/container_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:textSize="12dp"
android:textStyle="bold"
xmlns:android="http://schemas.android.com/apk/res/android" />
MainActivity.java
public class MainActivity extends AppCompatActivity implements List_fragment.OnListSelectedListener{
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (findViewById(R.id.container) != null) {
if (savedInstanceState != null) {
return;
}
List_fragment firstFragment = new List_fragment();
firstFragment.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction().add(R.id.container, firstFragment).commit();
}
}
#Override
public void onChapterSelected(int position) {
ContenFragment contenFragment=(ContenFragment)getSupportFragmentManager().findFragmentById(R.id.content_fragment);
if (contenFragment != null){
contenFragment.updateContent(position);
}else {
ContenFragment newFragment = new ContenFragment();
Bundle args = new Bundle();
args.putInt(ContenFragment.ARG_POSITION, position);
newFragment.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.container, newFragment);
transaction.addToBackStack(null);
transaction.commit();
}
}
}
List_fragment.java
public class List_fragment extends ListFragment {
OnListSelectedListener mCallBack;
interface OnListSelectedListener{
void onChapterSelected(int position);
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int layout=android.R.layout.simple_list_item_activated_1;
setListAdapter(new ArrayAdapter<>(getActivity(),layout,new Book_content().chapters));
}
#Override
public void onStart() {
super.onStart();
if (getFragmentManager().findFragmentById(R.id.list_fragment) != null){
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}
}
#Override
public void onAttach(Context context) {
super.onAttach(context);
try {
mCallBack=(OnListSelectedListener) context;
}catch (ClassCastException e){
throw new ClassCastException(context.toString()+" must implement OnListSelectedListener");
}
}
#Override
public void onListItemClick(ListView l, View v, int position, long id) {
mCallBack.onChapterSelected(position);
getListView().setItemChecked(position,true);
}
}
ContenFragment.java
public class ContenFragment extends Fragment {
final static String ARG_POSITION="position";
int mCurrentPosition=-1;
#Nullable
#Override
public View onCreateView(LayoutInflater inflater, #Nullable ViewGroup container, #Nullable Bundle savedInstanceState) {
if (savedInstanceState != null){
mCurrentPosition=savedInstanceState.getInt(ARG_POSITION);
}
return inflater.inflate(R.layout.content_view,container,false);
}
#Override
public void onStart() {
super.onStart();
Bundle args=getArguments();
if (args!= null){
updateContent(args.getInt(ARG_POSITION));
}else if (mCurrentPosition != -1){
updateContent(mCurrentPosition);
}
}
public void updateContent(int position) {
TextView textView = (TextView) getActivity().findViewById(R.id.container_content);
if (textView != null) {
textView.setText((new Book_content().contents_string[position]));
}else {
Log.e("LOG", "The textView is null");
}
mCurrentPosition = position;
}
#Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(ARG_POSITION,mCurrentPosition);
}
}
And the last Java file is Book_content.class, which just contain strings.
So it worked in portrait, but not in landscape, I can't figure it out, and the problem I found is the TextView in ContenFragment.class raises the exception, which is null. but I did have a TextView in the content_view. Why is that? HELP
Trying to figure it out myself,now I do.
It was odd that it still encountered the EXCEPTION,even if I just pasted the official sample codes in my classes directly.SO I have to turn to other instantiations.Changing the fragment in the right side into a fragmentLayout,let it be the same as the portrait layout.
activity_main.xml(land)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="#+id/list_fragment"
class="com.example.jimjay.bookapp.List_fragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<FrameLayout
android:id="#+id/content_fragment_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"></FrameLayout>
</LinearLayout>
So just use the FragmentTransaction to add the contentFragment.
i want to redirect activity to fragment when clicking button but it gives me error.
here is my activity class
public class EventDetailsNotif extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.eventdetails);
ImageButton imgmenu = (ImageButton) findViewById(R.id.imgmenu);
imgmenu.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
loadFragmentObj = new LoadFragment(getFragmentManager());
loadFragmentObj.initializeFragment(new ManagemntPageFragment());
}
});
}
}
and my load fragment class is here.
public class LoadFragment {
FragmentManager fragmentManager;
FragmentManager fragmentManager1;
public LoadFragment(FragmentManager fragmentManager2) {
this.fragmentManager = fragmentManager2;
}
public void initializeFragment(Fragment resultFragment) {
FragmentTransaction fragmentTransaction = fragmentManager
.beginTransaction();
fragmentTransaction.replace(R.id.content, resultFragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
}
}
and my content.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
and my fragment class.
public class ManagemntPageFragment extends Fragment {
ImageView footervie;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = (RelativeLayout) inflater.inflate(R.layout.managmntpg,
container, false);
footervie = (ImageView) view.findViewById(R.id.footervie);
advtimagepath = Utility.getSharedKey("advertiseFooter_image",
getActivity());
if (!TextUtils.isEmpty(advtimagepath)) {
if (advtimagepath.endsWith(".jpeg")
|| advtimagepath.endsWith(".jpg")
|| advtimagepath.endsWith(".gif")
|| advtimagepath.endsWith(".png")) {
imageLoader = new ImageLoader(getActivity());
imageLoader.DisplayImage(advtimagepath, footervie);
} else {
}
}
return view ;
}
}
please reply if have solution
are you sure you have below code
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
in eventdetails layout file because you set content menu in activity to this layout
setContentView(R.layout.eventdetails);
and if you don't use support library for fragment you will have compatibility with older android version!
I'm developing android tablet project. There is dualpane layout. In the left side there is leftscrollfrg fragment, it's also execute right side, mainmapfragment, it opens the map. In the left side, i click createproject button and when i click the button it hides the mainmapfragment and adds another fragment which is viewpager fragment. In the first page there is CreateProjectFrg1 fragment and inside there is button which adds another map fragment (CreateProjectMapFrg).
The problem is when the second map opened, the first one is showed like frozen. But i can see the new opened map because the old one padded from left and right. And also when i turn off the screen and back on, the old one map which frozen is gone.
How can i solve this problem?
Note: In the hierarchy view, i cannot see the frozen map.
public class LeftScrollFrg extends Fragment {
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View vw = inflater.inflate(R.layout.frg_left_behind, container, false);
frg_map = (MainMapFragment) getActivity()
.getSupportFragmentManager().findFragmentByTag(
MAP_FRAGMENT_TAG);
if (frg_map == null) {
frg_map = new MainMapFragment();
FragmentTransaction ft = getFragmentManager()
.beginTransaction();
ft.replace(R.id.above_framelayout, frg_map, MAP_FRAGMENT_TAG);
ft.addToBackStack(MAP_FRAGMENT_TAG);
ft.commit();
}
imgbtn_createproject.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
hideMainMapFrg();
openCreateProjectFrg();
}
});
imgbtn_map.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
hideCreateProjectFrg();
openMapFrg();
}
});
return vw;
}
private void hideMainMapFrg() {
fm = getActivity().getSupportFragmentManager();
frg_map = (MainMapFragment) fm
.findFragmentByTag(MAP_FRAGMENT_TAG);
if (fm != null) {
ft = fm.beginTransaction();
if (frg_map != null) {
if (frg_map.isVisible()) {
ft.hide(frg_map);
}
}
}
ft.commit();
}
private void openMapFrg() {
fm = getActivity().getSupportFragmentManager();
frg_map = (MainMapFragment) fm
.findFragmentByTag(MAP_FRAGMENT_TAG);
if (fm != null) {
ft = fm.beginTransaction();
if (frg_createproject != null) {
if (frg_createproject.isVisible()) {
ft.hide(frg_createproject);
}
}
if (frg_map == null) {
frg_map = new MainMapFragment();
ft.add(R.id.above_framelayout, frg_map, MAP_FRAGMENT_TAG);
} else {
if (frg_map.isHidden()) {
ft.show(frg_map);
}
}
ft.addToBackStack(MAP_FRAGMENT_TAG);
ft.commit();
}
}
}
public class MainMapFragment extends SupportMapFragment implements
LocationListener, LocationSource, OnInfoWindowClickListener,
OnMapClickListener {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
view = inflater.inflate(R.layout.frg_mainproject, container, false);
return view;
}
}
//frg_mainproject.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="#dimen/rightpanel_margin" >
<fragment
android:id="#+id/main_map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"
/>
</RelativeLayout>
public class CreateProjectFrg1 extends Fragment{
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View vw = inflater.inflate(R.layout.frg_createproject1, container,
false);
imgvw_createprojectmap.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
openCreateMap();
}
});
return vw;
}
private void openCreateMap() {
fm = getActivity().getSupportFragmentManager();
frg_map = (CreateProjectMapFrg) fm
.findFragmentByTag(CREATEPROJECTMAP_FRAGMENT_TAG);
if (fm != null) {
ft = fm.beginTransaction();
if (frg_map == null) {
frg_map = new CreateProjectMapFrg();
ft.add(R.id.above_framelayout, frg_map, CREATEPROJECTMAP_FRAGMENT_TAG);
}
ft.addToBackStack(CREATEPROJECTMAP_FRAGMENT_TAG);
ft.commit();
}
}
}
public class CreateProjectMapFrg extends SupportMapFragment implements
OnMapClickListener, OnMarkerClickListener {
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
if (view != null) {
ViewGroup parent = (ViewGroup) view.getParent();
if (parent != null)
parent.removeView(view);
}
try {
view = inflater.inflate(R.layout.frg_createprojectmap, container,
false);
} catch (InflateException e) {
}
setViewsResource(view);
setUpMapIfNeeded();
return view;
}
private void setUpMapIfNeeded() {
if (mMap == null) {
mMap = ((SupportMapFragment) getActivity()
.getSupportFragmentManager().findFragmentById(
R.id.frg_createproject_map)).getMap();
if (mMap != null) {
setUpMap();
}
}
}
}
//frg_createprojectmap.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="#+id/frg_createproject_map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
</RelativeLayout>
Updated code
This is https://code.google.com/p/gmaps-api-issues/issues/detail?id=5027
As a workaround you can explicitely remove / replace the MapFragment from the fragment manager instead of just hiding it. If you don't want to remove the fragment as a whole, you can also implement your own Fragment that just uses MapView and detaches that just before the fragment is hidden (might need some more custom code).
I want to show a Button and a PieChart below in a tab.
Thats the code I worked with: https://github.com/JakeWharton/ActionBarSherlock/blob/master/samples/fragments/src/com/actionbarsherlock/sample/fragments/FragmentTabs.java
Instead of the CountingFragment etc. I implemented my own.
I'm not sure what to
My xml:
fragment_graph_categories.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/fragment_graph_categories"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="#+id/button_filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/button_filter" />
</LinearLayout>
And that's my "Tab" attached to the TabManger
public class GraphCategories extends SherlockFragmentActivity {
GraphCategoriesFragment mCategoriesFragment;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_graph_categories);
if (savedInstanceState == null) {
// Do first time initialization -- add initial fragment.
mCategoriesFragment = GraphCategoriesFragment.newInstance(1);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.fragment_graph_categories, mCategoriesFragment).commit();
} else {
//mStackLevel = savedInstanceState.getInt("level");
}
}
#Override
protected void onResume() {
if(mCategoriesFragment != null) {
//mCategoriesFragment.onResumeRedraw();
}
}
//notice Inner class
public static class GraphCategoriesFragment extends SherlockFragment {
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//View mChartView = inflater.inflate(R.layout.hello_world, container, false);
View rlayout = inflater.inflate(R.layout.fragment_graph_categories, container, false);
//? rlayout = new LinearLayout(getActivity());
return rlayout;
}
}
}
But im not sure what to inflate at the fragments onCreateView or if I need a FrameLayout in my xml?
I tried some options but don't figured it out.