2013-10-08 44 views
1

我的应用程序意外关闭更频繁。在我的日志中,我收到了这条消息。团队请帮我找到这个问题的原因,我该如何解决这个问题。虚拟机退出,结果代码为0,清除跳过

在我的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 

的OnCreate:

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); 
+0

你可以发布'onCreate'功能的活动..? –

+0

@MukeshKumar请参阅编辑的问题。 – Sniper

回答

1

onCreate这个条件变为真。

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

而且由于System.exit(0);VM exiting和应用程序崩溃。

+0

你是对的。我多么愚蠢。不只是看到这一点。 – Sniper