android - Gradle sais that the return statment of onStartCommmand is unreachable -


hey guys code of onstartfunction command in service

public int onstartcommand(intent intent,int flags,int startid)     {         super.onstartcommand(intent,flags,startid);          context context = getapplicationcontext();         for(;;) {             long current = system.currenttimemillis();             usagestatsmanager usagestatsmanager = ((usagestatsmanager) context.getsystemservice(context.usage_stats_service));             (usagestats usagestats : usagestatsmanager.queryusagestats(usagestatsmanager.interval_daily, current - 1000, current)) {                 log.i("nome processo", usagestats.getpackagename());             }         }           return 0;      } 

the problem when i'm compile because gradle says me return 0 "error:(56, 9) error: unreachable statement"

you have loop no parameters. infinite loop. need way loop terminate or return statement never reached.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -