-7
こんにちは、私はアンドロイドのアプリケーション開発プロジェクトに新しく、ダッシュボードになる予定のログイン画面を作成しました。私はダッシュボードに別のアクティビティを意図してボタンを作ったが、switchidの代わりにボタンをクリックするとac。それがクラッシュし、ログイン画面に戻ります。どんな援助も感謝します。 これは私の意図コードです。ボタンの次のアクティビティに切り替えません
public class Dashboard extends AppCompatActivity {
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard);
button = (Button) findViewById(R.id.cv_btn);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(Dashboard.this, "Make your CV easy", Toast.LENGTH_LONG).show();
Intent cvintent;
cvintent= new Intent(Dashboard.this, CV.class);
startActivity(cvintent);
}
});
}
}
xml
ファイル
<Button
android:id="@+id/cv_btn"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Make Your CV"
android:textColor="@android:color/white"
android:background="@color/colorPrimaryDark"
android:layout_margin="15dp"
android:textSize="16sp"
/>
マニフェストファイルで、あなたの 'CV'アクティビティを登録したことがありますか? – Piyush
エラーコード –
を投稿する@sumanはxmlファイルの代わりにクラッシュログを貼り付けます –