Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. try {
  2. //To get weight
  3. EditText W = (EditText) view.findViewById(R.id.weight);
  4. //Weight = Float.valueOf(W.getText().toString());
  5. //String weight = W.getText().toString();
  6. Weight = Float.valueOf(W.getText().toString());
  7.  
  8. //To get height
  9. EditText H = (EditText) view.findViewById(R.id.height);
  10. Height = Float.valueOf(H.getText().toString());
  11.  
  12. //To get age
  13. EditText A = (EditText) view.findViewById(R.id.Age);
  14. Age = Float.valueOf(A.getText().toString());
  15. }
  16. catch(Exception e)
  17. {
  18. e.getMessage();
  19. }
  20.  
  21. <EditText
  22. android:id="@+id/weight"
  23. android:layout_width="70dp"
  24. android:layout_height="wrap_content"
  25. android:layout_alignBottom="@id/da"
  26. android:layout_centerHorizontal="true"
  27. android:ems="10"
  28. android:inputType="number"
  29. android:textColor="@color/colorAccent" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement