Browsing 7239 questions and answers with Jon Skeet
Your question is unclear, but I suspect this may be the problem - it's at least a problem: xmlOutput.output(document, new FileWriter(path)); FileWriter always uses the platform default encoding, whereas your XML document claims to be in... more 11/25/2013 8:05:56 AM
I use java 1.7.25 No, you don't - not if you're running on Android. You need to look at the Android documentation, not the Java 7 docs. If you look at the Android SimpleDateFormat documentation you'll see that u isn't listed there. I... more 11/24/2013 5:12:13 PM
Usually, IllegalStateException is used to indicate that "a method has been invoked at an illegal or inappropriate time." However, this doesn't look like a particularly typical use of it. The code you've linked to shows that it can be... more 11/23/2013 11:24:47 PM
It sounds like your array length isn't actually 1024. I know you've shown code creating it with 1024 bytes, but I suspect your actual code either changes the value somewhere else, or that it's created in a different way. It would be... more 11/23/2013 1:16:09 PM
Whether it contains one or two character. It contains one Unicode character, which is comprised of 2 UTF-16 code units. Every char in Java is a UTF-16 code unit... it may not be a whole character. Each character has a single code... more 11/23/2013 12:33:18 PM
Book isn't an attribute - it's an element (a tag). You should use: if (x.getName().equals("Book")) to check whether you're on the Book element. However, that won't really help you much, as you're actually after the bookName, bookSection... more 11/23/2013 8:58:36 AM
You haven't really described the problem, but I suspect this is the cause: VehicleFactory vehicleObject = new VehicleFactory(); vehicleObject.getSummary(); vehicleObject.HayloFactory(firstname, lastname, phone, nbrVehicles,... more 11/23/2013 8:17:07 AM
The problem is the way in which you're calling the extension method. You just need to use this instead of base. Calling extension methods on this is relatively unusual, but does need the this explicitly... and it can't be base, which... more 11/22/2013 3:10:34 PM
I'm not aware of the ability to specify optional parts like that in a custom format string. I suggest you use multiple format strings, and use the overload of TimeSpan.ParseExact that takes an array of formats. string[] formats = {... more 11/21/2013 2:37:40 PM
There are two problems here, as far as I can tell: You don't have a response property to deserialize The "token:123 id:191" part is actually just a string - the value of the outer token property So if you change your code to: var def... more 11/21/2013 2:29:15 PM