如何在按钮单击时启动另一个活动

时间:2015-10-07 07:42:04

标签: android

10-07 12:53:30.201      477-477/com.example.manikiran.intentex E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.example.manikiran.intentex, PID: 477
    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:1150)
            at android.app.ContextImpl.startActivity(ContextImpl.java:1137)
            at android.content.ContextWrapper.startActivity(ContextWrapper.java:311)
            at com.example.manikiran.intentex.MainActivity$5.onClick(MainActivity.java:67)
            at android.view.View.performClick(View.java:4470)
            at android.view.View$PerformClick.run(View.java:18773)
            at android.os.Handler.handleCallback(Handler.java:808)
            at android.os.Handler.dispatchMessage(Handler.java:103)
            at android.os.Looper.loop(Looper.java:193)
            at android.app.ActivityThread.main(ActivityThread.java:5341)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:830)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:646)
            at dalvik.system.NativeStart.main(Native Method)

1 个答案:

答案 0 :(得分:0)

使用此:

/etc/shadow