android-widget

ListPreference is throwing a strange null pointer exception

I have an app that obtains a list of available Calendars and displays them in the Spinner. I have checks to ensure that if the available Calendar list is empty, then ListPreference will still display "None available" in the Spinner. I am using the ListPreference to display the Spinner in the Preferences tab. Here is the preferences.xm...

How to make children of TableRow selectable

Hi, I'm making a image gallery with infinite vertical and horizontal scrolling. I put images inside a ListView to make a column, and put the ListViews inside a TableRow. However, it seems that child views of TableRow is not selectable and as a result I can't select the images in my ListView (easily). Is there a way to pass the events d...

If a text in a TextView is longer than the available space, how to get the remaining lines?

I have a long text and i want it to be displayed with a TextView. The text i have is much longer than the available space. However i don't want to use scrolling, but ViewFlipper to flip to the next page. How can i retrieve the lines from the first TextView that are not shown because the view is to short so that i can paste them into the ...

Android - Making Sliding Drawer to slide from Left-to-Right

I have implemented "Sliding Drawer" in my application using the below XML layout: (I got this example from androidpeople.com) <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/an...

How do I test for activity inactivity time

Hello, I'm wondering what is the highest level I can go in-order to know when the user interacts with my application preface: I'd like to logout of my application after X seconds of user inactivity. so what I did is create a service with a timer, and a toggle function which resets the timer to X time. after X time has passed, an intent ...

[Android] How to implement a little static map preview as list icon?

I built a ListActivity and now I want to add Map Previews as the List Icons. I dont want to extend MapView because: 1st I just need a little static preview and 2nd I already extended to ListView. I already looked into using the static map api, however that also doesnt look quite good in that small dimensions: http://maps.google.com/m...

Push API using C2DM

I have been working on c2dm for push API application. I am new to android and I dont understand the tut given at http://code.google.com/android/c2dm/index.html. Can anyone please guide me here? How would I start making an application that sends and receive the messages on emulator( I am working on emulator first and then want to test it ...

Code Custom Keyboard for Android devices

Hi Friends, I want to develop an application in which the user can define the keys and the value for those keys in the keyboard and save that keyboard. After the user has created a keyboard of his/her choice, the user has an option to set that particular keyboard as the default soft keyboard. Any ideas? ...

How to create GridView with groups

I need to create GridView with groups like this: GroupText1 Image Image Image Image Image Image GroupText2 Image Image Image Image Image Image There will be lots of images( 300-400 ), and about 10 groups. How can I do it? Thanks a lot. ...

How to detect if a widget is on/off screen?

I'm writing a customized view similar to Grid which will be used to hold a large amount of images. I'm using ImageButton to display the images, and I only want to load images onto the buttons once they are on the screen (and just display a static background image when they are not). The reason for it is that I'm fetching images from some...

How do I force an update in a configuration activity?

I'm writing a widget with a configuration activity which calls the following method when its OK button is clicked: private void ok() { // ...Do Widget Configuration... // Force an update Context context = getApplicationContext(); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget); AppWidg...

[Android] Is it necessary to give each Widget (TextView, LinearLayout...) an Id?

I mean widgets that are not going to be touched through program code. ...

How to catch exceptions caused by a malformed layout-xml file?

public class MyActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //R.layout.main has an illegal element (e.g. no layout_height attribute) //But no e...

How to enable on-screen keyboard?

I have one screen. it consists of an edit text. I want when this screen shown on the screen, keypad automatically shown by default without clicking on the edit text. ...

Widget Implementation Advice Needed

Hi, I'm new to Android and I want to write a widget that contains (about)100 columns, each column contains various amount of child views (will be determined at run time via some service call). Users can scroll horizontally and vertically (similar behavior as GridView but with horizontal scrolling). The child views will be customized widg...

Is there a way to show the scrollbar of ListView all the time??

Hi All, Is there a way to ALWAYS show the vertical scroll bar of the ListView ??? Kindly reply asap ...

How to create horizontal menu in android ?

Hello Friends, I am working on horizontal menu that will open on top of the screen. Layout is something like following, || < || Menu Item1 || Menu Item2 || Menu Item3 || > || I want to put this on top of the screen. It can have more than 3 menu item and it can traverse through previous and next arrow. I started with like this, Relat...

Different between android style Widget.Button and Widget.Button.Inset

Hi, I'm trying to use one of the existing Widget.Button styles but I see two different styles that look the same, but I'm sure there's a reason why they are made distinct. Can anyone explain the difference between the Widget.Button style versus the Widget.Button.Inset style, or at least an application where I would use one style over t...

Android TabWidget Problem

Hi All.. I m Realy fed up because not able to make the tabs. the problem is when i copy paste the XML from sample code. it showing an error. Null pointer Exception. Please help me.. *XML File:* pls check this. i need to implement. pls help me. ...

android seekbar drawing problem on orientation change

when the orientation changes, the seekbar drawing is messed up. See voice call and alarm below: ...