攔截應用Toast 攔截應用Toast

攔截應用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;
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章