80,351
社区成员
发帖
与我相关
我的任务
分享
Button myButton = new Button(this);
myButton.setText("速度");
addContentView(myButton, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
final TextView myTextView = new TextView(this);
myTextView.setText("");
myTextView.setPadding(50, 5, 5, 5);
addContentView(myTextView, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
myButton.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
myTextView.setText("显示速度");
}
});