android-widget

How to divide screen into three parts vertically?

三世轮回 提交于 2019-12-21 04:16:40
问题 I have screen with ScrollView and three different LinearLayouts . One LinearLayout contains a Spinner and second contains ListView and third contains two Buttons ( horizontal ). I want to display a screen that contains 3 LinearLayouts always displayed at bottom of screen and 1 LinearLayout always displayed on top. In middle part , i want to display ListView content. So that on whole screen there is no blank space present. I want to create screen for multiple devices which has different sizes.

Widgets configured with android:configure will receive onUpdate even if configuration is unfinished

混江龙づ霸主 提交于 2019-12-21 03:57:14
问题 This is how I configure my APP's widget: <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="240dp" android:minHeight="193dp" android:updatePeriodMillis="86400000" android:initialLayout="@layout/xyz_appwidget" android:configure="com.xyz.activity.Configuration" /> Therefore, the system will bring up the Configuration activity, once the widget has been put on the homescreen by the user. Unfortunately, without the configuration applied, this widget

What is difference between ` DialogInterface.dismiss()` and `DialogInterface.cancel()`? [duplicate]

蹲街弑〆低调 提交于 2019-12-21 03:34:18
问题 This question already has answers here : What is the difference between a dialog being dismissed or canceled in Android? (3 answers) Closed 2 years ago . While working with dialogs in android one can cancel it or dismiss it, But when to use dismiss and when to use cancel? what is the difference between them? Thanks in advance. 回答1: public void cancel () Since: API Level 1 Cancel the dialog. This is essentially the same as calling dismiss(), but it will also call your DialogInterface

Android PullTo Refresh on ScrollView

心已入冬 提交于 2019-12-21 02:55:15
问题 I know that pullToRefresh like functionality is available in the iPhone and for the Android we have to manage it manually. I got some example the having pullToRefresh but it works on the ListView only. In my case I want to implement for the Scrollview. Something like PullToRefresh available in DrawFree app in Google Play. Please see below image: So, how to implement it? 回答1: This is a excellent example of implementing pull to refresh in ListView, GridView, WebView, Expandable ListView. You

how to make columns in table layout spread evenly making maximum use of space available

妖精的绣舞 提交于 2019-12-20 17:48:13
问题 I was just trying out with table layout to display some data.... The data is a 3 column data and i want that the columns should utilize the whole width available. But it seems that the layout XML code which i had used is just wrapping up the columns according to the content. Layout XML code <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TableRow android

RadioGroup,setEnabled(false)not working!

人盡茶涼 提交于 2019-12-20 16:16:07
问题 I have used setEnabled(false) to set it unable,But it doesn't work. and after this method ,the value of RadioGroup.IsEnabled() is false. The value was changed. The code is from Android Programming Guide. Ps: The Spinner component use the setEnabled(false) is well. code is as follows: package com.example.testviews; import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget

Possible to define widget's behaviour/layout for resize and orientation change in 3rd party launchers?

為{幸葍}努か 提交于 2019-12-20 15:31:24
问题 I can't seem to find anything on the following problem with a widget I want to code: Apart from the resize-ability introduced in Android 3.1, I want my widget to be resizable in custom launchers like LauncherPro or ADWLauncher. Is there a way I can define how my widget changes its layout once it's resized? So, for example, button A is shown on the left for 2x1 but is shown on te right for 3x3. Also I want it to change its appearance/layout when due to screen rotation the widget size changes

How to embed a View (with Buttons, etc.) inside an EditText?

不想你离开。 提交于 2019-12-20 12:47:22
问题 I'm trying to figure out how to embed things, other than Drawables, inside an EditText widget. Specifically the example I'm thinking of is from the Google Buzz widget: screenshot (no inline image, sorry, I'm a newb) It appears to the casual observer that there's an entire layout object pinned to the bottom of the EditText, containing an ImageView, a TextView, and a Button. Anyone have any idea how to pull this off? Or do we think this is a custom subclass of EditText? 回答1: The EditText +

Android Widgets: Animations on RemoteViews ? [duplicate]

倖福魔咒の 提交于 2019-12-20 11:22:23
问题 This question already has answers here : Is there a way to animate on a Home Widget? (5 answers) Closed 3 years ago . I'm not having too much success applying animations to views inside a RemoteViews . For the sake of simplicity, let's say I have a widget with an ImageView and a Button . When clicking the button, I want to add a simple animation to the ImageView (a rotation for example). Since I can't get a reference using findViewById() like in an Activity and RemoteViews doesn't have a

Android Widgets: Animations on RemoteViews ? [duplicate]

ぃ、小莉子 提交于 2019-12-20 11:21:31
问题 This question already has answers here : Is there a way to animate on a Home Widget? (5 answers) Closed 3 years ago . I'm not having too much success applying animations to views inside a RemoteViews . For the sake of simplicity, let's say I have a widget with an ImageView and a Button . When clicking the button, I want to add a simple animation to the ImageView (a rotation for example). Since I can't get a reference using findViewById() like in an Activity and RemoteViews doesn't have a