android - VM 退出,结果代码为 0,清除已跳过

标签 android

我的应用程序意外关闭的频率更高。在我的日志中,我收到了这条消息。团队请帮我找到这个问题的原因,我该如何解决。

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

最佳答案

onCreate 中,此条件成立。

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

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

关于android - VM 退出,结果代码为 0,清除已跳过,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19249784/

相关文章:

java - GraphView水平日期标签无法换行

java - 如何创建一个新的 Bundle 对象?

mysql - 如何在android模拟器中获取mysql数据库连接

Android:如何在 SAX 解析器中解析相同的标签?

java - 驱动 Api 电话

android - 如何实现像whatsapp blue tick mark这样的消息阅读状态?

android - 如何动态绘制垂直线?

java - 媒体播放器搜索栏搜索无法正常工作

android - 如何选择我在 Android 上使用的麦克风?

android - 为 Android 全屏制作 Xamarin 表单