시계 앱위젯 개발 중인데요. 시간을 Calendar로 받아서 비트맵으로 변환해서 보여주는 앱위젯입니다. 그런데 이게 잘 작동하다가 한 30분쯤 지나면 멈춰버리네요. 메모리 문제인거 같은데, 아무튼 다음 코드는 문제가 있는 것으로 짐작되는 Broadcastreceiver 부분입니다. 고수님들의 조언을 부탁드립니다.
BroadcastReceiver mTime = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if(action.equals(Intent.ACTION_TIME_TICK)){
updateTime(); // 따로 함수정의를 하여 시간을 구하는 함수입니다.
RemoteViews views = new RemoteViews(context.getPackageName(),R.layout.hclockwidget_layout);
//(int)((74*(float)widgetWidth-2)*deviceDensity/160), (int)((100*(float)widgetHeight-2)*deviceDensity/160)
//다음에 비트맵과 캔버스를 새로 생성하는데 제 생각엔 여기서 문제가 일어나는 것 같아요.
Bitmap bitmap = Bitmap.createBitmap(100*widgetWidth,100*widgetHeight, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
canvas.drawARGB(backgroundA, backgroundR, backgroundG, backgroundB);
drawData(canvas, drawingOrder); // 따로 정의한 함수입니다. 내부적으로 canvas.drawtext함수를 사용합니다.
views.setImageViewBitmap(R.id.imgview, bitmap);
AppWidgetManager wm = AppWidgetManager.getInstance(hGetTime.this);
ComponentName widget;
//다음 switch 구문은 앱위젯 크기에 따라 componentName을 지정해주는 부분입니다.
switch((widgetHeight*10)+widgetWidth){
case 11 :
widget = new ComponentName(context,hClockWidget11.class);
break;
case 12 :
widget = new ComponentName(context,hClockWidget12.class);
break;
case 13 :
widget = new ComponentName(context,hClockWidget13.class);
break;
case 14 :
widget = new ComponentName(context,hClockWidget14.class);
break;
case 21 :
widget = new ComponentName(context,hClockWidget21.class);
break;
case 22 :
widget = new ComponentName(context,hClockWidget22.class);
break;
case 23 :
widget = new ComponentName(context,hClockWidget23.class);
break;
case 24 :
widget = new ComponentName(context,hClockWidget24.class);
break;
case 31 :
widget = new ComponentName(context,hClockWidget31.class);
break;
case 32 :
widget = new ComponentName(context,hClockWidget32.class);
break;
case 33 :
widget = new ComponentName(context,hClockWidget33.class);
break;
case 34 :
widget = new ComponentName(context,hClockWidget34.class);
break;
case 41 :
widget = new ComponentName(context,hClockWidget41.class);
break;
case 42 :
widget = new ComponentName(context,hClockWidget42.class);
break;
case 43 :
widget = new ComponentName(context,hClockWidget43.class);
break;
case 44 :
widget = new ComponentName(context,hClockWidget44.class);
break;
default :
widget = new ComponentName(context,hClockWidget11.class);
}
wm.updateAppWidget(widget, views);
}
}
};
전공이 아닌 야매 개발자라 안드로이드가 어떻게 돌아가는지 잘 모르겠네요. 부탁드립니다. (__)
답변 정말 감사합니다. 다음은 에러 메세지 입니다. 실장비에서 테스트 하는데.. 이게 에러가 언제 뜨는지 모르고 한 2시간 쯤 기다리다가 장비 화면을 한번 껐다 켜니 위젯이 먹통되는 현상과 함께 다음 에러메시지를 얻었습니다. 제 앱이름은 hodol_clockwidget 이고요. 실장비라서 다른 프로세스 로그도 같이 있네요. 에러 관련 로그라고 생각되는 부분은 붉은 색으로 작성했습니다. 지도 좀 부탁드립니다. (아우, 게릴라성 에러 이거 사람 잡네요......)
?:??: W/?(?): Start proc com.btb.minihompy for broadcast com.btb.minihompy/com.nate.android.cyworld.polling.AlarmReceiver: pid=8279 uid=10087 gids={3003, 1015, 1028}
?:??: W/?(?): [ 08-18 11:48:43.500 8279: 8279 I/dalvikvm ]
?:??: W/?(?): Turning on JNI app bug workarounds for target SDK version 6...
?:??: W/?(?): [ 08-18 11:48:43.578 8279: 8280 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 159K, 2% free 11125K/11335K, paused 3ms+2ms, total 19ms
?:??: W/?(?): [ 08-18 11:48:43.578 8279: 8279 D/dalvikvm ]
?:??: W/?(?): WAIT_FOR_CONCURRENT_GC blocked 9ms
?:??: W/?(?): [ 08-18 11:48:43.632 307: 458 I/ActivityManager ]
?:??: W/?(?): No longer want hodol.clockwidget (pid 8147): hidden #16
?:??: W/?(?): [ 08-18 11:48:43.640 307: 891 W/ActivityManager ]
?:??: W/?(?): Scheduling restart of crashed service hodol.clockwidget/.hGetTime in 5000ms
?:??: W/?(?): [ 08-18 11:48:47.640 1117: 1119 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 1094K, 50% free 15024K/29895K, paused 19ms+11ms, total 85ms
?:??: W/?(?): [ 08-18 11:48:48.656 8295: 8295 D/dalvikvm ]
?:??: W/?(?): Late-enabling CheckJNI
?:??: W/?(?): [ 08-18 11:48:48.656 307: 321 I/ActivityManager ]
?:??: W/?(?): Start proc hodol.clockwidget for service hodol.clockwidget/.hGetTime: pid=8295 uid=10054 gids={1028}
?:??: W/?(?): [ 08-18 11:48:48.671 8295: 8295 I/dalvikvm ]
?:??: W/?(?): Turning on JNI app bug workarounds for target SDK version 8...
?:??: W/?(?): [ 08-18 11:48:48.695 8295: 8301 E/jdwp ]
?:??: W/?(?): Failed sending reply to debugger: Broken pipe
?:??: W/?(?): [ 08-18 11:48:48.695 8295: 8301 D/dalvikvm ]
?:??: W/?(?): Debugger has detached; object registry had 1 entries
?:??: W/?(?): [ 08-18 11:48:48.710 8295: 8295 D/AndroidRuntime ]
?:??: W/?(?): Shutting down VM
?:??: W/?(?): [ 08-18 11:48:48.710 8295: 8295 W/dalvikvm ]
?:??: W/?(?): threadid=1: thread exiting with uncaught exception (group=0x40c55300)
?:??: W/?(?): [ 08-18 11:48:48.710 8295: 8295 E/AndroidRuntime ]
?:??: W/?(?): FATAL EXCEPTION: main
?:??: W/?(?): java.lang.RuntimeException: Unable to start service hodol.clockwidget.hGetTime@416eb4c8 with null: java.lang.NullPointerException
?:??: W/?(?): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2507)
?:??: W/?(?): at android.app.ActivityThread.access$1900(ActivityThread.java:130)
?:??: W/?(?): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
?:??: W/?(?): at android.os.Handler.dispatchMessage(Handler.java:99)
?:??: W/?(?): at android.os.Looper.loop(Looper.java:137)
?:??: W/?(?): at android.app.ActivityThread.main(ActivityThread.java:4745)
?:??: W/?(?): at java.lang.reflect.Method.invokeNative(Native Method)
?:??: W/?(?): at java.lang.reflect.Method.invoke(Method.java:511)
?:??: W/?(?): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
?:??: W/?(?): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
?:??: W/?(?): at dalvik.system.NativeStart.main(Native Method)
?:??: W/?(?): Caused by: java.lang.NullPointerException
?:??: W/?(?): at hodol.clockwidget.hGetTime.onStartCommand(hGetTime.java:30)
?:??: W/?(?): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
?:??: W/?(?): ... 10 more
?:??: W/?(?): [ 08-18 11:48:58.500 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: Trying to associate with 78:28:09:0d:35:38 (SSID='4F-407H0' freq=2412 MHz)
?:??: W/?(?): [ 08-18 11:48:58.781 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: Associated with 78:28:09:0d:35:38
?:??: W/?(?): [ 08-18 11:48:58.781 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: CTRL-EVENT-CONNECTED - Connection to 78:28:09:0d:35:38 completed (reauth) [id=7 id_str=]
?:??: W/?(?): [ 08-18 11:49:00.132 307: 309 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 2357K, 25% free 22538K/29703K, paused 4ms+10ms, total 99ms
?:??: W/?(?): [ 08-18 11:49:08.687 307: 321 W/ActivityManager ]
?:??: W/?(?): Timeout executing service: ServiceRecord{421e0f68 hodol.clockwidget/.hGetTime}
?:??: W/?(?): [ 08-18 11:49:08.687 307: 321 I/ActivityManager ]
?:??: W/?(?): Crashing app skipping ANR: ProcessRecord{41ce2288 8295:hodol.clockwidget/u0a54} Executing service hodol.clockwidget/.hGetTime
?:??: W/?(?): [ 08-18 11:49:20.796 477: 477 D/dalvikvm ]
?:??: W/?(?): GC_FOR_ALLOC freed 12302K, 54% free 10847K/23367K, paused 16ms, total 16ms
?:??: W/?(?): [ 08-18 11:49:20.796 477: 477 I/dalvikvm-heap ]
?:??: W/?(?): Grow heap (frag case) to 19.428MB for 9216016-byte allocation
?:??: W/?(?): [ 08-18 11:49:20.828 477: 479 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed <1K, 16% free 19847K/23367K, paused 12ms+3ms, total 28ms
?:??: W/?(?): [ 08-18 11:49:21.125 477: 477 D/dalvikvm ]
?:??: W/?(?): GC_FOR_ALLOC freed 33K, 16% free 19847K/23367K, paused 9ms, total 10ms
?:??: W/?(?): [ 08-18 11:49:21.125 477: 477 I/dalvikvm-heap ]
?:??: W/?(?): Grow heap (frag case) to 22.556MB for 3279376-byte allocation
?:??: W/?(?): [ 08-18 11:49:21.148 477: 479 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed <1K, 2% free 23050K/23367K, paused 11ms+2ms, total 23ms
?:??: W/?(?): [ 08-18 11:49:29.351 307: 8308 E/DhcpStateMachine ]
?:??: W/?(?): DHCP failed on wlan0: Timed out waiting for DHCP to finish
?:??: W/?(?): [ 08-18 11:49:29.585 307: 374 E/WifiStateMachine ]
?:??: W/?(?): IP configuration failed
?:??: W/?(?): [ 08-18 11:49:29.609 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0
?:??: W/?(?): [ 08-18 11:49:29.617 120: 276 D/CommandListener ]
?:??: W/?(?): Clearing all IP addresses on wlan0
?:??: W/?(?): [ 08-18 11:49:29.625 307: 376 D/ConnectivityService ]
?:??: W/?(?): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
?:??: W/?(?): [ 08-18 11:49:29.632 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to mobile
?:??: W/?(?): [ 08-18 11:49:29.632 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to BLUETOOTH_TETHER
?:??: W/?(?): [ 08-18 11:49:29.632 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to ETHERNET
?:??: W/?(?): [ 08-18 11:49:29.632 307: 376 D/ConnectivityService ]
?:??: W/?(?): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
?:??: W/?(?): [ 08-18 11:49:29.632 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to mobile
?:??: W/?(?): [ 08-18 11:49:29.640 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to BLUETOOTH_TETHER
?:??: W/?(?): [ 08-18 11:49:29.640 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to ETHERNET
?:??: W/?(?): [ 08-18 11:49:30.531 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: Trying to associate with 78:28:09:0d:35:38 (SSID='4F-407H0' freq=2412 MHz)
?:??: W/?(?): [ 08-18 11:49:30.820 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: Associated with 78:28:09:0d:35:38
?:??: W/?(?): [ 08-18 11:49:30.820 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: CTRL-EVENT-CONNECTED - Connection to 78:28:09:0d:35:38 completed (reauth) [id=7 id_str=]
?:??: W/?(?): [ 08-18 11:49:32.640 307: 378 D/Tethering ]
?:??: W/?(?): MasterInitialState.processMessage what=3
?:??: W/?(?): [ 08-18 11:49:32.656 307: 378 D/Tethering ]
?:??: W/?(?): MasterInitialState.processMessage what=3
?:??: W/?(?): [ 08-18 11:49:32.687 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:49:32.687 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:49:32.726 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:49:32.726 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:49:32.859 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:49:32.859 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:49:32.882 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:49:32.882 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:49:33.914 8079: 8081 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 435K, 5% free 11049K/11591K, paused 12ms+2ms, total 37ms
?:??: W/?(?): [ 08-18 11:50:01.382 307: 8316 E/DhcpStateMachine ]
?:??: W/?(?): DHCP failed on wlan0: Timed out waiting for DHCP to finish
?:??: W/?(?): [ 08-18 11:50:01.617 307: 374 E/WifiStateMachine ]
?:??: W/?(?): IP configuration failed
?:??: W/?(?): [ 08-18 11:50:01.648 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0
?:??: W/?(?): [ 08-18 11:50:01.656 120: 276 D/CommandListener ]
?:??: W/?(?): Clearing all IP addresses on wlan0
?:??: W/?(?): [ 08-18 11:50:01.664 307: 376 D/ConnectivityService ]
?:??: W/?(?): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
?:??: W/?(?): [ 08-18 11:50:01.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to mobile
?:??: W/?(?): [ 08-18 11:50:01.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to BLUETOOTH_TETHER
?:??: W/?(?): [ 08-18 11:50:01.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to ETHERNET
?:??: W/?(?): [ 08-18 11:50:01.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
?:??: W/?(?): [ 08-18 11:50:01.687 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to mobile
?:??: W/?(?): [ 08-18 11:50:01.687 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to BLUETOOTH_TETHER
?:??: W/?(?): [ 08-18 11:50:01.687 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to ETHERNET
?:??: W/?(?): [ 08-18 11:50:01.718 516: 518 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 405K, 5% free 11352K/11911K, paused 13ms+3ms, total 48ms
?:??: W/?(?): [ 08-18 11:50:02.570 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: Trying to associate with 78:28:09:0d:35:38 (SSID='4F-407H0' freq=2412 MHz)
?:??: W/?(?): [ 08-18 11:50:02.843 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: Associated with 78:28:09:0d:35:38
?:??: W/?(?): [ 08-18 11:50:02.843 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: CTRL-EVENT-CONNECTED - Connection to 78:28:09:0d:35:38 completed (reauth) [id=7 id_str=]
?:??: W/?(?): [ 08-18 11:50:04.679 307: 378 D/Tethering ]
?:??: W/?(?): MasterInitialState.processMessage what=3
?:??: W/?(?): [ 08-18 11:50:04.703 307: 378 D/Tethering ]
?:??: W/?(?): MasterInitialState.processMessage what=3
?:??: W/?(?): [ 08-18 11:50:04.726 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:50:04.726 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:50:04.773 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:50:04.773 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:50:04.875 1117: 1119 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 1572K, 51% free 14870K/29895K, paused 25ms+4ms, total 107ms
?:??: W/?(?): [ 08-18 11:50:04.875 1117: 1117 D/dalvikvm ]
?:??: W/?(?): WAIT_FOR_CONCURRENT_GC blocked 74ms
?:??: W/?(?): [ 08-18 11:50:04.906 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:50:04.906 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:50:04.929 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:50:04.929 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:50:05.046 307: 309 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 1981K, 25% free 22521K/29703K, paused 13ms+6ms, total 93ms
?:??: W/?(?): [ 08-18 11:50:22.843 477: 477 D/dalvikvm ]
?:??: W/?(?): GC_FOR_ALLOC freed 12301K, 54% free 10847K/23367K, paused 16ms, total 16ms
?:??: W/?(?): [ 08-18 11:50:22.851 477: 477 I/dalvikvm-heap ]
?:??: W/?(?): Grow heap (frag case) to 13.767MB for 3279376-byte allocation
?:??: W/?(?): [ 08-18 11:50:22.867 477: 479 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed <1K, 40% free 14050K/23367K, paused 2ms+3ms, total 18ms
?:??: W/?(?): [ 08-18 11:50:22.953 477: 477 D/dalvikvm ]
?:??: W/?(?): GC_FOR_ALLOC freed 32K, 40% free 14050K/23367K, paused 9ms, total 10ms
?:??: W/?(?): [ 08-18 11:50:22.960 477: 477 I/dalvikvm-heap ]
?:??: W/?(?): Grow heap (frag case) to 16.894MB for 3279376-byte allocation
?:??: W/?(?): [ 08-18 11:50:22.968 477: 479 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed <1K, 27% free 17252K/23367K, paused 2ms+1ms, total 12ms
?:??: W/?(?): [ 08-18 11:50:33.390 307: 8332 E/DhcpStateMachine ]
?:??: W/?(?): DHCP failed on wlan0: Timed out waiting for DHCP to finish
?:??: W/?(?): [ 08-18 11:50:33.625 307: 374 E/WifiStateMachine ]
?:??: W/?(?): IP configuration failed
?:??: W/?(?): [ 08-18 11:50:33.648 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0
?:??: W/?(?): [ 08-18 11:50:33.656 120: 276 D/CommandListener ]
?:??: W/?(?): Clearing all IP addresses on wlan0
?:??: W/?(?): [ 08-18 11:50:33.664 307: 376 D/ConnectivityService ]
?:??: W/?(?): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
?:??: W/?(?): [ 08-18 11:50:33.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to mobile
?:??: W/?(?): [ 08-18 11:50:33.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to BLUETOOTH_TETHER
?:??: W/?(?): [ 08-18 11:50:33.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to ETHERNET
?:??: W/?(?): [ 08-18 11:50:33.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
?:??: W/?(?): [ 08-18 11:50:33.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to mobile
?:??: W/?(?): [ 08-18 11:50:33.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to BLUETOOTH_TETHER
?:??: W/?(?): [ 08-18 11:50:33.671 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to ETHERNET
?:??: W/?(?): [ 08-18 11:50:34.570 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: Trying to associate with 78:28:09:0d:35:38 (SSID='4F-407H0' freq=2412 MHz)
?:??: W/?(?): [ 08-18 11:50:34.875 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: Associated with 78:28:09:0d:35:38
?:??: W/?(?): [ 08-18 11:50:34.875 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: CTRL-EVENT-CONNECTED - Connection to 78:28:09:0d:35:38 completed (reauth) [id=7 id_str=]
?:??: W/?(?): [ 08-18 11:50:36.679 307: 378 D/Tethering ]
?:??: W/?(?): MasterInitialState.processMessage what=3
?:??: W/?(?): [ 08-18 11:50:36.695 307: 378 D/Tethering ]
?:??: W/?(?): MasterInitialState.processMessage what=3
?:??: W/?(?): [ 08-18 11:50:36.726 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:50:36.726 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:50:36.765 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:50:36.765 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:50:36.921 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:50:36.921 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:50:36.937 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:50:36.937 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:50:53.234 8295: 8295 I/Process ]
?:??: W/?(?): Sending signal. PID: 8295 SIG: 9
?:??: W/?(?): [ 08-18 11:50:53.242 307: 893 I/ActivityManager ]
?:??: W/?(?): Process hodol.clockwidget (pid 8295) has died.
?:??: W/?(?): [ 08-18 11:50:53.242 307: 893 W/ActivityManager ]
?:??: W/?(?): Scheduling restart of crashed service hodol.clockwidget/.hGetTime in 5000ms
?:??: W/?(?): [ 08-18 11:50:53.257 389: 389 V/PhoneStatusBar ]
?:??: W/?(?): setLightsOn(true)
?:??: W/?(?): [ 08-18 11:50:53.265 307: 316 W/InputMethodManagerService ]
?:??: W/?(?): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@417f4d20 attribute=null
?:??: W/?(?): [ 08-18 11:50:58.265 8364: 8364 D/dalvikvm ]
?:??: W/?(?): Late-enabling CheckJNI
?:??: W/?(?): [ 08-18 11:50:58.265 307: 321 I/ActivityManager ]
?:??: W/?(?): Start proc hodol.clockwidget for service hodol.clockwidget/.hGetTime: pid=8364 uid=10054 gids={1028}
?:??: W/?(?): [ 08-18 11:50:58.281 8364: 8364 I/dalvikvm ]
?:??: W/?(?): Turning on JNI app bug workarounds for target SDK version 8...
?:??: W/?(?): [ 08-18 11:50:58.320 8364: 8364 D/AndroidRuntime ]
?:??: W/?(?): Shutting down VM
?:??: W/?(?): [ 08-18 11:50:58.320 8364: 8364 W/dalvikvm ]
?:??: W/?(?): threadid=1: thread exiting with uncaught exception (group=0x40c55300)
?:??: W/?(?): [ 08-18 11:50:58.320 8364: 8364 E/AndroidRuntime ]
?:??: W/?(?): FATAL EXCEPTION: main
?:??: W/?(?): java.lang.RuntimeException: Unable to start service hodol.clockwidget.hGetTime@416ec8b8 with null: java.lang.NullPointerException
?:??: W/?(?): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2507)
?:??: W/?(?): at android.app.ActivityThread.access$1900(ActivityThread.java:130)
?:??: W/?(?): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
?:??: W/?(?): at android.os.Handler.dispatchMessage(Handler.java:99)
?:??: W/?(?): at android.os.Looper.loop(Looper.java:137)
?:??: W/?(?): at android.app.ActivityThread.main(ActivityThread.java:4745)
?:??: W/?(?): at java.lang.reflect.Method.invokeNative(Native Method)
?:??: W/?(?): at java.lang.reflect.Method.invoke(Method.java:511)
?:??: W/?(?): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
?:??: W/?(?): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
?:??: W/?(?): at dalvik.system.NativeStart.main(Native Method)
?:??: W/?(?): Caused by: java.lang.NullPointerException
?:??: W/?(?): at hodol.clockwidget.hGetTime.onStartCommand(hGetTime.java:30)
?:??: W/?(?): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
?:??: W/?(?): ... 10 more
?:??: W/?(?): [ 08-18 11:51:05.406 307: 8348 E/DhcpStateMachine ]
?:??: W/?(?): DHCP failed on wlan0: Timed out waiting for DHCP to finish
?:??: W/?(?): [ 08-18 11:51:05.640 307: 374 E/WifiStateMachine ]
?:??: W/?(?): IP configuration failed
?:??: W/?(?): [ 08-18 11:51:05.664 6689: 6689 I/wpa_supplicant ]
?:??: W/?(?): wlan0: CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0
?:??: W/?(?): [ 08-18 11:51:05.671 120: 276 D/CommandListener ]
?:??: W/?(?): Clearing all IP addresses on wlan0
?:??: W/?(?): [ 08-18 11:51:05.679 307: 376 D/ConnectivityService ]
?:??: W/?(?): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
?:??: W/?(?): [ 08-18 11:51:05.679 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to mobile
?:??: W/?(?): [ 08-18 11:51:05.679 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to BLUETOOTH_TETHER
?:??: W/?(?): [ 08-18 11:51:05.679 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to ETHERNET
?:??: W/?(?): [ 08-18 11:51:05.679 307: 376 D/ConnectivityService ]
?:??: W/?(?): ConnectivityChange for WIFI: DISCONNECTED/DISCONNECTED
?:??: W/?(?): [ 08-18 11:51:05.687 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to mobile
?:??: W/?(?): [ 08-18 11:51:05.687 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to BLUETOOTH_TETHER
?:??: W/?(?): [ 08-18 11:51:05.687 307: 376 D/ConnectivityService ]
?:??: W/?(?): Attempting to switch to ETHERNET
?:??: W/?(?): [ 08-18 11:51:08.695 307: 378 D/Tethering ]
?:??: W/?(?): MasterInitialState.processMessage what=3
?:??: W/?(?): [ 08-18 11:51:08.710 307: 378 D/Tethering ]
?:??: W/?(?): MasterInitialState.processMessage what=3
?:??: W/?(?): [ 08-18 11:51:08.750 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:51:08.750 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:51:08.773 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:51:08.773 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:51:08.828 8029: 8031 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 501K, 6% free 12640K/13319K, paused 3ms+4ms, total 40ms
?:??: W/?(?): [ 08-18 11:51:08.906 1117: 1119 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 1369K, 51% free 14862K/29895K, paused 22ms+7ms, total 172ms
?:??: W/?(?): [ 08-18 11:51:08.906 1117: 1117 D/dalvikvm ]
?:??: W/?(?): WAIT_FOR_CONCURRENT_GC blocked 142ms
?:??: W/?(?): [ 08-18 11:51:08.914 307: 309 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 1893K, 24% free 22616K/29703K, paused 17ms+7ms, total 111ms
?:??: W/?(?): [ 08-18 11:51:08.984 8079: 8081 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed 430K, 5% free 11049K/11591K, paused 12ms+12ms, total 44ms
?:??: W/?(?): [ 08-18 11:51:09.015 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:51:09.015 7454: 7469 D/PicasaSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:51:09.039 307: 892 D/dalvikvm ]
?:??: W/?(?): WAIT_FOR_CONCURRENT_GC blocked 0ms
?:??: W/?(?): [ 08-18 11:51:09.070 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): active network: null
?:??: W/?(?): [ 08-18 11:51:09.070 8015: 8041 D/PicasaUploaderSyncManager ]
?:??: W/?(?): background data: true
?:??: W/?(?): [ 08-18 11:51:09.171 307: 892 D/dalvikvm ]
?:??: W/?(?): GC_EXPLICIT freed 347K, 25% free 22534K/29703K, paused 13ms+10ms, total 135ms
?:??: W/?(?): [ 08-18 11:51:18.296 307: 321 W/ActivityManager ]
?:??: W/?(?): Timeout executing service: ServiceRecord{421e0f68 hodol.clockwidget/.hGetTime}
?:??: W/?(?): [ 08-18 11:51:18.320 307: 321 I/ActivityManager ]
?:??: W/?(?): Crashing app skipping ANR: ProcessRecord{41bfd8c0 8364:hodol.clockwidget/u0a54} Executing service hodol.clockwidget/.hGetTime
?:??: W/?(?): [ 08-18 11:51:24.640 477: 477 D/dalvikvm ]
?:??: W/?(?): GC_FOR_ALLOC freed 6503K, 54% free 10847K/23367K, paused 15ms, total 16ms
?:??: W/?(?): [ 08-18 11:51:24.640 477: 477 I/dalvikvm-heap ]
?:??: W/?(?): Grow heap (frag case) to 13.767MB for 3279376-byte allocation
?:??: W/?(?): [ 08-18 11:51:24.664 477: 479 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed <1K, 40% free 14050K/23367K, paused 2ms+3ms, total 17ms
?:??: W/?(?): [ 08-18 11:51:24.750 477: 477 D/dalvikvm ]
?:??: W/?(?): GC_FOR_ALLOC freed 32K, 40% free 14050K/23367K, paused 9ms, total 9ms
?:??: W/?(?): [ 08-18 11:51:24.757 477: 477 I/dalvikvm-heap ]
?:??: W/?(?): Grow heap (frag case) to 16.894MB for 3279376-byte allocation
?:??: W/?(?): [ 08-18 11:51:24.765 477: 479 D/dalvikvm ]
?:??: W/?(?): GC_CONCURRENT freed <1K, 27% free 17252K/23367K, paused 1ms+2ms, total 11ms
switch문을
hClockWidget을 배열로 선언해서
widget = new ComponetName(context.hClockWidget[(widgetHeight*10)+widgetWidth].class);
사용하시는게 나을것 같네요
hClockWidget은 AppWidgetProvider 클래스를 확장한 클래스 입니다. 그래서 말씀대로 하자면,
hClockWidget[] hclockwidget = new hClockWidget[16];
hclockwidget[0] = hColockWidget11;
hclockwidget[1] = hColockWidget12;
.
.
.
를 하고
widget = new ComponetName(context.hClockWidget[(widgetHeight*10)+widgetWidth].class);
를 사용 하시라는 말씀인가요? (아, (widgetHeight*10)+widgetWidth - 1 로 해줘야겠네요.)
BroadcastReceiver에서는 시간이 오래 걸리는 작업을 수행 하면 안됩니다.
메인 쓰레드가 아닌 다른 쓰레드로 구동 되고 있거든요.
핸들러 등을 사용해서 메인 쓰레드에서 작업을 하시면 될 것 같습니다.
http://developer.android.com/reference/android/content/BroadcastReceiver.html
onReceive 메쏘드 부분을 참고 하시면 될듯 합니다.
아 그리고 추가로 UI를 변경 해주는 부분도 메인 쓰레드에서 해줘야 합니다.
다른 쓰레드에서 실행하면 Exception 발생해요.




정확힌 알수 없으나 대략 bitmap 가져오는 과정에서 생기는 문제같구...
스위치 케이스문은 한두줄로 바꿀 수 있으니 바꾸시면 좋을듯 합니다..
그리고 에러문을 같이 올려주세요 ^^