Imagine a use case, where an activity starts a service. When starting the Service, the Activity also passes a callback function to be called when Service is completed. What will happen, if the activity is not in focus(onPause) and Service tries to call, the callback function?
...
I'm using the following 9 patch image as the row background in a list view.
(the image is right above this line, in case you missed it)
I've placed this image in drawable-hdpi. When I run the app in a high density device, the grey border appears only while scrolling, and disappears when the list view is still. Why is this?
The goal ...
Possible Duplicate:
How to improve java knowledge?
Hi everyone!
I just recently graduated college with a B.S. in Computer Science with a focus on software development, particularity in Java. After graduation I got hired as a Java developer for a company in my area (been there for about a little over a month now). I also sta...
Hi all,
im trying to understand what the difference between a service and a broadcast receiver is,
as i see it they can do the same thing.
For example i have an application : App1
that provide a service called ToastHelloWorld which just creates a Toast and stopSelf().
I expose it to other applications using an intent filter with the act...
I'm working on Android game and there are some problem appear
I want to fill a color on bitmap object but can not
I tried bitmap.setPixel but my Image is PNG format (like a circle or unsharp, surrounded with transparent color) and android can not getHeight() or getWidth(), ie
ImageView i = new ImageView(mContext);
Bitmap bMap = BitmapF...
Can GPS on a phone, such as iPhone or Android determine your Z coordinates ?
I know it certainly has to be able to determine X and Y, well longitude, latitude that is, but what about the Z coordinates ? Can it determine your height, and can I obtain height relative to ground ?
...
Hi,
I creating a small application that will basically use a background server to send data over HTTP. I dont know how to create services. Secondly there will be a couple of activities in my application. I want the activities to display a Context Menu when data becomes available. How can i do both. I have search for a while but the cod...
Hi all, currently I'm working on my 1st Android app and I encounter something I cannot solve. When I try to insert data into my own database there is an error: 07-18 03:41:04.414: ERROR/AndroidRuntime(3480): java.lang.NullPointerException
My code for inserting into table is:
public long createRecord(String created_time, String modifie...
I'm trying to set the tab style to a light theme. Giving me white tabs. I've tried several ways but I can't get the guys to change color! Can I assign the theme in Manifest, TabHost or Tab Widget?
style.xml
<style name="SBstyle" parent="@android:style/Theme.Light">
<item name="android:windowNoTitle">true</item>
<item name="and...
I want to use a singleton pattern to hold a database and some other data/methods for my Android application.
I realize there are many reasons against singletons, but for this case I'd like to use it.
I've sub-classed UIApplication and made a data class within it called MyAppData.
MyAppData needs to have access to the SQLite database.
...
I was finishing up the "Hello World" tutorial in Eclipse (with the ADT plugin) and apparently, you are supposed to rename the string resource "hello" with "Hello Android, I am a string resource". Well, Java.Lang.NullPointerException pops up with four, "An error has occurred. See error log for details." Well, there is NOTHING in the error...
So far and thanks to this website, I've been able to set up an alarm that will be set up and active, even if I turn of my phone.
Now, I set up a alarm to show a reminder for event A and I need the application to setup another alarm to show another reminder for event B.
I must be doing something wrong, because it only fires the reminder...
I am quite new to Java, let alone Android. I am stuck with a problem
that I encountered while instrumenting (using the instrumentation
framework of android) the code of a Android project. I have a ListView
and using the getTouchables() API I have store the view in a
ArrayList. When in debug session, I saw that each view has children
(mCh...
I'm working on an app, where I need to determine which sqlite rows are closest to me given my current lat/long. I have a table with lat and long columns, I'm just having a bit of trouble working out how to get ones that are closest based on my devices current location. Any help would be appreciated.
...
I have a widget that currently takes a random string from an array and sets it to text view on update. The issue here is that the same item can be re-used multiple times in a row due to the string being 'random'
In order to solve this I was going to create a table that held String text, and int viewednum and increment the viewed number ...
Hello, so i've been trying to get my application to run an Activity via an intent and it works fine, when i then assign the finish(); method, it returns to the activity that called it. The only thing i don't understand is that i'm not sure if the callee Activity is put onPause while the called Activity is in-front. I've tried to setup a ...
I have a click event hooked up to my listview as shown.
int[] GenusListIDs = { R.id.txt_ID, R.id.txt_Genus, R.id.txt_Count };
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.genusitem, cursor_genuslist, service.GenusListColumns, GenusListIDs);
ListView list_Genus = (ListView)findViewById(R.id.list_G...
[UPDATE 2]: Hi there again,
after still trying to attach a video to an email, I think (not sure though!) that I am a little closer to my goal, but I discovered two problems...
PROBLEM 1: FILENAME DOESN'T SHOW PROPERLY: what I was trying was to toast the name of the video I clicked on to see how I can get the name. This is what I have ...
There are a lot of different classes that can be used in various ways to read/write to files in Android. For example, you can make use of java.nio.ByteBuffer, FileOutputStream and BufferedOutputStream. Are there any general guidelines for what to use to read/write quickly to the SD card? For example, BufferedOutputStream seems as if it s...
So i want to redirect the build-in android cache management outside data/com.app/cache dir.
I want to put the cache dir to the sdcard.
If this is not possible is there a way to set a fixed size for cache?Thank you
...