============问题描述============
搜的都是重写handleMessage(),如下:
//处理跳转到主Activity private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub Log.d(">>>>>Mhandler", "开始handleMessage"); Intent mIntent = new Intent(); mIntent.setClass(LoadingActivity.this, PalmHospital_main_Activity.class); startActivity(mIntent); LoadingActivity.this.finish(); Log.d(">>>>>Mhandler", "LoadActivity关闭"); if (dialog.isShowing()) dialog.dismiss(); } };
但素我用android studio是咋木有handleMessage这个方法?
我只有下面几个。。。,求解。。。。。。或者还有其他的方法实现progressdialog么??
private Handler mHandler=new Handler() { @Override public void close() { } @Override public void flush() { } @Override public void publish(LogRecord record) { } }
============解决方案1============
你用错类了,你用的是java.util.logging.Handler,实际上你应该用android.os.Handler
时间: 2024-10-28 16:43:31