ali*_*tha 0 testing android toast
有没有办法在android中获取与特定android Toast对象关联的消息?
toast=Toast.makeText(getAppContext(), message, Toast.LENGTH_LONG);
toast.show();
Run Code Online (Sandbox Code Playgroud)
现在在我的测试课中,我想从这个 toast 对象中获取消息
有没有办法在android中获取与特定android Toast对象关联的消息?
这样做:
Toast toast=Toast.makeText(getAppContext(), message, Toast.LENGTH_LONG);
toast.show();
View view = toast.getView();
TextView tv = (TextView)view.findViewById(android.R.id.message);
String strMessage=tv.getText().toString();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
883 次 |
| 最近记录: |