Skip to content

Commit

Permalink
Merge pull request #9 from bihe0832/master
Browse files Browse the repository at this point in the history
解决Android 7.1.1起不能再用Toast的问题(先解决crash)
  • Loading branch information
liaohuqiu authored Dec 9, 2016
2 parents 5d6dbaf + d3a17cd commit 2a296c0
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ public void show() {

int flags = 0;
int type = 0;


if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
type = WindowManager.LayoutParams.TYPE_TOAST;
//解决Android 7.1.1起不能再用Toast的问题(先解决crash)
if(Build.VERSION.SDK_INT > 24){
type = WindowManager.LayoutParams.TYPE_PHONE;
}else{
type = WindowManager.LayoutParams.TYPE_TOAST;
}
} else {
type = WindowManager.LayoutParams.TYPE_PHONE;
}
Expand Down

0 comments on commit 2a296c0

Please sign in to comment.