Skip to main content
Inspiring
May 21, 2015
Question

FREWrongThreadException inside AsyncTask in Android

  • May 21, 2015
  • 0 replies
  • 263 views

Create a FREArray inside a AsyncTask causes "FREWrongThreadException" exception in Android code. Do you know why?

Inside call() method

new AsyncTask<Void,Void,Void>()

  {

@2226279

  protected Void doInBackground(Void... params) {

//anything

  return null;

  }

protected void onPostExecute(Void result) {

FREArray resultAIR = null;

  try {

  resultAIR = FREArray.newArray(1);

  } catch (IllegalStateException e1) {

  e1.printStackTrace();

  } catch (FREASErrorException e1) {

  e1.printStackTrace();

  } catch (FREWrongThreadException e1) {

  e1.printStackTrace();

  }

//anything

}

}

thanks!

This topic has been closed for replies.