参考文章 http://blog.csdn.net/u012338845/article/details/46646205
问题:Toast.makeText(getActivity(), str, Toast.LENGTH_SHORT).show();空指针异常
解决:做一个判断非空操作
public void toast(String str) {
if (getActivity() != null) {
Toast.makeText(getActivity(), str, Toast.LENGTH_SHORT).show();
}
}