android widget组建
packagecom.android.TinySMS;importandroid.app.Activity;importandroid.os.Bundle;importa...
package com.android.TinySMS;
import android.app.Activity;
import android.os.Bundle;
import android.view.View.OnClickListener;
import android.widget.Button;
public class buttonText extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main2);
}
private void find_and_modify_button(){
Button button=(Button) findViewById(R.layout.main2);
button.setOnClickListener(button_listener);
}
private Button.OnClickListener button_listener =new Button.OnClickListener(){
public void onClick(View v){
setTitle("被点了啊");
}
}
}
eclipse报错。最后个}红色! 展开
import android.app.Activity;
import android.os.Bundle;
import android.view.View.OnClickListener;
import android.widget.Button;
public class buttonText extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main2);
}
private void find_and_modify_button(){
Button button=(Button) findViewById(R.layout.main2);
button.setOnClickListener(button_listener);
}
private Button.OnClickListener button_listener =new Button.OnClickListener(){
public void onClick(View v){
setTitle("被点了啊");
}
}
}
eclipse报错。最后个}红色! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询