美文网首页Android技巧
ClassNotFoundException——Android史

ClassNotFoundException——Android史

作者: melloyy | 来源:发表于2019-03-14 16:59 被阅读0次

问题来源:

同一款app 同一个点击 在某些机器上报classnotfoundexception 不同机器上报的找不到的类千奇百怪 还有机型报错是Activity could not be started for Intent  某些机器一切正常 

经过n小时的奋战发现


' /**

    * Modifies the standard behavior to allow results to be delivered to fragments.

    * This imposes a restriction that requestCode be <= 0xffff.

    */

    @Override

    public void startActivityForResult(Intent intent, int requestCode) {

        // If this was started from a Fragment we've already checked the upper 16 bits were not in

        // use, and then repurposed them for the Fragment's index.

        if (!mStartedActivityFromFragment) {

            if (requestCode != -1) {

                checkForValidRequestCode(requestCode);

            }

        }

        super.startActivityForResult(intent, requestCode);

    }

    @Override

    public void startActivityForResult(Intent intent, int requestCode,

            @Nullable Bundle options) {

        // If this was started from a Fragment we've already checked the upper 16 bits were not in

        // use, and then repurposed them for the Fragment's index.

        if (!mStartedActivityFromFragment) {

            if (requestCode != -1) {

                checkForValidRequestCode(requestCode);

            }

        }

        super.startActivityForResult(intent, requestCode, options);

    }

'


千万不要用startActivityForResult(Intent intent, int requestCode, @Nullable Bundle options) 方法

相关文章

网友评论

    本文标题:ClassNotFoundException——Android史

    本文链接:https://www.haomeiwen.com/subject/lujcmqtx.html