-2
我在從頁面查看轉換到主應用程序頁面時遇到了麻煩。頁面瀏覽是應用程序的介紹,我在介紹的最後一頁設置了一個按鈕。用戶可以觸摸按鈕並開始使用應用程序(屏幕應顯示主頁面)。但我使用java文件中的代碼(我將在該問題下顯示代碼)。我把代碼放入並運行後,該應用程序無法工作(它濺起來了)我怎麼能解決這個問題?android:Android開發
下面的語句是代碼:
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setClass(pageforintroductions.this,
page11_firstuserpages.class);
startActivity(intent); }
});
Button button17 = (Button) findViewById(R.id.button17);
button17.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setClass(pageforintroductions.this, page11_firstuserpages.class);
startActivity(intent); }
});
非常感謝!
對不起,setOnClickListener變成紅色。提示顯示:向方法添加合格的PageView。 –
ID必須看到更多的代碼。你是否初始化了onCreate方法中的按鈕? – DroiDev
我已更新我的帖子上的代碼。請檢查它,謝謝。 –