我想在 onHandleWork 内的 for 循环中调用一个非静态方法。我怎样才能做到这一点?
@Override
protected void onHandleWork(@NonNull Intent intent) {
Log.d(TAG, "onHandleWork");
String input = intent.getStringExtra("inputExtra");
for (int i = 0; i < 10; i++) {
Log.d(TAG, input + " - " + i);
new MainActivity.method();
if (isStopped()) return;
SystemClock.sleep(1000);
}
}