Skip to content
Advertisement

Send string value from one method to another

My first method deviceList is able to work successfully and I am able to store a value in the variable String.id. I am then trying to use that string in my second method addReview1 to implement that string in my database search. However, the method addReview1 is requested through a button onclick. I tried making my second method as addRview1 (String id), but then the button onclick would not work and the app would crash. Therefore I need help in sending the String id from deviceList to addReview1.

Method deviceList

JavaScript

Method addReview1

JavaScript

Advertisement

Answer

I have managed to come with an easy fix for it.

Declare String above onCreate as such

JavaScript

In method deviceList

JavaScript

In method addReview1

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement