I want to get the String from an EditText and then read individual characters from it. I've tried the following code:
String PT = pt.getText().toString();
int len = PT.length();
char chars[] = PT.toCharArray();
for(int i=0;i<len;i++)
{ Toast.makeText(encrypt.this,chars[i], 0).show(); }
However I get a Force Close error on this. Where am I going wrong?
I'm quite new to all this!
Here's the LogCat:
11-28 12:41:01.228: E/AndroidRuntime(1632): at android.app.ActivityThread.main(ActivityThread.java:3683)
11-28 12:41:01.228: E/AndroidRuntime(1632): at java.lang.reflect.Method.invokeNative(Native Method)
11-28 12:41:01.228: E/AndroidRuntime(1632): at java.lang.reflect.Method.invoke(Method.java:507)
11-28 12:41:01.228: E/AndroidRuntime(1632): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-28 12:41:01.228: E/AndroidRuntime(1632): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-28 12:41:01.228: E/AndroidRuntime(1632): at dalvik.system.NativeStart.main(Native Method)
11-28 12:46:43.688: W/KeyCharacterMap(1674): No keyboard for id 0
11-28 12:46:43.688: W/KeyCharacterMap(1674): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
11-28 12:46:54.442: W/ResourceType(1674): No package identifier when getting value for resource number 0x00000061
11-28 12:46:54.448: D/AndroidRuntime(1674): Shutting down VM
11-28 12:46:54.448: W/dalvikvm(1674): threadid=1: thread exiting with uncaught exception (group=0x40015560)
11-28 12:46:54.459: E/AndroidRuntime(1674): FATAL EXCEPTION: main
11-28 12:46:54.459: E/AndroidRuntime(1674): android.content.res.Resources$NotFoundException: String resource ID #0x61
11-28 12:46:54.459: E/AndroidRuntime(1674): at android.content.res.Resources.getText(Resources.java:201)
11-28 12:46:54.459: E/AndroidRuntime(1674): at android.widget.Toast.makeText(Toast.java:258)
11-28 12:46:54.459: E/AndroidRuntime(1674): at com.project.DENCrypt.encrypt$1.onClick(encrypt.java:33)
11-28 12:46:54.459: E/AndroidRuntime(1674): at android.view.View.performClick(View.java:2485)
11-28 12:46:54.459: E/AndroidRuntime(1674): at android.view.View$PerformClick.run(View.java:9080)
11-28 12:46:54.459: E/AndroidRuntime(1674): at android.os.Handler.handleCallback(Handler.java:587)
11-28 12:46:54.459: E/AndroidRuntime(1674): at android.os.Handler.dispatchMessage(Handler.java:92)
11-28 12:46:54.459: E/AndroidRuntime(1674): at android.os.Looper.loop(Looper.java:123)
11-28 12:46:54.459: E/AndroidRuntime(1674): at android.app.ActivityThread.main(ActivityThread.java:3683)
11-28 12:46:54.459: E/AndroidRuntime(1674): at java.lang.reflect.Method.invokeNative(Native Method)
11-28 12:46:54.459: E/AndroidRuntime(1674): at java.lang.reflect.Method.invoke(Method.java:507)
11-28 12:46:54.459: E/AndroidRuntime(1674): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-28 12:46:54.459: E/AndroidRuntime(1674): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-28 12:46:54.459: E/AndroidRuntime(1674): at dalvik.system.NativeStart.main(Native Method)
Toast.makeText(encrypt.this,String.valueOf(chars[i]), 0).show();
instead of
Toast.makeText(encrypt.this,chars[i], 0).show();
try this:
Toast.makeText(encrypt.this,chars[i] + "", 0).show();
it has the same way with Ram's
Change your toast message to
Toast.makeText(encrypt.this,Character.toString(chars[i]), Toast.LENGTH_SHORT).show();
Here the problem is with Toast message. Toast can not Display charaters. so convert charater to string and display
the chars[i] is integer value. If you look closely in your error log you will see
android.content.res.Resources$NotFoundException: String resource ID #0x61
(if you pass integer parameter, android will lookup for a resource with this Id)
you can print the character from the string directly:
Toast.makeText(encrypt.this,PT[i], 0).show();
probably the edit text (layout resource)is not available when reading the data from it. Just check whether you are able to get no null value when you do
EditText edt1 = (EditText)findViewById(R.id.myEditView);
log edt1(either through log, system.out.println);
Related
This is the first time I have this problem and I absolutely don't know what to do.
I used to test my app on both virtual devices and on my phone and tablet. I tested it very often, like every 1-2h.
And at one point, it just stopped working on every android devices, but it still works on desktop.
On the android devices, it crashes as soon as I start the app, and I obtain this message :
"Unfortunately, MyApp has stopped."
And in the logcat, the stack trace shows a "FATAL EXCEPTION: main", I really need help to understand what is happening, and how to deal with this situation.
Thank you very much.
11-28 21:10:37.517: D/dalvikvm(613): Trying to load lib /data/data/com.premier.jeu.android/lib/libgdx.so 0x411998b0
11-28 21:10:37.527: D/dalvikvm(613): Added shared lib /data/data/com.premier.jeu.android/lib/libgdx.so 0x411998b0
11-28 21:10:37.527: D/dalvikvm(613): No JNI_OnLoad found in /data/data/com.premier.jeu.android/lib/libgdx.so 0x411998b0, skipping init
11-28 21:10:37.617: D/libEGL(613): Emulator without GPU support detected. Fallback to software renderer.
11-28 21:10:37.627: D/libEGL(613): loaded /system/lib/egl/libGLES_android.so
11-28 21:10:37.646: D/AndroidRuntime(613): Shutting down VM
11-28 21:10:37.646: W/dalvikvm(613): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
11-28 21:10:37.656: E/AndroidRuntime(613): FATAL EXCEPTION: main
11-28 21:10:37.656: E/AndroidRuntime(613): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.premier.jeu.android/com.premier.jeu.android.AndroidLauncher}: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0
11-28 21:10:37.656: E/AndroidRuntime(613): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.app.ActivityThread.access$600(ActivityThread.java:130)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.os.Handler.dispatchMessage(Handler.java:99)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.os.Looper.loop(Looper.java:137)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-28 21:10:37.656: E/AndroidRuntime(613): at java.lang.reflect.Method.invokeNative(Native Method)
11-28 21:10:37.656: E/AndroidRuntime(613): at java.lang.reflect.Method.invoke(Method.java:511)
11-28 21:10:37.656: E/AndroidRuntime(613): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-28 21:10:37.656: E/AndroidRuntime(613): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-28 21:10:37.656: E/AndroidRuntime(613): at dalvik.system.NativeStart.main(Native Method)
11-28 21:10:37.656: E/AndroidRuntime(613): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0
11-28 21:10:37.656: E/AndroidRuntime(613): at com.badlogic.gdx.backends.android.AndroidGraphics.createGLSurfaceView(AndroidGraphics.java:122)
11-28 21:10:37.656: E/AndroidRuntime(613): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(AndroidGraphics.java:102)
11-28 21:10:37.656: E/AndroidRuntime(613): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(AndroidGraphics.java:95)
11-28 21:10:37.656: E/AndroidRuntime(613): at com.badlogic.gdx.backends.android.AndroidApplication.init(AndroidApplication.java:133)
11-28 21:10:37.656: E/AndroidRuntime(613): at com.badlogic.gdx.backends.android.AndroidApplication.initialize(AndroidApplication.java:99)
11-28 21:10:37.656: E/AndroidRuntime(613): at com.premier.jeu.android.AndroidLauncher.onCreate(AndroidLauncher.java:16)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.app.Activity.performCreate(Activity.java:5008)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
11-28 21:10:37.656: E/AndroidRuntime(613): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
11-28 21:10:37.656: E/AndroidRuntime(613): ... 11 more
11-28 21:10:39.476: I/Process(613): Sending signal. PID: 613 SIG: 9
Hello I found this exception when I run my application on Android kitkat 4.4
11-28 08:50:00.752: E/dalvikvm(10056): dlopen("/data/app-lib/com.vis.kotob-2/libdatabase_sqlcipher.so")
failed: dlopen failed: cannot locate symbol "_ZN7android10MemoryBaseC1ERKNS_2spINS_11IMemoryHeapEEElj"
referenced by "libdatabase_sqlcipher.so"...
11-28 08:50:00.762: E/AndroidRuntime(10056): FATAL EXCEPTION: main
11-28 08:50:00.762: E/AndroidRuntime(10056): Process: com.his.mojak, PID: 10056
11-28 08:50:00.762: E/AndroidRuntime(10056): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN7android10MemoryBaseC1ERKNS_2spINS_11IMemoryHeapEEElj" referenced by "libdatabase_sqlcipher.so"...
11-28 08:50:00.762: E/AndroidRuntime(10056): at java.lang.Runtime.loadLibrary(Runtime.java:364)
11-28 08:50:00.762: E/AndroidRuntime(10056): at java.lang.System.loadLibrary(System.java:526)
11-28 08:50:00.762: E/AndroidRuntime(10056): at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:143)
11-28 08:50:00.762: E/AndroidRuntime(10056): at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:136)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.his.mojak.model.db.DBManager.<init>(DBManager.java:24)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.his.mojak.model.db.DBManager.getInstance(DBManager.java:15)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.his.mojak.model.dao.db.DbAbstractDao.<init>(DbAbstractDao.java:13)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.his.mojak.model.dao.db.UserDataDao.<init>(UserDataDao.java:10)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.his.mojak.model.dao.db.UserDataDao.getInstance(UserDataDao.java:19)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.his.mojak.ui.activity.splash.SplashController.sessionExpired(SplashController.java:157)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.his.mojak.ui.activity.splash.SplashActivity.onSplashFinished(SplashActivity.java:55)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.his.mojak.ui.activity.splash.SplashController$1.handleMessage(SplashController.java:72)
11-28 08:50:00.762: E/AndroidRuntime(10056): at android.os.Handler.dispatchMessage(Handler.java:102)
11-28 08:50:00.762: E/AndroidRuntime(10056): at android.os.Looper.loop(Looper.java:137)
11-28 08:50:00.762: E/AndroidRuntime(10056): at android.app.ActivityThread.main(ActivityThread.java:4998)
11-28 08:50:00.762: E/AndroidRuntime(10056): at java.lang.reflect.Method.invokeNative(Native Method)
11-28 08:50:00.762: E/AndroidRuntime(10056): at java.lang.reflect.Method.invoke(Method.java:515)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
11-28 08:50:00.762: E/AndroidRuntime(10056): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
11-28 08:50:00.762: E/AndroidRuntime(10056): at dalvik.system.NativeStart.main(Native Method)
What's your sqlcipher version?
There is an issue with older(v2.2.0) versions for KitKat: https://github.com/sqlcipher/android-database-sqlcipher/issues/107
Get the latest release of the binaries (e.g. http://sqlcipher.net/downloads or directly here) or compile the latest source, and you should be fine!
I have a working project in Eclipse. Very often when I try Eclipse' Run command, I see some errors in logcat. Apparently the APK does not get installed or something. Eclipse/ADB tries again and second time around it always works as expected. This error does not seem to have any operational impact, but still I'm curious as to why it's happening.
Eclipse: Version: 3.7.2, Build id: M20120208-0800
Android SDK: 4.0
Target: Samsung Tab, Samsung S2, Emulator
Here is the logcat.
11-28 17:08:59.097: E/AndroidRuntime(14086): FATAL EXCEPTION: main
11-28 17:08:59.097: E/AndroidRuntime(14086): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4198)
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.app.ActivityThread.access$1300(ActivityThread.java:140)
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1288)
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.os.Handler.dispatchMessage(Handler.java:99)
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.os.Looper.loop(Looper.java:137)
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.app.ActivityThread.main(ActivityThread.java:4895)
11-28 17:08:59.097: E/AndroidRuntime(14086): at java.lang.reflect.Method.invokeNative(Native Method)
11-28 17:08:59.097: E/AndroidRuntime(14086): at java.lang.reflect.Method.invoke(Method.java:511)
11-28 17:08:59.097: E/AndroidRuntime(14086): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
11-28 17:08:59.097: E/AndroidRuntime(14086): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
11-28 17:08:59.097: E/AndroidRuntime(14086): at dalvik.system.NativeStart.main(Native Method)
11-28 17:08:59.097: E/AndroidRuntime(14086): Caused by: java.lang.NullPointerException
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:377)
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.app.LoadedApk.getClassLoader(LoadedApk.java:320)
11-28 17:08:59.097: E/AndroidRuntime(14086): at android.app.LoadedApk.makeApplication(LoadedApk.java:493)
11-28 17:08:59.097: E/AndroidRuntime(14086): ... 11 more
11-28 17:09:07.815: D/dalvikvm(14166): GC_FOR_ALLOC freed 54K, 9% free 7431K/8131K, paused 30ms, total 30ms
11-28 17:09:07.815: I/dalvikvm-heap(14166): Grow heap (frag case) to 9.173MB for 1463056-byte allocation
11-28 17:09:07.839: D/dalvikvm(14166): GC_CONCURRENT freed <1K, 8% free 8859K/9607K, paused 2ms+2ms, total 20ms
11-28 17:09:07.995: D/MainActivity(14166): onCreate()
I've made my Android app tablet optimized and I followed the tutorial here:
Everything is great, but I am trying to select an item (say, the 1st item) with a button in the ActionBar.
I tried this answer to use performItemClick but on I've got error reports of java.lang.IllegalStateException
in android.support.v4.app.ListFragment.ensureList, java.lang.IllegalStateException: Content view not yet created, and java.lang.NullPointerException
in android.content.ComponentName.<init>
I've tried checking if the ListView is null and still get the error reports on the Play Store. How do I properly select an item in my list programmatically?
Update to add logcat and the code is virtually identical to the tutorials in the links:
Logcat A:
java.lang.IllegalStateException: Content view not yet created
at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
at android.support.v4.app.ListFragment.getListView(ListFragment.java:222)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:69)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1280)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2606)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1045)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:592)
at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:149)
at android.view.View.performClick(View.java:4222)
at android.view.View$PerformClick.run(View.java:17273)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Logcat B:
java.lang.NullPointerException
at android.content.ComponentName.<init>(ComponentName.java:75)
at android.content.Intent.<init>(Intent.java:2874)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:86)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:284)
at android.widget.ListView.performItemClick(ListView.java:3701)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2205)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:779)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:861)
at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)
at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
at android.view.View$PerformClick.run(View.java:9152)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Update 2
And here is the code that is causing the problem:
if (mListFragment.listView != null) {
mListFragment.listView.performItemClick(mListFragment.listView.getAdapter().getView(position, null, null), position, mListFragment.listView.getAdapter().getItemId(position));
}
I use XOM to create XML on android, it's worked, but when I have tried to parse some xml with XOM's Builder I have an error:
11-28 22:00:11.290: I/dalvikvm(26548): Could not find method org.apache.xerces.impl.Version.getVersion, referenced from method nu.xom.Builder.<clinit>
11-28 22:00:11.290: W/dalvikvm(26548): VFY: unable to resolve static method 5819: Lorg/apache/xerces/impl/Version;.getVersion ()Ljava/lang/String;
11-28 22:00:11.290: D/dalvikvm(26548): VFY: replacing opcode 0x71 at 0x000f
11-28 22:00:11.295: W/dalvikvm(26548): Unable to resolve superclass of Lnu/xom/XML1_0Parser; (921)
11-28 22:00:11.295: W/dalvikvm(26548): Link of class 'Lnu/xom/XML1_0Parser;' failed
11-28 22:00:11.295: E/dalvikvm(26548): Could not find class 'nu.xom.XML1_0Parser', referenced from method nu.xom.Builder.findParser
11-28 22:00:11.295: W/dalvikvm(26548): VFY: unable to resolve new-instance 699 (Lnu/xom/XML1_0Parser;) in Lnu/xom/Builder;
11-28 22:00:11.295: D/dalvikvm(26548): VFY: replacing opcode 0x22 at 0x0000
11-28 22:00:11.300: W/dalvikvm(26548): Unable to resolve superclass of Lnu/xom/XML1_0Parser; (921)
11-28 22:00:11.300: W/dalvikvm(26548): Link of class 'Lnu/xom/XML1_0Parser;' failed
11-28 22:00:11.300: D/dalvikvm(26548): DexOpt: unable to opt direct call 0x1160 at 0x02 in Lnu/xom/Builder;.findParser
11-28 22:00:11.300: W/dalvikvm(26548): Unable to resolve superclass of Lnu/xom/JDK15XML1_0Parser; (461)
11-28 22:00:11.300: W/dalvikvm(26548): Link of class 'Lnu/xom/JDK15XML1_0Parser;' failed
11-28 22:00:11.325: D/dalvikvm(26548): GC_CONCURRENT freed 377K, 4% free 11719K/12167K, paused 2ms+4ms
11-28 22:00:11.325: W/System.err(26548): nu.xom.XMLException: Could not find a suitable SAX2 parser
11-28 22:00:11.325: W/System.err(26548): at nu.xom.Builder.findParser(Unknown Source)
11-28 22:00:11.325: W/System.err(26548): at nu.xom.Builder.<init>(Unknown Source)
11-28 22:00:11.325: W/System.err(26548): at nu.xom.Builder.<init>(Unknown Source)
11-28 22:00:11.325: W/System.err(26548): at com.rkovalev.first.app.MainActivity$UpdateTask.onProgressUpdate(MainActivity.java:294)
11-28 22:00:11.325: W/System.err(26548): at com.rkovalev.first.app.MainActivity$UpdateTask.onProgressUpdate(MainActivity.java:1)
11-28 22:00:11.325: W/System.err(26548): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:618)
11-28 22:00:11.325: W/System.err(26548): at android.os.Handler.dispatchMessage(Handler.java:99)
11-28 22:00:11.325: W/System.err(26548): at android.os.Looper.loop(Looper.java:137)
11-28 22:00:11.325: W/System.err(26548): at android.app.ActivityThread.main(ActivityThread.java:4511)
11-28 22:00:11.325: W/System.err(26548): at java.lang.reflect.Method.invokeNative(Native Method)
11-28 22:00:11.325: W/System.err(26548): at java.lang.reflect.Method.invoke(Method.java:511)
11-28 22:00:11.325: W/System.err(26548): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
11-28 22:00:11.325: W/System.err(26548): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
11-28 22:00:11.325: W/System.err(26548): at dalvik.system.NativeStart.main(Native Method)
11-28 22:00:11.325: W/System.err(26548): Caused by: org.xml.sax.SAXException: Can't create default XMLReader; is system property org.xml.sax.driver set?
11-28 22:00:11.325: W/System.err(26548): at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:156)
11-28 22:00:11.325: W/System.err(26548): ... 14 more
Using code to experiment:
Builder parser = new Builder();
nu.xom.Document doc = parser.build("<greeting>Hello World!</greeting>", "http://www.example.org/");
So, I could not found a driver property in org.xml.sax namespace.
This line of error log is related
11-28 22:00:11.325: W/System.err(26548): Caused by: org.xml.sax.SAXException: Can't create default XMLReader; is system property org.xml.sax.driver set?
This answer to this is here
porting to Android: why am I getting "Can't create default XMLReader; is system property org.xml.sax.driver set?"?