android-widget

Android : Receive custom broadcast when a button in a widget is clicked

I have a BroadcastReceiver that works fine, i.e. executing this code from an Activity, the receiver receives the intent: Intent toggleIntent = new Intent(this, ToggleServicesReceiver.class); this.sendBroadcast(toggleIntent); But I am trying to do the same from a button in a Widget: public void onUpdate(Context context, AppWidgetManag...

How to set the italic hint of edit text in android?

Hie friends, I have an doubt, how to set the hint text as italic in android. Please help? Thanks and Regards Niladri ...

Why can't one add/remove items from an ArrayAdapter?

I am using an ArrayAdapter<CharSequence> to populate the items to list in a android.widget.Spinner. That works all fine. But now I want to keep the list of items dynamic, i.e. I want to be able to add/remove items from the selection list at runtime. However, when I call adapter.add(item) or adapter.remove(item) I always get a Unsupporte...

Custom Widget using LinearLayout not getting onDraw()

I'm creating a custom widget by extending LinearLayout: public class MyWidget extends LinearLayout { private static Paint PAINT = new Paint(Paint.ANTI_ALIAS_FLAG); static { PAINT.setColor(Color.RED); } public MyWidget(Context context) { this(context, null); } public MyWidget(Context context, Att...

setOnclilcklistener for images of footer

Hello i am adding a footer having 2 imageviews to my app using include tag. I am able to view the footer and access the image view ids in source code but am not able to setOnclicklistener to these imageviews. In main.xml i have include layout="@layout/common_footer" In common_footer.xml ?xml version="1.0" encoding="UTF-8"? LinearLay...

How to replace the comma with a space when I use the "MultiAutoCompleteTextView"

Hello,friends: I'm doing a simple program using "MultiAutoCompleteTextView" to prompt the common words when I inputing several letters. code: ArrayAdapter<String> adapter = new ArrayAdapter<String>( this, android.R.layout.simple_dropdown_item_1line, ary); MultiAutoCompleteTextView textVi...

Listview items appear under tab in tabview

When this displays the first two rows of the listview appear under the tabs, the Mercury, and Venus planets. How do I get the tabs to occupy the top and the listview rows to start after the tabs? tablistmenu.xml: <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="...

Using ArrayListAdapter with ListView

Hi guys I am using a custom ArrayAdapter in order to populate a ListView in my page. This is the initation code of that adapter: public IngredientListAdapter(Context context, int layout_resourceid, ArrayList<RecipeItem> items) { super(context, layout_resourceid); this.items = items ; ctx = context; } To this array adapter...

How can I login to my application and show a google Map?

I am building an Android App. It has a login screen which when a user logs in, it crashes when the google maps MapView is in the layout/map.xml What am I doing wrong? ...

Validating EditText content as soon as user enters data

Hi, I have 2 EditText widgets ,one takes username and other takes password.When the user enters username in First EditText ,the text should be validated (It should accept only characters no digits) when the focus is on the first EditText. How to achieve this. It needs to display error message using setError() method in EditText when the ...

My widget drains battery on some phones

Hi, I have a widget that appears to drain the battery on some of my users phones but it works fine on my Nexus One (Froyo). Phones that has reported battery drain are HTC Legend, SE X10 and SE X10 mini. Anyone know if there is any known issues or something? // Johan ...

The famous scroll table problem...

After recently having to implement a scroll-table in JavaScript (i.e. a table that scrolls but leaves the headers visible so that one can easier visually associate cells with the correct columns) I now seem to bump into this very same problem on Android! I have a longish TableLayout which I therefore need to put into a ScrollView. I wou...

Can't declare a variable in my Widget Intent

Totally at my wits end. Created a widget intent/pendingintent. I am trying to set a variable to the value of the current ringer mode: AudioManager mAudioManager = (AudioManager) getSystemService(Service.AUDIO_SERVICE); int ringerMode = mAudioManager.getRingerMode(); Log.d(TAG, "ringerMode value=" + ringerMode)...

Security exception while calling bindAppWidgetId

Hello, While developing a Launcher (Homescreen) application for Android, I've come into a security exception I don't understand. When calling the [bindAppWidgetId()][1] method from within my Launcher Activity, I get this security exception : 08-19 11:30:11.689: ERROR/AndroidRuntime(6032): java.lang.SecurityException: bindGagetId ap...

How To Display information in PDF format in Android

Hi, I want to display some copy right agreement in pdf format in EditText or TextView. How to do that in Android ? Are there any APIs or any sample codes ? I will be waiting for valuable reply. Thanks, ...

Adding Custom Background for Widget Based on User Input

I have a widget that displays a set of information. What I would like to do is to give the user the opportunity to choose the background color/image. I would like to have a popup when the user is selecting the widget to choose the background. So how would I make the popup? And how would I apply the background dynamically? Thank you fo...

how to display table using html in webview in Android

hi, How to html table with rows and columns in webview in Android. Can I have one sample Example Thank you ...

Sync Two ScrollView

Situation: I have two ScrollView inside of each of two HorizontalScrollView of a TableRow. Goal: When I touch drag one of ScrollView, another ScrollView must scroll as much. For instance, if I have a list of name on left ScrollView and corresponding phone numbers in right ScrollView, scrolling one ScrollView should not destroy the origi...

How to use MediaController.MediaPlayerControl ?

I am trying to use MediaController.MediaPlayerControl in order to display a MediaController at the bottom of my Custom View but I can't get it to work. It's crashing at the ctrl.show(); with the following Exception whenever I try to load this view: E/AndroidRuntime( 3007): Caused by: android.view.WindowManager$BadTokenException: Unable ...

Keeping an AsyncTask alive in low memory conditions?

I have written a home screen widget as an ImageView, ie. the code generates the whole widget and writes it to RemoteViews as a bitmap. On slower devices with low memory, such as my G1, it can take a couple of seconds to generate the bitmap, and to avoid the dreaded force-close, I moved all the graphics code into an AsyncTask. So far so g...