2

我的应用程序意外关闭得更频繁。在我的日志中,我收到了这条消息。团队请帮助我找到此问题的原因以及如何解决此问题。

在我的 Manifest.XML 中,我声明了以下内容。

  <uses-sdk
    android:minSdkVersion="4"
    android:targetSdkVersion="18" />

日志:

10-08 19:22:54.492: E/onCreate(8584): onCreate
10-08 19:22:54.497: I/AndroidRuntime(8584): VM exiting with result code 0, cleanup skipped.
10-08 19:22:54.722: D/dalvikvm(10000): GC_CONCURRENT freed 167K, 6% free 12446K/13191K, paused 13ms+2ms, total 41ms

创建时:

public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        Log.e("onCreate", "onCreate");

        if (Modules.idCounty == null || Modules.idCounty.equals("")) {
            System.exit(0);
        }

        Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler(this));
        setContentView(R.layout.select_my_photo);

        Manufacturer = Build.MANUFACTURER;

        Btn_Gallary = (ImageView) findViewById(R.id.Img_gallary);
        Btn_Camera = (ImageView) findViewById(R.id.Img_camera);
        Btn_Delete = (ImageView) findViewById(R.id.Img_delete);
        Btn_Save = (ImageView) findViewById(R.id.Img_save);

        lbl_optional = (TextView) findViewById(R.id.lbl_optional);

        Btn_Gallary.setOnTouchListener(new myListener());
        Btn_Camera.setOnTouchListener(new myListener());
        Btn_Delete.setOnTouchListener(new myListener());
        Btn_Save.setOnTouchListener(new myListener());

        txt_name = (EditText) findViewById(R.id.text1);
        txt_slogan = (EditText) findViewById(R.id.text2);
        txt_dre = (EditText) findViewById(R.id.text3);
        txt_4 = (EditText) findViewById(R.id.text4);

        btn_lenderLicence = (Button) findViewById(R.id.btn_lenderLicence);

        TableLayout TL_select_photo = (TableLayout) findViewById(R.id.TL_Commonlayout1);
        TableLayout TL_property = (TableLayout) findViewById(R.id.TL_Commonlayout2);

        LinearLayout ln_userdetails = (LinearLayout) findViewById(R.id.ln_userinfo);

        if (Modules.ClassicPrintout
                || Modules.subProgramname.equals("MyAccount")) {
            ln_userdetails.setVisibility(8);
        }

        myImg = (ImageView) findViewById(R.id.myImg);
        mypropImg1 = (ImageView) findViewById(R.id.Img_prop1);
        mypropImg2 = (ImageView) findViewById(R.id.Img_prop2);
        mypropImg3 = (ImageView) findViewById(R.id.Img_prop3);

        mypropImg1.setScaleType(ScaleType.FIT_CENTER);
        mypropImg1.setPadding(5, 5, 5, 5);
        mypropImg2.setScaleType(ScaleType.FIT_CENTER);
        mypropImg2.setPadding(5, 5, 5, 5);
        mypropImg3.setScaleType(ScaleType.FIT_CENTER);
        mypropImg3.setPadding(5, 5, 5, 5);
4

1 回答 1

1

onCreate这种情况下成立。

if (Modules.idCounty == null || Modules.idCounty.equals("")) {
            System.exit(0);
        }

由于System.exit(0); VM exiting并且您的应用程序正在崩溃。

于 2013-10-08T14:57:50.830 回答