android-widget

Heterogeneous GridLayout

别等时光非礼了梦想. 提交于 2019-12-17 03:54:08
问题 UPDATE - my working solution: https://stackoverflow.com/a/21233824/902172 I am trying to implement the layout below: I guess GridLayout is suitable for my needs but after 2 hours of struggle I couldn't create even a similar layout.. The layout is resizing itself wrongly , it exceeds the screen of the phone and it also does not span the specified rows and columns. Here I selected a button so you can see how it exceeds the boundaries: and here is the associated xml code: https://gist.github.com

Multiple Instances Of Widget Only Updating Last widget

大憨熊 提交于 2019-12-17 03:37:20
问题 I have a WidgetProvider and an Configure Activity When the Widget is started it starts with the configure activity and I set it up by making a custom call to the widgetprovider (which you will notice is from the sdk tutorial examples) // Push widget update to surface with newly set prefix AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); AwarenessWidget.updateAppWidget(context, appWidgetManager, mAppWidgetId, position); // Make sure we pass back the original

Multiple Instances Of Widget Only Updating Last widget

半世苍凉 提交于 2019-12-17 03:36:20
问题 I have a WidgetProvider and an Configure Activity When the Widget is started it starts with the configure activity and I set it up by making a custom call to the widgetprovider (which you will notice is from the sdk tutorial examples) // Push widget update to surface with newly set prefix AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); AwarenessWidget.updateAppWidget(context, appWidgetManager, mAppWidgetId, position); // Make sure we pass back the original

Set transparent background of an imageview on Android

拜拜、爱过 提交于 2019-12-16 22:34:32
问题 I am using a web view in which I am adding an image view. How can I set the background of this image view to transparent? I have tried this: mImageview.setBackgroundResource(R.color.trans); Where trans → <color name="trans">#00000000 </color> . 回答1: In your XML set the Background attribute to any colour, White(#FFFFFF) shade or Black(#000000) shade. If you want transparency, just put 80 before the actual hash code: #80000000 This will change any colour you want to a transparent one.. :) 回答2:

Activity in TabActivity doesn't run onCreate Method when clicked second time

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-14 04:01:11
问题 I have a TabActivity which includes 3 tabs . And I set currentActivity as 1 not the default one, 0 . When I start my TabActivity I figured out that Activity0 also runs but Tabactivity shows the interface of Activity1 which I set as currentActivity . Furthermore when I click tab2 (include Activity2) and click again tba1 or tab0, they dont run again. As I think TabActivity just let to run one time. I would like to restart each activiy in tab whenever I click tabs. And I would like to keep these

How can I default to the numeric keypad on focus of an EditText view?

大城市里の小女人 提交于 2019-12-14 03:57:22
问题 I have an EditText field for the user to enter their weight in lbs. How can I override the traditional keyboard and display the numeric keypad instead? 回答1: This didn't work for me. However, I was able to accomplish the aforementioned by either of the following lines: // TYPE_CLASS_NUMBER: Class for numeric text. This displays the numbers/symbols keyboard. editText.setInputType(InputType.TYPE_CLASS_NUMBER); // TYPE_CLASS_PHONE: Class for a phone number. This displays the phone number keypad.

How to force a widget to appear on lock screen programmatically (Android)

删除回忆录丶 提交于 2019-12-14 03:23:58
问题 I want to force a widget to appear on the lock screen in Android. Any ideas or code examples? Thanks in advance. 回答1: First, the standard Android lockscreen framework only supports app widgets from Android 4.1 through 4.4, which is a steadily shrinking portion of the Android device ecosystem. Second, there is no programmatic means, in standard Android, to force the user to add an app widget to the home screen or to the lockscreen. 来源: https://stackoverflow.com/questions/41840622/how-to-force

Setting any value for Gallery spacing will disable onKeyEvent

允我心安 提交于 2019-12-14 02:18:40
问题 I am trying to make the Gallery scroll with animation to left or right when user click on either the left or right buttons. It works well if I use the below code to invoke the keyevent to scroll the gallery: gallery.onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, new KeyEvent(0, 0)); or KeyEvent evtKey = new KeyEvent(0, KeyEvent.KEYCODE_DPAD_RIGHT); gallery.dispatchKeyEvent(evtKey); But once I set any value to the Gallery spacing, the code above stop working. Any clue why this is so? 回答1: This is my

When I click on EditText inside Children group of ExpandableListView, keyboard appears but if I type on it EditText doesn't update

醉酒当歌 提交于 2019-12-14 02:14:36
问题 I have a ExpandableListView that works properly with JSONObject. When I click on group, the children are showed. Children represent comments and, in my case, the last child is ever a EditText. By this EditText I can insert a new comment. The problem is this: if in my adapter I use myEditText.requestFocus() the keyboard works, I mean when I type on it editText is update with characters, but often I have to push more than once on EditText to see the keyboard. If in my adapter I don't use

AppWidgetProvider: onAppWidgetOptionsChanged not being called on widget placement

巧了我就是萌 提交于 2019-12-14 01:44:13
问题 According to the documentation on onAppWidgetOptionsChanged in AppWidgetProvider: "This is called when the widget is first placed and any time the widget is resized." However, when I place my widget on the stock launcher in Android 4.2 and 4.3, this method is not being called immediately (only after I resize the widget). I tried it on my own app, as well as CommonsWare's https://github.com/commonsguy/cw-omnibus/tree/master/AppWidget/Resize Is there something I am missing? EDIT: The only