如何解决错误:找不到符号类RequestFinishedListener

TZ博士

在我的项目中,我使用排球包。但是它显示在Volley中找不到符号类newRequestQueue。我该怎么解决。

我已经导入了凌空包

import com.android.volley.RequestQueue.RequestFinishedListener; 

这是我的源代码

queue.addRequestFinishedListener(new RequestQueue.RequestFinishedListener<Object>() {
    @Override
    public void onRequestFinished(Request<Object> request) {
        // Start NewActivity.class
        Intent myIntent1 = new Intent(NewActivity.this, New2Activity.class);
        startActivity(myIntent1);
        Log.e("Error Response 2", "Request Finish");
    }
});
Nishikanto Sarkar Simul

只需将以下行添加到您的应用程序级别build.gradle

implementation 'com.android.volley:volley:1.1.0'

要么

compile 'com.android.volley:volley:1.1.0'

然后这是可行的代码

    queue = Volley.newRequestQueue(getApplicationContext());
    queue.addRequestFinishedListener(new RequestQueue.RequestFinishedListener<Object>() {
        @Override
        public void onRequestFinished(Request<Object> request) {
            // Start NewActivity.class
            Intent myIntent1 = new Intent(MainActivity.this, ActivityTwo.class);
            startActivity(myIntent1);
            Log.e("Error Response 2", "Request Finish");
        }
    });

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何解决流量张CPU DLL找不到错误

如何解决此“找不到符号”错误?

如何解决“找不到匹配的索引”。错误

如何解决错误:找不到符号message.reply(...); Vertx点对点

如何解决用Spring Boot找不到或加载主类错误?

如何解决“找不到符号”错误?

如何解决错误:在SpringBoot应用程序中找不到或加载主类

如何解决“错误:找不到libx264”?

如何解决“在项目中找不到'generateDebugSources'”错误?

如何解决OpenAI Gym中的“找不到Env”错误?

如何解决Gradle错误找不到符号

如何解决Java“找不到行”错误?

如何解决侦听器类中的“错误:找不到符号方法startActivity(Intent)”?

如何解决“错误:找不到与安装匹配的版本”?

如何解决Node.js错误:找不到模块?

如何解决错误:找不到函数“ plot_grid”?

如何解决Laravel中找不到路线的错误?

parLapply-如何解决错误“找不到函数“ bindToEnv””?

如何解决ImportError:dlopen():找不到符号:...。

如何解决Django中找不到页面的错误?

如何解决错误:找不到模块“ ejs”?

找不到GLIBCXX_3.4.20,如何解决此错误?

如何解决“找不到合适的驱动程序”错误

常规错误-找不到匹配的方法-如何解决

将Java类转换为Kotlin后,如何解决:“错误:找不到符号类...”?

如何解决Android Studio错误:找不到符号方法启动

如何解决致命错误:找不到“MongoClient”类?

意图错误 - 如何解决?(找不到符号类 Intent)

我该如何解决这个错误?错误:找不到符号 Vholder.setData(mValues.get(position));