-1

I am a beginner.I want to make an app that includes following:

-Navigation Drawer -Tab Swipe View -Two edittext,one textview and one button for each tab

I will add the screenshots.

I managed to combine Navigation Drawer and tab view.But I have trouble with edittext and textview inside the fragment.I want my textview to display the additon of two edittexts when I click the button.Please help me.Thanks.

enter image description here

enter image description here

Vitasset
  • 1
  • 1

1 Answers1

0

i didn't get your exact error or problem from your question, in fragments, did you initialized the text boxes,edit texts and Buttons like this?

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.activity_howitworks, container, false);
        edittext=(EditText)view.findViewById(R.id.ed_id);
        textview=(TextView)view.findViewById(R.id.tv_id);
        button=( Button)view.findViewById(R.id.bd_id);
}
Sharon Joshi
  • 498
  • 7
  • 19
  • can you specify the exact error that you are getting – Sharon Joshi Jul 03 '18 at 06:57
  • 1
    Yes I did but where to put Java code? Inside fragment class or main activity or fragmentpageradapter class? – Vitasset Jul 03 '18 at 11:14
  • u did the design in the fragment's xml right?..then the code should be in the fragments....i think you should study more about the fragments and android..find some you tube tutorials.. – Sharon Joshi Jul 03 '18 at 11:21