关于android
最经在看视频学习android,照着视屏的方法写的程序,一模一样,但就是mainBtn=setOnClickListener(listener)一直报错.求帮助!
package com.mine.evergreen0;
import android.app.Activity;
import android.content.DialogInte易做图ce;
import android.content.DialogInte易做图ce.OnClickListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
public class ntentActivity extends Activity
{
private Button mainBtn=null;
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mainBtn=(Button)findViewById(R.id.mainBtn);
mainBtn=setOnClickListener(listener);
}
private OnClickListener listener=new OnClickListener()
{
public void onClick(DialogInte易做图ce dialog, int which)
{
Intent intent=new Intent();
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:18200391120"));
startActivity(intent);
}
};
}
补充:Java , Eclipse