android 问题:程序没写完,写到这MyButtonOnClickListener 一直显示红色,代码如下:
packagecn.cad.photoclassify01;importandroid.app.Activity;importandroid.app.TabActivit...
package cn.cad.photoclassify01;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RadioGroup;
import android.widget.Button;
import android.view.View.OnClickListener;
import cn.cad.photoclassify.R;
import cn.cad.photoclassify.*;
/**
* Created by zhaojinsheng on 2017/4/22.
*/
public class MainActivity extends Activity {
Intent intent = new Intent();
private Button recommend;
private Button search;
private Button personal;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recommend = (Button) findViewById(R.id.recommend);
search = (Button) findViewById(R.id.search);
personal = (Button) findViewById(R.id.personal);
recommend.setOnClickListener(new MyButtonOnClickListener());//就是这个地方
}
} 展开
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RadioGroup;
import android.widget.Button;
import android.view.View.OnClickListener;
import cn.cad.photoclassify.R;
import cn.cad.photoclassify.*;
/**
* Created by zhaojinsheng on 2017/4/22.
*/
public class MainActivity extends Activity {
Intent intent = new Intent();
private Button recommend;
private Button search;
private Button personal;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recommend = (Button) findViewById(R.id.recommend);
search = (Button) findViewById(R.id.search);
personal = (Button) findViewById(R.id.personal);
recommend.setOnClickListener(new MyButtonOnClickListener());//就是这个地方
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |