请指出这一错误。
08-11 12:34:20.757: INFO/ActivityManager(68): Starting: Intent { cmp=com.acdroid/.activityclasses.ConditionalPolicyEntry (has extras) } from pid
08-11 12:34:20.966: DEBUG/dalvikvm(369): GC_EXTERNAL_ALLOC freed 172K, 51% free 2706K/5511K, external 2116K/2137K, paused
08-11 12:34:21.276: DEBUG/AndroidRuntime(369): Shutting down VM
08-11 12:34:21.276: WARN/dalvikvm(369): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): FATAL EXCEPTION: main
08-11 12:34:21.276: ERROR/AndroidRuntime(369): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.acdroid/com.acdroid.activityclasses.ConditionalPolicyEntry}: java.lang.NullPointerException
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.os.Handler.dispatchMessage(Handler.java:99)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.os.Looper.loop(Looper.java:123)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at java.lang.reflect.Method.invokeNative(Native Method)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at java.lang.reflect.Method.invoke(Method.java:507)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at dalvik.system.NativeStart.main(Native Method)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): Caused by: java.lang.NullPointerException
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at com.acdroid.activityclasses.ConditionalPolicyEntry.onCreate(ConditionalPolicyEntry.java:41)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-11 12:34:21.276: ERROR/AndroidRuntime(369): ... 11 more
08-11 12:34:21.296: WARN/ActivityManager(68): Force finishing activity com.acdroid/.activityclasses.ConditionalPolicyEntry
08-11 12:34:21.317: WARN/ActivityManager(68): Force finishing activity com.acdroid/.activityclasses.PolicyEntryMain
08-11 12:34:21.823: WARN/ActivityManager(68): Activity pause timeout for HistoryRecord{406da960 com.acdroid/.activityclasses.ConditionalPolicyEntry}
08-11 12:34:23.077: INFO/Process(369): Sending signal. PID: 369 SIG: 9
08-11 12:34:23.097: INFO/ActivityManager(68): Process com.acdroid (pid 369) has died.
08-11 12:34:23.119: ERROR/InputDispatcher(68): channel 4073f5d0 com.acdroid/com.acdroid.ACDroid (server) ~ Consumer closed input channel or an error occurred. events=0x8
08-11 12:34:23.119: ERROR/InputDispatcher(68): channel 4073f5d0 com.acdroid/com.acdroid.ACDroid (server) ~ Channel is unrecoverably broken and will be disposed!
08-11 12:34:23.167: INFO/WindowManager(68): WIN DEATH: Window{4073f5d0 com.acdroid/com.acdroid.ACDroid paused=false}
08-11 12:34:23.227: INFO/WindowManager(68): WIN DEATH: Window{406e93b8 com.acdroid/com.acdroid.activityclasses.PolicyEntryMain paused=true}
08-11 12:34:23.316: ERROR/InputDispatcher(68): Received spurious receive callback for unknown input channel. fd=196, events=0x8
08-11 12:34:24.028: WARN/InputManagerService(68): Got RemoteException sending setActive(false) notification to pid 369 uid 10051
08-11 12:34:24.297: INFO/ARMAssembler(68): generated scanline__00000177:03515104_00001002_00000000 [ 87 ipp] (110 ins) at [0x445ed848:0x445eda00] in 713146 ns
08-11 12:39:05.969: DEBUG/SntpClient(68): request time failed: java.net.SocketException: Address family not supported by protocol
08-11 12:44:06.023: DEBUG/SntpClient(68): request time failed: java.net.SocketException: Address family not supported by protocol
08-11 12:49:06.076: DEBUG/SntpClient(68): request time failed: java.net.SocketException: Address family not supported by protocol
08-11 12:54:06.117: DEBUG/SntpClient(68): request time failed: java.net.SocketException: Address family not supported by protocol
在活动A中,
final Intent conditionalIntent = new Intent(this,ConditionalPolicyEntry.class);
btn_ok.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
conditionalIntent.putExtra("user_id",1);
startActivity(conditionalIntent);
}
});
在活动B中,
Bundle extrasFromCondition = getIntent().getExtras();
myPolicy.setID(extrasFromCondition.getInt("user_id")); // line 41
PS:error is followed through get function of bundle whenever I place // . Think I can t pass data.
政策类别如下:
public class Policy{
int ID;
int user_type;
public int getID()
{
return ID;
}
public void setID(int iD) {
this.ID = iD;
}
public int getUser_type() {
return user_type;
}
public void setUser_type(int userType) {
this.user_type = userType;
}}