https://kotlinlang.org logo
#android
Title
# android
e

edwardwongtl

06/16/2018, 4:41 PM
I should put it this way, the
jsonTodo
is the data you need to write, together with the
id
, instead of removing it from the call site, what you should do it adding that to the function signature so that the function can receive both information you need.
n

neuber

06/17/2018, 3:16 PM
How can I do this?
@rkeazor
Do u knw
e

edwardwongtl

06/17/2018, 3:17 PM
Change your
.editTodo
function
n

neuber

06/17/2018, 3:22 PM
How
e

edwardwongtl

06/17/2018, 3:23 PM
I think this is even the most basic stuff in programming, you shouldn't need to ask
n

neuber

06/17/2018, 3:25 PM
@rkeazor here a thread bro
r

rkeazor

06/17/2018, 3:31 PM
I agree with @edwardwongtl , you should take time and learn some core coding concepts and fundamentals
In the long run, it will be more beneficial
Granted there are some issues you can run into that will be overly complex and down right confusing😂. So its defiantly cool to ask . But things like parameter signatures are core principal
n

neuber

06/21/2018, 2:12 AM
@Vishal hi
to this:
interface APIService { @POST(Constants.GET_TODO_LIST) fun getToDoList(): Observable<GetToDoListAPIResponse> @POST(Constants.EDIT_TODO) fun editTodo( @Field("todo_id") todoID:String, @Body todo_id:String, @Field("todo") todo:String 😞 Observable<BaseAPIResponse> @POST(Constants.ADD_TODO) fun addTodo(@Body todo:String): Observable<BaseAPIResponse> }
but not solved
e

edwardwongtl

06/21/2018, 4:17 AM
Any error message to give more information?
n

neuber

06/21/2018, 3:05 PM
I willtell
v

Vishal

06/21/2018, 3:07 PM
Please send logcat message
n

neuber

06/21/2018, 4:28 PM
C\neuber\adt bundle windows x86 64 20140702\sdk\ToDoApplication\app\src\main\java\com\rivuchk\todoapplication\tododetails\TodoDetailsActivity.kt (66, 70): No value passed for parameter 'todo'
e

edwardwongtl

06/21/2018, 4:30 PM
No value passed for parameter 'todo'
The error message already told you the issue.
n

neuber

06/21/2018, 4:34 PM
I can't solved
I tried
!
e

edwardwongtl

06/21/2018, 4:36 PM
You need to pass something for the
todo
parameter at the call site
n

neuber

06/21/2018, 4:38 PM
look this:
.editTodo(todoID: todoDataModel?.id?.toString()?:"",jsonTodo )
todoID is automatically populated because of this:
@POST(Constants.EDIT_TODO) fun editTodo( @Field("todo_id") todoID:String, @Body todo_id:String, @Field("todo") todo:String ):Observable<BaseAPIResponse>
todoID is first
Understood?
e

edwardwongtl

06/21/2018, 4:41 PM
Your
.editTodo()
now takes 3 parameters, and you're passing two
n

neuber

06/21/2018, 4:42 PM
3
how can I pass the todo parameter in this case?
e

edwardwongtl

06/21/2018, 4:43 PM
Just check the parameter's order and you should know
Look man, I cannot answer this kind of basic programming question forever, this is the basics of the basics in programming, not specifically about Android but in general for any king of programming.
n

neuber

06/22/2018, 2:04 AM
@kagomez