이것 때문에 몇달째 고민 중입니다.

왜 서비스가 끊어지는 걸까요??  혹시 경험하신분 없나요??

속 시원히 뭔가 설명좀 해 주실 분 없으신가요???

분단위 시간 표시와 함께 양음력 날짜표시 및 내부 데이타베이스에서 간단한 내용 검색하여 홈화면 위젯에 표시하는 기능인데 평상시에는 잘 되는데 구글지도같은 무거운 프로그램을 돌리면 서비스가 죽으면서 더이상 업데이트를 못합니다.  근데 항상 구글지도를 돌리면 죽는게 아니고 이따끔씩 죽습니다. 어떤때는 지도를 계속 돌려도 끄떡않고 견뎌내기도 합니다. 하지만 위젯은 절대 죽으면 안되는 거잖아요.

좀 도와 주세요.

7월2일 앱개발 질문 24642 번으로 질문 올렸는데 아무도 대답을 안주셔서 다시 올려 호소합니다.

매우 궁금 초보남 올림

관련 소스 아래참조;

 

public class Widgetprovider extends AppWidgetProvider {

@Override
public void onDisabled(Context context) {
super.onDisabled(context);
context.stopService(new Intent(context, UpdateService.class));
}

@Override
public void onEnabled(Context context) {
super.onEnabled(context);
context.startService(new Intent(UpdateService.ACTION_UPDATE));
}

@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
super.onUpdate(context, appWidgetManager, appWidgetIds);
context.startService(new Intent(UpdateService.ACTION_UPDATE));
}

@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);
context.startService(new Intent(UpdateService.ACTION_UPDATE));
}

public static final class UpdateService extends Service {
static final String ACTION_UPDATE = "com.dkeg.action.WIDGET_UPDATE";

private final static IntentFilter sIntentFilter;

static {
sIntentFilter = new IntentFilter();
sIntentFilter.addAction(Intent.ACTION_TIME_TICK);
}

@Override
public void onCreate() {
super.onCreate();
registerReceiver(brReceiver, sIntentFilter);
}

@Override
public void onDestroy() {
super.onDestroy();
unregisterReceiver(brReceiver);
}

@Override
public IBinder onBind(Intent intent) {
return null;
}

@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);

........

디비검색 조건

update(tdik);

}

private void update(int tdik) {
디비검색
..................
}

private final static BroadcastReceiver brReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if(action.equals(Intent.ACTION_TIME_TICK)) {
context.startService(new Intent(UpdateService.ACTION_UPDATE));
}
}
};

public static RemoteViews getRViews(Context context, int i, String sday) {
Intent intent = new Intent(context, Mainscreen.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
intent, PendingIntent.FLAG_CANCEL_CURRENT);

RemoteViews views = new RemoteViews(context.getPackageName(),
R.layout.widgetprovider);

.

.

..

.

.

.

}