我是用Android studio 开发了一个APP,写了一个欢迎页面和主页面,但是点击退出的时候它又回到了主页面,就相当于得点两次才可以退出,求大神帮助

Evloution_ 2018-06-02 09:00:50
第一次点击退出的时候,下面输出的是这样的:


D/KeyEvent: obtain, mHwFlags=0
D/KeyEvent: obtain, mHwFlags=0
W/InputMethodManager: startInputReason = 1
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
W/libEGL: EGLNativeWindowType 0x7244106010 disconnect failed
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
W/libEGL: EGLNativeWindowType 0x7244103010 disconnect failed
D/ActivityThread: Remove activity client record, r= ActivityRecord{42cffda token=android.os.BinderProxy@cc950b8 {com.evloution.androidnetwork/com.evloution.androidnetwork.MainActivity}} token= android.os.BinderProxy@cc950b8
I/zygote64: Do full code cache collection, code=503KB, data=333KB
I/zygote64: After code cache collection, code=501KB, data=283KB

这是什么问题?
...全文
3971 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
肖子理 2019-06-30
  • 打赏
  • 举报
回复
是不是在欢迎页面点击退出,然后还是会回到主页面
找不到快递 2019-06-24
  • 打赏
  • 举报
回复
完全看不见回复
Evloution_ 2018-06-02
  • 打赏
  • 举报
回复
这个是欢迎页面的代码。 public class StartActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.start_page); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//强制横屏 Handler handler = new Handler(); //当计时结束,跳转至主界面 handler.postDelayed(new Runnable() { public void run() { Intent intent = new Intent(StartActivity.this, MainActivity.class); startActivity(intent); StartActivity.this.finish(); } }, 1000*2); } } 跳转页面的代码。 public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
Evloution_ 2018-06-02
  • 打赏
  • 举报
回复
解决了,谢谢。
键盘舞者113 2018-06-02
  • 打赏
  • 举报
回复
你把两个activity代码贴出

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧