您
findViewById()以错误的方式调用该方法。应该在
Activity本身而不是引用上调用它
Button。更换
b1=(Button) b1.findViewById(R.id.button);
与
b1=(Button) findViewById(R.id.button);
此时的
b1引用为null,这是的原因
NullPointerException。

您
findViewById()以错误的方式调用该方法。应该在
Activity本身而不是引用上调用它
Button。更换
b1=(Button) b1.findViewById(R.id.button);
与
b1=(Button) findViewById(R.id.button);
此时的
b1引用为null,这是的原因
NullPointerException。