The type RoadActivity must implement the inherited abstract method求救
packagecom.ipcamer.demo;importandroid.app.Activity;importandroid.content.Intent;impor...
package com.ipcamer.demo;
import android.app.Activity;
import android.content.Intent;
import android.drm.DrmStore.Action;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
public class RoadActivity extends Activity implements OnClickListener,OnTouchListener {
private Button button_backplay = null;
private Button button1 = null;
//第一次创建该activity是回调这个方法
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);//父类方法
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.road);//设置布局文件
}
private void findView() {
button_backplay = (Button)findViewById(R.id.backplay);
button_backplay.setOnClickListener(this);
button1 = (Button)findViewById(R.id.button1);
button1.setOnTouchListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.backplay:
Intent intent = new Intent(RoadActivity.this,
PlayActivity.class);
startActivity(intent);
break;
}
button1.setOnTouchListener(new OnTouchListener(){
@Override
public boolean onTouch(View e, MotionEvent event) {
// TODO Auto-generated method stub
if(event.getAction() == MotionEvent.ACTION_DOWN){
//更改为按下时的背景图片
e.setBackgroundResource(R.drawable.released);
}
return false;
}
});
}
} 展开
import android.app.Activity;
import android.content.Intent;
import android.drm.DrmStore.Action;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
public class RoadActivity extends Activity implements OnClickListener,OnTouchListener {
private Button button_backplay = null;
private Button button1 = null;
//第一次创建该activity是回调这个方法
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);//父类方法
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.road);//设置布局文件
}
private void findView() {
button_backplay = (Button)findViewById(R.id.backplay);
button_backplay.setOnClickListener(this);
button1 = (Button)findViewById(R.id.button1);
button1.setOnTouchListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.backplay:
Intent intent = new Intent(RoadActivity.this,
PlayActivity.class);
startActivity(intent);
break;
}
button1.setOnTouchListener(new OnTouchListener(){
@Override
public boolean onTouch(View e, MotionEvent event) {
// TODO Auto-generated method stub
if(event.getAction() == MotionEvent.ACTION_DOWN){
//更改为按下时的背景图片
e.setBackgroundResource(R.drawable.released);
}
return false;
}
});
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询