容易出错的地方:
1、startSpeech方法中 image.pngshow方法容易出错
错误提示
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.widget.LinearLayout.findViewWithTag(java.lang.Object)' on a null object reference
at com.iflytek.cloud.ui.a.k(SourceFile:436)
at com.iflytek.cloud.ui.a.i(SourceFile:294)
at com.iflytek.cloud.ui.a.g(SourceFile:182)
at com.iflytek.cloud.ui.a.b(SourceFile:501)
at com.iflytek.cloud.thirdparty.at.show(SourceFile:45)
at com.iflytek.cloud.ui.RecognizerDialog.show(SourceFile:115)
at com.example.ifly.utils.IatActivity.onClick(IatActivity.java:146)
at com.example.ifly.utils.IatActivity.onCreate(IatActivity.java:105)
at android.app.Activity.performCreate(Activity.java:8214)
at android.app.Activity.performCreate(Activity.java:8202)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1320)
at com.qiyukf.unicorn.i.a.callActivityOnCreate(Unknown Source:2)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4033)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4247)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
at android.app.ActivityThreadMethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
解决方法:
image.png
创建assets文件夹考入所有文件即可
2.build.gradle文件和其他部分加入官方文档集成即可
3.初始化ID要和申请的ID一致
image.png
image.png
网友评论