App crashing when setting new content view

后端 未结 3 1854
误落风尘
误落风尘 2021-01-24 08:26

Edit:

It seems my button styles are causing the issue.

Edit Code

buttonL.setOnTouchListener(new View.OnTouchListener() {

        public boolean          


        
3条回答
  •  一向
    一向 (楼主)
    2021-01-24 09:09

    Try this:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
    
        Thread splash=new Thread(){
            public void run(){
                try{
                    sleep(2000);
                }catch(Exception e){
                    e.printStackTrace();
                }finally{
                    startActivity(new Intent(getApplicationContext(),StartMenu.class));
                    finish();
                }
            }
        };
    
        splash.start();
    }
    

    And your Manifest.xml:

     
     
     
     
     
    

提交回复
热议问题