Is it possible to launch an activity on a certain key sequence?

by Mark Murphy » Thu, 18 Feb 2010 22:57:13 GMT


Sponsored Links
 


Only from one of your own activities, and then only with some work.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android App Developer Training:  http://commonsware.com/training 

--



Other Threads

1. NumberFormat and comma as decimal separator

I have a program that allows users to enter decimal numbers. One user
noted that my program requires that he use a period as the decimal
separator even though in his country (Germany) they use the comma
instead. No problem, I looked at my code and realized I was
constructing a DecimalFormat directly instead of using
NumberFormat.getInstance() and changed my code as follows:

formatter = NumberFormat.getNumberInstance();
if (formatter instanceof DecimalFormat) {
    DecimalFormat format = (DecimalFormat)formatter;
    format.applyPattern(PATTERN);
}

I then was going to test it in the emulator and changed my locale to
German. While the language changed there was no change to the number
format and it still used the period as the decimal separator.
Iterating over NumberFormat.getAvailableLocales() I can see that only
English and Japan based countries are returned in the emulator and all
those countries use the period not the comma.

Any ideas on how can I test my changes to make sure they work? I can
override the decimal separator which works fine for testing the
display of numbers, unfortunately the keyboard won't allow me to enter
a comma in a numeric field to test the parsing. My personal Android
phone only supports English and French. I tried changing it to French
but still get the period as the separator, feeling kind of stumped
here.

--~--~---------~--~----~------------~-------~--~----~

2. Dynamic Image loading from Resources in ImageView

Hi,

I am very new to Android Development and I have a doubt regarding
Image Loading in ImageView from R.drawable.

Just to brief What I am trying to accomplish is :Showing a ListView
with ImageView and TextView using ViewWrapper pattern.

I get the Text Value for TextView from one http service and I store
all the values in String Array. I have implemented my own Adapter with
my own implementation of getView().

Now the issue:

I have put all the images i want to show in res/drawable folder. now
based on the value of text I want to pick that image from the folder
and show it in the Imageview.

For Example:
if i get "aaa" as the value of TextView. I already have aaa.jpg in res/
drawable folder and I want to set that image in ImageView.

I don't know how to get the handle for aaa.jpg in androind.

I have tried follwoing with no luck:
ImageView.setImageResource() - But it takes the rID as argument which
is of type int. I cant generate "R.drawable."+myVairable.

ImageView.setImageDrawable(Drawable.createFromPath(PATHVariable))-But
I don't know how to give the path to the image. I tried "./res/
drawable/"+variable+".jpg"

BitmapFactory takes the similar argument for all its method.

I really don't want to write any Async Image Loader based on any
server based URIs as I dont have any hosting server available.

Kindly help.

Thanks!





--~--~---------~--~----~------------~-------~--~----~

3. How to create new APN setting

4. Repairing the 1.6 install

5. Layout one horizontal line with two TextViews

6. MyLocationOverlay vs. Service with Locationlistener

7. Center TextView between other two widgets