-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doWork returning always undefined instead of the string. #82
Comments
Where are you getting undefined? I assume in the JavaScript - can I see that code as well I suspect you are hitting your exception - so while the result is being set to an instance of JObject, there is nothing being put into msg. Try changing to:
|
@Red-Folder : YES you are correct (in Javascript getting undefined), its the exception from Java. |
It looks like cant send Following code still showing "undefined" (expected to return "Step1" in my Javascript) which means its dead in the Is there anyway to see the Exception in my
|
The build error is because it needs any JSONObject to be wrapped in try/ catch block I'd suggest that within your first try/ catch you just set msg After that try/ catch - add a second try catch that does the result.put Also, in both exceptions log out that the exception occurred |
Tried as below, which still gives
|
Are you able to provide the JavaScript? |
myService.html is as below:
|
Which line is throwing the undefined? |
This one
|
Add this to your java file (if not already there):
|
Well I'm confused. Have you tried adding addition Log.d messages in the java and then looking at logcat? See if it is stepping through that doWork() as expected |
Very confusing. I did not check the logcat, but i will look further. I think when the Exception is happening we will not get return, the reason is Java do not continue after any exception which might be the reason. Because when i do not use the ALARM, NOTIFY, Ring statements then it works. Which means in |
Is this normal? doWork is always returning "undefined" when i have code as following:
The text was updated successfully, but these errors were encountered: