[android-beginners] WebView load local file
Hi: I tried use webview loadUrl load local file, the file name includes Chinese character. For example: file:///sdcard/简介.htm, but load failed, webview said that the file can not be found. it showed http address is:file:///sdcard/%80%CB.htm. I don't know why, I tried it on browser, the same issue is happened on browser. Anybody can help me and tell me the reason? Thanks a lot! Regards, Chao --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] How to use OrientationEventListener
Hi: I want to use this listener to catch the screen orientation change. But I don't know how to use it, I tried new it and add my codes in its method onOrientationChanged, the codes looks like: myOrientationListener = new OrientationEventListener(this) { public void onOrientationChanged(int orientation) { System.out.println(**onOrientationChanged); if (null == mWebViewState) // save some state for current view so that restore them for new screen orientation . } }; myOrientationListener.enable(); I put these codes in onCreate() function, no exception raised when application run, but the screen is black, nothing could be showed in my web browse view. I looked the ddms output: 06-02 18:12:19.708: INFO/System.out(7216): *onCreate() 06-02 18:12:19.708: INFO/System.out(7216): onStart() 06-02 18:12:19.717: DEBUG/qemud(560): fdhandler_accept_event: accepting on fd 10 06-02 18:12:19.717: DEBUG/qemud(560): created client 0xc088 listening on fd 14 06-02 18:12:19.727: DEBUG/qemud(560): client_fd_receive: attempting registration for service 'sensors' 06-02 18:12:19.727: DEBUG/qemud(560): client_fd_receive:- received channel id 9 06-02 18:12:19.727: DEBUG/qemud(560): multiplexer_handle_control: unknown control message (26 bytes): 'ko:connect:09:service busy' 06-02 18:12:29.197: WARN/ActivityManager(582): Launch timeout has expired, giving up wake lock! Seems the listener register is failed. I don't know why and also don't know how to use it, is it need to register on SensorManager? But I did not find any about register function for it in SensorManager. Could you help me? Thanks a lot! My intent of using it is that I want to keep the same web page and same browsing position in this listener only after screen orientation is changed. If you have another idea for my purpose without using OrientationEventListener, please tell me and thank you very much! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: How to use OrientationEventListener
Hi Mark: I've read that five posts about Rotational Forces. I choose the onRetainNonConfigurationInstance method to keep my current state and restore them in onCreate or onStart with getLastNonConfigurationInstance function. But there is a bug in emulator I think. Only when the screen change from horizontal to vertical, you can find your activity will be created twice. In first creation, the onRetainNonConfigurationInstance function will be called and then the kept state may be cleared by this calling. Why I think this may be a bug only in emulator? because I tried on my G1 seems no same issue found. Anyway, I think I can use this way. But I think sometimes I need catch the orientation change, some things only can be done when this behavior happened. Yeah, We can think this is a special requirement. So I tried to use OrientationEventListener, but failed. Except my initial intent, I just want to learn how to use this class now. If you know, could you please help me? I did not find any example with google search. Thanks a lot! On Jun 3, 2:26 am, Mark Murphy mmur...@commonsware.com wrote: I want to use this listener to catch the screen orientation change. Why? My intent of using it is that I want to keep the same web page and same browsing position in this listener only after screen orientation is changed. If you have another idea for my purpose without using OrientationEventListener, please tell me and thank you very much! http://wiki.andmob.org/samplecode Scan that page for the Rotational Forces...On Your App bullet point, which contains links to five blog posts on handling screen rotations. Note that keeping the browsing position may be rather difficult. If the Browser application does what you want, you may wish to review its source code to see how it does it. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Can I launch context menu with single click!
I want to launch context menu with single click. But the default is long click, Is there another way to do? Thanks a lot! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---