2013-10-08 42 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