中括弧split()
の使用に問題があります
String[] values = str_bj.split("{");
文字列をで分割する必要があり{
ますが、実行時にエラーがスローされます......。
エラー::
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): FATAL EXCEPTION: main
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.obj/com.obj.ObjectDemoActivity}: java.util.regex.PatternSyntaxException: Syntax error U_REGEX_BAD_INTERVAL near index 2:
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): /{
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): ^
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.os.Handler.dispatchMessage(Handler.java:99)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.os.Looper.loop(Looper.java:123)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at java.lang.reflect.Method.invokeNative(Native Method)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at java.lang.reflect.Method.invoke(Method.java:521)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at dalvik.system.NativeStart.main(Native Method)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): Caused by: java.util.regex.PatternSyntaxException: Syntax error U_REGEX_BAD_INTERVAL near index 2:
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): /{
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): ^
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at com.ibm.icu4jni.regex.NativeRegEx.open(Native Method)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at java.util.regex.Pattern.compileImpl(Pattern.java:383)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at java.util.regex.Pattern.<init>(Pattern.java:341)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at java.util.regex.Pattern.compile(Pattern.java:358)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at java.lang.String.split(String.java:2044)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at com.obj.ObjectDemoActivity.onCreate(ObjectDemoActivity.java:21)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-23 16:01:30.232: ERROR/AndroidRuntime(6802): ... 11 more
他のキャラクターでも問題なく動作するようですが、そうではありません{