android-widget

Is it possible to change the increment of NumberPicker when long pressing?

坚强是说给别人听的谎言 提交于 2019-12-11 02:29:57
问题 I have range of 3900 numbers which the user use the NumberPicker to pick one single number from. Now, when long pressing up/down arrows in the picker, the numbers are increased/decreased slowly. I have sat the setOnLongPressUpdateInterval() to 0 milliseconds, but it still increment slowly in this large range of numbers. Is it possible to change the increment in the picker when long pressing the up/down arrows so it increases numbers by lets say 100, and turns back to increment of 1 when

SurfaceView in widget

十年热恋 提交于 2019-12-11 02:26:10
问题 I am implementing a widget for TV application in which I want to show streaming so I have to place SurfaceView in it. As widget has RemoteViews, how can I use SurfaceView to set value of SurfaceHolder ? I have defined SurfaceView in xml. I have searched on internet but didn't find any help. I want instance of SurfaceView so that I can play with it. 回答1: As widget has RemoteViews, how can I use SurfaceView That is not possible. SurfaceView is not available for use with app widgets, as is

Updating multiple instances of App Widget in Android

霸气de小男生 提交于 2019-12-11 02:23:06
问题 Trying to create multiple instances of app widget and update each of them separately, but can't find our why it's not working properly. Here is the code, collected from here and modified somewhat: package com.example.widgetagain; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.widget.RemoteViews; public

How to Detect if Launcher Home Screen Supports Rotation

℡╲_俬逩灬. 提交于 2019-12-11 02:09:53
问题 I need to check if the device launcher home screen support orientation, is that possible? if so please help me out. for instance, Samsung Galaxy Note 2 does not support launcher orientation while Galaxy Mega does. 回答1: You can handle yourself the screen rotations by modifying the Manifest file, just add android:configChanges="orientation" for the activities you want. It means that the system will not handle by itself the orientation changes anymore. Then in order to implement the actions to

Widget UI not updating in response to broadcast

纵饮孤独 提交于 2019-12-11 01:48:43
问题 I have a couple of widgets which are basically quick links to functionality within my app, These widgets are basically ListView/GridViews which are being backed by data that changes during the main App's execution. Since the data is only changed during app execution the update frequency is set as so: android:updatePeriodMillis="0" and on the data changed I fire the following: public void updateWidget(@SuppressWarnings("rawtypes") Class provider) { AppWidgetManager appWidgetManager =

Button click does not start Service in Android App Widget

三世轮回 提交于 2019-12-11 01:39:57
问题 I'm having trouble starting a Service to update an AppWidget that I'm creating as an exercise. I'm trying to get the latitude and longitude of spoofed location data from DDMS to display in the widget. The widget uses a service to update the TextView, which may be slightly overkill, but I wanted to follow the template that seems to be common in AppWidgets that do more work (like the Forecast widget or the Wiktionary widget). Right now, I'm not getting any error messages or strange behavior;

Action bar custom style in my case

北慕城南 提交于 2019-12-11 01:37:16
问题 I am using Android native action bar. I would like to add my own drawable resource as the background of the action bar. So, I made a theme like following: res/values/themes.xml : <style name="Theme.MyStyle" parent="android:style/Theme.Holo.Light"> <item name="android:background">@drawable/my_bg</item> </style> Then, in AndroidManifest.xml file I add this style to my application: <application android:debuggable="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name"

how change screen led like Cyanogenmod widgetrenderFx night mod

泄露秘密 提交于 2019-12-11 01:32:29
问题 i work about application how can change android screen brightness, can somme help me by giving some examples of how to doing this. Thanks :-) 回答1: This peice of code will set the brightness: private void setBrightness(int brightness) { try { IHardwareService hardware = IHardwareService.Stub.asInterface( ServiceManager.getService("hardware")); if (hardware != null) hardware.setScreenBacklight(brightness); } catch (RemoteException doe) { } } Do not forget to add to your manifest <uses

How to achieve multitouch for whole activity?

寵の児 提交于 2019-12-10 23:41:27
问题 I have one activity which is having linear layout and inside this layout there are several linear layouts and each linear layout is having set if buttons and text views. I want to achieve multi touch feature for whole screen means if user perform zoom in-zoom out using his finger then it should zoom in and zoom out whole screen(increase and decrease all buttons,text views size accordingly once). How to achieve it using android 2.1? regards, Piks 回答1: This might give you an idea: import java

How to Set Layout with Mapview

蹲街弑〆低调 提交于 2019-12-10 22:39:35
问题 I have created the Application in which i m Using MapView. Now i want to Use the Back Button in My that MapView. I have develop the Layout but it cant seen the Button over mapview. When i push back button from Emulator then the Mapview become close and the Back button is shown. Can anybudy help me How to Show Back Button on the MapView. ? Thanks. 回答1: Bo basically it may be possible with the overlays but I have done it using RelativeLayout stuff <RelativeLayout android:id="@+id/headerlayout"