I have the following code:
Intent myIntent = new Intent(Intent.ACTION_VIEW,
ContentURI.create(arAdapter.getItem(position).getUrl()));
startActivity(myIntent);
But I get the compile time error:
ContentURI cannot be resolved.
How can I fix this? or is there a different way to launch the android browser?
...
My application has an assets directory in which I've dumped a bunch of text files I need to load at runtime.
I have a directory full of assets of a particular type (i.e., "assets/subdir") and I want to load all of the files in this directory, one at a time.
I have code like this:
AssetManager assetMgr = getAssets();
String[] assetsI...
I'm working on an Android project now where everyone (about 12 people) are using the Eclipse Galileo IDE 3.5.2. That decision was made last year when that version was relatively current. But we're at a good milestone where, if we wanted to make any changes, this would be a good time to do it, although we're not having any problems with...
I've been trying to diagnose a memory leak in an Android application I'm writing. I got a heap dump loaded into Eclipse, but the results I'm seeing are very curious. There are some 20,000 instances of an exception (specifically, LDAPException from the UnboundID LDAP library) in the heap with no inbound references.
That is, they show u...
I find it a waste of time that every time I need to enter a string that I have to go edit the strings.xml file manually. What I'd like to be able to do ideally is have Eclipse pop up a dialog box that lets me specify the name of the resource and the value for it. Then Eclipse would generate the code in strings.xml and paste the correct...
Hi,
So i am trying to get the screen size of the Moto Droid on my application. on my Create, i am using the Service windowManager to get the default display.
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
When i set it i get width of 320 and height ...
Hello,
i have a problem with a strange out of memory exception that only occurs on some devices (mostly HTC Desire). It happens there every time a user starts a certain activity (no matter how - there are two paths to that activity) and i'm really puzzled as to why (i checked for leaks and couldn't find any)...
The error is either thr...
@Override
public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Selection Options");
menu.add(0, v.getId(), 0, "Remove");
}
I want my menu to say "Remove AAPL"
I would get the string AAPL from ...
I have created the meat and guts of my application but I want to add a different activity that will be the starting point (sort of a log-in screen).
Couple questions:
1) I have a fairly decent handle on how to switch between activities (based on this article: http://www.linux-mag.com/id/7498) but I'm not sure how to go about creating a ...
I am running out of room on my app for buttons, so I want to stick them into some sort of sliding container, like the one at the top of the Astro File Manager app. How do I go about doing this? I've Googled this and can't find anything.
...
Hi,
I've been successful in creating various account authenticators / services each with their own preference.xml. These preferences are persistent but I do not know where on the phone they are stored. I've scoured the phone using adb but I can't seem to find a *.db or "shared_prefs" files that corresponds to the preferences for my pa...
I am trying to make an AlertDialog that scales in size to the content. The textual content can be larger than the dialog, so it has to be able to scroll. If I use a RelativeLayout everything renders properly no matter how much info there is, but when there is not enough text to fill up the TextView it leaves a lot of extra space. This is...
It annoys me when I need to pass the context reference around all over my code. So I am thinking to create a static method to return a reference to the application instance. I am not sure if it is safe to assume there is only one instance of the Application in one application. Apparently, the Application class in Android SDK doesn't prov...
Alas I have about 500 contacts in my phone book and for some reason after synch'ing them with thunderbird the display name is random last, first...first last. So I thought I would put a quick widget together to just re-do al my display names to last, first. The code I use is below, however I am not getting last / first values. The key...
I'm trying to create standard button in android with a background and some text in front but some fairly specific alignment. I want the text to be centered vertically and on the left with 20dp of padding. The alignment works but the padding doesn't. I know I could probably get the desired effect by putting a few spaces in the text but th...
Hi, I'm trying to write an app that can turn my mobile data connection on and off.
Already got the source and built my own sdk, where I removed the @hide statements so I can use the relevant function
cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
cm.setMobileDataEnabled(true);
Also found out which permissions I nee...
I want to build a site to introduce my phone apps and guide users to the app store. is there any good theme or template for me to get start?
I need to put all my apps together and have separate page for single one.
...
while compiling android project in eclipse 3.4.2 , am getting The project cannot be built until the build path errors are resolved.
i got a temporary solution from the blog http://www.scottdstrader.com/blog/ether_archives/000921.html
The resolution was to force a resave of the selected projects (and their .classpath files):
Open th...
Can anyone tell me about the Japanese phonebook sorting status in
Android contacts?
Does froyo support AKASATANA and Yomigana?
...
In my android app i need to get 50,000 database entry(text) and compare them with a value when the activity started(in onCreate() ).I am doing this with the simplest way : i get the whole table from db to a cursor.However this way is too laggy.Are there any other way to do it more effective ?
Edit :The app is "scrabble solver" that is w...