android-widget

How to change the icon of tab host once setup? (Android)

Hello, I am trying to change the Icon of one of the tabs of tab host at run time. I am not able to figure out hwo to do with the widget. could some one let me know how its done ? spec = tabHost.newTabSpec("hello").setIndicator("hello", res.getDrawable(R.drawable.tab1)).setContent(intent); tabHost.addTab(spec) The xml file is...

Stretch video to full screen in a SurfaceView extension

I have created a widget that is an extension of SurfaceView (very similar to VideoView) and I am working on a feature to stretch the video fully across the device screen when certain action is taken. I've looked at onMeasure function of VideoView and re-wrote it this way: @Override protected void onMeasure(int widthMeasureSpec, int heig...

How can I setup Eclipse for better Android Widget development?

I'm trying to develop a widget for Android. I'm using Eclipse but I can't get the view editor setup to match what I'm going to see when I deploy to my phone. I'm creating a 4x1 widget. I've gone through and tried setting up a new "Device" so that I can preview what the widget will look like before I deploy. I said the device is landscap...

Android customizing ViewFlipper...

So I'm having pretty much exactly the problem described here: http://code.google.com/p/android/issues/detail?id=6191 and until the ViewFlipper issue in 2.1 and 2.2 has been resolved, I'm attempting to customize my own ViewFlipper in the manner described: @Override protected void onDetachedFromWindow() { try { super.onDetac...

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

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? ...

Position of builtInZoomControls in WebView and MapView

I noticed that the position of the builtInZoomControls in WebView (bottom, horizontal right) is not consistent with the default position in the MapView (bottom, horizontal center). 1) Why is that not consistent? (Probably a question to be asked to Google) 2) Is there a way to horizontal center the builtInZoomControls of the WebView wit...

Datepicker and timepicker from within a single Dialog

Please tell me how to implement both Datepicker and timepicker from within a single Dialog. Thanks, susanta ...

Send a public broadcast from an AppWidget in Android

I have a widget for a music player and want to be able to send broadcasts when pushing the different buttons. What I want to do is when a button is pushed, the widget sends a public broadcast to another BroadcastReceiver so it can handle the different actions. In my activity class with the BroadcastReceiver: private BroadcastReceiver b...

Tunning up Activity with dialog theme

I need to launch a Dialog from home screen widget, so I created an Activity with android:theme="@android:style/Theme.Dialog" The problem is, that I would like make it look like standard dialog window ( buttons on the gray background, font and text size, paddings etc), like here: This is how my "dialog" Activity looks like: Is ther...

android touch animating object in canvas

Hello, Please tell me how to get touchlistener for bitmap object which is animating inside the canvas, I want to stop by touching it and then want to drag wherever I want on the screen. Please tell me - it's urgent. thanks. ...

android dynamical binding

I want to work dynamically therefore I want to bind text views dynamically I think an example would explain me the best assuming I want to bind 7 image views i can do it like this : Country = (EditText)findViewById(R.id.CountryEditText); City = (EditText)findViewById(R.id.CityEditText); LivinigCreture = (EditText)findViewById(R.id....

android R.layout concept

can I genrate java code instead using xml code ? lets say i want to do this xml code in a loop : <TableRow android:id="@+id/LivingCreture" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:text="LivingCreture" android:gravity="left" android:id="@+id/LivingCretureT" android:layout_width...

how to Set already running activity, when user clicks on app icon on home screen

I have Two activities One splash screen, Player screen. When user clicks on my app icon first splash screen is displayed and then player screen When player activity is running, if user returns to the home screen and then again clicks on app icon, the application is starting from the splash screen again. can any one please help me ou...

Alternatives to static variables in Android

I am using static Arrays and HashMaps to store some values in my AppWidgetProvider class. But they are becoming null when the process dies, so the widget does not work anymore. Are there any alternatives to using static members to store data for an AppWidgetProvider in Android? ...

How to resize a widget after it is selected from the widget menu.

I am creating a widget and I want to be able to have the user select the size of the widget in a menu during the configuration activity. My problem is that in the appwidget-provider meta data xml, the block size is already set before the configuration activity is already entered. I need to be able to reset the info of the widget, which c...

Andorid - Text dropdown/selection of Spinner does not show

Hi, I'm using this sample code to populate the Spinner. Data is read from database. The selection displays correctly - in this case, it shows "Green" and "Red". Spinner spinnerColor = (Spinner) findViewById(R.id.spinnertProfile); mProfileDbHelper = new ProfileDbAdapter(this); mProfileDbHelper.open(); Cursor profilesCu...

How to resize image from Uri?

Hi im retrieving image from URI and displaying in Imageview. I need to re-size image from URI to fit size of the Imageview. Pls help me how i can do this. Thanks ...

android sqlight invoked from calss

I am using Gamelogic class which implements no one (just object to be honest ) and i want from him to set a data base where the game screen ask the logic questions and the last ask the sql question without all the Context usage , just to keep it simple . is it possible ? if not what is the alternative , can someone show me little examp...

android surfaceflinger native code restarting Android

Hi Experts, I am trying to run surfaceflinger client code for Android 2.0 platform. It is supposed to post frames on android surfaceflinger. It is resulting in crash of the Android OS and resulting in restart of the emulator. Please help. Many thanks. Kind Regards -Durgesh O Mishra Here is the code. int main(int argc, char** argv) {...

Android Froyo WebView doesn't scroll vertically

Hi all, I have a WebView widget in my app that displays custom HTML content. This is my layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:id="@+id/main_...