启动intent时未定义Android Intent构造函数

noo*_*der 2 android android-intent

我在创建一个导航到我的Android应用程序中的不同活动的意图时有一些问题.当我创建intent函数时,它给出了一个错误说法

The constructor Intent(new View.OnClickListener(){}, Class<MapItmeizedOverlay>) is undefined
Run Code Online (Sandbox Code Playgroud)

这是具有startActivity意图的SelectOptions.java

btnLocation.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub

            Intent intent2 = new Intent(this, MapItmeizedOverlay.class);
            startActivity(intent2);


        }
    });
Run Code Online (Sandbox Code Playgroud)

ρяσ*_*я K 6

请在下面写下代码

Intent intent2 = new Intent(Current_Activity.this, MapItmeizedOverlay.class);
startActivity(intent2);
Run Code Online (Sandbox Code Playgroud)

代替

Intent intent2 = new Intent(this, MapItmeizedOverlay.class);
startActivity(intent2);
Run Code Online (Sandbox Code Playgroud)

在任何视图上启动新活动单击使用当前活动上下文或应用程序上下文而不是视图上下文,因为Intent构造函数将当前上下文或应用程序上下文作为第一个