选项B应该起作用,有时是一个不错的选择,但是有时我为此使用匿名类。当您通过活动进行调用时:
CustomTask task = new CustomTask() { @Override protected void onPostExecute(Long result) { super.onPostExecute(result); MyActivity.this.doX(); }}.execute();
选项B应该起作用,有时是一个不错的选择,但是有时我为此使用匿名类。当您通过活动进行调用时:
CustomTask task = new CustomTask() { @Override protected void onPostExecute(Long result) { super.onPostExecute(result); MyActivity.this.doX(); }}.execute();