美文网首页
拦截应用Toast

拦截应用Toast

作者: android_Pie | 来源:发表于2022-09-20 16:59 被阅读0次

    拦截应用Toast

    frameworks\base\core\java\android\widget\Toast.java
    /**
    * Show the view for the specified duration.
    */
    public void show() {
    if (mNextView == null) {
    throw new RuntimeException("setView must have been called");
    }

        TextView tv = (TextView)mNextView.findViewById(com.android.internal.R.id.message);
    
        if(tv.getText().toString().contains("boot fail") || tv.getText().toString().equals("boot fail ->")){
                cancel();
                return;
        }

    相关文章

      网友评论

          本文标题:拦截应用Toast

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