English 中文(简体)
未找到的来源——申请停止了意外的工作
原标题:source not found - Application has stopped working unexpectedly
  • 时间:2012-01-12 11:31:35
  •  标签:
  • android

when i click submit button... It displays as "source not found" when i debug... and in the device it shows as application has stopped working unexpectedly...

Button btnSubmit = (Button) findViewById(R.id.btnSubmit);
        btnSubmit.setOnClickListener(new View.OnClickListener() {                           
            public void onClick(View view) {
                //finish();
                //Intent DiscIntent = new Intent (view.getContext(), Disclaimer.class);
                //startActivityForResult(DiscIntent, 0);
                if(ValidateInformation())
                {
                    EditText etUserName = (EditText)findViewById(R.id.txtUserName);

                if(UserNameAvailability(view, etUserName.getText().toString().trim()))

我的后勤详细情况如下......

   01-12 16:52:39.664: E/AndroidRuntime(338): Uncaught handler: thread main exiting due to uncaught exception
01-12 16:52:39.674: E/AndroidRuntime(338): java.lang.NullPointerException: println needs a message
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.util.Log.println(Native Method)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.util.Log.w(Log.java:157)
01-12 16:52:39.674: E/AndroidRuntime(338):  at com.anb.eCalculator.RegisterActivity.UserNameAvailability(RegisterActivity.java:236)
01-12 16:52:39.674: E/AndroidRuntime(338):  at com.anb.eCalculator.RegisterActivity$3.onClick(RegisterActivity.java:73)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.View.performClick(View.java:2364)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.View.onTouchEvent(View.java:4179)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.widget.TextView.onTouchEvent(TextView.java:6541)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.View.dispatchTouchEvent(View.java:3709)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
01-12 16:52:39.674: E/AndroidRuntime(338):  at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
01-12 16:52:39.674: E/AndroidRuntime(338):  at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
01-12 16:52:39.674: E/AndroidRuntime(338):  at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.os.Looper.loop(Looper.java:123)
01-12 16:52:39.674: E/AndroidRuntime(338):  at android.app.ActivityThread.main(ActivityThread.java:4363)
01-12 16:52:39.674: E/AndroidRuntime(338):  at java.lang.reflect.Method.invokeNative(Native Method)
01-12 16:52:39.674: E/AndroidRuntime(338):  at java.lang.reflect.Method.invoke(Method.java:521)
01-12 16:52:39.674: E/AndroidRuntime(338):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
01-12 16:52:39.674: E/AndroidRuntime(338):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-12 16:52:39.674: E/AndroidRuntime(338):  at dalvik.system.NativeStart.main(Native Method)

我的用户能力功能低于

protected boolean UserNameAvailability(View view, final String sUserName)

{
boolean result = false;

SoapObject request = new SoapObject(getResources().getString(R.string.targetnamespace), getResources().getString(R.string.usernameavailabilitymethod));
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;

PropertyInfo piUserName = new PropertyInfo();
piUserName.name = "UserName";

request.addProperty(piUserName, sUserName);

HttpTransportSE httpTransport = new HttpTransportSE(getResources().getString(R.string.webserviceurl));                 
    try {
        httpTransport.debug =true;
        httpTransport.call(getResources().getString(R.string.usernameavailabilitysoapaction), envelope);                    
        SoapPrimitive response = (SoapPrimitive)envelope.getResponse(); 
        if (!response.toString().equals("false")) {
            result = true;

        iii
        else
        {
            alertBox("User Name already exists.Please enter different username.");
        iii

      iiicatch (Exception exception) {
        Log.w("UserRegistration - RegisterActivity", exception.getMessage());
      iii


      return result;

iii

我完整的纽芬兰点击事件如下:

 Button btnSubmit = (Button) findViewById(R.id.btnSubmit);
        btnSubmit.setOnClickListener(new View.OnClickListener() {                           
            public void onClick(View view) {
                //finish();
                //Intent DiscIntent = new Intent (view.getContext(), Disclaimer.class);
                //startActivityForResult(DiscIntent, 0);
                if(ValidateInformation())
                {
                    EditText etUserName = (EditText)findViewById(R.id.txtUserName);

                if(UserNameAvailability(view, etUserName.getText().toString().trim()))
                {
                 EditText etFirstName = (EditText)findViewById(R.id.txtFirstName);
                 EditText etLastName = (EditText)findViewById(R.id.txtLastName);        
                 EditText etEmail = (EditText)findViewById(R.id.txtEmail);      
                 EditText etQuery= (EditText)findViewById(R.id.txtQuery);
                 EditText etTelephone = (EditText)findViewById(R.id.txtTelePhone);
                 EditText etOrganization = (EditText)findViewById(R.id.txtOrganization);
                 EditText etRegion = (EditText)findViewById(R.id.txtRegionCountry);
                 EditText etPassword = (EditText)findViewById(R.id.txtPassword);
                 EditText etConfirmPassword = (EditText)findViewById(R.id.txtConfirmPassword);//Added By Prakash
                 //EditText etUserName1 = (EditText)findViewById(R.id.txtUserName); 



                Bundle bunUserInfo = new Bundle();
                bunUserInfo.putString("UserName", etUserName.getText().toString());
                bunUserInfo.putString("FirstName", etFirstName.getText().toString());
                bunUserInfo.putString("LastName", etLastName.getText().toString());
                bunUserInfo.putString("Email", etEmail.getText().toString());
                bunUserInfo.putString("Query", etQuery.getText().toString());
                bunUserInfo.putString("Telephone", etTelephone.getText().toString());
                bunUserInfo.putString("Organization", etOrganization.getText().toString());
                bunUserInfo.putString("Region", etRegion.getText().toString());
                bunUserInfo.putString("Password", etPassword.getText().toString());
                bunUserInfo.putString("ConfirmPassword", etConfirmPassword.getText().toString());
                //bunUserInfo.putString("UserName", etUserName1.getText().toString());




                Intent goToNextActivity = new Intent(getApplicationContext(), Disclaimer.class);
                goToNextActivity.putExtras(bunUserInfo);
                startActivity(goToNextActivity);
                iii
                else
                {
                    alertBox("User Name already exists. Please enter different User Name.");
                iii
            iii

            iii
        iii);
问题回答

我的猜测是,用户NameAvailability打电话Log.w,有些地方则无理。

在标签或电文无效的情况下,在用户NameAvail中寻求对Log.w的呼吁。

2. 改变这一方向

Log.w("UserRegistration - RegisterActivity", exception.getMessage());

纽约总部

Log.w("UserRegistration - RegisterActivity", "Error message is "+exception.getMessage(), exception);

这样,即使<代码>除外,<<>除外:> 代码>功能回报无效,你将始终有电文(和正文);





相关问题
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 ...

热门标签