我想将文本作为Dialogflow代理的输入,而不是使用aiService进行语音输入。我可以这样做吗?
public void send(View view){
Result result1 = (Result) et_1.getText();
speech = result1.getFulfillment().getSpeech();
t1.setText("Query: "+ result1.getResolvedQuery());
t2.setText("Answer: "+speech);
在这里,我已经在AnimationView上启用了onClick,并且在单击AnimationView时,我想要处理从EditText到Dialogflow代理的文本,并在textView上获取响应。
<EditText
android:id="@+id/edit_text"
android:layout_width="271dp"
android:layout_height="67dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="27dp"
android:hint="Enter Your Query here..." />
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/search"
android:layout_width="130dp"
android:layout_height="90dp"
android:paddingLeft="30dp"
android:onClick="send"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginTop="7dp"
app:lottie_autoPlay="true"
app:lottie_fileName="text_bubble_pop_up.json"
app:lottie_loop="true" />