android-widget

How can we view webpages in our android application without opening browser?

主宰稳场 提交于 2019-12-24 00:23:16
问题 Hey i am developing an android application , and i want to connect to web inside that application. However i have tried WebView to someextent but its displaying file's on my directory fine but when connecting to google.com it display's an error ! Then i added this file <uses-permission android:name="android.permission.INTERNET" /> in my Manifest.xml and now the the url(google.com) is being displayed in the browser Any help how i can open the browser inside my application ? 回答1: Using webview.

Access to standard android settings: PIN code of the SIM card

左心房为你撑大大i 提交于 2019-12-23 22:18:44
问题 This is my first question! I'd like to know how to access to standard settings in android, in particular SIM features. On boot, my Samsung i-9000 shows the window for insert the PIN code only for a few seconds, then disappears, so I'd like to develop by myself a widget for the homescreen that launch the standard window to insert the PIN code, but I don't know how can I do it! Or someway to change the screen timeout of that window... Thank you very much! 回答1: By using the TelephonyManager in

How can I use the new xml attributes and be compatible with older Android versions?

。_饼干妹妹 提交于 2019-12-23 21:25:58
问题 I have added widget functionality to my app, which is compatible with older versions of Android (back to 1.6). Widgets in Android 3.1+ support the xml tag resizeMode which is a very useful feature and I'd like to allow users to resize their widgets. But I'd like to still be backwards compatible with 1.6 (or 2.1 would be good enough too). How can I do this? Can I have selective xmls? Currently I am tagetting 1.6. Thanks! 回答1: You can put resources that are intended for more recent API levels

Android: Widget takes too much place

社会主义新天地 提交于 2019-12-23 20:26:31
问题 I faced with a strange problem with my widget size. I decided to develop one simple widget with supporting of ldpi, mdpi, large-mdpi and hdpi screens. At first I created xml/widget.xml where I defined the following: <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minHeight="146dip" android:minWidth="220dip" android:updatePeriodMillis="0" android:initialLayout="@layout/widget"/> So I expect that my widget will take 3x2 cells for all supported screens.

Make children of HorizontalScrollView as big as the screen?

强颜欢笑 提交于 2019-12-23 18:00:05
问题 The way I solved this problem is by creating a custom view for the child views, and then overriding onMeasure() for the custom view. The new onMeasure() sets the width and height to be as large as possible. The problem is when you show the soft keyboard and rotate the phone. With the orientation change and the keyboard showing, onMeasure() sets the "largest" available height to be something ridiculously small, so when I hide the keyboard, the child views have the wrong size. Is there a way to

Android: Clickable imageview widget

走远了吗. 提交于 2019-12-23 16:17:24
问题 I want to make a very simple widget: It must consist from just one image view 1) on incoming sms it should change the image 2) on click it also should change the image I tried to make it using ImageButton but failed: there were problems with changing the image on sms received event: new image had wrong scale. Anyway now I want to make an ImageView without anything else. The problem is that I can't handle onClick event: I've got a running service which should handle all events: sms received

Spinner with drawSelectorOnTop

跟風遠走 提交于 2019-12-23 15:49:03
问题 What is the purpose of drawSelectorOnTop in a Spinner? Whether I set this flag to "true" or "false", I cannot see any difference. Thanks 回答1: Well, like the name says it displays the selector control on top of the contents of the Spinner. Whether or not there will be visual differences will depend on the style/contents of the Spinner. This is an example. You'll note that the selector control appears to be on top of the Spinner 回答2: Spinner does NOT support android:drawSelectorOnTop, as it

Android: Sub-class Gallery doesn't scroll by onKeyDown event

和自甴很熟 提交于 2019-12-23 13:17:07
问题 I have a sub-classed Gallery widget which I customized its onFling method, otherwise everything should be the same as the original Gallery widget. And I am trying to animate its scrolling left or right by using: gallery.onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, new KeyEvent(0, 0)); But that doesn't seems to work on the sub-class Gallery. Any idea why? 回答1: If you guys have this problem, try get rid of the gallery spacing value -- that solved it for me. 来源: https://stackoverflow.com/questions

Android: Sub-class Gallery doesn't scroll by onKeyDown event

三世轮回 提交于 2019-12-23 13:17:06
问题 I have a sub-classed Gallery widget which I customized its onFling method, otherwise everything should be the same as the original Gallery widget. And I am trying to animate its scrolling left or right by using: gallery.onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, new KeyEvent(0, 0)); But that doesn't seems to work on the sub-class Gallery. Any idea why? 回答1: If you guys have this problem, try get rid of the gallery spacing value -- that solved it for me. 来源: https://stackoverflow.com/questions

Transparent widget background?

徘徊边缘 提交于 2019-12-23 13:16:44
问题 On Android widgets, how can I give the background a color, yet make is transparent at the same time? Please see the background on the clock at the screenshot. It's a black, yet transparent background. How can I do that on my own widget? Can I maybe also reference system colors, like the one on the screenshot from HTC Sense? Thanks for any hint! 回答1: You have to specify an alpha-channel (=transparency channel) for your ressources. If you are using a standard color in your XML res (e.g. from