请问我这个程序的错误如何改写?还有警告如何改写?谢谢 20
packagewei.guess;importandroid.app.Activity;importandroid.content.Intent;importandroi...
package wei.guess;
import android.app.Activity;
import android.content.Intent;
import android.location.GpsStatus.Listener;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class First_guess extends Activity {
/** Called when the activity is first created. */
//@Override
private Button key,next,prior,home;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.first_guess);
key=(Button)findViewById(R.id.key);
next=(Button)findViewById(R.id.next);
prior=(Button)findViewById(R.id.prior);
home=(Button)findViewById(R.id.home);
home.setOnClickListener(new homeListener());
}
public class homeListener implements Listener, OnClickListener{
public void OnClick(View v){
if(v.getId()==R.id.home)
{
Intent intent=new Intent(First_guess.this,Activity_guess.class);
startActivity(intent);
}
}
}
} 展开
import android.app.Activity;
import android.content.Intent;
import android.location.GpsStatus.Listener;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class First_guess extends Activity {
/** Called when the activity is first created. */
//@Override
private Button key,next,prior,home;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.first_guess);
key=(Button)findViewById(R.id.key);
next=(Button)findViewById(R.id.next);
prior=(Button)findViewById(R.id.prior);
home=(Button)findViewById(R.id.home);
home.setOnClickListener(new homeListener());
}
public class homeListener implements Listener, OnClickListener{
public void OnClick(View v){
if(v.getId()==R.id.home)
{
Intent intent=new Intent(First_guess.this,Activity_guess.class);
startActivity(intent);
}
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询