获取toast值

/**
* 获取Toast的String值
* @return
*/
public String getToast(int timeout){
TextView toastTextView = null;
String toastText = "";
long endTime = SystemClock.uptimeMillis() + timeout;
while(SystemClock.uptimeMillis() < endTime){
toastTextView = (TextView) solo.getView("message", 0);
if(null != toastTextView){
toastText = toastTextView.getText().toString();
break;
}else {
solo.sleep(10);
}
}

原网址链接:http://www.2cto.com/kf/201502/374776.html

 

posted @ 2016-08-18 14:06  一直很安静2016  阅读(269)  评论(0编辑  收藏  举报