0
我在行this.viewcam.setOnClickListerner(new view.OnClickListerner())
中得到以下錯誤。
我在eclipse中得到這個錯誤。此行有多個標記
在這條線
- 方法
setOnClickListener(View.OnClickListener)
在類型View
多重標誌物是不適用的參數(new OnClickListener(){}
) - 視圖不能解析爲一個類型
public class Main extends Activity
implements View.OnClickListener
{
Button viewcam;
EditText editTextIp;
EditText login;
EditText passwd;
public void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
setContentView(R.layout.main);
this.viewcam = ((Button)findViewById(R.id.viewcam));
this.viewcam.setOnClickListener(new view.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
if (v == this.viewcam)
{
Log.i("login", this.login.getText().toString());
Log.i("Passwd", this.passwd.getText().toString());
Intent localIntent1 = new Intent(v.getContext(), MjpegSample.class);
Log.i("My ip", this.editTextIp.getText().toString());
localIntent1.putExtra("ip", "http://" + this.editTextIp.getText().toString() + "/");
localIntent1.putExtra("user", this.login.getText().toString());
localIntent1.putExtra("passwd", this.passwd.getText().toString());
startActivityForResult(localIntent1, 1000);
} }
});
this.editTextIp = ((EditText)findViewById(R.id.ip));
this.login = ((EditText)findViewById(R.id.username));
this.passwd = ((EditText)findViewById(R.id.password));
}
}
非常感謝。它起到了魅力的作用 – radish