[Solved] @Override error after adding public interface OnTaskCompleted


  1. According this code you will get null pointer exception. because you have not assign the listener in code.

    public class saveData extends AsyncTask < List < String > , Void, Void > {
        private OnTaskCompleted listener;
        boolean myflag = false;
    
        @Override
        public void onPreExecute() {}
    
        @Override
        protected Void doInBackground(List < String > ...params) {}
    
        @Override
        public void onPostExecute(Void result) {
            super.onPostExecute(result);
            onTaskCompleted(myflag);
        }
    }
    

0

solved @Override error after adding public interface OnTaskCompleted