I'm developing an Android application and I piece in the But when I what's happening that you know? Your problem may be in your reference Then change the initiality of your asynctask inside your piece is AsynTask a
< / Code>:
The private class SendUserDatasAsynTask extends AsyncTask & LT; User, zero, string & gt; {Private reference mContext; Private progressivilog loading dietology; SendUserDatasAsynTask (Reference Reference) {this.mContext = context; } @ Override protected void on Preeaksaktek () {loadingDialog = new progress Diaieloji (Msitiaksti); LoadingDialog.setProgressStyle (ProgressDialog.STYLE_SPINNER); LoadingDialog.setMessage (GetString (R.string.dialog_message_sending_user_data)); LoadingDialog.setCancelable (wrong); LoadingDialog.show (); Super.onPreExecute (); } @Override protected string doInBackground (user ... user) {return SpringController.sendUserPersonalData (those [0]); } Secure Execute on Zero (string result) {loadingDialog.dismiss (); Toast.makeText (MSDApplication.getAppContext (), results, Toast.LENGTH_LONG) .show (); }}
execute function I get this error:
06-21 13: 52: 42.559 : E / AndroidRuntime (513): Reason by: android.view.WindowManager $ BadTokenException: Window for an app on viewer.ViewRoot.setView (ViewRoot.java:509) on Android - Token Fail is unable to add. On .WindowManagerImpl.addView android.view.WindowManagerImpl.addView (WindowManagerImpl.java:177) (WindowManagerImpl.java:91) on com.mycompany.mxt.fragments on android.app.Dialog.show (Dialog.java:241). UserProfileFragment $ SendUserDatasAyynTask.onPreExecute (UserProfileFragment.java:635) .mxt.fragments on com.mycompany.mxt.fragments.SuperDataToWebService (UserProfileFragment.java) 88 at Android.AsInCTsXAquate (UserInfoType.java391) at Com.mycompany. UserProfileFragment.onAcceptUserProfileClick (UserProfileFragment.java:477)
SendUserDatasAsynTask (reference context) may be used in. Make sure that you pass your
activity as reference and
ApplicationContext .
SendUserDatasAsynTask myTask = New SendUserDatasAsynTask (getActivity ()) ;
No comments:
Post a Comment