0

向きを変更しようとして、また非同期アクティビティを呼び出そうとすると、このエラーが発生します。ユーザーが をクリックするとrefresh to get data and he tries to change the orientation、このエラーが発生します。

私は自分のコードを振り返りました....私は.notifyDataSetChangedでのみメソッドを呼び出していonPostExecute()ます.

@Override
protected void onPostExecute(Boolean result) {
    super.onPostExecute(result);
    adapater.notifyDataSetChanged(); 
}

ログキャット

  06-12 18:19:11.777: E/XXX(10529):
  slidingmenu.lib.CustomViewAbove.onLayout(CustomViewAbove.java:476)
  06-12 18:19:11.777: E/XXX(10529):     at
  android.view.View.layout(View.java:13754) 06-12 18:19:11.777:
  E/XXX(10529):     at android.view.ViewGroup.layout(ViewGroup.java:4362)
  06-12 18:19:11.777: E/XXX(10529):     at
  android.widget.RelativeLayout.onLayout(RelativeLayout.java:948) 06-12
  18:19:11.777: E/XXX(10529):   at
  android.view.View.layout(View.java:13754) 06-12 18:19:11.777:
  E/XXX(10529):     at android.view.ViewGroup.layout(ViewGroup.java:4362)
  06-12 18:19:11.777: E/XXX(10529):     at
  android.widget.FrameLayout.onLayout(FrameLayout.java:448) 06-12
  18:19:11.777: E/XXX(10529):   at
  android.view.View.layout(View.java:13754) 06-12 18:19:11.777:
  E/XXX(10529):     at android.view.ViewGroup.layout(ViewGroup.java:4362)
  06-12 18:19:11.777: E/XXX(10529):     at
  android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1866) 06-12
  18:19:11.777: E/XXX(10529):   at
  android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1687)
  06-12 18:19:11.777: E/XXX(10529):     at
  android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998) 06-12
  18:19:11.777: E/XXX(10529):   at
  android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
  06-12 18:19:11.777: E/XXX(10529):     at
  android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
  06-12 18:19:11.777: E/XXX(10529):     at
  android.view.Choreographer.doCallbacks(Choreographer.java:555) 06-12
  18:19:11.777: E/XXX(10529):   at
  android.view.Choreographer.doFrame(Choreographer.java:525) 06-12
  18:19:11.777: E/XXX(10529):   at
  android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
  06-12 18:19:11.777: E/XXX(10529):     at
  android.os.Handler.handleCallback(Handler.java:615) 06-12
  18:19:11.777: E/XXX(10529):   at
  android.os.Handler.dispatchMessage(Handler.java:92) 06-12
  18:19:11.777: E/XXX(10529):   at
  android.os.Looper.loop(Looper.java:137) 06-12 18:19:11.777:
  E/XXX(10529):     at
  android.app.ActivityThread.main(ActivityThread.java:4928) 06-12
  18:19:11.777: E/XXX(10529):   at
  java.lang.reflect.Method.invokeNative(Native Method) 06-12
  18:19:11.777: E/XXX(10529):   at
  java.lang.reflect.Method.invoke(Method.java:511) 06-12 18:19:11.777:
  E/XXX(10529):     at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
  06-12 18:19:11.777: E/XXX(10529):     at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558) 06-12
  18:19:11.777: E/XXX(10529):   at dalvik.system.NativeStart.main(Native
   Method)

私のdoInBackgroundClass

@
Override
protected Boolean doInBackground(String...params) {
    if (Utils.UpdateDate(params)) {
        return true;
    }
    return false;
}
4

1 に答える 1

1

メソッドから、アダプターを変更するメソッドにadapter.notifyDataSetChanged()呼び出しを移動します。onPostExecute()

于 2013-06-12T13:12:44.563 に答える