It seems that I'm having a small problem when testing my app on Android Studio. A white bar is always being displayed in place of top bar icons (battery, time, etc), whenever I run my app on the emulator. I am not sure what this issue is but below shows a screenshot of my problem and logcat findings:
12-07 16:05:08.932 3003-3003/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
12-07 16:05:08.934 3003-3003/? D/AndroidRuntime: CheckJNI is ON
12-07 16:05:08.954 3003-3003/? I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
12-07 16:05:08.960 3003-3003/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
12-07 16:05:09.006 3003-3003/? E/memtrack: Couldn't load memtrack module (No such file or directory)
12-07 16:05:09.006 3003-3003/? E/android.os.Debug: failed to load memtrack module: -2
12-07 16:05:09.008 3003-3003/? I/Radio-JNI: register_android_hardware_Radio DONE
12-07 16:05:09.026 3003-3003/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am
12-07 16:05:09.031 1299-1311/? I/ActivityManager: Force stopping com.example.unknown.check_files appid=10057 user=0: from pid 3003
12-07 16:05:09.031 1299-1311/? I/ActivityManager: Killing 2975:com.example.unknown.check_files/u0a57 (adj 0): stop com.example.unknown.check_files
12-07 16:05:09.038 1299-1334/? W/InputDispatcher: channel '36fa2b9 com.example.unknown.check_files/com.example.unknown.check_files.testing (server)' ~ Consumer closed input channel or an error occurred. events=0x9
12-07 16:05:09.038 1299-1334/? E/InputDispatcher: channel '36fa2b9 com.example.unknown.check_files/com.example.unknown.check_files.testing (server)' ~ Channel is unrecoverably broken and will be disposed!
12-07 16:05:09.040 1299-1310/? D/GraphicsStats: Buffer count: 3
12-07 16:05:09.040 1299-1310/? I/WindowState: WIN DEATH: Window{36fa2b9 u0 com.example.unknown.check_files/com.example.unknown.check_files.testing}
12-07 16:05:09.040 1299-1310/? W/InputDispatcher: Attempted to unregister already unregistered input channel '36fa2b9 com.example.unknown.check_files/com.example.unknown.check_files.testing (server)'
12-07 16:05:09.063 1299-1311/? W/ActivityManager: Force removing ActivityRecord{4ee7b6f u0 com.example.unknown.check_files/.testing t8}: app died, no saved state
12-07 16:05:09.092 3003-3003/? D/AndroidRuntime: Shutting down VM
12-07 16:05:09.101 1299-2121/? W/ActivityManager: Spurious death for ProcessRecord{638c7d6 0:com.example.unknown.check_files/u0a57}, curProc for 2975: null
12-07 16:05:09.159 2216-2241/? W/EGL_emulation: eglSurfaceAttrib not implemented
12-07 16:05:09.159 2216-2241/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa1a8e3a0, error=EGL_SUCCESS
12-07 16:05:10.147 3017-3017/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
12-07 16:05:10.148 3017-3017/? D/AndroidRuntime: CheckJNI is ON
12-07 16:05:10.179 3013-3013/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
12-07 16:05:10.181 3013-3013/? D/AndroidRuntime: CheckJNI is ON
12-07 16:05:10.222 3017-3017/? I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
12-07 16:05:10.227 3017-3017/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
12-07 16:05:10.248 3013-3013/? I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
12-07 16:05:10.264 3013-3013/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
12-07 16:05:10.324 3013-3013/? E/memtrack: Couldn't load memtrack module (No such file or directory)
12-07 16:05:10.325 3013-3013/? E/android.os.Debug: failed to load memtrack module: -2
12-07 16:05:10.326 3013-3013/? I/Radio-JNI: register_android_hardware_Radio DONE
12-07 16:05:10.341 3017-3017/? E/memtrack: Couldn't load memtrack module (No such file or directory)
12-07 16:05:10.341 3017-3017/? E/android.os.Debug: failed to load memtrack module: -2
12-07 16:05:10.371 3017-3017/? I/Radio-JNI: register_android_hardware_Radio DONE
12-07 16:05:10.378 3013-3013/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm
12-07 16:05:10.426 1299-2121/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 2975 uid 10057
12-07 16:05:10.426 3013-3013/? D/AndroidRuntime: Shutting down VM
12-07 16:05:10.431 2216-2216/? I/Choreographer: Skipped 71 frames! The application may be doing too much work on its main thread.
12-07 16:05:10.528 3017-3017/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am
12-07 16:05:10.548 1299-2121/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.unknown.check_files/.testing} from uid 0 on display 0
12-07 16:05:10.584 3017-3017/? D/AndroidRuntime: Shutting down VM
12-07 16:05:10.604 1299-1310/? I/ActivityManager: Start proc 3034:com.example.unknown.check_files/u0a57 for activity com.example.unknown.check_files/.testing
12-07 16:05:10.617 3034-3034/? I/art: Not late-enabling -Xcheck:jni (already on)
12-07 16:05:10.617 3034-3034/? I/art: Late-enabling JIT
12-07 16:05:10.684 3034-3034/? I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
12-07 16:05:10.708 3034-3034/? W/System: ClassLoader referenced unknown path: /data/app/com.example.unknown.check_files-1/lib/x86
12-07 16:05:10.823 953-1333/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
12-07 16:05:10.825 3034-3049/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
12-07 16:05:10.861 3034-3045/? I/art: Background sticky concurrent mark sweep GC freed 6483(389KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 9MB/9MB, paused 33.060ms total 81.160ms
12-07 16:05:10.929 3034-3049/? I/OpenGLRenderer: Initialized EGL, version 1.4
12-07 16:05:11.046 3034-3049/? W/EGL_emulation: eglSurfaceAttrib not implemented
12-07 16:05:11.046 3034-3049/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xad72e280, error=EGL_SUCCESS
12-07 16:05:11.355 1299-1322/? I/Choreographer: Skipped 44 frames! The application may be doing too much work on its main thread.
12-07 16:05:11.413 2216-2241/? W/OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
12-07 16:05:11.413 2216-2241/? W/OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
12-07 16:05:11.417 2216-2241/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa38c25b0
12-07 16:05:12.157 1299-1322/? I/ActivityManager: Displayed com.example.unknown.check_files/.testing: +1s576ms
As of Android 5.0, the status bar is colored separately from the ActionBar. Make sure that you haven't set android:statusBarColor to #color/white in your base theme.
More info on Themes and Status Bar coloring here.
If you watch closely, it is not just a white bar. Your status bar color is set to white. You can see all the icons. So change the color by,
Window window = activity.getWindow();
// clear FLAG_TRANSLUCENT_STATUS flag:
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// add FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS flag to the window
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
// finally change the color
window.setStatusBarColor(YOUR_COLOR);
or, in theme, change colorPrimaryDark which will be used as statusbar color.
Note : this method is added in API level 21.
Read more about it here
Related
I am making app which on portrait mode shows fragmentA (containing Listview) and when in Landscape mode, it shows fragmentA and fragmentB(Listview and its corresponding description).It keeps on crashing,my hunch says either there is a fault in if-else condition in MainActivity or problem is in communication pattern.I request Everyone to please Help. Here is my MainActivity.xml
package com.example.prince.fragment_modularui2;
import android.content.Intent;
import android.content.res.Resources;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity implements FragmentA.Communicator{
String s;
Resources r=getResources();
String[] a=r.getStringArray(R.array.descr);
FragmentA fa;
FragmentB fb;
FragmentManager manager;
#Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
manager=getSupportFragmentManager();
//fa always present
fa= (FragmentA) manager.findFragmentById(R.id.fragment);
fb= (FragmentB) manager.findFragmentById(R.id.fragment2);
fa.setCommunicator(this);
}
#Override
public void respond(int data) {
Intent i=new Intent(this,AnotherActivity.class);
i.putExtra("index",data);
startActivity(i);
}
}
here is activity_main.xml in Portrait
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.prince.fragment_modularui2.FragmentA"
android:id="#+id/fragment"
></fragment>
</LinearLayout>
activity_main in landscape
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<fragment
android:id="#+id/fragment"
android:name="com.example.prince.fragment_modularui2.FragmentA"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true" />
<fragment
android:id="#+id/fragment2"
android:name="com.example.prince.fragment_modularui2.FragmentB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true" />
</LinearLayout>
Rest of the code is https://github.com/AlmightyHeathcliff/Fragment_ModularUi2
The stackTrace is
07-18 09:45:09.252 1974-1974/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
07-18 09:45:09.254 1974-1974/? D/AndroidRuntime: CheckJNI is OFF
07-18 09:45:09.289 1974-1974/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:09.301 1974-1974/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
07-18 09:45:09.316 1974-1974/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-18 09:45:09.316 1974-1974/? E/android.os.Debug: failed to load memtrack module: -2
07-18 09:45:09.317 1974-1974/? I/Radio-JNI: register_android_hardware_Radio DONE
07-18 09:45:09.325 1974-1974/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
07-18 09:45:09.330 1974-1974/? I/art: System.exit called, status: 0
07-18 09:45:09.330 1974-1974/? I/AndroidRuntime: VM exiting with result code 0.
07-18 09:45:09.333 1974-1982/? W/MessageQueue: Handler (android.os.Handler) {f6bbfb3} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {f6bbfb3} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:643)
at android.os.Handler.sendMessageAtTime(Handler.java:612)
at android.os.Handler.sendMessageDelayed(Handler.java:582)
at android.os.Handler.post(Handler.java:338)
at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57)
at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)
at android.os.Binder.execTransact(Binder.java:565)
07-18 09:45:09.972 1993-1993/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
07-18 09:45:09.976 1993-1993/? D/AndroidRuntime: CheckJNI is OFF
07-18 09:45:10.012 1993-1993/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:10.015 1993-1993/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
07-18 09:45:10.049 1993-1993/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-18 09:45:10.049 1993-1993/? E/android.os.Debug: failed to load memtrack module: -2
07-18 09:45:10.050 1993-1993/? I/Radio-JNI: register_android_hardware_Radio DONE
07-18 09:45:10.059 1993-1993/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
07-18 09:45:10.064 1993-2001/? W/MessageQueue: Handler (android.os.Handler) {f6bbfb3} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {f6bbfb3} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:643)
at android.os.Handler.sendMessageAtTime(Handler.java:612)
at android.os.Handler.sendMessageDelayed(Handler.java:582)
at android.os.Handler.post(Handler.java:338)
at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57)
at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)
at android.os.Binder.execTransact(Binder.java:565)
07-18 09:45:10.064 1993-1993/? I/art: System.exit called, status: 0
07-18 09:45:10.064 1993-1993/? I/AndroidRuntime: VM exiting with result code 0.
07-18 09:45:13.487 2005-2005/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
07-18 09:45:13.491 2005-2005/? D/AndroidRuntime: CheckJNI is OFF
07-18 09:45:13.569 2005-2005/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:13.575 2005-2005/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
07-18 09:45:13.708 2009-2009/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
07-18 09:45:13.715 2009-2009/? D/AndroidRuntime: CheckJNI is OFF
07-18 09:45:13.760 2005-2005/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-18 09:45:13.760 2005-2005/? E/android.os.Debug: failed to load memtrack module: -2
07-18 09:45:13.761 2005-2005/? I/Radio-JNI: register_android_hardware_Radio DONE
07-18 09:45:13.776 2005-2005/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm
07-18 09:45:13.814 2009-2009/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:13.825 2009-2009/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
07-18 09:45:13.833 2005-2005/? D/AndroidRuntime: Shutting down VM
07-18 09:45:13.839 2005-2019/? W/art: Thread attaching while runtime is shutting down: Binder:2005_2
07-18 09:45:13.839 2005-2019/? I/AndroidRuntime: NOTE: attach of thread 'Binder:2005_2' failed
07-18 09:45:13.891 2009-2009/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-18 09:45:13.891 2009-2009/? E/android.os.Debug: failed to load memtrack module: -2
07-18 09:45:13.892 2009-2009/? I/Radio-JNI: register_android_hardware_Radio DONE
07-18 09:45:13.903 2009-2009/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am
07-18 09:45:13.909 765-1149/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.prince.fragment_modularui2/.MainActivity} from uid 0 on display 0
07-18 09:45:13.919 2009-2009/? D/AndroidRuntime: Shutting down VM
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: returned from zygote!
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: done updating battery stats
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: building log message
07-18 09:45:13.993 765-1021/system_process I/ActivityManager: Start proc 2027:com.example.prince.fragment_modularui2/u0a115 for activity com.example.prince.fragment_modularui2/.MainActivity
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: starting to update pids map
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: done updating pids map
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: done starting proc!
07-18 09:45:14.003 2027-2027/? I/art: Late-enabling -Xcheck:jni
07-18 09:45:14.004 2027-2027/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:14.258 500-757/? D/gralloc_vbox86: gralloc_alloc: format 1 and usage 0x933 imply creation of host color buffer
07-18 09:45:14.784 2027-2027/com.example.prince.fragment_modularui2 W/System: ClassLoader referenced unknown path: /data/app/com.example.prince.fragment_modularui2-1/lib/x86
07-18 09:45:14.813 2027-2027/com.example.prince.fragment_modularui2 I/InstantRun: starting instant run server: is main process
07-18 09:45:14.814 2027-2027/com.example.prince.fragment_modularui2 V/InstantRun: Starting server socket listening for package com.example.prince.fragment_modularui2 on android.net.LocalSocketAddress#8989009
07-18 09:45:14.814 2027-2027/com.example.prince.fragment_modularui2 V/InstantRun: Started server for package com.example.prince.fragment_modularui2
07-18 09:45:14.903 2027-2027/com.example.prince.fragment_modularui2 D/AndroidRuntime: Shutting down VM
07-18 09:45:14.904 2027-2027/com.example.prince.fragment_modularui2 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.prince.fragment_modularui2, PID: 2027
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.prince.fragment_modularui2/com.example.prince.fragment_modularui2.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.content.ContextWrapper.getResources(ContextWrapper.java:86)
at android.view.ContextThemeWrapper.getResourcesInternal(ContextThemeWrapper.java:127)
at android.view.ContextThemeWrapper.getResources(ContextThemeWrapper.java:121)
at android.support.v7.app.AppCompatActivity.getResources(AppCompatActivity.java:549)
at com.example.prince.fragment_modularui2.MainActivity.<init>(MainActivity.java:12)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
07-18 09:45:14.907 765-1021/system_process W/ActivityManager: Force finishing activity com.example.prince.fragment_modularui2/.MainActivity
07-18 09:45:15.031 500-505/? D/gralloc_vbox86: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
07-18 09:45:15.058 500-505/? D/gralloc_vbox86: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
07-18 09:45:15.115 500-505/? D/gralloc_vbox86: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
07-18 09:45:15.232 765-1842/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
07-18 09:45:15.232 765-1842/system_process D/OpenGLRenderer: Swap behavior 1
07-18 09:45:15.429 765-779/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{b0310c2 u0 com.example.prince.fragment_modularui2/.MainActivity t693 f}
07-18 09:45:15.431 765-779/system_process I/ActivityManager: Killing 1353:android.process.media/u0a10 (adj 906): empty #17
07-18 09:45:15.432 765-779/system_process I/WindowManager: Failed to capture screenshot of Token{7756ed3 ActivityRecord{b0310c2 u0 com.example.prince.fragment_modularui2/.MainActivity t693 f}} appWin=Window{7f1e54b u0 Starting com.example.prince.fragment_modularui2} drawState=1
07-18 09:45:15.448 765-786/system_process I/Choreographer: Skipped 70 frames! The application may be doing too much work on its main thread.
07-18 09:45:15.452 765-1150/system_process D/ActivityManager: cleanUpApplicationRecord -- 1353
07-18 09:45:15.456 765-1842/system_process E/EGL_emulation: tid 1842: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
07-18 09:45:15.456 765-1842/system_process W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xc4afa800, error=EGL_BAD_MATCH
07-18 09:45:16.337 765-780/system_process I/Choreographer: Skipped 52 frames! The application may be doing too much work on its main thread.
07-18 09:45:25.438 765-779/system_process W/ActivityManager: Activity destroy timeout for ActivityRecord{b0310c2 u0 com.example.prince.fragment_modularui2/.MainActivity t693 f}
From the stacktrace I gather that you are calling getResources() on a Context that is null. This makes sense because you are declaring your resources as a field like:
Resources res = getResources();
This gets executed before the activity is created but you can only call getResources() once the activity is created. So the solution is to declare your resources like:
private Resources res;
And in your activity onCreate method you do:
res = getResources();
This also means that you can't use the res variable until the onCreate method is executed. Generally it is better to not declare resources as a variable like that but rather declare your string array as:
String[] a;
and then in onCreate just call: a = getResources().getStringArray(R.array.desc);
One other tip I can give you is to name your variable clearer. A string array named 'a' is not very descriptive. You can call it something like descriptionArray to make it more clear.
I have used IntentSerivce to download a large json. I have used Gson and Retrofit2 in the first place. After I have found that Jackson is better for marshaling of large json.
And here problem starts, intentService has been triggered twice even in code is called only once.
I am triggering intentService from splash screen, the orientation of the device is landscape. There are no flipping up/down so I guess that there is no recreation of activity when orientation is changed. Also app is hardcoded to start in landscape orientation.
Here are logs from logCat
I/APPLICATION CLASS: DB FOUND
02-28 10:15:25.034 1561-2108/? I/ActivityManager: START u0 {flg=0x10000000 cmp=aoc.netcast.rs.android_ott_client/.view.SplashScreen} from uid 10073 on display 0
02-28 10:15:25.040 3195-3195/? I/INTENT PERFORMING: Starting intent...
02-28 10:15:25.041 3195-3195/? I/INTENT PERFORMING: Intent started...
02-28 10:15:25.053 1206-1286/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
02-28 10:15:25.062 3195-3210/? W/nAnnotationIntrospector: Unable to load JDK7 annotation types; will have to skip
02-28 10:15:25.074 3195-3195/? I/INTENT PERFORMING: Starting intent...
02-28 10:15:25.074 3195-3195/? I/INTENT PERFORMING: Intent started...
02-28 10:15:25.090 3195-3210/? W/System.err: WARNING: could not load Java7 Path class
02-28 10:15:25.330 1206-1206/? E/SurfaceFlinger: rejecting buffer: bufWidth=1080, bufHeight=1920, front.active.{w=1080, h=1776}
[ 02-28 10:15:25.341 3195: 3209 D/ ]
HostConnection::get() New Host Connection established 0x7fa7db557360, tid 3209
02-28 10:15:25.344 3195-3209/? I/OpenGLRenderer: Initialized EGL, version 1.4
02-28 10:15:25.344 1561-1612/? I/InputReader: Reconfiguring input devices. changes=0x00000004
02-28 10:15:25.344 1561-1612/? I/InputReader: Device reconfigured: id=0, name='qwerty2', size 1080x1920, orientation 1, mode 1, display id 0
02-28 10:15:25.350 1694-2096/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7fa7cf1b1b10
02-28 10:15:25.353 1694-2096/? E/EGL_emulation: tid 2096: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
02-28 10:15:25.353 1694-2096/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fa7ce77fa80, error=EGL_BAD_MATCH
02-28 10:15:25.365 3195-3209/? E/EGL_emulation: tid 3209: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
02-28 10:15:25.365 3195-3209/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fa7db548c40, error=EGL_BAD_MATCH
02-28 10:15:25.367 1694-2096/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7fa7cf1b23d0
02-28 10:15:25.378 1694-2096/? E/EGL_emulation: tid 2096: eglSurfaceAttrib(1165): error 0x3009 (EGL_BAD_MATCH)
02-28 10:15:25.378 1694-2096/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fa7ce77fac0, error=EGL_BAD_MATCH
02-28 10:15:25.449 1561-1580/? I/ActivityManager: Displayed aoc.netcast.rs.android_ott_client/.view.SplashScreen: +390ms (total +578ms)
02-28 10:15:25.458 1561-1580/? I/WindowManager: Screen frozen for +559ms due to Window{85b86c9 u0 aoc.netcast.rs.android_ott_client/aoc.netcast.rs.android_ott_client.view.SplashScreen}
02-28 10:15:27.461 1561-1580/? I/art: Starting a blocking GC Explicit
02-28 10:15:27.471 1561-1580/? I/art: Explicit concurrent mark sweep GC freed 14571(904KB) AllocSpace objects, 3(60KB) LOS objects, 31% free, 8MB/12MB, paused 127us total 9.460ms
02-28 10:15:30.335 1561-2989/? I/AccountManagerService: getTypesVisibleToCaller: isPermitted? true
I don't know why is this happening, can you please help me to solve this?
For some reason when i put the line setSupportActionBar(MyToolBarVariable)... It goes on to my Genymotion Emulator.. But when it opens the app, it says :
Unfourtuanetly "AppName" has Stoped
But if i delete the setSupportActionBar() Everything works fine... Whats the problem here.. Im going to post MainActivity.java file.. If you need to see others please tell me so below. Thanks for helping!
package com.example.amanuel.zoo4;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
setContentView(R.layout.activity_main);
}
}
Here is the LOGCAT When i press the app in my emulator!
04-06 02:09:02.522 652-1011/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.amanuel.zoo4/.MainActivity (has extras)} from uid 10008 on display 0
04-06 02:09:02.721 3360-3360/? I/art: Late-enabling -Xcheck:jni
04-06 02:09:02.762 652-1021/? I/ActivityManager: Start proc 3360:com.example.amanuel.zoo4/u0a63 for activity com.example.amanuel.zoo4/.MainActivity
04-06 02:09:02.815 652-667/? W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.activityPaused(android.os.IBinder) from ActivityManagerService.java:6439 waiters=1 for 136ms
04-06 02:09:02.978 3360-3360/? W/System: ClassLoader referenced unknown path: /data/app/com.example.amanuel.zoo4-2/lib/x86
04-06 02:09:03.170 3360-3360/? D/AndroidRuntime: Shutting down VM
04-06 02:09:03.178 3360-3360/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.amanuel.zoo4, PID: 3360
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.amanuel.zoo4/com.example.amanuel.zoo4.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.support.v7.widget.Toolbar.getTitle()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.support.v7.widget.Toolbar.getTitle()' on a null object reference
at android.support.v7.internal.widget.ToolbarWidgetWrapper.<init>(ToolbarWidgetWrapper.java:94)
at android.support.v7.internal.widget.ToolbarWidgetWrapper.<init>(ToolbarWidgetWrapper.java:87)
at android.support.v7.internal.app.ToolbarActionBar.<init>(ToolbarActionBar.java:77)
at android.support.v7.app.AppCompatDelegateImplV7.setSupportActionBar(AppCompatDelegateImplV7.java:198)
at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:96)
at com.example.amanuel.zoo4.MainActivity.onCreate(MainActivity.java:13)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-06 02:09:03.193 652-1021/? W/ActivityManager: Force finishing activity com.example.amanuel.zoo4/.MainActivity
04-06 02:09:03.500 652-1021/? I/WindowManager: Screenshot max retries 4 of Token{75d8954 ActivityRecord{722f0a7 u0 com.example.amanuel.zoo4/.MainActivity t42 f}} appWin=Window{450aeec u0 Starting com.example.amanuel.zoo4} drawState=1
04-06 02:09:03.514 652-652/? W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.crashApplication(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo) from ActivityManagerService.java:12502 waiters=0 for 299ms
04-06 02:09:03.639 652-666/? W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.crashApplication(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo) from ActivityManagerService.java:12502 waiters=1 for 216ms
04-06 02:09:03.640 652-652/? W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService$UiHandler.handleMessage(android.os.Message) from ActivityManagerService.java:1397 waiters=1 for 111ms
04-06 02:09:03.814 652-1641/? I/OpenGLRenderer: Initialized EGL, version 1.4
04-06 02:09:04.021 652-666/? W/ActivityManager: Activity pause timeout for ActivityRecord{722f0a7 u0 com.example.amanuel.zoo4/.MainActivity t42 f}
04-06 02:09:04.129 652-1641/? W/EGL_emulation: eglSurfaceAttrib not implemented
04-06 02:09:04.130 652-1641/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd60610a0, error=EGL_SUCCESS
04-06 02:09:04.198 652-667/? I/Choreographer: Skipped 32 frames! The application may be doing too much work on its main thread.
04-06 02:09:04.303 652-981/? I/ActivityManager: Killing 1792:com.android.keychain/1000 (adj 15): empty for 3078s
04-06 02:09:04.763 652-668/? E/BluetoothAdapter: Bluetooth binder is null
04-06 02:09:04.825 652-667/? I/Choreographer: Skipped 37 frames! The application may be doing too much work on its main thread.
04-06 02:09:07.697 3360-3360/? I/Process: Sending signal. PID: 3360 SIG: 9
04-06 02:09:07.732 652-679/? I/ActivityManager: Process com.example.amanuel.zoo4 (pid 3360) has died
04-06 02:09:07.771 652-1641/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xde8f0df0
04-06 02:09:07.844 652-1641/? D/OpenGLRenderer: endAllStagingAnimators on 0xda3b2380 (RippleDrawable) with handle 0xdc57f670
04-06 02:09:07.852 652-652/? W/art: Long monitor contention event with owner method=void android.view.WindowManagerGlobal.removeView(android.view.View, boolean) from WindowManagerGlobal.java:349 waiters=0 for 102ms
04-06 02:09:07.854 652-1164/? W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#bc8dc8f attribute=null, token = android.os.BinderProxy#4b639cb
04-06 02:09:08.200 652-671/? W/AppOps: Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
04-06 02:09:12.630 308-647/? W/AudioFlinger: write blocked for 9842 msecs, 14 delayed writes, thread 0xf1e00000
04-06 02:09:18.081 100-100/? D/Genyd: Received Set Clipboard
04-06 02:09:18.081 100-100/? D/Genymotion: Received Set Clipboard
Try putting setContentView(R.layout.activity_main); before trying to instantiate the Toolbar.
I'm having some problems trying to install APKs in a specific device. I have lots of devices and it hadn't happened so far (all of them, Radxa Rock Pro).
When I run pm install myApp I get
root#radxaPro:/ # pm install /sdcard/myApp.apk
pkg: /sdcard/myApp.apk
Failure [INSTALL_FAILED_INTERNAL_ERROR]
Logcat output:
06-02 13:02:33.032 I/AndroidRuntime( 4469): JNI options: '-Xjniopts:warnonly'
06-02 13:02:33.042 D/dalvikvm( 4469): Trying to load lib libjavacore.so 0x0
06-02 13:02:33.042 D/dalvikvm( 4469): Added shared lib libjavacore.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): Trying to load lib libnativehelper.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): Added shared lib libnativehelper.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
06-02 13:02:33.082 D/dalvikvm( 4469): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
06-02 13:02:33.232 E/memtrack( 4469): Couldn't load memtrack module (No such file or directory)
06-02 13:02:33.232 E/android.os.Debug( 4469): failed to load memtrack module: -2
06-02 13:02:33.282 D/AndroidRuntime( 4469): Calling main entry com.android.commands.pm.Pm
06-02 13:02:33.292 W/ActivityManager( 474): Unable to start service Intent { cmp=com.android.defcontainer/.DefaultContainerService } U=0: not found
06-02 13:02:33.292 E/PackageManager( 474): Failed to bind to media container service
I think the most important line is Unable to start service Intent { cmp=com.android.defcontainer/.DefaultContainerService } U=0: not found because a successful installation shows this (another device):
06-02 13:04:35.747: I/AndroidRuntime(1005): JNI options: '-Xjniopts:warnonly'
06-02 13:04:35.757: D/dalvikvm(1005): Trying to load lib libjavacore.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Added shared lib libjavacore.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Trying to load lib libnativehelper.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Added shared lib libnativehelper.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
06-02 13:04:35.797: D/dalvikvm(1005): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
06-02 13:04:35.927: E/memtrack(1005): Couldn't load memtrack module (No such file or directory)
06-02 13:04:35.927: E/android.os.Debug(1005): failed to load memtrack module: -2
06-02 13:04:35.977: D/AndroidRuntime(1005): Calling main entry com.android.commands.pm.Pm
06-02 13:04:35.987: I/ActivityManager(478): Start proc com.android.defcontainer for service com.android.defcontainer/.DefaultContainerService: pid=1016 uid=10001 gids={50001, 1028, 1015, 1023, 2001, 1035}
The DefaultContainerService.apk is located in /system/priv-app/ but I have been able to check that it is not actually installed in that device. If I try to install it, I get the same error.
Does anyone have an idea? Is the Android system corrupt?
Thanks in advance.
I try to use Android Videoview to play a video in my sdcard. And it play next video in my sdcard if the sdcard have several videos. But neither in my emulator or my smartphone the app work.
I already add the permission
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
and a video to my sdcard.
Following is my code,
package com.example.videotest;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle ;
import android.provider.MediaStore.Video;
import android.app.Activity;
import android.database.Cursor;
import android.view.Menu;
import android.widget.Toast;
import android.widget.VideoView;
public class MainActivity extends Activity implements OnCompletionListener{
Cursor mediaCursor=null;
VideoView videoView=null;
int dataIdx=0;
#Override
public void onCompletion(MediaPlayer arg0) {
// TODO Auto-generated method stub
playNextVideo();
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VideoView videoView=(VideoView) findViewById(R.id.videoView1);
videoView.setOnCompletionListener((OnCompletionListener) this);
String projection[]=new String[] {Video.Media.DATA};
mediaCursor=getContentResolver().query(Video.Media.EXTERNAL_CONTENT_URI, projection, null, null, null);
if(mediaCursor!=null&&mediaCursor.getCount()>0){
dataIdx=mediaCursor.getColumnIndex(Video.Media.DATA);
playNextVideo();
}
}
private void playNextVideo(){
mediaCursor.moveToNext();
if(mediaCursor.isAfterLast()){
Toast.makeText(getApplicationContext(),"End of Line",Toast.LENGTH_SHORT).show();
}
else{
String path=mediaCursor.getString(dataIdx);
Toast.makeText(getApplicationContext(),"playing: "+path, Toast.LENGTH_SHORT).show();
videoView.setVideoPath(path);
videoView.start();
}
}
#Override
public void onDestroy(){
if (mediaCursor!=null){
mediaCursor.close();
}
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
01-29 10:43:39.186: W/WindowManager(161): Failure taking screenshot for (246x410) to layer 21015
01-29 10:43:39.256: I/Choreographer(429): Skipped 32 frames! The application may be doing too much work on its main thread.
01-29 10:43:39.535: I/Choreographer(429): Skipped 59 frames! The application may be doing too much work on its main thread.
01-29 10:44:03.995: D/AndroidRuntime(1345): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
01-29 10:44:03.995: D/AndroidRuntime(1345): CheckJNI is ON
01-29 10:44:04.035: D/dalvikvm(1345): Trying to load lib libjavacore.so 0x0
01-29 10:44:04.045: D/dalvikvm(1345): Added shared lib libjavacore.so 0x0
01-29 10:44:04.075: D/dalvikvm(1345): Trying to load lib libnativehelper.so 0x0
01-29 10:44:04.075: D/dalvikvm(1345): Added shared lib libnativehelper.so 0x0
01-29 10:44:04.895: D/AndroidRuntime(1345): Calling main entry com.android.commands.pm.Pm
01-29 10:44:04.965: W/ActivityManager(161): No content provider found for permission revoke: file:///data/local/tmp/VideoTEST.apk
01-29 10:44:04.985: W/ActivityManager(161): No content provider found for permission revoke: file:///data/local/tmp/VideoTEST.apk
01-29 10:44:05.266: D/dalvikvm(161): GC_CONCURRENT freed 550K, 45% free 10453K/18887K, paused 19ms+27ms, total 148ms
01-29 10:44:05.326: I/PackageManager(161): Removing non-system package:com.example.videotest
01-29 10:44:05.326: I/ActivityManager(161): Force stopping package com.example.videotest uid=10044
01-29 10:44:05.326: I/ActivityManager(161): Killing proc 1282:com.example.videotest/u0a44: force stop
01-29 10:44:05.326: W/ActivityManager(161): Force removing ActivityRecord{416c3d88 com.example.videotest/.MainActivity}: app died, no saved state
01-29 10:44:05.376: W/InputDispatcher(161): channel '416195c8 com.example.videotest/com.example.videotest.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
01-29 10:44:05.376: E/InputDispatcher(161): channel '416195c8 com.example.videotest/com.example.videotest.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-29 10:44:05.386: I/WindowState(161): WIN DEATH: Window{416195c8 com.example.videotest/com.example.videotest.MainActivity paused=false}
01-29 10:44:05.386: W/InputDispatcher(161): Attempted to unregister already unregistered input channel '416195c8 com.example.videotest/com.example.videotest.MainActivity (server)'
01-29 10:44:05.386: W/WindowManager(161): Force-removing child win Window{4167b698 SurfaceView paused=false} from container Window{416195c8 com.example.videotest/com.example.videotest.MainActivity paused=false}
01-29 10:44:05.426: W/WindowManager(161): Failed looking up window
01-29 10:44:05.426: W/WindowManager(161): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy#4161c220 does not exist
01-29 10:44:05.426: W/WindowManager(161): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7640)
01-29 10:44:05.426: W/WindowManager(161): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7631)
01-29 10:44:05.426: W/WindowManager(161): at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:854)
01-29 10:44:05.426: W/WindowManager(161): at android.os.BinderProxy.sendDeathNotice(Binder.java:449)
01-29 10:44:05.426: W/WindowManager(161): at dalvik.system.NativeStart.run(Native Method)
01-29 10:44:05.426: I/WindowState(161): WIN DEATH: null
01-29 10:44:05.426: I/WindowManager(161): WINDOW DIED Window{416195c8 co m.example.videotest/com.example.videotest.MainActivity paused=false}
01-29 10:44:05.666: W/InputMethodManagerService(161): Got RemoteException sending setActive(false) notification to pid 1282 uid 10044
01-29 10:44:06.095: I/PackageManager(161): Package com.example.videotest codePath changed from /data/app/com.example.videotest-1.apk to /data/app/com.example.videotest-2.apk; Retaining data and using new
01-29 10:44:06.095: I/PackageManager(161): Running dexopt on: com.example.videotest
01-29 10:44:06.965: D/dalvikvm(1356): DexOpt: load 131ms, verify+opt 486ms, 745428 bytes
01-29 10:44:06.986: I/ActivityManager(161): Force stopping package com.example.videotest uid=10044
01-29 10:44:06.995: W/PackageManager(161): Code path for pkg : com.example.videotest changing from /data/app/com.example.videotest-1.apk to /data/app/com.example.videotest-2.apk
01-29 10:44:06.995: W/PackageManager(161): Resource path for pkg : com.example.videotest changing from /data/app/com.example.videotest-1.apk to /data/app/com.example.videotest-2.apk
01-29 10:44:07.115: D/PackageManager(161): New package installed in /data/app/com.example.videotest-2.apk
01-29 10:44:07.236: I/ActivityManager(161): Force stopping package com.example.videotest uid=10044
01-29 10:44:07.246: D/dalvikvm(429): WAIT_FOR_CONCURRENT_GC blocked 0ms
01-29 10:44:07.286: D/dalvikvm(616): WAIT_FOR_CONCURRENT_GC blocked 0ms
01-29 10:44:07.436: D/dalvikvm(429): GC_EXPLICIT freed 10435K, 60% free 8931K/21831K, paused 11ms+23ms, total 186ms
01-29 10:44:07.446: D/dalvikvm(540): WAIT_FOR_CONCURRENT_GC blocked 0ms
01-29 10:44:07.466: D/dalvikvm(616): GC_EXPLICIT freed 4569K, 37% free 10401K/16455K, paused 7ms+33ms, total 179ms
01-29 10:44:07.666: I/InputReader(161): Reconfiguring input devices. changes=0x00000010
01-29 10:44:07.676: D/PackageManager(161): generateServicesMap(android.accounts.AccountAuthenticator): 2 services unchanged
01-29 10:44:07.686: D/dalvikvm(540): GC_EXPLICIT freed 86K, 7% free 8394K/8967K, paused 12ms+8ms, total 218ms
01-29 10:44:07.745: I/AccountTypeManager(710): Loaded meta-data for 1 account types, 0 accounts in 63ms(wall) 6ms(cpu)
01-29 10:44:07.745: D/PackageManager(161): generateServicesMap(android.content.SyncAdapter): 4 services unchanged
01-29 10:44:07.755: D/BackupManagerService(161): Received broadcast Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:com.example.videotest flg=0x8000010 (has extras) }
01-29 10:44:07.865: D/dalvikvm(161): GC_CONCURRENT freed 564K, 45% free 10429K/18887K, paused 53ms+13ms, total 188ms
01-29 10:44:07.865: D/dalvikvm(161): WAIT_FOR_CONCURRENT_GC blocked 109ms
01-29 10:44:08.035: D/dalvikvm(161): GC_EXPLICIT freed 61K, 46% free 10369K/18887K, paused 13ms+29ms, total 166ms
01-29 10:44:08.135: I/ActivityManager(161): Start proc com.android.keychain for broadcast com.android.keychain/.KeyChainBroadcastReceiver: pid=1357 uid=1000 gids={1015, 3002, 3001, 3003, 1028}
01-29 10:44:08.226: D/PackageManager(161): generateServicesMap(android.accounts.AccountAuthenticator): 2 services unchanged
01-29 10:44:08.256: D/PackageManager(161): generateServicesMap(android.content.SyncAdapter): 4 services unchanged
01-29 10:44:08.285: I/InputReader(161): Reconfiguring input devices. changes=0x00000010
01-29 10:44:08.296: D/BackupManagerService(161): Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.example.videotest flg=0x8000010 (has extras) }
01-29 10:44:08.296: V/BackupManagerService(161): removePackageParticipantsLocked: uid=10044 #1
01-29 10:44:08.515: V/BackupManagerService(161): addPackageParticipantsLocked: #1
01-29 10:44:08.556: W/InputMethodManagerService(161): Found no subtypes in a system IME: com.android.inputmethod.pinyin
01-29 10:44:08.586: E/Trace(1357): error opening trace file: No such file or directory (2)
01-29 10:44:08.686: I/AccountTypeManager(710): Loaded meta-data for 1 account types, 0 accounts in 9ms(wall) 5ms(cpu)
01-29 10:44:08.796: D/dalvikvm(161): WAIT_FOR_CONCURRENT_GC blocked 0ms
01-29 10:44:08.975: W/RecognitionManagerService(161): no available voice recognition services found
01-29 10:44:09.146: D/dalvikvm(161): GC_EXPLICIT freed 367K, 45% free 10413K/18887K, paused 57ms+22ms, total 355ms
01-29 10:44:09.186: D/AndroidRuntime(1345): Shutting down VM
01-29 10:44:09.196: D/dalvikvm(1345): GC_CONCURRENT freed 101K, 78% free 458K/2048K, paused 1ms+2ms, total 12ms
01-29 10:44:09.206: D/jdwp(1345): Got wake-up signal, bailing out of select
01-29 10:44:09.206: D/dalvikvm(1345): Debugger has detached; object registry had 1 entries
01-29 10:44:09.206: I/AndroidRuntime(1345): NOTE: attach of thread 'Binder_3' failed
01-29 10:44:10.085: D/AndroidRuntime(1377): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
01-29 10:44:10.085: D/AndroidRuntime(1377): CheckJNI is ON
01-29 10:44:10.176: D/dalvikvm(1377): Trying to load lib libjavacore.so 0x0
01-29 10:44:10.186: D/dalvikvm(1377): Added shared lib libjavacore.so 0x0
01-29 10:44:10.246: D/dalvikvm(1377): Trying to load lib libnativehelper.so 0x0
01-29 10:44:10.246: D/dalvikvm(1377): Added shared lib libnativehelper.so 0x0
01-29 10:44:11.126: D/AndroidRuntime(1377): Calling main entry com.an droid.commands.am.Am
01-29 10:44:11.156: I/ActivityManager(161): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.videotest/.MainActivity u=0} from pid 1377
01-29 10:44:11.186: W/WindowManager(161): Failure taking screenshot for (246x410) to layer 21005
01-29 10:44:11.226: D/AndroidRuntime(1377): Shutting down VM
01-29 10:44:11.246: I/AndroidRuntime(1377): NOTE: attach of thread 'Binder_3' failed
01-29 10:44:11.246: D/dalvikvm(1377): GC_CONCURRENT freed 102K, 77% free 489K/2048K, paused 11ms+1ms, total 23ms
01-29 10:44:11.256: D/jdwp(1377): Got wake-up signal, bailing out of select
01-29 10:44:11.256: D/dalvikvm(1377): Debugger has detached; object registry had 1 entries
01-29 10:44:11.266: D/dalvikvm(1388): Not late-enabling CheckJNI (already on)
01-29 10:44:11.286: I/ActivityManager(161): Start proc com.example.videotest for activity com.example.videotest/.MainActivity: pid=1388 uid=10044 gids={1015, 1028}
01-29 10:44:11.705: E/Trace(1388): error opening trace file: No such file or directory (2)
01-29 10:44:12.256: D/dalvikvm(161): WAIT_FOR_CONCURRENT_GC blocked 0ms
01-29 10:44:12.406: D/dalvikvm(161): GC_EXPLICIT freed 110K, 45% free 10473K/18887K, paused 10ms+12ms, total 157ms
01-29 10:44:12.606: I/Choreographer(1388): Skipped 38 frames! The application may be doing too much work on its main thread.
01-29 10:44:12.685: D/gralloc_goldfish(1388): Emulator without GPU emulation detected.
01-29 10:44:12.755: I/ActivityManager(161): Displayed com.example.videotest/.MainActivity: +1s541ms
01-29 10:44:13.146: I/Choreographer(1388): Skipped 92 frames! The application may be doing too much work on its main thread.
01-29 10:48:55.096: E/ThrottleService(161): problem during onPollAlarm: java.lang.IllegalStateException: problem parsing stats: java.io.FileNotFoundException: /proc/net/xt_qtaguid/iface_stat_all: open failed: ENOENT (No such file or directory)
01-29 10:50:28.105: D/dalvikvm(457): GC_CONCURRENT freed 403K, 7% free 8578K/9159K, paused 17ms+4ms, total 57ms
In your onCreate() method
This line
VideoView videoView=(VideoView) findViewById(R.id.videoView1);
Should be
videoView=(VideoView) findViewById(R.id.videoView1);