android

android: having two listviews in two listactivities didn't work

I guess my previous question wasn't clear enough ( http://stackoverflow.com/questions/2549585/android-failed-to-setcontentview-when-switching-to-listactivity ), so I explain as follows. In my app I have two listactivities which uses two different listviews: public class Activity1 extends ListActivity { @Override public void onCreate(Bu...

Java (Android) regular expression to strip out HTML paragraph

I have an Android application which grabs some data from an external XML source. I've stripped out some HTML from one of the XML elements, but it's in the format: <p class="x">Some text...</p> <p>Some more text</p> <p>Some final text</p> I want to extract the middle paragraph text, how can I do this? Would a regular expression be the ...

How to layout view right aligned and bottom of an LinearLayout

Hi I am trying to layout 1 textview (upText) left aligned and 1 textview (downText) and an image view (image) both on the same line and right aligned. how can I do that? I tried that, but both 'textview' and image view at left aligned. <TextView android:id="@+id/uptext" android:layout_width="fill_pare...

How do I start another application (downloaded or preinstalled) from an activity?

Basically, I want to get a list of all installed apps and pick one to run from an activity. I've tried ACTION_PICK with Intents but that seems to leave out apps that were downloaded and it has a bunch of junk in it. Thanks ...

How to test my app on my phone? I have Eclipse w/ Android plug-in.

Where do I copy the apk file on the Motorola Droid? Which directory? Are there any possible issues I need to be careful of, it's also my personal phone... ...

Android: Using onStart() method in Bluetooth application

Hello, I am getting a nullpointer exception when my onStart() method is called. Here is the breakdown of my Android app: Opening the app brings a user to the homescreen: The user is then presented with the first 6 icons to choose from. When the user presses the "Sugar" icon it takes them to the SugarTabActivity. The SugarTabActivit...

Can I add a portrait layout on top of a landscape Camera SurfaceView?

My application should hold a camera preview surface. The camera is fixed to landscape view via AndroidMainfest.xml <application android:icon="@drawable/icon" android:label="Camera"> <uses-library android:name="com.google.android.maps" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name...

Resume Activity with back button

I have an application I am creating with a DashboardActivity & a SettingsActivity. On the dashboard, I have one object displayed, but when I go into settings, I want to be able to select/deselect X options. Once the user clicks the back button, I save that data locally and to the server. Once the phone receives a success message from the...

Android - "Resources don't contain package for resource number"

My android application has several warnings of the following form when I run it in the emulator: "Resources don't contain package for resource number <Hex Address>" How can I fix these warnings? In particular, is there an easy way to find out what the hex address refers to? ...

How do I replicate the functionality of selecting contacts in messaging app?

Android's messaging app, located in projects/platform/packages/apps/Mms.git has a class called RecipientsEditor. I would like to be able to create MultiAutoCompleteTextView that will filter contacts the same way, to make contact selection easy in my app. using the mms app is cumbersome since it uses internal apis and has everything split...

SQLite table query

Hi I query the table by using this function below public Cursor getTableInfo() throws SQLException { return db.query(TableName, null, null, null, null, null, null); } I got the error "View Root.handleMessage(Message)line:1704". I could insert the data b...

Pass in the object a java class is embedded in as a parameter.

I'm building an android application, which has a list view, and in the list view, a click listener, containing an onItemClick method. So I have something like this: public class myList extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { getListView().setOnItemClickListener(new OnItemClickListe...

How to set a custom font for a spinner?

Is there anyway to set a custom font or color for the selected item in a Spinner? For example, I open the spinner and click a priority of "High". I'm my layout containing the spinner, I would like to see the word "High" in red or a custom font. I can't seem to obtain the textview to make the necessary change. I always obtain a NullPoin...

Android / Java rare and seemingly impossible exception causing force close

Hello all, I have an interesting problem being reported to me from an android application I have published. I have a two-dimensional array that I am iterating through using two for loops like so: for (int i = 0; i < arr.length; ++i) { for (int j = 0; j < arr[i].length; ++j) { if (arr[i][j] != 0) // does stuff...

Displaying music list using custom lists instead of array adapters

Hi, I have displayed the music list in a list view. The list is obtained from a website. I have done this using Arraylist. Now, i want to iterate the same program using custom lists and custom adapters instead of array list. The code i have written using array lists is... public class MusicListActivity extends Activity { MediaPlayer m...

Linux C++: Linker is outputting strange errors

Alright, here is the output I get: arm-none-linux-gnueabi-ld --entry=main -dynamic-linker=/system/bin/linker -rpath-link=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -L/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -nostdlib -lstdc++ -lm -lGLESv1_CM -rpath=/home/oem/android-ndk-r3/build/platfo...

Newbie Android question

Hi folks, I have just started with Android with the usual Hello World project template in Eclipse. I modified the layout XML and removed the label that says "Hello World, !", and added a couple of other controls. However, these are not reflected in the app, within the emulator. When I run this app from Eclipse again it is still showing ...

Custom title bar without padding (Android)

So I am using the techniques in this thread to use a custom background for my titlebar. Unfortunately the framework places my layout inside a FrameLayout (title_container) which has padding as seen below. Is there anyway to remove the grey borders? The frame layout is defined in com.android.internal.R.id.title_container, so accessing ...

Set a OGG in raw folder as Ringtone/Notification?

Hi, I have some ogg audios in my raw folder and I'm trying to set one of them as a Ringtone (or Notification, Alarm... whatever). I've been looking at the source code of RingDroid and I can see how is this done using the ContentValues and MediaStore, but in all the examples I've seen, the audio files is in the SDCard. Is it possible t...

How to clear a notification in android

Is it possible to clear a notification programatically? I tried it with the NotificationManager but its not working. Is there any other way i can do it? ...