2

I have Fragment activity where I display contents using RelativeLayout. I am displaying text and everything is working OK.

Now I would like to add some graphics information and I have problems. There is no onDraw() method in Fragment.

Is there a way where I would be able to use RelativeLayout to display text information and draw at the same time on Fragment?

Thank you.

Update:

I am using this code:

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)  
{  
  mFragmentView = inflater.inflate(R.layout.fragment_stat, container, false);  
  return mFragmentView;  
}

From what I understand I will have to override (or change) the View that is created by Inflater.inflate() method. How can I do that?

UrosP
  • 111
  • 1
  • 2
  • 4

1 Answers1

0

You just do not understand what the fragment. This is a common problem. Learn the official documentation.

The fragment is like a small part of the activity. It does not have a method of drawing. Drawing have View. You just need to add your View to a fragment.

Here's an example.

Community
  • 1
  • 1
user2413972
  • 1,355
  • 2
  • 9
  • 25