ban-geoengineering ban-geoengineering - 1 year ago 435
Android Question

Android Lint warning: "Redundant array creation for calling varargs method"

I am getting the above Lint warning in my Android project for the

new Void[] {}
part of the following code:

new AsyncTask<Void, Void, Exception>() {

protected void onPreExecute() {
showToast("Restarting NFC...");

protected Exception doInBackground(Void... params) {
try {
return null;
catch (Exception e) {
return e;

protected void onPostExecute(Exception e) {
if (e == null) {
showToast("...NFC restarted.");
else {
Log.e(LOG_TAG, "Could not restart NFC!", e);
showToast("Could not restart NFC: " + e);

}.execute(new Void[] {});

I am unable to replace the problematic
new Void[] {}
, so what is the correct solution?

Answer Source

Leave the argument list empty: