I'm working on a Android application. My app will include bottom navigation bar with four item and toolbar with one item. In my project, when there is no code, fragments and app is working, but when i wrote a line of code such as "EditText editText=getView().findViewById(R.id.editText);" to a fragment java file, my app is closing after tapped that fragment. After erase that code line, my app is working properly. Could you help me?
Asked
Active
Viewed 12 times
1 Answers
0
You need to cast the value to EditText
.
EditText editText = (EditText) getView().findViewById(R.id.editText);
This was answered already here.

maj
- 48
- 7
-
thanks, i changed "View view=inflater.inflate(R.layout.fragment_login, container, false);" and "return view;" and problem has solved. – Kemal Aydeniz Jun 08 '18 at 17:06