1
나는 myDataBsae 가치를 발견했을 때 통지 intentservice을 가지고 있지만 데이터가 그래서, 저를 통지하지 말아야 null의 경우Intentservice를 반복하는 방법은 무엇입니까?
- 어떻게 MYDATABASE 내 Intentservice 체크 내용이 매 50 초 (나는 알람 관리기를 사용 할 수 있습니다하지만 내 서비스 통지 내 데이터베이스 = null에도 불구하고 매 50 초마다)? 나는 그것이
내 서비스가 발사 할 때는
public class ShowTimeServer extends IntentService {
NotificationManager nm;
static final int uniqueID=326534;
public ShowTimeServer() {
super("ShowTimeServer");
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see android.app.IntentService#onHandleIntent(android.content.Intent)
*/
@Override
protected void onHandleIntent(Intent arg0) {
// TODO Auto-generated method stub
ShowTimeDB RetrieverDB =new ShowTimeDB(this);
RetrieverDB.open();
String data = RetrieverDB.getShowNotify();
RetrieverDB.close();
if (!(data.equals(null))){
nm=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Intent intent=new Intent(this,TodayShow.class);
PendingIntent pi= PendingIntent.getActivity(this, 0, intent, 0 );
CharSequence x=(CharSequence) data;
Notification n=new Notification(R.drawable.ic_launcher,"YOU HAVE SHOW" ,System.currentTimeMillis());
n.setLatestEventInfo(this, "ShowTime", x, pi);
n.defaults=Notification.DEFAULT_ALL;
nm.notify(uniqueID,n);
//pi.cancel();
//nm.cancel(uniqueID);
}
}
}
나는 runnable 또는 타이머를 만들 수 없다는 것을 의미 했습니까? –
당신이 말하는 것을 이해하지 못합니다. 더 설명해주세요. 내 말은 –
내가 아래에이 코드 사치 사용하고에 ***> 개인의 TimerTask mTask = 새로운 TimerTask를 내 알림 코드를 넣을 수 있습니다() { @Override 공공 무효 실행() { // 당신은 postDelayed 원하는대로 (this, REPEAT_INTERVAL); // 린스하고 반복하십시오 ... } }}; –