Author: ulhume
Date: 2008-08-31 04:34:33 +0200 (Sun, 31 Aug 2008)
New Revision: 1664

Modified:
   
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadget.java
Log:
Force string parameter for notifications

Modified: 
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadget.java
===================================================================
--- 
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadget.java
       2008-08-31 02:34:13 UTC (rev 1663)
+++ 
software_suite_v2/software/tools/tuxdroid-gadget-java-kit/trunk/tuxdroid-gadget-java-kit/sources/com/kysoh/tuxdroid/gadget/framework/gadget/SimpleGadget.java
       2008-08-31 02:34:33 UTC (rev 1664)
@@ -68,12 +68,12 @@
         * @param arguments
         *            Notification arguments
         */
-       protected void throwNotification(String notificationId, Object... 
arguments) {
+       protected void throwNotification(String notificationId, String... 
arguments) {
                StringBuffer buffer = new StringBuffer();
                buffer.append(notificationId);
-               for (Object argument : arguments) {
+               for (String argument : arguments) {
                        buffer.append(" '");
-                       buffer.append(String.valueOf(argument).replace("'", 
"\\'"));
+                       buffer.append(argument.replace("'", "\\'"));
                        buffer.append("'");
                }
                System.out.println(buffer.toString());
@@ -134,9 +134,12 @@
         *            message content
         */
        public void throwMessage(String content, Object... arguments) {
-               Object[] tmp = new Object[arguments.length + 1];
+
+               String[] tmp = new String[arguments.length + 1];
                tmp[0] = content;
-               System.arraycopy(arguments, 0, tmp, 1, arguments.length);
+               for (int i = 0; i < arguments.length; i++) {
+                       tmp[i + 1] = String.valueOf(arguments[i]);
+               }
                throwNotification("message", tmp);
        }
 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to