In my searchable.xml, I have:
android:voiceSearchMode="showVoiceSearchButton|launchRecognizer"
I get the search string returned SearchManager like so:
if (Intent.ACTION_SEARCH.equals(action)) {
searchString = intent.getStringExtra(SearchManager.QUERY);
}
Is there any way to get from the intent whether the search string came from ...
I have an object that has (among other things) a list of Intents. I want to pass this object as an extra to an Intent. However, the Intent class is not serializable, it is just "Parcelable".
I assume that Parcelable is the android version of Serializable, but I'd rather not have to write my own serialization code for my class, and P...
I want to have a font-size preference in percentage relative to the default font-size, so I need to get the default font-size for a TextView.
How do I get the default font-size of a TextView?
...
How would I go about converting a measurement from, for example, 12.5 feet to 12ft 6in? How would I created that second number which reads only the decimal place when multiplying by 12?
right now I have double Measurement01 using other variables and some math to get me the feet in decimals. I send that to a textview with farf.setText(Me...
I am trying to pass an integer between activities using an intent.
The source activity makes the calls info.id is the selected item from
a ListView.
Intent intent = new Intent(myActivity.this,
newClass.class);
intent.putExtra("selectedItem", info.id);
...
In my calculation app, which takes a few inputs and uses them in a fixed formula to produce multiple outputs, the application crashes if I try to run it without putting a value into every input.
I know how to catch exceptions, but I don't know the name of the exception that would be thrown by this kind of error. Can anyone help me out o...
Hi guys,
I am doing an application in which I have to display the numbers on TextView randomly and automatically with the help of Timer. I am able to get the random Numbers in the log without repeating, but I am not able to print the same on device please help me...
Regards,
Akki
Source:
//RandomNumber.java
public class RandomNumber...
dear friends,
i created google map test application on two difference computers A, B
i created two MD5 finger prints on both and obtained two different keys from google for Computer A and B.
Key of Computer A does not show google map on Computer B and vise versa.
Key of computer A only shows google map on Computer a only and same ca...
I want to catch any onTouchEvent() on the mapview. After search lots of questions&answers, I found only when I write my own MapView(MyMapView)and define onTouchEvent, then use this MyMapView in main activity.
Is it the only way??
...
Hi guys.
I wanna know about max thread number for one application.
You know Thread.activeCount() returns the number of active Threads in the running Thread's group and its subgroups.
If I can know the max number of threads to create in current activity, I can limit active threads.
I am using thread for http connection and catching H...
I'm considering to develop owner drawn EditText widget.
So, what do you think I should read or refer, firstly?
Or, could you give me some good examples of both owner drawn widget or custom widget?
...
I am trying to show custom alert from onActivityResult. I need to inflate it, so am getting context with getApplicationContext() and everything is fine until I execute alertDialog.show() - then it fails with:
Unable to add window -- token null is not for an application
Do you know why I cannot do it?
(it happens on 1.6 and 2.0 - I ...
hi,
I am trying by using javascript to get the window width and height of the build in webbrowser but can't find the right method, currently it seems the DOM doesn't know about the zoom level changes.
Thanks
...
Dear friends,
Can anyone guide me as to how I can pass an object of a custom type from one Activity to another with the putExtra() method of Intent???
Any help would be appreciated.
...
Hi, I'm developing an Android app (Android 1.6), but this is probably a more general Java question.
I have an ArrayList of about 10,000 objects
the objects contain 3 strings (firstName, middleName, lastName).
The user is presented with a "search box" on android where they can search for a particular "object" by typing in part of the n...
I have a "dumb" custom Android widget (as in View, not a home screen widget) that I need to have retain some state during screen rotations. This PlayerWidget is essentially a media player UI with some buttons (back, forward, play/pause) and a progress bar. It exposes the important bits of UI via getters.
There are a few separate Activ...
I have a LinearLayout, when user selects my AutoCompleteTextView(ACTW) I want to move the whole layout upwards, so that the ACTW is at the top and there is space between the ACTW and software keyboard for suggestions. 1) How to do this? 2) How to make this animated (but this is not necessary)?
...
I have implemented some gesture detection code so that I can detect when a row in my listview (which is situated in a FrameLayout) has been swiped.
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCIT...
How can I programmatically display an hourglass in an Android application ?
...
I have an app with a widget but I am having some difficulty with the layout of the widget.
The basic idea if the widget should look like an icon and have a little text tag under it like any other icon on the desktop.
I found one example which uses an android:background for the TextView and uses a drawable XML:
<shape xmlns:android="ht...