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
Related
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
Getting this error, no matter which genymotion virtual device I choose:
dlopen("/data/app-lib/com.brainlogin.facedetectlib-1/libjniavutil.so") failed: dlopen failed: library "/system/lib/libhoudini.so" not found
I'm initiating javacv statically (I have all the .so files in my lib folder).
My code to load the libraries
System.loadLibrary("detection_based_tracker");
I've also tried manually trigger loading libopencv_java based on other posts:
System.loadLibrary("libopencv_java");
System.loadLibrary("detection_based_tracker");
Note that the same app runs fine on Eclipse's ADT emulators and on physical devices.
Also note that my other apps not having javacv run fine on the Genymotion virtual devices.
Here is the full logcat:
02-21 11:33:49.177: D/AndroidRuntime(1673): CheckJNI is OFF
02-21 11:33:49.185: D/dalvikvm(1673): Trying to load lib libjavacore.so 0x0
02-21 11:33:49.185: D/dalvikvm(1673): Added shared lib libjavacore.so 0x0
02-21 11:33:49.189: D/dalvikvm(1673): Trying to load lib libnativehelper.so 0x0
02-21 11:33:49.189: D/dalvikvm(1673): Added shared lib libnativehelper.so 0x0
02-21 11:33:49.189: D/dalvikvm(1673): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
02-21 11:33:49.201: D/dalvikvm(1673): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
02-21 11:33:49.241: E/memtrack(1673): Couldn't load memtrack module (No such file or directory)
02-21 11:33:49.241: E/android.os.Debug(1673): failed to load memtrack module: -2
02-21 11:33:49.265: D/AndroidRuntime(1673): Calling main entry com.android.commands.am.Am
02-21 11:33:49.273: I/ActivityManager(540): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.brainlogin.facedetectlib/.FaceDetect} from pid 1673
02-21 11:33:49.281: D/(540): HostConnection::get() New Host Connection established 0xb8ba2cf8, tid 552
02-21 11:33:49.509: D/dalvikvm(540): GC_FOR_ALLOC freed 340K, 51% free 6547K/13196K, paused 7ms, total 7ms
02-21 11:33:49.509: I/dalvikvm-heap(540): Grow heap (frag case) to 7.285MB for 856092-byte allocation
02-21 11:33:49.521: D/dalvikvm(540): GC_FOR_ALLOC freed 3K, 48% free 7380K/14036K, paused 14ms, total 14ms
02-21 11:33:49.529: D/dalvikvm(540): GC_FOR_ALLOC freed 2K, 48% free 7384K/14036K, paused 7ms, total 7ms
02-21 11:33:49.533: I/dalvikvm-heap(540): Grow heap (frag case) to 8.103MB for 856092-byte allocation
02-21 11:33:49.541: D/dalvikvm(540): GC_FOR_ALLOC freed <1K, 45% free 8220K/14876K, paused 8ms, total 8ms
02-21 11:33:49.557: D/AndroidRuntime(1673): Shutting down VM
02-21 11:33:49.557: D/jdwp(1673): Got wake-up signal, bailing out of select
02-21 11:33:49.557: D/dalvikvm(1673): Debugger has detached; object registry had 1 entries
02-21 11:33:49.565: D/dalvikvm(1686): Late-enabling CheckJNI
02-21 11:33:49.569: I/ActivityManager(540): Start proc com.brainlogin.facedetectlib for activity com.brainlogin.facedetectlib/.FaceDetect: pid=1686 uid=10058 gids={50058, 1028, 1015}
02-21 11:33:49.569: D/MobileDataStateTracker(540): default: setPolicyDataEnable(enabled=true)
02-21 11:33:49.589: D/(540): HostConnection::get() New Host Connection established 0xb8ba2ec8, tid 554
02-21 11:33:49.589: D/dalvikvm(1686): Debugger has detached; object registry had 1 entries
02-21 11:33:49.661: D/MobileDataStateTracker(540): default: setPolicyDataEnable(enabled=true)
02-21 11:33:49.737: D/debug(1686): copy SUCCESS for flandmark_model.dat
02-21 11:33:49.745: D/CameraBridge(1686): Attr count: 3
02-21 11:33:49.777: D/dalvikvm(1686): GC_CONCURRENT freed 124K, 6% free 3502K/3692K, paused 3ms+1ms, total 17ms
02-21 11:33:49.789: D/dalvikvm(1686): GC_CONCURRENT freed 192K, 7% free 3819K/4088K, paused 0ms+1ms, total 5ms
02-21 11:33:49.789: D/dalvikvm(1686): WAIT_FOR_CONCURRENT_GC blocked 3ms
02-21 11:33:49.801: D/dalvikvm(1686): GC_CONCURRENT freed 281K, 11% free 3935K/4404K, paused 2ms+0ms, total 4ms
02-21 11:33:49.801: D/dalvikvm(1686): WAIT_FOR_CONCURRENT_GC blocked 3ms
02-21 11:33:49.809: D/dalvikvm(1686): GC_FOR_ALLOC freed 255K, 11% free 3994K/4480K, paused 6ms, total 7ms
02-21 11:33:49.825: D/dalvikvm(1686): GC_CONCURRENT freed 283K, 8% free 4193K/4556K, paused 1ms+2ms, total 8ms
02-21 11:33:49.841: D/dalvikvm(1686): GC_CONCURRENT freed 229K, 7% free 4451K/4756K, paused 0ms+2ms, total 8ms
02-21 11:33:49.869: D/dalvikvm(1686): GC_CONCURRENT freed 257K, 7% free 4675K/5008K, paused 6ms+1ms, total 15ms
02-21 11:33:49.885: D/dalvikvm(1686): No JNI_OnLoad found in /system/lib/libc.so 0xa4fd7c78, skipping init
02-21 11:33:49.885: D/dalvikvm(1686): No JNI_OnLoad found in /system/lib/libm.so 0xa4fd7c78, skipping init
02-21 11:33:49.889: D/dalvikvm(1686): No JNI_OnLoad found in /system/lib/libz.so 0xa4fd7c78, skipping init
02-21 11:33:49.893: D/dalvikvm(1686): No JNI_OnLoad found in /system/lib/libdl.so 0xa4fd7c78, skipping init
02-21 11:33:49.893: D/dalvikvm(1686): No JNI_OnLoad found in /system/lib/liblog.so 0xa4fd7c78, skipping init
02-21 11:33:49.893: D/dalvikvm(1686): Trying to load lib /data/app-lib/com.brainlogin.facedetectlib-1/libavutil.so 0xa4fd7c78
02-21 11:33:49.897: D/dalvikvm(1686): Added shared lib /data/app-lib/com.brainlogin.facedetectlib-1/libavutil.so 0xa4fd7c78
02-21 11:33:49.897: D/dalvikvm(1686): No JNI_OnLoad found in /data/app-lib/com.brainlogin.facedetectlib-1/libavutil.so 0xa4fd7c78, skipping init
02-21 11:33:49.897: D/dalvikvm(1686): Trying to load lib /data/app-lib/com.brainlogin.facedetectlib-1/libjniavutil.so 0xa4fd7c78
02-21 11:33:49.901: E/dalvikvm(1686): dlopen("/data/app-lib/com.brainlogin.facedetectlib-1/libjniavutil.so") failed: dlopen failed: library "/system/lib/libhoudini.so" not found
02-21 11:33:49.901: W/dalvikvm(1686): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/bytedeco/javacpp/avutil;
02-21 11:33:49.901: D/dalvikvm(1686): GC_CONCURRENT freed 453K, 11% free 4679K/5208K, paused 1ms+2ms, total 14ms
02-21 11:33:49.905: I/dalvikvm(1686): Rejecting re-init on previously-failed class Lorg/bytedeco/javacpp/avutil; v=0x0
02-21 11:33:49.905: W/dalvikvm(1686): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lorg/bytedeco/javacpp/avcodec$AVPacket;
02-21 11:33:49.905: D/AndroidRuntime(1686): Shutting down VM
02-21 11:33:49.905: W/dalvikvm(1686): threadid=1: thread exiting with uncaught exception (group=0xa4cb5b20)
02-21 11:33:49.905: E/AndroidRuntime(1686): FATAL EXCEPTION: main
When I push "Run", will come out this:
Waiting for device.
Target device: genymotion-custom_phone_7___4_1_1___api_16___1024x600-192.168.48.101:5555
Uploading file
local path: C:\Users\п\Messenger\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/org.iWi.messenger
Installing org.iWi.messenger
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/org.iWi.messenger"
pkg: /data/local/tmp/org.iWi.messenger
Failure [INSTALL_FAILED_UID_CHANGED]
Here he writes in the log:
10-03 16:15:10.090 3456-3456/? D/AndroidRuntime﹕ >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
10-03 16:15:10.090 3456-3456/? D/AndroidRuntime﹕ CheckJNI is OFF
10-03 16:15:10.090 3456-3456/? D/dalvikvm﹕ Unable to stat classpath element '/system/framework/filterfw.jar'
10-03 16:15:10.090 3456-3456/? D/dalvikvm﹕ Trying to load lib libjavacore.so 0x0
10-03 16:15:10.090 3456-3456/? D/dalvikvm﹕ Added shared lib libjavacore.so 0x0
10-03 16:15:10.090 3456-3456/? D/dalvikvm﹕ Trying to load lib libnativehelper.so 0x0
10-03 16:15:10.090 3456-3456/? D/dalvikvm﹕ Added shared lib libnativehelper.so 0x0
10-03 16:15:10.118 3456-3456/? D/AndroidRuntime﹕ Calling main entry com.android.commands.pm.Pm
10-03 16:15:10.138 298-364/system_process W/ActivityManager﹕ No content provider found for permission revoke: file:///data/local/tmp/org.iWi.messenger
10-03 16:15:10.138 298-364/system_process W/ActivityManager﹕ No content provider found for permission revoke: file:///data/local/tmp/org.iWi.messenger
10-03 16:15:10.186 298-301/system_process D/dalvikvm﹕ GC_CONCURRENT freed 1340K, 38% free 11740K/18823K, paused 11ms+1ms, total 21ms
10-03 16:15:10.610 298-301/system_process D/dalvikvm﹕ GC_CONCURRENT freed 1417K, 38% free 11760K/18823K, paused 12ms+54ms, total 402ms
10-03 16:15:10.610 298-364/system_process D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 268ms
10-03 16:15:10.798 298-301/system_process D/dalvikvm﹕ GC_CONCURRENT freed 1436K, 38% free 11765K/18823K, paused 16ms+1ms, total 139ms
10-03 16:15:10.798 298-364/system_process D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 64ms
10-03 16:15:10.818 298-364/system_process D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 0ms
10-03 16:15:10.818 298-364/system_process W/PackageManager﹕ Package couldn't be installed in /data/app/org.iWi.messenger-1.apk
10-03 16:15:10.834 298-364/system_process D/dalvikvm﹕ GC_EXPLICIT freed 522K, 38% free 11742K/18823K, paused 0ms+3ms, total 16ms
10-03 16:15:10.834 3456-3456/? D/AndroidRuntime﹕ Shutting down VM
10-03 16:15:10.834 3456-3460/? D/dalvikvm﹕ GC_CONCURRENT freed 122K, 78% free 461K/2048K, paused 0ms+0ms, total 1ms
10-03 16:15:10.834 3456-3462/? D/jdwp﹕ Got wake-up signal, bailing out of select
10-03 16:15:10.834 3456-3462/? D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
10-03 16:15:10.834 3456-3466/? I/AndroidRuntime﹕ NOTE: attach of thread 'Binder_3' failed
Earlier at me everything worked, suddenly appeared a problem. For several days, I can not solve this problem.
I am new to android coding. I am trying a simple code like clicking a button, and if clicked it opens Google. If I run my code, and if I click the button, the browser opens, and after sometime, it displays UNFORTUNATELY BROWSER STOPPED. please help me. thanks in advance.
package com.example.single_button_google;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
Button b1;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b1= (Button) findViewById(R.id.button1);
b1.setOnClickListener(click);
}
View.OnClickListener click = new View.OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("https://www.google.co.in/"));
startActivity(intent);
}
};
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
My logcat:
02-04 04:50:19.910: D/AndroidRuntime(1174): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
02-04 04:50:19.920: D/AndroidRuntime(1174): CheckJNI is ON
02-04 04:50:20.000: D/dalvikvm(1174): Trying to load lib libjavacore.so 0x0
02-04 04:50:20.010: D/dalvikvm(1174): Added shared lib libjavacore.so 0x0
02-04 04:50:20.040: D/dalvikvm(1174): Trying to load lib libnativehelper.so 0x0
02-04 04:50:20.040: D/dalvikvm(1174): Added shared lib libnativehelper.so 0x0
02-04 04:50:20.050: D/dalvikvm(1174): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
02-04 04:50:20.270: D/dalvikvm(1174): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
02-04 04:50:20.840: E/memtrack(1174): Couldn't load memtrack module (No such file or directory)
02-04 04:50:20.840: E/android.os.Debug(1174): failed to load memtrack module: -2
02-04 04:50:21.200: D/AndroidRuntime(1174): Calling main entry com.android.commands.pm.Pm
02-04 04:50:21.240: D/AndroidRuntime(1174): Shutting down VM
02-04 04:50:21.240: D/dalvikvm(1174): Debugger has detached; object registry had 1 entries
02-04 04:50:22.040: D/AndroidRuntime(1185): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
02-04 04:50:22.050: D/AndroidRuntime(1185): CheckJNI is ON
02-04 04:50:22.120: D/dalvikvm(1185): Trying to load lib libjavacore.so 0x0
02-04 04:50:22.130: D/dalvikvm(1185): Added shared lib libjavacore.so 0x0
02-04 04:50:22.160: D/dalvikvm(1185): Trying to load lib libnativehelper.so 0x0
02-04 04:50:22.160: D/dalvikvm(1185): Added shared lib libnativehelper.so 0x0
02-04 04:50:22.160: D/dalvikvm(1185): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
02-04 04:50:22.380: D/dalvikvm(1185): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
02-04 04:50:22.960: E/memtrack(1185): Couldn't load memtrack module (No such file or directory)
02-04 04:50:22.960: E/android.os.Debug(1185): failed to load memtrack module: -2
02-04 04:50:23.290: D/AndroidRuntime(1185): Calling main entry com.android.commands.am.Am
02-04 04:50:23.380: I/ActivityManager(363): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.single_button_google/.MainActivity} from pid 1185
02-04 04:50:23.410: D/AndroidRuntime(1185): Shutting down VM
02-04 04:50:23.420: D/jdwp(1185): Got wake-up signal, bailing out of select
02-04 04:50:23.420: D/dalvikvm(1185): Debugger has detached; object registry had 1 entries
02-04 04:50:23.930: W/ActivityManager(363): Activity pause timeout for ActivityRecord{b4f82e48 u0 com.android.browser/.BrowserActivity t8}
02-04 04:50:24.000: W/InputMethodManagerService(363): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#b505f218 attribute=null, token = android.os.BinderProxy#b51975c8
02-04 04:50:24.100: I/Choreographer(363): Skipped 51 frames! The application may be doing too much work on its main thread.
02-04 04:50:24.190: I/Choreographer(363): Skipped 58 frames! The application may be doing too much work on its main thread.
02-04 04:50:24.390: I/Choreographer(363): Skipped 48 frames! The application may be doing too much work on its main thread.
02-04 04:50:24.440: I/Choreographer(899): Skipped 288 frames! The application may be doing too much work on its main thread.
02-04 04:50:24.640: I/Choreographer(363): Skipped 50 frames! The application may be doing too much work on its main thread.
02-04 04:50:24.970: I/Choreographer(363): Skipped 52 frames! The application may be doing too much work on its main thread.
02-04 04:50:25.370: I/Choreographer(363): Skipped 51 frames! The application may be doing too much work on its main thread.
02-04 04:50:25.480: I/Choreographer(363): Skipped 58 frames! The application may be doing too much work on its main thread.
02-04 04:50:25.570: I/Choreographer(363): Skipped 54 frames! The application may be doing too much work on its main thread.
02-04 04:50:25.680: I/Choreographer(363): Skipped 69 frames! The application may be doing too much work on its main thread.
02-04 04:50:25.810: I/Choreographer(363): Skipped 72 frames! The application may be doing too much work on its main thread.
02-04 04:50:34.460: E/NativeDaemonConnector.ResponseQueue(363): Timeout waiting for response
02-04 04:50:34.460: E/VoldConnector(363): timed-out waiting for response to 12 volume mkdirs /storage/sdcard/Android/data/com.android.browser/files/
02-04 04:50:34.460: D/AndroidRuntime(1157): Shutting down VM
02-04 04:50:34.460: W/dalvikvm(1157): threadid=1: thread exiting with uncaught exception (group=0xb4adab90)
02-04 04:50:34.490: E/AndroidRuntime(1157): FATAL EXCEPTION: main
02-04 04:50:34.490: E/AndroidRuntime(1157): Process: com.android.browser, PID: 1157
02-04 04:50:34.490: E/AndroidRuntime(1157): java.lang.RuntimeException: Unable to get provider com.android.browser.provider.SnapshotProvider: java.lang.NullPointerException
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ActivityThread.installProvider(ActivityThread.java:4774)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ActivityThread.installContentProviders(ActivityThread.java:4366)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4306)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ActivityThread.access$1400(ActivityThread.java:135)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1457)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.os.Handler.dispatchMessage(Handler.java:102)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.os.Looper.loop(Looper.java:137)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ActivityThread.main(ActivityThread.java:4998)
02-04 04:50:34.490: E/AndroidRuntime(1157): at java.lang.reflect.Method.invokeNative(Native Method)
02-04 04:50:34.490: E/AndroidRuntime(1157): at java.lang.reflect.Method.invoke(Method.java:515)
02-04 04:50:34.490: E/AndroidRuntime(1157): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
02-04 04:50:34.490: E/AndroidRuntime(1157): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
02-04 04:50:34.490: E/AndroidRuntime(1157): at dalvik.system.NativeStart.main(Native Method)
02-04 04:50:34.490: E/AndroidRuntime(1157): Caused by: java.lang.NullPointerException
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.os.Parcel.readException(Parcel.java:1467)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.os.Parcel.readException(Parcel.java:1415)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.os.storage.IMountService$Stub$Proxy.mkdirs(IMountService.java:750)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ContextImpl.ensureDirsExistOrFilter(ContextImpl.java:2160)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ContextImpl.getExternalFilesDirs(ContextImpl.java:856)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ContextImpl.getExternalFilesDir(ContextImpl.java:839)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.content.ContextWrapper.getExternalFilesDir(ContextWrapper.java:210)
02-04 04:50:34.490: E/AndroidRuntime(1157): at com.android.browser.provider.SnapshotProvider.getOldDatabasePath(SnapshotProvider.java:116)
02-04 04:50:34.490: E/AndroidRuntime(1157): at com.android.browser.provider.SnapshotProvider.migrateToDataFolder(SnapshotProvider.java:123)
02-04 04:50:34.490: E/AndroidRuntime(1157): at com.android.browser.provider.SnapshotProvider.onCreate(SnapshotProvider.java:137)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.content.ContentProvider.attachInfo(ContentProvider.java:1589)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.content.ContentProvider.attachInfo(ContentProvider.java:1560)
02-04 04:50:34.490: E/AndroidRuntime(1157): at android.app.ActivityThread.installProvider(ActivityThread.java:4771)
02-04 04:50:34.490: E/AndroidRuntime(1157): ... 12 more
02-04 04:50:34.660: I/Choreographer(363): Skipped 45 frames! The application may be doing too much work on its main thread.
02-04 04:50:34.910: I/Choreographer(363): Skipped 64 frames! The application may be doing too much work on its main thread.
02-04 04:50:35.020: I/Choreographer(363): Skipped 65 frames! The application may be doing too much work on its main thread.
02-04 04:50:35.130: I/Choreographer(363): Skipped 64 frames! The application may be doing too much work on its main thread.
02-04 04:50:36.050: W/ActivityManager(363): Activity stop timeout for ActivityRecord{b4f82e48 u0 com.android.browser/.BrowserActivity t8}
Seems to be a problem related to the emulator and the SD card. Try to change some configuration on your emulator or try the app on a real device.
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.