android

Android Custom Spinner - What is the useable result?

I have a custom spinner (customized for formatting). It works fine and shows the result of the selected array item. The string array with my data is called mydata[]. I want to do something with that result - I've tried hours of changes but, it seems I don't know what the container is for the selected result - it just displays automati...

ListView with Efficiency adapter notifyDataSetChanged() causes listview to dissapear?

I have a similar question going because I had the same problem with the listview in an AlertDialog... so now I suspect something else is wrong. All I am doing is removing a single item from the arraylist and calling notifyDataSetChanged() in my efficiency adapter. The ListView completely disappears but I can still get a valid count via g...

Start / stop built-in Wi-Fi / USB tethering from code?

How can I start or stop the built-in tethering in Android 2.2 from my application? ...

Multiple icons in Android ListView.

Note that my activity is NOT extending ListActivity; just Activity. I have a list view with a custom layout as follows: (res/layout/list_item.xml) <?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="wrap_content" an...

Is it possible to move the internal DB to the SDCard?

As the database in my app grows, it is going to require more and more of the internal phone space. There isn't any sensitive/private data in the DB, so I'm interested in moving it to the SD card. I'm using SQLiteOpenHelper to assist with the database work. It's my understanding that you can't use this for DB-access on the SD card as you...

Android string.xml error for every character I type

I am going through the android hello world tutorial, and have been stuck when trying to create an XML UI. For some reason, even on a new program, in which I have made no changes to the default build, it gives the error java.lang.NullPointerException after every character I type. I can't figure out why it is doing this, as I am just try...

Android: How to check if a pending Notification was delivered?

Is there a way for the sender of a Notification to know when that Notification is delivered to the receiver? i.e. Some method that can check if a the user has clicked on a given Notification. What I'm trying to accomplish is this: Have my Service send a notification with a PendingIntent to start ActivityA. But if the user starts Activit...

Content Provider filtering query, filtering Cursor

Hi, I got following problem, I need to use a Content Provider to read a Database of an other App. first I want all rows, and after analyzing the data only e.g. the rows from _id = 1, 3 and 5. how can I call a Content provider and select only these rows? or is it possible to create a subset Cursor form an given Cursor? Thanks in advan...

Android Linkify from HTML in TextView

I have HTML with standard links which correspond to commands I'd like to handle. This is <a href="CMD:nice">a command</a>. I populate a TextView with Html.fromHtml() How can I use the Android Linkify system to convert the links to Linkify'ed ones? ...

uses-library in AndroidManifest.xml

Hi all, I am currently having this in my AndroidManifest.xml uses-library android:name="com.google.android.maps" android:required = "false" I specified requirement of google map api is not compulsory. (This enables me to install my application on an none-google-api emulator) However, this only works for API level 7, Platform 2.1 It ...

Android: How to receive callback from Content Provider when Data Changes?

Say I have 3 active Activities that can display and add data to a ContentProvider. What's the best way of synchronizing state among the Activities? For example, if ActivityA adds a new record to the ContentProvider, I would like ActivityB and ActivityC to receive notification so they may update their view. ...

How do I create an ADT virtual machine of a specific size that still has the hardware control buttons?

I'm trying to develop a very specific app for my Dell Streak. I want the entire app to run landscape. The Streak has a tilt function that switches the whole OS to a landscape 800x480. So I want to make an ADT to test in that uses an 800x480 display, but whenever I set the size I get no buttons. The Streak has a Home, Menu and Back butto...

Why do I constantly get ActivityNotFound exceptions?

I'm a novice Android programmer, and to help me understand how Intents really work, I wanted to put together a small Activity which would let the user call startActivity() with any action and data they want. I tried many different combinations, including "android.intent.action.VIEW" and "http://www.google.com". No matter what combinati...

The import android.pim cannot be resolved

I have the following import in my android class Clock - import android.pim.DateUtils; But the compiler is giving me the error - The import android.pim cannot be resolved. I am using the Android 2.1-update1 jar. Please help. ...

Deleting specified number of rows from SQLite database

I am trying to remove 6 rows from the database using the following statement but i get the error shown below getWritableDatabase().execSQL("DELETE FROM tblname ORDER BY _id ASC LIMIT 6;"); Error: Caused by: android.database.sqlite.SQLiteException: near "ORDER": syntax error: DELETE FROM tblname I tried reformatting the SQL in differe...

Buttons in TableLayout cropped on Android 1.6 and 2.1 (but not on 1.5 or 2.2)

I have four buttons arranged in a 2x2 TableLayout. These buttons each have an image on the left and some text. The buttons display fine in the emulator for 1.5, and for 2.2, but when testing with 1.6 the two buttons in the righthand column are cropped so that they are missing their righthand edge (the padding to the right of the text i...

parsing error with android app

I know this has been asked before, but nothing is working. I have signed my app. I sent the signed apk as an email attachment. I click on the email attachment to install it and I get a parsing error. What am I doing wrong? Thanks DeanO screen shot link http://picasaweb.google.com/lh/photo/EAdwMYNAPXSoY9BU8VJRhw?feat=directlink ...

Android LinkMovementMethod in XML?

To enable Linkify behavior, I do this in code: textView.setMovementMethod(LinkMovementMethod.getInstance()); Is there a way to set this in the layout xml for the textview? ...

Low-level audio API for Android

I'm looking for some way in Android to play in-memory audio in a manner analogous to the waveOutOpen family of methods in Windows programming. The waveOut... methods essentially let an application create arrays of sample values (like in-memory WAV files without the headers) and dump them into a queue for sequential playback. Windows tr...

Launching activity through intents

Hi, I am implementing a simple app. I need to start an activity based on the state of the Activity. Lets take i am using a button to start the activity. 1. If the activity is not started, I need to start XYZ activity. 2. If the XYZ activity is on focus, then i need to close the activity on the button press. 3. If the XY...