是因为有了源码那段注释, 所以你认为要try...catch么?我觉的有没有这个,和能不能编译没关系哈

解决方案 »

  1.   

    因为有更顶层的东东已经把这个接掉了。。
    例如你的base
      

  2.   

    那再看一下makeText(context, context.getResources().getText(resId), duration);这个方法的实现
    也许里面就处理了
    猜的
      

  3.   

        /**
         * Make a standard toast that just contains a text view.
         *
         * @param context  The context to use.  Usually your {@link android.app.Application}
         *                 or {@link android.app.Activity} object.
         * @param text     The text to show.  Can be formatted text.
         * @param duration How long to display the message.  Either {@link #LENGTH_SHORT} or
         *                 {@link #LENGTH_LONG}
         *
         */
        public static Toast makeText(Context context, CharSequence text, int duration) {
            Toast result = new Toast(context);        LayoutInflater inflate = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            View v = inflate.inflate(com.android.internal.R.layout.transient_notification, null);
            TextView tv = (TextView)v.findViewById(com.android.internal.R.id.message);
            tv.setText(text);
            
            result.mNextView = v;
            result.mDuration = duration;        return result;
        }实现如上,反而没有抛出异常的代码。
      

  4.   

    非常奇怪,感觉这不符合java语法啊