On
August 28, 2016 1:52:54 AM John Doe <playappa...@gmail.com>
wrote:
> Just to clear, I'm doing in the task:
> myobj = new String(%SMSRN);
I've run into this before. In a java function, literal strings should be
enclosed in quotes. Try this:
myobj = new String("%SMSRN");
This isn't a bug. It is more a case of mistaken identify. Unlike Tasker variables, which use %, Java objects have no special identifying marker. In Java, bobby is a perfectly legal object name, whereas "bobby" is a string.
Well, Pent would be the one to ask about the internal workings.
I do know that I have run into this situation several times when using Java functions. The problem has always been caused by my forgetting to enclose something in quotes.
>in addition even if it's a global object, you can't destroy it using the delete function.
This is strange. I've always been able to remove these dummy objects using the Java delete function.
I'm sorry but I don't understand. I think that what happens is:
1) Tasker replace the variable contents before to call String constructor, converting to something like "This is my test"
2) The constructor of String is called with a string that contains "This is my test"
If there isn't replace the string object contains instead %Thisismyvar but it contains the correct value, so the replace works. But when Tasker convert %SMSRN to a temporary string to pass it to the string constructor, it turns the variable in a global Java object. This is wrong
because the object must be local, in addition even if it's a global object, you can't destroy it using the delete function. So the fact that you have not removable entry means that there is something wrong somewhere IMHO.
In my case I would see a string object named 12345. Have you tried to create an SMS profile connected with a task that perform myobj = new String(%SMSRN)?