android

R.java file not updating with UI element's id

I added some UI elements to the main.xml file in the res\layout folder and when I try to access them through the call, R.layout.my_uielement, the UI element that I created is not there. Even when I add a new xml file with UI elements, it still doesn't show up in the R.layout class. I have made checked the ids on them and they have the co...

Share Link - Perform action in background

I have an application that will accept URLs from the built in web browser via the "Share page" menu item. I'm using the send intent and it works just fine. However, I'd like to accept a URL and process it in the background without bringing my application to the front. I don't want the user to have to actually leave the web browser. It wi...

How to open a new screen with additional parameters?

I've read through the FAQ of Android Dev Guid (http://developer.android.com/guide/appendix/faq/commontasks.html#opennewscreen) but I'm not sure how can I open a new screen with additional parameters passed into it. Let's say I'm going to open screen2, with a variable indicating the current user name so that I could greet the users. Is ...

ProgressDialog not working in external AsyncTask

I'm beginning to think that to get a ProgressDialog to work the AsyncTask has to be an inner class within an Activity class. True? [Edited much later...the answer is False and I'm not sure if this is a bug or what. I'm using Android 1.5. I'm going to read up on Services.] I have an activity the uses a database to manipulate informati...

How do I determine what is touched in 3D space from the screen?

How do I use gl.gluUnproject in my OpenGL ES 1.1 android app to determine what is selected when the user touches the screen? My understanding is that the touch event results in a line and I have to find the first "thing" it intersects with. Are there any tutorials on how to do this? ...

Why do my buttons stay pressed?

In my activity I respond to an onClick() by replacing the current view with a new one (setContentView()). For some reason when I do this and then go back to the original view later the button I originally pressed still looks like it is pressed. If you 'refresh' it somehow (e.g. scroll over it with the trackball) then it reverts to the u...

Wrong item checked when filtering ListView in android

I have a ListView with multiple choice entries where some are checked from the beginning using setItemChecked(position, true); I combine this with the filtering option setTextFilterEnabled(true) so it's easy to find a specific entry in the list. The problem is that when I filter the list the entries switch position in the list vi...

Get from Android BroadcastReciever to a UI

I have a reciever that works well, but I can't seem to show a proper UI, although the toast appears correctly. As far as I can tell, this is caused by Android requiring the class to extend Activity, however, the class already extends BroadcastReciever, so I can't do this. So, I tried to do an Intent, but this failed too. There are no err...

How to force the user to complete a task before pressing back?

I show to user a list of categories, he must choose one. How to force the user to choose before pressing back? ...

App not shown in 2.1 Market

I published several free and paid app in the Market. I recently get several complains from customers about not finding my app in the 2.1 Market. Even if they have bought them before, they can't find it in the market or their download list after updating to 2.1. Can anyone tell me what the problem is? My apps only require minimal SDK 3.....

How to do database schema migrations in Android?

Is there a standard way to do database schema migrations on Android? For example, user installs newer version of my Android app but the new version needs to make updates to the database schema (and wiping the user's database and starting over is not an option!). So I need to run some ALTER statements and/or copy tables the first time my ...

ListPreference, how can you make it to NOT save to SharedPreference?

I am resuing ListPreference for a setting which I store in the database. I do not want it stored in the preference file. How can I reuse ListPreference in such way that it does NOT save to SharedPreference file? ...

PreferenceActivity used as main activity has strange animation

Hi, I have a preference screen (subclass of PreferenceActivity) set as main activity (opened when the application starts) on android 1.6 device/emulator. Anyway the animation android uses to open this activity is different from standard activity. It seems that two types of animation run concurrently: the usual fade animation and the rig...

How to join a ContentResolver Cursor with a Database Cursor?

I get records from the system by quering a ContentResolver. I maintain the order of the items in the database. So I want to display the items in the order taken from my database. How do I merge these two informations? EDIT 1 I am looking after an alternative way now. As what I ideally want is: get order of contacts by a custom or...

Where can I get source code for apps on the Android emulator?

I have two question to put forward: I was very interested, even intrigued by the Maps application on the android emulator. Where can I get the source code for it? There is a Maps Editor on the Android Market, it cannot be downloaded to the emulator. But again, where can I find the source code to that? ...

Why are my resources suddenly unresolved in my Android project?

Eclipse is complaining about my Android project saying all my references to resources are unresolved, even though R.java does exist. For example: signin_btn=(Button)findViewById(R.id.signin_btn); signin_btn.setOnClickListener(this); I definately have signin_btn defined in my resources. Dont know why Eclipse is not seeing my R class any...

How do I upload my own library to Nexus one?

I'm porting my native C engine to android 2.1 using NDK r6, but I can't use the commands like: "adb root" or "adb remout" to my Nexus one. How should I do to upload my engine(.so file) to Nexus one? ...

Error when starting an activity

I'm starting an activity when a button is pressed, and normally (in other apps) haven't had an issue. But when I press the button in this app, I get an "unable to marshal value" error. Exact(ish) error from LogCat: 03-22 02:49:02.883: WARN/System.err(252): java.lang.RuntimeException: Parcel: unable to marshal value {CLASSNA...

Associate an Activity with an item in XML ListViews in Android

I have a ListView that is populated using an XML file. However, I want each item, when clicked, to start a new Activity related to that item. I understand how to use OnItemClick to start a Toast that shows the selected item's text. However, since the ListView is populated from an XML there is not a specific Id for each item in the lis...

surfaceDestroyed called out of turn

I'm currently developing on minimum sdk version 3 (Android 1.5 - cupcake) and I'm having a strange unexplained issue that I have not been able to solve on my own. It is now becoming a rather urgent issue as I've already missed 1 deadline... I'm writing a high-level library to make long term android development easier and quicker. The on...