开发者

String was passed as argument, but in the function it turned out to be a Rec

开发者 https://www.devze.com 2023-02-09 06:08 出处:网络
I was developing an android app using java language. The body of the method was below: a string \"3\" was passed to it as first argument--nextCmdId, but in the method it turned out to be a Rect, and

String was passed as argument, but in the function it turned out to be a Rec

I was developing an android app using java language. The body of the method was below: a string "3" was passed to it as first argument--nextCmdId, but in the method it turned out to be a Rect, and the application crashed. Quite odd!! thanks BR shawn

public String formatSyncTagP开发者_Python百科reamble(String nextCmdId,
                                    String sourceName,
                                    String sourceUri)
{

    StringBuffer syncTag = new StringBuffer();

    syncTag.append("<CmdID>").append(nextCmdId)
           .append("</CmdID>\n")
           .append("<Target><LocURI>")
           .append(sourceUri)
           .append("</LocURI></Target>\n")
           .append("<Source><LocURI>")
           .append(sourceName)
           .append("</LocURI></Source>\n");

    return syncTag.toString();
}

String was passed as argument, but in the function it turned out to be a Rec


I notice that Eclipse knows this as a .class file. Did you attach the correct source for SyncMLFormatter? (I agree with @Bozho...a String cannot change into a Rect in Java.)

0

精彩评论

暂无评论...
验证码 换一张
取 消