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
how to output the ArrayList and HashMap #34
Comments
can you show how do you use Logger? It seems that it is not used correctly. Logger only accepts String for the message. |
@orhanobut ok, |
second parameter is the argument and I assume that videoAndriodURL or videoIphoneURL has something "%20". That's why probably you get a crash because String.formatter cannot resolve 20. |
@orhanobut Very thank you for your answer,Yes, because I defined object inside a ImageUrl, he is the image resources links, there may be some special characters you said, is there any way to solve this problem? |
you need to escape the % character by using double "%%" |
@orhanobut Ok, thank you very much |
I have replaced all println's in my code with the logger, and now get lots of these UnknownFormatConversionExceptions. It seems that default System.out didn't have any issues printing my objects. |
Also, default |
Excuse me, would you please tell me how to use this package, how to output the ArrayList and HashMap,
7683-7683/com.guoyoujin.gz.gz E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.util.UnknownFormatConversionException: Conversion: '
at java.util.Formatter$FormatToken.unknownFormatConversionException(Formatter.java:1397)
at java.util.Formatter$FormatToken.checkFlags(Formatter.java:1334)
at java.util.Formatter.transform(Formatter.java:1440)
at java.util.Formatter.doFormat(Formatter.java:1079)
at java.util.Formatter.format(Formatter.java:1040)
at java.util.Formatter.format(Formatter.java:1009)
at java.lang.String.format(String.java:1992)
at java.lang.String.format(String.java:1966)
at com.orhanobut.logger.LoggerPrinter.createMessage(LoggerPrinter.java:346)
at com.orhanobut.logger.LoggerPrinter.log(LoggerPrinter.java:211)
at com.orhanobut.logger.LoggerPrinter.i(LoggerPrinter.java:138)
at com.orhanobut.logger.Logger.i(Logger.java:61)
at com.guoyoujin.gz.gz.fragment.tabfragment.Fragment1$GetNewsDataThread$1.run(Fragment1.java:129)
at android.os.Handler.handleCallback(Handler.java:800)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5463)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:854)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:621)
at dalvik.system.NativeStart.main(Native Method)
private ArrayList list;
public class NewsVo {
private String newsId;
private String title;
private String content;
private String videoAndriodURL;
private String videoIphoneURL;
private NewsImageVo image;
private String date;
}
The text was updated successfully, but these errors were encountered: