为什么我的Handler类中没有sendMessge方法,感觉写这个Handler中方法完全不
public void run() { try { URL url = new URL(mUrlName); HttpURLConnection fileConection = (HttpURLConnection) url.openConnection(); fileConection.setRequestMethod("GET"); fileConection.setReadTimeout(8000); fileConection.setConnectTimeout(8000); InputStream is = fileConection.getInputStream(); int TotalLen = fileConection.getContentLength(); Bitmap bitmap = BitmapFactory.decodeStream(is); Message message = Message.obtain(); message.what = 10008; message.obj = bitmap; //mHandler.sendMessage(message); mHandler.sendMessage(message);//此处在编辑器里显红,说明没有此方法 } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException E){ E.printStackTrace(); }} |
免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。
版权声明:作者保留权利,不代表天盟立场。
|
|
|
|
看一下你的handler 是哪一个包下的handler
需要是 下面这个包下的
importandroid.os.Handler;你有可能导包错了,导成了
java.util.logging.Handler |
|
|
|
|