Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于页面出现了问题 #58

Open
NightlyException opened this issue Jul 24, 2017 · 0 comments
Open

关于页面出现了问题 #58

NightlyException opened this issue Jul 24, 2017 · 0 comments

Comments

@NightlyException
Copy link

在MainActivity的137行处你使用了 getApplication().startActivity(intent);我在运行的时候报了
Theme: themes:{default=overlay:com.h2os.youlun, iconPack:com.h2os.youlun, fontPkg:com.h2os.youlun, com.android.systemui=overlay:com.h2os.youlun, com.android.systemui.navbar=overlay:com.h2os.youlun}
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:684)
at android.app.ContextImpl.startActivity(ContextImpl.java:671)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:337)
at com.looklook.xinghongfei.looklook.MainActivity$2.onNavigationItemSelected(MainActivity.java:137)
at android.support.design.widget.NavigationView$1.onMenuItemSelected(NavigationView.java:152)
at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:817)
at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:156)
at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:964)
at android.support.design.internal.NavigationMenuPresenter$1.onClick(NavigationMenuPresenter.java:318)
at android.view.View.performClick(View.java:5204)
at android.view.View$PerformClick.run(View.java:21156)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5466)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

错误,改成直接startActivity(intent);后正常运行,设备试三星GT-N7100,6.0.1系统

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant