个人每日总结

昨日:图片裁剪功能实现

今日:文字输入查询出现bug,未成功解决,

明天继续解决。实在不行考虑其他办法解决

问题:文字输入查询出现bug,无法成功调用

复制代码
    private void getRecognitionResult(String goods) {
        //使用Get异步请求
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
                //拼接访问地址
                .url("http://api.tianapi.com/txapi/lajifenlei/index?key=783da68c7ea7e10fcd259db651cc550b&word=" + goods)
                .build();
        client.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
                String result = response.body().string();
                if (response.isSuccessful()) {//回调的方法执行在子线程。
                    Log.d("result: ", result);
                }
            }
        });
    }
复制代码
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //获取识别的结果
        getRecognitionResult("眼镜");
    }

 

posted @   摆烂达人  阅读(9)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示