Android :: Returning Through Multiple Functions
Sep 2, 2010
Alright, this might be kinda simple, but I cannot figure out how to do this. How can I change this function to return the String class_name? I know that I need to change the function from void to String, but what else do I need to do? Code...
View 4 Replies
Aug 12, 2010
Edit: Okay, I found a solution. Don't know that it's the proper solution, but it does work correctly. Added to the code below. I'm trying to allow a user to select a number of directories from a checklist, and return them upon clicking a "Submit" button. Here's a snippet of my code. It populates the List View with all the directories on /sd card/, and for the initial selection (of however many I pick) when I submit, the log shows the correct choices returned. However, if I un check an item, and click "Submit" again, it still shows as if all are selected. Do I need to write a handler to un check an item? I thought that was taken care of by the choice Mode selection?
View 1 Replies
View Related
Oct 1, 2009
How can I return a value from TabActivity? It seems that the return value from tab pages vanishes and the caller always receives RESULT_CANCELED instead of RESULT_OK.
View 3 Replies
View Related
May 8, 2009
My application that uses geocoding was working fine till last week and now all of a sudden am not getting proper data from the same.
I used getLocality() , which was returning CITY name previously. But now it is returning NULL.
Is something changed? or Has someone faced the same issue?
My application is on SDK 1.0
View 12 Replies
View Related
Oct 15, 2010
I am (supposedly) catching NullPointerException and returning 0 if that happens. But occasionally I get NullPointerException failure anyway. Is catching it this way no enough to prevent this failure?
private char getCharBehindCursor (int offset){ // get a single char behind cursor + offsett CharSequence cSeq; InputConnection inputConnection = getCurrentInputConnection(); if (inputConnection != null){ try { cSeq = inputConnection.getTextBeforeCursor (offset + 1, 0); } catch (NullPointerException npe) { /* failure*/ return (char)0; }
if (cSeq.length() == offset+1){ return cSeq.charAt(0); } } return (char)0;
View 3 Replies
View Related
Apr 16, 2010
I am trying to send all my activities to background by calling this.moveTaskToBack(true); on a menu button click, but the call returns me a boolean value false. Please can anyone let me know if my way to invoke this is wrong or if I am doing anything wrong.
View 7 Replies
View Related
Oct 5, 2010
The line "return db.insert(DATABASE_TABLE, null, initialValues);" is returning a null pointer and I cant figure out why! I'd be grateful for any help public class Database extends Activity {
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
DBAdapter db = new DBAdapter(this);
if(db != null){
long id = db.insertUser("test", "test");
Cursor c = db.getUser(id);
Log.d("DB", c.getString(1));
Log.d("DB", c.getString(2)); db.close();.......
View 1 Replies
View Related
Sep 22, 2010
Looks like reverseGeocode ( getFromLocation()) is not working in android 2.2. It is not able to fetch the address from the coordinates. It returns null and crashing my app.
In general 2.2 is not stable - 2.1 was much better. UI response , UI rotation when rotate the phone etc doesn't work reliably....
View 5 Replies
View Related
Jun 18, 2010
I have looked all over the place. Here in the forums, online, user manuals, etc. What I am looking for: When I am texting, I see above the "A" key is an alt symbol that looks like an arrow pointing to the right with a verticle line. It appears to be an ALT-function of some sort. What is it? What does it do?
View 1 Replies
View Related
Apr 1, 2009
I read in the documentation for SQLite that there should be some core functions and aggregate functions available, but I can't seem to use them in my code.. Can anyone help? Here's the documentation ad: http://www.sqlite.org/lang_aggfunc.html http://www.sqlite.org/lang_corefunc.html There is for example the function count() but how do I use it? I have tried to use it as stated below, but none of the functions in the documentation is available that way (i.e when I type "db." the list that shows in Eclipse documentation doesn't include any of the functions from the SQLite doc except from execSQL):
Code...
View 7 Replies
View Related
Aug 28, 2010
Can someone tell me what busybox actually does and why it's required or necessary? I'm using a rooted captivate if it matters.
View 1 Replies
View Related
Apr 16, 2009
I do not get any results from the Geocoder in the 1.5 preview release. Any information on this? In the maps application it works but my calls simply return an empty list (no exception, all permissions I know of (in this case only Internet) are set.
View 7 Replies
View Related
Aug 10, 2010
I have a set of mp3 files on my computer which i want to be the server. Now i have a web service(Songs_Collection). This web service returns the list of all songs present on the server to the user.The user can download the desired file directly from the server.
I have a small problem :
How does my web service get the list of audio files kept on the server in the folder c:Audio Files.
Someone suggested that i need to keep the names in a "Web Content" folder, but can anyone suggest how should i approach it?
I worked out on this part . But now how do I send it to the client on device ?
Can i send it directly as an array? I guess then some seriliazation-deserialization needs to be done. Or If send it as an XML file then how should I proceed? (This is more important)
View 1 Replies
View Related
Sep 22, 2009
The code snippet below displays a Dialog with a simple login-form. The problem is that when the user hits the login-button, the text that was entered into the EditTexts are not returned on the getText()-call. However, if I set android:setText="foo" on the EditTexts in the xml-layout "foo" is returned on getText(). why the text entered at runtime won't stick?
CODE:..............
and the XML:
CODE:.....................
View 1 Replies
View Related
Jul 26, 2010
I am using the previewCallback from the camera to try and grab images. Here is the code I am using
private Camera.PreviewCallback mPrevCallback = new Camera.PreviewCallback()
{
public void onPreviewFrame( byte[] data, Camera Cam ) {
Log.d("CombineTestActivity", "Preview started");
Log.d("CombineTestActivity", "Data length = "
+ data.length );
currentprev = BitmapFactory.decodeByteArray( data, 0,
data.length );....................................
View 1 Replies
View Related
Jun 14, 2010
I have an application that utilizes the phones DeviceID in various ways. I am now getting emails from users who have the HTC Droid Incredible phone that they are getting the error message I have added to the app that is showing the DeviceID being returned is not valid - which means it is either empty/null or the default ID used in the emulator. I require a valid DeviceID to use my app, and the permissions are all set fine in the XML. It works just fine on every other device, and now suddenly it seems to stop working on this phone. Anyone else having this issue? Anyone find out what is causing it? Does HTC now block this ID on this device?
View 8 Replies
View Related
Apr 20, 2010
I'm a bit new to programming Android App's, however I have come across a problem, I can't find a way to make global variables -unlike other coding like php or VB.NET, are global variables possible? If not can someone find a way (and if possible implement the way into the code I will provide below) to get a value from the variable 'songtoplay' so I can use in another Public Void...
Here is the code:.............
Basically, it gets the value from the Spinner 'hubSpinner' and displays it in a Toast. I then want it to return a value for string variable 'songtoplay' -or find a way to make it global or useable in another Public Void, (Which is will a button, -loading the song to be played)
View 3 Replies
View Related
Oct 11, 2010
The FileObserver class doesn't appear to be working as advertised.
I created a class extending the FileObserver class. I initialize the class to watch the path of the sdcard as returned from the Android Environment.getExternalStorageDirectory function. Everything seems to work perfectly as long as the files are in the ROOTof the sdcard. Any files within SUB-FOLDERS of the sdcard are NOT returned to my public void onEvent(int event, String path) callback in my FileObserver class.
The docs say files in subfolders should be returned to the onEvent() callback but it's not happening. Note, I've only tested on the Android simulator (v2.2) since I do not yet have access to a device. Maybe this is a bug specific to the simulator?
View 4 Replies
View Related
Mar 23, 2009
I have an application that needs to have a user visit a web page to authorize it. After spending time in the Browser the user should return the my application.
Currently, I'm launching the Browser with:
CODE:................
After using the browser, I can go back home and launch my application, which stacks a new Activity on top of the previous stack of Activities that were being used in the application. For example. If the user launches the app, they have Activity A in the stack. From there we navigate to Activity B which then launches the Browser. Then, the next time we enter the app, we launch Activity A, which is pushed onto the stack that already contains an A and B.
My question is then, how can I just go back to the previous stack? Basically, do I have to create a new Activity? Is there a better way to launch the Browser, and then come back to my application?
Also, I've been using the Intent.FLAG_ACTIVITY_NEW_TASK when I start the Browser activity so that my app stays running.
View 2 Replies
View Related
Oct 7, 2010
New to android..been using WM 6.1 sync with outlook obviously seemless. Need the same type of functionality but it doesn't have to be with outlook. Looking for options to use for business. Being a small company I can go anyway I want, don't have any restrictions other than need to sync all with phone, laptop and desktop. Beginning to travel more so contact, calendar and task must sync (notes and a Today front end would be nice). I have tried Dejaoffice but I end up with 2 sets of contacts and calendars (Samsung and Dejaoffice) not to mention that the UI is lame (had just as good 15 years ago with Instant Recall). Don't mind rooting the phone if needed. So what options exist in the open source world? Love my captivate phone but need to be able to do business to keep it. Anxious to hear how the rest of the Android world does it.
View 10 Replies
View Related
Apr 23, 2010
Are there any USB functions for Android devices (all user devices, not rooted)? I'm curious because I might want to make an app that puts things through USB
View 1 Replies
View Related
Jul 22, 2010
How does one go about adding a custom SQLite function from within the Android sqlite API? I have a function (written in C) that I'm able to add using the C API outside of Android as described here: http://www.sqlite.org/c3ref/create_function.html.
View 4 Replies
View Related
Jul 12, 2010
I've searched through the forums and tried a lot of notes apps, but I am yet to find one to my requirements:
- Should have widget support (I need to put some notes on my homescreen, not the note creation widget like 3bananas)
- Bluetooth sharing (or it stores the notes as .txt files on the SD card). Alternatively, it could sync with google in some way. If you know one that does these, please tell me. Else please tell me what app you're using, so that I can try it if I haven't already.
View 2 Replies
View Related
Aug 29, 2010
I have a static library that contains some JNICALL functions, i.e. they are expected to be called from the JVM and are never referenced by the shared library that links the static library. However, it seems like function stripping is exterminating the JNICALL function (it's not visible in arm-eabi-objdump -t). I'm working around it by adding a dummy function with an impossible condition that calls the JNICALL function, but that's dirty. I know that there is a link option to prevent certain modules from getting their unused data stripped, but what is it? And how do I specify that option in the .mk file? I didn't see anything immediately obvious in arm-eabi-ld. Incidentally, the function stripping doesn't strip out JNICALL functions in the shared library itself, but it will remove those from the static library that the shared library is linking. What's the reason for that?
View 2 Replies
View Related
Oct 30, 2009
It seems like the convenience functions (onUpdate, onEnabled, etc.) aren't being called in the emulator on Android 2.0. Is this a bug, or are these functions just being eliminated? It would have been nice to see this documented somewhere.
View 4 Replies
View Related
Sep 30, 2010
I use in the getView()-Method of this example a static function to download the source of an ImageView. Later there will be threading included. However, I like to know in general how save the use of static function is in this case.
Because I experienced, that in some cases (when I scroll really fast) the Images get mixed up.code...
View 3 Replies
View Related
Sep 12, 2009
Im having trouble with button functions i have a menu created but how do i give them functions so when there pressed they can actually do something?
View 3 Replies
View Related
Oct 15, 2011
I want to perform various image processing functions such as threshold,equalize etc on the image i capture from the camera...What should i use in order to do that?
Also,when i installed the app in my phone, after clicking the pic, the next screen appears, and after clicking the button for performing other functions, force close comes up...what could be the reason,because my code works fine without the camera portion...
View 2 Replies
View Related
Nov 16, 2010
I think this should be easy to answer. I have an application that does some long calculations, and I would like to show a progress dialog while this is done. So far I have found that I could do this with threads/handlers, but didn't work, and then I found out about the AsyncTask.In my application I use maps with markers on it, and I have implemented the onTap function to call a method that I have defined. The method creates a dialog with Yes/No buttons, and I would like to call an AsyncTask if Yes is clicked. My question is how to pass an ArrayList to the AsyncTask (and work with it there), and how to get back a new ArrayList like a result from the AsyncTask?
View 1 Replies
View Related
Mar 23, 2010
I'm having issues with BitmapFactory.decodeStream(inputStream). When using it without options, it will return an image. But when I use it with options as in .decodeStream(inputStream, null, options) it never returns Bitmaps. What I'm trying to do is to downsample a Bitmap before I actually load it to save memory.
I've read some good guides, but none using .decodeStream.........................
View 2 Replies
View Related