| No textview On My widget The problem is solved, By the way |
Setxxx function usage. I tried it out in the afternoon.
For example, the above setcharsequence (INT viewid, string methodname, charsequence value );
Views. setstring (R. Id. textview01, "settext", battery + "% ");
Views is an instance of romoteviews, and the first parameter is ID,
The key is the second parameter, which is a method name. For example, textview has many methods, such as setbackground (), settext (), and settextcolor, the second parameter is used to fill in the function name, without parentheses,
The third parameter is the parameter used by the second function. For example, if it is settextcolor (INT), the third parameter is included with int (of course, if it is set to this parameter, you must use views. setint (...) this function). I have not tried several parameters yet... but most of them are a parameter ..
For example, if you want to change the clickable status of a button, you can write
Views. setboolean (R. Id. button01, "setclickable", false );
It should be noted that because the second parameter is a string, no compilation error is returned even if there is no such method, but a warning is generated during the running, and the program cannot run normally.