在我的android项目中有两个类,第一类有一个按钮,当我点击按钮时我需要查看下一页。
包 com.example.restaurantapp;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.view.View.OnClickListener;
import android.support.v4.app.NavUtils;
public class RestaurantActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_first);
Button orderbutton=(Button)findviewById(R.layout.activity_first);
orderbutton.setOnClickListener(new View.OnClickListener());
}
private Button findviewById(int activityFirst) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_first, menu);
{
public void onClick(View v) {
Intent intent = new Intent(RestaurantActivity.this,SecondActivity.class);
startActivity(intent);
}
return true;