请问如何理解这段代码呢?
private Handler mHandler2 = new Handler(new Handler.Callback() { @Override public boolean handleMessage(Message msg) { Toast.makeText(MainActivity.this, "你好", Toast.LENGTH_SHORT).show(); return true; } }) { @Override public void handleMessage(Message msg) { Toast.makeText(MainActivity.this, "你好2", Toast.LENGTH_SHORT).show(); } };
在Handler用法2 了里面有这段代码,不太理解。。。
new Handler(new Handler.Callback() { @Override public boolean handleMessage(Message msg) { Toast.makeText(MainActivity.this, "你好", Toast.LENGTH_SHORT).show(); return true; } }) //这里创建了一个对象
那么对象后面跟着那个花括号是什么?方法吗?