我的应用程序单击用于甜蜜对话的按钮时突然强制关闭

时间:2018-09-21 14:49:44

标签: android alertdialog

我创建了一个片段,上面有一个按钮,应用程序在单击按钮进行甜蜜对话时突然强制关闭,这是我的代码

Button btnricemeal1;


@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View v = inflater.inflate(R.layout.tab_fragment_1, container, false);

    btnricemeal1 = (Button) v.findViewById(R.id.btnricemeal1);

    btnricemeal1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            SweetAlertDialog sd = new SweetAlertDialog(getActivity(),SweetAlertDialog.PROGRESS_TYPE);
            sd.setTitleText("Here's a message!");
            sd.show();
        }
    });
    return v;
}

logcat

 E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.raynard.kopiaveandroidapplication, PID: 32710
    java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
        at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:77)
        at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:64)
        at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:41)
        at cn.pedant.SweetAlert.OptAnimationLoader.loadAnimation(OptAnimationLoader.java:22)
        at cn.pedant.SweetAlert.SweetAlertDialog.<init>(SweetAlertDialog.java:80)
        at com.example.raynard.kopiaveandroidapplication.TabFragment1$1.onClick(TabFragment1.java:37)
        at android.view.View.performClick(View.java:4780)
        at android.view.View$PerformClick.run(View.java:19866)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5254)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

0 个答案:

没有答案