MonkeyRunner causing Android Settings to Crash - android

I've been trying to turn on an Accessibility Service using Android's. I run an emulator using Android Studio (Nexus S API 19, armabi-v7). I'm able to open the accessibility settings when the emulator is running. (By clicking on the circled submenu)
Setting Screen with Accessibility Sub-Menu highlighted
Yet when I run try to attach monkeyrunner by opening an interactive monkeyrunner terminal and running:
>> from android.com.monkeyrunner import MonkeyRunner, MonkeyDevice
>> d = MonkeyRunner.waitForConnection()
I'm unable to get navigate to the accessibility settings screen and get the error message
Result of selecting accessibility sub-menu from settings when MonkeyDevice is attached
as soon as I detach the monkeyDevice, I'm able to get to the accessibility settings screen again. Any idea what could cause it?
snippet from the logs when there's an error:
##Logs from Failure ## I/ActivityManager( 357): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings} from pid 519 ... I/ActivityManager( 357): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)} from pid 751
...
D/SubSettings( 751): Launching fragment com.android.settings.accessibility.AccessibilitySettings ... E/AndroidRuntime( 751): FATAL EXCEPTION: main
E/AndroidRuntime( 751): Process: com.android.settings, PID: 751
E/AndroidRuntime( 751): java.lang.RuntimeException: Unable to resume activity {com.android.settings/com.android.settings.SubSettings}: java.lang.NullPointerException
E/AndroidRuntime( 751): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2774)
E/AndroidRuntime( 751): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2803)
E/AndroidRuntime( 751): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2238)
E/AndroidRuntime( 751): at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 751): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 751): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 751): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 751): at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime( 751): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 751): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 751): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime( 751): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime( 751): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 751): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 751): at com.android.settings.accessibility.AccessibilitySettings.loadInstalledServices(AccessibilitySettings.java:641)
E/AndroidRuntime( 751): at com.android.settings.accessibility.AccessibilitySettings.onResume(AccessibilitySettings.java:214)
E/AndroidRuntime( 751): at android.app.Fragment.performResume(Fragment.java:1743)
E/AndroidRuntime( 751): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:924)
E/AndroidRuntime( 751): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
E/AndroidRuntime( 751): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1044)
E/AndroidRuntime( 751): at android.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1863)
E/AndroidRuntime( 751): at android.app.Activity.performResume(Activity.java:5320)
E/AndroidRuntime( 751): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2764)
E/AndroidRuntime( 751): ... 12 more
W/ActivityManager( 357): Force finishing activity com.android.settings/.SubSettings
W/ActivityManager( 357): Force finishing activity com.android.settings/.Settings ... W/ActivityManager( 357): Activity pause timeout for ActivityRecord{b3ea9e08 u0 com.android.settings/.SubSettings t2 f}
There seems to be a NullPointer exception, but I don't know what could cause that
##Log Snippet Without Failure I/ActivityManager( 357): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.settings/.Settings} from pid 519
I/ActivityManager( 357): Start proc com.android.settings for activity com.android.settings/.Settings: pid=1095 uid=1000 gids={41000, 1028, 1015, 3002, 3001, 3003}
D/dalvikvm( 59): GC_EXPLICIT freed 40K, 5% free 2777K/2900K, paused 15ms+3ms, total 96ms
D/dalvikvm( 59): GC_EXPLICIT freed <1K, 5% free 2777K/2900K, paused 3ms+14ms, total 67ms
D/dalvikvm( 59): GC_EXPLICIT freed <1K, 5% free 2777K/2900K, paused 7ms+14ms, total 76ms
D/dalvikvm( 1095): GC_FOR_ALLOC freed 118K, 7% free 2987K/3188K, paused 35ms, total 37ms
I/dalvikvm-heap( 1095): Grow heap (frag case) to 3.602MB for 635812-byte allocation
D/dalvikvm( 1095): GC_FOR_ALLOC freed 3K, 6% free 3605K/3812K, paused 44ms, total 44ms
D/dalvikvm( 1095): GC_CONCURRENT freed <1K, 6% free 3605K/3812K, paused 4ms+2ms, total 53ms
E/BluetoothAdapter( 1095): Bluetooth binder is null
D/dalvikvm( 1095): GC_CONCURRENT freed 209K, 8% free 3793K/4088K, paused 2ms+16ms, total 65ms
D/ ( 1095): HostConnection::get() New Host Connection established 0xb82ef4c0, tid 1095
W/EGL_emulation( 1095): eglSurfaceAttrib not implemented
D/OpenGLRenderer( 1095): Enabling debug mode 0
I/ActivityManager( 357): Displayed com.android.settings/.Settings:
+2s599ms
D/dalvikvm( 1095): GC_CONCURRENT freed 124K, 5% free 4057K/4268K, paused 15ms+5ms, total 101ms
I/ActivityManager( 357): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)} from pid 1095
D/SubSettings( 1095): Launching fragment com.android.settings.accessibility.AccessibilitySettings
W/EGL_emulation( 1095): eglSurfaceAttrib not implemented
D/dalvikvm( 1095): GC_CONCURRENT freed 223K, 7% free 4267K/4576K, paused 20ms+65ms, total 345ms
I/Choreographer( 1095): Skipped 120 frames! The application may be doing too much work on its main thread.
I/ActivityManager( 357): Displayed com.android.settings/.SubSettings:
+3s235ms

Related

Android - Intent makes my app crash

I am creating an app on Android, which involves an Activity and a service. One of the components of the service is meant to send a signal to the MainActivity, which will execute some specific code. The problem is, trying to send the intent makes the app crash.
Here is the code that sends the intent. Note that it resides in the inside of a doInBackground function of an AsyncTask object, which resides inside the said service:
#Override
protected String doInBackground(Socket... client) {
Intent received = new Intent();
received.setAction("com.mycompany.Messenger.MESSAGE_RECEIVED");
sendBroadcast(received);
}
Note that if I comment out sendBroadcast(received), the app does not crash.
Here is the handler of the Intent inside MainActivity (which has the name ChatBubbleActivity in my app):
public class MessageReceiver extends BroadcastReceiver {
#Override
public void onReceive(Context context, Intent intent) {
if(intent.getAction().equals(MESSAGE_RECEIVED)) {
String current_message = "Intent works!";
TextView textView = (TextView) findViewById(R.id.myText);
textView.setText(current_message);
}
}
}
And this is the declaration of the Receiver in manifest:
<receiver android:name=".ChatBubbleActivity$MessageReceiver">
<intent-filter>
<action android:name="com.mycompany.Messenger.MESSAGE_RECEIVED"/>
</intent-filter>
</receiver>
, inside the <activity> chunk.
What is it that I might be missing?
EDIT:New version of code based on answers, still crashing.
EDIT logcat:
02-04 16:17:32.444 487-489/? D/dalvikvm﹕ GC_CONCURRENT freed 1662K, 22% free 6885K/8728K, paused 2ms+2ms, total 42ms
02-04 16:17:32.876 1275-1275/? D/AndroidRuntime﹕ >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
02-04 16:17:32.912 1275-1275/? D/AndroidRuntime﹕ CheckJNI is OFF
02-04 16:17:32.960 1275-1275/? D/dalvikvm﹕ Trying to load lib libjavacore.so 0x0
02-04 16:17:32.964 1275-1275/? D/dalvikvm﹕ Added shared lib libjavacore.so 0x0
02-04 16:17:32.968 1275-1275/? D/dalvikvm﹕ Trying to load lib libnativehelper.so 0x0
02-04 16:17:32.972 1275-1275/? D/dalvikvm﹕ Added shared lib libnativehelper.so 0x0
02-04 16:17:32.972 1275-1275/? D/dalvikvm﹕ No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
02-04 16:17:33.020 1275-1275/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
02-04 16:17:33.128 1275-1275/? E/memtrack﹕ Couldn't load memtrack module (No such file or directory)
02-04 16:17:33.132 1275-1275/? E/android.os.Debug﹕ failed to load memtrack module: -2
02-04 16:17:33.264 1275-1275/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
02-04 16:17:33.284 487-617/? I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.mycompany.messenger/com.mycompany.Messenger.ChatBubbleActivity} from pid 1275
02-04 16:17:33.692 1275-1275/? D/AndroidRuntime﹕ Shutting down VM
02-04 16:17:33.692 1275-1279/? D/dalvikvm﹕ GC_CONCURRENT freed 95K, 15% free 576K/676K, paused 1ms+0ms, total 1ms
02-04 16:17:33.884 487-538/? I/ActivityManager﹕ Start proc com.mycompany.messenger for activity com.mycompany.messenger/com.mycompany.Messenger.ChatBubbleActivity: pid=1286 uid=10059 gids={50059, 3003}
02-04 16:17:33.932 1286-1286/? D/dalvikvm﹕ Late-enabling CheckJNI
02-04 16:17:34.228 1286-1286/? D/dalvikvm﹕ GC_FOR_ALLOC freed 60K, 4% free 2873K/2992K, paused 6ms, total 7ms
02-04 16:17:34.236 1286-1286/? I/dalvikvm-heap﹕ Grow heap (frag case) to 3.338MB for 500412-byte allocation
02-04 16:17:34.248 1286-1295/? D/dalvikvm﹕ GC_FOR_ALLOC freed <1K, 4% free 3362K/3484K, paused 11ms, total 11ms
02-04 16:17:34.252 1286-1290/? D/dalvikvm﹕ GC_CONCURRENT freed 0K, 4% free 3362K/3484K, paused 1ms+0ms, total 5ms
02-04 16:17:34.696 1286-1286/? D/libEGL﹕ loaded /system/lib/egl/libEGL_genymotion.so
02-04 16:17:34.708 1286-1286/? D/﹕ HostConnection::get() New Host Connection established 0xb7944cb0, tid 1286
02-04 16:17:34.744 1286-1286/? D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_genymotion.so
02-04 16:17:34.744 1286-1286/? D/libEGL﹕ loaded /system/lib/egl/libGLESv2_genymotion.so
02-04 16:17:34.816 1286-1286/? W/EGL_genymotion﹕ eglSurfaceAttrib not implemented
02-04 16:17:34.820 1286-1286/? E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache
02-04 16:17:34.824 1286-1286/? E/OpenGLRenderer﹕ MAX_TEXTURE_SIZE: 8192
02-04 16:17:34.848 1286-1286/? E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
02-04 16:17:34.848 1286-1286/? E/OpenGLRenderer﹕ MAX_TEXTURE_SIZE: 8192
02-04 16:17:34.852 1286-1286/? D/OpenGLRenderer﹕ Enabling debug mode 0
02-04 16:17:34.932 1286-1300/? W/dalvikvm﹕ threadid=12: thread exiting with uncaught exception (group=0xa4d31b20)
02-04 16:17:34.932 1286-1300/? E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #2
Process: com.mycompany.messenger, PID: 1286
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:1050)
at android.app.ContextImpl.startActivity(ContextImpl.java:1037)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:311)
at com.mycompany.Messenger.LocalService$DownloadWebpageTask2.doInBackground(LocalService.java:118)
at com.mycompany.Messenger.LocalService$DownloadWebpageTask2.doInBackground(LocalService.java:113)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:841)
02-04 16:17:34.936 487-617/? W/ActivityManager﹕ Force finishing activity com.mycompany.messenger/com.mycompany.Messenger.ChatBubbleActivity
02-04 16:17:35.180 487-840/? W/InputMethodManagerService﹕ Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy#529ef2ac (uid=10059 pid=1286)
02-04 16:17:35.288 487-617/? I/WindowManager﹕ Screenshot max retries 4 of Token{52998cec ActivityRecord{5294f214 u0 com.mycompany.messenger/com.mycompany.Messenger.ChatBubbleActivity t4 f}} appWin=Window{52948c58 u0 Starting com.mycompany.messenger} drawState=4
02-04 16:17:35.288 487-617/? W/WindowManager﹕ Screenshot failure taking screenshot for (800x1280) to layer 21015
02-04 16:17:38.512 487-502/? I/Choreographer﹕ Skipped 188 frames! The application may be doing too much work on its main thread.
02-04 16:17:38.516 711-711/? I/Choreographer﹕ Skipped 185 frames! The application may be doing too much work on its main thread.
02-04 16:17:39.708 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:17:40.536 711-711/? W/EGL_genymotion﹕ eglSurfaceAttrib not implemented
02-04 16:17:41.260 487-502/? I/Choreographer﹕ Skipped 35 frames! The application may be doing too much work on its main thread.
02-04 16:17:49.560 1286-1300/? I/Process﹕ Sending signal. PID: 1286 SIG: 9
02-04 16:17:49.580 487-616/? W/InputMethodManagerService﹕ Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#52963b68 attribute=null, token = android.os.BinderProxy#5290713c
02-04 16:17:49.644 487-840/? I/ActivityManager﹕ Process com.mycompany.messenger (pid 1286) has died.
02-04 16:17:49.716 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:17:59.720 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:18:09.728 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:18:19.736 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:18:29.744 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:18:39.752 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:18:49.756 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:18:59.764 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:19:09.772 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:19:19.780 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:19:29.788 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:19:39.792 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
02-04 16:19:49.800 117-117/? D/local_opengl﹕ Select interrupted or nothing to read
Do you want to start an activity or send a broadcast? I don't understand your code.
You are starting an activity from a background thread, that's not allowed.
In your AsyncTask, the method protected String doInBackground(Socket... client) is the only one that doesn't run in the UI thread.
When ever you want to start your Broadcast Receiver you don't call it as an acitivty
Your Method
Intent received = new Intent(ChatBubbleActivity.MESSAGE_RECEIVED);
received.putExtra("current", "Intent is working!!");
startActivity(received);
What it should be
Intent intent = new Intent();
intent.setAction("com.tutorialspoint.CUSTOM_INTENT");
sendBroadcast(intent);
Have a look at these tutorials
Vogella
TutorialsPoint

Android emulator 4.0.3 Crashed when input text in a website through Webview

I've made a simple Android app that's trying to open a URL (any URL with input will do) on a click of a button.
The code I use is this :
btnTest = (Button)findViewById(R.id.btnTest);
btnTest.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
HelloActivity.this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")));
}
});
The problem is that in Android Emulator running Platform 4.0.3, the emulator is crashed everytime I try to input text using soft keyboard into the web. This problem doesn't occur in Emulator running Platform 2.3.3. I've tried many sites and it behaves the same.
Btw, this is the logcat :
02-22 09:35:51.434: I/ActivityManager(81): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.eatmicco.Training/.HelloActivity} from pid 212
02-22 09:35:51.444: D/PermissionCache(36): checking android.permission.READ_FRAME_BUFFER for uid=1000 => granted (623 us)
02-22 09:35:51.704: D/dalvikvm(81): GC_FOR_ALLOC freed 149K, 7% free 11999K/12871K, paused 79ms
02-22 09:35:51.714: I/dalvikvm-heap(81): Grow heap (frag case) to 11.914MB for 129616-byte allocation
02-22 09:35:51.844: D/dalvikvm(81): GC_FOR_ALLOC freed 745K, 13% free 11380K/12999K, paused 68ms
02-22 09:35:51.913: D/dalvikvm(478): Not late-enabling CheckJNI (already on)
02-22 09:35:51.944: I/ActivityManager(81): Start proc com.eatmicco.Training for activity com.eatmicco.Training/.HelloActivity: pid=478 uid=10048 gids={1015}
02-22 09:35:51.954: D/(81): HostConnection::get() New Host Connection established 0xbdd28, tid 123
02-22 09:35:52.094: W/NetworkManagementSocketTagger(81): setKernelCountSet(10048, 1) failed with errno -2
02-22 09:35:52.124: D/OpenGLRenderer(212): Flushing caches (mode 1)
02-22 09:35:52.334: V/PhoneStatusBar(151): setLightsOn(true)
02-22 09:35:52.533: W/InputManagerService(81): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy#415554e8 (uid=10013 pid=212)
02-22 09:35:52.533: D/(478): HostConnection::get() New Host Connection established 0x15c708, tid 478
02-22 09:35:52.593: D/OpenGLRenderer(212): Flushing caches (mode 0)
02-22 09:35:52.704: I/Process(81): Sending signal. PID: 478 SIG: 3
02-22 09:35:52.704: I/dalvikvm(478): threadid=3: reacting to signal 3
02-22 09:35:52.714: I/dalvikvm(478): Wrote stack traces to '/data/anr/traces.txt'
02-22 09:35:53.004: I/ActivityManager(81): Displayed com.eatmicco.Training/.HelloActivity: +1s114ms
02-22 09:35:53.154: W/NetworkManagementSocketTagger(81): setKernelCountSet(10013, 0) failed with errno -2
02-22 09:35:54.204: I/ActivityManager(81): START {act=android.intent.action.VIEW dat=http://www.google.com cmp=com.android.browser/.BrowserActivity} from pid 478
02-22 09:35:54.573: I/ActivityManager(81): Start proc com.android.browser for activity com.android.browser/.BrowserActivity: pid=491 uid=10002 gids={3003, 1015}
02-22 09:35:54.673: W/NetworkManagementSocketTagger(81): setKernelCountSet(10002, 1) failed with errno -2
02-22 09:35:54.933: I/ActivityThread(491): Pub com.android.browser;browser: com.android.browser.provider.BrowserProvider2
02-22 09:35:54.984: I/ActivityThread(491): Pub com.android.browser.home: com.android.browser.homepages.HomeProvider
02-22 09:35:54.984: I/ActivityThread(491): Pub com.android.browser.snapshots: com.android.browser.provider.SnapshotProvider
02-22 09:35:55.193: I/Process(81): Sending signal. PID: 491 SIG: 3
02-22 09:35:55.193: I/dalvikvm(491): threadid=3: reacting to signal 3
02-22 09:35:55.303: I/dalvikvm(491): Wrote stack traces to '/data/anr/traces.txt'
02-22 09:35:55.553: D/dalvikvm(491): GC_CONCURRENT freed 257K, 4% free 9281K/9607K, paused 8ms+4ms
02-22 09:35:55.603: E/ActivityThread(491): Failed to find provider info for com.google.settings
02-22 09:35:55.603: E/ActivityThread(491): Failed to find provider info for com.google.settings
02-22 09:35:55.693: I/Process(81): Sending signal. PID: 491 SIG: 3
02-22 09:35:55.693: I/dalvikvm(491): threadid=3: reacting to signal 3
02-22 09:35:55.813: I/dalvikvm(491): Wrote stack traces to '/data/anr/traces.txt'
02-22 09:35:55.893: D/dalvikvm(491): GC_FOR_ALLOC freed 191K, 4% free 9475K/9799K, paused 34ms
02-22 09:35:55.943: D/dalvikvm(491): GC_FOR_ALLOC freed 5K, 4% free 9647K/9991K, paused 31ms
02-22 09:35:55.993: D/dalvikvm(491): GC_FOR_ALLOC freed <1K, 4% free 9818K/10183K, paused 42ms
02-22 09:35:56.023: D/dalvikvm(491): GC_FOR_ALLOC freed <1K, 4% free 9989K/10375K, paused 35ms
02-22 09:35:56.073: D/dalvikvm(491): GC_FOR_ALLOC freed 1K, 4% free 10162K/10567K, paused 32ms
02-22 09:35:56.114: D/dalvikvm(491): GC_FOR_ALLOC freed <1K, 3% free 10504K/10759K, paused 33ms
02-22 09:35:56.163: E/libEGL(491): call to OpenGL ES API with no current context (logged once per thread)
02-22 09:35:56.183: D/ShaderProgram(491): couldn't load the vertex shader!
02-22 09:35:56.183: E/libEGL(491): call to OpenGL ES API with no current context (logged once per thread)
02-22 09:35:56.183: D/ShaderProgram(491): couldn't load the vertex shader!
02-22 09:35:56.183: E/libEGL(491): call to OpenGL ES API with no current context (logged once per thread)
02-22 09:35:56.183: D/ShaderProgram(491): couldn't load the vertex shader!
02-22 09:35:56.183: E/libEGL(491): call to OpenGL ES API with no current context (logged once per thread)
02-22 09:35:56.183: D/ShaderProgram(491): couldn't load the vertex shader!
02-22 09:35:56.183: E/libEGL(491): call to OpenGL ES API with no current context (logged once per thread)
02-22 09:35:56.183: D/ShaderProgram(491): couldn't load the vertex shader!
02-22 09:35:56.193: I/Process(81): Sending signal. PID: 491 SIG: 3
02-22 09:35:56.193: I/dalvikvm(491): threadid=3: reacting to signal 3
02-22 09:35:56.233: I/dalvikvm(491): Wrote stack traces to '/data/anr/traces.txt'
02-22 09:35:56.383: D/dalvikvm(491): GC_FOR_ALLOC freed 20K, 3% free 10896K/11143K, paused 57ms
02-22 09:35:56.393: D/WebViewTimersControl(491): onBrowserActivityResume
02-22 09:35:56.393: D/WebViewTimersControl(491): Resuming webview timers, view=com.android.browser.BrowserWebView#41313558
02-22 09:35:56.403: W/BaseUi(491): mMainView is already attached to wrapper in attachTabToContentView!
02-22 09:35:56.413: W/BaseUi(491): mContainer is already attached to content in attachTabToContentView!
02-22 09:35:56.433: V/NFC(491): this device does not have NFC support
02-22 09:35:56.543: D/libEGL(491): loaded /system/lib/egl/libGLES_android.so
02-22 09:35:56.593: D/libEGL(491): loaded /system/lib/egl/libEGL_emulation.so
02-22 09:35:56.593: D/(491): HostConnection::get() New Host Connection established 0x1ec618, tid 491
02-22 09:35:56.643: D/libEGL(491): loaded /system/lib/egl/libGLESv1_CM_emulation.so
02-22 09:35:56.643: D/libEGL(491): loaded /system/lib/egl/libGLESv2_emulation.so
02-22 09:35:56.703: I/Process(81): Sending signal. PID: 491 SIG: 3
02-22 09:35:56.703: I/dalvikvm(491): threadid=3: reacting to signal 3
02-22 09:35:56.793: W/EGL_emulation(491): eglSurfaceAttrib not implemented
02-22 09:35:56.823: D/OpenGLRenderer(491): Enabling debug mode 0
02-22 09:35:56.823: I/dalvikvm(491): Wrote stack traces to '/data/anr/traces.txt'
02-22 09:35:57.214: I/Process(81): Sending signal. PID: 491 SIG: 3
02-22 09:35:57.214: I/dalvikvm(491): threadid=3: reacting to signal 3
02-22 09:35:57.273: I/dalvikvm(491): Wrote stack traces to '/data/anr/traces.txt'
02-22 09:35:57.313: I/ActivityManager(81): Displayed com.android.browser/.BrowserActivity: +2s785ms
02-22 09:35:57.733: E/chromium(491): external/chromium/net/disk_cache/backend_impl.cc:1107: [0222/093557:ERROR:backend_impl.cc(1107)] Critical error found -8
02-22 09:35:57.893: D/dalvikvm(491): GC_CONCURRENT freed 65K, 3% free 11348K/11591K, paused 3ms+21ms
02-22 09:35:57.963: D/dalvikvm(491): GC_FOR_ALLOC freed 10K, 3% free 11337K/11591K, paused 60ms
02-22 09:35:57.963: I/dalvikvm-heap(491): Grow heap (frag case) to 11.765MB for 656656-byte allocation
02-22 09:35:57.993: W/chromium(491): external/chromium/net/disk_cache/storage_block-inl.h:119: [0222/093558:WARNING:storage_block-inl.h(119)] Failed data load.
02-22 09:35:57.993: W/chromium(491): external/chromium/net/disk_cache/storage_block-inl.h:119: [0222/093558:WARNING:storage_block-inl.h(119)] Failed data load.
02-22 09:35:58.003: W/chromium(491): external/chromium/net/disk_cache/storage_block-inl.h:119: [0222/093558:WARNING:storage_block-inl.h(119)] Failed data load.
02-22 09:35:58.033: W/chromium(491): external/chromium/net/disk_cache/storage_block-inl.h:119: [0222/093558:WARNING:storage_block-inl.h(119)] Failed data load.
02-22 09:35:58.053: E/chromium(491): external/chromium/net/disk_cache/entry_impl.cc:904: [0222/093558:ERROR:entry_impl.cc(904)] Failed to save user data
02-22 09:35:58.053: E/chromium(491): external/chromium/net/disk_cache/entry_impl.cc:904: [0222/093558:ERROR:entry_impl.cc(904)] Failed to save user data
02-22 09:35:58.143: D/dalvikvm(491): GC_FOR_ALLOC freed 0K, 3% free 11979K/12295K, paused 121ms
02-22 09:35:58.263: W/Tab(491): Failed to save back/forward list for http://www.google.com
02-22 09:35:58.883: W/NetworkManagementSocketTagger(81): setKernelCountSet(10048, 0) failed with errno -2
02-22 09:36:03.363: D/dalvikvm(165): GC_CONCURRENT freed 118K, 3% free 9760K/9991K, paused 4ms+5ms
02-22 09:36:04.403: D/(165): HostConnection::get() New Host Connection established 0x1e7f50, tid 165
02-22 09:36:04.773: D/dalvikvm(165): GC_FOR_ALLOC freed 143K, 3% free 9844K/10119K, paused 224ms
02-22 09:36:04.803: I/dalvikvm-heap(165): Grow heap (frag case) to 10.241MB for 591376-byte allocation
02-22 09:36:04.913: D/dalvikvm(165): GC_FOR_ALLOC freed 9K, 4% free 10412K/10759K, paused 99ms
02-22 09:36:05.053: D/dalvikvm(165): GC_CONCURRENT freed <1K, 4% free 10413K/10759K, paused 3ms+4ms
02-22 09:36:05.623: D/dalvikvm(151): GC_CONCURRENT freed 174K, 29% free 9975K/13959K, paused 4ms+16ms
02-22 09:36:05.803: D/dalvikvm(81): GC_CONCURRENT freed 278K, 12% free 11569K/12999K, paused 5ms+28ms
: E/(): Device disconnected
Can anyone tell me what's wrong here?
Thanks

android.view.InflateException array

error line 21: line 21 is: android:entryValues="#array/listValues". This error only on android < 3. Any idea? Logcat is about when I start app and rotate emulator.
preferences.xml:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="sett"
android:summary="Sett">
<CheckBoxPreference
android:title="Notify"
android:defaultValue="true"
android:summary="on off"
android:key="checkboxPref" />
</PreferenceCategory>
<PreferenceCategory
android:title="Animation" >
<ListPreference
android:entries="#array/listOptions"
android:entryValues="#array/listValues"
android:key="listpref"
android:summary="time"
android:title="time" />
</PreferenceCategory>
</PreferenceScreen>
arrayfade.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<string-array name="listOptions">
<item>Mezzo secondo</item>
<item>Un secondo</item>
<item>Un secondo e mezzo</item>
<item>Due secondi</item>
</string-array>
<string-array name="listValues">
<item>500</item>
<item>1000</item>
<item>1500</item>
<item>2000</item>
</string-array>
</resources>
logcat:
I/ActivityManager( 52): Displayed activity com.example.app/.MainActivity: 2372 ms (total 2372 ms)
I/ActivityManager( 52): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=1/1 orien=2 layout=18}
I/UsageStats( 52): Unexpected resume of com.example.app while already resumed in com.example.app
W/SurfaceFlinger( 52): timeout expired mFreezeDisplay=1, mFreezeCount=0
I/WindowManager( 52): Setting rotation to 0, animFlags=0
I/ActivityManager( 52): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=1/1 orien=1 layout=18}
I/UsageStats( 52): Unexpected resume of com.example.app while already resumed in com.example.app
D/dalvikvm( 660): GC freed 3448 objects / 774776 bytes in 59ms
I/dalvikvm( 660): Stack overflow, expanding (0x41049200 to 0x41049000)
I/dalvikvm( 660): Shrank stack (to 0x41049200, curFrame is 0x41049488)
D/AndroidRuntime( 660): Shutting down VM
W/dalvikvm( 660): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
E/ACRA ( 660): ACRA caught a StackOverflowError exception for com.example.app. Building report.
I/NotificationService( 52): enqueueToast pkg=com.example.app callback=android.app.ITransientNotification$Stub$Proxy#43bf7008 duration=1
D/dalvikvm( 660): GC freed 6838 objects / 1236840 bytes in 65ms
D/dalvikvm( 660): GREF has increased to 201
D/dalvikvm( 52): GREF has increased to 501
D/dalvikvm( 52): GC freed 6591 objects / 308072 bytes in 96ms
D/dalvikvm( 660): GREF has increased to 301
D/dalvikvm( 660): GC freed 10418 objects / 650872 bytes in 78ms
D/dalvikvm( 52): GC freed 2244 objects / 129800 bytes in 103ms
D/dalvikvm( 660): GC freed 3169 objects / 152248 bytes in 75ms
I/ACRA ( 660): READ_LOGS granted! ACRA can include LogCat and DropBox data.
D/ACRA ( 660): Retrieving logcat output...
D/ACRA ( 660): Writing crash report file 1356895743000.stacktrace.
D/dalvikvm( 660): GC freed 8682 objects / 1094864 bytes in 72ms
D/ACRA ( 660): About to start ReportSenderWorker from #handleException
D/ACRA ( 660): Mark all pending reports as approved.
D/ACRA ( 660): Looking for error files in /data/data/com.example.app/files
D/ACRA ( 660): #checkAndSendReports - start
D/ACRA ( 660): Looking for error files in /data/data/com.example.app/files
I/ACRA ( 660): Sending file 1356895743000-approved.stacktrace
D/dalvikvm( 660): DestroyJavaVM waiting for non-daemon threads to exit
D/ACRA ( 660): Waiting for Toast + worker...
D/dalvikvm( 52): GC freed 3929 objects / 166424 bytes in 157ms
D/dalvikvm( 660): GREF has decreased to 199
D/dalvikvm( 660): GC freed 495 objects / 497968 bytes in 165ms
D/ACRA ( 660): Sending report 569291c5-64df-4491-91f9-f89f01f7f053
D/ACRA ( 660): Connect to https://docs.google.com/spreadsheet/formResponse?formkey=dFNyNHJJQ1ZvdVhlblg3aVl1LVNOSGc6MQ&ifq
W/WindowManager( 52): App freeze timeout expired.
W/WindowManager( 52): Force clearing freeze: AppWindowToken{43d7b688 token=HistoryRecord{43cf1898 com.example.app/.MainActivity}}
D/dalvikvm( 660): GC freed 11315 objects / 1068344 bytes in 59ms
D/dalvikvm( 660): GC freed 1302 objects / 353824 bytes in 48ms
D/ACRA ( 660): Sending request to https://docs.google.com/spreadsheet/formResponse?formkey=dFNyNHJJQ1ZvdVhlblg3aVl1LVNOSGc6MQ&ifq
D/dalvikvm( 52): GREF has decreased to 399
D/dalvikvm( 100): GC freed 1096 objects / 64416 bytes in 65ms
D/dalvikvm( 52): GC freed 3276 objects / 134560 bytes in 84ms
D/ACRA ( 660): #checkAndSendReports - finish
D/ACRA ( 660): Wait for Toast + worker ended. Kill Application ? true
E/AndroidRuntime( 660): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 660): java.lang.StackOverflowError
E/AndroidRuntime( 660): at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:49)
E/AndroidRuntime( 660): at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:41)
E/AndroidRuntime( 660): at java.nio.ReadWriteHeapByteBuffer.<init>(ReadWriteHeapByteBuffer.java:45)
E/AndroidRuntime( 660): at java.nio.BufferFactory.newByteBuffer(BufferFactory.java:40)
E/AndroidRuntime( 660): at java.nio.ByteBuffer.wrap(ByteBuffer.java:87)
E/AndroidRuntime( 660): at java.nio.charset.CharsetEncoder.isLegalReplacement(CharsetEncoder.java:692)
E/AndroidRuntime( 660): at java.nio.charset.CharsetEncoder.replaceWith(CharsetEncoder.java:804)
E/AndroidRuntime( 660): at java.nio.charset.CharsetEncoder.<init>(CharsetEncoder.java:205)
E/AndroidRuntime( 660): at com.ibm.icu4jni.charset.CharsetEncoderICU.<init>(CharsetEncoderICU.java:75)
E/AndroidRuntime( 660): at com.ibm.icu4jni.charset.CharsetICU.newEncoder(CharsetICU.java:74)
E/AndroidRuntime( 660): at com.android.internal.util.FastXmlSerializer.setOutput(FastXmlSerializer.java:292)
E/AndroidRuntime( 660): at com.android.internal.util.XmlUtils.writeMapXml(XmlUtils.java:180)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl.writeFileLocked(ApplicationContext.java:2757)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl.access$800(ApplicationContext.java:2510)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImpl.commit(ApplicationContext.java:2695)
E/AndroidRuntime( 660): at com.example.app.MainActivity.preferenze(MainActivity.java:3473)
E/AndroidRuntime( 660): at com.example.app.MainActivity.access$0(MainActivity.java:3439)
E/AndroidRuntime( 660): at com.example.app.MainActivity$1.onSharedPreferenceChanged(MainActivity.java:2302)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImpl.commit(ApplicationContext.java:2703)
E/AndroidRuntime( 660): at com.example.app.MainActivity.preferenze(MainActivity.java:3473)
E/AndroidRuntime( 660): at com.example.app.MainActivity.access$0(MainActivity.java:3439)
E/AndroidRuntime( 660): at com.example.app.MainActivity$1.onSharedPreferenceChanged(MainActivity.java:2302)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImpl.commit(ApplicationContext.java:2703)
E/AndroidRuntime( 660): at com.example.app.MainActivity.preferenze(MainActivity.java:3473)
E/AndroidRuntime( 660): at com.example.app.MainActivity.access$0(MainActivity.java:3439)
E/AndroidRuntime( 660): at com.example.app.MainActivity$1.onSharedPreferenceChanged(MainActivity.java:2302)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImpl.commit(ApplicationContext.java:2703)
E/AndroidRuntime( 660): at com.example.app.MainActivity.preferenze(MainActivity.java:3473)
E/AndroidRuntime( 660): at com.example.app.MainActivity.access$0(MainActivity.java:3439)
E/AndroidRuntime( 660): at com.example.app.MainActivity$1.onSharedPreferenceChanged(MainActivity.java:2302)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImpl.commit(ApplicationContext.java:2703)
E/AndroidRuntime( 660): at com.example.app.MainActivity.preferenze(MainActivity.java:3473)
E/AndroidRuntime( 660): at com.example.app.MainActivity.access$0(MainActivity.java:3439)
E/AndroidRuntime( 660): at com.example.app.MainActivity$1.onSharedPreferenceChanged(MainActivity.java:2302)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImpl.commit(ApplicationContext.java:2703)
E/AndroidRuntime( 660): at com.example.app.MainActivity.preferenze(MainActivity.java:3473)
E/AndroidRuntime( 660): at com.example.app.MainActivity.access$0(MainActivity.java:3439)
E/AndroidRuntime( 660): at com.example.app.MainActivity$1.onSharedPreferenceChanged(MainActivity.java:2302)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImpl.commit(ApplicationContext.java:2703)
E/AndroidRuntime( 660): at com.example.app.MainActivity.preferenze(MainActivity.java:3473)
E/AndroidRuntime( 660): at com.example.app.MainActivity.access$0(MainActivity.java:3439)
E/AndroidRuntime( 660): at com.example.app.MainActivity$1.onSharedPreferenceChanged(MainActivity.java:2302)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImpl.commit(ApplicationContext.java:2703)
E/AndroidRuntime( 660): at com.example.app.MainActivity.preferenze(MainActivity.java:3473)
E/AndroidRuntime( 660): at com.example.app.MainActivity.access$0(MainActivity.java:3439)
E/AndroidRuntime( 660): at com.example.app.MainActivity$1.onSharedPreferenceChanged(MainActivity.java:2302)
E/AndroidRuntime( 660): at android.app.ApplicationContext$SharedPreferencesImpl$EditorImp
D/dalvikvm( 660): GC freed 8661 objects / 994800 bytes in 65ms
D/dalvikvm( 660): threadid=31 wakeup: interrupted
I/Process ( 52): Sending signal. PID: 660 SIG: 3
I/dalvikvm( 660): threadid=7: reacting to signal 3
I/dalvikvm( 660): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 660): Sending signal. PID: 660 SIG: 9
I/ActivityManager( 52): Process com.example.app (pid 660) has died.
I/UsageStats( 52): Unexpected resume of com.android.launcher while already resumed in com.example.app
W/InputManagerService( 52): Got RemoteException sending setActive(false) notification to pid 660 uid 10028
With your update you now got a stack over flow error : onSharedPreferenceChanged calls a method name preferenze that calls commit than triggers onSharedPreferenceChanged. After a certain number of "recursive" calls like this, you get out of heap space. Don't call commit from there.
The problem comes from the layout of MainActivity, not the preference xml file.
Check your fragments are properly declared with a android:name attribute.
Tak a look at
Could not find class 'android.content.ClipboardManager', referenced from method com.example.app.MainActivity.Copia
android.content.ClipboardManager is available from API lvl 11 - Android 3.0.
I think it can be connected with your problem.

Android - Settings.ACTION_DEVICE_INFO_SETTINGS crashes on android 4.1.1

I have an app where users can click on certain buttons in my app and it will launch specific settings page from Android to the user. I uses the android API from their website http://developer.android.com/reference/android/provider/Settings.html
Intent intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
currentContext.startActivity(intent);
Intent intent = new Intent(Settings.ACTION_DISPLAY_SETTINGS);
currentContext.startActivity(intent);
These are some of the settings pages that my app will open. So far I have no problem launching these two intents from my app. However, when I try to launch the "About tablet" page with the code below, the Settings process crashes.
Intent intent = new Intent(Settings.ACTION_DEVICE_INFO_SETTINGS);
currentContext.startActivity(intent);
It crashes on android 4.1.1 but it works fine on android 3.2. I'm still new to Android and I am at a lost on why it crashes. I'm new to StackOverflow as well. Hopefully I am able to get some answers here and nice to meet you all.
Here's my logcat:
09-19 09:50:12.830: I/ActivityManager(270): START {act=android.settings.DEVICE_INFO_SETTINGS cmp=com.android.settings/.Settings$DeviceInfoSettingsActivity u=0} from pid 1627
09-19 09:50:12.910: D/dalvikvm(270): GC_FOR_ALLOC freed 738K, 13% free 11824K/13575K, paused 62ms, total 62ms
09-19 09:50:13.010: W/System.err(1675): Removed 2131231183
09-19 09:50:13.020: W/System.err(1675): Removed 2131231190
09-19 09:50:13.060: D/LocalBluetoothProfileManager(1675): LocalBluetoothProfileManager construction complete
09-19 09:50:13.060: D/AndroidRuntime(1675): Shutting down VM
09-19 09:50:13.060: W/dalvikvm(1675): threadid=1: thread exiting with uncaught exception (group=0x40d4c300)
09-19 09:50:13.060: E/AndroidRuntime(1675): FATAL EXCEPTION: main
09-19 09:50:13.060: E/AndroidRuntime(1675): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.Settings$DeviceInfoSettingsActivity}: java.lang.NullPointerException
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.os.Handler.dispatchMessage(Handler.java:99)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.os.Looper.loop(Looper.java:137)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.app.ActivityThread.main(ActivityThread.java:4745)
09-19 09:50:13.060: E/AndroidRuntime(1675): at java.lang.reflect.Method.invokeNative(Native Method)
09-19 09:50:13.060: E/AndroidRuntime(1675): at java.lang.reflect.Method.invoke(Method.java:511)
09-19 09:50:13.060: E/AndroidRuntime(1675): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-19 09:50:13.060: E/AndroidRuntime(1675): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-19 09:50:13.060: E/AndroidRuntime(1675): at dalvik.system.NativeStart.main(Native Method)
09-19 09:50:13.060: E/AndroidRuntime(1675): Caused by: java.lang.NullPointerException
09-19 09:50:13.060: E/AndroidRuntime(1675): at com.android.settings.Settings.onCreate(Settings.java:167)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.app.Activity.performCreate(Activity.java:5008)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
09-19 09:50:13.060: E/AndroidRuntime(1675): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
09-19 09:50:13.060: E/AndroidRuntime(1675): ... 11 more
09-19 09:50:13.090: W/ActivityManager(270): Force finishing activity com.android.settings/.Settings$DeviceInfoSettingsActivity
09-19 09:50:13.090: W/ActivityManager(270): Force finishing activity com.panasonic.tbexperience/.view.templates.TwoColumnsControlActivity
09-19 09:50:13.100: W/InputMethodManagerService(270): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41811de8 attribute=null
09-19 09:50:13.130: D/dalvikvm(1675): GC_CONCURRENT freed 187K, 4% free 6233K/6471K, paused 12ms+5ms, total 60ms
09-19 09:50:13.610: W/ActivityManager(270): Activity pause timeout for ActivityRecord{417ea2e0 com.android.settings/.Settings$DeviceInfoSettingsActivity}
09-19 09:50:13.820: D/dalvikvm(445): GC_FOR_ALLOC freed 1020K, 33% free 14790K/22023K, paused 41ms, total 41ms
09-19 09:50:13.960: D/dalvikvm(445): GC_FOR_ALLOC freed 1057K, 30% free 15633K/22023K, paused 39ms, total 39ms
09-19 09:50:14.010: D/dalvikvm(445): GC_FOR_ALLOC freed 362K, 24% free 16871K/22023K, paused 32ms, total 32ms
09-19 09:50:14.060: D/dalvikvm(445): GC_CONCURRENT freed 1289K, 20% free 17622K/22023K, paused 3ms+7ms, total 39ms
09-19 09:50:14.060: D/dalvikvm(445): WAIT_FOR_CONCURRENT_GC blocked 29ms
09-19 09:50:14.060: D/dalvikvm(445): WAIT_FOR_CONCURRENT_GC blocked 17ms
09-19 09:50:14.100: D/dalvikvm(445): GC_FOR_ALLOC freed 1693K, 25% free 16723K/22023K, paused 31ms, total 31ms
09-19 09:50:14.190: D/dalvikvm(445): GC_CONCURRENT freed 1126K, 21% free 17585K/22023K, paused 14ms+9ms, total 64ms
09-19 09:50:14.190: D/dalvikvm(445): WAIT_FOR_CONCURRENT_GC blocked 50ms
09-19 09:50:14.390: I/dalvikvm(270): Jit: resizing JitTable from 8192 to 16384
09-19 09:50:16.870: I/Process(1675): Sending signal. PID: 1675 SIG: 9
09-19 09:50:16.890: I/ActivityManager(270): Process com.android.settings (pid 1675) has died.
09-19 09:50:16.890: W/ActivityManager(270): Force removing ActivityRecord{4166f668 com.android.settings/.Settings$DeviceInfoSettingsActivity}: app died, no saved state
09-19 09:50:16.890: W/InputMethodManagerService(270): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#415f2878 attribute=null
09-19 09:50:32.250: D/dalvikvm(1552): GC_CONCURRENT freed 424K, 9% free 6942K/7559K, paused 12ms+3ms, total 39ms
Also, I tried to directly set the classname for this api...
Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.Settings$DeviceInfoSettingsActivity");
currentContext.startActivity(intent);
Same thing happens.It works for android 3.2 but doesn't work in 4.1.1. I've got a feeling that maybe I did not get the right class name for the 4.1.1 version. Does anyone know the direct class name to open the "About Tablet" page or whether is it possible to open that page programmatically?
Regards,
shuwen
android api doc say:
In some cases, a matching Activity may not exist, so ensure you safeguard against this.
so you should check this intent or catch this exception yourself.

ListView not getting displayed?

I have a activity which uses a listview element as follows
public class List1 extends Activity
{
Context context=this;
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.listview);
try{
//DB
final SQLiteDatabase db;
db = openOrCreateDatabase(
"Secret.db"
, SQLiteDatabase.CREATE_IF_NECESSARY
, null
);
db.setVersion(1);
db.setLocale(Locale.getDefault());
db.setLockingEnabled(true);
Cursor cur = db.query("tbl_user",null,null,null,null,null,null);
//DB Over
ListView listView = (ListView) findViewById(R.id.mylist);
listView.setTextFilterEnabled(true);
final String[] values = new String[50];
int i=0;
while(cur.moveToNext())
{
values[i]=Integer.toString(cur.getInt(0))+":"+cur.getString(1)+":"+cur.getString(2);
i++;
}
cur.close();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,R.layout.list_item,values);
listView.setAdapter(adapter);
listView.setVisibility(0);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position,long id)
//public void onItemClick(ListView<?> listview, View view, int position,long id)
{
try
{
Intent i=new Intent(List1.this,Form1.class);
i.putExtra("uid","85");
startActivity(i);
finish();
}
catch(Exception e)
{
String insert2="insert into login values("+"\""+e.toString()+"\""+");";
db.execSQL(insert2);
}
}
});
db.close();
//required
}
catch(Exception e)
{
Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_LONG).show();}
}
}
This is my listview.xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</RelativeLayout>
This is my list_item.xml file which has the required textview
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/tv1"
android:padding="10dp"
android:background="#drawable/textview1"
style="#style/textview_text"
android:textSize="16dp">
</TextView>
But the ListView is not working. I mean after coming to this activity the app is showing error showing "APP_NAME is stopped unexpectedly". The same code works for one or two times and then shows the above error continuously after that. May I kno why is it happening?
EDIT
This is logcat file
W/dalvikvm( 2694): threadid=3: thread exiting with uncaught exception (group=0x4
001b188)
E/AndroidRuntime( 2694): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 2694): java.lang.NullPointerException
E/AndroidRuntime( 2694): at android.widget.ArrayAdapter.createViewFromRes
ource(ArrayAdapter.java:355)
E/AndroidRuntime( 2694): at android.widget.ArrayAdapter.getView(ArrayAdap
ter.java:323)
E/AndroidRuntime( 2694): at android.widget.AbsListView.obtainView(AbsList
View.java:1274)
E/AndroidRuntime( 2694): at android.widget.ListView.makeAndAddView(ListVi
ew.java:1668)
E/AndroidRuntime( 2694): at android.widget.ListView.fillDown(ListView.jav
a:637)
E/AndroidRuntime( 2694): at android.widget.ListView.fillFromTop(ListView.
java:694)
E/AndroidRuntime( 2694): at android.widget.ListView.layoutChildren(ListVi
ew.java:1521)
E/AndroidRuntime( 2694): at android.widget.AbsListView.onLayout(AbsListVi
ew.java:1113)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.RelativeLayout.onLayout(Relati
veLayout.java:900)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.FrameLayout.onLayout(FrameLayo
ut.java:333)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.setChildFrame(Lin
earLayout.java:1119)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.layoutVertical(Li
nearLayout.java:998)
E/AndroidRuntime( 2694): at android.widget.LinearLayout.onLayout(LinearLa
yout.java:918)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.widget.FrameLayout.onLayout(FrameLayo
ut.java:333)
E/AndroidRuntime( 2694): at android.view.View.layout(View.java:6830)
E/AndroidRuntime( 2694): at android.view.ViewRoot.performTraversals(ViewR
oot.java:996)
E/AndroidRuntime( 2694): at android.view.ViewRoot.handleMessage(ViewRoot.
java:1633)
E/AndroidRuntime( 2694): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 2694): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2694): at android.app.ActivityThread.main(ActivityThrea
d.java:4363)
E/AndroidRuntime( 2694): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 2694): at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 2694): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2694): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:618)
E/AndroidRuntime( 2694): at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 2694): GC freed 6621 objects / 343272 bytes in 126ms
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c60cd0 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c58028 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/dalvikvm( 2694): Uncaught exception thrown by finalizer (will be discarded):
I/dalvikvm( 2694): Ljava/lang/IllegalStateException;: Finalizing cursor android.
database.sqlite.SQLiteCursor#44c37fa0 on login that has not been deactivated or
closed
I/dalvikvm( 2694): at android.database.sqlite.SQLiteCursor.finalize(SQLiteC
ursor.java:596)
I/dalvikvm( 2694): at dalvik.system.NativeStart.run(Native Method)
I/Process ( 52): Sending signal. PID: 2694 SIG: 3
I/dalvikvm( 2694): threadid=7: reacting to signal 3
I/dalvikvm( 2694): Wrote stack trace to '/data/anr/traces.txt'
I/Process ( 2694): Sending signal. PID: 2694 SIG: 9
I/ActivityManager( 52): Process com.notification (pid 2694) has died.
I/WindowManager( 52): WIN DEATH: Window{44d90538 com.notification/com.notifica
tion.List1 paused=false}
I/UsageStats( 52): Unexpected resume of com.android.launcher while already res
umed in com.notification
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44d933c8
I/ActivityManager( 52): Start proc com.notification for broadcast com.notifica
tion/.AlarmReceiver: pid=2706 uid=10034 gids={3003}
D/ddm-heap( 2706): Got feature list request
D/dalvikvm( 1152): GC freed 194 objects / 8728 bytes in 88ms
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Back
ground }
I/ActivityManager( 52): Displayed activity com.notification/.Background: 262 m
s (total 8081 ms)
D/dalvikvm( 234): GC freed 44 objects / 2064 bytes in 134ms
D/AndroidRuntime( 2718):
D/AndroidRuntime( 2718): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 2718): CheckJNI is ON
D/AndroidRuntime( 2718): --- registering native functions ---
D/ddm-heap( 2718): Got feature list request
D/PackageParser( 52): Scanning package: /data/app/vmdl67950.tmp
I/PackageManager( 52): Removing non-system package:com.notification
D/PackageManager( 52): Removing package com.notification
D/PackageManager( 52): Services: com.notification.BackService
D/PackageManager( 52): Receivers: com.notification.AlarmReceiver
D/PackageManager( 52): Activities: com.notification.NotificationActivity com
.notification.Form1 com.notification.Background com.notification.Bg com.notifica
tion.List1
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44eb1868
D/PackageManager( 52): Scanning package com.notification
I/PackageManager( 52): /data/app/vmdl67950.tmp changed; unpacking
D/installd( 32): DexInv: --- BEGIN '/data/app/vmdl67950.tmp' ---
D/dalvikvm( 2724): DexOpt: load 40ms, verify 159ms, opt 2ms
D/installd( 32): DexInv: --- END '/data/app/vmdl67950.tmp' (success) ---
D/PackageManager( 52): Services: com.notification.BackService
D/PackageManager( 52): Receivers: com.notification.AlarmReceiver
D/PackageManager( 52): Activities: com.notification.NotificationActivity com
.notification.Form1 com.notification.Background com.notification.Bg com.notifica
tion.List1
D/ActivityManager( 52): Uninstalling process com.notification
D/ActivityManager( 52): Force removing process ProcessRecord{44e9eb48 2706:com
.notification/10034} (com.notification/10034)
I/Process ( 52): Sending signal. PID: 2706 SIG: 9
D/ActivityManager( 52): Received spurious death notification for thread androi
d.os.BinderProxy#44eec8b8
I/installd( 32): move /data/dalvik-cache/data#app#vmdl67950.tmp#classes.dex ->
/data/dalvik-cache/data#app#com.notification.apk#classes.dex
D/PackageManager( 52): New package installed in /data/app/com.notification.apk
D/AndroidRuntime( 2718): Shutting down VM
D/dalvikvm( 2718): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 2718): DestroyJavaVM shutting VM down
D/dalvikvm( 2718): HeapWorker thread shutting down
D/dalvikvm( 2718): HeapWorker thread has shut down
D/jdwp ( 2718): JDWP shutting down net...
I/dalvikvm( 2718): Debugger has detached; object registry had 1 entries
D/dalvikvm( 2718): VM cleaning up
D/dalvikvm( 2718): LinearAlloc 0x0 used 623916 of 5242880 (11%)
D/ActivityManager( 52): Uninstalling process com.notification
I/dalvikvm( 2718): JNI: AttachCurrentThread (from ???.???)
E/AndroidRuntime( 2718): ERROR: thread attach failed
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
700e5
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20031
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20030
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
50000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60001
D/dalvikvm( 1152): GC freed 139 objects / 5928 bytes in 230ms
D/dalvikvm( 52): GC freed 14606 objects / 863536 bytes in 259ms
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
700e5
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20031
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
20030
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
50000
D/dalvikvm( 52): GC freed 425 objects / 17320 bytes in 275ms
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60000
W/ResourceType( 52): Resources don't contain package for resource number 0x7f0
60001
D/AndroidRuntime( 2729):
D/AndroidRuntime( 2729): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 2729): CheckJNI is ON
D/AndroidRuntime( 2729): --- registering native functions ---
D/ddm-heap( 2729): Got feature list request
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Start proc com.notification for activity com.notificat
ion/.NotificationActivity: pid=2735 uid=10034 gids={3003}
D/AndroidRuntime( 2729): Shutting down VM
D/dalvikvm( 2729): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 2729): DestroyJavaVM shutting VM down
D/dalvikvm( 2729): HeapWorker thread shutting down
D/dalvikvm( 2729): HeapWorker thread has shut down
D/jdwp ( 2729): JDWP shutting down net...
I/dalvikvm( 2729): Debugger has detached; object registry had 1 entries
D/dalvikvm( 2729): VM cleaning up
E/AndroidRuntime( 2729): ERROR: thread attach failed
D/dalvikvm( 2729): LinearAlloc 0x0 used 639500 of 5242880 (12%)
D/dalvikvm( 30): GC freed 299 objects / 11576 bytes in 264ms
D/ddm-heap( 2735): Got feature list request
D/dalvikvm( 30): GC freed 57 objects / 2432 bytes in 160ms
D/dalvikvm( 30): GC freed 2 objects / 48 bytes in 360ms
I/ActivityManager( 52): Displayed activity com.notification/.NotificationActiv
ity: 1204 ms (total 1204 ms)
W/KeyCharacterMap( 2735): No keyboard for id 0
W/KeyCharacterMap( 2735): Using default keymap: /system/usr/keychars/qwerty.kcm.
bin
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Bg (
has extras) }
I/ActivityManager( 52): Displayed activity com.notification/.Bg: 329 ms (total
329 ms)
D/dalvikvm( 1152): GC freed 2454 objects / 141000 bytes in 600ms
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.List
1 bnds=[0,152][480,248] }
W/ActivityManager( 52): startActivity called from non-Activity context; forcin
g Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.notification/.List1 bnds=[
0,152][480,248] }
D/AndroidRuntime( 2735): Shutting down VM
W/dalvikvm( 2735): threadid=3: thread exiting with uncaught exception (group=0x4
001b188)
E/AndroidRuntime( 2735): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 2735): java.lang.NullPointerException
E/AndroidRuntime( 2735): at android.widget.ArrayAdapter.createViewFromRes
ource(ArrayAdapter.java:355)
E/AndroidRuntime( 2735): at android.widget.ArrayAdapter.getView(ArrayAdap
ter.java:323)
E/AndroidRuntime( 2735): at android.widget.AbsListView.obtainView(AbsList
View.java:1256)
E/AndroidRuntime( 2735): at android.widget.ListView.measureHeightOfChildr
en(ListView.java:1147)
E/AndroidRuntime( 2735): at android.widget.ListView.onMeasure(ListView.ja
va:1060)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.widget.RelativeLayout.measureChild(Re
lativeLayout.java:554)
E/AndroidRuntime( 2735): at android.widget.RelativeLayout.onMeasure(Relat
iveLayout.java:377)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewGroup.measureChildWithMargin
s(ViewGroup.java:3023)
E/AndroidRuntime( 2735): at android.widget.FrameLayout.onMeasure(FrameLay
out.java:245)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.widget.LinearLayout.measureVertical(L
inearLayout.java:464)
E/AndroidRuntime( 2735): at android.widget.LinearLayout.onMeasure(LinearL
ayout.java:278)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewGroup.measureChildWithMargin
s(ViewGroup.java:3023)
E/AndroidRuntime( 2735): at android.widget.FrameLayout.onMeasure(FrameLay
out.java:245)
E/AndroidRuntime( 2735): at android.view.View.measure(View.java:7964)
E/AndroidRuntime( 2735): at android.view.ViewRoot.performTraversals(ViewR
oot.java:763)
E/AndroidRuntime( 2735): at android.view.ViewRoot.handleMessage(ViewRoot.
java:1633)
E/AndroidRuntime( 2735): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 2735): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2735): at android.app.ActivityThread.main(ActivityThrea
d.java:4363)
E/AndroidRuntime( 2735): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 2735): at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime( 2735): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 2735): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:618)
E/AndroidRuntime( 2735): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 52): Sending signal. PID: 2735 SIG: 3
I/dalvikvm( 2735): threadid=7: reacting to signal 3
I/dalvikvm( 2735): Wrote stack trace to '/data/anr/traces.txt'
W/ActivityManager( 52): Launch timeout has expired, giving up wake lock!
W/ActivityManager( 52): Activity idle timeout for HistoryRecord{44dcace0 com.n
otification/.List1}
I/Process ( 2735): Sending signal. PID: 2735 SIG: 9
I/ActivityManager( 52): Process com.notification (pid 2735) has died.
I/WindowManager( 52): WIN DEATH: Window{44d8db78 com.notification/com.notifica
tion.List1 paused=false}
I/UsageStats( 52): Unexpected resume of com.android.launcher while already res
umed in com.notification
I/ActivityManager( 52): Start proc com.notification for broadcast com.notifica
tion/.AlarmReceiver: pid=2745 uid=10034 gids={3003}
W/InputManagerService( 52): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy#44f2e3d8
E/gralloc ( 52): [unregister] handle 0x423290 still locked (state=40000001)
D/ddm-heap( 2745): Got feature list request
D/dalvikvm( 1152): GC freed 212 objects / 9560 bytes in 82ms
I/ActivityManager( 52): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.notification/
.NotificationActivity }
I/ActivityManager( 52): Starting activity: Intent { cmp=com.notification/.Back
ground }
I/ActivityManager( 52): Displayed activity com.notification/.Background: 240 m
s (total 16387 ms)
D/dalvikvm( 234): GC freed 43 objects / 2024 bytes in 152ms
i think your adapter should know which textViewResourceId it should use.
So try this out: ArrayAdapter<String> adapter = new ArrayAdapter<String>(context,R.layout.list_item, R.id.tv1,values);
Change this to
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
this
<ListView
android:id="#+id/mylist"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
And why do you need listView.setVisibility(0)?
final String[] values = new String[50];
int i=0;
while(cur.moveToNext())
{
values[i]=Integer.toString(cur.getInt(0))+":"+cur.getString(1)+":"+cur.getString(2);
i++;
}
cur.close();
Starting from the this spinet of code.
When the db.query returns you should rewind the cursor before starting to use it in the while loop. What if the query returns more the 50 results? Your app will crash with ArrayOutBoundException

Categories

Resources