English 中文(简体)
Android 识别
原标题:Android Error Identification
  • 时间:2011-08-11 06:30:39
  •  标签:
  • android

请指出这一错误。

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;
}}
问题回答

第41行的检查结果如下:

at com.acdroid.activityclasses.ConditionalPolicyEntry.onCreate(ConditionalPolicyEntry.java:41)

or if you can show code...

页: 1

有条件的政策

页: 1 java, 第41行

com.acdroid.activityclasses.ConditionalPolicyEntry.onCreate(ConditionalPolicyEntry.java:41)
conditionalIntent.putExtra("user_id","1");
startActivity(conditionalIntent);

myPolicy.setID(Integer.parseInt(extrasFromCondition.getString("user_id")));

我的政策是什么。 如果是观点,则确定方法 Id,not setID

既然你说过,“我前面增加了法典。 我认为这个问题已经存在,但我错了。 我可以在我的政策.setID(......)上用Log.i()打印捆包数据。

错误如下:

 myPolicy.setID(extrasFromCondition.getInt("user_id"));  // line 41

可以得出的唯一结论是,参考政策是无效的。 分配我的政策在哪里?





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签