How to hook into the Power button in Android?
On an Android device, where the only buttons are the volume buttons and a power button, I want to make the app react to presses on the power button (long and short). How is this done? ...
On an Android device, where the only buttons are the volume buttons and a power button, I want to make the app react to presses on the power button (long and short). How is this done? ...
I want to dynamically add image in EditText. Is it possible? anybody knows please give sample code for that. ...
Hello All, I have a class which inflates linearlayout. The inflated xml contains a textview. I want to change the height of that textview dynamically as per the content. ...
Are there any app built with html5 feature (such as canvas, video playback...) available in Android marketplace? I'm looking for html5 web apps wrapped as a native android app. ...
Hello, if I have an Options menu in Android that has more than 6 items, Android adds a More item that shows the other hidden items, AS text! But I want the More button to display the extra items both in their text AND icon, how do I do that? ...
My app's main screen is a listview in portrait mode. When it is in landscape orientation it switches to an ImageView. I want to be able to animate a fading transition when I switch orientations. How can I go about doing this? ...
Hello, I'm learning Android and have need for dates/times. I was recommended Joda-time by a colleague, which seems to be exactly what I need to make progress. Unfortunately, I'm having trouble getting it to work. I'm using intellij and this is Android 2.2. Steps I took: Download the Joda-time jar from the website. Intellij > File > ...
Hello. I have a Tabhost in a horizontal scrollview that contains 8 tabs. The Label space for each tab is small and many of the labels have to scroll to be viewable. Is there anyway to make the tab labels bigger? This is my layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertic...
I try to display a Toast inside a AsyncTask. This first piece of code is placed in an activity that we may call MyActivity, and works fine: Toast.makeText(this, "Toast!", Toast.LENGTH_SHORT).show(); Then I create a new instance of MyObject and calls method(). This code is also placed in MyActivity. MyObject obj = new MyObject(this);...
I am building a list and the list contain for every contact a checkbox to chose which one to modify for example, the problem is that when the list became longer than the phone screen and the scrolling is active; when i select a check box , a second one is automatically selected in the bottom of the list. the problem is the automatic sel...
I'm trying to start an Activity with startActivityForResult, but I keep getting an ActivityNotFound exception, and I can't work out why. I've looked through the code multiple times, and it seems to be identical to some other, working code. Any suggestions? The newNoteButton that starts the Activity: newNoteButton.setOnClickListener...
Is there a way to know what digits (digit by digit) are entered via an Android phone's native dialer? ...
I'm trying to make a timeout gauge bar animation effect: The width of a lengthy colorful bitmap image is decreasing, but not x-scaling. so the image looks not changing and the visible area shrinks. I couldn't find the sole ImageView clipping or masking support in android. And I managed to get the clipping effect by surrounding the Im...
I have to play flash (swf) in my program when the user clicks on a link. Which is best? Concentrate on android 2.2 and use the Adobe Flash Player, or what do you recommend? I have tested WebView, but can not play swf in the emulator. HTC has a custom flash player but it feel like a limitation. Some code samples to play swf in android t...
Hi, i got some data like this "line 1 \n line 2" from my distant server by using json with utf8 encoding, and when i try to put the data in my EditText the newline \n doesn't work in spite of unscaping the data by using URLDecoder.decode() because i use databases. Any suggestions all the best . ...
I have 3 days into this and my mind is melting oozing out my ears.... please help! The end result is that I want to upload selected photos from and Android phone to a php website. I can display the images from the camera and get the filename that I want to upload. However I cannot use FileInputStream on the file name because it is no...
I'm setting a textview as a child to a TableRow view programmatically and I cannot seem to get the text to wrap inside of the parent. Here is the code which should be wrapping the text inside of the TableRow. Notice the setSingleLine is being set to false. TextView value = new TextView(this); ![alt text][1]value.setLayo...
Say I have a somewhat large (i.e. not fit in most phones' memory) bitmap on disk. I want to draw only parts of it on the screen in a way that isn't scaled (i.e. inSampleSize == 1) Is there a way to load/draw just the part I want given a Rect specifying the area without loading the entire bitmap content? ...
I've tried running a variety of live wallpapers. When I set a different one to be live, the old one still shows up in the adb shell when I type 'ps': app_37 12107 1870 125356 16932 ffffffff afe0da04 S fishnoodle.aquarium_free app_50 12196 1870 109620 16804 ffffffff afe0da04 S com.geekyouup.android.snowpaper My own one that I...
I have a table with cells mixed from TextView and EditText fields. For some reason all EditText fields use a bigger font than TextView (20dp vs. 12dp) and they also ignore their textSize attributes. Furthermore all EditText fields have a height that would easily fit TWO lines even though I explicitly specify a line height of 1 only. Any...