Guest User

Untitled

a guest
Feb 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. @Override
  2. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  3. Bundle savedInstanceState)
  4. {
  5.  
  6. // Inflate the layout for this fragment
  7. View view = inflater.inflate(R.layout.fragment_trip_date, container, false);
  8.  
  9. editText_From = view.findViewById(R.id.editText_From);
  10.  
  11. return view;
  12. }
  13.  
  14.  
  15. public void setSelectedCity(String city)
  16. {
  17.  
  18. Log.i("<<269>>", "Setting Text on Edit Text <<269>>:" + city);
  19.  
  20. editText_From.setText(city);
  21.  
  22. }
  23.  
  24. public void setSelectedCity(String city)
  25. {
  26.  
  27. Log.i("<<269>>", "Setting Text on Edit Text <<269>>:" + city);
  28. selectedCityConfirmed = city;
  29.  
  30. editText_From.setText(city);
  31.  
  32. }
  33.  
  34. 02-16 19:37:43.928 26582-26582/com.example.bob2609.busticketingapp E/AndroidRuntime: FATAL EXCEPTION: main
  35. Process: com.example.bob2609.busticketingapp, PID: 26582
  36. java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.support.v4.app.FragmentActivity.findViewById(int)' on a null object reference
  37. at com.example.bob2609.busticketingapp.TripDateFragment.setSelectedCity(TripDateFragment.java:188)
  38. at com.example.bob2609.busticketingapp.MainActivity.selectedCity(MainActivity.java:176)
  39. at com.example.bob2609.busticketingapp.LocationSelector$1.onItemClick(LocationSelector.java:69)
  40. at android.widget.AdapterView.performItemClick(AdapterView.java:313)
  41. at android.widget.AbsListView.performItemClick(AbsListView.java:1201)
  42. at android.widget.AbsListView$PerformClick.run(AbsListView.java:3195)
  43. at android.widget.AbsListView$3.run(AbsListView.java:4138)
  44. at android.os.Handler.handleCallback(Handler.java:761)
  45. at android.os.Handler.dispatchMessage(Handler.java:98)
  46. at android.os.Looper.loop(Looper.java:156)
  47. at android.app.ActivityThread.main(ActivityThread.java:6523)
  48. at java.lang.reflect.Method.invoke(Native Method)
  49. at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
  50. at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
  51.  
  52. @Override
  53. public void selectedCity(String city)
  54. {
  55.  
  56.  
  57. tripDateFragment.setSelectedCity(city);
  58.  
  59. }
Add Comment
Please, Sign In to add comment