Advertisement
Guest User

Untitled

a guest
Sep 12th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. //XML
  2. <EditText
  3. android:id="@+id/profileEditAbout"
  4. android:layout_width="match_parent"
  5. android:layout_height="wrap_content"
  6. android:autofillHints="@string/about_me"
  7. android:background="@drawable/shape_edit_text"
  8. android:minHeight="300dp"
  9. android:hint="@string/about_me"
  10. android:gravity="start|top"
  11. android:padding="8dp"
  12. android:inputType="textAutoCorrect|textMultiLine|textCapSentences"/>
  13.  
  14. //RETROFIT FUN
  15. @POST("upd_prof.php")
  16. @Multipart
  17. fun updateProfile(
  18. @Part("user_id") userId: Int,
  19. @Part("about")about: String?,
  20. @Part image: MultipartBody.Part?
  21. ) : Call<Void>
  22.  
  23.  
  24. //CODE
  25. val aboutText = view?.profileEditAbout?.text?.toString()
  26. AppMain.retrofitApi.updateProfile(
  27. userId,
  28. aboutText,
  29. null
  30. ).enqueue(someCallback)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement