"3511530","1","3511563","","2010-08-18 11:27:07","4","6687","<p>when i click a button my app should be terminated. It must not to run at the background. that is when holding the home key, My App should not be alive. For Example, i have to redirect my app to the browser. then My App goes to as a background Task. I want to terminate before the redirection to browser. How is it Possible? Any Idea? Better I would need a Explanation on that. that helps to understand How it works to EveryBody.</p><p>Thanks in Advance.</p>","267269","","267269","","2010-08-18 11:41:49","2011-04-05 14:10:47","How to Terminate a App Programmatically in Android?","<android>","3","2","1","",""
"3511596","1","3678878","","2010-08-18 11:36:10","11","8337","<p>I've got simple tab activity with next layout:</p><pre><code>    &lt;TabWidget    android:id=""@android:id/tabs""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""                      android:background=""#ffffff00""        /&gt;&lt;FrameLayout                android:id=""@android:id/tabcontent""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""        android:background=""#ffffff00""          /&gt;</code></pre><p>I use buttons as indicators for tabs</p><pre><code>tabHost.addTab(tabHost.newTabSpec(""Tab1"")                .setIndicator(new Button(this))                                .setContent(new Intent(this, TabActivity1.class)));   tabHost.addTab(tabHost.newTabSpec(""Tab2"")                .setIndicator(new Button(this))                                .setContent(new Intent(this, TabActivity2.class)));</code></pre><p>In this case FrameLayout always got black line and shadow effect on top (you can see it under buttons):</p><p><img src=""http://i.stack.imgur.com/DNC4G.png"" alt=""alt text""></p><p><strong>The question is: How can I get rid of this line? Where is the method that draws it in Android sources?</strong></p>","238123","","238123","","2010-08-26 08:40:50","2012-04-01 14:51:39","Get rid of the line under TabWidget","<android><line><tabwidget>","5","0","6","",""
"3511741","1","","","2010-08-18 11:53:27","2","16370","<p>I need some help in application exit handling.My application has multiple Activity say : - EntryAct, Act1, Act2 .... Act10.</p><p>When user presses home key on any of these Activities, I need to do some flag setting.</p><p>Handling home key in every application Activity is not possible!Can someone tell how this can be achieved?</p><p>Can't change anything in OnPause,OnStop or OnDestory of all activities Act1... Act10. :-(</p>","423923","","423923","","2010-08-18 12:07:13","2012-06-30 02:52:38","Android Application On Exit Event","<android>","3","0","3","2013-06-11 18:59:31",""
"3512130","1","3512274","","2010-08-18 12:38:17","13","1522","<p>Assume that, I have a TCP connection that doing heavy data transmitting on my 3G network; and I walked home, Android switch to my home Wifi automatically. Now what happen to the existing connection? is it simply disconnect? or it will keep going, only new connections will use wifi?</p><p>In addition, what if I walk away from home, wifi lost signal and switch to 3g? It should be safe to guess the connection is dropped. For my application, do I need to handle the reconnection or there is a auto fall back solution?</p><p>Thanks in advance.</p><p>Hongbo</p>","423989","","423989","","2010-08-18 12:53:49","2010-08-18 14:10:24","What will happen to existing connections when switch between 3g/wifi","<android><wifi><3g>","2","1","6","",""
"3512198","1","","","2010-08-18 12:47:07","15","10421","<p>How can I startup a browser with the adb shell and display a certain web page?</p>","492729","","114066","","2010-08-18 13:49:19","2013-10-15 16:14:20","Need command line to start web browser using adb","<android>","2","1","9","",""
"3512222","1","","","2010-08-18 12:49:51","0","1420","<p>I have a list-activity using a row-based layout for elements of the list:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextView android:id=""@+id/exerciseText"" android:textSize=""40sp"" android:layout_weight=""1"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;ImageView android:id=""@+id/solutionImage"" android:scaleType=""center"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt; &lt;/LinearLayout&gt;</code></pre><p>I fill the list with a SimpleAdapter and provide the data over this List:</p><pre><code>List&lt;HashMap&lt;String, String&gt; &gt; data;</code></pre><p>I initially load the data with some strings and default image. The main images are loaded later. The images are saved as resource ids </p><pre><code>Integer.toString(R.drawable.check)</code></pre><p>Now the problem: While the images I initially put into the list are loading properly, updated items don't change their appearance directly. They have to be out of the viewable area(In the scrolled view I have to scroll until they are out of the window. If I scroll them back they changed their appearance). This problem does not only concern to images but also on texts(which I don't update in my App).</p><p>Do I have to use an ArrayAdapter rather than a SimpleAdapter to get automatically updating work? </p><p>Thanks for tips in any kind and please ask if I didn't make myself clear</p>","423949","","","","","2012-02-20 10:24:28","Images in ListView over SimpleAdapter are not updatet after change","<android>","2","0","1","",""
"3512306","1","3512743","","2010-08-18 12:58:49","1","333","<p>I would need to wake up my camera when i click a button on my App. After that it takes a picture and save it to the sdcard and display the path of that image as Toast? How can this be done?</p>","267269","","114066","","2010-08-18 13:47:47","2010-08-18 13:47:47","How to wake up the Camera in Android?","<android><camera>","1","0","1","",""
"3512368","1","","","2010-08-18 13:05:31","1","775","<p>I have a Receiver for BOOT_COMPLETED intent and it will start a Service by calling startService with an intent and the Service processes that intent in onStartCommand function by spawning a thread that does a HTTP post to a server.</p><p>On powerup, sometimes it takes 3 to 5 seconds to get the active data connection on phone, when this happens Service fails to do HTTP post as there is no data connection. Is it possible for the Receiver to send the intent to Service using startService with a delay.? so that when onStartCommand of Service is called data connection is ready to post data.</p>","110024","","","","","2010-08-18 13:25:41","Sending intents from receiver to service with a delay","<android>","2","0","","",""
"3512417","1","","","2010-08-18 13:11:37","0","284","<p>I developed an ""heavy"" application (700 Mb !). With an ""apk installer"" application, i can install it on the Nexus One SD card (Froyo ""installLocation"" option). My application is heavy because of the videos it contains (located in /raw directory). The problem I have, is that it crashes when launched, with this error :</p><pre><code>08-18 11:22:16.179: ERROR/AndroidRuntime(1250): FATAL&gt; &gt; EXCEPTION: main 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):&gt; &gt; java.lang.RuntimeException: Unable to&gt; &gt; instantiate activity&gt; &gt; ComponentInfo{com.test.media/com.test.media.Welcome}:&gt; &gt; java.lang.ClassNotFoundException:&gt; &gt; com.test.media.Welcome in loader&gt; &gt; dalvik.system.PathClassLoader[/mnt/asec/com.test.media-1/pkg.apk]&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.app.ActivityThread.access$2300(ActivityThread.java:125)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.os.Handler.dispatchMessage(Handler.java:99)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.os.Looper.loop(Looper.java:123)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.app.ActivityThread.main(ActivityThread.java:4627)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; java.lang.reflect.Method.invokeNative(Native&gt; &gt; Method) 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; java.lang.reflect.Method.invoke(Method.java:521)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; dalvik.system.NativeStart.main(Native&gt; &gt; Method) 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250): Caused by:&gt; &gt; java.lang.ClassNotFoundException:&gt; &gt; com.test.media.Welcome in loader&gt; &gt; dalvik.system.PathClassLoader[/mnt/asec/com.test.media-1/pkg.apk]&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; java.lang.ClassLoader.loadClass(ClassLoader.java:573)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; java.lang.ClassLoader.loadClass(ClassLoader.java:532)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.app.Instrumentation.newActivity(Instrumentation.java:1021)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     at&gt; &gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)&gt; &gt; 08-18 11:22:16.179:&gt; &gt; ERROR/AndroidRuntime(1250):     ... 11&gt; &gt; more</code></pre><p>I dont't understand the reason of this error, because when i try the same thing with a lighter application (250 Mb) it runs perfectly. Has anyone of you ever had this kind of problem ? Do you know if there is a size limit for applications to work ?</p><p>Thank you for your help !</p>","416081","","","","","2011-04-14 03:00:42","Problem running heavy application","<android><resources>","4","0","1","",""
"3512616","1","","","2010-08-18 13:31:40","0","1466","<pre><code>fileListView = new FileListController(this);fileListView.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        pWindow.dismiss();    }});pWindow = new PopupWindow(fileListView);pWindow.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);pWindow.setTouchable(true);button_show.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        if (pWindow.isShowing()) {            pWindow.dismiss();            return;        }        pWindow.showAsDropDown(v);        pWindow.setFocusable(true);        pWindow.update();    }});fileListView.listView.setLongClickable(true);registerForContextMenu(fileListView.listView);</code></pre>","424061","","512958","","2012-12-10 13:40:39","2012-12-10 13:40:39","ListView in PopupWindow,ContextMenu not popping up on Long click","<android><listview><contextmenu><popupwindow>","1","1","","",""
"3512651","1","3512701","","2010-08-18 13:36:18","0","1384","<p>Hi In canvas we have <code>drawrect()</code> method for  drawing rectangle. I now want to fill it with Image view. For this what can i do? Give me some suggestions. </p>","454808","","922198","","2013-02-18 23:56:41","2013-02-18 23:56:41","How we place the image in Rectangle in canvas","<android>","1","0","","",""
"3512680","1","3512850","","2010-08-18 13:38:55","5","11927","<p>How to dynamically change the background LinearLayout?</p>","413881","","","","","2012-06-15 07:46:43","Dynamically change the background LinearLayout","<android>","2","3","1","",""
"3512822","1","","","2010-08-18 13:54:55","0","788","<p>If you got:</p><p>Button btn = (Button) findViewById(R.id.widget28);</p><p>where ""widget28"" is the name of your button, how can you pass thisinto the findViewById as a String? or get it from R class as a string?</p><p>I want to get the Button instance by string and not by the hard code R.id.widget28 reference.</p><p>thanks</p>","188674","","188674","","2010-08-18 14:45:23","2010-08-18 14:45:23","Pass Control By Name To findViewById","<android>","1","2","","",""
"3512984","1","","","2010-08-18 14:12:05","0","514","<p>I've been developing a cool game for android recently (http://www.androidzoom.com/android_games/cards_and_casino/the-best-card-game-everyaniv_jrbe_download.html) and I've been getting requests for a mute button.So I've implemented all the required UI stuff and I'm using the application's sharedPreferences to store the isMuted state, but now I need that functionality in the mediaplayer class.I've thought about extending it, but since the original mediaplayer has the static create method, overriding it might not be a great solution, the same goes for creating a class that holds a mediaplayer instance and creating my own create method - it's doable but it's dirty.I'm sure I'm not the first person to encounter this issue, can somebody please share their experience on the matter?Thanks</p>","380168","","","","","2011-02-09 06:43:40","A mutable MediaPlayer class that extends or uses android's MediaPlayer class","<android><audio><media-player>","1","0","","",""
"3512989","1","","","2010-08-18 14:12:29","1","146","<pre><code>private void hour(){    Toast.makeText(this,String.valueOf(Calendar.HOUR_OF_DAY),Toast.LENGTH_LONG).show();}</code></pre>","365860","","180538","","2011-02-06 13:08:36","2011-02-06 13:08:36","Why he return 11 all the time ??? (btw. now is 16 h my local time)","<android><time><calendar>","1","2","","",""
"3513073","1","3513139","","2010-08-18 14:21:44","0","991","<p>Does anybody knows the unit of the return value of Sensor.TYPE_LIGHT on Android ?</p><p>Thanks.</p>","424106","","255721","","2012-08-29 05:11:57","2012-08-29 05:11:57","Android Sensor.TYPE_LIGHT unit","<android><sensor><light>","2","0","1","",""
"3513234","1","3513427","","2010-08-18 14:38:29","0","2069","<p>I would like to hack around the Android default Settings app for prototyping purposes. What is the correct procedure for building and installing the ""customized"" app?</p><p>After I modify the Settings source in the platform source tree, how to I build it? After I build it, can I install Settings by itself, or do I rebuild and reinstall the entire Android platform image?</p>","440093","","","","","2010-08-18 14:56:42","Android: How to modify Settings app?","<android>","1","0","3","",""
"3513398","1","","","2010-08-18 14:54:29","0","1707","<p>I'm working on developing a game in Java for android phones and I was wondering if there was a place to view a complete game script so I could see all the components and how it's setup? Kind of like a dissection self-tutorial. Either a developer or website that offers game scripts in their entirety for android phones? I'm pretty new to Java programming and was just looking for a good example of a running game. Thanks for your help.</p>","424151","","","","","2010-08-18 15:04:00","Looking for Android Development Java Game Script","<android>","1","0","1","",""
"3513420","1","3513582","","2010-08-18 14:56:19","7","3243","<p>Does Android have an equivalent to Cocoa's viewDidLoad and viewDidAppear functions? </p><p>If not, then how would I go about performing an action when a View appears? My app is a tabbed application, in which one of the tabs is a list of forum topics. I would like the topic list to be refreshed every time the view appears. Is such a thing possible in Android?</p>","424155","","73488","","2010-08-18 15:08:05","2013-05-30 15:29:28","Android's viewDidLoad and viewDidAppear equivalent","<iphone><android><viewdidload><viewdidappear>","3","0","4","",""
"3513554","1","","","2010-08-18 15:08:08","0","536","<p>I am having back and forward images in my footer,by using them, I want to navigate to next page,but the problem image click have not changing the function call when click image is to changed.i'm using click events for bothhere code for backward  image </p><pre><code>img_back setOnClickListener(new OnClickListener(){void OnClick(view arg1){     .....}});</code></pre><p>the problem here isif i supposed clicked back image first and to move for forward image click event secondly,but it not fired the forward image click event it's only firing back image event alone which initially clicked.</p><p>help me to fix this problem.</p><p>Thanks in advance.</p>","407506","","1479511","","2013-04-21 15:51:55","2013-04-21 15:51:55","Image click event not working","<android><image><events><onclick>","0","5","","",""
"3513594","1","3514063","","2010-08-18 15:11:44","3","7934","<p>I want to do something when the user has scrolled >90% down, so I thought I could just add a onScrollListener like I would in a ListView. Unfortunatly, ScrollView doesn't seem to have a similar method. Is there any way I can do what I want; getting a notification when the user scrolls approx 90% down?</p><p>Thanks,Erik</p>","419625","","","","","2013-11-14 20:08:15","Android: ScrollView 'setOnScrollListener' (like ListView)","<android>","5","0","1","",""
"3513608","1","3515502","","2010-08-18 15:13:05","1","620","<p>I'm having a problem with a ListActivity.  I've extended ArrayAdapter and Overridden getView to fill in the data for each row.  I throw some data from my Adapter's ArrayList into a TextView.</p><p>My problem is, when I scroll, the TextView of each row populates with text that is not in its corresponding data in the ArrayList.  What I mean is: say I have a row at the top of my list with a TextView that is populated with emptystring.  If I'm at the bottom of my list and see a row with a TextView populated with ""bob"" and I flick to scroll to the top, the row at the top may now have ""bob"" in its TextView, but the data at that index of my ArrayList does not contain ""bob.""  It contains emptystring (actually null).  If I continue scrolling up and down, other rows will populate (or erase) with data that doesn't correspond to what's in the Adapter's ArrayList.</p><p>To cause this to happen, I don't need to scroll the ListView fast.  However, it appears the faster I scroll, the more rows get messed up.</p><p>Here is my code.  I realize I'm using findViewById every time getView gets called, but that's beside the point.  I'm calling it against convertView; so it should be grabbing the correct TextView on each row, yes?</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    // get the View for this list item    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.layout_mylistlist_item, null);    }    // get the next object    MyListItem myItem = m_items.get(position);    // set up the list item    if (myItem != null) {        TextView txtName = (TextView) v.findViewById(R.id.mylist_name);        // set text        if (txtName != null &amp;&amp; myItem.getName() != null) {            txtName.setText(myItem.getName());        }    }   // return the created view    return v;}</code></pre>","406790","","406790","","2010-08-18 15:28:47","2010-08-18 18:41:31","Out of control ListView","<android><listview><scrolling><listviewitem><listactivity>","2","3","","",""
"3513665","1","","","2010-08-18 15:18:37","4","1852","<p>I'm implementing Parcelable class that has another Parcelable insde.</p><p>In OuterParcelable class:</p><pre><code>@Overridepublic void writeToParcel(Parcel dest, int flags) {    Bundle tmp = new Bundle();    tmp.putParcelable(""innerParcelable"", mParcelable);    dest.writeBundle(tmp);</code></pre><p>and then:</p><pre><code>public OuterParcelable(Parcel parcel) {    super();    Bundle b = parcel.readBundle();    mParcelable = b.getParcelable(""innerParcelable"");</code></pre><p>and:</p><pre><code>    public OuterParcelable createFromParcel(Parcel in) {        return new OuterParcelable(in);    }</code></pre><p>When I recreate object using above code I get:</p><pre><code> 08-18 17:13:08.566: ERROR/AndroidRuntime(15520): Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: my.package.InnerParcelable</code></pre>","296427","","","","","2013-01-03 20:20:21","Problem in implementing Parcelable containing other Parcelable","<android><bundle><unmarshalling><classnotfoundexception><parcelable>","2","0","3","",""
"3513690","1","","","2010-08-18 15:20:57","0","341","<p>I'm trying to create some 9patch images that have some text as their content. I define the stretchable area with a black pixel line top and left. And I define the content area with a black pixel line right and bottom.</p><p>However, it seems as though Droid is adding padding to the top and bottom of the content area, messing my layouts up. Has anyone else experienced this?</p>","31399","","","","","2010-10-12 02:19:09","Font padding problems with Droid font in Android","<android>","1","0","","",""
"3513779","1","","","2010-08-18 15:30:29","2","6635","<p>I am facing an issue with AsynsTask in my Application. I really do not understand the reason of it happening.</p><p>The issue is ""The application works perfectly usually, now when any of the <code>activity</code> is displayed on the screen and I keep my device idle for a longer period of time. Then when I make the keyguard on the view of the last active activity is displayed to me. But as soon as I click on any component below mentioned exception is thrown. If the device is not kept for a longer period of time then there is no problem as such. The application makes http connection in onResume of most of the activities. I did this since every time the user comes to particular view then he should get the updates lists of posts from the webservice""</p><pre><code>W/AsyncTask(18829): java.lang.InterruptedExceptionW/AsyncTask(18829):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1254)W/AsyncTask(18829):     at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:219)W/AsyncTask(18829):     at java.util.concurrent.FutureTask.get(FutureTask.java:82)W/AsyncTask(18829):     at android.os.AsyncTask$3.done(AsyncTask.java:196)W/AsyncTask(18829):     at java.util.concurrent.FutureTask$Sync.innerCancel(FutureTask.java:293)W/AsyncTask(18829):     at java.util.concurrent.FutureTask.cancel(FutureTask.java:75)W/AsyncTask(18829):     at android.os.AsyncTask.cancel(AsyncTask.java:325)W/AsyncTask(18829):     at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:73)W/AsyncTask(18829):     at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:1)W/AsyncTask(18829):     at android.os.AsyncTask$2.call(AsyncTask.java:185)W/AsyncTask(18829):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)W/AsyncTask(18829):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)W/AsyncTask(18829):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)W/AsyncTask(18829):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)W/AsyncTask(18829):     at java.lang.Thread.run(Thread.java:1096)W/InputManagerService(   85): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44daac80D/NetworkStateTracker(   85): setDetailed state, old =CONNECTED and new state=DISCONNECTEDD/NetworkStateTracker(   85): setDetailed state, old =CONNECTED and new state=OBTAINING_IPADDRD/WifiStateTracker(   85): DhcpHandler: DHCP request startedD/ConnectivityService(   85): ConnectivityChange for WIFI: CONNECTING/OBTAINING_IPADDRD/ConnectivityService(   85): Dropping ConnectivityChange for WIFI: CONNECTING/OBTAINING_IPADDRI/AudioHardwareQSD(   59): AudioHardware pcm playback is going to standby.I/System.out(18829): URL for Subsection Bookmark reply ==&gt; http://www.softwebdemo.com/viral/babbleville/services/getvilledetails.php?action=getbookmarksubsection&amp;Userid=51&amp;start=0&amp;end=30W/dalvikvm(18829): threadid=10: thread exiting with uncaught exception (group=0x4001d7f0)E/AndroidRuntime(18829): FATAL EXCEPTION: AsyncTask #3E/AndroidRuntime(18829): java.lang.RuntimeException: An error occured while executing doInBackground()E/AndroidRuntime(18829):    at android.os.AsyncTask$3.done(AsyncTask.java:200)E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)E/AndroidRuntime(18829):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)E/AndroidRuntime(18829):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)E/AndroidRuntime(18829):    at java.lang.Thread.run(Thread.java:1096)E/AndroidRuntime(18829): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()E/AndroidRuntime(18829):    at android.os.Handler.&lt;init&gt;(Handler.java:121)E/AndroidRuntime(18829):    at android.app.Dialog.&lt;init&gt;(Dialog.java:101)E/AndroidRuntime(18829):    at android.app.AlertDialog.&lt;init&gt;(AlertDialog.java:63)E/AndroidRuntime(18829):    at android.app.AlertDialog.&lt;init&gt;(AlertDialog.java:59)E/AndroidRuntime(18829):    at android.app.AlertDialog$Builder.create(AlertDialog.java:786)E/AndroidRuntime(18829):    at com.babbleville.utils.BabbleVilleSyncTask.AlertOnInternetConnetion(BabbleVilleSyncTask.java:188)E/AndroidRuntime(18829):    at com.babbleville.utils.BabbleVilleSyncTask.checkInternetConnetion(BabbleVilleSyncTask.java:169)E/AndroidRuntime(18829):    at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:57)E/AndroidRuntime(18829):    at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:1)E/AndroidRuntime(18829):    at android.os.AsyncTask$2.call(AsyncTask.java:185)E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)E/AndroidRuntime(18829):    ... 4 moreW/ActivityManager(   85):   Force finishing activity com.babbleville/.VilleBookmarkReplyE/WindowManager(18829): Activity com.babbleville.VilleBookmarkReply has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44a25940 that was originally added hereE/WindowManager(18829): android.view.WindowLeaked: Activity com.babbleville.VilleBookmarkReply has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44a25940 that was originally added hereE/WindowManager(18829):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:247)E/WindowManager(18829):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)E/WindowManager(18829):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)E/WindowManager(18829):     at android.view.Window$LocalWindowManager.addView(Window.java:424)E/WindowManager(18829):     at android.app.Dialog.show(Dialog.java:241)E/WindowManager(18829):     at com.babbleville.utils.BabbleVilleSyncTask.onPreExecute(BabbleVilleSyncTask.java:48)E/WindowManager(18829):     at android.os.AsyncTask.execute(AsyncTask.java:391)E/WindowManager(18829):     at com.babbleville.VilleBookmarkReply.loadSubsectionBookmark(VilleBookmarkReply.java:1186)E/WindowManager(18829):     at com.babbleville.VilleBookmarkReply.loadBookmarkSubsection(VilleBookmarkReply.java:1171)E/WindowManager(18829):     at com.babbleville.VilleBookmarkReply.onClick(VilleBookmarkReply.java:277)E/WindowManager(18829):     at android.view.View.performClick(View.java:2408)E/WindowManager(18829):     at android.view.View$PerformClick.run(View.java:8816)E/WindowManager(18829):     at android.os.Handler.handleCallback(Handler.java:587)E/WindowManager(18829):     at android.os.Handler.dispatchMessage(Handler.java:92)E/WindowManager(18829):     at android.os.Looper.loop(Looper.java:123)E/WindowManager(18829):     at android.app.ActivityThread.main(ActivityThread.java:4627)E/WindowManager(18829):     at java.lang.reflect.Method.invokeNative(Native Method)E/WindowManager(18829):     at java.lang.reflect.Method.invoke(Method.java:521)E/WindowManager(18829):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/WindowManager(18829):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/WindowManager(18829):     at dalvik.system.NativeStart.main(Native Method)D/NetworkStateTracker(   85): setDetailed state, old =OBTAINING_IPADDR and new state=CONNECTEDD/ConnectivityService(   85): ConnectivityChange for WIFI: CONNECTED/CONNECTEDD/WifiWatchdogService(   85): (android.server.ServerThread) Softwebsolutions (00:25:9c:0c:2d:c0) does not require the watchdogD/ConnectivityService(   85): adding dns 192.168.3.105 for WIFID/Tethering(   85): Tethering got CONNECTIVITY_ACTIOND/Tethering(   85): MasterInitialState.processMessage what=3E/HierarchicalStateMachine(   85): TetherMaster - unhandledMessage: msg.what=3I/GTalkService(  214): [ServiceAutoStarter] --- connectivity changed</code></pre><p>Can someone let me know the reason behind this error and any solution to this?</p>","261566","","119895","","2010-09-11 13:40:40","2011-09-01 10:04:45","AsyncTask interrupted exception in Android?","<android><exception><android-asynctask>","1","0","1","",""
"3513859","1","","","2010-08-18 15:39:34","13","1166","<p>I'm a bit at a loss, here. I've been seeing a steadily increasing number of these <code>NullPointerException</code>s in <code>handleStopActivity</code>. I suspect that the increase coinicides with the increase in 2.2 upgrades to Droid owners, though that's just a guess. I've never seen the crash myself, and the stack trace provided by the market does not mention any of the classes I've written. As such, I have no idea where to start in fixing the problem.</p><pre><code>java.lang.NullPointerExceptionat android.app.ActivityThread.handleStopActivity(ActivityThread.java:3674)at android.app.ActivityThread.access$2600(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2153)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:144)at android.app.ActivityThread.main(ActivityThread.java:4937)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Since I don't know the cause, I also don't know what information to provide to aid in diagnosis, so I'll give an overiew:My app is WootWatcher. It tracks Woot.com and notifies users of new items for sale. It does this by means of a service that runs in a separate process. The service and the main activity communicate with each other via aidl interface and callback.  I also make use of message handlers in both the service and activity, and frequently spawn threads for expensive tasks. </p>","301145","","2865804","","2013-11-04 08:18:32","2013-11-04 08:18:32","NullPointerException in handleStopActivity -- No reference to my code in stack trace","<java><android>","4","8","6","",""
"3513862","1","3544107","","2010-08-18 15:39:40","6","1967","<p>I am writing a live wallpaper for android. To test my basic code was working I drew a rectangle in the top left-hand cornor of the screen:</p><pre><code>canvas.drawRect(0f,0f,50f,50f,paint);</code></pre><p>Half of the rectangle was underneath the bar at the top of the home screen.<img src=""http://i.stack.imgur.com/OMcpV.png"" alt=""alt text""> </p><p>I tried to take into account pixel offsets using:</p><pre><code>public void onOffsetsChanged(float xOffset, float yOffset,            float xOffsetStep, float yOffsetStep, int xPixelOffset,            int yPixelOffset)...  canvas.drawRect(0f+xPixelOffset,0f+yPixelOffset,50f+xPixelOffset,50f+yPixelOffset  ,paint);</code></pre><p>But the rectangle is still drawn underneath the bar. How do find where the bar ends so I can draw below it?</p><p>Cheers,</p><p>Pete</p>","130076","","19750","","2011-08-31 14:26:06","2012-01-31 03:41:17","Android - Live Wallpaper offset clipping","<android><draw><offset><live-wallpaper><wallpaper>","2","1","1","",""
"3513959","1","3514571","","2010-08-18 15:49:04","1","1719","<p>I'm just learning OpenGL ES on Android, and I am trying to get some kind of <strong>anisotropic filtering</strong> on textures. I want to increase the size of a sprite, with some kind of interpolation, instead of this ""nearest-pixel-interpolation"".</p><p>Is there anything like this in the OpenGL ES standard or do I have to make one texture for each size?</p>","333361","","","","","2010-08-18 16:53:13","Android, anisotropic filtering?","<android><opengl-es>","2","2","","",""
"3513966","1","3514011","","2010-08-18 15:49:53","3","373","<p>before publishing a new app on the market, on which devices would you suggest to check whether it runs fine or not? What are your experiences? How do you handle this?</p><p>Are there some empirical values, for example, do applications that run smoothly on a HTC Desire behave similar on all HTC devices? Are there some devices on which the app should definately be checked?</p><p>I like to picture myself releasing a high quality product instead of throwing some crap on the market. :) But I suppose I am not the only one who cannot buy like 5 or more devices just to ensure that the apps works fine on every kind of device.Well, at least not yet... ;)</p><p>Thanks for your help!</p><p>Best regardsS.</p>","419501","","157882","","2011-10-23 15:26:40","2011-10-23 15:26:40","Developing an Android smartphone app - on which devices would YOU suggest to check the app?","<android><testing><smartphone>","4","0","5","2012-02-22 17:14:21",""
"3514032","1","","","2010-08-18 15:56:32","0","771","<p>I am trying to compile and run the <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=summary"" rel=""nofollow"">Android Camera</a> for sdk 1.6 (also called API level 4 or Donut release).</p><p>While there is no <code>minSdkVersion</code> in the AndroidManifest, it clearly does not run on a donut device.  In fact, if compiled with sdk 2.2 the camera will crash with a NoSuchMethodError execption on an avd or a G1 with sdk 1.6. </p><p>I tried also checking out the [donut-release] tag, but, strangely, it won't even compile giving many errors like:</p><pre><code>[javac] /home/mrucci/camtest2/src/com/android/camera/ImageManager.java:41: cannot find symbol[javac] symbol  : class DrmStore[javac] location: package android.provider[javac] import android.provider.DrmStore;[javac]                         ^[javac] /home/mrucci/camtest2/src/com/android/camera/Util.java:32: cannot find symbol[javac] symbol  : class MediaMetadataRetriever[javac] location: package android.media[javac] import android.media.MediaMetadataRetriever;[javac]                      ^[javac] /home/mrucci/camtest2/src/com/android/camera/MenuHelper.java:29: cannot find symbol[javac] symbol  : class ExifInterface[javac] location: package android.media[javac] import android.media.ExifInterface;....[javac]                      ^[javac] /home/mrucci/camtest2/src/com/android/camera/ActionMenuButton.java:81: cannot find symbol[javac] symbol  : variable mScrollX[javac] location: class com.android.camera.ActionMenuButton[javac]                           mScrollX + mRight - mLeft),[javac]                           ^[javac] /home/mrucci/camtest2/src/com/android/camera/ActionMenuButton.java:81: cannot find symbol[javac] symbol  : variable mRight[javac] location: class com.android.camera.ActionMenuButton[javac]                           mScrollX + mRight - mLeft),</code></pre><p>In particular, I really do not understand why <a href=""http://developer.android.com/reference/android/media/ExifInterface.html"" rel=""nofollow"">ExifInterface</a> is used in the ""donut"" tag when it has been introduced since API level 5. Am I missing something?</p><p>Thank you very much for any help.</p>","133106","","133106","","2010-08-22 14:38:51","2010-08-22 14:38:51","Compile Android camera application for sdk 1.6","<android><camera>","1","0","","",""
"3514109","1","3514508","","2010-08-18 16:04:15","0","1909","<p>I am optimizing our database for Android SQLite.</p><p>The data is simple, 3 ints (Country, State, City) The data is stored in order by Country, State and City.</p><p>If I create an index on the three fields in ASC, would that be the most efficient given that we ""READ-ONLY"" the data 100% of the time by the 3 fields?</p>","172861","","","","","2010-08-18 20:36:51","Android SQLite Index Optimization","<android><sqlite>","1","0","","",""
"3514123","1","","","2010-08-18 16:05:24","3","892","<p>I have observed that by default the wifi adaptor goes into (power saving mode) PSM mode.  When Certain applications such as youtube appear to buffer video, the adaptor leaves PSM mode into CAM state or full power mode. Once the buffering is done, the wifi adaptor goes back into PSM mode. I have observed this behavior with other applications as well. Is there an API call that supports this kind of behavior? It's not clear from the documentation how to switch the WIFI adapator in and out of PSM mode. </p>","424235","","","","","2011-06-22 21:45:39","Android wifi power question","<android><wifi>","1","0","1","",""
"3514182","1","3523519","","2010-08-18 16:13:07","1","1614","<p>I need to update my AppWidget when my main activity pauses.  I tried using the following code in my main activity's onPause():</p><pre><code>super.onPause();AppWidgetManager manager = AppWidgetManager.getInstance(this);int[] a = manager.getAppWidgetIds(new ComponentName(this, ""WidgetProvider""));new WidgetProvider().onUpdate(this, manager, a);</code></pre><p>When I call this code, however, <code>a</code> is empty.  What am I doing wrong?</p>","346688","","346688","","2010-08-18 16:47:47","2010-08-19 15:42:01","Update AppWidget from within program?","<android><appwidget>","1","0","1","",""
"3514262","1","","","2010-08-18 16:22:37","0","184","<p>I don't know much about Java or Android development, so I'm digging into it myself.  But I noticed that if I open sample code that came with my new 2.2 SDK, Eclipse by default will contain errors until I open up specific files.  Is this normal for IDEs?  Or is there something I'm missing?</p><p>I am having to use Eclipse 3.5.2 since Google said there is issues with the new version and the 2.2 SDK (or was it the Android Plugin?)</p>","393219","","","","","2012-02-04 05:19:31","Eclipse New Project (From Sample) Defaults to Errors","<android><eclipse>","2","0","","",""
"3514287","1","3514742","","2010-08-18 16:25:01","15","20783","<p>I would like to know if it is possible to have a service that is started with startService and then be able to also bind to that service and do some remote procedure calls?according to this:<a href=""http://developer.android.com/guide/topics/fundamentals.html#servlife"" rel=""nofollow"">http://developer.android.com/guide/topics/fundamentals.html#servlife</a></p><p>the two services have different lifecycle so it's not possible,does anyone know about it?</p>","234898","","759866","","2014-02-05 15:33:01","2014-02-05 15:33:01","android service startService() and bindService()","<android>","2","0","4","",""
"3514312","1","3514405","","2010-08-18 16:27:26","0","733","<p>I would think this should be a relatively easy question to answer, but I'm brand new to android development and so not sure where else to turn.</p><p>I have a simple layout (relative currently) for my main Activity.  I want to create an object (a card for a card game) that will have all of the necessary properties for that card (value, suit, etc).  I have images for all of those cards in my drawable folder.</p><p>For the sake of testing, I created a card.xml file in my layout folder and ""hardcoded"" in the background for one card.</p><p>My question is, now that I have an xml file with the layout for my card, how should I plug this into an object that contains info about that card and then how do I pull that object onto my main scene?  Should I create the card object as another activity and use setContentView() to reference the card.xml in the layout folder?  As I said, I'm just starting android development and not entirely sure how Activities work.  Assuming this is the correct method, how would I then pull this second activity onto my main scene?</p><p>TIA</p>","233971","","","","","2010-08-18 16:40:56","android UI - adding a new class","<android><user-interface><activity>","1","2","","",""
"3514392","1","3514483","","2010-08-18 16:36:21","2","2314","<p>I'm wondering how I can create a custom pop-up like the one in the screenshot below (borrowed from the Swype keyboard), where I can have a couple of buttons, which each commit a string to the currently ""connected"" <code>TextView</code> (via a <a href=""http://developer.android.com/reference/android/view/inputmethod/InputConnection.html"" rel=""nofollow"">InputConnection</a>). </p><p><strong>Please note:</strong> this is an <a href=""http://developer.android.com/reference/android/inputmethodservice/InputMethodService.html"" rel=""nofollow"">InputMethodService</a> and not an ordinary <code>Activity</code>. I already tried launching a separate <code>Activity</code> with <code>Theme:Dialog</code>. However, as soon as that one opens I lose my focus with the <code>TextView</code> and my keyboard disappears (and with that my <code>InputConnection</code> is gone).</p><p><img src=""http://i.stack.imgur.com/DpSWZ.png"" alt=""Swype""></p>","184367","","49246","","2010-11-13 10:41:37","2011-05-29 09:13:13","Android IME: showing a custom pop-up dialog (like Swype keyboard) which can enter text into the TextView","<android><keyboard><ime><android-input-method>","3","0","2","",""
"3514398","1","3514412","","2010-08-18 16:36:57","37","46385","<p>This code doesn't work:</p><pre><code>URL         url   = new URL( xmlPath );InputSource input = new InputSource( url.openStream() );</code></pre><p>all the time, resulting in an UnknownHostException, even when the host exists, has been hit successfully using the same code if from a different development host (machine), and also from a browser.</p><p>I'm probably out of line asking this question again, a repeat of <a href=""http://stackoverflow.com/questions/3293659/android-java-net-unknownhostexception-host-is-unresolved-strategy-question"">http://stackoverflow.com/questions/3293659/android-java-net-unknownhostexception-host-is-unresolved-strategy-question</a>. The forum software would not allow me to comment on the unsatisfactory answer to that question (in order to solicit more attention to the solution I ultimately found). Perhaps I'm not popular enough yet to be given that privilege. In the meantime, I'm essentially re-posting the question and a different answer.</p><p>Basically, I accept that maybe the Android device has a hard time with DNS under certain circumstances, but I've tried, for example the anddev.org example of how to use the SAX parser, and it worked on one machine I have and not on another.</p><p>Edit:As noted, I know a working answer and will post it.</p><p>I am a) asking a question (that's already been asked and unsuccessfully answered) and b) answering it for the benefit of those for whom my answer will be useful.</p>","339736","","339736","","2010-08-18 17:03:06","2014-01-15 08:18:52","Android java.net.UnknownHostException: Host is unresolved","<android>","14","7","7","",""
"3514418","1","3545211","","2010-08-18 16:39:05","15","9611","<p>I built my first Android app. </p><p>It is a Live Wallpaper designed for 2.2. </p><p>When I press and hold the screen, select <code>Wallpapers</code> and then select <code>Live Wallpapers</code>, my live wallpaper has what looks like a default icon with the name of my live wallpaper overlaid.</p><p>How do I set this icon?</p><p>My manifest file has an application icon specified as <code>@drawable/icon</code></p><p>Update</p><p>I think I need to add some info to this question as it poorly describes my problem (sorry).</p><ol><li>I have all the <code>res/drawable-[hml]dpi/</code> icons. I named them all <code>icon.png</code>.</li><li>My manifest file contains <code>&lt;application android:label=""@string/app_name"" android:icon=""@drawable/icon""&gt;</code></li><li>I have also tried creating a 48x48 icon in <code>res/drawable/</code> called <code>icon.png</code>.</li><li>I have also tried explicitly adding icons in other manifest tags if they are allowed. eg. service, activity, intent-filter (It should be obvious that I don't know how this manifest file really works, so I was trying anything)</li><li>In <code>Manage Applications</code>, the icon <strong>is displayed correctly</strong>.</li><li>When selecting the Live Wallpaper, the icon is <strong>not displayed correctly</strong>.</li><li><code>mdpi</code> icon is 48x48, <code>ldpi</code> icon is 36x36 and <code>hdpi</code> icon is 72x72</li></ol>","275052","","645502","","2011-05-13 15:15:18","2012-10-21 08:53:58","How to set the Android Live Wallpaper icon (aka ""thumbnail"")","<android><live-wallpaper>","6","0","2","",""
"3514534","1","","","2010-08-18 16:50:04","2","760","<p>Hello I have a service that starts on boot on my android device,the service is started using startService command so it runs saperatelly  from the UI, I would like to be notified when the service is killed from the OS or from the task manager so I can be able to saffelly save my data, I have override the onDestroy method but when the service is killed by the task manager the code on the onDestroy method is not executed!</p><p>Can I be notified when someone tries to kill my service and how?regards maxsap.</p>","234898","","","","","2010-10-06 15:09:50","android how to handle when a service is killed by OS or taskmanager","<android>","1","1","1","",""
"3514540","1","","","2010-08-18 16:50:33","0","154","<p>In android...once logging in into the google account after all the contacts from google server is synced is there any intent being broadcasted by the google mail app which tellsthat the google contacts are synced from the server? Could someone provide some info on this...</p>","424296","","","","","2011-07-08 02:28:26","Need info on google contacts sync","<android>","1","0","","",""
"3514548","1","3515221","","2010-08-18 16:51:01","5","9678","<p>I have a ListView with different layouts for different items.  Some items are separators.  Some items are different because they hold different kinds of data, etc.</p><p>I want to implement ViewHolders to speed up the getView process, but I'm not quite sure how to go about it.  Different layouts have different pieces of data (which makes naming difficult) and different numbers of Views I want to use.</p><p>How should I go about doing this?</p><p>The best idea I can come up with is to create a generic ViewHolder with X items where X is the number of Views in an item layout with the highest number of them.  For the other views with a small number of Views, I'll just use a subsection of those variables in the ViewHolder.  So say I have 2 layouts I use for 2 different items.  One has 3 TextViews and the other has 1.  I would create a ViewHolder with 3 TextView variables and only use 1 of them for my other item.  My problem is that this can get really ugly looking and feels really hacky; especially when an item layout may have many Views of many different types.</p><p>Here is a very basic getView:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    MyHolder holder;    View v = convertView;    if (v == null) {        LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);        v = vi.inflate(R.layout.layout_mylistlist_item, parent, false);        holder = new MyHolder();        holder.text = (TextView) v.findViewById(R.id.mylist_itemname);        v.setTag(holder);    }    else {        holder = (MyHolder)v.getTag();    }    MyListItem myItem = m_items.get(position);    // set up the list item    if (myItem != null) {        // set item text        if (holder.text != null) {            holder.text.setText(myItem.getItemName());        }    }    // return the created view    return v;}</code></pre><p>Suppose I had different types of row layouts, I could have a ViewHolder for each type of row.  But what type would I declare ""holder"" to be at the top?  Or would I declare a holder for each type and then use the one for the type of row I'm on.</p>","406790","","406790","","2010-08-18 18:39:31","2010-08-18 18:52:37","Creating ViewHolders for ListViews with different item layouts","<android><listview><listactivity>","1","0","8","",""
"3514558","1","","","2010-08-18 16:51:44","1","117","<p>I would like to know if the WebView browser understands an embedded HTML media object and plays in the media player or</p><p>do we have to start a Media Player activity to play the media content?</p><p>Thanks,Sana.</p>","402637","","402637","","2010-08-18 18:17:09","2010-08-18 18:17:09","WeView and Media Content play!","<android>","0","0","1","",""
"3514579","1","3514809","","2010-08-18 16:54:02","8","3121","<p>That idiot being me.</p><p>I've read a bit about it at <a href=""http://oauth.net/"">http://oauth.net/</a> , it's ""a simple way to publish and interact with protected data"" apparently.</p><p>I think it's exactly what I need to provide a secure way of accessing data from an android/iphone app via a REST web service, but I can't work out exactly what it is.</p><p>So, put simply, what exactly does it do and are there any (really) simple examples of it in action I can follow, preferably implementing something in c# that can be accessed from a smartphone app?</p><p>Thanks.</p>","56007","","","","","2010-08-18 18:44:53","Can anybody explain OAuth to an idiot?","<c#><android><security><rest><oauth>","2","2","4","",""
"3514639","1","3514768","","2010-08-18 17:03:10","6","11756","<p>I  use some kind of stopwatch in my project and I have </p><pre><code>start time ex: 18:40:10 hstop time  ex: 19:05:15 h</code></pre><p>I need a result from those two values like <code>final time = stop - start</code></p><p>I found some examples but they all are very confusing . </p><p>Is there any simple solution ?</p>","365860","","17343","","2010-08-18 17:14:58","2010-08-18 17:38:40","Android Java : How to subtract two times?","<java><android><timer><subtract>","2","0","","",""
"3514808","1","3515412","","2010-08-18 17:25:20","6","8633","<p>Now that SENSOR_ORIENTATION is deprecated, what's the best practice for obtaining compass heading?  The old way was so simple.</p>","338479","","","","","2012-01-01 16:55:26","How to get Android compass reading?","<android>","2","0","3","",""
"3514862","1","","","2010-08-18 17:31:46","0","1544","<p>Our Android app loads RSS feeds for news and blog sites and displays the stories in a webview.</p><p>Whenever a story has a YouTube video, the video doesn't show up and it doesn't play (the object is there, but it's just whitespace &amp; nothing happens when you tap it)</p><p>Surely, since Google owns both Android and YouTube there's simple way to allow YouTube videos to play in a webview within Android Apps?? (They work great in our iPhone app).</p><p>Any suggestions are greatly appreciated!!</p><p>Thanks,John</p>","424331","","","","","2010-08-18 18:03:17","How to get YouTube Videos to show up & play in Android Apps?","<android><youtube>","1","0","1","",""
"3514881","1","3514972","","2010-08-18 17:34:16","0","870","<p>I create an Intent in one class then it's returned to another class.  I need to check the type of intent it is.  I need to ensure it's not a specific class of intent.</p><p>How to do this?</p><pre><code>if( newIntent == ActivityName.class )</code></pre><p>Edit:So I would need to know if the new intent would equal an intent of a certain type:</p><pre><code>newIntent = new Intent(context, ActivityName.class);return newIntent;</code></pre><p>In another class:</p><pre><code>if( newIntent == ActivityName.class ) // do something</code></pre><p>Hope this clarifies a bit.</p>","386541","","386541","","2010-08-18 18:18:20","2010-08-18 18:18:20","Identify android intent type, from another method/class?","<android>","1","0","","",""
"3514900","1","","","2010-08-18 17:36:50","4","4136","<p>I need to enable a MenuItem when a previous screen (Activity) returns. </p><p>I tried this code:</p><p>...((MenuItem)findViewById(R.id.menu_how)).setEnabled(true);...</p><p>but a null pointer exception is launched.</p><p>BTW, the menu_how is set to false in xml; and the code is part of onActivityResult(int requestCode, int resultCode, Intent data) call.</p>","424271","","","","","2012-11-24 22:10:54","Android - Enabling MenuItems by code","<android><menuitem>","3","0","3","",""
"3514905","1","","","2010-08-18 17:37:29","0","454","<p>Alright so I'm just learning how to work with contacts and such. I would like to have my contacts listed out in a ListView, with custom adapter (I think thats what it is called, where I can have ImageViews, TextViews, all that such, in one ListView entry). How would I be able to do that with the following code that I have?</p><pre><code>Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); while (cursor.moveToNext()) {     String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));     String hasPhone = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));     if (Boolean.parseBoolean(hasPhone)) {         // You know have the number so now query it like this        Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID +"" = ""+ contactId, null, null);         while (phones.moveToNext()) {             String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));                         }         phones.close();     } } cursor.close();</code></pre>","362857","","","","","2010-08-18 17:44:44","Adding contacts to a ListView","<android>","1","0","","",""
"3514985","1","3619143","","2010-08-18 17:45:22","0","4761","<p>I'm installing and configuring Eclipse Galileo 3.52 on a PC following the instructions on <a href=""http://developer.android.com/sdk/eclipse-adt.html"" rel=""nofollow"">Eclipse ADT</a></p><p>All the steps in ""Downloading the ADT Plugin"" go fine with no errors.   But when I get to the next step ""Configuring the ADT Plugin"" it fails when I set my SDK location, saying that it can't find android-sdk-windows\platforms.  </p><p>But no kidding - I'm using the android-sdk_r06-windows SDK and the Readme file says, ""<em>The Android SDK archive now only contains the tools. It no longer comes populated with a specific Android platform or Google add-on. Instead youuse the SDK Manager to install or update SDK components such as platforms,tools, add-ons, and documentation.</em>""   How how I do this?  Do I have to use an older version of the SDK to go with this older version of Eclipse?</p><p>Thanks in advance.</p><hr><p><strong>To QRohlf:</strong></p><p>I tried that. I ran it from the command line and got the same error:</p><p>[INFO] Starting Android SDK and AVD Manager</p><p>Error: Error parsing the sdk.</p><p>Error: <code>C:\Documents and Settings\Peter\My Documents\SW\AndroidSDK\android-sdk-windows\platforms</code> is missing.</p><p>Error: Unable to parse SDK content.</p><p>""platforms"" is missing because it's not included in this version of the SDK. It says so in the Readme file. I'm trying to follow the instructions in the link in the original post which imply this can be all done from the IDE but I don't know what step is supposed to create the platforms folder.</p><p>It's tempting to manually create the folder but I want to do this 'by the book' as the Eclipse/Android team intended because I'm making a 'getting started' guide for some students.</p>","424690","","1887603","","2012-12-25 19:32:42","2012-12-25 19:32:42","Android Config in Eclipse - SDK Preferences wants ...\Platforms, but SDK doesn't come with one","<android><eclipse><sdk><adt>","2","0","1","",""
"3515021","1","3517712","","2010-08-18 17:48:39","0","1270","<pre><code>public void onSensorChanged(SensorEvent e) {    if (e.sensor.getType()==Sensor.TYPE_ACCELEROMETER) {        if(e.values[0] &gt;= 8)            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);        else            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);    }}</code></pre><p>When the method is called setRequestedOrientation() - error. Create layout-land and placed there a copy of the main.xml file.</p>","413881","","","","","2010-08-19 08:50:12","Error when calling method setRequestedOrientation()","<android>","1","3","1","",""
"3515131","1","4881084","","2010-08-18 18:02:17","1","1136","<p>My project was working fine, when suddenly the text on my buttons was being displayed vertically. By which I mean instead of map_infobutton displaying</p><pre><code>Info</code></pre><p>it was displaying</p><pre><code>In</code></pre><p>with the f and o beyond the bounds of the button, even though I have specified height=wrap_content in the TableLayout containing the buttons.</p><p>It appears fine in the Layout tab in eclipse, and only appears vertical in the emulator (not tried on target hardware)</p><p>getPaddingLeft for one of the buttons returns 11 at various points in the code. Not sure where it gets that from, but the spacing looks bigger than that anyway. I did have three buttons and took one away, but the problem existed with both two and three buttons. </p><p>My layout is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;TextView    android:id=""@+id/map_header""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentTop=""true""    android:paddingTop=""8px""    android:paddingBottom=""8px""    android:gravity=""center""    android:textColor=""@color/header_foreground""    android:background=""@color/header_background""    android:text=""@string/map_header""/&gt;  &lt;TableLayout    android:id=""@+id/map_footer""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:paddingTop=""4px""    android:paddingLeft=""2px""    android:paddingRight=""2px""    android:stretchColumns=""*""    android:textColor=""@color/footer_foreground""    android:background=""@color/footer_background""&gt;    &lt;TableRow&gt;      &lt;Button        android:id=""@+id/map_infobutton""        android:layout_width=""0px""        android:layout_weight=""1""        android:text=""@string/map_infobutton"" /&gt;      &lt;Button        android:id=""@+id/map_selectbutton""        android:layout_width=""0px""        android:layout_weight=""1""    android:text=""@string/map_selectbutton"" /&gt;&lt;/TableRow&gt;   &lt;/TableLayout&gt;  &lt;LinearLayout    android:id=""@+id/map_selectiondetails""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_above=""@id/map_footer""    android:orientation=""horizontal""    android:gravity=""center""    android:textColor=""@color/main_foreground""    android:background=""@color/main_background"" &gt;    &lt;TextView        android:id=""@+id/map_selectionname""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingRight=""4px""        android:textColor=""@color/main_foreground""        android:background=""@color/main_background""/&gt;    &lt;TextView        android:id=""@+id/map_selectiondistance""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingLeft=""4px""        android:paddingRight=""4px""        android:textColor=""@color/main_foreground""        android:background=""@color/main_background""/&gt;    &lt;TextView        android:id=""@+id/map_selectionvar1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingLeft=""4px""        android:paddingRight=""4px""        android:textColor=""@color/main_foreground""        android:background=""@color/main_background""/&gt;    &lt;TextView        android:id=""@+id/map_selectionvar2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingLeft=""4px""        android:paddingRight=""4px""        android:textColor=""@color/main_foreground""        android:background=""@color/main_background""/&gt;    &lt;TextView        android:id=""@+id/map_selectionvar3""    android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingLeft=""4px""        android:textColor=""@color/main_foreground""        android:background=""@color/main_background""/&gt;      &lt;/LinearLayout&gt;      &lt;SurfaceView        android:id=""@+id/map_map""        android:layout_width=""fill_parent""        android:layout_height=""0dp""        android:layout_above=""@id/map_selectiondetails""        android:layout_below=""@id/map_header""        android:clickable=""true""/&gt;    &lt;/RelativeLayout&gt;</code></pre><p>Any ideas? Also if you have any comments on how I'm creating the layout, as I'm new to this and it seems like there are a lot of options available, but I'm trying to make it as simple as possible.</p>","131209","","142162","","2011-09-24 13:00:19","2012-04-05 12:51:10","Button text appears vertical","<android>","1","1","","",""
"3515197","1","3515362","","2010-08-18 18:10:14","0","540","<p>My XML looks like:</p><pre><code>&lt;key&gt;A&lt;/key&gt;</code></pre><p>How do I extract the string ""A"" from the XML with java in Eclipse?My Java code looks like:</p><pre><code>    XmlResourceParser xmlSymptoms = getResources().getXml(R.xml.symptoms);    while (eventType != XmlResourceParser.END_DOCUMENT) {        if (eventType == XmlResourceParser.START_TAG) {            // Get the name of the tag (eg scores or score)            String strName = xmlSymptoms.getName();            if (strName.equals(""key"")) {                 keyName = xmlSymptoms.getAttributeName(0);                 keyA = xmlSymptoms.getAttributeValue(0);            }         }         eventType = xmlSymptoms.next();    }</code></pre><p>But I think AttributeName and AttributeValue are for items that are part of the key description, i.e. they would be used to obtain ""item"" and ""first"".</p><pre><code>&lt;key item=""first""&gt;A&lt;/key&gt;</code></pre><p>What do I use to obtain the string between    ""<code>&lt;key&gt;</code>""and    ""<code>&lt;/key&gt;</code>""?</p>","148635","","21234","","2010-08-18 18:13:44","2010-08-18 18:27:45","Android XML parsing in Java","<android><xml><parsing>","1","0","","",""
"3515198","1","6327052","","2010-08-18 18:10:18","47","59406","<p>I have an Android app and it supports sending text via other apps. It therefore uses the ACTION_SEND intent and the EXTRA_TEXT field. The chooser presents me with all apps that can handle such an intent. Those are Twitter, EMail, ... and Facebook. But when I select Facebook it opens the browser and goes to the following page:</p><p><a href=""http://m.facebook.com/sharer.php?u=mytext"">http://m.facebook.com/sharer.php?u=mytext</a></p><p>It shows my text and the submit button. But when I press the submit button nothing happends. The page just loads again.I think maybe it is only possible to send URLs via the Facebook App. Could that be?</p><p>Did anyone manage to send text via ACTION_SEND through the Facebook Android app?</p>","373138","","1288","","2012-08-04 17:29:53","2013-12-12 12:21:28","Share Text on Facebook from Android App via ACTION_SEND","<android><facebook>","8","8","31","",""
"3515264","1","3515625","","2010-08-18 18:16:33","37","34742","<p>I am starting an activity and would rather have a alpha fade-in for <code>startActivity()</code>, and a fade-out for the <code>finish()</code>. How can I go about this in the Android SDK?</p>","69634","","","","","2012-05-23 00:14:25","Can I change the Android startActivity() transition animation?","<android><animation><fade><transition>","3","0","13","",""
"3515410","1","3516328","","2010-08-18 18:32:07","3","10807","<p>We have a variety of devices for testing purposes, and now that Froyo is being pushed (to the Nexus One so far at least), we have to constantly dismiss upgrade requests.  There is no apparent ""stop asking me"" button.</p><p>So, is there any way I can disable OTA OS updates?  We want a number of these phones to stay on old OS versions.</p>","205192","","995926","","2012-05-05 13:46:11","2012-05-05 13:46:11","Stop Android OS auto-update","<android><auto-update><android-2.2-froyo>","2","1","","",""
"3515514","1","","","2010-08-18 18:42:43","0","1724","<p><br>I want to create thumbnail image from its original image in coding for android</p>","410757","","95313","","2010-08-19 02:03:07","2010-12-06 10:18:41","how to create thumbnails image in android","<android>","2","0","2","",""
"3515638","1","3515974","","2010-08-18 18:56:29","3","3239","<p>I am adding different markers to my map...</p><pre><code>Drawable drawable = app1.getResources().getDrawable(R.drawable.test);drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());OverlayItem overlayitem2 = new OverlayItem(mark, ""Test"", ""t"");overlayitem2.setMarker(drawable);app1.mapOverlay.addOverlay(overlayitem2);app1.mapOverlays.add(app1.mapOverlay);</code></pre><p>that works but the shadow is at the wrong position.</p><p><img src=""http://i.stack.imgur.com/srx1V.jpg"" alt=""alt text""></p>","401025","","126562","","2010-08-18 19:47:14","2012-04-23 20:13:52","MapView Marker shadow","<android><android-mapview><marker>","3","1","3","",""
"3515640","1","3515740","","2010-08-18 18:56:37","0","987","<p>My question is, is it possible to call one app from another?           It would be very helpful if anyone had an answer or solution.</p><p>-Chris-</p>","424421","","143378","","2010-08-20 14:35:21","2012-03-12 06:31:09","calling one app from another, Android sdk?","<android>","2","2","","",""
"3515718","1","3515929","","2010-08-18 19:05:33","0","325","<pre><code>imgvw_back.setOnClickListener(this);imgvw.setOnClickListener(this);static id=10@Overridepublic void onClick(View v) {   // TODO Auto-generated method stub   switch(v.getId())   {     case R.id.back:      Log.v(""back"",""""+id--);      break;     case R.id.forward:       Log.v(""next"",""""+id++);       break;                              }}</code></pre><p>i am using this kind of concept but mostly fire R.id.back part ,what can i do plz give solution for this problem...</p>","410757","","256793","","2010-08-18 19:08:17","2010-08-18 23:41:04","Android image button problem","<android>","3","3","","",""
"3515759","1","3515865","","2010-08-18 19:11:29","4","17600","<p>I have a custom view (an extension of a TextView) that I want to dynamically add to my Layout (don't want to include it in the main.xml file).</p><p>The book says to fetch the RelativeLayout using findViewById() in my java code then create a new instance of my custom view, then use addView on the RelativeLayout to add the new view.</p><p>I'm not getting any errors, but when I click my button to add the new view, nothing is happening (view isn't being added).  Do I need to set additional properties on my custom view (layout width, layout height for example) in order for it to be shown?</p><p>EDIT: adding code</p><pre><code>// changed to an imageview as I thought it might be easier to see an imageRelativeLayout rel = (RelativeLayout) findViewById(R.id.rellay);MyCustomImageView mciv = new MyCustomImageView(null);mciv.setId(5);LayoutParams p = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);mciv.setLayoutParams(p);mciv.setImageResource(R.drawable.someImage);rel.Addview(mciv);</code></pre>","326196","","326196","","2010-08-18 19:37:42","2010-08-18 19:37:42","dynamically adding a view to activity layout","<android><user-interface><textview><relativelayout>","1","0","","",""
"3515840","1","3515916","","2010-08-18 19:22:52","5","2708","<p>Sorry, I know that this topic has been covered a bit.  I've read the related posts and am still a bit confused.  I am working on an app that while the prototype will have 3 main screens, it will eventually have dozens.  Each screen will present either dynmically changing status or take user input.  To visualize, it is required to be laid out similar to how MS Word or a typical PC is.  It has a status bar at the top and a navigation bar at the bottom that is common to all screens (slight tweaks for some screens, like different icons) in the middle is what I would call a view pane that needs to be updated with a applicable layout.</p><p>The status, nav bar, and each screen are defined in their own layout xml file.  For my first swag at it I just used a ViewFlipper and loaded the 3 screen layouts into it.  However that means that currently I have one main Activity which will not be maintainable as I continue to add screens.  </p><ol><li>It feels right to me that each screen layout should have an associated Activity class that understands how to control that screen.  I need to figure out how to load that into the center pane dynamically.  However I thought I read in another post that using multiple Activities can be a CPU and RAM drain.</li><li>Currently I tried making one of the screens it's own Activity and kick that off from the main Activity by creating an Intent and than calling startActivity.  However that causes the new screen Activity to reside on top of the main Activity.  The interesting thing is that then pressing the back button dismissed that activity and returns me to the main.  </li><li>So far I haven't figured out how to setup having a different Activity control what happens in the center pane.</li><li>If I continue down the multiple Activity path, should my main Activity be inheriting from ActivityGroup?</li><li>Are using View classes more applicable in this case?</li></ol><p>I know this has been a long post.  I'd appreciate any advice.Thanks!CB</p>","418714","","143327","","2010-08-18 19:27:30","2013-06-09 04:59:14","Android Activities vs Views","<android>","3","0","3","",""
"3515959","1","6206510","","2010-08-18 19:37:19","16","5320","<p>I'm writing some acceptance tests for an application using the ActivityInstrumentationTestCase2 class. I want to cause an orientation change from within the test to ensure that a number of things happen. Among these things are ensuring that Activity state is preserved, but also I'd like to ensure that the appropriate layout for the orientation is used.</p><p>I know I can simply test the onSaveInstanceState/onRestoreInstanceState/onPause/onResume/etc. methods to make sure instance state is preserved. However, I was wondering if there is actually a mechanism for causing an orientation change event?</p><p>Would this involve injecting some kind of motion event to trick the device/emulator into thinking that it has been rotated, or is there an actual method for this provided by the Instrumentation?</p><p>Thanks &amp; Cheers!</p>","242426","","242426","","2010-10-28 19:40:51","2011-11-18 10:33:24","How do you force an orientation change in an Android Instrumentation test?","<android><testing><instrumentation><screen-orientation><uiinterfaceorientation>","3","0","4","",""
"3516133","1","","","2010-08-18 19:54:51","12","4052","<p>I have an android app written for my company and since its a private app, it is not in the android market.  I'd like to be able to have the app check periodically for an update and if there is one notify the user and start downloading / installing the update.</p><p>Is there an example of something like this out there?</p>","424477","","","","","2014-03-01 11:26:53","Android app not in Market: how to push updates?","<android><auto-update>","2","0","10","",""
"3516180","1","3516232","","2010-08-18 20:00:55","2","4746","<p>I wanted to compare the current system date to a fix date, but get the wrong result. By trying to find out what's wrong, I ended with the following Java code:</p><pre><code>    // today, 18th of August 2010    long currSystem = System.currentTimeMillis();    Calendar calToday = Calendar.getInstance();    Calendar calFix = Calendar.getInstance();    long milliToday = calToday.getTimeInMillis();    long milliOlder = calFix.getTimeInMillis();    long deltaOlder = milliOlder - milliToday;    long deltaSystem = currSystem - milliToday;    // 1st of August 2010    calFix.set( 2010, 8, 1 );    long milliChanged1 = calFix.getTimeInMillis();    long deltaChanged1 = milliChanged1 - milliToday;    boolean isAfter1 = calToday.after( calFix );    boolean isBefore1 = calToday.before( calFix );    // 1st of October 2010    calFix.set( 2010, 10, 1 );     long milliChanged2 = calFix.getTimeInMillis();    long deltaChanged2 = milliChanged2 - milliToday;    boolean isAfter2 = calToday.after( calFix );    boolean isBefore2 = calToday.before( calFix );</code></pre><p>The results in the debugger are:</p><p>currSystem:        1282160371775<br>deltaChanged1:     1209600009<br>deltaChanged2:     6480000009<br>deltaOlder:        9<br>deltaSystem:       -25<br><strong>isAfter1:          false</strong><br>isAfter2:          false<br><strong>isBefore1:         true</strong> isBefore2:         true milliChanged1:     1283369971809<br>milliChanged2:     1288640371809<br>milliOlder:        1282160371809<br>milliToday:        1282160371800    </p><p>The small differences for deltaOlder and deltaSystems are due to the execution time, that's no problem. But the results of the comparison of today (18th of August) and the first set date (1st of August) is wrong IMO. isAfter1 should be true and isBefore1 should be false;The comparison with the second set date (1st of October) is ok.</p><p>Any suggenstion what I'm doing wrong in the simple thing to compare two dates?</p>","424478","","251173","","2010-08-18 20:10:23","2010-08-18 20:14:54","problems comparing two Calendar dates in Android","<java><android><date><calendar><compare>","1","0","","",""
"3516297","1","","","2010-08-18 20:17:24","0","368","<p>As you can know there are aggregated contacts (one 1) and each can have multiple raw contacts linked together to that contact (many N)</p><p>So there is a 1 contact -> N raw contacts relationship between them. </p><p>When you need to store a custom info for your contact, you have to store it for one of the raw contacts. The question is, how do you select which raw contact to use? The raw contacts can belong to different accounts.</p>","243782","","","","","2012-11-25 05:19:04","How do you select which raw contacts to update when you need to add custom info to your contacts?","<android><contacts><rawcontacts>","1","0","","",""
"3516430","1","","","2010-08-18 20:33:51","7","4394","<p>i have an EditText and a Button in my LinearLayout and i want to align them closely together so they see seem to belong together (edittext + micButton for speech input). Now they don't have the same height and they aren't really aligned well (button seems to be a little lower than the EditText). I know I can apply a negative margin like -5dip to make them come closer together, but is there perhaps a better way to do this? Set them in a specific container/layout so that they will automatically have the same height and no margin between them?</p>","424514","","","","","2012-04-25 09:44:09","Making EditText and Button same height in Android","<android><button><edittext><android-layout>","3","0","","",""
"3516435","1","","","2010-08-18 20:34:36","1","809","<p>We have a manufacturer that wants to pre-install our application on their Android device. We sent them the APK and even though it installs fine when used by a user, it appears to not get installed correctly when included in the manufacturer's build image. FYI, our application uses the JNI layer and some libraries built with NDK. The exception we're seeing seems to indicate that the class loader cannot find the library and is unable to load it. They have verified that the library files are indeed present in the APK.</p><p>Since we dont make devices, its unclear why they are seeing this exception and what needs to be done differently when including a package as part of the Android build image.</p><p>Any Android folks here care to comment?</p>","246793","","","","","2011-10-08 09:02:28","What's the difference between a regular Android APK and one included as part of a device's system image?","<android><image><build><system><packaging>","2","0","","",""
"3516530","1","3516656","","2010-08-18 20:45:30","7","22170","<p>I have an ImageView on my scene that I would like to set the source of dynamically based on user input.</p><p>Let's say I have 4 images in my drawable folder: aaa.png, bbb.png, ccc.png, and ddd.png.</p><p>When my application loads I set the image to: aaa.png</p><pre><code>myImageView.setImageResource(R.drawable.aaa);</code></pre><p>now I have an EditText where a user can type in bbb and I want to change the image source to be the bbb.png, or user enters ccc, change source to ccc.png etc.</p><p>how can I dynamically set the parameter in setImageResource()?  I tried playing around with the Drawable object to no avail...</p>","233971","","","","","2013-07-08 18:00:54","set source of ImageView dynamically android","<android><user-interface><imageview>","3","0","4","",""
"3516842","1","4011090","","2010-08-18 21:25:55","2","12389","<p>I have two webviews and to cut out the common functionality from both the webviews I created a super class with all methods in the super class and use it in the two webviews.</p><p>Once when I create the object and set the variables from the 1st webview, the WebView displays properly and when I press the 'BACK' button and go to the 2nd WebView I get the folling exception.</p><p>Any help?</p><p>First WebView Code</p><pre><code>public class firstWebView extends Activity {    private static final String LOG_TAG = ""FirstWebView"";    public static final int VIDEO_PLAY = 0;    private WebView mWebView;    private NicuWebView _nicuWebView;    private static final String URL = mainMenuActivity.urlSelected+""todo.html"";        @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.webview);        getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);        mWebView = (WebView) findViewById(R.id.webview);        _nicuWebView = NicuWebView.getNicuWebView(mWebView);//      mWebView.setWebChromeClient(new MyWebChromeClient());        final Activity activity = this;        NicuWebView.setContext(activity);        setProgressBarVisibility(true);        int count = (int) _nicuWebView.loadUrl(URL);        Toast.makeText(this, ""Count = ""+count, Toast.LENGTH_SHORT).show();    }public boolean onKeyDown(int keyCode, KeyEvent event) {    if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mWebView.canGoBack()) {//          startActivity(new Intent(getApplication(), mainMenuActivity.class));            mWebView.goBack();            return true;        }        return super.onKeyDown(keyCode, event);    } </code></pre><p>Code for Second is similar to the first one but the URL points to a different html page.</p><pre><code>E/AndroidRuntime( 7913): android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@447d2a98 is not valid; is your activity running?E/AndroidRuntime( 7913):        at android.view.ViewRoot.setView(ViewRoot.java:468)E/AndroidRuntime( 7913):        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)E/AndroidRuntime( 7913):        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)E/AndroidRuntime( 7913):        at android.view.Window$LocalWindowManager.addView(Window.java:424)E/AndroidRuntime( 7913):        at android.app.Dialog.show(Dialog.java:239)E/AndroidRuntime( 7913):        at android.app.AlertDialog$Builder.show(AlertDialog.java:802)E/AndroidRuntime( 7913):        at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:483)E/AndroidRuntime( 7913):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 7913):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 7913):        at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime( 7913):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime( 7913):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 7913):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime( 7913):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime( 7913):        at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Code for NicuWebView is</p><pre><code>public class NicuWebView {private static NicuWebView _nicuWebView;private static WebView _webView;private static HashMap&lt;String,Long&gt; _urls;private static Context contextName;private static final int VIDEO_PLAY = 0;private NicuWebView(WebView myWebView) {    _urls = new HashMap&lt;String,Long&gt;(10);    _webView = myWebView;    _webView.setWebViewClient(new NicuWebViewClient());    _webView.getSettings().setJavaScriptEnabled(true);    _webView.clearCache(true);    WebSettings webSettings = _webView.getSettings();    webSettings.setSavePassword(true);    webSettings.setSaveFormData(true);    webSettings.setJavaScriptEnabled(true);    webSettings.setSupportZoom(true);    _webView.addJavascriptInterface(new DemoJavaScriptInterface(), ""demo"");    _webView.clearCache(true);    _webView.setWebViewClient(new WebViewClient() {    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {        Toast.makeText(contextName, ""Super Class TOAST message"", Toast.LENGTH_LONG).show();    }    @Override       public void onPageFinished(WebView view, String url)       {           _webView.loadUrl(""javascript:(function () { "" +                   ""setVariable(""+mainMenuActivity.numberSelected+"");"" +                 ""})()"");     }      });    _webView.setWebChromeClient(new WebChromeClient() {        public void onProgressChanged(WebView view, int progress) {          // Activities and WebViews measure progress with different scales.          // The progress meter will automatically disappear when we reach 100%            ((Activity) contextName).setProgress(progress * 1000);        }    });    _webView.setWebViewClient(new WebViewClient() {        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {          Toast.makeText(contextName, ""Oh no! "" + description, Toast.LENGTH_SHORT).show();        }     @Override       public void onPageFinished(WebView view, String url)  {           _webView.loadUrl(""javascript:(function () { "" +                   ""setVariable(""+mainMenuActivity.numberSelected+"");"" +                 ""})()"");     }    });}    // allow clicking on link to remain in app instead of launching android browser    private class NicuWebViewClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }    }   public static NicuWebView getNicuWebView(WebView myWebView){    if (_nicuWebView == null) _nicuWebView = new NicuWebView(myWebView);    return _nicuWebView;} // loads the requested URL and maintains a 'history' of pages visited.// returns number of times page was loaded. public long loadUrl(String url) {     long count = incrementCounter(url);     _webView.loadUrl(url);      return count; } //helper to  private static long incrementCounter(String url){     if (url != null) {     if (_urls.get(url)==null) _urls.put(url,new Long(0));     long count = _urls.put(url,_urls.get(url) +1L);     return count;     }     else {         Toast.makeText(contextName, ""Null URL"", Toast.LENGTH_SHORT).show();         return 0;     } } /// return the number of times the given URL has been visited public long getUrlVisitCount(String url) {     if (_urls.get(url)==null) return 0L;     return _urls.get(url); } //returns to the previous URL, returns that URL public String goBack(){     if (_webView.canGoBack()) _webView.goBack();     String url = _webView.getUrl();     incrementCounter(url);     return url; } //returns to next forward URL, returns that URL public String goForward(){    if (_webView.canGoForward()) _webView.goForward();    String url = _webView.getUrl();    incrementCounter(url);    return url;      } public static boolean setContext(Context context) {     contextName = context;     return true; } public Context getContext(){     if (contextName == null) return null;     return contextName; }    final class DemoJavaScriptInterface {        public void setPlayVideo(String option) {            Toast.makeText(contextName, ""Playing Video = ""+option, Toast.LENGTH_SHORT).show();            Intent intent = new Intent ( contextName,  playVideo.class );            ((Activity) contextName).startActivityForResult(intent, VIDEO_PLAY);        }    }       public boolean canGoBack() {        return _webView.canGoBack();    }</code></pre><p>}</p>","402637","","402637","","2010-08-19 16:12:26","2012-09-28 11:10:16","android.view.WindowManager$BadTokenException Exception. Any pointer?","<android>","3","1","2","",""
"3516877","1","6541468","","2010-08-18 21:31:01","0","700","<p>In ""Documentation for Android SDK, API 8"", the javadoc for class android.test.InstrumentationTestRunner mentions command-line options for ""small"", ""medium"", and ""large"" tests without explaining how one would define tests as being of those sizes. A clue arrives later in the description in the form of a link to the annotation android.test.suitebuilder.annotation.LargeTest.</p><p>I have since noticed that Android defines annotations that the SDK javadoc hides from view. For example, the android.test.suitebuilder javadoc page does not mention the adroid.test.suitebuilder.annotation package at all. </p><p>Am I missing some base assumption about how one should use the SDK? For example, the question at <a href=""http://stackoverflow.com/questions/2174926/how-to-get-eclipse-to-show-javadoc-for-javax-annotations"">How to get eclipse to show javadoc for javax annotations</a> suggests downloading the source and letting eclipse generate (presumably more complete) javadoc from it. Have Android developers been viewing javadoc from source for so long that they haven't noticed the incomplete javadoc in the SDK?</p><p>And yes, I've noticed that some of the source javadoc includes a @hide tag, which presumably causes the generator to ignore it. It appears deliberate, which begged my question.</p>","424529","","424529","","2011-06-30 21:47:08","2011-06-30 21:47:08","How to see javadoc for annotations in Android SDK?","<android><annotations><javadoc>","1","1","0","",""
"3516885","1","3517338","","2010-08-18 21:32:35","3","1787","<p>I am working on an app that has multiple edittext fields and spinners and i want the focus to be switched to the next edittext box down when a selection is made from the spinner above.</p><p>Help</p>","415560","","","","","2010-08-18 22:44:02","Android: How do you set a spinner to change focus to the next EditText box down after a selection has been made?","<android><xml>","1","0","1","",""
"3516933","1","","","2010-08-18 21:39:11","1","377","<p>I have several EditText fields that I reformat on the fly as the user types by looking for onKeyEvents from a onKeyListener on the views.  On a phone running 2.1 update 1 and a phone running 1.6, everything works correctly.  On a HTC EVO running 2.2, the onKey sub is never called. The activity implements View.onKeyListener, and setOnKeyListener(this) is set for each of the EditText views.</p>","424565","","995926","","2012-05-05 13:46:31","2012-05-05 13:46:31","onKey not called in Froyo 2.2","<android><android-2.2-froyo>","0","1","","",""
"3517063","1","3517151","","2010-08-18 22:00:00","4","4448","<p>In our app, we have Activities A,B,C,D, and E. The user usually goes from A to E.</p><p>In Activity E we want to go back to A, and get ride of B,C,D from the stack. We don't want to recreate A from E.</p><p>How do I 'pop off' B,C,D from the stack and then return to A ?</p>","172861","","86860","","2010-08-18 22:06:12","2010-08-18 22:13:37","Android Popping off the Activity Stack","<android>","2","1","2","",""
"3517196","1","3517227","","2010-08-18 22:18:59","0","475","<p>I used Eclipse with the Android SDK to develop the original application. I ask since this was my first Java (and Eclipse, and Android, and XML) project. I assume that most of the Java should run on the PC without too much trouble. I may want to restructure the code to isolate the Android specific functions. Should I stay with Eclipse or move to something like NetBeans? Any advice would be terrific.</p>","398460","","","","","2010-08-18 22:29:08","What is the best approach to port an Android application to Windows?","<java><android><windows><eclipse>","3","1","","",""
"3517220","1","3525722","","2010-08-18 22:23:06","2","572","<p>I am using Apache's HttpClient via <a href=""http://code.google.com/p/httpclient-fluent-builder/"" rel=""nofollow"">httpclient-fluent-builder</a> to download a http page.</p><p>This is the code:</p><pre><code>...try {    response = Http.get(""http://fr3.ah.fm:9000/played.html"")        .use(client)                // use this HttpClient (required)        .charset(""windows-1252"")      // set the encoding... (optional)        .asString();} catch (IOException e) {    Log.d(TAG, ""Error: ""+e.toString());    e.printStackTrace();} Log.i(TAG, """"+ response );...</code></pre><p>Problem is that I get org.apache.http.client.ClientProtocolException</p><p>It's something with the host:port/url, beacause it works with urls without ports. I also get this same error with another Httphelper class than fluent-builder. Firewall is off.</p><p>Logcat: <a href=""http://pastebin.com/yMMvvdQ3"" rel=""nofollow"">http://pastebin.com/yMMvvdQ3</a></p>","215088","","215088","","2010-08-19 07:32:40","2010-08-19 20:00:45","Can't download with HttpClient with a different server port","<java><android><httpclient>","2","2","1","",""
"3517231","1","","","2010-08-18 22:24:45","1","1303","<p>I am testing my application on an LG Eve phone. I have an application that tries to download something from the web, and when it throws an exception, it is supposed to launch an alertdialog saying that there was an error. When the phone has no wifi signal, the program crashes at builder.create() (see code below). However, when there is wifi signal, and the exception is thrown by something else (for instance, a typo in the url), the dialog launches the way it's supposed to. Any clue as to why this could be?</p><p>Code for onCreateDialog:</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id){    Dialog d = null;    switch (id){    case DIALOG_DATA_ERROR_ID:        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setMessage(getResources().getString(R.string.error_data));        builder.setCancelable(false);        builder.setNeutralButton(""OK"", new DialogInterface.OnClickListener(){            public void onClick(DialogInterface d, int id){                d.cancel();            }        });        d = builder.create();        break;          }    return d;}</code></pre><p>Code for AsyncTask that calls showDialog:</p><pre><code>private static class DownloadJSONTask extends AsyncTask&lt;String, Void, String&gt;{    private ProgressDialog dialog;    private Activity parent;    private JSONParserInterface jsonParser;    public DownloadJSONTask(Activity parent, JSONParserInterface jsonParser){         this.parent = parent;        this.jsonParser = jsonParser;    }       protected void onPreExecute(){          dialog = ProgressDialog.show(parent, ""Loading"", ""Please Wait..."", true);       }       protected String doInBackground (String... urls){                          try {             return HttpHelper.getResponse(urls[0]);           }catch (Exception e){               dialog.cancel();               parent.showDialog(BoomSetListActivity.DIALOG_DATA_ERROR_ID);           }           return null;       }       protected void onPostExecute(String json){           dialog.cancel();            if (jsonParser != null) jsonParser.parse(json);       }}</code></pre>","424602","","","","","2010-08-18 22:33:53","Application crashes while doing AlertDialog.Builder create() method - Android","<android><crash><builder><showdialog><alertdialog>","1","1","","",""
"3517373","1","3517504","","2010-08-18 22:51:12","1","1257","<p>I am writing an android application that has a webview.  On the first load it works fine, I am able to browse and drill down to pages.  My expected behavior is that if I leave the application and come back, it should redirect to the page that I have it set to call in the webView.loadUrl(""[page i set here]"") but it seems to load the page that I was last on when I last used it.  </p><p>How can I kill the app in the onStop() method? Or, am I supposed to do something else in order  for it to restart the application on every load.</p><p>Thanks in advance!</p>","410154","","","","","2010-08-18 23:38:49","Android WebView Reload when the app loads","<android><webview><restart>","3","1","","",""
"3517484","1","","","2010-08-18 23:14:58","2","8109","<p>I have an android application which allows the user to open up google maps or navigator to show a certain address.  This functionality was working in the past, but now I get the following error and the app crashes:</p><p>ERROR/AndroidRuntime(2165): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=google.navigation:q=MCNAMARA+TERMINAL+ROMULUS+MI+48174 }</p><p>The two intents I'm using are-</p><p>1) For Map:</p><pre><code>    String uri = ""geo:0,0?q=MCNAMARA+TERMINAL+ROMULUS+MI+48174"";            Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));    startActivity(i); </code></pre><p>2) For Navigator:</p><pre><code>    String uri = ""google.navigation:q=MCNAMARA+TERMINAL+ROMULUS+MI+48174"";    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));    startActivity(i); </code></pre>","355663","","","","","2012-10-17 12:37:25","Launching Google Maps and Navigator from Android App","<android><uri><android-intent><navigator>","2","1","3","",""
"3517683","1","3521215","","2010-08-18 23:56:07","3","420","<p>I have a simple translate tween that moves an object up 200 pixels.  As soon as it's finished moving, it always bounces back to its original state and I don't want that.  I want it to stay where I moved it.</p><p>I know this is should be an obvious solution, but I can't find the method/property anywhere to make it just stop and not reset...</p>","326196","","","","","2010-08-19 11:19:49","prevent translate tween from resetting - android","<android><tween>","1","0","","",""
"3517704","1","3517937","","2010-08-19 00:01:42","1","1545","<p>My function, run from the onResume() does not cause the keyboard to appear.</p><p>Am I doing it wrong?</p><pre><code>private void showKeyboard() {InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);mgr.showSoftInput(txtSearch, InputMethodManager.SHOW_FORCED);txtSearch.requestFocus();}</code></pre>","172861","","","","","2011-07-11 09:53:29","android force keyboard visible","<android><uikeyboard>","2","2","","",""
"3517770","1","","","2010-08-19 00:15:48","2","1364","<p>I am trying to display a filtered version of the camera preview.The code runs without errors but the device is showing the preview instead of the generated bitmap.   </p><p>This is the code for my (very small) Activity: <a href=""http://code.google.com/p/ruellia/source/browse/ruellia/src/br/com/ximp/ruellia/RuelliaActivity.java"" rel=""nofollow"">http://code.google.com/p/ruellia/source/browse/ruellia/src/br/com/ximp/ruellia/RuelliaActivity.java</a></p><p>I suspect the view layering and the surface holder type, but so far no luck... anyone?</p>","203801","","13565","","2010-08-19 11:45:57","2011-05-17 11:24:26","Filtering the camera preview","<android><camera>","2","0","1","",""
"3517833","1","11739039","","2010-08-19 00:31:47","20","5297","<p>I currently use a MapActivity in my application.I use it with 2 API Keys. One for debugging, and one for ""production""</p><p>I am fed up with changing these values in the xml layout:</p><pre><code> &lt;view class=""com.google.android.maps.MapView""         android:id=""@+id/myGmap""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:enabled=""true""        android:clickable=""true""        android:apiKey=""@string/api_key_prod"" /&gt;</code></pre><p>I am fed up trying to change the apikey each time and replace prod by debug each time.</p><p>Is that possible to change this key within the onCreate() of my application.</p><p>Imagine that I have a boolean preference that look like: isDebug.</p><p>I may check thi preference on my phone and disable it by default on user application. and make something like:</p><pre><code> if (isDebug)     myMap.setApiKey(R.string.api_key_debug) else     myMap.setApiKey(R.string.api_key_prod)</code></pre><p>Thank a lot for any help.</p>","327402","","527702","","2013-05-19 02:01:43","2013-05-19 02:01:43","MapActivity: set APIKey programmatically","<android><google-maps><key><api-key>","3","0","2","",""
"3517915","1","","","2010-08-19 00:47:12","0","167","<p>How would I go about this? I have a list of news, and I know if it's read or not when I populate an ArrayAdapter with it, but I don't know how to style the read ones differently.</p>","92259","","","","","2010-08-19 00:47:12","Style list items as read in android?","<android>","0","2","","",""
"3517929","1","3517973","","2010-08-19 00:49:19","0","199","<p>How do you create a button in an Android app that produces the same result as hitting the down key on the D-Pad?</p>","415560","","","","","2010-08-19 01:02:21","Android: How to create a button that produces the same result as hitting the down key on the D-Pad?","<android>","1","0","","",""
"3518072","1","3518079","","2010-08-19 01:31:00","0","761","<p>In the values/colors.xml, I put:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;color name=""blank""&gt;#f0f0f0&lt;/color&gt;&lt;/resources&gt;</code></pre><p>In the layout/main.xml, I put:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@android:color/white""&gt;&lt;TextView  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:textColor=""@colors/blank""/&gt;&lt;/LinearLayout&gt;</code></pre><p>And I got the error:</p><p><strong>No resource found that matches the given name (at 'textColor' with value '@colors/blank').</strong></p><p>What am I doing wrong?!</p>","394842","","","","","2010-08-19 01:33:25","Android - Main.xml doesn't recognize my color values...?","<android><eclipse><main>","1","0","","",""
"3518346","1","3518760","","2010-08-19 02:47:53","1","6573","<p><br>I’m creating an currency exchange rate application to learn Android. The app will list all exchange rate in a list, each of them has the layout like this (in essential):</p><pre><code>&lt;TableRow&gt;    &lt;ImageView&gt;        [properties for the Flag image here]    &lt;/ImageView&gt;    &lt;TableLayout&gt;        &lt;TableRow&gt;             &lt;TextView&gt; [Buying] &lt;/TextView&gt;            &lt;TextView&gt; [Buying Rate] &lt;/TextView&gt;        &lt;/TableRow&gt;         &lt;TableRow&gt;             &lt;TextView&gt; [Transfer] &lt;/TextView&gt;            &lt;TextView&gt; [Transfer Rate] &lt;/TextView&gt;        &lt;/TableRow&gt;         &lt;TableRow&gt;             &lt;TextView&gt; [Selling] &lt;/TextView&gt;            &lt;TextView&gt; [Selling Rate] &lt;/TextView&gt;        &lt;/TableRow&gt;     &lt;/TableLayout&gt;&lt;/TableRow&gt;</code></pre><p>To list exchange rate for all currencies I have the following approach:</p><pre> - Design the layout for one currency (let’s choose EUR as first currency) - Generate the layout for all other currencies automatically by:   1.  Copy all properties of the EUR-layout into the new currency layout2.  Modify some properties of new currency layout like: ID, Rates …3.  Repeat steps 1,2 for all sub-layout of the new currency layout</pre><p>But I don’t know how to code step 1, so I did a lot of  google about: “android copy view”  “android copy properties” “android copy view” “android clone view” “java clone object” …. but still no solution. <br><br><strong>So, my question is:  how to copy all properties of a view ?</strong></p>","424721","","","","","2010-08-19 04:36:33","How to copy all properties of a view?","<android><view>","1","0","","",""
"3518407","1","3518476","","2010-08-19 03:00:55","3","5637","<p>I'm working on an app and I want to integrate the Last.fm app into it. Basically, when someone is looking at an artist in my app, I would like to have a button that they can tap to open up Last.fm application with the artist's information.</p><p>This intent works, but it loads a menu asking which app I would like to use (Browser or Last.fm):</p><pre><code>Intent i = new Intent();i.setData(Uri.parse(""http://last.fm/music/"" + headliner));i.setAction(""android.intent.action.VIEW"");startActivity(i);</code></pre><p>However, I just want to start the Last.fm app and skip the dialog asking which app to use, I thought maybe using the setPackage() method would work like this: </p><pre><code>i.setPackage(""fm.last.android"");</code></pre><p>But it causes the app to crash:</p><pre><code>android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://last.fm/music/Rihanna pkg=fm.last.android }</code></pre><p>Is it possible to just start the Last.fm app? <a href=""http://github.com/c99koder/lastfm-android/blob/master/app/AndroidManifest.xml"" rel=""nofollow"">Here's</a> a copy of Last.fm's AndroidManifest.xml for reference.</p><p>Thanks for reading,Tony</p>","215056","","","","","2011-01-31 14:24:42","Android: Starting An Activity For A Different Third Party App","<android><android-intent>","1","0","2","",""
"3518581","1","3518592","","2010-08-19 03:45:28","0","2713","<p>I have a custom class that I've written that extends ImageView (for Android Java).  I want to add a ClickListener to every instance I create of the class that will do the same thing (just animate the ImageView.</p><p>I tried a few different things to no avail.  The code below is what I want to accomplish but it's being applied to an instantiated object of the class.</p><pre><code>MyCustomImageView fd = new MyCustomImageView(this);fd.setOnClickListener(new OnClickListener(){            public void onClick(View v) {                Animater(fd);            }        });</code></pre><p>I tried using ""implements onClickListener"" on the class declaration and then a public void onClick() method in the class, and that didn't work for me.</p><p>I also tried using the code snippet above with a ""this"" instead of ""fd"" and that didn't work either.</p><p>I'm relatively new to java and this is out of the scope of my knowledge.  Any assistance you can provide is greatly appreciated.</p>","233971","","","","","2010-08-19 03:49:12","setOnClickListener to all extended ImageViews - Java","<java><android><event-handling>","1","0","","",""
"3518587","1","","","2010-08-19 03:47:01","0","207","<p>Another newbie question here.  For some reason, when I click on my icon, it says ""application not loaded"".  The rest of it runs OK in the emulator, but not at all on my new Droid X phone.  I'm sure it's something small I'm overlooking but I've gone through the Manifest and checked sample code and can't seem to find what I'm missing here.</p><p>Here's output </p><p>LogCat Intent or Permission problem? </p><p>Console message:</p><pre><code> ""ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent"" 08-20 12:35:50.458: WARN/Launcher(1357): appvisfalse08-20 12:35:50.473: DEBUG/PackageManager(1231): Activities:     com.android.memory.MemorySplashActivity    com.android.memory.HelpActivity    com.android.memory.MemoryActivity     com.android.memory.MenuActivity     com.android.memory.MemorySplashActivity 08-20 12:35:50.505: INFO/UsageStats(1231): Something wrong here, didn't expect    com.motorola.blur.home to be paused</code></pre><p>Thanks,</p><p>Bill</p>","422432","","763459","","2012-10-05 12:01:12","2012-10-05 12:01:12","icon launcher not working","<android>","0","4","","",""
"3518671","1","","","2010-08-19 04:12:52","1","1065","<p>I'm trying to write an app for my Samsung Vibrant (running android 2.1). I used the example ""Form Stuff"" app available as tutorial on the android developers website. I basically added a background picture to the application. the background picture has some text on it towards the top. I want to display a list of elements (to be selectable by teh user) but I want this list to start from a certain position on the screen (say for example - start from the middle of the screen). tried reading the listview under dev resource and searched the forums but I could not find a way to do this.</p><p>Could anyone please help me out? or if this is not possible, then suggest me something else which i can place at a certain position on the screen.</p>","424789","","649687","","2011-12-21 11:12:57","2011-12-21 11:12:57","Android: how can i position the listview at a particular location on the screen","<android><listview>","2","0","","",""
"3518720","1","","","2010-08-19 04:28:09","1","1169","<p>I've managed to show existing user in a textview. But it can only show one at a time so I decided to use listview. </p><pre><code>package log1.log2;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.SimpleCursorAdapter;public class AdminMain extends ListActivity { DBAdapter db = new DBAdapter(this); public void onCreate(Bundle savedInstanceState)  {    super.onCreate(savedInstanceState);    setContentView(R.layout.listview);      db = new DBAdapter(this);   db.open();   Cursor c = db.getAllUser();    while (c.moveToNext()){    setListAdapter(new SimpleCursorAdapter(this,       R.layout.adminmain, c,       new String[] { ""Username"" },       new int[] {R.id.txtUser}));   }   db.close();  }}</code></pre><p>But I received this error message from the logcat. </p><pre><code>08-19 04:22:49.331: ERROR/AndroidRuntime(918): java.lang.RuntimeException: Unable to start activity ComponentInfo{log1.log2/log1.log2.AdminMain}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'</code></pre><p>I have added listview in listview.xml. I do not understand why the error msg tells me that.</p><p>I hope to receive helpful replies soon! Thank you very much!</p><p>-Dayne</p><hr><h1>Edited</h1><p>Hello again</p><p>For my xml, I got two xml file to make the listview work. First is <code>listview.xml</code> and second is <code>adminmain.xml</code>. For <code>listview.xml</code>, i've placed <strong><em>only listview</em></strong>. And for <code>adminmain.xml</code>, I placed <strong><em>textview</em></strong>.</p><p><code>listview.xml</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListView android:id=""@+id/ListView""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt;&lt;/AbsoluteLayout&gt;</code></pre><p><code>adminmain.xml</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/widget0""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background = ""@drawable/image""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextView    android:id=""@+id/txtUser""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:textColor=""#ff000000""    android:text=""USERNAMES HERE""     android:layout_x=""100px""    android:layout_y=""102px""/&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>I've tried swapping the <code>R.layout</code>. The same error message appears. </p><p>I hope somebody can give me a good tip soon. Thank you for reading my post.</p><p>-Dayne</p><hr><h2>After Editing</h2><p>Here's the message from the log cat:</p><pre><code>08-20 04:06:45.326: INFO/ActivityManager(587): Start proc log1.log2 for activity log1.log2/.AdminMain: pid=761 uid=10022 gids={}08-20 04:06:45.456: DEBUG/dalvikvm(753): LinearAlloc 0x0 used 637060 of 4194304 (15%)08-20 04:06:49.026: DEBUG/dalvikvm(761): GC freed 3633 objects / 145376 bytes in 166ms08-20 04:06:51.876: WARN/System.err(658): Can't dispatch DDM chunk 46454154: no handler defined08-20 04:06:51.886: WARN/System.err(658): Can't dispatch DDM chunk 4d505251: no handler defined08-20 04:06:51.895: INFO/jdwp(676): received file descriptor 27 from ADB08-20 04:06:51.926: INFO/jdwp(687): received file descriptor 27 from ADB08-20 04:06:55.227: WARN/ActivityManager(587): Launch timeout has expired, giving up wake lock!08-20 04:06:55.757: WARN/ActivityManager(587): Activity idle timeout for HistoryRecord{4367c578 {log1.log2/log1.log2.AdminMain}}08-20 04:06:56.206: DEBUG/dalvikvm(761): GC freed 3325 objects / 126264 bytes in 142ms08-20 04:06:56.927: WARN/System.err(687): Can't dispatch DDM chunk 46454154: no handler defined08-20 04:06:56.927: WARN/System.err(687): Can't dispatch DDM chunk 4d505251: no handler defined08-20 04:06:56.957: WARN/System.err(676): Can't dispatch DDM chunk 46454154: no handler defined08-20 04:06:56.957: WARN/System.err(676): Can't dispatch DDM chunk 4d505251: no handler defined08-20 04:06:56.967: INFO/jdwp(692): received file descriptor 33 from ADB08-20 04:06:57.026: INFO/jdwp(707): received file descriptor 25 from ADB08-20 04:06:57.066: WARN/System.err(692): Can't dispatch DDM chunk 46454154: no handler defined08-20 04:06:57.066: WARN/System.err(692): Can't dispatch DDM chunk 4d505251: no handler defined08-20 04:07:04.906: WARN/System.err(707): Can't dispatch DDM chunk 46454154: no handler defined08-20 04:07:04.936: WARN/System.err(707): Can't dispatch DDM chunk 4d505251: no handler defined08-20 04:07:04.957: INFO/jdwp(761): received file descriptor 26 from ADB08-20 04:07:05.546: DEBUG/dalvikvm(658): GC freed 2935 objects / 166312 bytes in 264ms08-20 04:07:09.946: DEBUG/dalvikvm(761): GC freed 3289 objects / 117368 bytes in 170ms08-20 04:07:10.607: DEBUG/dalvikvm(692): GC freed 3379 objects / 202040 bytes in 326ms08-20 04:07:15.486: DEBUG/dalvikvm(633): GC freed 2236 objects / 120792 bytes in 205ms08-20 04:07:16.897: WARN/System.err(761): Can't dispatch DDM chunk 46454154: no handler defined08-20 04:07:16.897: WARN/System.err(761): Can't dispatch DDM chunk 4d505251: no handler defined08-20 04:07:30.386: DEBUG/dalvikvm(761): GC freed 4161 objects / 124992 bytes in 184ms08-20 04:07:35.147: WARN/WindowManager(587): No window to dispatch pointer action 008-20 04:07:35.246: WARN/WindowManager(587): No window to dispatch pointer action 108-20 04:07:35.346: WARN/WindowManager(587): No window to dispatch pointer action 008-20 04:07:35.466: WARN/WindowManager(587): No window to dispatch pointer action 108-20 04:07:35.707: WARN/WindowManager(587): No window to dispatch pointer action 008-20 04:07:35.827: WARN/WindowManager(587): No window to dispatch pointer action 1</code></pre><p>Everytime when I click on the empty space, this error message will appear ;  </p><pre><code>08-20 04:07:35.707: WARN/WindowManager(587): No window to dispatch pointer action 0    08-20 04:07:35.827: WARN/WindowManager(587): No window to dispatch pointer action 1</code></pre><p>Thank you so much for taking your time reading this! I appreciate it!!</p><p>-Dayne</p>","380770","","380770","","2010-08-20 04:11:19","2010-08-20 04:11:19","Listview error can't run; force close","<android><xml><database><listview>","1","0","","",""
"3518729","1","","","2010-08-19 04:30:00","1","453","<p>I am writing a game in android using Box2d physics engine in NDK. So physics is entirely in the native world but the drawing is still in Java world.</p><p>In my game I have an update thread that steps the physics world and invalidates the canvas for redraw. So far so good. When the user wishes to pause the game I stop all the threads. Then user is given an option to ""Resume"" the game which would restart the threads and the game would begin from where it stopped.</p><p>For some reason, when the game is resumed the bodies in the physics move faster. Why would anything change for a body if its time stepping is stoppped and restarted ? </p><p>Is there an issue with calling step() again after making a pause ? does the body's velocity, masss, friction , density change after a brief pause.</p><p>Any help is appreciatedThanks</p>","372446","","","","","2011-06-23 19:20:26","Box2d body moves faster after step is stopped and restarted in a pause [Android]","<android><box2d>","1","2","","",""
"3518745","1","","","2010-08-19 04:33:54","0","95","<p>1.how do we build our own video player in android,it will be helpful if ull can give me some code related to it.</p><ol><li>other than the sd card where else can we place a video file and paly it.                    thank you.</li></ol>","412955","","","","","2010-08-19 04:42:10","where can a video file be placed and played in android other than sd card?","<android>","1","0","","",""
"3518859","1","","","2010-08-19 05:04:45","1","339","<p>I'm developing an android application based on HTML.I made several tabs and put a WebView into each tabs to display the page.Currently I want to use just single WebView instance for all tabs to support login/out feature.I mean I need consistency of user's status during transition of each webpages in tabs.</p><p>Is it available to share an WebView in different tabs?Thank you.</p>","424804","","","","","2010-11-20 13:10:58","Android - How to share an WebView control among different tabs?","<html><android>","1","0","","",""
"3518926","1","3519090","","2010-08-19 05:20:43","1","1786","<p>In my application am displaying a list of names and respectives pictures ?  i am picking picture from galery through Drawble.getFromPath().  ? am displaying list , some i encountered with out of memory error ? please help me to sort out this error ?</p><p>regards ,srinivas</p>","414777","","","","","2010-08-19 05:55:08","java.lang.out of memory error : bitmap size exceeds VM budget?","<android><memory><leak>","1","0","","",""
"3519034","1","3519128","","2010-08-19 05:41:09","0","5129","<p>HelloIn my android application , i have three pages A,B,C.All the three pages have table layout.If i person clicks on a particular row other page related to that row will display.Now what i require is if a person clicks on back after the second page,I need to focus the row which he had clicked in the first page on his return.Can i do this in androidPlease reply your valuable suggestions.</p><p>My code after Totramonhave suggested is.</p><p>Here in amy code i am generating rows dynamically.</p><pre><code>public void onClick(View v) {    // TODO Auto-generated method stub    flag=v.getId();    if(v.getId()==1)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }    if(v.getId()==3)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }    if(v.getId()==5)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }    if(v.getId()==7)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }    if(v.getId()==100)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }   }@Overridepublic void onFocusChange(View v, boolean hasFocus) {    // TODO Auto-generated method stub        if(hasFocus)    {        ((TableRow)v).setBackgroundColor(Color.rgb(255, 180, 40));    }    else        {((TableRow)v).setBackgroundColor(Color.BLACK);}}    protected void onResume() {         super.onResume();        tr[flag].requestFocus();        tr[flag].setFocusableInTouchMode(true);        if(tr[flag].hasFocus())        {            tr[flag].setBackgroundColor(Color.rgb(255, 180, 40));        }        else            {tr[flag].setBackgroundColor(Color.BLACK);}    }     @Override        public void onPause() {          super.onPause();             }</code></pre><p>Thanks in advance  :)</p>","420261","","420261","","2010-08-20 11:59:39","2010-08-20 11:59:39","Keycode back press in android","<android>","2","0","","",""
"3519040","1","","","2010-08-19 05:42:26","0","2108","<p>How to open the ContextMenu in Android by Clicking a Button?</p>","424830","","424830","","2010-08-19 06:05:53","2012-08-10 07:51:43","Opening ContextMenu by Clicking a Button in Android","<android>","2","0","","",""
"3519149","1","","","2010-08-19 06:07:25","0","1408","<p>How to change the size of height and width according to the screen size?</p>","424830","","114066","","2010-08-19 07:34:49","2010-08-19 07:48:34","Changing the height and width regarding your screen Size","<android><layout>","2","2","","",""
"3519277","1","","","2010-08-19 06:29:28","8","32215","<p>Can I change the background color of a Menu item in Android?</p><p>Please let me know if anyone have any solution to this. The last option will be obviously to customize it but is there any way for changing the text color without customizing it.</p>","261566","","464552","","2012-01-10 12:40:24","2014-01-23 09:18:21","How to change the Text color of Menu item in Android?","<android><menuitem><textcolor><layout-inflater>","8","2","10","",""
"3519344","1","","","2010-08-19 06:39:30","2","634","<p>How to make my android application transfer files (jpg , mp3 ..) via bluetooth. Is this supported?</p>","381921","","844882","","2012-05-12 06:11:01","2012-05-12 06:11:01","how to transfer files via bluetooth from my android application","<android><mp3><bluetooth>","1","0","","",""
"3519369","1","","","2010-08-19 06:42:46","1","280","<p>I am trying to create a gallery inside a widget in the home screen ....as i am new to android please do give me guidelines and the source code ...</p>","424884","","6391","","2010-08-19 07:26:19","2010-08-19 07:26:19","How to put a gallery into a widget in the home screen?","<android><layout><appwidget>","1","0","","",""
"3519383","1","","","2010-08-19 06:46:06","5","851","<p>I have an application in which a progress dialog is shown. The progress dialog is working properly on any one orientation. But when I change the orientation during the progress dialog is on progress mode, then the app crashes.</p><p>So, now how can i fix this problem?</p><hr><p><strong>Update</strong></p><p>Hello,Thanks for your answer.Here I have extracted the progress dialog code from the whole project and there is no problem.You have said to see the Log cat file. But I do not understand the Logcat file.Actually what type of error message will be on the Logcat file if the Activity.onCreate() function will create any problem?</p><p>If you have any senario please help me.</p><p>Best Regards,gsmaker</p>","424854","","53114","","2011-03-16 09:27:23","2012-04-05 12:29:15","Android app crash when progress dialog is on progress and app's orientation changed. why?","<android>","3","0","","",""
"3519529","1","3520062","","2010-08-19 07:08:43","3","1918","<p>I have  lot of markers on my map. Zooming in each marker shows me a position. but zooming out the markers are overlapping each other and it is more difficult do determine the position of a marker. </p><p>Is there a way to scale the marker image depending on the zoom factor?</p>","401025","","","","","2013-12-12 21:48:01","Scale Map Markers by Zoom, Android","<android><zoom><android-mapview><google-maps-markers>","2","0","2","",""
"3519682","1","3519774","","2010-08-19 07:39:35","3","5664","<p>I have two TranslateAnimation on a TextView and i want them to execute one after other.. but using the below code, only the second one executes.. how can i solve this</p><pre><code>TranslateAnimation animation = new TranslateAnimation(    Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f,    Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, -150.0f);animation.setDuration(200);wave.startAnimation(animation);TranslateAnimation animation1 = new TranslateAnimation(    Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, 0.0f,    Animation.ABSOLUTE, 150.0f, Animation.ABSOLUTE, 0.0f);animation1.setDuration(200);wave.startAnimation(animation1);</code></pre>","367016","","","","","2013-11-21 12:55:22","Android Animation one after other","<android><animation>","3","1","2","",""
"3519856","1","3521098","","2010-08-19 08:09:23","0","1115","<p>So I used a ScaleAnimation to make a timebar shrink in a game. When the current level was finished, I wanted the timebar to quickly shrink to the bottom. So what I did was that if 30% of the time had passed, I assumed that 30% of the timebar was gone. So I just started a new ScaleAnimation that started at 70% of the timebars original size, assuming that this would look like a single smooth animation that speed up when the level was finished. Unfortunately the scaleanimation does not move evenly. It moves slower at the start and end, and faster in the middle.</p><p>So now I have three choices: Either I figure out how to make the ScaleAnimation move in an even speed, or I figure out the formula of how fast it moves, so I can determine exactly how big it is when a certain percent of the animation has played. Or, I find a smarter way altogether to do this timebar. Suggestions? :)</p><p>Cheers,</p>","249871","","","","","2010-08-19 11:06:59","Make ScaleAnimation move evenly, or figure out how it moves","<android><animation>","1","0","","",""
"3520019","1","3520111","","2010-08-19 08:37:33","10","10886","<p>before asking question let me tell you about my class hierarchy. i have a <code>Main</code> class with has <code>onCreate()</code> method. in that method i have made the MapFile class' object.and called its <code>readFile()</code> and <code>readIndex()</code> methods. in <code>readIndex()</code> method i call another class named <code>MapTile</code> where i read the images tiles from my binary file and there i have to display my image.</p><p>now question is how can i display image without putting my code into <code>onCreate(Bundle savedInstanceStare)</code> method.i am trying this way but on first line it gives me null pointer exception.</p><pre><code>ImageView image = (ImageView) findViewById(android.R.id.icon);           Bitmap bMap = BitmapFactory.decodeByteArray(imageTile, 0, imageTile.length);image.setImageBitmap(bMap);</code></pre><p>thanks in Advance.</p>","397901","","263521","","2010-08-19 08:46:13","2011-12-03 15:13:03","display image from byteArray","<android><image><bytearray>","2","0","4","",""
"3520076","1","","","2010-08-19 08:46:56","0","103","<p>Use a folder layout-land and layout-port them is a copy main.xml.</p><pre><code>    public void onSensorChanged(SensorEvent e) {        if (event.sensor.getType()==Sensor.TYPE_ACCELEROMETER) {            if(event.values[0] &gt;= 8)setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);            else            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);        }</code></pre><p>When you switch the screen is the establishment of two layers on each other. I use <code>android:configChanges=""orientation|keyboardHidden""</code>Help me please if you can give an example. I would be very grateful.</p>","413881","","","","","2010-08-19 08:46:56","Problem with Landscape","<android>","0","2","","",""
"3520088","1","3520110","","2010-08-19 08:47:50","7","6345","<p>can we use truncate query in android database?otherwise can we performing truncate operation using our java code?</p>","421645","","180538","","2010-08-24 12:11:05","2013-01-07 10:15:16","can we use truncate query in android sqlite","<android><database><sqlite>","3","0","","",""
"3520197","1","3819610","","2010-08-19 09:01:49","0","423","<p>I am writing an android application which uses a REST-based API on the server. So far the login works perfectly using HttpGet = I send the credentials, it sends me back a JSON response object containing session id or failure. I then moved onto using another get api (this one is passed the sessionid) and the response I get back looks like a valid one ""200 - Ok"" but the response body contains nothing - 0 text. </p><p>If I take the same URL and drop it into a browser, I get all the JSON text I expect displayed in the browser window. So what is the difference between a browser request/response and that of HttpGet? Any clues as to why my HttpGet might return a 'valid' nothing?</p>","424554","","","","","2011-06-02 08:45:08","Why do I get the proper URL response from a browser, but empty within Android's ""HttpGet""?","<java><android><http><http-get>","3","0","","",""
"3520226","1","3527596","","2010-08-19 09:07:30","1","945","<p>I'm trying to do some advanced features with android maps and to do that I need to do some operations on vectors. Now - I read the answer from <a href=""http://stackoverflow.com/questions/217578/point-in-polygon-aka-hit-test"">this</a> and it gave me some hints and tips. However, there is a part which I don't understand. Please allow me to quote this:</p><blockquote>  <p>Now that we have the ray with its start and end coordinates, the problem shifts from ""is the point within the polygon"" to ""how often intersects the ray a polygon side"". Therefor we can't just work with the polygon points as before (for the bounding box), now we need the actual sides. A side is always defined by two points.</p>    <p>side 1: (X1/Y1)-(X2/Y2) side 2:  (X2/Y2)-(X3/Y3) side 3:  (X3/Y3)-(X4/Y4)</p></blockquote><p>So my understanding is that every side of the triangle is actually a vector. But how is it possible to substract 2 points? Let's say I got a triangle with 3 vertices: A(1,1) , B(2,2), C (1,3). So according to that, I have to do, for example, (1,1)-(2,2) in order to calculate one of the sides. The question is how to do it programatically in java/android? Below I'm attaching the code which I already developed:</p><pre><code>    /** Creating the containers for screen      *  coordinates taken from geoPoints     */    Point point1_screen = new Point();    Point point2_screen = new Point();    Point point3_screen = new Point();    /* Project them from the map to screen */    mapView.getProjection().toPixels(point1, point1_screen);    mapView.getProjection().toPixels(point2, point2_screen);mapView.getProjection().toPixels(point3, point3_screen);    int xA = point1_screen.x;    int yA = point1_screen.y;    int xB = point2_screen.x;    int yB = point2_screen.y;    int xC = point3_screen.x;    int yC = point3_screen.y;    int[] xPointsArray = new int[3];    int[] yPointsArray = new int[3];    xPointsArray[0] = xA;    xPointsArray[1] = xB;    xPointsArray[2] = xC;    yPointsArray[0] = yA;    yPointsArray[1] = yB;    yPointsArray[2] = yC;    Arrays.sort(xPointsArray);    int xMin = xPointsArray[0];    int yMin = yPointsArray[0];    int xMax = xPointsArray[xPointsArray.length-1];    int yMax = xPointsArray[xPointsArray.length-1];     int e = (xMax - xMin) / 100;                                    // for ray calcultions    int width = mapView.getWidth();    int height = mapView.getHeight();    if(pPoint.x &lt; xMin || pPoint.x &gt; xMax || pPoint.y &gt; yMin || pPoint.y &lt; yMax)    {        DisplayInfoMessage(pPoint.x + "" &lt; "" + xMin + "" AND ""  + pPoint.x + "" &gt; "" + xMax + "" || "" + pPoint.y + "" &lt; "" + yMin + "" AND ""  + pPoint.y + "" &gt; "" + yMax );    //  DisplayInfoMessage(""Minimum is: ""+  yPointsArray[0] + "" and the maximum is: ""+ yPointsArray[xPointsArray.length-1]);    }    else    {         GeoPoint start_point = new GeoPoint(xMin - e, pPoint.y);         Point start_point_container = new Point();           mapView.getProjection().toPixels(start_point, start_point_container);            int a, b, c, tx, ty;            int d1, d2, hd;            int ix, iy;            float r;            // calculating vector for 1st line            tx = xB - xA;            ty = yB - yA;            // equation for 1st line            a = ty;            b = tx;            c = xA*a - yA*b;            // get distances from line for line 2            d1 = a*xB + b*yB + c;            d2 = a*pPoint.x + b*pPoint.y + c;            DisplayInfoMessage(""You clicked inside the triangle!"" + ""TRIANGLE POINTS: A(""+xA+"",""+yA+"") B(""+xB+"",""+yB+"") C(""+xC+"",""+yC+"")"");    }</code></pre><p>The pPoint hold the coordinates of the point which user clicked. I hope that I explained my problem well enough. Can someone give me some help with that? Appreciated!</p>","359656","","37213","","2010-08-19 09:33:26","2010-08-20 01:34:46","How to determine a vector using 2 Points in Android map?","<java><android><google-maps><vector>","1","0","","",""
"3520252","1","","","2010-08-19 09:10:19","0","814","<p>I want to create say 5 different types of cells in table along with identifiers and load them appropriately as per the given data depending upon the type? Creating TableRow inside TableLayout seems to be one of the options but how to dynamically create the tableRows depending upon the type? </p><p>Thanx in advance.</p>","227943","","","","","2010-08-20 08:48:57","Dynamically load customized table cells in table","<android><tablerow>","1","0","","",""
"3520260","1","3520333","","2010-08-19 09:11:15","0","110","<p>I have list view to display data,it dispalys well with white color background initially,but when i scrolled the background of list view has been changed to black,when i stop scrolling it get white background,i need to have white color background when i scrolled,how can i fix it.</p><p>Thanks in advance.</p>","407506","","","","","2010-08-19 09:20:07","Problem in backgroung of list when scrolled","<android>","2","0","","",""
"3520317","1","","","2010-08-19 09:17:53","3","2917","<p>I have view, which have layout_width=""wrap_content"". If i use view.getWidth() in code, it returns 0. :-(How can I convert width of view ""wrap_content"" to pixels?</p>","425001","","","","","2010-08-19 10:27:44","how to get width in pixels of view with android:layout_width=""wrap_content""?","<android><xml><layout><height><width>","1","0","","",""
"3520390","1","3520948","","2010-08-19 09:28:06","2","2139","<p>i save some ressources in the res/raw directory which i then would like to read with my custom loader. </p><p>how can i do this? </p><p>ideally i would get a BufferedReader on them.</p><p>thanks!</p>","97688","","97688","","2010-08-19 09:44:31","2010-08-19 11:51:11","android: how to access ressources in the res/raw directory via BufferedReader","<java><android><loading><bufferedreader>","3","0","1","",""
"3520499","1","5968185","","2010-08-19 09:42:59","2","2728","<p>At the moment I am searching for an easy and supported way of adding contacts in Android up from SDK level 7. (when some kind of data like the phone number is available) I looked at the default contact application and found ""Intent.ACTION_INSERT_OR_EDIT"" which is used for adding a new contact (or adding a number to a contact from the contact provider) from the dialer screen with the mime type ""vnd.android.cursor.item/person"". Now it would be nice to know how to find some documentation about the extras that should be added when using that action and if it is the correct way trying to support as much as possible handsets.</p><p>I'm looking forward reading your ideas. Thank you very much.</p><p>Regards.</p>","391216","","391216","","2010-08-23 11:46:17","2011-05-11 17:27:39","Android Intent Action ""ACTION_INSERT_OR_EDIT"" - should it be used for adding contacts?","<android><android-sdk-2.1><android-sdk-2.2>","1","0","3","",""
"3520514","1","","","2010-08-19 09:44:48","2","782","<p>I am new to android.I want to save my name  in Sqlite database when i enter the text in TextEdit and clicking the save button .I have created a database as name.db.I do know how to link the text in TextEdit and button  to the database. Please Help me out .Sample codes Will be were useful.Thanks in advance...</p>","366916","","180538","","2010-08-19 09:48:19","2012-02-29 18:27:48","Android-SQLite Database","<android><database><sqlite>","2","1","","",""
"3520564","1","3582588","","2010-08-19 09:50:37","4","3854","<p>While developing a Launcher (Homescreen) application for Android, I've come into a security exception I don't understand.</p><ul><li>When calling the[bindAppWidgetId()][1] method fromwithin my Launcher Activity, I getthis security exception :</li></ul><p>08-19 11:30:11.689: ERROR/AndroidRuntime(6032): java.lang.SecurityException: bindGagetId appWidgetId=99 provider=ComponentInfo{com.android.music/com.android.music.MediaAppWidgetProvider}: <strong>User 10034 does not have android.permission.BIND_APPWIDGET.</strong></p><p>I first thought I had forgotten the BIND_APPWIDGET permission in my manifest, but it is definitely there. </p><p>The android api documentation states this :</p><blockquote>  <p>""You need the APPWIDGET_LIST  permission. This method is to be used  by the AppWidget picker.""</p></blockquote><p>I tried to add the permission android.permission.APPWIDGET_LIST, but it doesn't solve the issue.</p><p>Also, I've looked at the manifest of the Settings application from the android sources that contains the AppWidgetPickActivity code : there's a special line that asks to share user id : </p><blockquote>  <p>""android:sharedUserId=""android.uid.system""</p></blockquote><p>Could it be related to my problem ?</p><p>If anyone has an idea that would be great !</p><p>Cheers, Laurent</p>","339138","","339138","","2010-08-20 07:24:29","2010-10-20 09:17:03","Security exception while calling bindAppWidgetId","<android><android-widget><homescreen><launcher>","2","1","0","",""
"3520703","1","5399794","","2010-08-19 10:12:24","2","2608","<p>I would like to have two apps. One to do the real job and another one to carry the payment on a monthly basis (licensing app).</p><p>Users must download the licensing app each month from Market. But, should they have to uninstall the last month's app before that?</p><p>Can an app auto destroy itself (uninstall itself)?</p>","406222","","114066","","2010-08-19 10:34:14","2011-03-23 01:13:09","Android Market subscription payment model. How to?","<android><payment>","3","0","1","",""
"3520719","1","3520868","","2010-08-19 10:14:31","7","2135","<p>I'm confused between thread and service on android.If I have to download some file form server. It may be multiple files at a time.What i should choose in this situation thread or services?</p>","422579","","114066","","2010-08-19 10:26:07","2012-03-12 15:48:46","Thread or services","<android>","5","0","3","",""
"3520854","1","3521047","","2010-08-19 10:30:23","0","238","<p>Does anyone know of any tutorials on populating a Mapview using an overlay at a specific point? e.g adding a marker at a specific lat / lng on your mapview?</p>","358438","","73488","","2010-08-19 13:01:19","2010-08-19 13:01:19","populating mapOverlay","<java><android><google-maps>","1","0","","",""
"3520946","1","","","2010-08-19 10:42:08","1","342","<p>I am writing an Android app where I need to send an image and text. I called intent with action Action_send, but it launches a GUI to compose a message. Can any one tell me how to send an MMS from code only with out triggering any GUI? Is there any intent action, where I can message directly?</p><p>Thanks</p>","414777","","243245","","2010-08-19 10:46:41","2012-07-15 10:03:38","Sending MMS with out any GUI?","<android><gui><sms><mms>","1","1","","",""
"3520979","1","","","2010-08-19 10:47:57","3","1040","<p>I´m having trouble using .NET Web Services with the Android Platform because the web service i want to consume is locked behind Windows (NTLM) authentication.How can i to use NTLM authentication with an HttpClient request in a android application?</p><p>Regards</p>","425102","","","","","2014-02-17 05:35:34","How to call with credentials a .NET Webservice from Android?","<android><web-services><authentication><credentials><ntlm>","2","0","1","",""
"3521097","1","","","2010-08-19 11:06:51","4","8773","<p>Can't find any library to create pdf files on Android. Can any one help me?</p>","425124","","","","","2013-03-09 05:06:24","How to create pdf files on android","<java><android><pdf><pdf-generation>","1","1","2","2013-06-30 13:26:00",""
"3521299","1","8240271","","2010-08-19 11:33:25","6","743","<p>I'm using <em><code>webview.capturePicture()</code></em> to create a Picture object that contains all the drawing objects for a webpage.</p><p>I can successfully render this Picture object to a bitmap using the <em><code>canvas.drawPicture(picture, dst)</code></em> with no problems.However when I use <em><code>picture.writeToStream(fos)</code></em> to serialize the picture object out to file, and then <em><code>Picture.createFromStream(fis)</code></em> to read the data back in and create a new picture object, the resultant bitmap when rendered as above is missing any larger images (anything over around 20KB! by observation).</p><p>This occurs on all the Android OS platforms that I have tested 1.5, 1.6 and 2.1.Looking at the native code for <em><code>Skia</code></em> which is the underlying Android graphics library and the output file produced from the <em><code>picture.writeToStream()</code></em> I can see how the file format is constructed.I can see that some of the images in this Skia spool file are not being written out (the larger ones), the code that appears to be the problem is in <em><code>skBitmap.cpp</code></em> in the method </p><pre><code>void SkBitmap::flatten(SkFlattenableWriteBuffer&amp; buffer) const;</code></pre><p>It writes out the bitmap <em><code>fWidth, fHeight, fRowBytes, FConfig and isOpaque</code></em> values but then just writes out <em><code>SERIALIZE_PIXELTYPE_NONE (0).</code></em> This means that the spool file does not contain any pixel information about the actual image and therefore cannot restore the picture object correctly.</p><p>Effectively this renders the <em><code>writeToStream and createFromStream()</code></em> APIs useless as they do not reliably store and recreate the picture data.</p><p>Has anybody else seen this behaviour and if so am I using the API incorrectly, can it be worked around, is there an explanation i.e. incomplete API / bug and if so are there any plans for a fix in a future release of Android?</p><p>Thanks in advance.</p>","425122","","559070","","2011-02-25 10:51:36","2011-11-23 10:02:43","Picture.writeToStream() not writing out all bitmaps","<java><android><image>","2","0","3","",""
"3521348","1","","","2010-08-19 11:39:18","3","358","<p>Simple question really:</p><p>for very simple graphics such as dividers, is it cheaper in terms of layouting / rendering costs to use a FrameLayout and set the image as a background instead of using ImageView? The intuition was that FrameLayout is the simplest of all views (in terms of features), and ImageView does things like scaling and cropping. On the other hand, FrameLayout is a ViewGroup and maintains children, while ImageView does not (although in this case, there are no child views).</p><p>Or is it not much to talk about anyway in terms of performance?</p>","127013","","","","","2010-08-19 11:39:18","FrameLayout + bg-image vs. ImageView","<android><performance><views>","0","0","","",""
"3521386","1","","","2010-08-19 11:42:51","4","1184","<p>As far as I undestand, neither a <code>ViewStub</code> nor a View that's <code>GONE</code> participate in the measure and layout passes (or rendering anyway).</p><p>Is there a difference in rendering performance? What's the best practice about when to use which?</p>","127013","","","","","2011-05-26 21:09:30","ViewStub vs. View.GONE","<android><performance><visibility><viewstub>","1","0","","",""
"3521439","1","3521744","","2010-08-19 11:50:02","0","5196","<p>I want to show a Dialog from an Android Service. Since the Service class doesn't have the methods you'd use to accomplish this if you were in an Activity, how can it be done?</p>","412907","","76835","","2013-10-10 14:45:18","2013-10-10 14:45:18","Dialog from Service android","<android><service>","1","2","","2013-03-21 02:45:21",""
"3521631","1","","","2010-08-19 12:15:00","1","3601","<p>In my android application i need to scroll a marquee text continuously.in my Xml i have this code:</p><pre><code>&lt;TextView   android:id=""@+id/widget28""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_alignParentRight=""true""                   android:singleLine=""true""           android:ellipsize=""marquee""   android:fadingEdge=""horizontal""   android:marqueeRepeatLimit=""marquee_forever""   android:scrollHorizontally=""true""   android:textColor=""#ff4500""   android:text=""Simple application that shows how to use RelativeLayout "" /&gt;</code></pre><p>And in my Java source code i have:</p><pre><code>TextView tv = (TextView )findViewById(R.id.widget28);tv.setSelected(true);</code></pre><p>Now my issue is this code works fine and marquee runs fine even if the focus is not on the control but the scrolling of text is not complete.I need the text to scroll completely.If i add space to the text both before and after the text it works fine but that is not good programming. Is there a good way to this?</p>","420261","","114066","","2010-08-19 12:46:21","2013-10-08 09:52:09","Marquee in android","<android><layout>","4","0","2","",""
"3521730","1","","","2010-08-19 12:28:51","1","2783","<p>I have a fully-working web app that is accessible using Android's browser.The annoying part is the url bar uses a lot of the screen. Is there a way to make this web app a native Android app? I've read that webview can be used to embed a web site within the Android App.</p><p>Unfortunately, I only know web programming languages and have no Java experience. Will I still be able to do this on my own?</p>","243055","","114066","","2010-08-19 12:47:46","2013-06-27 21:53:35","How do I use webview to embed the web app in a native Android App?","<android><web-applications><webview>","3","0","3","",""
"3521861","1","","","2010-08-19 12:43:43","0","3670","<p>hi<br/>Is there any way to prevent android webview to scale the rendered web page .<br/>I need to load an url which has links to other pages .When user clicks these links the rendered page is not aligned properly(i mean it cramps all the stuff within the screen width and height ) as compared to default handling of same web page by android browser .<br/><Br/></p><p>The alignment is proper when i comment shouldOverrideUrlLoading ,but i need the redirects within my app so i can't avoid overriding shouldOverrideUrlLoading.Is there any other options left out.  </p><p><img src=""http://i.stack.imgur.com/JzYZw.jpg"" alt=""android webview""></p><p>The first image shows webview rendering page within my app as i override shouldOverrideUrlLoading  and the second image shows the same screen after commenting shouldOverrideUrlLoading.</p>","286044","","","","","2011-08-09 06:42:29","How to avoid scaling of android webview","<android><webview>","3","1","2","",""
"3522023","1","3522177","","2010-08-19 13:03:22","16","11362","<p>I was wondering if there was a way to display all text in a toast to be centered. For instance, I have a toast that has 2 lines of text in it. For purely aesthetic reasons, I would like the text to center-aligned instead of left-aligned. I've looked through the documentation and can't find anything about it. Is there a simple way to do this that I have missed?</p><p>ThanksChris</p>","410921","","","","","2014-04-01 10:13:00","Center text in a toast in Android","<android><text><alignment><center><toast>","6","0","5","",""
"3522140","1","","","2010-08-19 13:16:01","1","396","<p>I am trying to import the code from this tutorial <a href=""http://www.anddev.org/bbc_download.php?p=777&amp;item=7"" rel=""nofollow"">http://www.anddev.org/bbc_download.php?p=777&amp;item=7</a></p><p>into my eclipse,the tutorial is oldand I have trouble importing the packages that it referes.</p><p>Are those packages deprecated? or I have to manually download and install them into my projects classhpath? if so can someone give me a link on where to find them?thanks in advances maxsap.</p>","234898","","","","","2010-08-19 15:30:03","android org.apache.http.httpclient package problem","<android>","1","0","","","2010-08-19 13:16:01"
"3522144","1","3522233","","2010-08-19 13:16:31","3","128","<p>I've build my app under the version 1.6, 2.1 and 2.2 of android and it works. I'd like to know when I'll publish it what is the best :</p><ul><li>Build under 1.6 and so it will be compatible with newer version of android</li></ul><p>or</p><ul><li>Build under 2.2 and set ""Target SDK version"" to 8 and ""Min SDK Version"" to 4</li></ul><p>Thanks</p>","400695","","272824","","2010-08-19 13:26:48","2010-08-19 13:35:36","Android app compability","<android><sdk><version>","2","0","2","",""
"3522181","1","3571249","","2010-08-19 13:20:53","4","2676","<p>Following the Android <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">sample for populating a ListView</a>, I query an array from my <em>strings.xml</em> using <a href=""http://developer.android.com/reference/android/content/res/Resources.html#getStringArray%28int%29"" rel=""nofollow"">Activity.getResource().getStringArray()</a>:</p><pre><code>String [] mDefinitions = getResources().getStringArray(R.array.definition_array);</code></pre><p>The documentation for this method is pretty clear and I didn't expect to encounter any problems with it:</p><blockquote>  <p>Return the string array associated with a particular resource ID.</p></blockquote><p>This approach worked as expected for small data sets. However, when I populated <em>strings.xml</em> with the full data set (close to 2000 entries), I find that the app crashed when it tried to load the resource.  I noticed this error in the console log:</p><blockquote>  <p>ReferenceTable overflow (max=512)</p></blockquote><p>Playing around with the number of items in my <em>string-array</em> I confirmed that the error was reproducible when the number of items exceeded ~700 entries.</p><p>Googling the problem has turned up some examples of other developers <a href=""http://www.listware.net/201005/android-developers/4451-android-developers-max-size-of-string-array.html"" rel=""nofollow"">having the same problem</a>, but I can't find anything in the Android documentation to explain it. </p><p>Someone has gone to the trouble of creating an <a href=""http://code.google.com/p/android/issues/detail?id=5287"" rel=""nofollow"">issue for the problem</a> on the Android Google Code page but neither it, or any of the posts I came across, received a satisfactory answer.</p><p>Am I approaching the problem the wrong way? Should I be populating the data myself (loading a file and parsing JSON or similar) and avoid the issue entirely? It feels like I am missing something obvious here.</p>","73488","","","","","2010-08-26 00:27:58","Should I be using something other than getResource().getStringArray() to populate a large array?","<android>","2","0","2","",""
"3522224","1","3522328","","2010-08-19 13:24:53","7","22267","<p>In my application I need to set dynamic text to my textview so I want it to get resized dynamically. I have set:</p><pre><code>&lt;TextViewandroid:id=""@+id/TextView02"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:textStyle=""normal""android:text=""Frontview""android:layout_weight=""1""android:gravity=""center_vertical""android:textColor=""#0099CC""android:singleLine=""false""android:maxLines=""4""android:ellipsize=""marquee""/&gt;</code></pre><p>My textview height is not going beyond 2 lines and the text is getting cut.Can anybody please help?</p><p>Thanx in advance.</p>","227943","","227943","","2010-08-19 13:37:19","2013-04-06 08:53:43","How to dynamically set textview height android","<android><textview>","3","0","8","",""
"3522394","1","4966106","","2010-08-19 13:45:29","0","1248","<p>Is there any way to stream raw AAC data to android media player? Or i there any work around for that?thanks in advance.</p>","196579","","","","","2013-06-17 03:41:26","How to stream Raw AAC data to android mediaplayer?","<android><android-emulator>","3","0","1","",""
"3522428","1","3522728","","2010-08-19 13:50:18","1","416","<p>I defined a LinearLayout:</p><pre><code>&lt;LinearLayout    android:id=""@+id/top_menu""    android:layout_width=""fill_parent""    android:orientation=""horizontal""    android:background=""@drawable/backrepeat""    android:layout_height=""wrap_content"" &gt;        &lt;ImageView        android:id=""@+id/topLeft""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_gravity=""left""        android:src=""@drawable/library_top_left""&gt;        &lt;/ImageView&gt;        &lt;ImageView        android:id=""@+id/topMiddle""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_gravity=""center""        android:src=""@drawable/library_top_middle""/&gt;        &lt;ImageView        android:id=""@+id/topRight""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_gravity=""right""        android:src=""@drawable/library_top_right""/&gt;    &lt;/LinearLayout&gt;</code></pre><p>I'd like that one image is on the left side of the screen, one in the middle, and one on the right side. However all of them are on the left side. How can I fix that?</p>","","anon","","","","2010-08-19 14:23:54","How to adjust 3 ImageViews in a LinearLayout","<java><android>","3","0","","",""
"3522487","1","3522609","","2010-08-19 13:56:25","0","544","<p>Take this for example:<a href=""http://en.wikipedia.org/wiki/United_States_Bill_of_Rights"" rel=""nofollow"">http://en.wikipedia.org/wiki/United_States_Bill_of_Rights</a></p><p>Under the ""Amendments"" section, I want to get what each bullet point says, and display them in a nice list in an android application. I know there's a wikimedia api, but I have absolutely no idea how to use it, and from what I understand of it, you can get the text under a section, but I'm not sure if you can get each bullet point separately.</p><p>What would be the best way to do this? Or instead of this, should I just spend my time copying the text from over 300 pages onto a text file, and reading it in the application?</p>","425296","","","","","2010-08-19 14:19:21","How can I get certain text from wikipedia?","<java><android>","2","1","2","",""
"3522786","1","","","2010-08-19 14:29:49","1","55","<p>i have installed android sdk for windows and finished installation.i am using eclipse and also installed adt plug-in.but i could not create a new project by doing like this on eclipse:goto window -> android sdk and avd manager -> new</p><p>because the window target option is disabled and hence could not create the application.</p><p>but,i have given the path of tool's folder of android sdk in the environment varialble ""path"" </p>","425360","","","","","2010-08-19 14:29:49","could not create a project","<android>","0","0","","",""
"3522925","1","3522967","","2010-08-19 14:45:10","0","610","<p>Nothing too exotic. I have classes in a library project, which is set to ""Is Library"".</p><p>The target application project uses this library under the Project Properties/Android section. The project is set to version 2.1-Update (api 7).</p><p>None of the classes from the library are visible in the target project. i.e. import statements referencing the classes are underlined in red.</p><p>Any ideas?</p>","425376","","","","","2012-05-03 23:20:40","Android Library is not working","<android>","5","0","","",""
"3522980","1","3523003","","2010-08-19 14:51:05","2","5156","<p>I try to log some text using Log.v or Log.e but I can't see the text anywhere in the eclipse console.</p><p>What am I missing? thanks!</p>","97688","","758485","","2011-11-17 15:03:27","2012-07-06 04:40:57","android: can't see log output","<android><console><logging>","3","0","","",""
"3522987","1","3525825","","2010-08-19 14:51:56","2","347","<p>I understand how to force a specific orientation per activity in the android manifest. I would like to know if it is possible to allow the keyboard to change orientation even though the activity(the layout really) must remain unchanged.</p>","393328","","","","","2010-08-19 20:14:31","Can I force a specific layout orientation, but have an opposite keyboard orientation? Android","<android><layout>","1","0","","",""
"3523022","1","","","2010-08-19 14:54:25","1","524","<p>I have tried to create a simple application that draws a png graphic where the screen is touched. The problem that I have is that only every other instance of the graphic I add is actually rendered. Each time I add a new instance, the pattern alternates. I always get only 50% of the graphics rendered.</p><p>I am using android level 3 on HTC Hero.</p><p>To explain the problem a little more, this is the draw method I am calling from the surface holder callback:</p><pre><code> public void surfaceCreated(SurfaceHolder holder) {  drawOK = true;  drawIcon(100.0f, 100.0f);//line-1  drawIcon(50.0f, 100.0f);//line-2  drawIcon(100.0f, 50.0f);//line-3  drawIcon(50.0f, 50.0f);//line-4  //drawIcon(200.0f, 200.0f);//line-5  //drawIcon(100.0f, 200.0f);//line-6 }</code></pre><p>When I have lines 5 &amp; 6 commented out (as shown), I only see lines 2 &amp; 4 rendered. When I add in line 5, I see lines 1,3 &amp; 5 rendered. Finally when I add in line 6, I see lines 2,4 &amp; 6 rendered.</p><p>Why would this be?</p><p>To explain the rest of the application in more detail. I have the following layout xml:</p><pre><code>&lt;SurfaceView android:id=""@+id/SurfaceView01"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""/&gt;</code></pre><p>I.e. I have a single surface view onto which I will draw the png graphic.</p><p>My activity implements SurfaceHolder.Callback and intialises like this:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    surfaceView = (SurfaceView) findViewById(R.id.SurfaceView01);    // register our interest in hearing about changes to our surface    holder = surfaceView.getHolder();    holder.addCallback(this);}</code></pre><p>I.e. I chain the call, and set the content view using the R class. I then obtain a reference to the surface view and register the activity as a surface holder callback.</p><p>I have a method that draws the icon to the screen. This is it:</p><pre><code>private void drawIcon(float x, float y) {  if (!drawOK) return;  Canvas canvas = holder.lockCanvas();         // getting instance each time in case problem is related to reusing obj         mFiringImage = getResources().getDrawable(R.drawable.icon);         //so i can see overlapping icons, to rule out clipping issues      mFiringImage.setAlpha(125);          // This mutate call is incase the bounds are shared state, which i doubt      mFiringImage.mutate().setBounds(        (int)x-mFiringImage.getIntrinsicWidth()/2,        (int)y-mFiringImage.getIntrinsicHeight()/2,        (int)x+mFiringImage.getIntrinsicWidth()/2,        (int)y+mFiringImage.getIntrinsicHeight()/2      );      mFiringImage.draw(canvas);      holder.unlockCanvasAndPost(canvas); }</code></pre><p>I.e. I lock the canvas, obtain the drawable png resource, set the bounds (using mutate just in case), and ask the drawable to draw itself on the canvas. Note I don't ever draw unless the surface has been created.</p><p>I really am puzzled here.</p><p>All help appreciated.</p><p>p.s. Here is the full listing:</p><pre><code>package com.mypackage;import android.app.Activity;import android.graphics.Canvas;import android.graphics.drawable.Drawable;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.view.SurfaceHolder;import android.view.SurfaceView;public class Toucher extends Activity implements SurfaceHolder.Callback { private Drawable mFiringImage; private SurfaceView surfaceView; private boolean drawOK; private SurfaceHolder holder; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  surfaceView = (SurfaceView) findViewById(R.id.SurfaceView01);  // register our interest in hearing about changes to our surface  holder = surfaceView.getHolder();  holder.addCallback(this); } @Override public boolean onTouchEvent(MotionEvent event) {  float x = event.getX();  float y = event.getY();  Log.e(getClass().getSimpleName(), ""========================="");  Log.e(getClass().getSimpleName(), ""Action=""+event.getAction());  Log.e(getClass().getSimpleName(), ""History Size=""+event.getHistorySize());  Log.e(getClass().getSimpleName(), ""Pressure=""+event.getPressure());  Log.e(getClass().getSimpleName(), ""Raw X=""+event.getRawX());  Log.e(getClass().getSimpleName(), ""Raw Y=""+event.getRawY());  Log.e(getClass().getSimpleName(), ""X=""+x);  Log.e(getClass().getSimpleName(), ""Y=""+y);  Log.e(getClass().getSimpleName(), ""Precision X=""+event.getXPrecision());  Log.e(getClass().getSimpleName(), ""Precision Y=""+event.getYPrecision());  Log.e(getClass().getSimpleName(), ""Size=""+event.getSize());  Log.e(getClass().getSimpleName(), ""========================="");  drawIcon(x, y);  return super.onTouchEvent(event); } private void drawIcon(float x, float y) {  if (!drawOK) return;  Canvas canvas = holder.lockCanvas();  mFiringImage = getResources().getDrawable(R.drawable.icon);  mFiringImage.setAlpha(125);  mFiringImage.mutate().setBounds(    (int)x-mFiringImage.getIntrinsicWidth()/2,     (int)y-mFiringImage.getIntrinsicHeight()/2,     (int)x+mFiringImage.getIntrinsicWidth()/2,     (int)y+mFiringImage.getIntrinsicHeight()/2  );  mFiringImage.draw(canvas);  holder.unlockCanvasAndPost(canvas); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width,   int height) { } @Override public void surfaceCreated(SurfaceHolder holder) {  drawOK = true;  drawIcon(100.0f, 100.0f);//1  drawIcon(50.0f, 100.0f);//2  drawIcon(100.0f, 50.0f);//3  drawIcon(50.0f, 50.0f);//4  //drawIcon(200.0f, 200.0f);//5  //drawIcon(100.0f, 200.0f);//6 } @Override public void surfaceDestroyed(SurfaceHolder holder) {  // TODO Auto-generated method stub } @Override public void onWindowFocusChanged(boolean hasFocus) {  super.onWindowFocusChanged(hasFocus);  if (!hasFocus) drawOK = false; }}</code></pre>","425390","","263521","","2010-08-19 15:56:10","2010-08-19 15:56:10","Why would only 50% of my drawables be drawn?","<android><drawable>","0","4","","",""
"3523078","1","3523176","","2010-08-19 14:58:44","5","5323","<p>The java.lang.RuntimeException is ""Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead,"" but that is not correct. I am using setOnItemClickListener to do some stuff based on the new selection, but I also need to do some stuff before the user changes the selection. Specifically, I am collecting data for each selection that needs to be saved to a file before moving to another selection, since the other selection is associated with different set of data. Is there a way to use setOnClickListener with an Android Spinner?</p><pre><code>spinner.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        // Do some stuff before the user changes the selection        ...spinner.setOnItemSelectedListener(new OnItemSelectedListener() {    @Override    public void onItemSelected(AdapterView&lt;?&gt; parent,            View view, int pos, long id) {            // Do some stuff based onItemSelected            ...</code></pre>","398460","","","","","2013-08-17 17:33:42","Is there a way to use setOnClickListener with an Android Spinner?","<java><android><spinner>","2","1","2","",""
"3523157","1","3523210","","2010-08-19 15:05:49","0","783","<p>I wrote an android application to request a scan for available wifi signals around, using the WifiManager, then dump the results to a file. The program works fine, but this weird bug occurs.</p><p>Initially I was requesting a scan every 30 seconds, and everything worked fine. I then tried to request a scan every two seconds, I get this strange bug. Everything will work fine for a few minutes, then the time between two scan requests jumps from 2 seconds to 50 seconds for no reason. Then, for four more scans, it will scan at 2-second intervals, then skip to a 50-second interval, and it continues to do this consistently.</p><p>With larger time intervals this bug does not appear. Has anyone experienced this bug before? Is there a way to prevent it? Or does Android automatically cancel scan requests if they are too frequent?</p><p>Thank you for your help!</p><p>NS</p>","777890","","","","","2010-08-19 17:36:33","Can an android phone pause wifi scan requests?","<java><android><android-wifi>","1","4","","",""
"3523195","1","3524252","","2010-08-19 15:09:26","0","1166","<p>How can I add an icon before every ListView item text in an Android application?</p><p>Here is the current list_item xml that is called to populate the list:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/text1""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textAppearance=""?android:attr/textAppearanceMedium""    android:gravity=""center_vertical""    android:padding=""5dip""    android:background=""@color/darkblue""/&gt;   </code></pre><p>I attempted to add a ImageView before it, but it didn't show at all. Then I added a RelativeLayout around the entire thing and tried positioning them, but still it didn't show.</p><p>Any ideas?</p><p>Thanks!</p>","312390","","","","","2013-07-11 14:44:26","How to add an icon before every ListView item text in an Android Application?","<java><android><xml>","2","1","1","",""
"3523324","1","4270043","","2010-08-19 15:22:54","2","1323","<p>So I have a default searchable Activity in my app, and if I press the search button in simples activities it works. But when I'm in a tab where the content is an ActivityGroup, and not an Activity, the app crashes.</p><pre><code>08-19 17:18:23.438: ERROR/AndroidRuntime(9078): Uncaught handler: thread main exiting due to uncaught exception08-19 17:18:23.458: ERROR/AndroidRuntime(9078): java.lang.IllegalArgumentException: no ident08-19 17:18:23.458: ERROR/AndroidRuntime(9078):     at android.app.Activity.ensureSearchManager(Activity.java:3499)08-19 17:18:23.458: ERROR/AndroidRuntime(9078):     at android.app.Activity.startSearch(Activity.java:2648)08-19 17:18:23.458: ERROR/AndroidRuntime(9078):     at android.app.Activity.onSearchRequested(Activity.java:2612)...</code></pre><p>Even if I add this code in my activityGroup, I'm still crashing :    </p><pre><code>@Override  public boolean onSearchRequested() {return false;}</code></pre>","386745","","73488","","2010-08-19 15:23:37","2011-01-12 15:18:36","ActivityGroup and SearchDialog","<android>","2","3","1","",""
"3523384","1","3523980","","2010-08-19 15:29:04","1","1951","<p>How can I pass a string from an activity to a layout?I can pass arrays from an activity to a layout with the following activity code</p><pre><code>    ListView remedyList = (ListView) findViewById(R.id.ListView_Symptom);    String remedyArray[] = new String[30];    ArrayAdapter&lt;String&gt; adapt = new ArrayAdapter&lt;String&gt;(this, R.layout.menu_item, remedyArray);    remedyList.setAdapter(adapt);</code></pre><p>Is there a simpler way to just pass a single string instead of any array of strings, from an activity to a layout?</p>","148635","","","","","2010-08-19 16:35:05","android - pass string from activity to layout?","<android>","1","0","2","",""
"3523417","1","3523455","","2010-08-19 15:32:06","0","2775","<p>I am dynamically adding ImageViews to a RelativeLayout depending on user input.  I have also created a button that when pressed, should clear all of the content of that RelativeLayout (remove all children).  I was hoping for a .clear() method, but no such luck.</p><p>can someone point me in the right direction here?</p><pre><code>RelativeLayout rel = (RelativeLayout) findViewById(R.id.iv_section);rel.SomethingToRemoveAllChildren();</code></pre><p>thanks.</p>","233971","","","","","2010-08-19 15:35:07","clearing contents of a RelativeLayout programmatically - android java","<android><imageview><relativelayout>","1","0","","",""
"3523453","1","3524186","","2010-08-19 15:35:06","3","1384","<p>I am developing an app and get confused about the idea of Service and Content Provider in Android. In practice, what will be the difference between them?</p><p><code>Content Provider</code><br>is a facade and it defines a way to share data among applications. You many attach a local database to your app or create Content Provider mapped to a universal database so that all the application on the same device can share it. </p><p><code>Service</code><br>is long running processes that need to be decoupled from main activity. It has local and remote service. local service is like the local database, and remote service is like Content Provider sharing the database info.</p><p><code>What My App is doing?</code><br>downloads info. from multiple internet resource in the background (I suppose this will be Service) and store the info. into database, and multiple applications will need to retrieve the data, format them and output them to user (I guess it will be a Content Provider).</p><p>What will be the fine line between Service and Content Provider? Newbie in Android, and any suggestion is welcome.</p><p>Lily</p>","90765","","90765","","2010-08-19 15:47:25","2010-08-19 16:57:18","Difference between Android Service and Content Provider","<android><database><service><content>","1","0","","",""
"3523550","1","3523626","","2010-08-19 15:45:07","1","1005","<p>I have a long ""cities"" list.  I was looking for an equivalent to <strong>sectionIndexTitlesForTableView</strong> in the iphone world.  It provides a way to ""jump"" to a particular point in long lists without having to scroll through all the elements.  I think <strong>FastScrollView</strong> implements this but it's not part of the API and I can't find any documentation on how to use it.  It appears in the baked in contacts application of the device.  I want to use this functionality within an AlertDialog.  Is this possible?</p>","408956","","","","","2010-11-05 01:45:33","Where can I find a good example of FastScrollView?","<android>","2","4","","",""
"3523656","1","","","2010-08-19 15:55:51","0","435","<p>How can I have a portrait-oriented menu in my lanscape-oriented view in Android?Hi,</p><p>I'm building an application with some items that must be landscape-oriented. Everything else (menu, view for editing the item, list of item...) should change orientation according to the orientation of the device. To do that I set android:screenOrientation=""landscape"" in the AndroidManifest.xml for the activity showing my items. Now, how can I create a portrait-oriented menu for that activity?</p><p>I'm also wondering if setting the screen orientation of the activity is the only way? Isn't it possible to set the screenOrientation for each view?</p><p>Thanks</p><p>Jul</p>","326849","","","","","2010-08-19 20:12:51","How can I have a portrait-oriented menu in my lanscape-oriented view in Android?","<android><screen><orientation>","1","0","1","",""
"3523701","1","3524609","","2010-08-19 16:00:18","0","929","<p>I have used RelativeLayout for a custom implementation of a ListAdapter and I am not sure if I can continue using this or if I need to use TableLayout.</p><p>In the first example I have the text positioned as I would like by using one image view and one text view containing the book name and the author name. However, I want to style the author text differently so I think I will need two text views. </p><p>In the second example I have added another text view but it floats to the right. Second eg is Clipboard02.png.</p><p>How can I make the second text view go under the first text (as in eg 1). I have done this in code rather than using XML layout. </p><p><a href=""http://carriehall.co.uk/Clipboard01.png"" rel=""nofollow"">http://carriehall.co.uk/Clipboard01.png</a></p><pre><code>LinearLayout.LayoutParams skyParams = new LinearLayout.LayoutParams( 70,    LayoutParams.WRAP_CONTENT );ImageView skyControl = new ImageView( context );skyControl.setImageResource( R.drawable.the_eyre_affair );addView( skyControl, skyParams );LinearLayout.LayoutParams bookParams = new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT,    LayoutParams.WRAP_CONTENT);bookParams.setMargins( 5, 10, 5, 10 );TextView bookControl = new TextView( context );bookControl.setTextAppearance( context, R.style.SpecialText );bookControl.setText( book.getTitle( ) + ""\n\n"" + book.getAuthor( ));addView( bookControl, bookParams );</code></pre>","425459","","","","","2010-08-19 17:44:24","Android LinearLayout / TableLayout with custom ListAdapter. Making List items of book previews","<java><android><programming-languages><mobile>","1","0","1","",""
"3523988","1","3524785","","2010-08-19 16:35:37","0","1348","<p>What is the best way to constantly update the center of a mapView's latitude and longitude in an Android application?</p><p>I need to display it on a label that is shown on top of the map.  I know you can call <code>MapViewObject.getMapCenter()</code> to get a GeoPoint of the center of the map, but where would I place that code so that it is called every time the user moves the map or zooms in/out?</p>","116938","","116938","","2010-08-19 17:13:00","2010-08-25 20:44:32","How to update latitude/longitude of the center of a Mapview whenever map is moved","<android><android-mapview><latitude-longitude>","1","0","0","",""
"3524110","1","3528859","","2010-08-19 16:48:28","2","3242","<p>Recently I've started to develop Android Soft Keyboard and got some problem with preferences.</p><p>How to add a preferences  to Android setting app? I've searched almost all the source code of AnySoftKeyboard, but haven't found anything what would add them to Settings app.</p><p>I'm placing a link to show what I meant: <a href=""http://code.google.com/p/softkeyboard/wiki/Settings"" rel=""nofollow"">http://code.google.com/p/softkeyboard/wiki/Settings</a></p><p>(first picture from begin)</p><p>Thank you</p><p>P.S. Sorry for my bad english..</p>","425504","","","","","2014-04-06 00:01:08","How to add preference of Custom Input method to Android Settings app?","<android><settings><preferences><android-softkeyboard>","1","0","1","",""
"3524140","1","3525802","","2010-08-19 16:51:32","4","3875","<p>I have an app that needs to scan a barcode to get a code before it can continue.</p><p>I use this code to start the scanning activity:</p><pre><code>finish = (Button) findViewById(R.id.finishButton);        finish.setOnClickListener(new OnClickListener() {            public void onClick(View viewParam) {                /*Prompt the user to scan the barcode */                new AlertDialog.Builder(Visit.this)                .setMessage(""Please Scan the clients barcode to complete the visit"")                .setPositiveButton(""Scan Barcode"", new DialogInterface.OnClickListener() {                    @Override                    public void onClick(DialogInterface dialog, int which) {                        //Start the scan application                        Intent intent = new Intent(""com.google.zxing.client.android.SCAN"");                        startActivityForResult(intent, 0);                    }                })                .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {                    @Override                    public void onClick(DialogInterface dialog, int which) {                        //Execute some method call                        Toast.makeText(Visit.this, ""Scan declined..."", Toast.LENGTH_SHORT).show();                    }                })                .show();                /* End of Scan prompt */            }        });</code></pre><p>What the above code does is sets a listener on a button labeled ""finished""When the button is clicked, it displays a prompt asking the user to scan a barcode or cancel.</p><p>Clicking on the 'Scan Barcode' button starts a new activity which starts the scan.</p><p>I have the following code set up to read the result of the scan on the return from the scan:</p><pre><code>/* Return from scanning barcode */    @Override    public void onActivityResult(int requestCode, int resultCode, Intent data) {;      if (resultCode == Activity.RESULT_OK &amp;&amp; requestCode == 0) {        Bundle extras = data.getExtras();        String result = extras.getString(""SCAN_RESULT"");      }      Toast.makeText(Visit.this, ""request code: ""+requestCode+"" result code = ""+resultCode+ ""\nRESULT_OK: ""+Activity.RESULT_OK, Toast.LENGTH_SHORT).show();    }</code></pre><p>Which very simply (for now) outputs the avtivity result in a toast message.</p><p>The problem Im having is that the onActivityResult method is being triggered as soon as I press the scan barcode button. </p><p>The scanning process works fine as I can see the results of the scan in the logcat., however because it is triggered too soon the onActivityResult method never gets the scan result and the result code is always -1</p><p>Am I missing a step here? is there someway of getting to onActivityResult to wait until the activity actual finishes?</p><p>Thanks</p><p>Kevin</p>","409826","","","","","2012-09-17 16:54:11","Android onActivityResult triggered before activity even starts!","<android><activity><barcode-scanner><result>","1","0","1","",""
"3524233","1","3524347","","2010-08-19 17:02:43","6","2281","<p>I have a game out on Android, and it runs in a single thread.  Performs the work in run() and the draws in onDraw().  Pretty simple.</p><p>However, on a Droid it runs much faster than on a G1.</p><p>What is a best practice for ensuring that the game runs at the same speed regardless of the device?</p>","179518","","","","","2010-08-19 22:39:11","Best way to make sure Android games run at the same speed on any device","<android>","2","0","2","",""
"3524360","1","3544220","","2010-08-19 17:14:08","0","993","<p>I have the following code in a few activities and it reads and parses XML files fine but in two activities when reading small XML files I get a null pointer exception and can't figure out what the problem is:</p><pre><code>while (eventType != XmlResourceParser.END_DOCUMENT) {    if ((eventType == XmlResourceParser.START_TAG) ||        (eventType == XmlResourceParser.TEXT)) {        // Get the name of the tag (eg scores or score)        String strName = xmlSymptoms.getName();        if (helpFound == 1){            helpText  = xmlSymptoms.getText();            helpFound = 0;        } else if (strName.equals(""string"") &amp;&amp; (eventType == XmlResourceParser.START_TAG)) {            helpFound = 1;        }    }    eventType = xmlSymptoms.next();}</code></pre><p>The null pointer exception occurs when I am reading in ""<code>&lt;string&gt;</code>"" which I am able to read in with the same code in other activities.  In this activity, I am able to read in the other XML tokens fine until I get to ""<code>&lt;string&gt;</code>"".</p><p>Here is my debug window</p><p>Thread [&lt;1> main] (Suspended)<br>    ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2628<br>    ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2679<br>    ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125     ActivityThread$H.handleMessage(Message) line: 2033<br>    ActivityThread$H(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4627<br>    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]<br>    Method.invoke(Object, Object...) line: 521<br>    ZygoteInit$MethodAndArgsCaller.run() line: 868<br>    ZygoteInit.main(String[]) line: 626     NativeStart.main(String[]) line: not available [native method]<br>Thread [&lt;6> Binder Thread #2] (Running) Thread [&lt;5> Binder Thread #1] (Running) </p><p>I have LogCat running, but nothing shows up in it.</p><p>Here is some XML that works:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN"" ""http://www.apple.com/DTDs/PropertyList-1.0.dtd""&gt;&lt;plist version=""1.0""&gt;&lt;dict&gt;&lt;key&gt;A&lt;/key&gt;&lt;array&gt;        &lt;string&gt;ABANDONED, feeling:     &lt;/string&gt;        &lt;string&gt;ABSCESS:        &lt;/string&gt;&lt;/array&gt;&lt;/dict&gt;&lt;/plist&gt;</code></pre><p>and here is some XML that doesn't work:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN""   ""http://www.apple.com/DTDs/PropertyList-1.0.dtd""&gt;&lt;plist version=""1.0""&gt;&lt;dict&gt;  &lt;key&gt;HOWTOTAKE&lt;/key&gt;    &lt;array&gt;  &lt;string&gt; Put two pellets in 8 oz bottle of water.&lt;/string&gt;  &lt;/array&gt;&lt;/dict&gt;&lt;/plist&gt;</code></pre><p>One last note:  When I get to the ""<code>&lt;string&gt;</code>"" field, getName() returns ""null"" instead of ""string"".  Obviously trying to tell me something, I just can't figure out why ""null"" is returned.</p><p>Any ideas how to debug this?  </p>","148635","","148635","","2010-08-19 20:48:44","2010-08-23 01:51:29","eclipse null pointer exception debug","<android><eclipse>","1","8","","",""
"3524390","1","4247462","","2010-08-19 17:18:46","0","1603","<p>I tried to install Android SDK plugin on my existing Eclipse Classic 3.6.0 (Helios). I managed to do everything else, but when I try to add components using Android SDK and AVD Manager in Eclipse, whole Eclipse just crashes.</p><p>Anyone have any idea what's going on?</p><p><a href=""http://pastebin.com/x3fdLSQa"" rel=""nofollow"">Eclipse Crash Log on pastebin.com</a></p>","425530","","","","","2013-02-19 00:06:59","Eclipse crashes on Android SDK and AVD Manager","<android><eclipse>","2","2","","",""
"3524593","1","3524976","","2010-08-19 17:42:59","0","3394","<p>my friend and i develop a Android programm. </p><p>Now we got to the question if it's possible to get the actual position of an ListElement. </p><p>Example: You drag the list up and down, and now you want to konw which element is on the center of the screen?</p><p>can anyone help us?</p>","325479","","102937","","2013-10-03 23:23:41","2013-10-03 23:23:41","Get the position of an element in Android's List View","<android><list><view>","2","1","","",""
"3524745","1","3525061","","2010-08-19 17:59:20","1","4980","<p>I have a custom class that extends ImageView that I'm programatically putting on to a RelativeLayout.  I want each one of these images to be a specific width and height.  I've tried setting the width/height in code with LayoutParams and with setMaxWidth/setMaxHeight...neither seem to be working.</p><p>Here is the code from the constructor of the class:</p><pre><code>LayoutParams p = new LayoutParams(50,67);               this.setLayoutParams(p);        this.setImageResource(WhichImage(wi));        this.setMaxWidth(50);        this.setMaxHeight(67);</code></pre><p>I've moved the call to setImageResource() above and below everything there and it still defaults to the true image size in my drawables...</p>","233971","","","","","2010-08-19 18:37:16","set extended ImageView width and height programatically - android","<android><height><width><imageview>","1","0","","",""
"3524758","1","3527770","","2010-08-19 18:00:41","14","9818","<p>Are the physical buttons that Android phones come with standard? Specifically the back, menu, home, and search button? In my applications I assume everyone has a back button so I don't bother putting in a ""soft"" button to go back to a previous screen.</p><p>For some reason I can't find any official documentation on this.</p><p>Looking at <a href=""http://www.androphones.com/2010-android-phones.php"">http://www.androphones.com/2010-android-phones.php</a> it appears that all of the phones have at least the back, menu and home button.</p><p>Should I just assume all phones have a back button or do I have to always code one in my apps?</p>","394093","","","","","2013-11-28 04:32:55","Are the 4 Android buttons standard? Ex. back button, menu button","<android><button><phone><physical>","3","0","1","",""
"3524768","1","","","2010-08-19 18:01:37","0","480","<p>I'm trying to programmatically determine what audio applications are installed on an Android phone. I'm able to enumerate all the installed applications, but don't yet see a way to figure out which ones are capable of playing audio? What property of the application would have to queried to determine if is capable of playing audio?</p><p>Thanks in advance.</p>","425583","","","","","2010-08-19 19:35:41","How to programmatically determine installed audio applications on Android","<android>","1","1","1","",""
"3524996","1","","","2010-08-19 18:28:14","0","1109","<p>I am developing my first android app and need a little bit of help.  I am creating a recipes page and I would like to have a Favorites button on it.  I would like the user to be able to click the favorites button while they are viewing a recipe and have it added to the favorites page.  However when the user clicks the button I would like them to be able to continue viewing that recipes page instead of moving to the favorites page.</p><p>I found out how to use intent to send data to another activity while changing the page.  However I would not like the page to change.  </p><p>I'm assuming I would be passing a button to the activity to do this(is there a better way?)</p><p>Thanks for all the help in advance!</p>","425605","","","","","2010-12-06 16:27:18","Creating Favorites button in Android App(Need to pass object without changing Activity)","<android><activity><favorites>","2","0","","",""
"3525021","1","","","2010-08-19 18:31:27","0","305","<p>I want to display some copy right agreement in pdf format in EditText or TextView. How to do that in Android ? Are there any APIs or any sample codes ? I will be waiting for valuable reply.Thanks,</p>","385939","","","","","2010-08-19 19:28:26","How To Display information in PDF format in Android","<android><android-widget>","1","0","0","",""
"3525073","1","5573928","","2010-08-19 18:38:48","1","2077","<p>When I download a file on my Android phone from my webserver it save it as </p><pre><code> downloadfile.apk</code></pre><p>The file is saved on my server as MyApp.apk</p><p>Do you know how to make the file appear as MyApp.apk in the downloaded files list on Android?</p><p>I should also mention that to get the file to download and be understood by the phone I modified the .htaccess file on the server to be</p><pre><code> AddType application/vnd.android.package-archive apk DirectoryIndex MyApp.apk</code></pre>","207795","","","","","2011-04-06 22:54:58","Filename when downloading APK on Android","<android><.htaccess><download><apk>","1","3","","",""
"3525274","1","4333443","","2010-08-19 19:04:29","0","354","<p>I have a widget that displays a set of information. What I would like to do is to give the user the opportunity to choose the background color/image. I would like to have a popup when the user is selecting the widget to choose the background.</p><p>So how would I make the popup?</p><p>And how would I apply the background dynamically?</p><p>Thank you for any help you can give!!</p>","354130","","","","","2011-07-21 06:24:24","Adding Custom Background for Widget Based on User Input","<android><android-widget>","3","0","","",""
"3525287","1","","","2010-08-19 19:05:39","6","12968","<p>I am trying to display a filtered camera preview, using onPreviewFrame() callback.</p><p>The problem is that when i remove this line:    mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);</p><p>to hide the preview, the app crashes. The log reads:    08-19 15:57:51.042: ERROR/CameraService(59): registerBuffers failed with status -38</p><p>What does this mean? Is this documented anywhere?</p><p>I am using the CameraPreview from the SDK APIDemos: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html</a></p>","203801","","","","","2012-01-10 12:32:25","What does SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS means?","<android><camera>","3","0","1","",""
"3525345","1","3525384","","2010-08-19 19:11:55","0","746","<p>I need lat and lng of a point on a google map. It has to look like that </p><p>8.53171539306641 for example</p><p>but when I go to maps.google.com I get just</p><p>8.532493</p><p>There is a possibility to receive lat and lng that have such a length 8.53171539306641 but I do not remember how</p>","401025","","","","","2010-08-19 19:16:24","Get Lat and Long, Android","<android><android-mapview><latitude-longitude>","1","0","","",""
"3525424","1","3648239","","2010-08-19 19:21:16","4","1527","<p>Passing the following SSML (<a href=""http://www.w3.org/TR/speech-synthesis/"" rel=""nofollow"">Speech Synthesis Markup Language</a>) document to the com.svox.pico TextToSpeech engine resulted in a reading of the XML body but no control from the phoneme element or the emphasis element.  This result (no apparent SSML control) is the same on a Nexus One running Android 2.2 as well as on the emulator running an AVD with SDK level 8.</p><pre><code>            String text = ""&lt;?xml version=\""1.0\""?&gt;"" +                ""&lt;speak version=\""1.0\"" xmlns=\""http://www.w3.org/2001/10/synthesis\"" "" +                    ""xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" "" +                    ""xsi:schemaLocation=\""http://www.w3.org/2001/10/synthesis "" +                        ""http://www.w3.org/TR/speech-synthesis/synthesis.xsd\"" "" +                    ""xml:lang=\""en-US\""&gt;"" +                    ""tomato "" +                    ""&lt;phoneme alphabet=\""ipa\"" ph=\""t&amp;amp;#x259;mei&amp;amp;#x325;&amp;amp;#x27E;ou&amp;amp;#x325;\""&gt; tomato &lt;/phoneme&gt; "" +                    ""That is a big car! "" +                    ""That &lt;emphasis&gt; is &lt;/emphasis&gt; a big car! "" +                    ""That is a &lt;emphasis&gt; big &lt;/emphasis&gt; car! "" +                    ""That is a huge bank account! "" +                    ""That &lt;emphasis level=\""strong\""&gt; is &lt;/emphasis&gt; a huge bank account! "" +                    ""That is a &lt;emphasis level=\""strong\""&gt; huge &lt;/emphasis&gt; bank account!"" +                ""&lt;/speak&gt;"";            mTts.speak(text, TextToSpeech.QUEUE_ADD, null);</code></pre><p><b>Does any Android TTS engine support any of the SSML elements?</b></p>","411972","","168868","","2012-01-01 21:36:05","2012-01-01 21:36:05","does Android TTS support Speech Synthesis Markup Language?","<android><text-to-speech><ssml>","2","0","4","",""
"3525547","1","","","2010-08-19 19:34:59","4","4816","<p>I am working on google's C2DM and have a program on the android emulator trying to get registration ID. But I get following errors:</p><p>DEBUG/GoogleLoginService(171): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }</p><p>WARN/GoogleLoginService(171): Device has no accounts: sending Intent { act=com.google.android.gsf.LOGIN_ACCOUNTS_MISSING }</p><p>ERROR/GTalkService(171): asyncFetch: no username</p><p>DEBUG/C2DMRegistrar(171): [C2DMRegistrar.20] AuthTokenCallback: account missing</p>","425672","","","","","2012-05-15 03:24:06","android c2dm registration Id fails","<android><android-emulator><android-c2dm>","2","0","1","",""
"3525649","1","","","2010-08-19 19:49:35","1","3421","<p>How to display HTML  table with rows and columns in WebView in Android.</p><p>Give me some example.</p>","385939","","101361","","2013-12-19 10:38:30","2014-04-18 19:45:20","Display HTML Table in webview","<android><android-widget><android-webview>","3","1","","",""
"3525753","1","","","2010-08-19 20:04:00","0","8144","<p>I currently am designing an app which needs to connect to a device, write/read data, and close the connection reliably.  Currently I have the write/read solid.  My disconnect and then reconnect is terribly unreliable, and often actually crash the phone.. and sometimes Eclipse.  I've been looking through numerous articles trying to figure it out and.. no luck..</p><p>*<strong>*CONNECT FUNCTION</strong></p><pre><code>public boolean connect(){  ConfigData.getInstance();  BluetoothSocket tmp = null;  BluetoothDevice device = ConfigData.m_SharedBluetoothDevice;  Method m;  try {   tmp = device.createRfcommSocketToServiceRecord(MY_UUID);//(BluetoothSocket)    m.invoke(device, 1);  } catch (SecurityException e) {    e.printStackTrace();  } catch (IllegalArgumentException e) {     e.printStackTrace();  }   catch (IOException e) {   e.printStackTrace();  }        ConfigData.m_SharedBluetoothSocket = tmp;        try {   ConfigData.m_SharedBluetoothSocket.connect();   ConfigData.bIsBTConnected = true;  } catch (IOException e) {   try {    closeSocket();    m = device.getClass().getMethod(""createRfcommSocket"", new Class[] {int.class});    tmp = (BluetoothSocket) m.invoke(device, 1);   } catch (SecurityException e1) {    e1.printStackTrace();   } catch (NoSuchMethodException e1) {    e1.printStackTrace();   } catch (IllegalArgumentException e1) {    e.printStackTrace();   } catch (IllegalAccessException e1) {    e.printStackTrace();   } catch (InvocationTargetException e1) {    e.printStackTrace();   }   ConfigData.m_SharedBluetoothSocket = tmp;   try {    ConfigData.m_SharedBluetoothSocket.connect();    ConfigData.bIsBTConnected = true;   } catch (IOException e1) {    ConfigData.m_BluetoothException += e1.toString();    ConfigData.bIsBTConnected = false;    return false;   }   e.printStackTrace();   return true;  }        return true; }</code></pre><p>*<strong>*Disconnect Function</strong></p><pre><code> public void destroySocket() {     try {      if(m_InStream != null)      {       m_InStream.close();       m_InStream = null;      }      if(m_OutStream != null)      {       m_OutStream.close();       m_OutStream  = null;      }      if(ConfigData.m_SharedBluetoothSocket != null)      {       ConfigData.m_SharedBluetoothSocket.close();       ConfigData.m_SharedBluetoothSocket = null;      }      if(m_InStream == null &amp;&amp; m_OutStream == null &amp;&amp; ConfigData.m_SharedBluetoothSocket == null)   {       ConfigData.bIsBTConnected = false;   }  } catch (IOException e1) {   m_InStream = null;   m_OutStream  = null;   ConfigData.m_SharedBluetoothSocket = null;   e1.printStackTrace();  } }</code></pre><p>So the disconnect is successful and returns everything null.  The problem is that when I reconnect it blocks at the 2nd connect attempt and will either just sit there or completely crash the phone, causing several reboots.  </p><p>Does anyone have any advice here? Its been extremely frustrating. Any help would be much appreciated!!</p><p>Thanks and Gig 'Em!TxAg</p>","409686","","","","","2014-03-26 09:08:45","Android Bluetooth: Connect()/Disconnect()","<android><bluetooth><connect>","1","0","1","",""
"3526011","1","3526119","","2010-08-19 20:39:20","0","476","<p>I've been toying around with a lot of different layout structures and can't seem to find the best one for my solution.</p><p>Essentially I need 3 rows that each take up 33% (height) of the device (in landscape mode).  I thought  would be perfect, but I can't seem to find a way to specify the height of a .  It's possible I've overlooked a property somewhere, but I can't find it in the docs.  I also thought of  as an option but after playing around with that for a bit, I'm not sure that's the best solution either.</p><p>Can  accomplish what I need?  I will have other layouts specified within my rows (RelativeLayout primarily), but I just need the core structure to be 3 rows of 33% height each.</p><p>EDIT - Added Code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/rellay""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/table_background""&gt;    &lt;LinearLayout        android:layout_weight=""1""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;Button            android:id=""@+id/connect""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:text=""Connect To Server"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_weight=""1""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TextView             android:id=""@+id/label""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:scrollbars=""vertical""            android:maxLines=""6""            android:textColor=""#FFFFFF"" /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout        android:layout_weight=""1""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TableLayout            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:stretchColumns=""1""&gt;            &lt;TableRow&gt;                &lt;RelativeLayout                    android:id=""@+id/cardssection""                    android:layout_column=""1"" /&gt;                &lt;Button                    android:id=""@+id/submitcards""                    android:gravity=""right""                    android:maxWidth=""10px""                    android:text=""Submit Cards""                    android:layout_below=""@id/label"" /&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;     &lt;/LinearLayout&gt;</code></pre>","233971","","233971","","2010-08-19 21:24:09","2010-08-19 21:30:40","layout ideas for android","<android><gridview><tablelayout>","1","0","1","",""
"3526087","1","3526297","","2010-08-19 20:46:06","2","1093","<p>I have this currently.</p><pre><code>ClickableSpan span = new ClickableSpan(...){...};String text = ""I am some &lt;b&gt;awesome&lt;/b&gt; text"";Spanned spanned = Html.fromHtml(text);SpannableStringBuilder builder = new SpannableStringBuilder(spanned);int start = builder.nextSpanTransition(0, builder.length(), StyleSpan.class);int stop = builder.nextSpanTransition(start, builder.length(), StyleSpan.class);builder.setSpan(span, start, stop, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);textView.setText(builder);</code></pre><p>The TextView renders with the text that has the word ""awesome"" bolded and underlined (Yay). However in my view, I cannot focus the subregion of text I specified in the clickablespan. I can click on it with a touch event, but I cannot focus it. I am testing this on Android 1.5 + 2.1. I have also tried UrlSpan as well. </p><p>I have also tried instead of using a ClickableSpan, to actually attach an onClick listener to the entire block of text but that doesn't give the region focus, just makes clicking easier.  Please help</p>","307990","","","","","2010-08-19 21:13:14","Android: Is it possible to have a Spanned with part of it's text focusable within a TextView?","<android>","1","0","","",""
"3526133","1","","","2010-08-19 20:51:07","0","137","<p>I'm working on nifty enhancements to an Android app and I've cloned its source from android.git.kernel.org.  How does one deal with imports not found, for example:</p><pre><code>import android.content.entity*import android.os.ServiceManagerimport com.google.android.collect.*import com.android.internal.*</code></pre><p>etc. This is with a checkout of tag Android-2.1_r1 Android2.1-update1 with ADK 0.9.7.v20100514.  I'm not seeing them in the platform source - maybe I'm looking the wrong way?  I spose the answer is a library or something, but it's my first time in ...</p><p>ty!</p>","294973","","","","","2010-08-19 21:56:33","Build android branch missing imports","<android><import><source>","1","0","","",""
"3526148","1","3526213","","2010-08-19 20:53:17","4","9028","<p>Is <code>onSizeChanged()</code> called once the user touches some part of the screen?</p><p>I'm confused about the order in which <code>onDraw()</code>, <code>onMeasure()</code> and <code>onSizeChanged()</code> are called.</p>","388025","","119895","","2011-07-09 15:13:42","2011-07-09 15:13:42","when is onSizeChanged() called?","<android>","1","0","","",""
"3526254","1","3528053","","2010-08-19 21:06:40","2","2618","<p>I can't fill a ListView layout with an array of strings.  Here is the Activity:</p><pre><code> ListView symptomList = (ListView) findViewById(R.id.ListView_Symptom); String symptomsArray[] = new String[1024]; // Then I fill up symptomsArray ArrayAdapter&lt;String&gt; adapt = new ArrayAdapter&lt;String&gt;(this, R.layout.menu_item, symptomsArray);    symptomList.setAdapter(adapt);</code></pre><p>Here is menu_item:</p><pre><code>&lt;TextViewxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:textSize=""@dimen/menu_item_size""android:text=""test string""android:layout_gravity=""center_horizontal""android:layout_height=""wrap_content""android:shadowRadius=""5""android:gravity=""center""android:shadowDy=""3""android:shadowDx=""3"" /&gt;</code></pre><p>And here is symptom.xml - </p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ListView        android:layout_height=""wrap_content""        android:id=""@+id/ListView_Symptom""        android:layout_width=""fill_parent""        android:divider=""@drawable/divider""        android:listSelector=""@drawable/textured""        android:layout_alignParentTop=""true""&gt;&lt;/ListView&gt; &lt;/LinearLayout&gt;</code></pre><p>Does anyone have any idea what is wrong?  Does my public class need to extend ""ListActivity"".  I tried that and that didn't work.</p>","148635","","148635","","2010-08-19 21:26:41","2010-08-20 03:48:44","android - filling ListView with array","<android>","2","4","2","",""
"3526339","1","3526390","","2010-08-19 21:20:00","1","1780","<p>Why doesn't this work?? I am trying to create an onClickListener for a button that produces the same effect as pressing the ""down"" key on the D-pad. Eclipse gives me an error, saying: ""Cannot make a static reference to the non-static method sendDownUpKeyEvents(int) from the type InputMethodService"" Help!</p><pre><code>downButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                InputMethodService.sendDownUpKeyEvents(0x00000014);            }</code></pre>","415560","","272824","","2010-08-20 06:58:56","2011-01-23 23:50:22","Android: Help creating a button that produces the same result as hitting the down key on the D-Pad? (part 2)","<android><keyevent>","2","0","","",""
"3526490","1","3526588","","2010-08-19 21:41:59","1","543","<p>How can I highlight a row in a ListView backed by a CursorAdapter knowing the row ID of the item?</p>","35501","","","","","2010-08-19 22:35:22","Highlight ListView row based on id","<android><listview><listadapter>","1","0","","",""
"3526700","1","3757320","","2010-08-19 22:10:42","4","1467","<p>Google maps now offers a way to ""share a place"" with what appears to be a predefined list of sources.  When users search for a place on Google Maps, whether it's a specific address, cross-street, or restaurant name, there's a new button called ""share this place"" that posts the location info to Google Buzz, Facebook, Twitter, or via e-mail or SMS.  I would like to either have my application included in this list or determine how to obtain the lat/lon of that selected location.  Does anyone have any ideas?</p>","121678","","142162","","2011-09-25 02:47:15","2013-04-06 22:23:39","How to add your application to the ""share this place"" list in Google maps","<android><google-maps>","1","1","5","",""
"3526834","1","3526849","","2010-08-19 22:36:26","1","988","<p>I working on a Game. The View, Thread and the Engine are done. Now I going into how to, for example, set Coordinates to my Bitmap. </p><p>I have successfully done that using getters/setters-method. I've been reading around the web there the most of the good game developers say that ""make your member variable public"" and all that stuff.</p><p>Since I read the Avoid Internal Getters/Setters section at <a href=""http://developer.android.com/guide/practices/design/performance.html"" rel=""nofollow"">http://developer.android.com/guide/practices/design/performance.html</a>, I started to wonder: How I can change my Coordinates-class to achieve this without ""setters"" for example?</p><p>Now my Coordinates-class look like:</p><pre><code>package com.mygame.mygame;public class Coordinates {    int x;    int y;    Coordinates instance = null; public Coordinates getInstance(){  if(instance == null){   instance = new Coordinates();    }  return instance; }    public Coordinates() {        }    public int getX() {        return x;    }    public void setX(int value) {         x = value;    }    public int getY() {        return y;    }    public void setY(int value) {        y = value;    } }</code></pre><p>How should I change my code to achieve this? Method calls are expensive, but I still have no idea how to restructure my current code without getters and setters.</p><p><strong>UPDATED</strong></p><pre><code> public GameEngine getInstance(){ if(instance == null){  instance = new GameEngine(resources,view);    }  return instance;  }</code></pre><p><strong>UPDATE 2</strong></p><p>GameEngine</p><pre><code>    static Resources res;static GameView view;static GameEngine instance = null;public static GameEngine getInstance(Resources localResources, GameView localView){    view = localView;    res = localResources;    if(instance == null){        instance = new GameEngine(); //Init-stuff in the GameEngine    }    return instance;}</code></pre><p>and my GameView</p><pre><code>static GameEngine engine;public GameView(Context localContext) {   //Other stuff   engine = GameEngine.getInstance(context.getResources(), this);   //Other stuff}</code></pre><p>Thanks in advance!</p>","386562","","386562","","2010-08-19 23:12:54","2010-08-19 23:12:54","Avoid internal getters/setters - Game","<java><android>","2","0","","",""
"3526848","1","3526864","","2010-08-19 22:38:55","9","4449","<p>i would like to get rid of the defualt grey bar which apears at the top of my application.I just can't seem to find the attribute or setting to do so.how can this be achived?thanks</p>","407133","","","","","2012-09-16 10:34:02","How to get rid of the program name bar at the top of the application?","<android>","3","0","1","",""
"3526917","1","","","2010-08-19 22:53:48","0","815","<p>I want to be able to check the status of Droid's wireless and I was hoping that by reading /sys/class/net/tiwlan0/wireless/status I could find out if it was actually connected or not. I already know that I can check if my wireless is enabled/disabled but I want my app to notify the user if the wireless gets disconnected. </p><p>However, the Droid I have is not rooted and I do not have permission from the owner to root it and I need to know the type of the value (e.g. long, boolean, byte) before I can proceed. </p><p>Any help or suggestions about other ways I can go about this would be greatly appreciated!</p><p>Thanks</p>","425827","","","","","2012-10-28 04:27:23","Android: Using tiwlan0 to determine wireless connected status for Droid","<android><wireless>","2","0","","",""
"3527119","1","","","2010-08-19 23:35:43","3","2546","<p><strong>Situation:</strong>I have two ScrollView inside of each of two HorizontalScrollView of a TableRow.<br /><br /><strong>Goal:</strong>When I touch drag one of ScrollView, another ScrollView must scroll as much. For instance, if I have a list of name on left ScrollView and corresponding phone numbers in right ScrollView, scrolling one ScrollView should not destroy the original bounding between the names and phone numbers.<br /></p><p>Can it be implemented by onTouchEvent? If so, how should I implement this(on both or one of the ScrollView)?</p><p>Please help me out Android Gurus!</p>","425854","","","","","2013-09-25 22:38:21","Sync Two ScrollView","<android><android-widget>","1","1","1","",""
"3527137","1","3527489","","2010-08-19 23:40:11","0","5320","<p>I am trying to add an object to an arraylist but when I view the results of the array list, it keeps adding the same object over and over to the arraylist.  I was wondering what the correct way to implement this would be.</p><pre><code>    public static ArrayList&lt;Person&gt; parsePeople(String responseData) {    ArrayList&lt;Person&gt; People = new ArrayList&lt;Person&gt;();    try {        JSONArray jsonPeople = new JSONArray(responseData);        if (!jsonPeople.isNull(0)) {            for (int i = 0; i &lt; jsonPeople.length(); i++) {                People.add(new Person(jsonPeople.getJSONObject(i)));            }        }    } catch (JSONException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (Exception e) {    }    return People;}</code></pre><p>I have double checked my JSONArray data and made sure they are not duplicates.  It seems to keep adding the first object over and over.</p>","408079","","408079","","2013-08-21 16:46:58","2013-08-21 16:46:58","Correct way to add objects to an ArrayList","<java><android><activity><performance><arraylist>","3","5","","",""
"3527146","1","3527981","","2010-08-19 23:42:49","0","734","<p>To Launch the market I usually do this:</p><p>Intent intent = new Intent( Intent.ACTION_VIEW,Uri.parse(""market://search?q=pname:com.package.package2.package3""));startActivity(intent);</p><p>But I would like to run a search based on a keyword like ""Happy Toasters""</p><p>What is the URL for that kind of search?</p>","172861","","","","","2010-08-20 03:26:20","Android Search Market on Keyword URL?","<android><google-play>","1","0","","",""
"3527173","1","","","2010-08-19 23:48:06","2","73","<p>Views may at any time invoke disallowInterceptTouchEvent() which will prevent parent views from handling touch events. In short, what is the need for this API? I see that lists use it when a scroll is initiated, but why? The list would still receive ACTION_CANCEL if a parent view intercepts the event, so why would it specifically want to block onInterceptTouchEvent on parent views?</p>","425860","","","","","2010-08-19 23:48:06","Need for ViewParent.disallowInterceptTouchEvent?","<android>","0","0","2","",""
"3527261","1","4287218","","2010-08-20 00:05:04","3","573","<p>I'm attempting to write a BroadcastReceiver to be notified when the Android OS kills an app in order to reclaim resources. I've tried filtering on ""android.intent.action.PACKAGE_RESTARTED"" but I never seem to receive that broadcast, even when I force close an application.  </p><p>So, am I using the correct intent action filter? If not, what is the proper one? Or is this simply not possible?  </p><p>Thanks!</p>","425871","","","","","2011-02-25 16:42:50","Android - Is there a system broadcast intent when an app is killed to reclaim resources?","<android><android-intent><broadcast>","1","0","","",""
"3527263","1","3527279","","2010-08-20 00:05:48","24","8598","<p>My Android App has 2 activities. A login screen and a search screen. When i deploy the app on emulator or on my  device, i see 2 icons for same app. When i click on icon 1 it opens screen 1 (login screen) and When i click on icon 2 it opens screen 2 (search screen). By logic when i login it should show the search screen. Not sure when i'm making the mistake, would be of help if some one can point me in right direction.</p><p>Regards,Aravind. C</p>","","Aravindan. C","","","","2013-08-27 11:39:20","Android App actvities installed as multiple icons","<android>","2","0","3","",""
"3527333","1","","","2010-08-20 00:22:56","0","98","<p>I want to enhance Android app and I've cloned its source from android.git.kernel.org. During compile I find dependencies on platform components external to the tree, for example</p><pre><code>com.google.android.collect.*</code></pre><p>It turns out that most of these are resolved in platform/frameworks/base.git.</p><p>Which raises <strong>several questions</strong>:</p><ul><li>is grabbing a piece of the tree just asking for trouble, generally?</li><li>can this be fixed with a .jar?</li><li>how would one know which .jar and where to get it?  </li><li>is there a place that cross-references packages to .git trees?</li><li>how do you detect? [and follow? [and resolve?]] dependencies?</li></ul>","294973","","","","","2010-08-20 00:27:09","How do you build one piece of the Android platform?","<android><build><dependencies>","1","0","","",""
"3527567","1","3543899","","2010-08-20 01:25:03","8","5528","<p>I know how to setup and display an oval shape.  I know how to apply a gradient to this shape. What I cant figure out is how I can get an oval gradient to match the shape.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""       android:shape=""oval"" &gt;    &lt;gradient        android:startColor=""#66FFFFFF""        android:endColor=""#00FFFFFF""        android:gradientRadius=""100""        android:type=""radial"" /&gt;&lt;/shape&gt;</code></pre><p>If you can imagine, this gradient has a semi transparent white glow in the middle, then fades to alpha zero at the edges.  I need to get it to go out in an oval shape, not just a circular gradient.  How can I achieve this?</p>","69634","","69634","","2010-08-20 02:54:36","2012-03-10 09:30:34","Oval Gradient in Android","<android><graphics><gradient><shape>","3","0","4","",""
"3527573","1","","","2010-08-20 01:26:47","2","2417","<p>Is there a way to replace the scrollbar drawable in an application (i.e. I have a customized scrollbar view that I would like to use instead of the default gray scrollbar that comes with the Android framework).  I looked through I believe all of the android attributes and none seem to support it (at least the simplest way I know how which I would assume would be setting a drawable to some android attribute).</p><p>If not and say it requires a change in the framework, where would I start looking for it (in the framework)?</p><p>Thanks</p><p>MB</p>","425916","","","","","2010-08-23 11:01:46","Android: Overriding the scrollbar drawable in an application","<android><scrollbar><drawable>","1","0","3","",""
"3527576","1","3527605","","2010-08-20 01:27:05","4","1814","<p>I am still working on my location-based alarm android application. I have an AlarmService class that starts notifications and proximity alerts. I am starting this service with:</p><pre><code>startService(intentAlarmService);</code></pre><p>I try to stop the service using:</p><pre><code>Intent intentAlarmService = new Intent(this, AlarmService.class);stopService(intentAlarmService);</code></pre><p>This is what happens: The service stops, but then, when I start another instance of the service (i.e. exit the app, launch the app, start the service) - I discover (through Toasts) that the previous instances of the service are still running. For example, in the AlarmService class, there is a LocationListener with the onLocationChanged method. So, in this method, I put:</p><pre><code>Toast.makeText(AlarmService.this, ""AlarmTitle: "" + mAlarmTitle, Toast.LENGTH_SHORT).show();</code></pre><p>And when I re-start the service, Toasts keep showing up with the previous AlarmTitles, and the current AlarmTitle. </p><p>So, something is not working when I try to stop the AlarmService - what could this be?</p><p>Note: when I re-install the application, the service stops for real. Then when I start the service, only the current AlarmTitle shows in the Toast (I want this to happen every time).</p><p>Something is wrong with my service. Any ideas what I can do?</p><p>thanks.</p><hr><p>CODE FROM MY APP:</p><pre><code>public void onDestroy() {    super.onDestroy();    Intent alarmIntent = new Intent(getApplicationContext(), AlarmReceiver.class);    PendingIntent pendingIntentAlarm = PendingIntent.getBroadcast(getApplicationContext(), PENDING_INTENT_REQUEST_CODE1, alarmIntent, PendingIntent.FLAG_CANCEL_CURRENT);    pendingIntentAlarm.cancel();    Intent intentAlarmService = new Intent(getApplicationContext(), AlarmService.class);    stopService(intentAlarmService);     mNtf.cancel(NOTIFICATION_ID1);    mNtf.cancelAll();  }</code></pre>","399717","","638471","","2013-12-16 15:01:38","2014-01-17 00:07:41","How to stop multiple instances of an Android Service?","<android>","2","0","","",""
"3527621","1","3596395","","2010-08-20 01:41:27","10","18609","<p>I have a surfaceView setup and running, but when i resume it i get an error that the thread has already been started. Whats the proper way to handle when the app goes to the background and then back to the foreground? Ive tinkered around and managed to get the app to come back without crashing...but the surfaceView doesnt draw anthing anymore. My code:</p><pre><code>    @Override    public void surfaceCreated(SurfaceHolder holder) {           Log.e(""sys"",""surfaceCreated was called."");           if(systemState==BACKGROUND){                  thread.setRunning(true);           }           else {        thread.setRunning(true);               thread.start();               Log.e(""sys"",""started thread"");               systemState=READY;           }    }    @Override    public void surfaceDestroyed(SurfaceHolder holder) {           Log.e(""sys"",""surfaceDestroyed was called."");           thread.setRunning(false);           systemState=BACKGROUND;    }</code></pre>","385051","","","","","2012-05-04 17:04:15","how to pause and resume a surfaceView thread","<android><multithreading><surfaceview>","8","0","18","",""
"3527640","1","3527941","","2010-08-20 01:47:45","0","362","<p>My Android app runs fine, but:<br>If I insert a call to WebView.setScrollbarFadingEnabled, it crashes saying:</p><pre><code>Could not find method android.webkit.WebView.setScrollbarFadingEnabled, referenced from [my class]VFY: unable to resolve virtual method 289: Landroid/webkit/WebView;.setScrollbarFadingEnabled (Z)V</code></pre><p>I am using Android 1.5, not a custom ROM.<br>My app defines minSdkVersion=""3""<br>I always clean before compiling.</p><p>Is setScrollbarFadingEnabled unavailable in Android 1.5?<br>If so, why don't I receive a compiler error?</p>","226958","","","","","2010-08-20 03:16:04","App crashes because Android can't find a Java method, despite no problem at compile or install","<android><webview>","1","0","","",""
"3527679","1","3527935","","2010-08-20 02:02:51","1","1381","<p>I understand that the system may kill the activity without calling onDestroy(). Say I have a MediaPlayer that runs even when it's not visible, I would be releasing the player in onDestroy() method.</p><p>Now, if the system decides to kill the activity after calling onPause() and never called onDestroy(), what does it mean for my MediaPlayer? Is it ever released? This is bigger problem for Camera since I think it requires to be released for other activities to use it.</p>","425932","","","","","2010-08-20 03:14:01","Android: Releasing resources in onDestroy(); method","<android>","1","0","","",""
"3527771","1","3527923","","2010-08-20 02:31:36","0","922","<p>I have the android:cacheColorHint=""#00000000"" set on my ListView, which fixed this issue in one of my other lists in another activity, but it's not helping in this other list. I'm using the Light theme in my app, if that matters. I can't figure out what's going on. Long press brings up the context menu just fine, I just don't get the nice highlight of the row while pressing it.</p><p>Any ideas?</p>","413414","","","","","2010-08-20 03:11:56","Row not highlighting on long press in ListView","<android><listview><highlighting>","1","0","","",""
"3527809","1","3529134","","2010-08-20 02:40:46","2","1035","<p>We have an existing website which currently uses v2 of the google maps api which displays cellphone signal strength as a ground overlay on top of the google maps tiles (similar to this <a href=""http://www.vodafone.co.nz/coverage/"" rel=""nofollow"">http://www.vodafone.co.nz/coverage/</a>)</p><p>What I would like to know is if it's possible to have ground/tile overlays in google maps android/iphone native api's?</p><p>The client is wanting to create an iPhone app, but we figured we may aswell make an android app while where at it. Personally I'd prefer to make it just a web app which would then work on any modern mobile browser but then I guess its not a native app. which has its downsides I guess since you can't just tell people to get it off the app store. </p><p>But im unsure of the capabilitys of the iphone/android native google maps api. I've set up a very basic map app in android but there doesn't seem to be any support for ground overlays and not even polygons</p><p>The funconality I need but not sure if the Android/iPhone native api supports are:</p><ul><li>drawing polygon's</li><li>ground/tile overlays </li></ul><p>Would It be better to just create a web app using google maps api v3 in javascript. I've never doing any mobile app dev so not sure if a web app is a good option</p>","323694","","73488","","2010-08-20 04:30:28","2010-08-20 16:36:54","Mobile Phone: google maps api or native sdk - capabilities?","<iphone><android><google-maps><google-maps-api-3>","2","2","","",""
"3527836","1","3527882","","2010-08-20 02:46:24","2","652","<p>Trying to find some information on the GC. In my log i see these entrie often:</p><pre><code>08-19 22:35:27.513: DEBUG/dalvikvm(1981): GC_EXPLICIT freed 93 objects / 3160 bytes in 999ms08-19 22:35:28.256: DEBUG/dalvikvm(2331): GC_FOR_MALLOC freed 15082 objects / 523496 bytes in 47ms</code></pre><p>whats the difference between the 2?</p>","385051","","","","","2010-08-20 02:58:44","android garbage collector lingo","<android><garbage-collection>","1","0","","",""
"3527841","1","","","2010-08-20 02:47:21","4","1462","<p>When running LogCat in Eclipse, the output to Logcat stops after the following message</p><pre><code> 08-19 19:46:13.525: WARN/ActivityManager(58): Launch timeout has expired, giving up wake lock! 08-19 19:46:13.702: WARN/ActivityManager(58): Activity idle timeout for HistoryRecord{43fd5c90 com.android.homeopathy/.symptomActivity}</code></pre><p>What does this mean and why does the output to Logcat stop at this point?</p>","148635","","","","","2011-05-29 20:24:33","Android - Logcat Launch timeout has expired","<android>","1","2","1","",""
"3527878","1","3528213","","2010-08-20 02:57:39","2","3063","<p>I'm making an OpenGLES Android app using Android NDK, expanding from android's gljni example, which can be found <a href=""http://www.netmite.com/android/mydroid/2.0/frameworks/base/opengl/tests/gl_jni/"" rel=""nofollow"">here</a></p><p>It's using GLSurfaceView. Textures are initialized in a JNI function called from onSurfaceChanged() of GLSurfaceView.Renderer </p><p>When the user touches screen, the app needs more textures. In order to do so, glGenTextures() is called in a JNI function called in onTouchEvent().</p><p>The problem is that the thread id (which gettid() returns) seems completely arbitrary and not always the same to the thread id that has the OpenGL context.</p><p>It loads and shows up textures if the JNI function is called in the same thread, but fails if it's on another thread. So it's acting quite randomly.</p><p>Can I do something like :</p><ul><li><p>share the OpenGL context so that I can call glGenTextures() successfully on any thread.</p></li><li><p>make onTouchEvent() to be called in only one thread that has the OpenGl Context</p></li><li><p>or anything that I can make it working</p></li></ul><p>?</p><p>Thanks</p>","425943","","44729","","2010-08-20 14:23:09","2013-11-02 10:27:34","Can't call glGenTextures on multithreaded android app","<android><opengl-es><android-ndk><textures>","4","0","1","",""
"3527886","1","","","2010-08-20 03:00:06","1","3051","<p>I need to fool GMap application on android device by providing my own positioning data.What is the possibility and how shall i go about achieving it?</p><p>Thanks,Black</p>","423923","","","","","2011-06-01 18:01:17","Android Device mock location provider for Gmaps","<android><gps>","1","0","1","",""
"3527928","1","3529985","","2010-08-20 03:13:10","3","2622","<p>I wrote the same program two ways.</p><p>One using a Surfaceview, and the other using a custom view. According to the android SDK development guide, using a surface view is better because you can spawn a separate thread to handle graphics. Th SDK development guide claims that using a custom view with invalidate calls is only good for slower animations, less intense graphics.</p><p>However, in my simple app, I can clearly see that using a custom view with calls to invalidate seems to render faster.</p><p>What do you guys know/think about this?</p><p>My touchEvent code is exactly the same, and my drawing code is exactly the same. The only difference is that one is all in the UI thread, and the other is using a tread to handle the drawing.</p>","425962","","","","","2010-08-20 10:23:04","SurfaceView vs Custom View (extended from View). SurfaceView is slower, Why?","<android><performance><surfaceview><android-custom-view>","1","0","","",""
"3528428","1","3568936","","2010-08-20 05:38:03","3","1886","<p>I am trying to create an application which collects a lot of notes from users. I want to implement full text search on the notes so that the user can get relevant notes from the whole array of notes. I am looking for a solution for this. Full-text-search(FTS) is actually supported by SQLite, but is it available for Android? Can anybody enlighten me on this?</p>","177890","","","","","2013-10-20 09:06:45","Is there anyway to implement Full Text Search (FTS) in SQlite from Android platform?","<android><database><sqlite><search>","2","0","2","",""
"3528458","1","3528471","","2010-08-20 05:47:11","4","14280","<p>Android: I am trying the following xAuth example for android share.</p><p><a href=""http://stackoverflow.com/questions/3280328/xauth-authentication-for-twitter-share-in-android"">xAuth Authentication for Twitter Share in Android?</a></p><pre><code>System.setProperty(""twitter4j.oauth.consumerKey"", ""your token"");System.setProperty(""twitter4j.oauth.consumerSecret"", ""your token secret"");Twitter twitter = new TwitterFactory().getInstance(login, password);AccessToken accessToken = twitter.getOAuthAccessToken();//Then you must save your Token and Token secret from AccesTokenif (mAccessToken != null) {    if (mAccessToken.getToken() != null &amp;&amp; mAccessToken.getTokenSecret() != null) {        saveAccessToken(mAccessToken.getToken(), mAccessToken.getTokenSecret());    }}</code></pre><p>I am having IllegalStateException </p><p><code>Exception Msg: java.lang.IllegalStateException: OAuth consumer key/secret combination not supplied</code></p><p>at the following line</p><pre><code>AccessToken accessToken = twitter.getOAuthAccessToken();</code></pre><p>I made changes some thing like following </p><pre><code>Twitter twitter = new TwitterFactory().getInstance(""login"", ""pass"");            twitter.setOAuthConsumer(getString(R.string.twtAPIKey), getString(R.string.twtSecret));            AccessToken mAccessToken = twitter.getOAuthAccessToken();</code></pre><p>and again I got exception <code>Exception Msg: java.lang.IllegalStateException: Basic authenticated instance.</code></p><p>Any working example of xAuth ?</p>","216431","","11238","","2011-05-11 05:00:18","2012-07-09 00:31:42","Android Twitter xAuth example using twitter4j","<android><twitter><twitter4j><xauth>","2","1","7","",""
"3528562","1","","","2010-08-20 06:16:01","0","1020","<p>On my android htc g1 device currently there is 1.6 sdk is install. But now i am working in android 2.2, so now i want install this new sdk in my HTC g1 device and i am working on Linux machine. I don't know how to do this. Help me...</p><p>Many Thanks</p>","387466","","387466","","2010-08-23 05:42:39","2010-08-23 05:42:39","Install android sdk 2.2 on htc g1 device","<android>","2","0","","",""
"3528637","1","3528709","","2010-08-20 06:29:28","0","2002","<p>please somebody tell me what is the folder of sdcard and how can i create files in it.because i am new to android and i have googled so much but could not find any comprehensive stuff.i want to create file in sdcard manually. please help.</p><p>here is my code i have written but now it says fileNotFoundException. hence i have created a file in sdcard but still it is not recognisizing the file.any suggestions please.</p><p>try             {</p><pre><code>                String root = android.os.Environment.getExternalStorageDirectory().getPath();                File gpxfile = new File(root, ""sijjeel.txt"");                //FileWriter writer = new FileWriter(gpxfile);                FileOutputStream writer = new FileOutputStream(gpxfile);                writer.write(bArray, 0, bArray.length);                writer.flush();                writer.close();        } </code></pre><p>thanks alot</p>","397901","","397901","","2010-08-20 07:08:32","2010-08-20 11:38:32","what is the folder of sdcard and how can i create files and read and write them in it","<android><file-io>","3","0","","",""
"3528735","1","","","2010-08-20 06:48:28","38","34457","<p>Can anybody tell me the reason for !!!failed binder transaction!!! error??? I can see this error message in logcatI am getting this error while trying to put an bitmap dynamically in a widget..</p>","362088","","362088","","2010-09-06 13:34:00","2013-09-16 17:31:06","Failed Binder transaction","<android><bitmap><widget>","5","0","10","",""
"3528790","1","","","2010-08-20 07:01:18","4","4151","<p>I'm trying to dynamically resize my textview but getlinecount() method always returns me 0 even after settext() and invalidate(). I'm using the following code:</p><pre><code>        if(convertView == null){            convertView = lInflater.inflate(R.layout.listview, null);            holder = new ViewHolder();            holder.text2 = (TextView)convertView.findViewById(R.id.TextView02);        convertView.setTag(holder);        }        else{            holder = (ViewHolder)convertView.getTag();        }        holder.text2.setText(arr2[position]);        holder.text2.invalidate();        int lineCnt = holder.text2.getLineCount();</code></pre><p>holder is a static class as follows:</p><pre><code>    static class ViewHolder{        TextView text2;} </code></pre><p>holder contains non null text2 and the content set is also non null. </p><p>Can anybody please help?</p><p>Thanx in advance.</p>","227943","","","","","2014-03-12 12:27:48","textview.getLineCount always 0 in android","<android><textview>","5","0","","",""
"3529022","1","3541308","","2010-08-20 07:41:28","1","797","<p>I have a map that dispays markers. If the user clicks on a marker a popup shows up. A method calculates wheather there is a marker at the clicked position.</p><p>My Problem is that I have a lot of different markers, but in this method I can handle only one specific marker.</p><p>I need something like a general bitmap, that holds all marker resources. E.g. I do not wand to handle 100 markers manually, because all are a Bitmap so I need just to handle one general bitmap.</p><p>any ideas?</p>","401025","","","","","2011-01-31 07:06:07","Map Marker Management, Android","<android><android-mapview><google-maps-markers>","1","0","1","",""
"3529181","1","","","2010-08-20 08:11:06","2","4116","<p>I have a string that I want to update using AsyncTask classhere is my code:</p><pre><code>public class MainActivity extends Activity{private String str = ""oldString"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        getString();        }       private void getString(){              new CustomTask().execute();       }     private class CustomTask extends AsyncTask&lt;Void, Void, String&gt;{          @Override          protected String doInBackground(Void... params) {           // TODO Auto-generated method stub           Log.i(""Lesson3"", ""doInBackground method"");           str = ""newString"";           return ""someString"";          }          protected void onPostExecute(String s){           Log.i(""Lesson3"", ""onPostExecute method"");          }}</code></pre><p>onPostExecute method is not called, thats the problem??</p><p>Thanks</p>","330740","","330740","","2010-08-20 08:38:48","2013-06-25 09:09:12","Android AsyncTask problem","<android><android-asynctask>","3","2","","",""
"3529311","1","3529579","","2010-08-20 08:30:20","0","1078","<p>How do i on checkboxselected , show a toast that has data from database?</p><p>Thank you.</p>","358218","","","","","2012-03-29 05:45:54","ListView with checkbox","<android><database><listview><checkbox>","1","1","","",""
"3529352","1","","","2010-08-20 08:38:33","0","1806","<p>I have been reading a lot of comments on how it is more lightweight to use views instead of intents in <code>setContent</code> when using tabs.</p><p>Since I will be creating an app with tabs, I am trying to implement this instead of having intents inside <code>setContent</code>. However, I am having a difficult time looking for examples or straightforward tutorials on swapping the current view with another one.</p><p><strike>Say I have TAB_A, with some entry fields and a button. When the user clicks on the button, a <code>TextView</code> will display ""Hello, user!"" in the same TAB_A. Of course this is an oversimplified example, but it will surely point me in the right direction.</strike></p><p>EDIT: I have a tab called TAB_A with a button in it.  If the user clicks on that button, TAB_A will now display ""Hello, user!"" instead of the button. </p><p>Here is a sample of my TabSpec.</p><pre><code>TabHost.TabSpec spec = tabHost.newTabSpec(getString(R.string.tabspec_tag_search))                .setIndicator(getString(R.string.tabspec_indic_search),                        res.getDrawable(R.drawable.tab_ic_search))                .setContent(new TabContentFactory() {                @Override                public View createTabContent(String tag) {                   switch (doWhat){                    case ACTIVITY_SPLASH_PAGE:                                       return showButton;                    case ACTIVITY_HELLO:                                       return showHello;                   }                       return null;                }            });        tabHost.addTab(spec);</code></pre><p>Where <code>ShowButton</code> and <code>ShowHello</code> are classes both extending <code>LinearLayout</code>.  Both are initialized in onCreate like this:<code>ShowButton showButton = new ShowButton(this);</code></p><p>Inside the showButton class, I have this listener:</p><pre><code>viewHolder.button.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {        Intent intent = new Intent(context, Search247.class);        intent.putExtra(EXTRA_DO_WHAT, ACTIVITY_HELLO);        context.startActivity(intent);    }});</code></pre><p>When the app first starts, the user sees the view showButton.  When the user clicks on the button, I want the tab to change its contents to showHello.</p><p>The question then is: Is there any way to update the contents of the tabspec without using <code>startActivity</code>?</p><p>Thanks as always!</p>","395576","","395576","","2010-08-20 09:26:47","2010-10-15 05:26:18","Change content of tab on button click","<android><views><tabs><android-tabhost><android-intent>","1","2","","",""
"3529378","1","","","2010-08-20 08:43:39","1","646","<p>When I restart an <code>Activity</code> using </p><pre><code>Intent intent = new android.content.Intent();intent.setClass(this, this.getClass()); this.startActivity(intent);</code></pre><p>A lot of the state is remembered, but I want to clear it all (its a rare exception handler that I am using to try to clear all).</p>","400923","","12388","","2010-08-20 08:57:13","2010-08-20 15:28:35","On resart activity how to clear stored variables?","<android><activity>","1","0","","",""
"3529524","1","","","2010-08-20 09:08:26","0","1051","<p>I'm creating an application that encrypts data with a key that is created each time the user logs into the app. However, there are times when data will be received via a BroadcastReceiver that needs encrypting, but the user is not logged in and so the encryption key is not available.Security is pretty important and so using a key stored in code to encrypt the data until the user next logs in is out of the question as is storing one in the applications DB despite it being within the apps sandbox.I've been searching through the Android docs and get hints of APIs to address this situation but have not yet come up with a definitive solution.Anyone know of the usual solution to this problem? I expect it crops up quite a lot in software development.</p>","397789","","","","","2010-09-30 15:58:58","Android Data Encryption dilemma","<android><security><encryption>","2","1","1","",""
"3529640","1","","","2010-08-20 09:25:52","0","1362","<p>Current configuration</p><p>Use Android emulator and GAE tools (to access local GAE service I set uri <a href=""http://10.0.2.2:8888/XXX"" rel=""nofollow"">http://10.0.2.2:8888/XXX</a> and it works.</p><p>Question</p><p>I would like to use Android device(phone) via USB to call web service running on connected ""local"" computer. What is best configuration practice ((I don't have static IP) I am using mac and linux)?</p>","407471","","","","","2010-08-20 15:25:39","How to config computer/phone network to access local web server via USB (Android:GAE)?","<android><google-app-engine><networking>","1","0","","",""
"3529676","1","3900855","","2010-08-20 09:32:15","1","612","<p>I would like to know if there is anyway to debug the HTTP response with the android emulator. my logs show that the response is not arriving complete to the application and i would like to know if it is the server that does not send the complete response or if my application is not processing the response completely.</p><p>I tried hooking up Fiddler and Blurp proxy, it actually works with Blurp proxy but only for HTTP and as you may guess i need it also for HTTPS</p>","197565","","7852","","2013-10-25 16:11:46","2013-10-25 16:11:46","HTTPResponse debugging with the android emulator","<android><android-emulator>","2","0","","",""
"3529834","1","","","2010-08-20 09:57:42","7","18619","<p>I am writing an android app which must be always running in the background untill user exit it from the app's menu. But now I notice that in Android after some time my app is stopped by itself without user intervention.</p><p>Any idea how to make sure my app will always be running in the background?</p><p>Thanks In Advance,Perumal</p>","426201","","","","","2013-06-30 23:23:44","How to keep a Android app always running?","<android>","4","2","5","",""
"3529998","1","5114509","","2010-08-20 10:26:06","1","920","<p>i am using spinner in some application  in spinner item list array  this text replaced in drawable images  how can its implemented</p><pre><code>personalinformation = (Spinner) findViewById(R.id.SpinnerCategory);ArrayAdapter&lt;?&gt; adapterDefaultpersonal = ArrayAdapter.createFromResource(Animals.this, R.array.Animalinformation, android.R.layout.simple_spinner_item);adapterDefaultpersonal.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);personalinformation.setAdapter(adapterDefaultpersonal); </code></pre><p>How can the <code>R.array.Animalinformation</code> array list items replaced in drawable images be implemented?</p>","254790","","18626","","2012-09-25 13:53:45","2012-09-25 13:53:45","in spinner items display the list array to replace drawable images how can implemented","<android>","1","1","2","",""
"3530017","1","","","2010-08-20 10:28:29","1","257","<p>Running my unit tests I have found that on android I am not receiving the complete atom document while the code works ok for JSE.</p><p>The URL is: <a href=""https://www.googleapis.com/buzz/v1/activities/@me/@consumption?max-results=25"" rel=""nofollow"">https://www.googleapis.com/buzz/v1/activities/@me/@consumption?max-results=25</a></p><p>The request headers are: authorization: [OAuth oauth_token=""validToken"", oauth_consumer_key=""anonymous"", oauth_version=""1.0"", oauth_signature_method=""HMAC-SHA1"", oauth_timestamp=""1282297108"", oauth_nonce=""5247048527864989575"", oauth_signature=""validSignature""]</p><p>The code to make the HTTP request</p><pre><code>public static String send( HttpsURLConnection request )    throws BuzzIOException{    StringBuffer response = null;    try    {        // Send request        request.connect();        // Read response        InputStream is = request.getInputStream();        response = new StringBuffer();        byte[] b = new byte[4096];        for ( int n; ( n = is.read( b ) ) != -1; )        {            response.append( new String( b, 0, n ) );        }    }    catch ( Exception e )    {        throw new BuzzIOException( e );    }    //TODO remove debug line, i could set log4j but it is not compatible with android    try{        Class&lt;?&gt; clazz = Class.forName(""android.util.Log"");        Method androidLog = clazz.getMethod(""d"", new Class[]{String.class,String.class});        androidLog.invoke(null, ""BuzzIO"",response.toString());    } catch (Exception e) {        System.out.println(response.toString());    }    return response.toString();}</code></pre><p>The response I receive is an invalid atom feed because it gets truncated. the expected length is about 86043 characters but I am getting a response with only 4435</p>","197565","","759866","","2013-12-16 11:36:45","2013-12-16 11:36:45","Is there a limit to the content length for HTTPResponse?","<android><google-buzz>","0","0","","",""
"3530026","1","3530118","","2010-08-20 10:29:37","1","1327","<p>This is my SimpleDBAdapter Class that encapsulates all the complexities of accessing the database and the inner class SimpleDBHelper takes care of CRUD operations,now the Problem that i am facing here is when i deploy the code, the tables were getting created, but the i am unable to insert tht values in to the table, the id is returning -1 that depicts that there is an error,while inserting the values. </p><pre>id = db.insert(TABLE_SIMPLETABLE_CLIENT1,null,contentvalues);</pre><p>SimpleDBAdapter.java</p><p><pre>import android.content.ContentValues;import android.content.Context;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;import android.view.ViewGroup.MarginLayoutParams;</p><p>public class SimpleDBAdapter {    // Define all the constants that are to used in the Program    private static final String DATABASE_NAME = ""SimpleDB.db"";    private static final String TABLE_SIMPLETABLE_CLIENT1 = ""SimpleTable1"";    private static final int DATABASE_VERSION = 1;</p><pre><code>private static final String KEY_EMPLOYEE_ID = ""Employee_id"";private static final String KEY_EMPLOYEE_NAME = ""Name"";private static final String KEY_EMPLOYEE_DESIGNATION = ""Designation"";private static final String KEY_EMPLOYEE_MARITUALSTATUS = ""Maritual Status"";private static final String KEY_EMPLOYEE_DOJ = ""Date of Joining"";private static final String TAG = ""SimpleDBAdapter"";String CREATE_TABLE_SIMPLETABLE = ""CREATE TABLE IF NOT EXISTS ""    + TABLE_SIMPLETABLE_CLIENT1    + "" (Employee_ID INTEGER PRIMARY KEY AUTOINCREMENT, ""    + ""  Employee_Name VARCHAR(20),"" + ""  JoinedDateTime DATETIME,""
    + ""  Designation VARCHAR(20),""
    + ""  Maritual_Status BOOLEAN DEFAULT 'FALSE');"";private final Context ctx;private SQLiteDatabase db;private SimpleDBHelper simpledbhelper;public SimpleDBAdapter(Context context) {Log.i(TAG,""SimpleDBAdapter Constructor""); ctx = context; simpledbhelper = new SimpleDBHelper(ctx);}  class SimpleDBHelper extends SQLiteOpenHelper {    private static final String TAG = ""SimpleDBHelper"";    public SimpleDBHelper(Context context) {    super(context, DATABASE_NAME, null, DATABASE_VERSION);Log.i(TAG,""Calling.. super(context, DATABASE_NAME, null, DATABASE_VERSION)"");    }       @Override    public void onCreate(SQLiteDatabase db) {        Log.i(TAG,""Creating Table named CREATE_TABLE_SIMPLETABLE"");        db.execSQL(CREATE_TABLE_SIMPLETABLE);           }    @Override    public void onUpgrade(SQLiteDatabase db, int oldversion, int newversion) {        Log.w(TAG, ""Upgarding from"" + oldversion + ""to"" + newversion                + ""could remove all the old data"");        db.execSQL(""DROP TABLE IF EXISTS TABLE_SIMPLETABLE_CLIENT1"");        onCreate(db);    }}//Opens the DBpublic void open() throws SQLException {    Log.i(TAG,""Open() Called..."");    db = simpledbhelper.getWritableDatabase();    simpledbhelper.onCreate(db);}//closes the DBpublic void close() {    Log.i(TAG,""Close() Called..."");    simpledbhelper.close();}//inserting the values in to Tablepublic long insertEntry(String Name,String Designation,Boolean MaritualStatus,String date){    Log.i(TAG,""Insert Entry ()"");    long id = 0;    try{    ContentValues contentvalues = new ContentValues();    contentvalues.put(KEY_EMPLOYEE_NAME, Name);    contentvalues.put(KEY_EMPLOYEE_DOJ,date);    contentvalues.put(KEY_EMPLOYEE_DESIGNATION, Designation);    contentvalues.put(KEY_EMPLOYEE_MARITUALSTATUS, MaritualStatus);    id = db.insert(TABLE_SIMPLETABLE_CLIENT1,null,contentvalues);    }    catch(Exception err){        Log.i(TAG,""Error Encountered..."");        Log.e(TAG,String.valueOf(err).toString());    }    return id;}</code></pre><p>}</p><p></p><p>In the MainClass file (DBHandler.java), i am creating instance of the code and calling the insert method of this class as follows,</p><p>DBHandler.java</p>import android.app.Activity;import android.os.Bundle;import android.util.Log;public class SimpleDBApplication extends Activity {    private static final String TAG = ""SimpleDBApplication"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        SimpleDBAdapter DBAdapter = new SimpleDBAdapter(this);        Log.i(TAG,""Called SimpleDBAdapter"");        //call to open the DB        DBAdapter.open();        long id;      //  add an entry      id = DBAdapter.insertEntry(""Vinayaka"",""CEO"",false,""17-7-2010"");      Log.w(TAG,""Tuple Inserted"");      Log.w(TAG,"" The Value of ID :"" +String.valueOf(id).toString());    //call to close the DB      DBAdapter.close();    }}</pre><p>Thanks in Advance...</p>","384193","","","","","2010-08-20 10:43:42","While Inserting records in SQLite returns -1","<android><sqlite>","2","0","","","2010-08-20 10:30:50"
"3530171","1","3530358","","2010-08-20 10:51:25","-1","1019","<p>I've got the following <code>MapOverlay</code>. The following line is throwing a NullPointer but I don't understand why :S <code>mapView.getProjection().toPixels(p, screenPts);</code> could anyone help me out?</p><pre><code>    public class Mapview extends MapActivity {GeoPoint p;MapView mapView; MapController mc;@Overrideprotected boolean isRouteDisplayed() { return false;}public int icount = 0;MapController mapController;MyPositionOverlay positionOverlay;private LocationData tweets;public int start = 0;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);MapView myMapView = (MapView)findViewById(R.id.mapView);myMapView.setSatellite(true);myMapView.setStreetView(true);myMapView.displayZoomControls(false);mapController = myMapView.getController();mapController.setZoom(17);myMapView.setBuiltInZoomControls(true);//Adding points here//---Add a location marker---MapOverlay mapOverlay = new MapOverlay();List&lt;Overlay&gt; listOfOverlays = myMapView.getOverlays();listOfOverlays.clear();listOfOverlays.add(mapOverlay);        myMapView.invalidate();// Add the MyPositionOverlaypositionOverlay = new MyPositionOverlay();List&lt;Overlay&gt; overlays = myMapView.getOverlays();overlays.add(positionOverlay);LocationManager locationManager;String context = Context.LOCATION_SERVICE;locationManager = (LocationManager)getSystemService(context);Criteria criteria = new Criteria();criteria.setAccuracy(Criteria.ACCURACY_COARSE);criteria.setAltitudeRequired(false);criteria.setBearingRequired(false);criteria.setSpeedRequired(false);criteria.setCostAllowed(true);String provider = locationManager.getBestProvider(criteria, true);locationManager.requestLocationUpdates(provider, 2000, 10, locationListener);Location location = locationManager.getLastKnownLocation(provider);updateWithNewLocation(location);}private final LocationListener locationListener = new LocationListener() { public void onLocationChanged(Location location) {  updateWithNewLocation(location);}public void onProviderDisabled(String provider){  updateWithNewLocation(null);}public void onProviderEnabled(String provider){ }public void onStatusChanged(String provider, int status,                             Bundle extras){ } };private void updateWithNewLocation(Location location) {String latLongString ="""";TextView myLocationText;myLocationText = (TextView)findViewById(R.id.myLocationText);String addressString = ""No address found"";if (location != null) {     // Update my location marker    positionOverlay.setLocation(location);  // Update the map location.  Double geoLat = location.getLatitude()*1E6;  Double geoLng = location.getLongitude()*1E6;  GeoPoint point = new GeoPoint(geoLat.intValue(),                                 geoLng.intValue());  mapController.animateTo(point);  double lat = location.getLatitude();  double lng = location.getLongitude();  latLongString = ""Lat:"" + lat + ""\nLong:"" + lng;  Global.lat = lat;  Global.lng = lng;  double latitude = location.getLatitude();  double longitude = location.getLongitude();  Geocoder gc = new Geocoder(this, Locale.getDefault());  try {    List&lt;Address&gt; addresses = gc.getFromLocation(latitude,                                                  longitude, 1);    StringBuilder sb = new StringBuilder();    if (addresses.size() &gt; 0) {      Address address = addresses.get(0);      for (int i = 0; i &lt; address.getMaxAddressLineIndex(); i++)        sb.append(address.getAddressLine(i)).append(""\n"");        sb.append(address.getLocality()).append(""\n"");        sb.append(address.getPostalCode()).append(""\n"");        sb.append(address.getCountryName());    }    addressString = sb.toString();  } catch (IOException e) {}} else {  latLongString = ""No location found"";}}class MapOverlay extends com.google.android.maps.Overlay{  @Override  public boolean draw(Canvas canvas, MapView mapView,   boolean shadow, long when)   {      super.draw(canvas, mapView, shadow);                         //---translate the GeoPoint to screen pixels---      Point screenPts = new Point();      mapView.getProjection().toPixels(p, screenPts);      //---add the marker---      Bitmap bmp = BitmapFactory.decodeResource(          getResources(), R.drawable.marker);                  canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);               return true; }  }}</code></pre>","358438","","358438","","2010-08-20 11:08:32","2012-05-29 22:39:29","Nullpointer Exception","<java><android><nullpointerexception>","2","3","","",""
"3530182","1","3530322","","2010-08-20 10:52:40","1","4679","<p>Looks like there's a plenty of questions about centering, same size etc, but so far I didn't find the exactly my case so I dare to ask :)</p><p>What I need is a layout of three buttons like this:</p><pre><code>[ previous ][*select*] [  next  ]</code></pre><p>where <strong>[previous]</strong> and <strong>[next]</strong> buttons are of the <strong>same</strong> size (i.e. in this case, size of the <strong>[previous]</strong> button as it is bigger), and the <strong>[*select*]</strong> button should stretch to occupy all of the available width.</p><p>Following the hints of making two buttons in LinearLayout same sized, i came up with the following xml file:</p><pre><code>&lt;LinearLayout    android:id=""@+id/button_bar""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:orientation=""horizontal"" &gt;    &lt;Button        android:layout_width=""0dip""        android:layout_height=""fill_parent""        android:layout_weight=""1""        android:text=""Previous"" /&gt;    &lt;Button        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_weight=""2""        android:text=""Select"" /&gt;    &lt;Button        android:layout_width=""0dip""        android:layout_height=""fill_parent""        android:layout_weight=""1""        android:text=""Next"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>This <em>almost</em> works :)Except one thing: instead of making <strong>Next</strong> button to match the size of <strong>Previous</strong> button, android makes <strong>Previous</strong> button to be the size of the <strong>Next</strong> :)And because of this the text ""Previous"" gets wrapped in two lines, like </p><pre><code>Previous</code></pre><p>Dunno if this is a bug or not, but can you advice me a workaround or some another way to achive the desired layout?</p><p>Thank you!</p>","258848","","","","","2010-08-20 12:04:46","LinearLayout text wrap problem when having two buttons of same size plus one stretched in the center","<android><layout><android-linearlayout>","4","3","","",""
"3530320","1","3530332","","2010-08-20 11:13:33","10","12222","<p>I am working on an application based on Galaxy S at the moment. I know that Galaxy S is 480 px wide and 800 px tall, but how much is that in DP?</p><p>Lets say if I want to have two Layout side by side, I'll have them setting to 240 px. But how do I know what value I should use in DP unit?</p>","271736","","","","","2010-08-20 12:11:05","How to tell screen resolution in ""DP""?","<android>","1","0","2","",""
"3530328","1","3530366","","2010-08-20 11:15:20","39","9418","<p>So, I have an imageview that should display an arbitrary image, a profile picture downloaded from the internet. I want this the ImageView to scale its image to fit inside the height of the parent container, and a set max width of 60dip. However, if the image is tall ratio-wise, and doesn't need the full 60dip of width, the ImageView's width should decrease so the view's background fits snugly around the image.</p><p>I tried this, </p><pre><code>&lt;ImageView android:id=""@+id/menu_profile_picture""    android:layout_width=""wrap_content""    android:maxWidth=""60dip""    android:layout_height=""fill_parent""    android:layout_marginLeft=""2dip""    android:padding=""4dip""    android:scaleType=""centerInside""    android:background=""@drawable/menubar_button""    android:layout_centerVertical=""true""/&gt;</code></pre><p>but that made the ImageView super large for some reason, maybe it used the intrinsic width of the image and wrap_content to set it - anyway, it didn't respect my maxWidth attribute.. Does that only work inside some types of containers? It's in a LinearLayout...</p><p>Any suggestions?</p>","378158","","","","","2010-08-20 11:23:19","Android imageview not respecting maxWidth?","<android><scaling><imageview>","1","0","9","",""
"3530421","1","","","2010-08-20 11:32:26","4","3707","<p>I've started to write a small app for android. It looks very nice, but there is one thing I don't understand.</p><p>I've created a new intent in the activity A and I've added a serialized vector <code>intent.putExtra(""key"", vector)</code>. On the called activity B I'm doing this: <code>Vector&lt;ItemModel&gt; items = (Vector&lt;ItemModel&gt;) getIntent().getExtras().getSerializable(""key"")</code>. This line causes a <code>ClassCastException</code>. Does anyone know why? Please help me :-)</p><p>Here is the source of the two activities and of the <code>ItemModel</code>:</p><p>ItemModel:</p><pre><code>public class ItemModel implements java.io.Serializable {    private static final long serialVersionUID = -1772392719565658730L;    public int id;    public String name;    public String quantity;    public int status;}</code></pre><p>ShoppingListActivity (A):</p><pre><code>   public void onClickItems(final View v){        final Intent intent = new Intent(this,ItemListActivity.class);        Vector&lt;ItemModel&gt; v1 = new Vector&lt;ItemModel&gt;();        ItemModel item = new ItemModel();        item.name = ""Tomaten"";        item.quantity = ""400g"";        item.id = 12;        item.status = 0;        v1.add(item);        item = new ItemModel();        item.name = ""Bohnen"";        item.quantity = ""150g"";        item.id = 13;        item.status = 0;        v1.add(item);        item = new ItemModel();        item.name = ""Schokolade"";        item.quantity = ""5 Tafeln"";        item.id = 17;        item.status = 0;        v1.add(item);        intent.putExtra(""ShoppingList"", v1);        startActivity(intent);</code></pre><p>ItemListActivity (B):</p><pre><code>   public class ItemListActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.item);        ListView list = (ListView) findViewById(R.id.ITEMSLIST);        final Bundle extras = getIntent().getExtras();        Vector&lt;ItemModel&gt; items = (Vector&lt;ItemModel&gt;) extras.getSerializable(""ShoppingList"");        ArrayList&lt;HashMap&lt;String, Object&gt;&gt; itemsList = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();        HashMap&lt;String, Object&gt; itemMap = new HashMap&lt;String, Object&gt;();}</code></pre>","426264","","105224","","2010-08-20 11:41:28","2010-08-20 14:25:41","How to put a Vector into an intent.extra?","<java><android><serialization><android-intent>","3","1","1","",""
"3530721","1","3530786","","2010-08-20 12:15:10","1","1178","<p>I would like to make a single Android app for multiple Android versions (possibly every one of them)My problem is that I want to check what is the version of Android the app is currently running on, and dynamically load a class which is version dependent. This part should be ok.</p><p>I just wonder how I can achieve that without compilation errors in my Eclipse project. I mean, the project is configured for a particular target (1.5, 2.1 ...), so if a class in my project is not compatible wich the selected target, it will result in errors.</p><p>Is there a way to export this classes even if they are not fit for the platform (I thought about a separated lib, but then again : how to compile theses classes into a lib without compilation pbs?) ? This should be ok since they won't be loaded until I ask them to after having checked Android version.</p><p>Thanks! </p>","426325","","","","","2010-08-20 12:23:58","Dynamic class loading to target multiple Android versions","<android><classloader><multitargeting>","2","0","2","",""
"3530739","1","","","2010-08-20 12:17:40","1","843","<p>I've got the following code which plots a marker at the specified x/y screen co-ordinates. like so...</p><pre><code>            public boolean draw(Canvas canvas, MapView mapView,     boolean shadow, long when)     {        super.draw(canvas, mapView, shadow);                           //---translate the GeoPoint to screen pixels---        Point screenPts = new Point();        mapView.getProjection().toPixels(p, screenPts);        //---add the marker---        Bitmap bmp = BitmapFactory.decodeResource(            getResources(), R.drawable.marker);                    canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);          System.out.println(""X: "" + screenPts.x + ""Y: "" + screenPts.y);        return true;    }</code></pre><p>But is there anything in the API or known methods for plotting points based on a lat/lng?</p>","358438","","358438","","2010-08-20 14:44:37","2010-08-20 14:44:37","Google maps, plotting markers based on a lat / lng value","<java><android><google-maps>","1","0","","",""
"3530780","1","3530912","","2010-08-20 12:23:16","28","29742","<p>I need  a PDF library for manipulating  a  PDF documents, (creating PDF, image convertinng to PDF) and  things like that but in Android.</p><p>I tried the android itext port but the library project generates compile errors after I added it to my Project. Looks like it is still using some affinetransformation classes that are defined in AWT.</p>","365860","","359307","","2012-01-18 19:51:46","2014-02-03 20:11:21","Android : Is there any free PDF library for Android","<android><pdf><mupdf>","4","4","9","2012-04-14 13:55:17",""
"3530901","1","3530968","","2010-08-20 12:41:59","1","914","<p>How to put file in sdcard using command line I tried by using adb push command but its not working my file is in D:/sample.ogg I had written</p><pre><code>         adb push sample.ogg/sdcard/sample.ogg </code></pre><p>It's not working. Any help would be appreciated</p><p>Thanks</p>","426344","","20402","","2010-08-20 12:43:54","2010-08-20 13:01:11","android sdcard question","<android>","1","0","","",""
"3530907","1","3634091","","2010-08-20 12:42:44","1","343","<p>I have subclassed View and do some bitmap drawing inside of the onDraw method. This view is then placed in a horizontal scrollview. Some of the time the bitmaps will not be visible since they are scrolled off screen. To improve performance I would like to avoid drawing anything when the object will not be visible.</p><p>So the question is, how do I determine that my bitmap will be drawn offscreen so I can just return without drawing?</p>","128800","","","","","2010-09-03 08:25:22","How can I determine if I will draw offscreen when doing custom bitmap blitting in a view inside a scrollview in Android","<android><image><canvas><scrollview><blit>","1","0","1","",""
"3530945","1","","","2010-08-20 12:47:50","1","634","<p>How to put on pause? I have not found such a function. There are other ways?</p>","413881","","413881","","2010-08-20 13:12:14","2011-02-07 13:12:18","Record audio in Android","<android>","1","0","1","",""
"3530953","1","3531189","","2010-08-20 12:49:31","1","1353","<p>I am developing an app in android, which basically visits a given url and downloads an image.</p><p>Now i want to populate this downloaded image and show it in thumbnail view.</p><p>I have tried out displaying the same from SD Card, but when i am doing the same for downloaded files, it doesn't seems to work.</p><pre><code>public View getView(int position,View convertView,ViewGroup parent)                {    System.gc();    ImageView i = new ImageView(mContext.getApplicationContext());      if (convertView == null)        {            //imagecursor.moveToPosition(position);            //int id = imagecursor.getInt(image_column_index);            //i.setImageURI(Uri.withAppendedPath(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, """"+ id));            i.setImageBitmap(bitmap);            i.setScaleType(ImageView.ScaleType.FIT_CENTER);            i.setLayoutParams(new GridView.LayoutParams(100, 100));      }      else      {         i = (ImageView) convertView;    }    return i;  }</code></pre>","419685","","105224","","2010-08-20 12:51:59","2010-08-20 13:22:53","Thumbnail view in Android","<android>","1","2","","",""
"3531047","1","","","2010-08-20 13:04:27","2","593","<p>I have a weirb bug that is pissing me off.I have an app that is pretty much only a webview with some extra functionalities, one of them is a Custom Loading Dialog (Extended from the progress dialog) that I show on the onPageStarted call, and dismiss on the onPageFinished call. The problem is, if I do that (show the dialog), the virtual keyboard will only show if the user touch TWO times on a form text box (Html or Javascript Text box on the Webview).</p><ul><li>I've tried manually giving focus to the webview, before and after the GUI update by the handler that dismisses the Dialog.</li><li>Redrawing the WebView</li><li>Not showing the dialog (this works, but I need the dialog)</li></ul><p>Anyone have an idea on how to fix that?</p><p>Thanks!</p>","367342","","","","","2010-08-20 13:04:27","Progress Dialog causing Virtual Keyboard to not show on WebView","<android><android-webview><virtual-keyboard><customdialog>","0","1","1","",""
"3531128","1","4885365","","2010-08-20 13:15:39","5","2657","<p>Two part question:</p><p>I have setup my website to use Facebook Connect for logging in. In the restricted area, I check if there is a cookie set with the name, ""fbs_"" under my domain name. However, I do not understand how this cookie gets set under my domain name. Does anyone know what happens with FB.Init call in this regard? (I have not used cross domain HTML file in my implementation).</p><p>Secondly, I am interested in implementing an Android setup that uses this web setup for data. Because these cookies look to be setup by the Javascript, I am not able to access these login cookies (fbs_ under mydomain.com) when I try with Cookie Manager. Is there a way I can implement this? Does WebKit help me in this regard?</p><p>Thank you for your time and responses.</p>","395192","","","","","2012-10-17 16:33:48","How does Facebook set Cookies with FB Init call in ""Facebook Connect"" setup?","<java><javascript><android><cookies><facebook>","1","1","2","",""
"3531140","1","3531520","","2010-08-20 13:16:49","1","192","<p>While testing on Android 1.6 using a G1 I have noticed that when I slide out the keyboard it kills the activity and recreates it even though I have set my activity to only display in portrait mode.</p><p>Same happens when I push the keyboard back in.</p><p>I get onSaveInstance, onDestroy called, then onCreate, onResume, OnrestoreInstance...</p><p>I understand why this is done when the display is being switched to landscape view but why does this happen when I specifically dont want my activity to switch view, its essentially killing and restarting the activity for no reason.</p><p>Is it the same on 2.x devices?</p><p>Is there something I'm missing to stop it happening?</p><p>Can anyone explain if there is any point to it?</p>","243999","","","","","2010-08-20 13:55:33","Android - Slider devices cause Activities to reset","<android><activity><slider><device><reset>","1","0","","",""
"3531141","1","3531466","","2010-08-20 13:17:14","1","154","<p>HelloIn my application i am displaying rows dynamically.I am using the below code so as to focus the clicked row even if the user press back key.But the issue is like if the row is not focussed we need two clicka to navigate.First to make it focussable and then next click to navigate.I need all at once any suggestions.</p><pre><code>@Overridepublic void onClick(View v) {    // TODO Auto-generated method stub    for(int a=0;a&gt;16;a++)    {        tr[a].setBackgroundColor(Color.BLACK);    }    flag=v.getId();    if(v.getId()==1)    {           Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }    if(v.getId()==3)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }    if(v.getId()==5)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }    if(v.getId()==7)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }    if(v.getId()==100)    {        Intent i = new Intent(TableImageLayout.this, TableImageLayout3.class);        startActivity(i);    }   }@Overridepublic void onFocusChange(View v, boolean hasFocus) {    // TODO Auto-generated method stub    for(int a=0;a&gt;16;a++)    {        tr[a].setBackgroundColor(Color.BLACK);    }        if(hasFocus)    {        ((TableRow)v).setBackgroundColor(Color.rgb(255, 180, 40));    }    else        {((TableRow)v).setBackgroundColor(Color.BLACK);}}    protected void onResume() {         super.onResume();        for(int a=0;a&gt;16;a++)        {            tr[a].setBackgroundColor(Color.BLACK);        }        tr[flag].requestFocus();        tr[flag].setFocusableInTouchMode(true);        tr[flag].setOnFocusChangeListener(new OnFocusChangeListener() {            @Override            public void onFocusChange(View v, boolean hasFocus) {                // TODO Auto-generated method stub                if(hasFocus)                {                    ((TableRow)v).setBackgroundColor(Color.rgb(255, 180, 40));                }                else                    {((TableRow)v).setBackgroundColor(Color.BLACK);}            }        });    }     @Override        public void onPause() {          super.onPause();      }   </code></pre><p>Please let me know your valuable suggestions.Thanks in advance.</p>","420261","","","","","2010-08-20 13:50:52","Click issue in android","<android>","1","0","","",""
"3531348","1","","","2010-08-20 13:39:25","2","512","<p>I'm an Android total-noob but in the last few weeks I've installed the JDK/Eclipse/Android SDK on 2 PC's.   Both installs took a day of tweaking and dealing with configuration problems and getting the different parts to play together, and generally were a PITA!   On one PC I'm STILL dealing with random, sporadic instances of the <em>""<strong>HelloAndroid] emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!</strong>""</em>  problem that has been discussed here and on the Android Google group!   No one seems to know for sure what causes it.</p><p>ALSO in the last few weeks I've installed Visual Studio 2010 on the same PC's to do my regular work as a Windows sw developer.   On both PC's all I had to do was pop in the DVD, type in the product code, come back a few hours later and start coding!! </p><p>So my question is whether there is a commercial (i.e., $$) sw development environment for Android that installs and runs as easily as VS 2010 so I can focus my time on actual sw development and not on fighting with the development system.    Thanks in advance.</p>","424690","","","","","2011-09-26 09:19:40","Commercial IDE+Emulator for Android?","<android>","2","0","1","",""
"3531378","1","","","2010-08-20 13:42:42","1","1041","<p>I'm developing a bluetooth server over Android. The client I want to be connected has established a COD (Class of Device) filter, in order I don't catch the connection unless I have a concrete COD. </p><p>Are there any way for establishing the COD of the Bluetooth adapter?</p><p>Thanks in advance.</p>","365610","","","","","2011-01-06 16:36:56","Set COD on Android bluetooth server","<android><bluetooth>","1","0","","",""
"3531398","1","3761744","","2010-08-20 13:44:33","5","724","<p>I want to use FastScroll for my history list and use dates for sections, but alert dialog (that shows letters in contacts) does not stretch to fit text's size (i want to show there month and day).</p><p>How can I resize it?</p>","238123","","","","","2012-12-05 19:53:37","Resize FastScroll alert dialog","<android>","2","1","0","",""
"3531401","1","","","2010-08-20 13:44:55","3","5698","<p>I am using gridview for display group of image from xml using xml parsing now i want to display the border around each image in gridview.all image should display outline border on image in gridview .how to set boder for each image in gridview </p>","410757","","15177","","2011-11-02 10:05:45","2011-11-02 10:05:45","gridview image border","<android><android-gridview>","3","0","","",""
"3531408","1","3534041","","2010-08-20 13:45:36","1","3381","<p>In my Application, I need to convert Image to Base64 format.Could anyone please let me know how can I do that?</p><p>Please forward your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","2964945","","2014-01-17 12:42:49","2014-01-17 12:43:39","Convert png or jpg image to Base64 string in Android","<android>","3","0","1","",""
"3531423","1","3531965","","2010-08-20 13:46:50","2","3435","<p>I'm really confused about this, but when I'm trigging a thread from my SurfaceView, im sending a Handler with the constructor like this</p><pre><code>private static Thread thread;public SurfaceView(Context localContext) {      //other stuff      thread = new Thread(mySurfaceHolder, myEngine, this, new Handler());      //other stuff}</code></pre><p>and in my thread-class I assign a Handler-object with the handler I sent from my view, like this:</p><pre><code>    public Thread (SurfaceHolder lHolder,    Engine lEngine,    View lView,    Handler lHandler){    surfaceHolder = lHolder;    engine = lEngine;    view = lView;    handler = lHandler;}</code></pre><p>So what does this Handler do? I never use it in my thread-class in any ways, so why are the examples on the web still showing me that I should send a handler with the constructor?I can't see the connection....</p><p>Thanks in advance!</p>","386562","","","","","2010-08-20 14:54:24","What does Handler do when running a thread?","<java><android>","3","0","1","",""
"3531586","1","","","2010-08-20 14:04:02","4","2894","<p>I want to parse an xml file using xpath in android, any idea how to do that??</p><p>I hope you get the point. Thank you ;)</p>","426418","","11339","","2010-08-20 14:11:19","2011-02-09 02:06:16","Parsing XMl in Android using Xpath","<android><xml><parsing><xpath>","3","3","","",""
"3531801","1","","","2010-08-20 14:25:55","11","8882","<p>Is there a way to enable or disable tethering (USB or wifi) on an android phone programmatically? Perhaps an API in android SDK or NDK or any even non-UI command to do that.</p><p>Thanks in advance.</p>","426440","","","","","2013-05-02 09:13:00","Enable/Disable USB or Wifi tethering programmatically on android","<android>","2","1","1","",""
"3531885","1","","","2010-08-20 14:37:17","2","1418","<p>I need to create a layout with a title bar on the top and a list view with n sections. Thelist header of every section has got two distinct Buttons that must be clickable and focusable independently from each other. This is the code of the layout:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;    &lt;include layout=""@layout/title_bar"" /&gt;    &lt;ListView android:id=""@android:id/list""       android:layout_width=""fill_parent""      android:layout_height=""0dip""       android:layout_weight=""1.0""       /&gt;&lt;/LinearLayout&gt;</code></pre><p>I tried this two solutions but I've found issues that I am not able to solve in both:</p><p>1) Using a sectioned adapter (source code can be found <a href=""http://github.com/commonsguy/cw-advandroid/tree/master/ListView/Sections/"" rel=""nofollow"">here</a>). It works fine without the title bar but with the title bar the default focus algorithm doesn't work any more.<br />2) Using an ExpandableListAdapter (in this case obviously the ListView in the layout becomes an ExpandableListView). It works fine but if I press the dpad center button on group layout both buttons are clicked.  I did not find a way to solve this.</p><p>Anyone can help?</p><p>Thanks very much!</p>","389262","","","","","2011-10-06 09:16:56","Sectioned ListView and ExpandableListView","<android><listview><expandablelistview>","1","2","1","",""
"3531940","1","3532043","","2010-08-20 14:43:03","17","7889","<p>I thought that I should use NetworkInterface::getDisplayName. I got some name, but this name is different that this name which I can see, when I choosing to which network I want to connect.</p><p>Please help..</p><p><strong>[EDIT]</strong></p><p>acording to Loxley answer:</p><pre><code>WifiManager wifiMgr = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);WifiInfo wifiInfo = wifiMgr.getConnectionInfo();String name = wifiInfo.getSSID();</code></pre>","338581","","338581","","2010-08-20 15:49:59","2013-04-12 16:25:34","How to get name of wifi-network out of android using android API?","<android><wifi><android-wifi>","2","2","7","",""
"3531964","1","3567459","","2010-08-20 14:45:12","4","3978","<p>I've been following this tutorial: <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a>but in <code>onTap</code> mContext is throwing a NullPointerException.. anyone know why? Here's my code.. </p><pre><code>    public class Mapitems extends ItemizedOverlay{Context mContext;private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();public Mapitems(Drawable defaultMarker) {      super(boundCenterBottom(defaultMarker));    }public Mapitems(Drawable defaultMarker, Context context) {      super(defaultMarker);      mContext = context;    }@Overrideprotected OverlayItem createItem(int i) {    return mOverlays.get(i);}public void addOverlay(OverlayItem overlay) {    mOverlays.add(overlay);    populate();}@Overrideprotected boolean onTap(int index) {  OverlayItem item = mOverlays.get(index);  AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);  dialog.setTitle(item.getTitle());  dialog.setMessage(item.getSnippet());  dialog.show();  return true;}@Overridepublic int size() {    return mOverlays.size(); }  }</code></pre><p>//edit: I'm still having problems with this. Bounty is for anyone who can give me an explanation as to why I'm getting this sort of error and how would I correct it?</p><p>//edit2: It seems past answer allows me to click the item but doesnt show its icon in the mapview.. anyone know why??</p>","358438","","358438","","2010-08-26 00:25:16","2010-10-28 02:22:39","Context null Pointer","<java><android><google-maps>","4","0","1","",""
"3532150","1","3532257","","2010-08-20 15:04:57","4","2009","<p>I have a single Android application that houses a suite of applications. I want each application to install with its own launcher icon, so I have a few activities with the same intent filter.</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;&lt;/intent-filter&gt;</code></pre><p>It works just fine if I close out of an application using the back button. Each launcher icon starts a different activity. However, if I simply send the application into the background using the home button and then try to start a different activity, the one I put into the background is brought to the foreground instead of the correct activity starting. </p><p>Can I make the multiple icons work or do I need to create a central activity as a way to start all the sub-applications?</p>","370556","","","","","2010-08-20 15:15:35","Android application suite with multiple launcher icons does resumes to same activity no matter which was selected","<android>","1","0","","",""
"3532397","1","3532466","","2010-08-20 15:32:09","21","43073","<p>In Java I would do something like:</p><pre><code>java.awt.GraphicsEnvironment ge =                       java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();Font[] fonts = ge.getAllFonts(); </code></pre><p>is there an Android equivalent? </p>","426493","","829571","","2013-06-18 18:49:31","2013-06-18 18:49:31","How to retrieve a list of available/installed fonts in android?","<java><android><fonts>","3","0","4","",""
"3532615","1","","","2010-08-20 15:59:15","5","1809","<p>I want to compile this program for Android and see it run on my phone:</p><pre><code>#include ""Hello World.h""using namespace codewerks;//=============================================// Main Loop//=============================================int main(int argc, char* argv[]){        Print(std::string(""Hello World!""));}</code></pre><p>Where do I start?  Can I compile this with GCC?  The NDK seems focused on Java.  Thank you.</p>","426514","","86860","","2010-08-20 16:01:33","2012-01-31 08:01:34","Pure C++ program compiled for Android","<android><android-ndk>","2","4","3","",""
"3532687","1","3560964","","2010-08-20 16:06:07","3","988","<p>I have a widget layout as follow :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/widget""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@drawable/widget_bg""&gt;&lt;TextView android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:id=""@+id/widgetText"" android:text=""@string/sWaitingForLocation"" android:layout_marginLeft=""4dip"" android:layout_marginRight=""4dip"" android:layout_marginTop=""4dip"" android:layout_marginBottom=""4dip"" android:textStyle=""bold"" android:gravity=""center""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>But the text doest appear, like it's hidden behind the background.</p><p>My background is a 9patch png.It does work if I use android:background=""android:color/black"" ...Can it be my png ? (created using android tool draw9patch)</p>","417766","","","","","2010-09-06 13:30:17","android:background hides my text ","<android><widget><nine-patch>","3","0","","",""
"3532742","1","","","2010-08-20 16:14:16","5","3609","<p>I'm caching image files as a blob in a SQLite database.  I have a similar application on another platform that does the same thing with the same image files.  The databases on both platforms report the exact same size for the same images.  So I think, but can't guarantee, that the image data is getting into the database intact.</p><p>But when I try to create a Drawable, the console prints out ""DEBUG/skia(267): --- decoder->decode returned false"".</p><p>The steps are:</p><ol><li><p>Read the blob into a byte array.</p><p>byte[] b = new byte[imageDataCursor.getInt(0)];</p><p>b = imageDataCursor.getBlob(1);</p></li><li><p>Create an InputStream from the byte array.</p><p>ByteArrayInputStream is = new ByteArrayInputStream(b);</p></li><li><p>Create a Drawable from the InputStream. (this is what creates the 'decoder' message above)</p><p>Drawable drw = Drawable.createFromStream(is, ""articleImage"");</p></li><li><p>Set the ImageView.image to the Drawable.</p><p>imgView.setImageDrawable(drw);</p></li></ol><p>So far, no joy.  Any suggestions?</p>","346166","","346166","","2010-08-20 16:34:47","2011-12-12 01:52:40","Problem creating a Drawable from a SQLite Blob","<android>","2","0","1","",""
"3532816","1","3533636","","2010-08-20 16:22:19","1","211","<p>the Canvas class does not take Shape as a parameter for any of its methods.  There is no drawShape or clipShape, etc...  So, I need to use Path instead.  Does android sdk expose any way to convert Shape to Path or Path to shape?  I haven't been able to find relationship any between the 2 classes...?</p><p>Thank you</p>","426493","","","","","2010-08-20 18:10:44","does android sdk give any convenience methods for converting Shape to Path?","<java><android>","1","0","","",""
"3533042","1","3533071","","2010-08-20 16:52:22","1","350","<p>In my app I want to obtain a gps lock and record the coords. But I do not want to lock the device into looking for the gps. The user is to be free to traverse through the app and the different activities within.</p><p>So If I call a locationListener in activity A, can I reference it in activities B C and D?</p><p>if is was still in activity A I could say something like </p><pre><code>A.this.mlocListener.removeMyUpdates();</code></pre><p>When I am in activity B how can I reference the LocationListener I set up in Activity A</p><p>Thanks in advance</p><p>Kevin</p>","409826","","","","","2010-08-20 16:55:11","Android Communicate with a Location Manager started from another activity","<java><android><class><object><locationlistener>","1","0","","",""
"3533234","1","3534616","","2010-08-20 17:15:12","2","3334","<p>I am trying to check if there is a specific column in my database when onUpgrade() gets called. Is there an easy way to check like</p><pre><code>if(database does not have specific column){db.execSQL(""ALTER TABLE table"" + "" ADD COLUMN column"" );}</code></pre><p>I saw some other answer, <a href=""http://stackoverflow.com/questions/2675388/detect-if-a-table-contains-a-column-in-android-sqlite"">Pragma Table</a>, but I don't know how to use it or even what it really is for.</p>","394093","","","","","2010-08-20 20:25:50","Check for specific column in Android SQLite database","<android><database><sqlite>","2","0","1","",""
"3533265","1","","","2010-08-20 17:18:06","2","2932","<p>I would like to know how to get a pre-saved image from the gallery and then display it onto the screen. Any tutorials/helpful links and info would be appreciated. If there is anything you would like me to explain more, please ask.</p>","399004","","101258","","2010-08-20 20:35:36","2011-06-23 04:43:56","How to get images from gallery and display them to the screen in android sdk","<android><image><sdk><get>","1","0","1","",""
"3533327","1","","","2010-08-20 17:27:28","1","2343","<p>I'm trying to code a preferences widget to set a value with a SeekBar. This includes a Title, Summary, Seekbar and a TextView to show current value. All of them but Title should be shown in a second row (as standard preferences).</p><p>I can't make it work. I first tried with a RelativeLayout but BELOW, etc. rules where not applied.Then I'm trying with Linear Layout + TableLayout but Seekbar doesn't catch minimumWidth and remains small.</p><p>image <a href=""http://i.stack.imgur.com/laYVk.png"" rel=""nofollow"">here</a></p><p>All this is done through code. Here it is</p><pre><code> LinearLayout layoutv = new LinearLayout(getContext());    layoutv.setOrientation(LinearLayout.VERTICAL);    //Title    LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(            LinearLayout.LayoutParams.WRAP_CONTENT,            LinearLayout.LayoutParams.WRAP_CONTENT);    TextView view = new TextView(getContext());    view.setId(VIEW_ID_TITLE);    view.setText(getTitle());    view.setTextSize(21);    view.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);    view.setTextColor(Color.WHITE);    view.setLayoutParams(params1);    layoutv.addView(view);    //TAble Layout to show all the information    TableLayout layout = new TableLayout(getContext());    TableLayout.LayoutParams params0 = new TableLayout.LayoutParams(            TableLayout.LayoutParams.FILL_PARENT,            TableLayout.LayoutParams.WRAP_CONTENT);    layout.setLayoutParams(params0);    layout.setShrinkAllColumns(true);    //Row    TableRow tr = new TableRow(getContext());    //Summary    TextView summary = new TextView(getContext());    summary.setId(VIEW_ID_SUMMARY);    summary.setText(getSummary());    summary.setTextSize(14);    summary.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);    tr.addView(summary);    //SeekBar    SeekBar bar = new SeekBar(getContext());    bar.setId(VIEW_ID_BAR);    bar.setMax(maximum);    bar.setProgress((int)this.oldValue);    bar.setMinimumWidth(80);    bar.setOnSeekBarChangeListener(this);    tr.addView(bar);    //Monitor Box    this.monitorBox = new TextView(getContext());    this.monitorBox.setId(VIEW_ID_MONITOR);    this.monitorBox.setTextSize(12);    this.monitorBox.setTypeface(Typeface.MONOSPACE, Typeface.ITALIC);    this.monitorBox.setPadding(2, 5, 0, 0);    this.monitorBox.setText(Float.toString((float) bar.getProgress()/10.0f));    tr.addView(this.monitorBox);           layout.addView(tr);   layoutv.setPadding(15, 5, 10, 5);    layoutv.addView(layout);   layoutv.setId(android.R.id.widget_frame);   return layoutv;</code></pre><p>Many thanks</p>","426593","","426593","","2010-08-20 17:36:53","2010-08-20 23:10:48","Seekbar width in a custom preference","<android><seekbar>","1","2","","",""
"3533370","1","","","2010-08-20 17:34:21","11","23915","<p>I am using startActivity to call another Activity and I get the ""Activity Not Found Exception"".  Here is my code:</p><pre><code>  TextView textView = (TextView) itemClicked;  String strText = textView.getText().toString();  String key = ""symptom"";  Intent mIntent = new Intent(symptomActivity.this, symptomRemedyActivity.class);  Bundle mBundle = new Bundle();  mBundle.putString(key, strText);  mIntent.putExtras(mBundle);  startActivity(mIntent);</code></pre><p>Here is the Logcat output:</p><pre><code>INFO/ActivityManager(59): Displayed activity com.android.homeopathy/.HomeopathyActivity: 5542 ms (total 39089 ms)INFO/ARMAssembler(59): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x3283e0:0x3284ec] in 627000 nsINFO/ActivityManager(59): Starting activity: Intent { cmp=com.android.homeopathy/.symptomActivity }INFO/ActivityManager(59): Displayed activity com.android.homeopathy/.symptomActivity: 2706 ms (total 2706 ms)INFO/ActivityManager(59): Starting activity: Intent { cmp=com.android.homeopathy/.symptomRemedyActivity (has extras) }</code></pre><p>Here is the debug window output:</p><pre><code>    Thread [&lt;1&gt; main] (Suspended (exception ActivityNotFoundException)) Instrumentation.checkStartActivityResult(int, Object) line: 1404    Instrumentation.execStartActivity(Context, IBinder, IBinder, Activity, Intent, int) line: 1378  symptomActivity(Activity).startActivityForResult(Intent, int) line: 2817    symptomActivity(Activity).startActivity(Intent) line: 2923  symptomActivity$1.onItemClick(AdapterView, View, int, long) line: 67    ListView(AdapterView).performItemClick(View, int, long) line: 284   ListView.performItemClick(View, int, long) line: 3382   AbsListView$PerformClick.run() line: 1696   ViewRoot(Handler).handleCallback(Message) line: 587 ViewRoot(Handler).dispatchMessage(Message) line: 92 Looper.loop() line: 123 ActivityThread.main(String[]) line: 4627    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 868  ZygoteInit.main(String[]) line: 626 NativeStart.main(String[]) line: not available [native method]  </code></pre><p>symptomRemedyActivity is another activity in my project.  Is there something I need to do like importing symptomRemedyActivity so that startActivity can see symptomRemedyActivity, to remove this ""Activity Not Found Exception""?</p>","148635","","148635","","2010-08-20 18:06:06","2013-08-13 16:51:37","Android - Activity Not Found Exception","<android>","8","4","2","",""
"3533490","1","","","2010-08-20 17:51:14","4","732","<p>I'm trying to use an Mp3 on the SDCard as a ringtone.</p><p>I'm basing my code off various snippets/tutorials online, but none seem to be working.</p><p>I'm running FroYo. This is my code:</p><pre><code>    Uri uri = MediaStore.Audio.Media.getContentUriForPath(file.getAbsolutePath());    ContentValues values = new ContentValues();    values.put(MediaStore.MediaColumns.TITLE, ""Title"");    values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/mp3"");    values.put(MediaStore.MediaColumns.DATA, file.getAbsolutePath());    values.put(MediaStore.Audio.Media.DATA, file.getAbsolutePath());    values.put(MediaStore.Audio.Media.ARTIST, ""Artist"");    values.put(MediaStore.Audio.Media.IS_RINGTONE, true);    values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);    values.put(MediaStore.Audio.Media.IS_ALARM, true);    values.put(MediaStore.Audio.Media.IS_MUSIC, false);    Uri newUri = getContentResolver().insert(uri, values);</code></pre><p>This is the error I get</p><pre><code>08-20 18:48:39.878: ERROR/Database(31570): Error inserting album_id=-1 title=Title is_notification=true title_key=%R%&lt;%R%B%4% mime_type=audio/mp3 date_added=1282326519 _display_name=sb_ringtone_2.mp3 is_alarm=true is_ringtone=true artist_id=31 is_music=false _data=/mnt/sdcard/sb_ringtone_2.mp308-20 18:48:39.878: ERROR/Database(31570): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed08-20 18:48:39.878: ERROR/Database(31570):     at android.database.sqlite.SQLiteStatement.native_execute(Native Method)08-20 18:48:39.878: ERROR/Database(31570):     at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:55)08-20 18:48:39.878: ERROR/Database(31570):     at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1549)08-20 18:48:39.878: ERROR/Database(31570):     at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1410)08-20 18:48:39.878: ERROR/Database(31570):     at com.android.providers.media.MediaProvider.insertInternal(MediaProvider.java:1813)08-20 18:48:39.878: ERROR/Database(31570):     at com.android.providers.media.MediaProvider.insert(MediaProvider.java:1638)08-20 18:48:39.878: ERROR/Database(31570):     at android.content.ContentProvider$Transport.insert(ContentProvider.java:174)08-20 18:48:39.878: ERROR/Database(31570):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:146)08-20 18:48:39.878: ERROR/Database(31570):     at android.os.Binder.execTransact(Binder.java:288)08-20 18:48:39.878: ERROR/Database(31570):     at dalvik.system.NativeStart.run(Native Method)</code></pre><p>When I use newUri with the RingtoneManager, no exception is raised, but I get this error when the ringtone is 'played' (ie, somebody rings)</p><pre><code>08-20 18:49:28.318: ERROR/MediaPlayerService(26167): Couldn't open fd for content://settings/system/notification_sound08-20 18:49:28.318: ERROR/MediaPlayer(26174): Unable to to create media player08-20 18:49:28.318: WARN/NotificationService(26174): error loading sound for content://settings/system/notification_sound08-20 18:49:28.318: WARN/NotificationService(26174): java.io.IOException: setDataSource failed.: status=0x8000000008-20 18:49:28.318: WARN/NotificationService(26174):     at android.media.MediaPlayer.setDataSource(Native Method)08-20 18:49:28.318: WARN/NotificationService(26174):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:716)08-20 18:49:28.318: WARN/NotificationService(26174):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:671)08-20 18:49:28.318: WARN/NotificationService(26174):     at com.android.server.NotificationPlayer$CreationAndCompletionThread.run(NotificationPlayer.java:88)</code></pre><p>Any help would be greatly appreciated :)</p>","310455","","","","","2010-08-20 17:51:14","Adding MP3 to ContentProvider","<android>","0","0","1","",""
"3533507","1","3533615","","2010-08-20 17:53:06","6","3435","<p>I want to be able to tell if a view is visible in my listview, which is populated by a custom CursorAdapter. How can I do this?</p>","413414","","","","","2013-03-04 11:00:49","How to determine if a view is visible in a ListView?","<android><listview>","2","0","2","",""
"3533508","1","3533553","","2010-08-20 17:53:16","0","513","<p>I got the code below how do I pass the current object ""this"" into the event handler so that I can pass it to the object Foo:</p><pre><code>btn.setOnClickListener(new View.OnClickListener(this) {public void onClick(View view) {   new Foo(this).AlertBox(""Hello Lennie!"");}});</code></pre><p>Where ""this"" is: android.app.Activity</p><p>i get an error that it can't find the constructor:</p>","188674","","185722","","2010-08-20 17:58:37","2010-08-20 17:58:37","Pass this object into event handler","<java><android>","1","0","","",""
"3533599","1","3533612","","2010-08-20 18:06:11","0","741","<p>What is a more efficient methods for drawing circles on a canvas. </p><p>I can do it two ways:</p><ol><li>Use <code>canvas.drawcircle(...)</code></li><li><code>ShapeDrawable.SetBounds()</code> followed by <code>ShapeDrawable.draw(canvas)</code></li></ol><p>What renders faster? What's better practice? Or does it not matter?</p>","425962","","935779","","2013-03-31 06:15:20","2013-03-31 06:15:20","Canvas.DrawCircle VS ShapeDrawable.setBounds()","<android><drawable><shape>","1","0","","",""
"3533602","1","","","2010-08-20 18:06:16","1","1770","<p>I have developed a widget that has certain functionality, but some people have asked me to create a similar widget but with a slight different functionality. Both widgets will look the same but behave slightly different. I tried adding a different receiver for the second widget to my manifest file. I also created a separate widget provider xml file and I have a separate class that implements the AppWidgetProvider with the different functionality. Yet, when I add the second widget to home page, it seems to be using the functionality of the first widget, and not the new functionality.</p><p>Here is some of the code:</p><p>I have to separate classes that extend the AppWidgetProvider (one for each widget). The class names are iContacts and iContactsQuickDial.</p><p>The difference between this two classes is the OnReceive method which implements the different logic. The other methods are exactly the same.</p><p>Manifest receivers:</p><pre><code>    &lt;receiver android:name="".iContacts"" android:label=""@string/app_name""&gt;       &lt;intent-filter&gt;              &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;              &lt;action android:name=""android.appwidget.action.CONFIGURATION_CHANGED"" /&gt;              &lt;action android:name=""com.mesa.icontacts.ConfigureContacsActivity.ACTION_UPDATE_WIDGET"" /&gt;                &lt;action android:name=""com.mesa.icontacts.iContacts.ACTION_WIDGET_SHOW_CONTACT_1"" /&gt;                &lt;action android:name=""com.mesa.icontacts.iContacts.ACTION_WIDGET_SHOW_CONTACT_2"" /&gt;                &lt;action android:name=""com.mesa.icontacts.iContacts.ACTION_WIDGET_SHOW_CONTACT_3"" /&gt;                &lt;action android:name=""com.mesa.icontacts.iContacts.ACTION_WIDGET_SHOW_CONTACT_4"" /&gt;            &lt;/intent-filter&gt;            &lt;meta-data android:name=""android.appwidget.provider""                 android:resource=""@xml/icontacts_widget_provider"" /&gt;        &lt;/receiver&gt;        &lt;receiver android:name="".iContactsQuickDial""                  android:label=""@string/app_name_quick_dial""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;                &lt;action android:name=""android.appwidget.action.CONFIGURATION_CHANGED"" /&gt;                &lt;action android:name=""com.mesa.icontacts.ConfigureContacsActivity.ACTION_UPDATE_WIDGET"" /&gt;                &lt;action android:name=""com.mesa.icontacts.iContacts.ACTION_WIDGET_SHOW_CONTACT_1"" /&gt;                &lt;action android:name=""com.mesa.icontacts.iContacts.ACTION_WIDGET_SHOW_CONTACT_2"" /&gt;                &lt;action android:name=""com.mesa.icontacts.iContacts.ACTION_WIDGET_SHOW_CONTACT_3"" /&gt;                &lt;action android:name=""com.mesa.icontacts.iContacts.ACTION_WIDGET_SHOW_CONTACT_4"" /&gt;            &lt;/intent-filter&gt;            &lt;meta-data android:name=""android.appwidget.provider""                 android:resource=""@xml/icontacts_quick_dial_widget_provider"" /&gt;        &lt;/receiver&gt;</code></pre><p>Both widgets use the same configuration activity since this logic doesn't change.</p><p>Both providers:icontacts_widget_provider:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""   android:minWidth=""300dip""   android:minHeight=""75dip""   android:initialLayout=""@layout/main""/&gt;</code></pre><p>icontacts_quick_dial_widget_provider</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""   android:minWidth=""300dip""   android:minHeight=""75dip""   android:initialLayout=""@layout/main""/&gt;</code></pre><p>Note that the layout is the same for both since both widgets must look the same</p><p>Any ideas would be appreciated?</p><p>Thank you</p>","318525","","101258","","2010-08-20 20:32:03","2010-08-20 20:32:03","How to add multiple widgets to one application?","<android><widget>","0","3","1","",""
"3533623","1","","","2010-08-20 18:09:19","0","383","<p>I'm wrestling with the Android UI to try to create a table layout that has two rows with two buttons in each row. I want the buttons to each take up 50% of the space in the row. However, no matter what I set the layout_width and layout_height to, I always get two skinny buttons in each row.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""   android:orientation=""horizontal""  android:id=""@+id/tablelayout"" &gt;&lt;TableRow&gt;&lt;Button      android:id=""@+id/btn_one""     android:tag=""1""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:text=""""/&gt;&lt;Button      android:id=""@+id/btn_two""     android:tag=""2""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:text=""""     android:padding=""0px""/&gt;&lt;/TableRow&gt;&lt;TableRow&gt;&lt;Button      android:id=""@+id/btn_three""     android:tag=""3""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:text=""""/&gt;&lt;Button      android:id=""@+id/btn_four""     android:tag=""4""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:text=""""/&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre>","108495","","","","","2010-08-20 18:10:17","Table Layout baffle","<android><tablelayout>","1","0","","",""
"3533693","1","","","2010-08-20 18:17:32","1","169","<p>When emulator is running is safe mode, my application is not visible to user but On HTC-G1 run in safe mode , its visible to the user. How can I keep the app invisible on device also while its runing in safe mode.</p>","426632","","","","","2010-08-20 20:55:05","While in Safe-Mode user should not have any access to application","<android>","1","0","","",""
"3533737","1","3534059","","2010-08-20 18:23:55","0","651","<p>I hava a MapView and I define a Rect. Touching the map I compare the coordinates to detect whether the rect is touched or not. But it does not work</p><pre><code>RectF hitTestRecr = new RectF();hitTestRecr.set(0,100,0,100);hitTestRecr.offset(0,0);if (hitTestRecr.contains(event.getX(),event.getY())) {    Toast.makeText(getBaseContext(), ""hit"", Toast.LENGTH_SHORT).show(); }else{    Toast.makeText(getBaseContext(), ""no hit"", Toast.LENGTH_SHORT).show(); }</code></pre><p>I always get no hit</p><p>any ideas?</p>","401025","","","","","2010-08-20 19:08:03","Hit testing on a MapView, Android","<android><android-mapview><hittest>","1","0","","",""
"3533833","1","3535138","","2010-08-20 18:38:03","0","6887","<p>I'm just getting started with Android app development on a Mac, and I keep getting a NullPointerException everytime I go into Strings.xml to edit it.</p><p>Here's the steps I followed -</p><ul><li>Downloaded eclipse 3.5</li><li>Installed the Android SDK</li><li>Downloaded SDKs from Android SDK manager.</li><li>Created a basic Hello World Project.</li></ul><p>The project compiles and runs fine, but if I add even a single character to Strings.xml, a popup comes up that says -</p><p>""An error has occured. Please see the log for details.<br />An error has occured. Please see the log for details.""</p><p>When I click details, all I see is - ""An error has occurred. See error log for more details.java.lang.NullPointerException""</p><p>Anything I'm missing completely?</p>","116858","","","","","2013-12-22 14:54:14","NullPointerException while working with Android development in Eclipse","<android><eclipse><nullpointerexception>","6","0","","",""
"3533837","1","3535700","","2010-08-20 18:38:20","7","19888","<p>I'm having a crack at using the MediaPlayer object and not having much success.  If I add a sound asset to my raw folder and call it using the int value within R, it works fine.  But I want to be able to pull things off of url.</p><p>According to all of the documentation I've read setDataSource() should accept a string param with a url to a file.</p><p>I keep getting an IO exception on the prepare() statement.  I've even tried copying the file locally and still no dice.</p><p>Anyone have any ideas?</p><pre><code>MediaPlayer mp = new MediaPlayer();try {        mp.setDataSource(""http://www.urltofile.com/file.mp3"");        mp.prepare();        mp.start();    } catch (IllegalArgumentException e) {        e.printStackTrace();    } catch (IllegalStateException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }</code></pre>","233971","","","","","2012-04-05 12:28:26","MediaPlayer.setDataSource() and prepare() not working - android","<android><media-player><prepare>","2","0","5","",""
"3533894","1","3734524","","2010-08-20 18:45:53","1","2514","<p>I'm using XStream to serialize some objects to XML, and am facing a problem with Enums. The exception I get when I try to serialize the object: ""ObjectAccessException: invalid final field java.lang.Enum.name"".</p><p>Apparently, this is a problem with the reflection API implementation in android: It doesn't treat final fields correctly. This problem actually existed in past implementations of the official Sun (Oracle) JDK. </p><p>Can you confirm/refute this is the problem with Android? Can you suggest any other serialization API that could be used in this situation? </p>","114919","","114919","","2010-08-20 20:57:29","2011-03-26 00:25:05","Serialization problem with Enums at Android","<android><enums><xstream>","3","0","1","",""
"3533947","1","3712501","","2010-08-20 18:52:01","3","1055","<p>I'm watching the 2010 Google I/O video on this topic and I have a few questions to make sure I understand properly.</p><p><a href=""http://www.youtube.com/watch?v=xHXn3Kg2IQE"" rel=""nofollow"">Google I/O 2010 - Android REST client applications</a></p><p>Please note I also have a very limited understanding of CursorAdapters</p><p>Right now my application just has a UI layer.  I've created an object called DbAdapter using some Google tutorials to create a small database and a table in that database.</p><p>I've created a class I'm calling DataBroker (extending ContentProvider) to manage retrieving data from the database and calling web services to update data.</p><p>Scenarios: </p><p>1) Suppose I want to display a list of items in my ListActivity.  Am I correct in assuming I will write a function in my DataBroker that creates a Cursor to the table in my database that holds those items, fire up a service which launches a thread which calls a web service to get additional items, then return the Cursor to my UI thread?  Doing this would likely return the Cursor to my UI thread before the web service finished, but, I'm assuming, once the CursorAdapter has a Cursor, it will automatically show any changes made to that database table, yes?</p><p>2) Now I have a list of items in my ListView.  Suppose I give the user some functionality to delete an item.  The user executes this functionality.  It should call a function in my DataBroker which updates the row in my database corresponding to that item, setting the status column to STATE_DELETING (which will remove the row from the ListView because the Cursor has a clause excluding this state), then fire off a service that fires a thread that hits my web service, then deletes the row in the database when finished?</p><p>Also, suppose I have multiple Activities, am I looking at having a static Cursor for each Activity with a list, grabbing that Cursor in the Activity's onCreate, and if that Cursor is null, hitting my DataBroker?</p>","406790","","406790","","2010-08-20 20:14:53","2010-09-14 20:10:50","Database and web service models","<android><database><web-services><model><cursor>","1","2","1","",""
"3534051","1","","","2010-08-20 19:06:55","0","1381","<p>I´m writing an application for Android in which I have a character that I must dress with multiple items, such as clothes, hairs, hats, earrings, etc. and on one side of the screen I need to have a container with many items inside that are available for use.</p><p>My problem is that I haven´t found any object that lets me do this simple task in android, I need it to be scrollable, and resizeable so I can place it on the right of the screen, the objects i need to add are Imageviews.</p><p>I accomplished this on iPhone with a UIScrollView but it seems that it't not that simple with Android.</p><p>Thank you.</p>","364974","","","","","2011-02-10 14:16:07","Scrolling multiple images in android","<android><scroll><imageview>","1","0","","",""
"3534390","1","3534582","","2010-08-20 19:51:57","1","797","<p>I have three images in my drawable folder, and an XML Image Button code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;\&lt;item android:state_pressed=""true""android:drawable=""@drawable/happycarrot"" /&gt; &lt;!-- pressed --&gt;&lt;item android:state_focused=""true"" android:drawable=""@drawable/largerunicornbutton2"" /&gt; &lt;!-- focused --&gt;&lt;item android:drawable=""@drawable/largerunicornbutton"" /&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p>In my layout folder, I have my main XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ImageViewandroid:src=""@drawable/button""android:layout_height=""fill_parent""android:layout_width=""fill_parent""&gt;&lt;/ImageView&gt;&lt;TextView  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/hello""/&gt;&lt;/LinearLayout&gt;</code></pre><p>When I run it in the emualtor I only get the first image. It doesn't do anything else. What do I do?</p>","394842","","","","","2013-05-06 21:45:17","Android - Image button (XML) isn't working?","<android><eclipse><button><emulator><imageview>","1","0","","",""
"3534452","1","4059290","","2010-08-20 20:01:11","2","2754","<p>When I set the background to my surfaceview, I see what I set as the background. However, I cannot draw simple things like circles when I lock/unlock the surfaceview's canvas. All I see is the background image.</p><p>Is there something I'm missing?</p><p>Any thoughts?</p>","425962","","","","","2010-10-30 15:14:25","SurfaceView.setbackground() dominates my canvas","<android><surfaceview>","1","0","","",""
"3534518","1","3534608","","2010-08-20 20:11:49","4","2477","<p>I want to detect blowing into the mic on android. Google wasn't much help. Is it possible?</p>","310385","","","","","2011-06-06 07:26:38","Android--Mic input levels?","<android>","1","0","2","",""
"3534575","1","","","2010-08-20 20:19:23","1","311","<p>I have a problem:</p><ol><li><p>I have a UI thread which displays webwiew and another chatActivity which displays chat.</p></li><li><p>I keep on getting data from server which would be displayed on both Activities.</p></li><li><p>What is the best way to do this viz doInBackground or Service, </p></li><li><p>If service, than can i bind 2 activity with 1 service i.e. if user press logout from UI or chatActivity, both activity and service should die otherwise service sud update both activity contents.</p></li></ol><p>I am new to 'service' so any reference or sample code wud b helpful.Thank you for your consideration :)</p>","385190","","385190","","2010-08-20 21:16:05","2010-08-20 21:16:05","Android: How to communicate between 2 activies","<android><service><activity><chat><webview>","1","0","","",""
"3534642","1","3534813","","2010-08-20 20:28:55","11","3263","<p>Suppose I initialize an AffineTransform as below:</p><p>AffineTransform af = new AffineTransform(2, 3, 4, 5, 6, 7);</p><p>How would I create an equivalent Matrix using android's sdk?</p>","426493","","","","","2013-10-02 10:06:07","How to map java's AffineTransform to android's Matrix?","<java><android>","3","0","4","",""
"3534734","1","","","2010-08-20 20:39:51","6","11999","<p>I have a layout that has just a ScrollView visible. It has a relative layout as its child. This layout has several other layouts (mainly text views) as its children. When the text is not big enough, the scroll view does not expand itself to fit the whole screen. Instead, it shows a gap at the bottom where the background shows. I tried setting <code>fillViewPort=true</code> on the ScrollView, but that just made the first child layout (RL1) to fill the screen.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/background_image""&gt;   &lt;ProgressBar android:id=""@+id/progressBar""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center""        android:visibility=""gone""/&gt;    &lt;ScrollView      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:fillViewPort=""true""      android:scrollbars=""none""&gt;    &lt;RelativeLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:paddingTop=""10px""&gt;      &lt;RelativeLayout android:id=""@+id/list""          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:paddingTop=""10px""&gt;        &lt;!-- This layout is filling the screen if I set fillViewPort=""true"" --&gt;        &lt;RelativeLayout  android:id=""@+id/RL1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;            &lt;!--TextViews and ImageViews --&gt;       &lt;/RelativeLayout&gt;        &lt;RelativeLayout android:id=""@+id/RL2""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;            &lt;!--TextViews and ImageViews --&gt;        &lt;/RelativeLayout&gt;        &lt;RelativeLayout android:id=""@+id/RL3""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content"" &gt;            &lt;!--TextViews and ImageViews --&gt;        &lt;/RelativeLayout&gt;        &lt;RelativeLayout  android:id=""@+id/RL4""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;            &lt;!--TextViews and ImageViews --&gt;        &lt;/RelativeLayout&gt;     &lt;/RelativeLayout&gt;   &lt;/RelativeLayout&gt;  &lt;/ScrollView&gt;&lt;/FrameLayout&gt;</code></pre>","426749","","426749","","2010-08-20 20:47:39","2011-02-17 23:39:55","How to make ScrollView with a RelativeLayout with multiple child layouts fill the screen?","<android><layout><scrollview>","1","0","2","",""
"3534843","1","3534963","","2010-08-20 20:55:34","1","1310","<p>When trying to start up my Android AVD emulator, I get the following error message in eclipse</p><pre><code>Failed to start emulator: Cannot run program ""/home/james/development/tools/android//tools/emulator"": java.io.IOException: error=2, No such file or directory</code></pre><p>However, the file is clearly there as displayed below</p><pre><code>james@nevada:~/development/tools/android/tools$ pwd/home/james/development/tools/android/toolsjames@nevada:~/development/tools/android/tools$ ls -ltotal 9504-rwxrwxrwx 1 james james  341773 2010-05-07 19:47 adb-rwxrwxrwx 1 james james    3636 2010-05-07 19:47 android-rwxrwxrwx 1 james james    2382 2010-05-07 19:47 apkbuilder-rwxrwxrwx 1 james james    3265 2010-05-07 19:47 ddms-rwxrwxrwx 1 james james   89032 2010-05-07 19:47 dmtracedump-rwxrwxrwx 1 james james    1940 2010-05-07 19:47 draw9patch-rwxrwxrwx 1 james james 6886136 2010-05-07 19:47 emulator-rwxrwxrwx 1 james james  478199 2010-05-07 19:47 etc1tool-rwxrwxrwx 1 james james    1987 2010-05-07 19:47 hierarchyviewer-rwxrwxrwx 1 james james   23044 2010-05-07 19:47 hprof-conv-rwxrwxrwx 1 james james    1939 2010-05-07 19:47 layoutoptdrwxrwxr-x 4 james james    4096 2010-05-07 19:48 lib-rwxrwxrwx 1 james james   16550 2010-05-07 19:47 mksdcard-rw-rw-r-- 1 james james  205851 2010-05-07 19:48 NOTICE.txt-rw-rw-rw- 1 james james      33 2010-05-07 19:47 source.properties-rwxrwxrwx 1 james james 1447936 2010-05-07 19:47 sqlite3-rwxrwxrwx 1 james james    3044 2010-05-07 19:47 traceview-rwxrwxrwx 1 james james  187965 2010-05-07 19:47 zipalign</code></pre><p>Any ideas why I may be getting this error? I was able to run my AVD yesterday, the only thing I have done since then is to restart the box (VirtualBox)</p>","155695","","","","","2010-08-20 21:18:25","Why does my eclipse fail to start android virtual device, when the files are there?","<android><eclipse>","1","0","","",""
"3534916","1","5386629","","2010-08-20 21:06:53","1","790","<p>I'm struggling with some issues which I believer are memory related with my Android app, yet I can't seem to figure out how to get information on how much memory my app is using.</p><p>I have a suspicion that some textures I am loading are not getting cleared by the garbage collector, but I want to be able to test before I start blindly making changes.</p><p>I've been struggling with DDMS for hours, and while I can get it to connect, I can't make heads or tails of the output.  The allocations only seems be showing me basic object allocations, whereas what I'm concerned about is what's going on with memory using by things like my openGL textures and audio files.</p><p>Any advice on profiling memory usage in openGL apps on Android would be much appreciated, thanks!</p>","170286","","349130","","2010-08-20 21:08:38","2011-03-22 03:59:07","Android OpenGL memory usage profiling?","<android><memory><opengl-es><ddms>","1","2","","",""
"3534980","1","5602977","","2010-08-20 21:22:46","1","745","<p>I have been looking at the gesture builder demo for the android and it works great: provided that you have and SD card.  I'm trying to adjust it so that it will write to the internal storage instead of the SD card.</p><p>So far it has been pretty simple, </p><pre><code>if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)){    _sStoreFile = new File(Environment.getExternalStorageDirectory(), _fileName);}else{    _sStoreFile = new File(Environment.getDataDirectory(), _fileName);}</code></pre><p>However, it doesn't want to save any of the gestures that I have created.  I know this is pretty sparse information and I'm willing to post more details based on questions and comments.</p><p>Does anyone have suggestions on what to examine to find out why gestures are not being saved?</p>","69983","","","","","2011-04-09 04:58:17","with android gesture builder can i save to data directory","<android><gesture-recognition>","2","0","","",""
"3535052","1","3535133","","2010-08-20 21:35:00","3","1398","<p>im pretty new at Ant and have been looking for alot of examples. I am pretty far now, and was successfull to get a build.xml going. Though i seem to have one thing missing. My application needs a custom Reference Library i am calling that is a jar file. But i dont know how to add it one. Any Tips, reference sites or examples you guys have, i would really appreciate it. Thank you</p>","423305","","","","","2010-08-20 21:54:10","Android Build Application with Ant","<android><ant>","2","0","1","",""
"3535074","1","3535129","","2010-08-20 21:39:57","40","16081","<p>So, I'm watching this video <a href=""http://www.youtube.com/watch?v=N6YdwzAvwOA"">http://www.youtube.com/watch?v=N6YdwzAvwOA</a> and Romain Guy is showing how to make more efficient UI adapter code using the <code>getView()</code> method. Does this apply to CursorAdapters as well? I'm currently using <code>bindView()</code> and <code>newView()</code> for my custom cursor adapters. Should I be using getView instead?</p>","413414","","413414","","2010-08-20 22:51:22","2012-07-16 14:52:38","GetView Vs. BindView in a custom CursorAdapter?","<android><user-interface><adapter>","2","0","22","",""
"3535079","1","3535115","","2010-08-20 21:40:53","8","3047","<p>I have noticed in the android gesture examples, that it reads the gestures from the res/raw folder.  it would be a great thing for my application to include a 'getting started' list of gestures.  that way a user can use the app without having to train it for their own personal gestures.  i would even expect that the majority of users would be happy to use a default set of gestures.</p><p>however, i cannot figure out how to generate that initial set of gestures that i would include in the res/raw folder of my application.</p><p>anyone have ideas of how to create this file or where to look for more info?</p>","69983","","","","","2010-08-20 21:48:53","how to create a raw file of android gestures","<android><gestures>","1","1","","",""
"3535118","1","7572689","","2010-08-20 21:49:25","1","965","<p>I have read a lot of stuff about launching Google Maps in Android.</p><p>That's pretty easy:</p><pre><code> Uri uri = Uri.parse(""geo:38.899533,-77.036476"");Intent it = new Intent(Intent.ACTION_VIEW, uri);startActivity(it);</code></pre><p>The problem is that the map is shown at a high zoom level and there is no marker on the map.So, if the user move a little bit or something happen, the point is lost.</p><p>Is that possible to add a marker like this:</p><p><a href=""http://img.skitch.com/20100820-da3n4r7h5xbsu6bsx4p4ujjghc.jpg"" rel=""nofollow"">http://img.skitch.com/20100820-da3n4r7h5xbsu6bsx4p4ujjghc.jpg</a></p><p>or like this:</p><p><a href=""http://img.skitch.com/20100820-qg7k2m5wtwm3j5phphrgc8tb53.jpg"" rel=""nofollow"">http://img.skitch.com/20100820-qg7k2m5wtwm3j5phphrgc8tb53.jpg</a></p><p>So i can be sure that even if the user move the map, he will be able to find this place again.</p><p>Thank a lot for any help.</p>","327402","","","","","2011-09-27 16:42:46","Launching Google Maps with more parameters","<android><google-maps><maps><marker>","2","0","","",""
"3535164","1","","","2010-08-20 21:57:47","5","3610","<p>I want to change the font in my widget such that it uses a specific font in ""assets"" folder of my app.</p><p>I usually do this in my app to change the font:</p><pre><code>        Typeface tf= Typeface.createFromAsset(getAssets(), ""advertising.ttf"");        TextView converted = (TextView)findViewById(R.id.TextView03);        converted.setTypeFace(tf);</code></pre><p>and it works like a charm.</p><p>How can I do this in widgets? I can only set the text and change the color:</p><pre><code>      remoteView.setTextViewText(R.id.TextView03,""some text"" );    remoteView.setTextColor(R.id.TextView03, Color.BLACK);</code></pre><p>but I don't see a way to set the font. Any help please?</p>","403733","","403733","","2010-08-21 06:42:43","2012-04-05 09:25:24","How to change the font in Android widgets to user-defined fonts in ""assets"" folder of the app?","<android><fonts><widget>","2","0","3","",""
"3535230","1","3535560","","2010-08-20 22:09:56","1","526","<p>i am using a listprefernce in my app and when a user makes a selection I would like to check it for errors, but when i set an onclicklistener it starts when i select the listpreference, not when i make my selection. is there a way to make it check the selection right after they make it?</p>","274365","","","","","2010-08-20 23:35:37","android preferences","<android><preferences>","1","0","","",""
"3535293","1","","","2010-08-20 22:26:58","0","643","<p>I have a Horizontal Gallery in the bottom of the activity , My problem is that gallery detect swipe action from the whole layout not just when you on it , from any point in the screen you can drag it, how can i stop that ??</p>","419979","","","","","2010-08-20 22:26:58","Gallery swipe in android","<android>","0","3","","",""
"3535338","1","3535940","","2010-08-20 22:39:44","9","2710","<p>I can't sell my applications on Android-Market because my country is not supported for merchants.Is there any other market-place which let you to use paypal or is there any way to get around this problem ?</p><p>Edit:Question was not clear , edited to avoid missunderstanding.</p>","426815","","426815","","2010-08-20 23:08:45","2013-03-04 21:04:38","How can I sell my Android apps in a country that doesn't officially supported for merchants by Android-Market?","<android><google-play>","2","0","1","",""
"3535634","1","","","2010-08-20 23:52:21","0","376","<p>I am working off the Android Notepad Tutorial as a base. The problem is that when someone creates a record with a null name field, it shows up as a blank space in the listview and is unclickable, and therefore undeletable from the list. </p><p>I would like to have the program check for a null ""name"" field and replace it with the string ""Unnamed Record"" so that it comes up appropriately in the listview. Everything that I have tried so far has not worked correctly.</p><p>Another possible solution might be the give the name field an initial value of ""Unnamed Record"" but I am not sure that this would be effective.</p><p>Thanks.</p>","415560","","","","","2011-04-28 15:21:20","Android: How to check if a DB field is blank and, if so, add a value like ""Unnamed Record""?","<android>","2","0","","",""
"3535690","1","","","2010-08-21 00:07:35","6","2869","<p>I was wondering if there is some opposite method of View.bringToFront()?When i call bringToFront() my whole screen get locked cause i have some problem with overriding the onMeasure() method(when i implement onMeasure, my custom View doesn't draw itself even it enters onDraw method) and my cutom View takes up the whole screen....</p><p>I badly need bringToFront() but I need to start some animation that lasts for 3 seconds and by calling bringToFront() user input doesn't work anymore.</p><p>Can I reset that bringToFront()?</p><p>Thx in advance for help</p>","240588","","","","","2012-02-21 13:18:36","Opposite of View.bringToFront() in Android","<android><user-interface>","2","2","1","",""
"3535728","1","3535922","","2010-08-21 00:26:04","3","4253","<p>How do I manually add a file to an Android APK package?</p>","440093","","","","","2014-03-17 20:25:26","Android: How to manually add a file to apk?","<android>","3","2","5","",""
"3535841","1","3536656","","2010-08-21 01:15:50","0","71","<p>I want to call a function the moment i realease my finger from a Gallery.Is there a way to accomplish that?</p>","348058","","","","","2010-08-21 06:45:45","Android Is there way to know when i am releasing my finger from a gallery widget?","<android>","1","0","","",""
"3535949","1","","","2010-08-21 02:00:21","2","12591","<p>I am trying to use <code>MediaController.MediaPlayerControl</code> in order to display a <code>MediaController</code> at the bottom of my Custom View but I can't get it to work. It's crashing at the <code>ctrl.show();</code> with the following Exception whenever I try to load this view:</p><blockquote>  <p>E/AndroidRuntime( 3007): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?</p></blockquote><p>here is my code.</p><pre><code>public class MediaPlayerView extends ImageView implements MediaPlayerControl {    private MediaPlayer mp;    private MediaController ctrl;    private Uri data;    private Context mContext;    public MediaPlayerView(Context context, Uri data) {        super(context);        this.mContext = context;        this.data = data;        init();    }    public void init() {        mp = new MediaPlayer();        try {            mp.setDataSource(mContext, data);            mp.prepare();        } catch(IOException e) {            e.printStackTrace();        }        ctrl = new MediaController(mContext);        ctrl.setMediaPlayer(this);        ctrl.setAnchorView(this);        ctrl.setEnabled(true);        ctrl.show();    }    public boolean canPause() {        return true;    }    public boolean canSeekBackward() {        return false;    }    public boolean canSeekForward() {        return false;    }    public int getBufferPercentage() {        return (mp.getCurrentPosition()*100)/mp.getDuration();    }    public int getCurrentPosition() {        return mp.getCurrentPosition();    }    public int getDuration() {        return mp.getDuration();    }    public boolean isPlaying() {        return mp.isPlaying();    }    public void pause() {        mp.pause();    }    public void seekTo(int pos) {        mp.seekTo(pos);    }    public void start() {        mp.start();    }}</code></pre><p>Any help greatly appreciated!</p>","358898","","512958","","2012-12-19 15:53:42","2012-12-19 15:53:42","How to use MediaController.MediaPlayerControl?","<android><android-widget>","2","2","1","",""
"3535955","1","3536398","","2010-08-21 02:02:38","2","322","<p>I'm designing a custom view which is an X/Y Plot. It's a moving graph that scrolls to the left with time and new Y values are continuously coming in at 10 per second. </p><p>I've been able to make it work with an array of integers where the array index is the X value and the integer value is the Y value, but this seems horribly inefficient (Because every time it comes time to re-paint, I have to loop 800+ times to paint the graph). Then we do it all again 10 times a second. yuck. </p><p>Can anybody think of a paintable object that I can draw points to and perform some kind of scroll transformation and then just draw the new points each time, rather than the whole canvas? </p><p>Any other ideas out there? </p><p>Thanks!</p>","268803","","","","","2010-08-21 05:02:56","Drawable object where I can store points for faster paint?","<android><arrays><canvas><drawing>","1","0","1","",""
"3535958","1","3536387","","2010-08-21 02:03:47","6","9734","<p>For the app that I'm making, I plan on having a main menu composed of 6 different icons, with 2 per line. This is very similar to the Twitter main menu layout seen here:<img src=""http://i.stack.imgur.com/QG4vE.png"" alt=""nothx""></p><p>So basically... how should I go about setting up the XML? LinearLayout, TableLayout? And then, what do I actually do to get the icons and text to be evenly spaced and such? I've tried everything I can think of so far and to no avail.</p>","205910","","157882","","2010-08-21 02:15:10","2013-10-21 09:30:08","How to setup a main menu layout in Android?","<java><android><xml><twitter>","1","2","4","",""
"3536047","1","","","2010-08-21 02:47:41","0","2697","<p>If I have 2 LinearLayouts split %50/%50 everything is fine.  Weights are 1 and 1.  As soon as I add a TextView inside the top LinearLayout, it stretches that layout.  I use ""wrap_content"" as the documentation says I should when it comes to weights. As you can see the red and green should be split evenly and text on grey background should be inside red box. Here is the code:</p><pre><code>&lt;LinearLayoutandroid:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:layout_weight=""1""android:background=""#ff0000""&gt; &lt;TextView android:text=""@string/hello"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:background=""#cccccc"" android:textColor=""#000000""/&gt;      &lt;/LinearLayout&gt;&lt;LinearLayoutandroid:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:layout_weight=""1""android:background=""#00ff00""&gt;&lt;/LinearLayout&gt;    </code></pre><p>Now if I switch to ""fill parent"" as follows it actually works but it creates another problem.  Here is the code (so far so good):</p><pre><code> &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""1""    android:background=""#ff0000""    &gt;     &lt;TextView     android:text=""@string/hello""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:background=""#cccccc""     android:textColor=""#000000""/&gt;          &lt;/LinearLayout&gt; &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""1""    android:background=""#00ff00""    &gt;    &lt;/LinearLayout&gt;</code></pre><p>So looking at above we were forced to use ""fill_parent"" and we would think like we fixed the problem but here is the problem if we are using ""fill_parent"" (I took out the textview just to show the problem, textview doesnt make the problem go away anyways):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt; &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""3""    android:background=""#ff0000""    &gt;    &lt;/LinearLayout&gt; &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""2""    android:background=""#00ff00""    &gt;    &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>As you can see I assign the weights 3 (top red) and 2 (bottom green) but what actually happens is they get flipped:  The red becomes 2 and bottom becomes 3.  Just measure the pixels too see.</p><p>Here are the results of the 3 codes:</p><p><a href=""http://imgur.com/iVt8g.jpg"" rel=""nofollow"">http://imgur.com/iVt8g.jpg</a></p><p>Anyone had some similar experiences? </p><p>NOTE:Just to be clear, every single time the layout was wrapped inside this (the top layout):</p><pre><code>android:layout_width=""fill_parent""android:layout_height=""fill_parent""</code></pre><p>with xml version=""1.0"" encoding=""utf-8"" and proper namespace.</p>","426900","","13531","","2011-09-12 22:28:12","2011-09-12 22:28:12","TextView inside LinearLayout stretches the LinearLayout and fill_parent fix causes weight flip","<android><textview><android-linearlayout><weight>","2","2","","",""
"3536165","1","3536535","","2010-08-21 03:30:18","7","9395","<p>is it possible to make an imageview link to a web page such that when user taps on the image, it takes them to a web page?</p>","408112","","244296","","2011-11-25 14:27:44","2014-02-27 09:17:47","How can ImageView link to web page?","<android>","3","0","2","",""
"3536296","1","3536317","","2010-08-21 04:14:00","0","2141","<p>I'm getting a no such column: _id  error. YES there is a column ""_id"" in my journals table.</p><p>I'm getting the error with this code:</p><pre> mDb.execSQL(""UPDATE ""+DATABASE_PLANTS_TABLE+"" SET ""+ KEY_PLANT_DAYS+             "" = (SELECT COUNT(*) FROM ""+DATABASE_PLANTS_TABLE+"" WHERE ""              +DATABASE_JOURNAL_TABLE+"".""+KEY_JROWID+"" = ""+DATABASE_PLANTS_TABLE +"".""                        +KEY_PLANT_HOMEID+"")"");</pre><p>The following code DOES work:</p><pre>mDb.execSQL(""UPDATE ""+DATABASE_JOURNAL_TABLE+"" SET ""+KEY_JOURNAL_PLANTS+                    "" = (SELECT COUNT(*) FROM ""+DATABASE_PLANTS_TABLE+"" WHERE ""                    +DATABASE_JOURNAL_TABLE+"".""+KEY_JROWID+"" = ""+DATABASE_PLANTS_TABLE +"".""                    +KEY_PLANT_HOMEID+"")"");</pre><p>LogCat:</p><pre>08-21 00:07:46.614: ERROR/Database(12943): Failure 1 (no such column: journals._id) on 0x421470 when preparing 'UPDATE plants SET days = (SELECT COUNT(*) FROM plants WHERE journals._id = plants.homeid)'.08-21 00:07:46.614: DEBUG/AndroidRuntime(12943): Shutting down VM08-21 00:07:46.614: WARN/dalvikvm(12943): threadid=3: thread exiting with uncaught exception (group=0x4001b390)08-21 00:07:46.614: ERROR/AndroidRuntime(12943): Uncaught handler: thread main exiting due to uncaught exception08-21 00:07:46.624: ERROR/AndroidRuntime(12943): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.growjournal.beta/com.grower.beta.plantsList}: android.database.sqlite.SQLiteException: no such column: journals._id: UPDATE plants SET days = (SELECT COUNT(*) FROM plants WHERE journals._id = plants.homeid)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at android.os.Handler.dispatchMessage(Handler.java:99)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at android.os.Looper.loop(Looper.java:123)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at android.app.ActivityThread.main(ActivityThread.java:4595)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at java.lang.reflect.Method.invokeNative(Native Method)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at java.lang.reflect.Method.invoke(Method.java:521)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at dalvik.system.NativeStart.main(Native Method)08-21 00:07:46.624: ERROR/AndroidRuntime(12943): Caused by: android.database.sqlite.SQLiteException: no such column: journals._id: UPDATE plants SET days = (SELECT COUNT(*) FROM plants WHERE journals._id = plants.homeid)08-21 00:07:46.624: ERROR/AndroidRuntime(12943):     at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)</pre>","393328","","","","","2010-08-21 04:23:57","no such column: _id SQLite error Android","<android><sqlite>","1","0","1","",""
"3536330","1","3536784","","2010-08-21 04:31:14","1","1854","<p>I'm new to Android and Java programming and I've manage to create a simple paint program, but how do I add a zoom feature? Right now I'm just extending the View class and using the ""onDraw()"" method.</p><p>Do I have to use a Drawable to be able to add zooming functionality? I'm not really understanding the differences between the two.</p><p>If I am way off base then please point me to a good tutorial on paint/zooming. </p>","426929","","263895","","2010-08-21 05:21:29","2010-08-21 07:45:18","How to create simple paint program with zoom","<android>","1","0","2","",""
"3536391","1","3539494","","2010-08-21 04:58:54","10","7290","<p>I'm trying to create a way to adjust volume settings for each of the different streams (media, notification, ringtone, etc) and have a way to preview the output sound level of each stream. I believe I have the correct implementation, but when I set the output stream type, there is no sound that plays.</p><p>Here is the code that correctly plays the user's selected alarm sound:</p><pre><code>Uri mediaUri=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);MediaPlayer mp=MediaPlayer.create(getApplicationContext(), mediaUri);//mp.setAudioStreamType(AudioManager.STREAM_ALARM);mp.start();`</code></pre><p>That commented out line is what is causing me problems. I would like to hear the alarm sound at the volume levels of the different audio streams, but when I include that line for STREAM_ALARM or any other audio stream, no sound at all plays. Any ideas what could be going on here?</p>","142464","","","","","2010-08-21 23:45:40","How to correctly set MediaPlayer audio stream type","<android><audio>","1","0","1","",""
"3536453","1","3536468","","2010-08-21 05:22:59","0","93","<p>When i create one apk from one machine and try to install into a device .it successfully get installed .But when i try to connect the same device to another machine and try to deploy same application from different machine.It doesnt allow me .I need to uninstall the application and then it works correctly .What is the issue for that .What i need to do to resolve this issue.</p><p>Thanks in advance.</p>","95877","","","","","2010-08-21 05:28:34","Android apk problem","<java><android>","1","0","","",""
"3536463","1","3536527","","2010-08-21 05:25:47","27","25920","<p>I am going to install first application in my android phone, but having some doubtsrelated to Android Memory (Maximum size of APK).</p><p>So please help me know and solve the problems:</p><ol><li>What is <strong>maximum size of the apk</strong> that can be supported by the android ?</li><li>When we install any apk file in real phone, <strong>where does application installed</strong> (in SD-card or other memory) ??</li></ol><p>I have referred this link: <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/7965885da4d1a03a"">http://groups.google.com/group/android-developers/browse_thread/thread/7965885da4d1a03a</a> and also searched lot.</p><p>I came Across the search on the web that <strong><code>many people are facing the same issue</code></strong> What is the maximum size of Application supported by Android. I think this question also help to the people who are connected with Android application programming and development.</p><p><strong><code>Update:</code></strong></p><p>This time i am having 58Mb application from that 52.5MB Images and it runs on the my HTC Hero mobile but On Emulator, it shows an error:</p><pre><code>Failed to upload my_application.apk on device 'emulator-5554'java.io.IOException: Unable to upload file: No space left on deviceLaunch canceled!</code></pre><p>Now please suggest me the way to store images inside the Drawable folder? is there any way to zip the images or such method?</p>","379693","","213269","","2010-11-10 11:55:32","2012-03-06 08:56:24","Android - Application (apk) Maximum size","<android><android-emulator><sd-card><apk><avd>","2","4","16","",""
"3536580","1","3536652","","2010-08-21 06:17:50","0","638","<p>So I have a broadcast receiver that needs to notify a service that it has received a text message. The only way to do this (as far as I know) is a static method. But the method that is notified need access to the application's preferences.</p><p>Every method I have tried says that it cannot be accessed from a static method. So how do I access preferences from a static method?</p>","420377","","","","","2010-08-21 06:44:21","How to access preferences in a static method","<android>","2","1","","",""
"3536590","1","3536606","","2010-08-21 06:20:48","1","14051","<p>I have a splash screen/loading screen that has .setVisibility() to GONE right after the draw call of my large bitmap is completed. The problem is the splash screen takes a bit to popup which i believe is due to the main activity booting up and doing CPU intensive applications on first run. Is there a way to get my splash screen displayed ASAP? Would it be ok if i had it in a different thread maybe? The splash screen is just a bitmap with a progressBar right below it. My layout is xml based so i cant see myself using setContentView. Thanks.</p>","385051","","379693","","2010-10-30 08:44:30","2013-12-30 10:45:37","android splash screen/ loading screen","<android><multithreading><splash-screen><android-2.1-eclair>","3","1","1","",""
"3536639","1","3549947","","2010-08-21 06:41:32","16","5023","<p>I currently have my app caching image files in the <code>cache</code> sub-directory for the application. The images are used in a <code>ListView</code> and stored in a <code>HashMap</code> of <code>SoftReferences</code> to <code>Bitmaps</code>.</p><p>So my question is this, what is the best way to cache these image files without inflating the space my application uses AND remains responsive from a user standpoint. </p><p>Things I am concerned about:</p><p>I know the user can clear the cache and that it is done automatically when space is low on internal memory, but I feel most users will see a several MB app and uninstall it. Also if the space is constantly low, my app will just keep downloading the images, making it appear slower.</p><p>Most devices have an SD card pre-installed, but what should I do when it is not inserted? The SD card may also be slower compared to internal storage, affecting my app's performance.</p><p>Should I include an option to choose the location of the cache?</p><p>Should I attempt to manage the size of my cache (be it in the /cache or /sdcard) or just forget about it?</p><p>Thank you for your time (its a long one I know) and please post any relevant experience.</p>","413575","","21234","","2011-01-12 12:04:09","2011-01-12 12:04:09","Best Practice when Caching files in Android","<android><image><caching><memory-management>","2","0","21","",""
"3536684","1","","","2010-08-21 06:52:51","1","157","<p>hi  i am gallery application   i am using  handler in rotating gallery images    protec</p><pre><code>ted void onStart() {        super.onStart();        isUpdateUI = true;        mRedrawHandler.handleMessage(new Message());    }     @Override    protected void onPause()    {        super.onPause();        isUpdateUI = false;    }    class RefreshHandler extends Handler {            @Override        public void handleMessage(Message msg) {                        SeaSpell.this.updateUI();        }        public void sleep(long delayMillis) {            this.removeMessages(0);                     if(isUpdateUI==true)                sendMessageDelayed(obtainMessage(0), delayMillis);}}public void updateUI(){     getImages();//this is gallery rotation method        mRedrawHandler.sleep(5000);}</code></pre><p>next activity gallery image clicking     g.setOnItemClickListener(new OnItemClickListener() {</p><pre><code>   public void onItemClick(AdapterView&lt;?&gt; parent, View v, final int position, long id)     {        timer.schedule(new TimerTask(){        public void run()        {        try {            isUpdateUI=false;} },5000)});</code></pre><p>click the gallery item or scrooling  then  handler will stop  in 5sec will be running  how can implemented  this topic critical one please  forward some solution  i am try to more days but not get any solution  please forward some suggestion</p>","254790","","","","","2010-08-21 06:52:51","one handler running in this time click the gallery handler will stop next 3 sec will run handler how can implemented","<android>","0","1","1","",""
"3536708","1","","","2010-08-21 07:02:25","2","2843","<p>I want to play mp4 video which is available in my assets/raw folder.I am successfully playing mp4 video from my sd card but not able to get video from assets folder or from raw folder.</p>","414954","","263521","","2010-08-21 09:36:35","2010-08-21 09:36:35","Wants to play mp4 video from assets folder in android","<android><mp4><assets>","1","1","2","",""
"3536714","1","","","2010-08-21 07:04:32","0","1474","<p>Invoked device native player to play audio file, it opens android native player on top of the application but when selecting to back out or return to the application, device automatically stops playing the current media.</p><p>Sample code:</p><pre><code>Intent intent = new Intent();intent.setAction(android.content.Intent.ACTION_VIEW);intent.setDataAndType(Uri.fromFile(file),""audio/*"");startActivity(intent);</code></pre><p>How can I implement so that Device should continue to play audio in the background when selecting to back out or return to the application</p><p>Thanks in Advance.</p>","426632","","29407","","2010-08-21 07:06:06","2013-06-06 06:39:15","Audio Native Player","<android>","2","0","","",""
"3536772","1","","","2010-08-21 07:26:56","0","634","<p>Hi guysi want to have some knowledge on porting android on linux devices. I am a web and android developer but now i want to port android on some hardware which you could suggest is easy for the beginners to start with. I don't feel like buying a mobile phone this time i want to make a mobile phone :)Please help me achieve this goal.</p><p>regardsAbhishek Talwar  </p>","426986","","","","","2011-05-07 19:53:52","Porting Android","<android><porting>","1","1","","",""
"3536786","1","3537075","","2010-08-21 07:32:04","3","2556","<p>In General, Android runs the each App as a seperate process in Dalvik Vm. I got this from the <a href=""http://developer.android.com/guide/basics/what-is-android.html"" rel=""nofollow"">Doc</a>. But i can not understand what is the main reason to go to Dalvik VM for Android. What are the Advantages it has than Java VM. Share your Knowledge. It helps.</p><p>Thanks in Advance.</p>","267269","","","","","2011-02-11 03:07:02","DalvikVM Vs JavaVM in Android?","<android><jvm><dalvik>","1","4","1","",""
"3536838","1","3536855","","2010-08-21 07:52:07","1","825","<p>I have a TableLayout defined in my xml with three columns and four rows plus a heading row.Each column contains a TextView.</p><pre><code>    &lt;TableLayout    android:id=""@+id/inventory""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:stretchColumns=""*""    &lt;TableRow&gt;        &lt;TextView            android:text=""Item""/&gt;        &lt;TextView            android:text=""Quantity""/&gt;        &lt;TextView            android:text=""Units""/&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/inventorycell10""        &lt;TextView            android:id=""@+id/inventorycell11""        &lt;TextView            android:id=""@+id/inventorycell12""    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/inventorycell20""        &lt;TextView            android:id=""@+id/inventorycell21""        &lt;TextView            android:id=""@+id/inventorycell22""    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/inventorycell30""        &lt;TextView            android:id=""@+id/inventorycell31""        &lt;TextView            android:id=""@+id/inventorycell32""    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/inventorycell40""        &lt;TextView            android:id=""@+id/inventorycell41""        &lt;TextView            android:id=""@+id/inventorycell42""    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>Is there any way of referring to the TextViews in code, without having to id them individually. I was thinking there might be come way of getting row/col views from the tableview.</p><p>-Frink</p>","131209","","","","","2013-11-11 15:29:41","How to refer to TableLayout cells in code","<android>","2","0","","",""
"3536875","1","","","2010-08-21 08:03:27","1","367","<p>I am facing the problem in licensing of my old published paid apps. Basically i have paid app which is published by version code 1. I implemented the license code on it, it working fine to me. Licensing server giving the response or allow that you can use it. But once i changed version code from 1 to 2 in manifest file, then licensing service not allow to use the app.Server giving the response dont allow. I not understanderd, y it has relation with version code? i can't publish the update version.???</p><p>Moreover, i am already login to my publisher account, i have setting of LICENSED in edit profile section. </p>","321027","","73488","","2010-10-04 02:18:23","2010-10-04 02:18:23","Facing licensing issue in already published paid app","<android><android-manifest>","1","2","","",""
"3536923","1","","","2010-08-21 08:23:35","0","393","<p>According to my application i create the database with two tables. when i inserting the data in 1 table then it runs correctly after that when i save data in the second table then it gives the exception of illegal state exception (database cannot be open). Please give me the solution.</p>","403007","","263521","","2010-08-21 08:39:28","2010-08-22 09:10:51","illegal state exception in android when inserting data in database","<android><database><exception>","1","1","0","",""
"3536928","1","3553599","","2010-08-21 08:26:52","3","2086","<p>I have multiple applications that share certain data through preferences. Each app sets its preferences through a PreferenceActitivity (from xml). Two questions:</p><p>How do I use/edit preferences created by one app in another app. If I figure out how to create MODE_WORLD_WRITEABLE preferences using PreferenceActivity that will solve the problem.</p><pre><code> SharedPreferences prefs = getSharedPreferences(          &lt;String referring to another package´s prefs&gt;, MODE_WORLD_WRITEABLE);        HashMap&lt;String, String&gt; map = (HashMap&lt;String, String&gt;) prefs          .getAll();        String str = map.toString();        tv.setText(str);</code></pre><p>Above code returns {}</p><ul><li>Second, how do I use addPreferencesFromIntent(i) -- I am getting a NullPointerException even though the intent is not Null.</li></ul><p>Thanks for the help in advance.</p><p>Best,Sameer</p>","356580","","567929","","2011-06-09 07:26:27","2011-06-09 07:26:27","Android PreferenceActivity to create a MODE_WORLD_WRITEABLE preference across applications","<android><preferences><preferenceactivity>","1","0","1","",""
"3537014","1","","","2010-08-21 08:56:51","0","2654","<pre><code>private class Task_xmlparse extends AsyncTask&lt;String, Void, Void&gt; {    private final ProgressDialog dialog = new ProgressDialog(BlackSheepimage.this);    protected void onPreExecute() {        this.dialog.setMessage(""Loading..."");        this.dialog.setCancelable(false);        this.dialog.show();    }    @Override    protected Void doInBackground(String... params)    {        try {            DomFeedParser dom = new DomFeedParser(url);            Log.v(""thread"","" ""+url);            List&lt;Message_thbnail&gt; l_obj_tnail = new ArrayList&lt;Message_thbnail&gt;();            List&lt;Message_zoom&gt; l_obj_zoom = new ArrayList&lt;Message_zoom&gt;();            l_obj_tnail = dom.parse_tnail();            l_obj_zoom = dom.parse_zoom();            VAL1 = new String[l_obj_tnail.size()];            VAL2= new String[l_obj_zoom.size()];            //Log.v(""bufersize"",""""+bufferarray.length);            //Log.v(""val2Length"",""""+VAL1.length);            Iterator&lt;Message_thbnail&gt; it_tnail = l_obj_tnail.iterator();            while (it_tnail.hasNext())            {                k++;                Log.v(""Zoo"",""""+zo);                VAL1[k] = it_tnail.next().toString();                bufferarray[zo]=VAL1[k];                Log.v(""Buffer"",bufferarray[zo]);                zo++;            }            Log.v(""threadbuffsize"",""""+zo);            Iterator&lt;Message_zoom&gt; it_zoom = l_obj_zoom.iterator();            Log.v(""zoosize"", """"+l_obj_zoom.size());            while (it_zoom.hasNext()) {                k1++;                Log.v(""Zoo1"",""""+zo1);                VAL2[k1] = it_zoom.next().toString();                zoombufferarray[zo1]=VAL2[k1];                zo1++;                Log.v(""tag"",VAL2[k1].toString());            }            thumbnail_disp=bufferarray;            grid= new GridAdapter(BlackSheepimage.this,bufferarray);        } catch (Exception e) {            //Log.v(""Image"", ""dom"" + e);        }        return null;    }protected void onPostExecute(Void result) {    lay2_gv.setAdapter(grid);    if (this.dialog.isShowing()) {        this.dialog.dismiss();    }}}public void onCreate(Bundle savedInstanceState){    url=""http://www.theblacksheeponline.com/partypics.php?page=""+pageno;    super.onCreate(savedInstanceState);    lay2_gv = (GridView) findViewById(R.id.jr_lookbook_grid);    new Task_xmlparse().execute(url);    tv = (TextView) findViewById(R.id.next_pg);  tv.setOnClickListener(this) ;    lay2_gv.setOnItemClickListener(this);}public void onClick(View arg0) {        pageno++;        Log.v(""pge"",""""+pageno);        lay2_gv.setVisibility(GridView.GONE);        url=""http://www.theblacksheeponline.com/partypics.php?page=""+pageno;        //Log.v(""URL"",url);         new Task_xmlparse().execute(url);}</code></pre>","410757","","180538","","2012-09-12 08:19:07","2012-09-12 08:19:07","Add dynamically images to a GridView in Android","<android><gridview><dynamic>","1","0","1","",""
"3537115","1","3537193","","2010-08-21 09:34:35","1","1170","<p>As the title says, I cannot get padding around the text.</p><p>Here's my xml:</p><pre><code>&lt;style name=""StandardButton"" parent=""@android:style/Widget.Button""&gt;    &lt;item name=""android:background""&gt;@drawable/nine_patch_3&lt;/item&gt;    &lt;item name=""android:textColor""&gt;@color/white&lt;/item&gt;    &lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;    &lt;item name=""android:paddingLeft""&gt;10dp&lt;/item&gt;    &lt;item name=""android:paddingRight""&gt;10dp&lt;/item&gt;&lt;/style&gt;</code></pre><p>Thanks!</p>","312390","","","","","2010-08-21 10:02:18","Android: Using a nine-patch background on a button, I cannot add any padding around the text","<java><android><xml>","1","1","","",""
"3537213","1","3537789","","2010-08-21 10:11:04","4","3824","<p>I'm interested in fleshing out an idea for a Android phone app, and I'm wondering if this is possible. So I would have the app running in the background on Phone A, then when it finds another Android phone B, it saves certain information like time, GPS location, just state variables.</p><p>But if the other phone is also running the same app, the two phones connect and share trivial non-private information.</p><p>Hypothetically, would this be possible? Would I go through a local ad-hoc Wi-Fi connection, or constantly broadcast Bluetooth?</p>","262363","","262363","","2010-08-21 10:28:04","2010-08-21 13:29:07","Android: Connect two phones wirelessly?","<android><bluetooth><wifi>","2","0","1","",""
"3537271","1","3537352","","2010-08-21 10:33:22","5","4189","<p>Is there any possible way to install Android Emulator itself on the windows. I would need that for the Testing purpose? Any Idea?</p><p>Please Note: I dont want to install whole sdk. i just want install the Emulater itself. that emulator is just like that a phone for the testing purpose.</p><p>Thanks in Advance</p>","267269","","267269","","2010-08-21 10:38:49","2013-07-18 17:13:09","Android Emulator for windows?(Not to install the Complete SDK, Just Emulator Needed)","<android><android-emulator>","7","2","","",""
"3537307","1","","","2010-08-21 10:43:17","2","4755","<p>Is there a way to send an SMS from te DDMS in Eclipse to my Android phone. The emulator control is disabled when I'm running my physical phone. I can only sent a SMS to the emulator.</p>","355651","","","","","2012-11-23 10:08:22","Simulating SMS on Android Devices when developing","<android>","3","0","3","",""
"3537567","1","3537981","","2010-08-21 12:12:27","1","3731","<p>I have 2 quiet big Animations each 50pics a 20kbBoth defined as Animations .xml</p><p>One I let start from the beginning and the second after a button click.</p><pre><code>//Start immediatly  imgView.setBackgroundResource(R.layout.anim1);                rocketAnimation = (AnimationDrawable) imgView.getBackground();//Start after button click  imgView.setBackgroundResource(R.layout.anim2);                rocketAnimation = (AnimationDrawable) imgView.getBackground();</code></pre><p>It works fine, till i hit the button and assign the second anim to my view</p><pre><code>08-22 14:56:03.886: DEBUG/AndroidRuntime(1541): Shutting down VM08-22 14:56:03.886: WARN/dalvikvm(1541): threadid=3: thread exiting with uncaught exception (group=0x4001da28)08-22 14:56:03.886: ERROR/AndroidRuntime(1541): Uncaught handler: thread main exiting due to uncaught exception08-22 14:56:04.096: ERROR/AndroidRuntime(1541): java.lang.OutOfMemoryError: bitmap size exceeds VM budget08-22 14:56:04.096: ERROR/AndroidRuntime(1541):     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)</code></pre><p>It looks definitly that each animation for itself is fine (i could even set anim2 at the autostart). but BOTH will exceed the memory.</p><p>Btw. on my Nexus One it works perfect. Where it fails is on G1 1.6 (even in Simulator).</p><p>So HOW would I release anim1 first before I assign anim2 ??</p><p>thxchris</p>","355372","","355372","","2010-08-21 12:19:01","2012-08-19 20:27:12","Android setBackgroundResource release memory?","<android><memory-management><animation>","2","0","1","",""
"3537666","1","","","2010-08-21 12:43:14","0","270","<p>I am new to android programming, but I am trying to learn. I have written some code that takes in some parameters through a ""normal"" view with checkboxes and textviews. Then I use this information to generate a lot of numbers that I want to display in a listview. I have managed to create a listview when I press a run button, but how do I pass the information from the main view to the listview. Is it best to pass the information one number at the time or a large array with all the numbers. The list of numbers can be really large.</p>","427100","","","","","2010-08-21 18:19:03","Passing information between views","<android>","2","0","","",""
"3537690","1","3539012","","2010-08-21 12:51:30","2","1549","<p>I am going to use openGLES for 3d graphics. so i wat to install android NDK . can anyone help me to sort out ?</p>","414777","","","","","2011-11-16 09:13:44","Android Ndk Installation on windows?","<android>","1","0","0","",""
"3537762","1","3537837","","2010-08-21 13:14:51","1","833","<p>java.lang.IOException, path to file cannot be created. my catch is working by dont know why is isnt being created?</p><p>Im not sure why im getting this error, i assumed the setOutputFile() would create the file ..</p><p>any help appreciated, as there are a few errors in DDMS</p><p>this is my viderecorder class:</p><pre><code>    package com.sg86.quickrecord;    import java.io.File;    import java.io.IOException;    import android.media.MediaRecorder;    import android.os.Environment;    public class VideoRecorder {  final MediaRecorder recorder = new MediaRecorder();     final String path;     /**     * create a new video recording stored in SDcard Root     */ public VideoRecorder(String path) {     this.path = organisePath(path);     } private String organisePath(String path) {  if (!path.startsWith(""/"")) {   path = ""/"" + path;     }     if (!path.contains(""."")) {      path += "".3gp"";     }     return Environment.getExternalStorageDirectory().getAbsolutePath() + path;     }     public void start() throws IOException {     String state = android.os.Environment.getExternalStorageState();        if(!state.equals(android.os.Environment.MEDIA_MOUNTED))  {            throw new IOException(""SD Card is not mounted.  It is "" + state + ""."");        }        // make sure the directory we plan to store the recording in exists        File directory = new File(path).getParentFile();        if (!directory.exists() &amp;&amp; !directory.mkdirs()) {          throw new IOException(""Path to file could not be created."");        }        recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);        recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);        recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);        recorder.setOutputFile(path);        recorder.prepare();        recorder.start();    }    public void stop() throws IOException {        recorder.stop();        recorder.release();    } }</code></pre><p><strong>this is my main activity</strong></p><pre><code>package com.sg86.quickrecord;import java.io.File;import java.io.IOException;import java.lang.IllegalStateException;import android.app.Activity;import android.media.MediaRecorder;import android.os.Bundle;import android.os.Environment;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;@SuppressWarnings(""unused"")public class QuickRecord extends Activity { public static final String WRITE_EXTERNAL_STORAGE = ""android.permission.WRITE_EXTERNAL_STORAGE"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button recordBtn = (Button) findViewById(R.id.button01);        Button stopBtn = (Button) findViewById(R.id.button02);        final VideoRecorder record = new VideoRecorder(""/QuickRecord/recording"");        recordBtn.setOnClickListener(new OnClickListener() {      public void onClick(View v) {    // TODO Auto-generated method stub    try {     record.start();    } catch (IOException e) {     // TODO Auto-generated catch block     e.printStackTrace();    }   }  });        stopBtn.setOnClickListener(new OnClickListener() {      public void onClick(View v) {    try {     record.stop();    } catch (IOException e) {     // TODO Auto-generated catch block     e.printStackTrace();    }   }  });    }}</code></pre>","427113","","630668","","2011-07-26 09:41:50","2011-07-26 09:41:50","Android VideoRecording error, cannot create path to file","<java><android>","1","0","","",""
"3537773","1","3977965","","2010-08-21 13:17:18","5","8846","<p>There are several threads already on how to make custom layouts in the notification bar.  The problem is I must be missing something simple.</p><p>I have a custom_notification_layout.xml</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:padding=""3dip""              &gt;    &lt;TextView android:id=""@+id/text""              android:text=""Uploading""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:textColor=""#000""              /&gt;    &lt;ProgressBar              style=""?android:attr/progressBarStyleHorizontal""             android:layout_height=""wrap_content""             android:layout_width=""fill_parent""            android:max=""0""             android:progress=""0""               android:layout_marginLeft=""10dip""              android:id=""@+id/progressBar""             /&gt;  &lt;/LinearLayout&gt;</code></pre><p>I also have some test code that creates the notification, which works and shows the progress bar.</p><pre><code>NotificationManager mManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);Notification notification = new Notification(R.drawable.icon, title, System.currentTimeMillis());RemoteViews contentView = new RemoteViews(context.getPackageName(), R.layout.custom_notification_layout);contentView.setProgressBar(R.id.progressBar, 10, 0, false);        contentView.setTextViewText(R.id.text, text);       notification.contentView = contentView;Intent notificationIntent = new Intent(context, NotificationHandler.class);PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);notification.contentIntent = contentIntent;mManager.notify(APPID, notification);</code></pre><p>Finally I try to update the progress bar, which doesn't work.</p><pre><code>contentView.setProgressBar(R.id.progressBar, 10, 5, false); </code></pre><p>What is the secret to actually updating the notification?</p>","242904","","","","","2011-11-21 10:24:03","Updating the Progress Bar in the Notification Area","<android>","3","1","4","",""
"3537785","1","3537961","","2010-08-21 13:21:20","1","2314","<p>I am first time implementing Google Map in Android and troubling to show ""View Controller"" in Android.</p><p>Let me clear about my problem: <strong><code>I want to display the ""View Controller"" which shows different view button, such as Satellite, street View, Hybrid, etc.</code></strong> So how do i show the ""View controller"" in Google map with Android.</p>","379693","","246246","","2012-05-13 07:28:29","2012-05-13 07:28:29","Android - Map View Controller","<android><google-maps><android-maps>","1","0","2","",""
"3537854","1","3537880","","2010-08-21 13:55:56","0","453","<p>I'm starting to use RelativeLayout more and more but there are some things I keep running into. </p><p>Say I have a status textview that I want top and center. Then I have a bunch of other objects below it like images and a table layout. </p><p>I want the stuff below the status text view to respect the status textview's personal space and not draw themselves right on top of it. </p><p>But what I'm seeing is that in a relativelayout, everything piles up on eachother unless I use alignment such as <code>android:layout_below</code> and <code>android:layout_above</code>. </p><p>Is there an attribute that I can add to the status textview to make it so other objects don't want to draw right on top of it? Or do I have to keep using the alignment tags on everything and align things away from it? </p><p>Thanks!</p>","268803","","","","","2010-08-21 14:09:06","In a RelativeLayout how to prevent objects from piling up on eachother?","<android><gui><layout><relativelayout>","1","0","","",""
"3538104","1","3538164","","2010-08-21 15:52:37","0","1735","<p>I want to add a new view to my scene that will contain content that will change programatically throughout the course of my application.  When it does change, it needs to pop up on the screen for 3 seconds (or a click) then disappear.</p><p>This view will change in size according to its content WRAP_CONTENT, but ideally I'd like it centered horizontally and vertically on the screen.</p><p>I'm stuck on three parts:1) what type of view should I use for this...I was thinking Relative, but all of my playing with it has yielded no good results for what I'm trying to do2) with respect to #1 (trying relative view), I could not get it centered properly (tried using param.leftMargin and param.topMargin with varying values but could not get it to work on different devices with different resolutions3) also with respect to #1, I couldn't make this float over everything else on my screen (need something like a z-index or the like).</p><p>any ideas, code examples would be wonderful.</p><p>TIA </p>","233971","","","","","2010-08-21 16:37:47","pop-up type view (z-index?) - android","<android><layout><z-index>","1","0","","",""
"3538407","1","3538523","","2010-08-21 18:07:14","0","1255","<p>I have an array of drawables, that I would like to change by my own timer to a imageview.(i tried the other option with xml and  setBackgroundResource, but does not work for me as I have hundret of pics and always got memory problem as it looks android assign already the whole memory for all pics at once. (just in this demo i shorted it to 4 images)</p><p>Ok, so first i make my array</p><pre><code>private static int[] draws = {     R.drawable.frankiearmevor_0001,      R.drawable.frankiearmevor_0002,      R.drawable.frankiearmevor_0003,      R.drawable.frankiearmevor_0002  };@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    imgView = (ImageView) findViewById(R.id.fredi);    // create timer            Timer updateProgressTimer = new Timer();    updateProgressTimer.scheduleAtFixedRate(new TimerTask() {        @Override        public void run() {            myloop();        }    }, 0, 150);}int mycounter;public void myloop(){    mycounter++;    if (mycounter &gt; 4) mycounter = 1;    imgView.setImageResource(draws[mycounter-1]);    String hallo; hallo = ""now: ""+mycounter;    Log.d(""1"",hallo);}</code></pre><p>when I assign only a fixed image:       imgView.setImageResource(draws[2]);it shows that fine and I see also my thread is logged fine, but when I exchange thefixed resource draws[2] into a dynamic draws[mycounter-1] .. i just get a black screen, no error, nothing.</p><p>what to do, so i will show the images :)</p><p>thxchris</p><p>EDIT: 22. August:</p><p>I tried now with the comment I got, it compiles fine, but somehow there is an error i guess.. it crash:</p><pre><code>    imgView = (ImageView) findViewById(R.id.fredi);    Timer updateProgressTimer = new Timer();    updateProgressTimer.scheduleAtFixedRate(new TimerTask()     {        @Override        public void run()         {            //myloop();            imgView.post (new Runnable()             {                public void run()                 {                    mycounter++;                    if (mycounter &gt; 10) mycounter = 1;                    imgView.setImageResource(draws[1]);                    //imgView.invalidate();                    String hallo; hallo = ""now: ""+mycounter;                    Log.d(""1"",hallo);                 }            });        }    }, 0, 150);</code></pre>","355372","","355372","","2010-08-22 12:30:45","2010-08-22 12:30:45","android assign a drawable dynamicaly to a imageview","<android>","1","0","1","",""
"3538470","1","3538886","","2010-08-21 18:37:05","0","1380","<p>I have an extended dialog class that I want to show for 3 seconds then disappear.  This works great the first 2 times it's called, but then it crashes my app after that.  Admittedly, I'm not the best with threads and I think that's where my problem might be.  As you can see from the code below (commented out section), I tried using a cancel event to kill the thread that is spawned, but that makes it crash the first time it's run.  I've also tried doing all of this on the parent class' UI thread which yields the same result as this (crashes after 3 times displaying the dialog).</p><pre><code>import java.util.Timer;import java.util.TimerTask;import android.app.Dialog;import android.content.Context;import android.content.DialogInterface;import android.os.Handler;public class HandResults extends Dialog implements DialogInterface {    HandResults hr;    Timer myTimer;    Handler hand = new Handler();    Thread t;    public HandResults(Context context) {        super(context);        setContentView(R.layout.handresults);        hr = this;        /*        this.setOnCancelListener(new OnCancelListener(){            public void onCancel(DialogInterface dialog) {                t.destroy();            }        });        */    }    public void showHands(){        this.show();        myTimer = null;        myTimer = new Timer();        myTimer.schedule(new TimerTask() {            @Override            public void run() {                TimerMethod();            }        }, 3000);    }    private void TimerMethod()    {        t = new Thread(){            public void run(){                   hand.post(Timer_Tick);                   }        };        t.start();    }    private Runnable Timer_Tick = new Runnable() {        public void run() {            hr.cancel();        }    };}</code></pre>","233971","","","","","2010-08-21 21:11:03","cancel dialog after 3 seconds - keeps crashing my app after multiple uses","<android><multithreading><dialog><timer>","2","1","","",""
"3538546","1","3667852","","2010-08-21 19:13:44","7","6600","<p>I was wondering if there was any way to feature a custom title with my own drawable -- and then subsequently put a progress bar in the title layout so that it acts like the built in android progress bar. </p><p>In my code -- I want to be able to call <code>setProgressBarIndeterminateVisibility(true)</code> and have that display the progress bar in my custom title bar. </p><p>Is this possible?</p><p>I have set up my application theme so that it uses a custom title -- but I don't how or where to put the progress bar in that layout. </p><p>Thanks in advance. </p><p>EDIT: Right now I use my own theme that looks something like this: </p><pre><code>&lt;style parent=""android:Theme.Light.NoTitleBar"" name=""BaseTheme""&gt;    &lt;item name=""android:windowBackground""&gt;@drawable/splash_bg&lt;/item&gt;    &lt;item name=""android:windowTitleStyle""&gt;@style/TitleBackground&lt;/item&gt;&lt;/style&gt;</code></pre><p>With the title background style as :</p><pre><code>&lt;style name=""TitleBackground"" parent=""android:WindowTitleBackground""&gt;    &lt;item name=""android:background""&gt;@drawable/title_bar&lt;/item&gt;&lt;/style&gt;</code></pre><p>To give everyone a better idea -- something like this. <img src=""http://i.stack.imgur.com/Ejou6.png"" alt=""alt text""></p>","354247","","354247","","2010-08-27 19:01:39","2011-05-23 14:34:12","Custom Title Bar with Progress in Android","<android><gui>","3","2","4","",""
"3538615","1","3823494","","2010-08-21 19:39:13","0","741","<p>In the included LVL sample app, the license check is triggered during onCreate.  This means that when I click ""Buy App"" to launch the market, then immediately hit the back button to return to the app, the dialog is gone and another check isn't performed, leaving me with a perfectly usable app (at least until the activity is killed and the process starts over again).</p><p>Would triggering the license check during onResume() be bad form, even though it would fix this issue?  Is there a better solution?</p>","420474","","","","","2011-08-13 18:28:01","Android Market Licensing: Check during onCreate() or onResume()?","<android><google-play>","3","0","0","",""
"3538647","1","3538803","","2010-08-21 19:44:40","0","4213","<p>Basically, so far I've just got an add and minus button which will change the value of a TextView.</p><p>I followed the second example under ""Event Listeners"" on <a href=""http://developer.android.com/guide/topics/ui/ui-events.html"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/ui-events.html</a></p><p>The problem is I get 4 errors when I go to compile, I don't see what I'm doing wrong?</p><p>Please can someone point out if there is anything wrong, or show me a simpler way please.</p><p>Thank you for your time.</p><p>Here's the errors:</p><pre><code>/home/alex/NetBeansProjects/GolfScoreCard/src/com/alex/golfscorecard/MainActivity.java:19: com.alex.golfscorecard.MainActivity is not abstract and does not override abstract method onClick(android.content.DialogInterface,int) in android.content.DialogInterface.OnClickListenerpublic class MainActivity extends Activity implements OnClickListener{/home/alex/NetBeansProjects/GolfScoreCard/src/com/alex/golfscorecard/MainActivity.java:49: setOnClickListener(android.view.View.OnClickListener) in android.view.View cannot be applied to (com.alex.golfscorecard.MainActivity)        buttonMinus.setOnClickListener(this);/home/alex/NetBeansProjects/GolfScoreCard/src/com/alex/golfscorecard/MainActivity.java:50: setOnClickListener(android.view.View.OnClickListener) in android.view.View cannot be applied to (com.alex.golfscorecard.MainActivity)        buttonPlus.setOnClickListener(this);/home/alex/NetBeansProjects/GolfScoreCard/src/com/alex/golfscorecard/MainActivity.java:51: setOnClickListener(android.view.View.OnClickListener) in android.view.View cannot be applied to (com.alex.golfscorecard.MainActivity)        buttonOK.setOnClickListener(this);</code></pre><p>Here is my code:</p><pre><code>package com.alex.golfscorecard;import android.app.Activity;import android.content.DialogInterface.OnClickListener;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;/** * * @author alex */public class MainActivity extends Activity implements OnClickListener{  Button buttonMinus, buttonPlus, buttonOK;  TextView golfScore;    // Implement the OnClickListener callback    // Incomplete!    public void onClick(View v) {      switch(v.getId()){          case R.id.buttonMinus:          score--;          break;          case R.id.buttonPlus:          score++;          break;      }    }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        //Set the UI elements and find their view in main.xml        buttonMinus = (Button) findViewById(R.id.buttonMinus);        buttonPlus = (Button) findViewById(R.id.buttonPlus);        buttonOK = (Button) findViewById(R.id.buttonOK);        golfScore = (TextView) findViewById(R.id.golfScore);        //Set the UI elements' on click listeners        buttonMinus.setOnClickListener(this);        buttonPlus.setOnClickListener(this);        buttonOK.setOnClickListener(this);    }}</code></pre>","427234","","427234","","2010-08-21 20:04:36","2010-08-22 08:16:43","Android Development: Button onClickListeners Help","<php><android><onclick>","2","0","","",""
"3538649","1","3538784","","2010-08-21 19:44:47","9","8519","<p>I have a few strings which I need to translate and display. Those strings are in variables. I have the translation in the strings.xml file. </p><p>I want to display the ""translated version"" of the string. For example, inside an Activity:</p><pre><code>String name = ""Water"";TextView nameDisplay = new TextView(this).nameDisplay.setText(name);</code></pre><p>In the strings file I have the definition</p><pre><code>&lt;string name=""Water""&gt;French word for Water&lt;/string&gt;</code></pre><p>If I used something like this:</p><pre><code>nameDisplay.setText(R.string.KnownName);</code></pre><p>it would work. But in my case, the name is stored in a variable so I do not know what to do in  order for the setText method to function properly.</p><p>My current workaround is </p><pre><code>String translation = """"if(name == ""Water"") {  translation = getString(R.string.Water);}else {  ...}nameDisplay.setText(translation);</code></pre><p>... but this does not scale very well.</p><p>Any suggestions? </p><p>Should I store the translated version in the variable?</p><p>Thanks.</p>","425749","","","","","2011-08-25 10:45:30","Accessing contents of R.string using a variable to represent the resource name","<android><resources>","2","0","2","",""
"3538680","1","3539119","","2010-08-21 19:53:19","3","1472","<p>Am i correct in saying a 16 bit image will be decode and drawn faster than a 24 or 32 bit? I know the file size will be less but if the bitmaps will actually be drawn faster than it would be worth the effort to convert them. If it is faster, how would i go about saving a 16 bit jpeg file? I only found an option in photoshop to save a 16 bit bitmap...which is 54 MB.</p>","385051","","","","","2010-08-21 21:44:41","16 bit images and android processing","<android><opengl-es><bitmap><imageview>","2","0","1","",""
"3538728","1","3538859","","2010-08-21 20:01:49","5","4572","<p>I am currently writing my first Android application and I keep running into references to background and foreground services. Since I intend on using a service in my application I was hoping to get a clarification between the two and how they are used.</p>","420377","","","","","2012-02-17 05:50:08","What is the difference between a background and foreground service?","<android>","2","0","1","",""
"3538789","1","","","2010-08-21 20:14:55","1","400","<p>I am trying to implement a code that uses the camera LED (Flash). It is similar to the torch applications that are available on the market. I guess in android 2.1 and above this can be achieved by using FLASH_MODE_TORCH. Is there a generic way to do the same on <strong>android 1.6</strong>.</p>","417698","","243782","","2010-08-22 09:05:34","2010-08-22 09:05:34","Is there a generic way to activate led flash light on android 1.6","<android><android-sdk-1.6>","0","2","1","",""
"3538853","1","3539184","","2010-08-21 20:28:36","2","1152","<p>I am looking to run a certain method call every ten minutes in Android, what is the best way to go about implementing this? I am currently looking at using the <code>Handler</code> object's <code>PostDelayed</code>  method.</p>","420377","","420377","","2012-10-03 16:11:01","2012-10-03 16:11:01","How do I run a method every 10 minutes in Android?","<android>","1","5","2","",""
"3538860","1","3539032","","2010-08-21 20:31:22","3","572","<p>I would like to be able to test to see if the Phone's GPS is working or not (in the app's code). Right now, I am just trying to directly access the GPS location without an  </p><pre><code>if ( GPS_is_working ) {}</code></pre><p>I am having a problem right now since when I access the GPS when it is not working, the force-close dialogue shows up and my activity is shut down.</p><p>What is the code to do this?</p>","399717","","328193","","2010-08-21 20:50:14","2010-08-21 21:20:04","How to test to see if GPS is working in Android App?","<android>","1","0","1","",""
"3538871","1","3538889","","2010-08-21 20:34:21","0","8052","<p>What is the max x, y size of a Android screen in pixels? Is there a standard set by the OS or does it mostly just depend upon the phone hardware.</p><p>Thanks</p>","188674","","","","","2012-08-02 12:26:52","Screen Size In Pixels","<android>","2","0","","",""
"3538946","1","3787796","","2010-08-21 20:55:43","6","5622","<p>I am trying to create smaller tabs in android -- but I can't seem to get it to work because all that happens when I create a smaller tab is that it shows the bigger tab -- but without a drawable. </p><p>This is my layout code for tabs now -- but the height isn't wrapping for some reason -- it just goes to Android's usual layout height. </p><pre><code>&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;TabWidget android:id=""@android:id/tabs""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;/FrameLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>It would be great if someone could help me create something like the Facebook application -- I think that looks really clean and I would love to implement something like it:<img src=""http://i.stack.imgur.com/BtpO0.png"" alt=""""></p>","354247","","","","","2011-02-23 15:50:28","Create Smaller Tabs in Android","<android><gui><android-tabhost>","2","0","2","",""
"3538995","1","","","2010-08-21 21:09:37","1","925","<p>Part of my Layout is shown below, but the Button shows up <strong>above</strong> the MapView and NOT as expected ""below"" the map. How can I fix this?</p><pre><code>   &lt;RelativeLayout android:id=""@android:id/tabcontent""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""&gt;    &lt;com.google.android.maps.MapView        android:id=""@+id/mapview1"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:clickable=""true""        android:apiKey=""0i4xk7rTGI6b6ggDrC9hOYCbOd9julMg_DG79cg"" /&gt;    &lt;Button android:id=""@+id/btnBanner""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text = ""text""        android:layout_below=""@+id/mapView1""     /&gt;</code></pre>","427307","","21234","","2010-08-21 21:18:19","2010-12-20 12:31:59","Failed to set a Button below a MapView","<android><layout><android-mapview>","1","0","","",""
"3539100","1","","","2010-08-21 21:39:32","0","1390","<p>I have a complex layout file with many TextView's and EditText's placed on the canvas.  The layout needs to be a ScrollView in order to properly work for the user.  The problem is that 2 fields should really be ListView's with all the formatting that comes with them.  Neither of these lists will be more then 10 lines long.  I am currently using a TextView by creating a long string from the data and displaying it.</p><p>The problem is that I cannot format the text in the TextView like I can within a ListView.</p><p>Since I cannot place ListView's within a ScrollView, I need to simulate it by using a TextView .  I need to format the data into columns like I would in a ListView, with data wrapping in the second display field, being a different font based on the rows condition.</p><p>Is there any way to format the data in a TextView to look like data in a ListView such as below:</p><pre><code>21   This is the data for   NA       this item.1/2  This is the data for   Q       the second item.3    This data should be a  NA       different font.</code></pre><p>Can anyone tell me how to do this?</p>","411203","","","","","2010-08-21 22:08:28","android ListView replacement for ScrollView","<android><listview><textview><scrollview>","1","0","","",""
"3539115","1","3539152","","2010-08-21 21:44:03","0","1321","<p>I have an MP3 audio file that I want to play from my Android app.  I am using MediaController and VideoView like the answer to question <a href=""http://stackoverflow.com/questions/2961749"">2961749</a>. I get the error ""Sorry this video cannot be played."" But if I copy the file to /Music on my sd card, I can play it with the Music player app on Android. I've also tried just using MediaPlayer and it has a similar error.</p><p>Any ideas why this would be?  And, an anyone tell me what I need to do to play the audio?</p><p>Here's my code:</p><pre><code>setContentView(R.layout.reading_layout);topicGraphic = (ImageView) findViewById(R.id.topic_graphic);videoView = (VideoView) findViewById(R.id.video_view);Uri uri = Uri.parse(""/sdcard/audio/mainidea.mp3"");mediaController = new MediaController(this);mediaController.setAnchorView(videoView);videoView.setMediaController(mediaController);videoView.setVideoURI(uri);videoView.start();</code></pre>","4476","","","","","2010-08-21 21:53:20","Why does my MP3 play in Android's Music app but not using MediaController?","<android>","1","3","","",""
"3539245","1","","","2010-08-21 22:18:58","1","141","<p>I've only written a handful of apps, but all the bad feedback I get is with Droid X phones. Is there something fundamental I'm missing with this phone?</p><p>I test with a HTC Desire but always take into account the 480 x 854 screen layout. It's becoming a bit worrying.</p><p>Any help appreciated.</p>","427331","","","","","2010-08-21 22:18:58","Problem with Droid X","<android>","0","2","","2010-08-23 02:44:19",""
"3539300","1","3539370","","2010-08-21 22:30:19","0","532","<p>I have just started using services in Android and I have a made a simple service that is polling a server every 20 seconds.</p><p>Now how can I get this data from my main activity (when it is active)? </p><p>Alternatively the service could send it back do my main activity (but only if its active). I don't want to wake up my activity.</p><p>I have read SDK <a href=""http://developer.android.com/reference/android/app/Service.html"" rel=""nofollow"">examples</a> of ""Binding"" but I can't find an example how to <strong>actually</strong> get something from the service. Just how to start and stop the Binding.</p><p>From the example. If I have the ""mBoundService"" object in my activity how do I get my data from the service method called eg. ""pollingData()""?</p>","215088","","215088","","2010-08-21 22:35:39","2010-08-22 20:04:17","How do I get data from a running service","<java><android><service>","1","0","2","",""
"3539349","1","","","2010-08-21 22:48:57","13","24746","<p>If AbsoluteLayout is deprecated what can I use instead of it?</p><p>I've done an app that uses AbsoluteLayout but it doesn't work well with the different screen resolutions. I use because I can set the X and Y position of a button. Can I set the position of a button using another layout?</p>","404784","","404784","","2010-08-22 12:05:03","2013-12-04 09:44:38","Alternative to AbsoluteLayout in Android?","<android>","4","3","2","",""
"3539353","1","","","2010-08-21 22:50:23","1","190","<p>So I have a try-catch statement in a java program that fetches things from the internet. How do I handle timeouts? Would I just wrap the try catch in a while statement and after some number of failed iterations tell the user to try later?</p>","412554","","","","","2010-08-22 00:56:59","Wrapping try-catch that fetches from internet, in a while","<java><android>","1","0","","",""
"3539375","1","","","2010-08-21 22:57:55","1","526","<p>While this may sound backwards, I have a need to draw to my Overlay in another class.</p><p>I get a bitmap from the MapsView, then essentially draw it on the overlay.</p><p>I am having difficulty doing this however.</p><p>Here is what I am doing. First I generate a bitmap from the mapview:</p><pre><code>Bitmap bitmap = Bitmap.createBitmap(400, 800,             Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); mapview.draw(canvas); </code></pre><p>At this point, I do some processing and need to draw the bitmap on the Overlay.</p><p>The overlay's draw method doesn't work, as it takes a canvas as a parameter but draws to that canvas.</p><p>It seems like when my overridden draw method is called, it is passed a sort of 'internal' canvas which is then drawn on top or whatever the map view.</p><p>Is there any way to access that through code? I feel I am missing something simple, and/or doing this very rube goldberg-ish. Thanks.</p>","427344","","","","","2010-08-21 22:57:55","Android - Any way to access an Overlay's canvas in another class?","<android><google-maps><canvas><bitmap><android-mapview>","0","0","","",""
"3539406","1","3540090","","2010-08-21 23:10:32","0","1717","<p>I'm trying to make a simple livewallpaper out of a series of boot animation .pngs...</p><p>I'm using </p><pre><code>private static final int NUM_RES = 9;        private final Bitmap[] mPics = new Bitmap[NUM_RES];        CubeEngine() {            Resources res = getResources();            for (int i = 0; i&lt; NUM_RES; i++) {                int id = res.getIdentifier(""boot_0010"" + (i + 1), ""drawable"", ""minghai.wallpaper"");                mPics[i] = BitmapFactory.decodeResource(res, id);            }        }</code></pre><p><strong>9 seems to be the highest I can go. If i set NUM_RES to anything over 9 i get a force close.</strong></p><p>All my files are labeled...boot_00101.pngboot_00102.pngboot_00103.pngboot_00104.pngboot_00105.pngboot_00106.pngboot_00107.pngboot_00108.pngboot_00109.pngboot_00110.pngboot_00111.pngboot_00112.pngboot_00113.pngboot_00114.pngand so on...I have about 50 images im trying to use</p><p>Anyone know what I should be doing?</p><p>LOGCAT:</p><pre><code>08-21 19:18:43.108: ERROR/AndroidRuntime(6475): FATAL EXCEPTION: main08-21 19:18:43.108: ERROR/AndroidRuntime(6475): java.lang.NullPointerException08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at android.graphics.Canvas.drawBitmap(Canvas.java:1115)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at minghai.wallpaper.YayoiWallpaper$CubeEngine.drawYayoi(YayoiWallpaper.java:166)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at minghai.wallpaper.YayoiWallpaper$CubeEngine.drawFrame(YayoiWallpaper.java:144)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at minghai.wallpaper.YayoiWallpaper$CubeEngine.onOffsetsChanged(YayoiWallpaper.java:117)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at android.service.wallpaper.WallpaperService$Engine.doOffsetsChanged(WallpaperService.java:669)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:847)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at android.os.Handler.dispatchMessage(Handler.java:99)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at android.os.Looper.loop(Looper.java:123)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at java.lang.reflect.Method.invokeNative(Native Method)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at java.lang.reflect.Method.invoke(Method.java:521)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-21 19:18:43.108: ERROR/AndroidRuntime(6475):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>@YokThank you so much that did the trick....to an extent, i can't seem to go past 30 I get a memory error. Sorry to ask, but would you happen to know of a more efficient way to simply get an animation like i'm trying to achieve. </p><pre><code>08-22 04:35:03.720: ERROR/AndroidRuntime(8783): FATAL EXCEPTION: main08-22 04:35:03.720: ERROR/AndroidRuntime(8783): java.lang.OutOfMemoryError: bitmap size exceeds VM budget08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.Bitmap.nativeCreate(Native Method)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.Bitmap.createBitmap(Bitmap.java:435)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:346)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:372)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at minghai.wallpaper.YayoiWallpaper$CubeEngine.&lt;init&gt;(YayoiWallpaper.java:60)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at minghai.wallpaper.YayoiWallpaper.onCreateEngine(YayoiWallpaper.java:35)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:814)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.os.Handler.dispatchMessage(Handler.java:99)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.os.Looper.loop(Looper.java:123)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at java.lang.reflect.Method.invokeNative(Native Method)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at java.lang.reflect.Method.invoke(Method.java:521)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-22 04:35:03.720: ERROR/AndroidRuntime(8783):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","393373","","19750","","2011-03-31 15:40:00","2011-03-31 15:40:00","Live wallpaper animation force closing when I add more than 10 frames?","<java><android><animation><live-wallpaper>","2","4","","",""
"3539646","1","3540140","","2010-08-22 00:50:55","3","927","<p>Is there some way to have Eclipse NOT present the Android Device Chooser dialog every time I run the Android application I'm developing?  I'm using a running Android device, not an AVD.  There's got to be some place I can set my default device to be the Android device so that I don't have to double-click on the device entry in the ADC dialog everytime.</p>","369722","","","","","2010-08-22 04:25:27","Alternative to having to select device every time I run an Android application?","<android><eclipse><dialog><device>","1","0","","",""
"3539660","1","3539780","","2010-08-22 00:55:18","2","18573","<p>My imagebutton code wont respond to ""fill_parent"" and ""wrap_content"".Instead, it just shows the middle of the image (because it is a pretty big image).I tried setting specific values for the image but it still didn't work! Can somebody help me?</p><p>My button.xml in the res/drawable folder:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;\&lt;item android:state_pressed=""true"" android:drawable=""@drawable/happycarrot"" /&gt; &lt;!-- pressed --&gt;&lt;item android:state_focused=""true"" android:drawable=""@drawable/largerunicornbutton2"" /&gt; &lt;!-- focused --&gt;&lt;item android:drawable=""@drawable/largerunicornbutton"" /&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p>My main.xml in the res/layout folder:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:background=""@android:color/white""&gt; &lt;ImageButton android:src=""@drawable/button"" android:layout_height=""fill_parent"" android:layout_width=""wrap_content""  /&gt;  &lt;/RelativeLayout&gt;</code></pre><p>I tried using a LinearLayout, but the app wouldnt run, and I tried replacing the imagebutton with an imageview, but then the button didn't work.</p>","394842","","","","","2010-08-22 02:01:16","Android - Image button size help?","<android><eclipse><image><button><imageview>","1","0","","",""
"3539677","1","3539789","","2010-08-22 01:01:19","1","683","<p>I'm looking for suggestions for ways to share Android app data between phones running the same app. For example, lets say I have an app that stores a database of book reviews. If person A has a book review that person B doesn't have, what are the options for getting that information from person A's phone to person B's phone?</p><p>Currently, I'm aware of the following options:</p><pre><code>- Upload data from person A's phone to a server, then download data from server to Person B's phone.- Write code to have the phones sync up using bluetooth- Write code to send SMS messages</code></pre><p>I'm wondering if there are any more options besides these, and if there's actually a best-practice for accomplishing this?</p><p>Ideally, I want the users to simply click a button in the app to make the sharing take place, so I don't want to go down the bluetooth route because that requires the user to do a bit of setup (or assumes they already have set things up in the form of bluetooth settings).</p><p>Since the data can be of variable length and potentially large, I believe that would rule out text messaging.</p><p>As far as the server route goes, from what I understand this seems to be an ok way of doing things, but my problem is that I have no experience with having users potentially sign in to a server and then uploading data. I don't know of the cost concerns (if any), or of potential security concerns (allowing just anyone to upload data, I'm not sure if I would have to take steps to ensure someone couldn't bypass the app and upload malicious data).</p><p>So, can you guys give me suggestions and point me in the right direction? Thanks.</p>","449070","","","","","2011-06-09 08:31:28","Options for Sharing Android App Data on Multiple Phones","<android><web-services>","3","0","","",""
"3539684","1","3539806","","2010-08-22 01:04:37","0","930","<p>I'd like to populate a listview from 2 tables. Anyone know how I can achieve this? Currently what I have looks like but it only works with one adapter:</p><pre><code>   private void populate() {        todoCursor = dbNotes.getTodoKey();        startManagingCursor(todoCursor);        todo =              new SimpleCursorAdapter(               this,               R.layout.todo_list,                todoCursor,               new String[] {databaseHelper.DB_COLUMN_TODO_KEYS},               new int[] {R.id.textTodo});        setListAdapter(todo);    }    private void fillData(int i) {        Cursor notesCursor = dbNotes.retrieveAll(i, ""=0"");        startManagingCursor(notesCursor);        notes =              new SimpleCursorAdapter(               this,               R.layout.list_item,                notesCursor,               new String[] {databaseHelper.DB_COLUMN_SUBJECT, databaseHelper.DB_COLUMN_TIME, databaseHelper.DB_COLUMN_MESSAGE, databaseHelper.DB_COLUMN_DOW, databaseHelper.DB_COLUMN_MD},               new int[] {R.id.text1, R.id.text2, R.id.text3, R.id.textDay, R.id.textDayOfWeek});        setListAdapter(notes);    }</code></pre>","427377","","313137","","2010-08-22 01:57:13","2010-08-22 02:10:18","Listview from multiple tables?","<android>","1","0","","",""
"3539755","1","3543301","","2010-08-22 01:47:05","0","776","<p>Here is my onCreate method:</p><pre><code>    /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Intent intent = getIntent();    if (intent.getData() == null)        intent.setData(Formulas.CONTENT_URI);    AutoCompleteTextView searchBar = (AutoCompleteTextView)findViewById(R.id.searchBar);    Cursor c = getContentResolver().query(getIntent().getData(),new String[] { Formulas.TITLE }, null, null, null);    SimpleCursorAdapter searchAdapter =         new SimpleCursorAdapter(this, android.R.layout.simple_dropdown_item_1line, c,                 new String[] { Formulas.TITLE } , new int[] { android.R.id.text1} );    searchBar.setAdapter(searchAdapter);}</code></pre><p>I did input some sample data in my databaseopenhelper:</p><pre><code>        @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(""CREATE TABLE formula ( \n"" +                ""_id INTEGER PRIMARY KEY AUTOINCREMENT, \n"" +                ""title TEXT NOT NULL, \n"" +                ""formula TEXT NOT NULL \n"" +                "");"");        db.execSQL(""INSERT INTO formula VALUES ( \n"" +                ""null, \""Pythagorean theorium\"", \""a^2+b^2=c^2\"" \n"" +                ""); "");        db.execSQL(""INSERT INTO formula VALUES ( \n"" +                ""null, \""Perimeter of a square\"", \""l^2 * w^2\"" \n"" +                ""); "");        db.execSQL(""INSERT INTO formula VALUES ( \n"" +                ""null, \""Area of a square\"", \""l^4\"" \n"" +                ""); "");    }</code></pre><p>The problem is where I set the adapter to the <code>AutoCompleteTextView</code>, I expect the values that I inserted using the <code>SQLiteDatabase.execSQL(String)</code> method. But nothing is there? The dropdown box doesn't even show up? I used debugging and found that the <code>Cursor</code> was not null and neither was the adapter or <code>AutoCompleteTextView</code>? What could be the problem? I already defined my own contentprovider.</p>","200477","","200477","","2010-08-22 13:47:07","2010-08-22 20:40:57","AutoCompleteTextView adapter not displaying dropdown?","<java><android><sqlite><android-contentprovider><autocompletetextview>","1","2","","",""
"3539792","1","","","2010-08-22 02:04:10","2","1031","<p>What is the Easiest way to stop a soundpool of 4 streams.</p><pre><code>    mSoundManager.addSound(1, R.raw.svphorn);    mSoundManager.addSound(2, R.raw.svpphaser);    mSoundManager.addSound(3, R.raw.svpwail);    mSoundManager.addSound(4, R.raw.svpyelp);</code></pre><p>I need a button to stop all sounds playing @ one time.</p>","407754","","243782","","2010-08-22 09:01:37","2010-08-25 07:03:42","What is the Easiest way to stop a soundpool of 4 streams","<java><android>","1","5","","",""
"3539828","1","","","2010-08-22 02:17:46","0","111","<p>So I have an array of strings (let's call it array1) and then I have another array (array2 say) and I want to check if array2 is a subset of array1.. is there a simple command for that?</p><p>edit:</p><p>scenario2</p><p>I have array1 (which is user generated through an edittext with strings say names of people) and I have a matrix that I want to check to see if each individual row is a subset of array1.. for example.. array1 = ""bob"" , ""john"" , ""joe"" , ""frank"" and I have a 2x3 matrix with names in each of 6 items of it and I want to check if each row is a subset of array1.. so if row1 of the matrix was equal to ""jim"" , ""joe"" , ""frank"" and row2 was equal to ""joe"" , ""bob"" , ""frank"" then only row2 would be a subset of array1</p>","407775","","407775","","2010-08-22 22:01:49","2010-08-22 22:01:49","checking for a subset in android application","<android><subset>","2","0","","",""
"3539930","1","3540111","","2010-08-22 02:56:37","0","608","<p>I'm trying to create a table in android database, but when i try to run the application the LogCat returns the following error:</p><p>08-22 02:39:29.098: ERROR/AndroidRuntime(277): Caused by: android.database.sqlite.SQLiteException: near ""auto_increment"": syntax error: CREATE TABLE words(id INTEGER PRIMARY KEY, word TEXT, count INTEGER not null auto_increment)</p><p>The code for this error is this:</p><pre><code>public void onCreate(SQLiteDatabase db) {     db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY, word TEXT, count INTEGER not null auto_increment)"");  }</code></pre><p>And there is a error on this line too, the one between arrows:</p><pre><code>public DataHelper(Context context) {  this.context = context;  OpenHelper openHelper = new OpenHelper(this.context);  --&gt;this.db = openHelper.getWritableDatabase();&lt;--  this.insertStmt = this.db.compileStatement(INSERT);  this.updateStmt = this.db.compileStatement(UPDATE);</code></pre><p>}</p><p>Ps: The codes before is from DataHelper class.</p><p>and  erro at this line (the logcat just say the line of the class, dont say the error):</p><pre><code>this.dh = new DataHelper(this);     </code></pre><p>Ps: DataHelper is the class that manage the database.   </p>","399459","","","","","2011-07-16 14:30:11","Error Creating Table on Android","<android><database><sqlite><android-emulator>","2","0","","",""
"3539998","1","3540104","","2010-08-22 03:27:38","2","1065","<p>I have a LinearLayout with a vertical orientation, within that layout I have three buttons (ImageButtons to be exact) and when the orientation changes (via an OrientationEventListener) I have them set to perform a rotation animation.  The top and bottom buttons rotate perfectly, however the middle one does not.  Its pivot point seems to be off.</p><p>Here is the layout of the animation:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;rotate xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromDegrees=""0""     android:toDegrees=""-90""    android:pivotX=""50%""     android:pivotY=""50%""    android:duration=""500""/&gt;</code></pre><p>...and here is how I initiate the animation:</p><pre><code>Animation rotate = AnimationUtils.loadAnimation(this.mContext, animResId);rotate.setFillEnabled(true);rotate.setFillAfter(true);{...retrieve the each ImageButton then call startAnimation(rotate) on them...}</code></pre><p>...and here is the layout for the component in my activity that is the LinearLayout for my menu:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/camera_menu""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_alignParentTop=""true""    android:layout_toRightOf=""@+id/camera_preview""    android:layout_alignParentRight=""true""    &gt;    &lt;ImageButton            android:id=""@+id/camera_top_button""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""3""            android:src=""@drawable/placeholder""            android:scaleType=""centerInside""            android:onClick=""onTopButtonClick""    /&gt;    &lt;ImageButton            android:id=""@+id/camera_action_button""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""2""            android:src=""@drawable/placeholder""            android:scaleType=""centerInside""            android:onClick=""onActionButtonClick""    /&gt;    &lt;ImageButton            android:id=""@+id/camera_bottom_button""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""3""            android:src=""@drawable/placeholder""            android:scaleType=""centerInside""            android:onClick=""onBottomButtonClick""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>Does anyone have an idea as to why the middle (action) button is not rotating around the correct pivot point?</p><p>One thing I have noticed is that after rotating, the middle button is aligned with the tops of the other two, smaller buttons (the top and bottom buttons).</p><p>Thanks in advance for any help!</p><p>Regards, celestialorb.</p>","384386","","384386","","2010-08-22 03:41:47","2010-08-22 04:13:26","Rotating views in a LinearLayout problem","<java><android><animation><rotation>","1","1","","",""
"3540076","1","","","2010-08-22 04:02:38","0","1055","<p><br>I'm just wondering to know if a can with a background service have co-ordinates of a touch screen event in all activities.<br>Such like that<br><pre><code>*final TextView textView = (TextView)findViewById(R.id.textView);final View touchView = findViewById(R.id.touchView);touchView.setOnTouchListener(new View.OnTouchListener() {    @Override    public boolean onTouch(View v, MotionEvent event) {              textView.setText(""Touch coordinates : "" +String.valueOf(event.getX()) + ""x"" + String.valueOf(event.getY()));     return true;}</pre></code>but without any view by default.<br>Thanks</p>","427148","","225647","","2010-08-22 04:52:32","2012-06-02 17:09:27","Get co-ordinates touch screen in a background service","<android>","2","0","","",""
"3540287","1","3540302","","2010-08-22 05:23:38","2","477","<p>I'm developing a Android AppWidget for my application. For updating my appwidget I need to download data from network. But when I try to do that in onUpdate method, my appWidget is killed by Android system. I learnt that time consuming operations can't be done in receivers so I launched a service from onUpdate method and launched a thread from that. But still the problem persists.Can anyone please let me know how to do network operations in Appwidget?</p>","337214","","","","","2010-08-22 05:30:16","Android : Network operations in Appwidget","<android><networking><operations><appwidget>","1","0","1","",""
"3540294","1","3543329","","2010-08-22 05:26:03","4","4313","<p>I want to increment a column in a sqlite android database. Im doing like this:</p><pre><code>public void atualiza(String word){   this.db.rawQuery(""UPDATE words SET count = count + 1 WHERE word= ? "", new String[] {word});     }</code></pre><p>And I call this method on another class like this:</p><pre><code>this.dh.atualiza(word); </code></pre><p>But when i pull the database from the emulator and check with the SQLite Database Browser, the field is not incremented. Why?</p>","399459","","523100","","2013-01-22 21:25:01","2013-01-22 21:25:01","How to increment field in sqlite android database","<android><database><sqlite><increment>","2","2","","",""
"3540426","1","3930548","","2010-08-22 06:16:49","0","745","<p>I am going through the <a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">Android Hello World</a>, but when I go to <code>Run &gt; Run</code> in Eclipse, it loads the emulator, takes a few moments, then loads the Android home screen. My app does not load automatically like the tutorial says, and I can't find it in the applications list.</p><p>How do I get my app to launch? What might I have done?</p><p>I am using Eclipse, and targeting Android 2.2</p><p><strong>EDIT*</strong> </p><p>When I run the application from Eclipse, I get this output in the concole:</p><pre><code>// Android Launch!// adb is running normally.// Performing com.adamharte.helloandroid.HelloAndroid activity launch// Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'// Launching a new emulator with Virtual Device 'my_avd'</code></pre><p>The emulator start on a black screen saying ""android_"" then shows a shimmering blue android logo, then goes to the ""unlock"" screen. I drag the lock to the right, and it goes to the android home screen. I can't find my ""HelloWorld"" app on any of the home screens, or applications list.</p>","78782","","78782","","2010-08-23 06:41:33","2010-10-14 06:12:43","Android not loading app","<android><mobile>","3","3","","",""
"3540475","1","","","2010-08-22 06:38:59","0","1022","<p>How can I determine the number of visible characters that a TextView can display. For example if I change the orientation this number may change. If I change the resolution then also the number of visible characters changes.</p><p>Thanks in advance</p><hr><p>Thank you for your answer.</p><p>Currently I am developing a small text based game to become acquainted with the Android API. For that reason I need to know exactly how much characters  can be displayed in the visible area of a TextView widget. I saw an example of Paint but wanted to know if there are better solutions.</p>","427481","","1288","","2012-08-23 11:37:56","2012-08-23 11:37:56","Android TextView and how to determine the number of visible characters","<android><textview>","2","0","","",""
"3540554","1","","","2010-08-22 07:18:31","0","461","<p>I have a ListView which is updated by some service sending intent. If update event arrives while I'm pressing some item in the ListView I get some weird behavior. The default orange rectangle in the pressed item disappears and some other item(s)'s text becomes darker (as if its item is being pressed). </p><p>How do I postpone ListView update after it becomes ""not pressed""? Or more specifically which events should I listen to in order to determine that ListView is no longer pressed? (I can create some thread executed periodically to update when it's appropriate but I think it's overkill). Or maybe there are better solution or workaround.</p><p>Here is sample code illustrating the problem. Service sends update intents every 2 seconds. If I try to long press some item in the list I get the weird behavior I described above.</p><p>The activity:</p><pre><code>package org.me.listviewupdate;import android.app.ListActivity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.widget.ArrayAdapter;public class MyActivity extends ListActivity {    private class MyHandler extends Handler {        @Override        public void handleMessage(Message msg) {            switch (msg.what) {                case MSG_UPDATE_DATA:                    mAdapter.notifyDataSetChanged();                    break;                default:                    super.handleMessage(msg);                    break;            }        }    }    private class MyBroadcastReceiver extends BroadcastReceiver {        @Override        public void onReceive(Context context, Intent intent) {            mHandler.sendEmptyMessage(MSG_UPDATE_DATA);        }    }    private static final int MSG_UPDATE_DATA = 0;    private String[] mItems = new String[] { ""Item1"", ""Item2"", ""Item3"", ""Item4"" };    private ArrayAdapter&lt;String&gt; mAdapter;    private Handler mHandler;    private BroadcastReceiver mBroadcastReceiver;    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        mHandler = new MyHandler();        mAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,                android.R.id.text1, mItems);        setListAdapter(mAdapter);        mBroadcastReceiver = new MyBroadcastReceiver();        registerReceiver(mBroadcastReceiver, new IntentFilter(MyService.UPDATE_EVENT));        startService(new Intent(this, MyService.class));    }    @Override    protected void onDestroy() {        unregisterReceiver(mBroadcastReceiver);        stopService(new Intent(this, MyService.class));        super.onDestroy();    }}</code></pre><p>The service:</p><pre><code>package org.me.listviewupdate;import android.app.Service;import android.content.Intent;import android.os.IBinder;import java.util.concurrent.Executors;import java.util.concurrent.ScheduledExecutorService;import java.util.concurrent.TimeUnit;public class MyService extends Service {    private class MyUpdateTask implements Runnable {        public void run() {            sendBroadcast(new Intent(UPDATE_EVENT));        }    }    public static final String UPDATE_EVENT =            ""org.me.listviewupdate.intent.event.UPDATED"";    private static final int UPDATE_INTERVAL = 2;    private ScheduledExecutorService mUpdater;    @Override    public IBinder onBind(Intent arg0) {        return null;    }    @Override    public void onCreate() {        super.onCreate();        mUpdater = Executors.newSingleThreadScheduledExecutor();    }    @Override    public void onDestroy() {        mUpdater.shutdownNow();        super.onDestroy();    }    @Override    public void onStart(Intent intent, int startId) {        super.onStart(intent, startId);        mUpdater.scheduleAtFixedRate(new MyUpdateTask(), UPDATE_INTERVAL,                UPDATE_INTERVAL, TimeUnit.SECONDS);    }}</code></pre><p>Thank you.</p><p><strong>My solution.</strong> Well, just in case it may help somebody here is my solution. The code added to <code>MyActivity.onCreate()</code>:</p><pre><code>getListView().setOnTouchListener(new OnTouchListener() {    @Override    public boolean onTouch(View v, MotionEvent event) {        boolean isReleased = event.getAction() == MotionEvent.ACTION_UP                || event.getAction() == MotionEvent.ACTION_CANCEL;        if (mHasPendingUpdate &amp;&amp; isReleased) {            mHandler.sendEmptyMessage(MSG_UPDATE_DATA);        }        return false;    }});getListView().setOnKeyListener(new OnKeyListener() {    @Override    public boolean onKey(View v, int keyCode, KeyEvent event) {        boolean isKeyOfInterest = keyCode == KeyEvent.KEYCODE_DPAD_CENTER                || keyCode == KeyEvent.KEYCODE_ENTER;        boolean isReleased = event.getAction() == KeyEvent.ACTION_UP;        if (mHasPendingUpdate &amp;&amp; isKeyOfInterest &amp;&amp; isReleased) {            mHandler.sendEmptyMessage(MSG_UPDATE_DATA);        }        return false;    }});</code></pre><p>Also I added a variable <code>mHasPendingUpdate</code> and modified <code>MyHandler</code>:</p><pre><code>private class MyHandler extends Handler {    @Override    public void handleMessage(Message msg) {        switch (msg.what) {            case MSG_UPDATE_DATA:                if (getListView().isPressed()) {                    mHasPendingUpdate = true;                } else {                    mAdapter.notifyDataSetChanged();                    mHasPendingUpdate = false;                }                break;            default:                super.handleMessage(msg);                break;        }    }}</code></pre>","394541","","394541","","2010-08-22 13:17:05","2010-08-22 13:17:05","How to prevent ListView from updating while item is long pressed?","<android><listview>","1","0","","",""
"3540739","1","","","2010-08-22 08:30:57","4","761","<p>Is it possible to programmatially read the date when my Android apk was built? I could not find anything in the PackageInfo class.</p><p>I want to expire beta versions of my app and the easiest way would be to read out such a date and expire it after a fix preiode of days, so I don't have to update the code for that eavery time I build and deploy a beta version.</p>","424478","","","","","2014-03-26 01:06:04","How to programmatically read the date when my Android apk was built?","<android><date><build><apk>","2","0","1","",""
"3540805","1","3541015","","2010-08-22 08:53:30","3","318","<p>I want to run a django app on a hand-held device. It'll need to run Python (obviously) and will write its data to an SQLite database. </p><p>Are there any tablets available that will let me do this? Specifically, if I bought an Android tablet, would I have to/be able to install linux instead, or would I be able to run it under Android?</p>","347999","","347999","","2010-08-22 09:47:27","2010-08-22 10:52:35","Is it possible to run linux on hand-held tablets?","<python><android><django>","2","0","","",""
"3540807","1","","","2010-08-22 08:53:55","0","863","<p>Help! With Windows 7, Galileo, Eclipse 3.5.2: every time I click Finish when installing ADT I get the error 'Install has encountered a problem - an error occurred while uninstalling'. Details:  </p><pre><code>String index out of range:0 eclipse.buildId=unknownjava.version=1.6.0_21java.vendor=Sun Microsystems Inc.BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GBFramework arguments:  -product org.eclipse.epp.package.java.productCommand-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product</code></pre><p>Error</p><pre><code>Sat Aug 21 15:40:46 BST 2010session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Uninstall, operand=[R]org.apache.commons.lang 2.3.0.v200803061910 --&gt; [R]org.apache.commons.lang 2.3.0.v201005080501, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.UninstallBundleAction).</code></pre>","427167","","180538","","2010-12-21 09:58:58","2010-12-21 09:58:58","Can't install Android ADT in Eclipse","<android><eclipse><install>","2","0","","",""
"3540872","1","3850828","","2010-08-22 09:15:27","0","2729","<p>I'm using the Android's <code>MediaPlayer</code> class to play some remote resources. I would like the user to be able to reuse the <code>MediaPlayer</code> to open some content and then change it to play another one without having to recreate the <code>MediaPlayer</code>.</p><p>So, I wrote a method to open a resource which, first of all, resets the <code>MediaPlayer</code> so that I can send it to the idle state. After that, I set the new URI and I call the prepare method. It happens quite often, anyway, that the method <code>setDataSource</code> hangs, for many seconds and even for minutes. This is the code:</p><pre><code>mediaPlayer.reset();  mediaPlayer.setDataSource(this, Uri.parse(uri));  mediaPlayer.setDisplay(surfaceHolder);  mediaPlayer.prepare();  mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);</code></pre><p>Any idea why the method should hang for many seconds after setDataSource and before the setDisplay method?Thanks!</p>","427544","","2218452","","2013-05-30 09:14:45","2013-05-30 09:14:45","Reusing Android's MediaPlayer","<android><media-player>","1","0","","",""
"3540876","1","3541087","","2010-08-22 09:15:43","7","9320","<p>I have an <code>onKeyDown</code> event which is only needed for handling the Up and Down hardware keys in my app. For these it returns true, as they are handled.For anything else it returns false which I understand means that the OS should handle them.However, when I press the Back button, my <code>onKeyDown</code> is called and returns false, but there is no other effect. I want/would expect the OS to finish the current <code>Activity</code> and resume the previous one.</p><p>Is this correct behavior, or is there something amis?</p><p>Update:</p><p>Cheers guys, my onKeyDown routine looks like this, now I've followed CommonsWare's advice:</p><pre><code>@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    super.onKeyDown(keyCode, event);    boolean handled = true;    // handle key presses    switch (keyCode) {    case KeyEvent.KEYCODE_DPAD_LEFT:        mCursorX = mCursorX - 1;        if (mCursorX &lt; MAP_MIN_X) { mCursorX = MAP_MIN_X; }        break;    case KeyEvent.KEYCODE_DPAD_RIGHT:        mCursorX = mCursorX + 1;        if (mCursorX &gt; MAP_MAX_X) { mCursorX = MAP_MAX_X; }        break;    default:        handled = false;    if (handled) {        redrawCursorno();        return true;    }    return super.onKeyDown(keyCode,event);}</code></pre><p>My class looks like:</p><pre><code>public class Map extends Activity implements OnClickListener, SurfaceHolder.Callback, OnTouchListener {</code></pre><p>I must admit I didn't know why the @override and the first 'super' line were there, they were just in all the routines I looked at.If the super.onKeyDown runs the onKeyDown for the Activity, then I probably don't want it at the start, only at the end if my routine doesn't handle it, which I think is what I've added.Does that sound about right, or am I still confused?</p><p>-Frink</p>","131209","","131209","","2010-08-22 18:13:45","2010-08-22 19:45:14","Handling Android hardware Back button","<android><back-button>","3","2","","",""
"3541061","1","3541101","","2010-08-22 10:17:56","1","5003","<p>I'm following the <a href=""http://developer.android.com/guide/tutorials/views/hello-mapview.html"" rel=""nofollow"">MapView</a> tutorial on the Android website</p><pre><code>[2010-08-22 11:12:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestParser] Parser exception for /MeCercana/AndroidManifest.xml: Open quote is expected for attribute ""android:name"" associated with an  element type  ""uses-library"".[2010-08-22 11:12:24 - MeCercana] Error in an XML file: aborting build.</code></pre><p>I've copied in the external Maps API as instructed, my XML file looks as follows </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.jameselsey""      android:versionCode=""1""      android:versionName=""1.0""&gt;  &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;     &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;          &lt;uses-library android:name=”com.google.android.maps” /&gt;                  &lt;activity android:name="".Mecercana""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>However, when I try to compile and run I get the following error</p><p>I'm unable to see what is wrong with my XML?</p>","155695","","","","","2010-08-22 10:26:16","AndroidManifest.xml; unable to include external library","<android><android-manifest>","1","0","","",""
"3541125","1","3541183","","2010-08-22 10:34:01","6","978","<p>Hi: I want to release multiple applications to android marketplace which are all very slightly customized based on a code base. I can't just change the package indentifier in the AndroidManifest.xml file because several other things dependet on this like action identifiers and so on.What is the best approach to release several apps based on one eclipse project with the same code base?</p>","281535","","","","","2011-07-03 18:02:42","Release several android applications with same code base","<android>","1","0","1","",""
"3541200","1","3541229","","2010-08-22 10:54:14","1","430","<p>Have following setup:</p><p>MainActivity class - extends activity</p><p>MyLayout class - extends View</p><p>Prefs class - extends PreferenceActivity and implements OnSharedPreferenceChangeListener</p><p>MainActivity creates a MyLayout class and sets it as its contentview. Once the user presses on the menu, Prefs class starts where the user can change some settings.</p><p>What I want is that, once the user changes a setting, the overloaded OnsharedPreferenceChanged method in the Prefs class will be called and from there I would like to invoke public methods on the MyLayout class that was created in the MainActivity.</p><p>How can I do this?</p>","62570","","","","","2010-08-22 14:21:35","accessing a class from another activity","<android><activity><android-preferences>","2","0","","",""
"3541287","1","","","2010-08-22 11:22:33","1","994","<p>What way is most efficient for updating an widget that will be a clock(Timer/Alarm), but for a clock to really works, like a clock it would be needed to update at least twice in a minute (30 sec period or less). </p><p>But that can't be effective? Have looked at some of the ""threads/topics"" here at StackOverFlow but haven't found any information regarding effectiveness. </p><p>(Don't own an android device yet, so I can't really test battery draining and cpu)</p>","427599","","","","","2010-08-22 12:46:24","Android: Widget updating a clock with custom images as numbers","<android><bitmap><widget><clock>","1","2","","",""
"3541362","1","3541381","","2010-08-22 11:49:47","1","455","<p>I am developing an Android application where I get the following exception while writing to the database:</p><pre><code>An exception occurred: android.database.sqlite.SQLiteException</code></pre><p>But it doest say anything else(not even the stack trace). </p><p>In general I find it very difficult to debug android SDK exceptions.</p><p>Any suggestions/tips on how to debug while developing android applications?</p><ul><li>I am using Eclipse to develop the application. </li></ul>","427606","","427606","","2011-08-23 14:39:32","2011-08-23 14:39:32","Debug android application","<android>","2","4","2","",""
"3541384","1","3541478","","2010-08-22 11:57:01","3","2807","<p>This is the way I listen for GPS location updates (using <code>LocationManager</code> and a <code>LocationListener</code>):</p><pre><code>locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);listener = new MyLocationistener(); // LocationListenerlocationManager.requestLocationUpdates(        LocationManager.GPS_PROVIDER,         30000, // milliseconds (minTime)        20, // meters (minDistance)        listener );</code></pre><p>But I would like to dynamically adjust the <code>minTime</code> and <code>minDistance</code> arguments used by <code>LocationManager#requestLocationUpdates</code>. My aim is to save battery, according to several usage policies, i.e.:</p><ul><li>If the user is not moving, increase the minTime to get a location update</li><li>If the user is moving very fast, increase the minDistance</li><li>If the user is indoors (no GPS coverage), increase both</li><li>If the battery is too low, increase both</li><li>... (any other heuristic)</li></ul><p>I would like to know:</p><ol><li>Is this really a good idea to save battery life ?</li><li>How could I do that kind of adjustments?  I can call both <code>LocationManager#removeUpdates</code> and <code>LocationManager#requestLocationUpdates</code> again, if there is the only alternative.</li><li>Any idea or sample code you know to implement this kind of adaptive algorithms ?</li></ol><p>Edit: The application is a tracking system to know where people are, in order to assign tasks to the person nearest to a given poing.  Actually battery hardly lasts  8 hours, so I'd like to increase it.</p>","12388","","12388","","2010-08-22 20:38:22","2012-12-11 05:07:58","Android : LocationManager dynamically adjust minTime/minDistance thresholds","<android><android-location>","3","2","3","",""
"3541479","1","","","2010-08-22 12:28:08","0","1072","<p>Hi i'm working on a service that collect data from sensor and save a fast fourier trasform in to the db, but when i press the red phone button (to make the screen black) it don't save anything. Any idea?</p><p>In addition i noticed that when i stop the service, it continues to read sensors, how should I do?</p><p>This is the code that i use to connect and start the service:</p><pre><code>private ServiceConnection mConnection = new ServiceConnection() {        public void onServiceConnected(ComponentName className, IBinder service) {            myService = (IMyService) service;            myService.set(toRec,CAMPIONI_FFT);        }        public void onServiceDisconnected(ComponentName className) {        }    };    void doBindService() {        bindService(new Intent(SensorsState.this,                 SensorService.class), mConnection, Context.BIND_AUTO_CREATE);        mIsBound = true;    }    void doUnbindService() {        if (mIsBound) {            // Detach our existing connection.            unbindService(mConnection);            mIsBound = false;        }    }    @Override    protected void onDestroy() {        super.onDestroy();        doUnbindService();    }</code></pre><p>And this is my Service (public recClass recc; is the class that manage the db):</p><pre><code>public class SensorService extends Service implements SensorEventListener {private static final String TAG = ""MyService"";private MyServiceBinder myServiceBinder = new MyServiceBinder();private SensorManager mSensorManager;public float[] dataBuffer;public boolean mIsStarted = false;public FourierClass fft;public recClass recc;public String toRec;public int camp;MediaPlayer player;@Overridepublic IBinder onBind(Intent intent) {    return myServiceBinder; // object of the class that implements Service interface.}public class MyServiceBinder extends Binder implements IMyService {    public void set(String tr, int cp) {        toRec = tr;        camp = cp;        fft = new FourierClass(camp);        mIsStarted = true;    }}@Overridepublic void onCreate() {    Log.d(TAG, ""onCreate"");    // Get the SensorManager     mSensorManager= (SensorManager) getSystemService(SENSOR_SERVICE);    mSensorManager.registerListener(this,            mSensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER).get(0),            SensorManager.SENSOR_DELAY_NORMAL);    recc =  new recClass(this);    recc.open();}@Overridepublic void onDestroy() {    Log.d(TAG, ""onDestroy"");    mIsStarted = false;    recc.close();}@Overridepublic void onStart(Intent intent, int startid) {    Log.d(TAG, ""onStart"");    mIsStarted = true;}@Overridepublic void onSensorChanged(SensorEvent event) {    // SensorEventListener    Sensor sens = event.sensor;    if ((sens.getType() == Sensor.TYPE_ACCELEROMETER) &amp;&amp; mIsStarted){            fft.add((float)Math.sqrt((event.values[0]*event.values[0])+(event.values[1]*event.values[1])+(event.values[2]*event.values[2])));   // Add value to the fft            dataBuffer = fft.calculate();            if (dataBuffer != null){                for (int i=0; i&lt;fft.camp;i++){                    if (toRec != getString(R.string.nuovo))                        recc.addValue(toRec, dataBuffer[i]);                }            }    }}@Overridepublic void onAccuracyChanged(Sensor sensor, int accuracy) {    // TODO Auto-generated method stub}</code></pre><p>}</p><p>Thanks</p><p>Valerio</p>","314554","","","","","2010-08-22 12:40:24","Connecting my Android service with the db","<android><database><service>","1","0","","",""
"3541582","1","3541652","","2010-08-22 13:10:49","1","412","<p>I have two buttons set, ""OK"" and ""Cancel"" in main.xml. I have <code>setOnclickListener</code> for the <strong>Cancel</strong>. When I click on <strong>OK</strong> i need another xml file say abc.xml to get displayed. I have added that xml file under the layout folder.</p><p>How do I do this?</p>","427629","","119895","","2010-08-22 13:30:20","2010-08-22 13:36:04","Issue on setOnclickListener","<android>","1","0","","",""
"3541681","1","3541694","","2010-08-22 13:44:43","0","8273","<p>I have an Array like:</p><pre><code> private static int[] f_arme = {     R.drawable.frankiearmevor_0001,      R.drawable.frankiearmevor_0002,      R.drawable.frankiearmevor_0003,      R.drawable.frankiearmevor_0004,      R.drawable.frankiearmevor_0005</code></pre><p>}</p><p>how Do I get the Size of that array (f_arme) ?? = 5I tried f_arme.size() but get ""cannot invoke size() on the array type int[]</p>","355372","","421372","","2012-12-21 20:32:38","2012-12-21 20:32:38","Android count size of INT Array","<android>","1","0","","",""
"3541718","1","3542046","","2010-08-22 13:55:31","1","512","<p>I have a ListActivity with a list of names (Jacob, Will, Matt, etc.).  I have a contextMenu which gives the user the option to edit or delete the person.  I know how to find the id to perform the edit and delete functionality, but I can't figure out how to get the person's name to be added to the intent extras or to add a toast when a delete occurs.</p><p>Here is a snippet of code that I'm using for the context menu:</p><pre><code>@Overridepublic boolean onContextItemSelected(MenuItem item) {    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();    switch(item.getItemId()) {    case DELETE_ID:        mDbHelper.deletePerson(info.id);        fillData();        return true;    case EDIT_ID:        Cursor c = mCursor;        c.moveToPosition(info.position);        Intent i = new Intent(this, PersonEdit.class);        i.putExtra(""_id"", info.id);        startActivityForResult(i, ACTIVITY_EDIT);        return true;    }    return super.onContextItemSelected(item);}</code></pre>","422967","","","","","2010-08-22 15:35:51","How do I get the text from a context menu?","<android>","2","0","","",""
"3541723","1","","","2010-08-22 13:56:10","3","784","<p>I have written a home screen widget as an ImageView, ie. the code generates the whole widget and writes it to RemoteViews as a bitmap. On slower devices with low memory, such as my G1, it can take a couple of seconds to generate the bitmap, and to avoid the dreaded force-close, I moved all the graphics code into an AsyncTask. So far so good.</p><p>However, in very low memory conditions, the AsyncTask can easily be killed by the OS before it has finished generating the bitmap, resulting in an empty square on the homescreen. So before creating the AsyncTask, it sets an alarm for now + 5 seconds, and after the graphics are complete, it resets the alarm. The assumption here is that if the alarm is triggered, more than likely the process was killed, and we have to set another now+5 alarm and start again.</p><p>This does work, but in extreme low memory conditions it can take several attempts (20+ seconds) to draw the widget, so I added a placeholder hourglass image, as a static resource, which is displayed on the homescreen until the real image is ready.</p><p>My question is this: is this the best way? Is there some way to (politely) ask the OS not to kill the AsyncTask until it's finished (on the grounds that killing it will actually result in <em>more</em> waste of system resources)?</p><p>I understand that if a process is categorised as ""visible"" then Android won't kill it except as a last resort. But I don't know how to tag an AsyncTask as ""visible"". I'm very happy for the process to be killed just as soon as it's done drawing the widget. Would just like it to stay alive long enough to complete.</p>","199011","","","","","2014-02-13 16:36:36","Keeping an AsyncTask alive in low memory conditions?","<android><memory><android-widget><android-asynctask>","3","0","","",""
"3541741","1","3542010","","2010-08-22 14:01:21","5","3961","<p>I am trying to add a badge to one of my Activity's button. Right now I am trying to do the xml.The Button with the badge, should look like this:</p><p><img src=""http://i.stack.imgur.com/a4sE8.png"" alt=""alt text""></p><p>I have already done the bubble and the text inside using a <code>RelativeLayout</code>:</p><pre><code>&lt;RelativeLayout android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;            &lt;ImageView android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:adjustViewBounds=""true""                android:src=""@drawable/badge""                android:layout_centerInParent=""true""/&gt;             &lt;TextView android:layout_width=""wrap_content""                        android:layout_height=""wrap_content""                       android:textStyle=""bold""                       android:text=""2""                       android:layout_centerInParent=""true"" /&gt;         &lt;/RelativeLayout&gt;</code></pre><p>But I can't find a way to place it there and making it work on portrait and landscape with the same xml.</p><p>The Buttoms in the <code>Activity</code> are like this:</p><pre><code>&lt;Button android:id=""@+id/new_releases_button""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""@drawable/ic_button_selector""            android:text=""@string/new_releases_title""            android:textColor=""#FFFFFF""            android:textSize=""20sp""            android:gravity=""center_vertical""            android:paddingLeft=""12dp""            android:layout_marginTop=""15dp""            android:layout_below=""@id/coming_soon_button""            android:onClick=""newReleaseClick""            android:layout_centerHorizontal=""true"" /&gt;        &lt;Button android:id=""@+id/top_sellers_button""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:background=""@drawable/ic_button_selector""            android:text=""@string/top_sellers_title""            android:textColor=""#FFFFFF""            android:textSize=""20sp""            android:gravity=""center_vertical""            android:paddingLeft=""12dp""            android:layout_marginTop=""15dp""            android:layout_below=""@id/new_releases_button""            android:onClick=""topSellersClick""            android:layout_centerHorizontal=""true"" /&gt;</code></pre><p>and here are the two resources:</p><p><img src=""http://i.stack.imgur.com/AVlNF.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/Nfkfp.png"" alt=""alt text""></p><p>How should I do the xml?</p><p>EDIT:Best approach so far, but it still doesn't work:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;Button android:id=""@+id/discounts_button""                android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:background=""@drawable/ic_button_selector""                android:text=""@string/discounts_title""                android:textColor=""#FFFFFF""                android:textSize=""20sp""                android:onClick=""discountsClick""                android:layout_marginTop=""40dp""                android:layout_marginLeft=""20dp""/&gt;        &lt;RelativeLayout android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_gravity=""top|left""&gt;            &lt;ImageView android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                    android:adjustViewBounds=""true""                    android:src=""@drawable/badge""                    android:layout_centerInParent=""true""/&gt;             &lt;TextView android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                           android:textStyle=""bold""                           android:text=""20""                           android:layout_centerInParent=""true"" /&gt;         &lt;/RelativeLayout&gt;&lt;/FrameLayout&gt;</code></pre>","119895","","119895","","2010-08-22 16:12:11","2010-08-22 16:40:09","Positioning a badge bubble on the left upper side of a button","<android>","2","0","2","",""
"3541810","1","3541915","","2010-08-22 14:27:31","2","1328","<p>I am looking for a way to create dynamic preferences where I don't need to hard code the preference key and I could have a variable number of preferences. Basically, my application will let the user create a multiple number of profiles and each of these profiles will save custom values for a fixed number of preferences.<br>So this way, the user does not have to change the preferences every time he wants this app to run differently, he can just switch the profile. One way I think will work is by subclassing all the standard Preference classes and calling their setKey method with my custom preference key, containing the profile name, but this is ugly.So is there a cleaner and more standards compliant way to do this?Regards,Dhruwat</p>","427669","","","","","2010-08-22 14:59:01","Dynamic preferences for a variable number of profiles in an Android app","<android><android-preferences>","1","0","","",""
"3541811","1","4345207","","2010-08-22 14:27:39","10","10895","<p>I'm unable to start up my Android application in Eclipse, I'm getting the following error when I select ""Run as Android Application""</p><p>I have my Android Virtual Device running, can't see any issues with that (I'm able to navigate around the OS on the emulator etc)</p><p>When I try to ""Run as Application"" I get the following popup from eclipse</p><pre><code>An internal error occurred during: ""Launching myApp"".</code></pre><p>When selecting ""View Error Log"" this is as much info as I can get</p><pre><code>java.lang.NullPointerExceptionat com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(Unknown Source)at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(Unknown Source)at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(Unknown Source)at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)</code></pre><p>Something wrong with the ADT plugin maybe?</p>","155695","","","","","2013-09-14 09:32:21","Unable to launch Android application in Eclipse; An internal error occurred during: ""Launching myApp""","<android><android-emulator><eclipse-3.6>","3","2","1","",""
"3541849","1","3541886","","2010-08-22 14:42:15","3","1132","<p>I have the following code that I want to be able to loop every 30 seconds.</p><pre><code>MyLocation myLocation = new MyLocation();    public LocationResult locationResult = new LocationResult() {        @Override        public void gotLocation(final Location location) {            GeoPoint myGeoPoint = new GeoPoint(                    (int) (location.getLatitude() * 1000000),                    (int) (location.getLongitude() * 1000000));            myMapController.animateTo(myGeoPoint);            myMapController.setZoom(10);            lat = location.getLatitude();            lon = location.getLongitude();            new OverlayTask().execute();            Timer timer;            timer = new Timer();            timer.scheduleAtFixedRate(new MyTimerTask(), 30000, 30000);         }    };</code></pre><p>Gets fired once I have the location, and the OverlayTask executes fine, it also will execute when assigned to a menu item to force it.</p><p>However inside the timer I get an error.</p><pre><code>public class MyTimerTask extends TimerTask {    public void run() {        try {            Log.i(""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Refresh: "", ""Success"");            new OverlayTask().execute();        } catch (Exception e) {            Log.e(""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Error executing MyAsyncTask: "", e.getMessage(), e);        }    }}</code></pre><p>The error is....</p><blockquote>  <blockquote>    <p>Error executing MyAsyncTask:(2573): Only the original thread that created a view hierarchy can touch its views.</p>  </blockquote></blockquote>","103999","","244296","","2010-08-22 14:50:50","2010-08-22 14:52:27","Android Threading Issue","<android><timer><android-asynctask>","1","0","","",""
"3541855","1","3541873","","2010-08-22 14:43:29","0","232","<p>During my game loop I am constantly loading images using</p><pre><code>BitmapFactory.decodeResource(getResources(), R.drawable.objectx);</code></pre><p>Most of the time I'm calling images that have already been decoded earlier. Am I slowing down execution by decoding the resource every time?<br>Is it better to store every image into a Map (or Dictionary) at the beginning of the program? If so, how do you get the resource IDs for all images in the drawable folder?</p>","386764","","","","","2010-08-22 14:49:58","Android - What is the best way to maintain multiple images?","<android><resources><android-image>","1","0","","",""
"3541894","1","3542004","","2010-08-22 14:53:45","1","5699","<p>I get this error everytime I try to use my content provider to insert a URI. Here is the method:</p><pre><code>private void sample() {    ContentValues values;    values = new ContentValues();    values.put(Formulas.TITLE, ""Formula1"");    values.put(Formulas.FORMULA, ""someformula"");    getContentResolver().insert(getIntent().getData(), values);    values = new ContentValues();    values.put(Formulas.TITLE, ""Formula2"");    values.put(Formulas.FORMULA, ""someformula"");    getContentResolver().insert(getIntent().getData(), values);    values = new ContentValues();    values.put(Formulas.TITLE, ""Formula3"");    values.put(Formulas.FORMULA, ""someformula"");    getContentResolver().insert(getIntent().getData(), values);}</code></pre><p>Previously I set the Intent data here:</p><pre><code>Intent intent = getIntent();if (intent.getData() == null)    intent.setData(Formulas.CONTENT_URI);</code></pre><p>Here is my content URI and authority:</p><pre><code>public static final String AUTHORITY = ""com.mohit.provider.FormulaProvider"";public static final Uri CONTENT_URI = Uri.parse(""content:\\"" + AUTHORITY + ""\formulas"");</code></pre><p>Here is the provider tag:</p><pre><code>&lt;provider android:name=""com.mohit.provider.FormulaProvider""         android:authorities=""com.mohit.provider.FormulaProvider"" /&gt;</code></pre><p>And finally the Logcat log:</p><pre><code>08-22 14:42:07.362: ERROR/AndroidRuntime(338): FATAL EXCEPTION: main08-22 14:42:07.362: ERROR/AndroidRuntime(338): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mohit.gformula.activities/com.mohit.gformula.activities.FormulasList}: java.lang.IllegalArgumentException: Unknown URL content:\\com.mohit.provider.FormulaProvider\formulas08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.os.Handler.dispatchMessage(Handler.java:99)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.os.Looper.loop(Looper.java:123)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at java.lang.reflect.Method.invokeNative(Native Method)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at java.lang.reflect.Method.invoke(Method.java:521)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at dalvik.system.NativeStart.main(Native Method)08-22 14:42:07.362: ERROR/AndroidRuntime(338): Caused by: java.lang.IllegalArgumentException: Unknown URL content:\\com.mohit.provider.FormulaProvider\formulas08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.content.ContentResolver.insert(ContentResolver.java:583)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at com.mohit.gformula.activities.FormulasList.sample(FormulasList.java:38)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at com.mohit.gformula.activities.FormulasList.onCreate(FormulasList.java:23)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-22 14:42:07.362: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)</code></pre><p>What could be the problem?</p>","200477","","","","","2010-08-22 15:22:57","Unknown URL content:Unknown URL content:\com.mohit.provider.FormulaProvider\formulas","<java><android><uri><android-contentprovider>","1","0","","",""
"3541943","1","3543024","","2010-08-22 15:06:39","0","1534","<p>I have a gridview that is inflated by multiple buttons. I used just a gridview and it worked fine. The grid was in correct order and was centered. Although, I wanted to add a button below the grid of buttons that was different and centered. To do this I decided to section off the gridview and then add the button (therefore it wouldn't be affected by the gridview). I tried the following code to seperate the views:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TableLayout     android:id=""@+id/tbl_gridcreator""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""center""&gt;    &lt;TableRow&gt;        &lt;GridView            android:id=""@+id/gridview""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:columnWidth=""150px""            android:numColumns=""7""            android:stretchMode=""spacingWidthUniform""            android:gravity=""center""&gt;            &lt;!--             android:horizontalSpacing=""0px"" --&gt;        &lt;/GridView&gt;    &lt;/TableRow&gt;    &lt;TableRow android:gravity=""center""&gt;        &lt;Button android:text=""Submit""             android:id=""@+id/submit""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;        &lt;/Button&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The problem is that this code smushes the gridview to the left and oddly it flips it (Position 0 is ont he bottom right and the last button is on the top left pushed off screen). The following image shows what is the result:</p><p><img src=""http://img.photobucket.com/albums/v68/authoreety/gridview_problem.png""></p><p>Any idea why its pushed to the left and flipped? Or maybe how I could have just the Gridview with the button on the bottom?</p>","278447","","","","","2011-11-22 05:46:30","Trouble with getting a button along with gridview","<android><gridview>","1","0","","",""
"3542022","1","","","2010-08-22 15:30:23","0","862","<p>Since 2 months I have the new samsung galaxy S (I9000) android phone. This is the best phone I have ever had but since this week it manifests a verry weird problem.</p><p>After a few hours of running time it displays the ""usb connected"" message. After wich the device shuts down and will only restart with the cable connected. Altough that is probably due to a empty battery since the amoled screen won't go to standby due to the repeating notification.</p><p>I had the device flashed back to 2.1 by my official vendor point. The device isn't rooted in any way. </p><p>Has anyone had any simmilar problems?</p>","425454","","425454","","2010-08-22 16:52:06","2010-08-22 16:52:06","""usb connected"" notification while cable is not attached on android","<android><mobile-phones>","0","2","","",""
"3542065","1","3542124","","2010-08-22 15:40:14","3","1105","<p>This is maddening. I have the following XML layout:</p><pre><code>&lt;FrameLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:background=""@drawable/shadow"" android:focusable=""true"" android:focusableInTouchMode=""true""&gt;    &lt;ViewFlipper android:id=""@+id/flipper"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;EditText android:id=""@+id/reviews"" style=""@style/DescriptionArea"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:enabled=""false"" android:background=""@null"" /&gt;     &lt;EditText android:id=""@+id/notes"" style=""@style/DescriptionArea"" android:hint=""@string/detail_hint"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:enabled=""false"" android:maxLines=""4""/&gt;    &lt;/ViewFlipper&gt;&lt;/FrameLayout&gt;</code></pre><p>And the Java:</p><pre><code>viewFlipper = (ViewFlipper)findViewById(R.id.flipper);    slideLeftIn = AnimationUtils.loadAnimation(this, R.anim.slide_left_in);    slideLeftOut = AnimationUtils.loadAnimation(this, R.anim.slide_left_out);    slideRightIn = AnimationUtils.loadAnimation(this, R.anim.slide_right_in);    slideRightOut = AnimationUtils.loadAnimation(this, R.anim.slide_right_out);    gestureDetector = new GestureDetector(new MyGestureDetector());    gestureListener = new View.OnTouchListener() {        public boolean onTouch(View v, MotionEvent event) {            if (gestureDetector.onTouchEvent(event)) {                return true;            }            return false;        }    };</code></pre><p>It seems like if I try to fling on top of the EditText area, the gesture does not register. However, if I fling <em>around</em> it, that is, the background of the EditText, it DOES work. I've tried following around with the fill_parent/wrap_content heights and widths, but it doesn't seem to change a thing. I've confirmed this suspicion my making the EditText background ""red,"" and noting that nothing within that red rectangle can activate a fling. So how do I make this work?</p>","213345","","","","","2011-12-15 12:56:27","EditText not capturing ViewFlipper flings?","<android><edittext><gesture><viewflipper>","2","0","1","",""
"3542075","1","3542087","","2010-08-22 15:43:11","1","304","<p>Its a dumb question. Prepare yourself.</p><p>My main.xml is this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" android:background=""@android:color/white""&gt; &lt;ImageButton android:src=""@drawable/button"" android:scaleType=""fitStart""android:layout_height=""fill_parent""android:layout_width=""wrap_content"" /&gt; &lt;/RelativeLayout&gt;</code></pre><p>It works. However, I actually SEE an android button with my image inside it. When you click it, the outside turns orange and everything. How do I get it so that the outside button DOESN'T appear?</p><p>Help please?</p>","394842","","","","","2010-08-22 15:47:37","Android - Another button question","<android><eclipse><image><button><scale>","2","0","","",""
"3542092","1","3542211","","2010-08-22 15:46:21","1","752","<p>I am using Zend Studio 7.2 as my main IDE. I develope android apps. I wanted to work with html parsers, however adding external jars I get always the same problem <strong>Converting to dalvik format failed</strong> and eclipse needs a lot of time to build workspace.</p><p>any ideas?</p>","401025","","401025","","2011-03-18 06:53:24","2013-11-13 12:34:12","Converting to dalvik format failed when I try to add external Jars","<java><android><eclipse>","1","0","2","",""
"3542107","1","3542166","","2010-08-22 15:49:31","4","2836","<p>I have a simple form where a user can add, edit, and delete people from a list.  When a user has chosen to edit a person it executes startActivityForResult so it can make the appropriate changes and refresh the list once the edit is complete.  If the user clicks the back button from the edit screen a force close error appears.</p><p>I believe it has something to do with the system expecting a result, and I'm not trapping it properly.  How would I trap this error?</p><p>Here is the onActivityResult code currently in place:</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); Bundle extras = intent.getExtras(); switch(requestCode) { case ACTIVITY_CREATE:  String person = extras.getString(""person"");  mDbHelper.addPerson(person);  fillData();  break; case ACTIVITY_EDIT:  Long rowId = extras.getLong(""_id"");  if (rowId != null) {   String editPerson = extras.getString(""person"");   mDbHelper.updatePerson(rowId, editPerson);  }  fillData();  break; }}</code></pre><p>Thank you for any help.</p>","422967","","","","","2011-04-01 00:56:10","How do I handle the back button when startActivityForResult is active?","<android>","2","0","1","",""
"3542159","1","3542606","","2010-08-22 15:59:34","2","986","<p>I've created an Android application from Windows command line (not using Eclipse), how do I add a JAR file and make it part of my application? I've copied the JAR I created to the lib folder. </p>","188674","","","","","2010-08-22 17:56:54","Use JAR (library) In Android Application","<android>","2","0","","",""
"3542163","1","","","2010-08-22 16:00:16","1","148","<p>I am using Eclipse and developed an app that has 3 tabs using Android 1.5.  The program works just fine.1st problem--whenever the app is run, it change orientations, but does not show the scroll bars, thus allowing to scroll down(or up).  Is this suppose to be happening?  And how is it corrected?</p><p>2nd problem--if you are on say tab2, then open or close the key board (T-Mobile G1), the tab2 switches to tab1.  No matter if you are one tab1 or tab2, opening/closing the keyboard will switch it back to tab1.  Does anyone know what the fix is?</p><p>Thanks for all the help and assistance,Rc3375@gmail.com</p>","263203","","272824","","2010-08-22 16:16:45","2010-08-22 16:16:45","Android Orientation problem","<android><keyboard><scrolling><hardware><tabs>","1","1","","",""
"3542219","1","","","2010-08-22 16:11:08","5","2432","<p>I will like to know if we can continuously call some service for fetching results and displaying in Autocomplete list.</p><p>I have one screen with the text box and when user starts entering in that textbox the autocomplete should get filled with the data. The data will not be hardcoded and will be fetched through http connection. I think I need to call http connection in onTextChanged method of Edittext but is that the perfect solution.</p><p>Moreover, should this type of implementation done in mobile application. Since, this feature is web based. Can this be done in mobile application too?</p><p>Is this feasible?</p>","261566","","261566","","2010-08-22 19:12:54","2010-08-26 18:22:09","Dynamically update autocomplete box in Android?","<android><autocomplete><dynamic>","1","1","3","",""
"3542224","1","3549064","","2010-08-22 16:12:42","3","1158","<p>I created a custom dialog that I'm dynamically putting views into via a RelativeLayout.  Every time the dialog is displayed, it shows all my child views just great, but it has some space at the top that I can not account for.  I'm assuming this is reserved for a ""title"" of the dialog (which I won't have).  Is there a way to remove that space and have my custom dialog just wrap the contents that I'm putting in?</p><p>here is the xml for the layout:</p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;RelativeLayout     android:id=""@+id/handlay""     android:layout_width=""fill_parent""      android:layout_height=""wrap_content"" /&gt;  &lt;/LinearLayout&gt;</code></pre><p>incidentally, I've tried just having the relative layout be the parent node, with the same results.</p><p>Here is the .java for the custom dialog.</p><pre><code>public class HandResults extends Dialog implements DialogInterface {    HandResults hr;    Timer myTimer;    RelativeLayout handrl;    // constructor sets the layout view to handresult layout    public HandResults(Context context) {        super(context);        setContentView(R.layout.handresults);        hr = this;    }    // create a timer to remove the dialog after 3 seconds    public void showHands(){        this.show();        myTimer = null;        myTimer = new Timer();        myTimer.schedule(new TimerTask() {            @Override            public void run() {                hr.cancel();             }        }, 3000);    }}</code></pre><p>and here is how I would call the dialog:</p><pre><code>HandResults mhr = new HandResults(this);mhr.showHands();</code></pre><p>no matter what I do or how I change the layout file, I always have that buffer at the top, how can I get rid of that?</p>","233971","","","","","2010-08-23 15:32:28","remove extra real-estate from top of custom dialog","<android><dialog><relativelayout>","1","0","","",""
"3542268","1","3543637","","2010-08-22 16:24:15","18","14809","<p>What are the minimal steps necessary (including retrieving the source code) to compile and run just the Dalvik virtual machine on Linux?</p><p>Thanks.</p>","367395","","","","","2012-11-19 10:42:17","How can I compile Dalvik to run it locally on Linux?","<android><dalvik>","4","4","6","",""
"3542294","1","3545193","","2010-08-22 16:32:25","0","1906","<p>how can i import musica fonts into eclipse to support musical unicode? Any workaround? </p>","427722","","","","","2010-08-23 06:35:54","import fonts into eclipse to support unicode","<android><eclipse><unicode><fonts><music>","1","0","","",""
"3542312","1","3545954","","2010-08-22 16:37:57","56","19001","<p>They both inherits ViewAnimator. I know that ViewSwitcher allows only two views, while ViewFlipper allows more. But why did Android create ViewSwitcher if it is just a ViewFlipper with 2 views? Is there any other differences? What condition will make using one superior than the other?</p>","412759","","","","","2012-09-20 21:57:16","What's the difference between ViewFlipper and ViewSwitcher","<android>","3","0","18","",""
"3542320","1","","","2010-08-22 16:40:33","1","3235","<p>Is it possible to intercept an SMS coming from a certain number and direct it to a certain application on the iPhone/Android where it will be processed?Thanks.</p>","427732","","","","","2012-06-11 00:10:23","IPhone/Android SMS intercept and redirection to an application","<iphone><android><sms><intercept>","5","0","0","",""
"3542333","1","3542895","","2010-08-22 16:45:07","71","21032","<p>I've successfully implemented <code>onRetainNonConfigurationInstance()</code> for my main activity to save and restore certain critical components across screen orientation changes. </p><p>But it seems, my custom views are being re-created from scratch when the orientation changes. This makes sense, although in my case it's inconvenient because the custom view in question is an X/Y plot and the plotted points are stored in the custom view. </p><p>Is there a crafty way to implement something similar to onRetainNonConfigurationInstance() for a custom view, or do I need to just implement methods in the custom view which allow me to get and set its ""state""?</p><p>Thanks!</p>","268803","","844882","","2012-07-02 04:00:39","2013-12-06 13:03:10","How to prevent Custom Views from losing state across screen orientation changes","<android><android-activity><state><screen-orientation>","3","0","71","",""
"3542338","1","3542373","","2010-08-22 16:46:52","1","480","<p>Before I found out about that adb shell doesn't have the permission to do much with /data/data I was using my unrooted Verizon Droid for development of a content provider. How do I get rid of the database I created there? Is my best option writing a small app that drops the database?</p>","267257","","","","","2010-08-22 16:56:37","How do I 'drop' an sqlite DB on an unrooted Android phone?","<android><sqlite>","1","0","","",""
"3542349","1","","","2010-08-22 16:49:12","0","1730","<p>I try to write to a Csv file via:</p><pre><code>mFileWriter = new FileWriter(        ""/sdcard/program/file"");mCsvWriter = new CSVWriter(mFileWriter);</code></pre><p>At the moment it throws an exception that the file doesn't exist.It's true that the file doesn't exist. What's the easiest way to create the file?</p>","25282","","25282","","2010-08-22 22:35:42","2010-08-22 22:35:42","Android writing to a CSV file via OpenCsv","<java><android><file-io><csv>","1","0","","",""
"3542394","1","3542999","","2010-08-22 17:02:01","1","1234","<p>I am having an activity with two ViewGroup as it's children, and each ViewGroup has one or more views in it. I found that the dispatchDraw() is being called four times each time I make change, and 10 times when I use ViewFlipper to flip to next or previous. It really kills my performance, but I can't find out where these draws come from by Thread.dumpStack. They all look identical in the stack dump. Does anybody know when will Android calls dispatchDraw, which in turn calls onDraw of view? I know there's an article in dev guide telling me HOW Android draws views, but it doesn't tell me WHEN.</p>","412759","","","","","2010-08-22 19:28:54","Too many dispatchDraw, why?","<android>","1","0","1","",""
"3542456","1","3542492","","2010-08-22 17:19:56","0","361","<p>I have a custom view and I simply wish to access the xml layout value of <code>layout_height</code>. </p><p>I am presently getting that information and storing it during onMeasure, but that only happens when the view is first painted. My view is an XY plot and it needs to know its height as early as possible so it can start performing calculations. </p><p>The view is on the fourth page of a viewFlipper layout, so the user may not flip to it for a while, but when they do flip to it, I would like the view to already contain data, which requires that I have the height to make the calculations. </p><p>Thanks!!!</p>","268803","","","","","2012-08-21 05:04:51","How do I access layout_height from within my custom view?","<android><layout><custom-view>","2","0","","",""
"3542580","1","3552563","","2010-08-22 17:50:27","1","1305","<p>I am working on a simple app for the HTC EVO that blinks the alternate notification LED when a new text message is received. I have this part working great via a Broadcast Receiver but I need some way to turn the LED off when the user has read the message(s) using their default SMS app. I'm not sure if it is best to do this in the receiver or in a background service. I found <a href=""http://developer.android.com/reference/android/telephony/SmsMessage.html#getStatusOnIcc%28%29"" rel=""nofollow"">this</a>, which might be what I am looking for, but I have no idea on how to use it as I could not find any instructions or tutorials.</p>","192185","","","","","2010-08-26 16:41:09","Checking if a new SMS has been read","<android><sms><notifications><message><led>","2","0","1","",""
"3542657","1","3543650","","2010-08-22 18:09:43","0","173","<p>I'm using the jexcel api in my android application. It works great on devices running Android 2.2, but any other device just gives a blank String when I try to get the contents of a cell.</p><p>I've narrowed the thing thats not working to the Cell.getContents() method in the jexcel api. All android version below 2.2 are able to get the workbook, get the sheets, get the number of sheets, and they can get the cells, but when trying to get the contents within that cell, it return a blank string.</p><p>Is there something wrong with the library, or is it an android problem</p>","425296","","","","","2010-08-22 22:09:36","Anything below froyo can't read method in 3rd party library","<android>","1","2","","",""
"3542701","1","3542771","","2010-08-22 18:18:56","4","3335","<p>I'm new to android, bear it with me.</p><p>I've a TimerTask for which I define run() inside the Service. Inside run(), I'm calling </p><pre><code>locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,    LOCATION_UPDATES_MIN_TIME_MS, LOCATION_UPDATES_MIN_DISTANCE_M, gpsListener);</code></pre><p>and it complains that can't create Handler, since I believe its a background thread. How do I solve it?</p><p>Edit: Code snippet</p><pre><code>locationTask = new TimerTask() {        @Override        public void run() {            Log.d(Commands.TAG, ""Running location Task"");            myLocationProvider = new MyLocationProvider(locationManager, handler, MyService.this);            myLocationProvider.start();            myLocationProvider.stop();        }    };</code></pre><p>and later its Scheduled as below:</p><pre><code>locationTimer = new Timer();  locationTimer.schedule(locationTask, 10000, cmds.getAlertInterval()*60);</code></pre><hr><p>and when .start is called, requestLocationUpdates() fails</p>","389161","","389161","","2010-08-23 12:16:32","2011-10-13 06:33:15","Handler inside a Thread run","<android>","2","1","","",""
"3542961","1","","","2010-08-22 19:20:21","0","322","<p>Is it possible to set up a form in an application and have the person filling out the form send the information to you?  If so could I get some examples?</p>","424421","","1288","","2010-08-24 11:28:55","2010-08-24 11:28:55","sending email from android application?","<android>","1","0","","",""
"3542989","1","","","2010-08-22 19:27:10","4","4817","<p>I am using the hello android tutorial and creating an avd through eclipse.  When starting the emulator no image is used.  It simply displays a black back screen with the word ANDROID in the center and a blinking cursor at the end of the word ANDROID.  I have followed the steps to the T for installing the SDK, Eclipse, and the ADT.  Even starting the emulator as a standalone produces the same result.  Is there a step I am missing to get the emulator to load an android environment to test in?</p>","427816","","218159","","2010-08-22 19:37:03","2013-01-18 21:12:01","Emulator does not load","<android><eclipse><android-emulator><avd>","1","1","","",""
"3542998","1","3543672","","2010-08-22 19:28:52","1","1378","<p>I have a fairly simple application that uses a ListActivity to display a ListView.  Each ListView item has a CheckBox so that the user can specify favorite items.  I am using a class that extends SimpleCursorAdapter so that I can capture both the CheckBox changed event (to save the change to the database) and the list item clicked event (to load an item details activity).</p><p>After the OnCheckChangedListener implementation updates the database, I call .requery() on the cursor so that when an item scrolls off and then back on to the screen, the CheckBox has the proper state.</p><p>That all works fine.  Where I am having problems is in another activity where I am reusing the same ListView layout and the same cursor adapter to display a specific subset of items as part of a different activity's layout.  When I use the layout there, everything is fine until I tap the CheckBox, at which point the entire ListView disappears.  The database is updated, but until I leave the activity and come back, the ListView is just totally gone. </p><p>If I don't call .requery() on the cursor, everything works fine; the ListView does not disappear (but the CheckBox state will be wrong some of the time, as described above).</p><p>Working layout, event_list.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout01""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TextView android:layout_width=""wrap_content"" android:text=""@+id/eventsHeader""        android:id=""@+id/eventsHeader"" android:gravity=""center_vertical""        android:layout_height=""wrap_content"" android:textSize=""15sp"" /&gt;    &lt;ListView android:id=""@+id/android:list"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_below=""@+id/showHistoricalEvents"" /&gt;    &lt;CheckBox android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:id=""@+id/showHistoricalEvents""        android:layout_alignParentRight=""true"" android:layout_alignParentTop=""true""        android:text=""Show Past Events"" android:textSize=""14sp"" /&gt;    &lt;TextView android:id=""@+id/android:empty"" android:text=""@string/no_events""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_below=""@+id/showHistoricalEvents"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Broken layout, track_details.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content"" android:orientation=""vertical""    android:layout_width=""fill_parent""&gt;    &lt;TextView android:layout_width=""wrap_content"" android:id=""@+id/InterestLabel""        android:layout_alignParentLeft=""true"" android:text=""@string/interest_level""        android:gravity=""center_vertical"" android:layout_height=""fill_parent""        android:layout_above=""@+id/track_name"" /&gt;    &lt;Spinner android:layout_height=""wrap_content"" android:id=""@+id/InterestSpinner""        android:entries=""@array/priority"" android:layout_alignParentTop=""true""        android:layout_toLeftOf=""@+id/FavoriteCheckbox"" android:layout_width=""fill_parent""        android:layout_toRightOf=""@+id/InterestLabel"" /&gt;    &lt;CheckBox android:layout_width=""wrap_content"" style=""?android:attr/starStyle""        android:id=""@+id/FavoriteCheckbox"" android:layout_alignParentTop=""true""        android:layout_alignParentRight=""true"" android:gravity=""center_vertical""        android:layout_height=""fill_parent"" android:layout_above=""@+id/track_name"" /&gt;    &lt;TextView android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:id=""@+id/track_name""        android:text=""@+id/track_name"" android:textSize=""25sp""        android:layout_below=""@+id/InterestSpinner"" /&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout01""        android:layout_below=""@+id/track_name"" android:orientation=""vertical""        android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;        &lt;TextView android:text=""@+id/track_description"" android:id=""@+id/track_description""            android:scrollbars=""vertical"" android:layout_width=""fill_parent""            android:layout_height=""0dip"" android:layout_weight=""1""            android:paddingLeft=""5dp"" android:paddingTop=""5dp"" /&gt;        &lt;include layout=""@layout/event_list"" android:id=""@+id/trackEventList""            android:layout_width=""fill_parent"" android:layout_height=""0dip""            android:layout_weight=""2.5"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>My only thought right now is that the way I am using layout_weight in the second layout is causing some weirdness.  I am loath to change that, however, since it took me quite some time to get the layout to work the way I wanted it to in the first place.  </p><p>One other note, when I am including the first layout in the second, I am hiding the TextView and CheckBox controls because they are unnecessary.</p><p>Any ideas what I am doing wrong here?</p>","76916","","","","","2010-08-22 22:15:15","Why does Android listview sometimes disappear after calling requery on underlying cursor?","<android><listview><cursor>","1","0","","",""
"3543153","1","3545550","","2010-08-22 20:10:50","0","175","<p>I cannot test build Android application on my HTC Evo at all. I searched online for answers, but nothing helped, including updating all the software.</p><p>The Eclipse launched Emulator doesn't recognize it as an external device either.</p><p>Any ideas? I have a presentation at my job tomorrow, and it has to be on the phone.</p>","312390","","244296","","2010-08-22 20:15:27","2010-08-23 07:38:23","Cannot test build Android application on my HTC Evo","<java><android>","1","4","","",""
"3543178","1","3543246","","2010-08-22 20:15:51","3","124","<p>I know this in general is beyond the scope of SO, but I am looking for some basic yes/no info to see if it is even feasible to proceed...  I am thinking about building and Android 'note-taking/annotation' app that runs 'over' other installed Android apps, such as the web browser for example.</p><p>Essentially, while the user is browsing, my app would be running in the bg as a service, and then they could activate it which would then essentially intercept user inputs and translate those on a transparent canvas over the web browser into lines, shapes, etc.  The user could then take a screen-cap of their marking with the underlying web page, which would be stored to the sd card.</p>","357801","","212218","","2012-08-06 13:58:06","2013-10-24 00:57:00","Possible to 'layer' Android applications?","<java><android>","2","0","","",""
"3543211","1","3543241","","2010-08-22 20:23:20","1","3705","<p>I am new to Android development since my EVO purchase a few months ago.</p><p>Anyway, I am developing my first Android app using Eclipse and Android SDK emulator.</p><p>I am trying to do a simple HTTP POST. My real code has my login information hard coded in so I replaced it with test information and I changed the url as well to simply POST to google.com.</p><p>I am getting a NullPointerException when trying to view the HTTP POST request response.</p><p>I have added the internet permissions to my manifest xml file as well.</p><p>Here is my code.</p><p>editted</p><p>Thanks in advance</p><p>::updated::</p><p>I have initialized the txtResult TextView object and I am getting new NullPointerException.</p><pre><code>package com.dougi.TexAgsPremiumWidget;import java.io.IOException;import java.util.ArrayList;import java.util.List;import org.apache.http.HttpResponse;import org.apache.http.NameValuePair;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.entity.UrlEncodedFormEntity;import org.apache.http.client.methods.HttpPost;import org.apache.http.impl.client.DefaultHttpClient;import org.apache.http.message.BasicNameValuePair;import android.app.Activity;import android.app.ProgressDialog;import android.os.Bundle;import android.util.Log;import android.widget.LinearLayout;import android.widget.TextView;public class TexAgsPremiumWidget extends Activity {    LinearLayout layout = new LinearLayout(this);;    TextView txtResult = new TextView(this);    ProgressDialog pDialog;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        login();        layout.addView(txtResult);        setContentView(layout);        pDialog = ProgressDialog.show(this, ""Loading"", ""please wait..."", true);    }    public void login()    {        // Create a new HttpClient and Post Header        HttpClient httpclient = new DefaultHttpClient();        HttpPost httppost = new HttpPost(""http://www.google.com"");        try        {            List nameValuePairs = new ArrayList(2);            nameValuePairs.add(new BasicNameValuePair(""username"", ""test""));            nameValuePairs.add(new BasicNameValuePair(""password"", ""test""));            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));            // Execute HTTP Post Request            HttpResponse response = httpclient.execute(httppost);            txtResult.setText(HttpHelper.request(response));        }         catch (ClientProtocolException e)        {            Log.i(""httpClientProtocolException"", e.toString());        }        catch (IOException e)        {            Log.i(""httpClientIOException"", e.toString());        }    }}</code></pre><p>here is my new logcat error log</p><pre><code>08-22 20:57:40.153: ERROR/AndroidRuntime(960): ERROR: thread attach failed08-22 20:57:40.883: ERROR/AndroidRuntime(966): Uncaught handler: thread main exiting due to uncaught exception08-22 20:57:40.923: ERROR/AndroidRuntime(966): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.dougi.TexAgsPremiumWidget/com.dougi.TexAgsPremiumWidget.TexAgsPremiumWidget}: java.lang.NullPointerException08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.os.Handler.dispatchMessage(Handler.java:99)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.os.Looper.loop(Looper.java:123)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.app.ActivityThread.main(ActivityThread.java:4363)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at java.lang.reflect.Method.invokeNative(Native Method)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at java.lang.reflect.Method.invoke(Method.java:521)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at dalvik.system.NativeStart.main(Native Method)08-22 20:57:40.923: ERROR/AndroidRuntime(966): Caused by: java.lang.NullPointerException08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.content.ContextWrapper.getResources(ContextWrapper.java:80)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.view.View.(View.java:1777)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.view.ViewGroup.(ViewGroup.java:279)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.widget.LinearLayout.(LinearLayout.java:88)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at com.dougi.TexAgsPremiumWidget.TexAgsPremiumWidget.(TexAgsPremiumWidget.java:25)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at java.lang.Class.newInstanceImpl(Native Method)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at java.lang.Class.newInstance(Class.java:1479)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)08-22 20:57:40.923: ERROR/AndroidRuntime(966):     ... 11 more</code></pre>","427807","","427807","","2010-08-22 21:04:33","2010-08-22 21:44:04","Android : HttpClient POST : NullPointerException","<android><post><httpclient><nullpointerexception>","1","0","","",""
"3543218","1","3551046","","2010-08-22 20:24:44","3","1358","<p>AdSense (Google AdSense SDK 3.1) alone works fine in my app. </p><p>When I use AdWhirl  I see in my Log always:</p><pre><code>:WARN/AdWhirl SDK(562): AdSense company name and app name are required parameters </code></pre><p>How do I send this params right so also AdWhirl transfer it to AdSense?? (I didn't delete the params I used for ONLY ADSENSE.. so they are still there??)</p>","355372","","123527","","2010-10-17 15:51:15","2010-10-17 15:51:15","Android AdWhirl & AdSense 3.1","<android><adsense><adwhirl>","2","0","2","",""
"3543327","1","3551688","","2010-08-22 20:48:26","1","545","<p>How can I copy a file from some Android app's assets folder, to somewhere off the device?</p><p>Alternatively, how can I move or copy an  app so that it is installed on the sd card, not the main rom?</p><p>Peter</p>","253661","","71059","","2012-04-13 14:22:22","2012-04-13 14:22:22","Copying a file off an android device?","<android><file><copy><device>","3","0","","",""
"3543335","1","3543720","","2010-08-22 20:50:36","6","5241","<p>I'm new to using the PreferenceActivity.</p><p><strong>Task:</strong> Allow user to choose the program layout from the Preferences</p><p><strong>Problem:</strong> Selecting an option in the PreferenceList causes a NullPointerException</p><p><strong>Exception arises:</strong> At android.preference.ListPreference.onDialogClosed()</p><p><img src=""http://i.stack.imgur.com/1Wdy1.png"" alt=""alt text""></p><p>(Shortened) Code:</p><pre><code>private static final String PREF_LAYOUT_KEY = ""PrefLayout"";private static final int DEFAULT_LAYOUT = LayoutHelper.LAYOUT_DOUBLE ;private static int mListLayout = DEFAULT_LAYOUT ;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);    pref.registerOnSharedPreferenceChangeListener(this);    mListLayout = pref.getInt(PREF_LAYOUT_KEY, DEFAULT_LAYOUT);}@Overridepublic void onSharedPreferenceChanged(SharedPreferences pref,        String key) {    Log.v(TAG, ""OnSharedPreferencesChanged run"" ); // TODO Testing Purposes    if( key.equals( PREF_LAYOUT_KEY ) ){        mListLayout = pref.getInt(key, DEFAULT_LAYOUT);    }}</code></pre><p>[PreferenceActivity]</p><pre><code>public class Preferences extends PreferenceActivity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.pref);    }}</code></pre><p>[res/xml/pref.xml]</p><p></p><pre><code>&lt;PreferenceCategory    android:title=""@string/pref_cat1_title""&gt;    &lt;ListPreference        android:title=""@string/pref_layout_name""        android:summary=""@+id/pref_chosen_layout""        android:key=""PrefLayout""        android:entries=""@array/prefLayoutOptions""        android:entryValues=""@array/prefLayoutOptionsValues""    /&gt;&lt;/PreferenceCategory&gt;</code></pre><p></p><p>[Strings.xml]</p><pre><code>&lt;string name=""pref_cat1_title""&gt;Layout&lt;/string&gt;    &lt;string name=""pref_layout_name""&gt;""Layout of list""&lt;/string&gt;        &lt;array name=""prefLayoutOptions""&gt;            &lt;item&gt;Layout 1 (single)&lt;/item&gt;            &lt;item&gt;Layout 2 (double)&lt;/item&gt;            &lt;item&gt;Layout 3 (triple)&lt;/item&gt;            &lt;item&gt;Layout 4 (quad)&lt;/item&gt;        &lt;/array&gt;        &lt;array name=""prefLayoutOptionsValues""&gt;            &lt;item&gt;50&lt;/item&gt;            &lt;item&gt;51&lt;/item&gt;            &lt;item&gt;52&lt;/item&gt;            &lt;item&gt;53&lt;/item&gt;        &lt;/array&gt;</code></pre><p>The bit of code that logs OnSharedPreferencesChanged being run never gets there.</p><p>Can anybody see where I've gone wrong?</p><p>EDIT. Here's the top of the stack trace:</p><pre><code>E/AndroidRuntime( 2707): java.lang.NullPointerExceptionE/AndroidRuntime( 2707):        at android.preference.ListPreference.onDialogClosed(ListPreference.java:218)E/AndroidRuntime( 2707):        at android.preference.DialogPreference.onDismiss(DialogPreference.java:384)E/AndroidRuntime( 2707):        at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1047)E/AndroidRuntime( 2707):        at android.os.Handler.dispatchMessage(Handler.java:99)</code></pre>","295199","","295199","","2010-08-22 21:13:39","2010-08-23 08:30:01","PreferenceActivity gives a NullPointerException when option selected from ListPreference","<android><nullpointerexception><android-preferences>","3","8","2","",""
"3543454","1","3543625","","2010-08-22 21:21:28","23","14136","<p>How can you print a string with a subscript or superscript? Can you do this without an external library? I want this to display in a <code>TextView</code> in Android.</p>","200477","","272824","","2011-03-22 09:30:22","2014-01-29 11:36:01","Subscript and Superscript a String in Android","<java><android><string><superscript><subscript>","4","1","4","",""
"3543456","1","3544740","","2010-08-22 21:22:32","2","1452","<p>Is it possible to create a custom dictionary for an edittext? In other words, can I create a custom list and have the edittext only suggest names from that list? I don't need it popping up useless word suggestions when the user is inputting specific names of people.</p>","407775","","","","","2013-05-14 10:09:59","custom dictionary for edittext in android","<android><edittext>","2","1","1","",""
"3543478","1","6812883","","2010-08-22 21:26:49","12","13331","<p>Is it possible to remove the bottom line showed in the tab bar? It is grey when not selected.</p><p>And is it possible to change the yellowish color to something else?</p><p><img src=""http://i.stack.imgur.com/E9QEe.png"" alt=""alt text""></p><p>layout xml: <a href=""http://pastebin.com/M2KqtH1r"">http://pastebin.com/M2KqtH1r</a></p>","215088","","215088","","2010-08-23 05:00:04","2012-11-26 15:39:26","Remove the bottom line border in tab bar? (And change selected color)","<android><gui>","5","0","7","",""
"3543846","1","7239979","","2010-08-22 23:09:12","1","420","<p>Is it possible to listen for entries to the log?Ie is there a broadcast intent for when a log entry is appended?</p>","355549","","","","","2011-08-30 07:54:11","Android Listen for/Detect entry into the log","<android><logging><broadcastreceiver>","2","1","","",""
"3543978","1","3546219","","2010-08-22 23:53:55","0","1378","<p>I'm using a mixture of the ""<a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html"" rel=""nofollow"">Efficient Adapter</a>"" and the <a href=""http://github.com/commonsguy/cwac-endless"" rel=""nofollow"">EndlessAdapter</a> from CommonsGuy, and sometime the holder in getView() is null.</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    ViewHolder holder;    if (convertView == null) {        convertView = inflater.inflate(R.layout.queue_item, null);        holder = new ViewHolder();        holder.text = (TextView) convertView.findViewById(R.id.queueItemText);        holder.image = (ImageView) convertView.findViewById(R.id.queueItemImage);        convertView.setTag(holder);    } else {        holder = (ViewHolder) convertView.getTag();    }    if (holder != null) {        holder.text.setText(queueItems.get(position).getTitle().getName());    } else {        Log.e(context.getString(R.string.app_name), ""holder is null for some reason ..."");    }    return convertView;}</code></pre><p>I've put the rest of the code for both of my classes <a href=""http://pastie.org/private/0nrue2mzuvnqp2tm8ld6nw"" rel=""nofollow"">here</a>, as it's rather large to paste inline.</p><p>Once the whole data set is loaded, scrolling up &amp; down causes rows to disappear and re-appear too.</p>","11470","","11470","","2010-08-22 23:56:07","2010-08-23 09:23:04","When Using the ""Efficient Adapter"", holder is sometimes null","<android><android-arrayadapter>","1","0","","",""
"3544108","1","","","2010-08-23 00:51:46","1","666","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4011482/how-to-make-android-app-update-in-execution-time"">How to make Android app update in execution time</a>  </p></blockquote><p>Im trying something in android, that has to get the words sent in sms and print on the emulator screen. But the app doesnt update in time. </p><p>I send a message. Ok. But when I open the app it doesnt print the words that I've sent. So i have to close the emulator and then open it again, and run the app, and the word is there.</p><p>Id like that when I sent the message and then I access the app, the word is printed without I have to close the emulator.</p><p>How do I do this?</p><p>Thx.</p><hr><p>So here is my code. Remember that I want to, send a new SMS and when I go to my app again, (without close and open the emulator), it updates the words in the screen, the new words shall be printed in the screen. Thx.</p><p>I have this class <strong>SMS.java</strong>, which is my activity, and another class, that is below this one here, called <strong>DataHelper.java</strong>, which manipulate my database, and has the methods to insert, query, update, etc.:</p><p><strong>SMS.java</strong></p><pre><code>package com.sys;import java.util.List;import java.util.StringTokenizer;import com.sys.DataHelper;import android.app.Activity;import android.content.ContentValues;import android.content.Intent;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.net.Uri;import android.os.Bundle;import android.provider.BaseColumns;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.TextView;import android.widget.Toast;import com.sys.ratedSmsContacts;public class SMS extends Activity { private DataHelper dh;  private static TextView txtView;                private static Button btnChkCntts;private static Button btnChkTag;final Uri CONTENT_URI = Uri.parse(""content://sms/sent"");    @Override    public void onCreate(Bundle savedInstanceState) {    this.dh = new DataHelper(this);     super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final Button button = (Button) findViewById(R.id.btnChkCntts);    button.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        Intent myIntent = new Intent(v.getContext(), ratedSmsContacts.class);        startActivityForResult(myIntent, 0);    }    });    txtView =    (TextView)findViewById(R.id.txtView);              Cursor cursor = getContentResolver().query(CONTENT_URI, null, null, null, null);                                            String body;          String atual;        if(cursor.moveToFirst()){            body = cursor.getString(cursor.getColumnIndexOrThrow(""body"")).toString();            if(body == "" ""){                Toast.makeText(getBaseContext(), ""There is no words to save!"", Toast.LENGTH_LONG).show();            }                else{                                                   StringTokenizer st = new StringTokenizer(body);                                       while(st.hasMoreTokens()){                        atual = st.nextToken();                            while(this.dh.select(atual) == true){                                this.dh.atualiza(atual);                                Toast.makeText(getBaseContext(), ""Word updated!"", Toast.LENGTH_LONG).show();                            }                            while(this.dh.select(atual) == false){                                this.dh.insert(atual);                                Toast.makeText(getBaseContext(), ""Word added!"", Toast.LENGTH_LONG).show();                            }                        }                    }                    List&lt;String&gt; words = this.dh.selectAll();                    StringBuilder sb = new StringBuilder();                    sb.append(""Set of words:\n\n"");                    for (String w : words) {                        sb.append(w);                        sb.append("" "");                                             }                       txtView.setText(sb.toString());                }                           }                }</code></pre><p><strong>DataHelper.java</strong></p><pre><code>package com.sys;import android.content.Context;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.database.sqlite.SQLiteStatement;import android.util.Log;import android.widget.Toast;import java.util.ArrayList;import java.util.List;public class DataHelper {private static final String DATABASE_NAME = ""sms.db"";private static final int DATABASE_VERSION = 1;private static final String TABLE_NAME = ""words"";private Context context;private SQLiteDatabase db;private SQLiteStatement insertStmt;private SQLiteStatement updateStmt;private static final String INSERT = ""insert into ""   + TABLE_NAME + ""(word, cont) values (?, 1)"";public DataHelper(Context context) {  this.context = context;  OpenHelper openHelper = new OpenHelper(this.context);  this.db = openHelper.getWritableDatabase();           //openHelper.onUpgrade(db, 1, 2);  this.insertStmt = this.db.compileStatement(INSERT); }public long insert(String word) {   this.insertStmt.bindString(1, word);               return this.insertStmt.executeInsert(); }public void atualiza(String word){   this.db.execSQL(""UPDATE words SET cont = cont + 1 WHERE (word= ?)"", new String[] {word} );       }public void deleteAll() {  this.db.delete(TABLE_NAME, null, null); }public boolean select(String wrd) {  String word;  Cursor cursor = this.db.query(TABLE_NAME, new String[] {""word""}, ""word like ?"", new String[] {wrd} , null, null, null);  if (cursor.moveToFirst()) {     do {        word = cursor.getString(0);      } while (cursor.moveToNext());   }  if (cursor != null &amp;&amp; !cursor.isClosed()) {     cursor.close();              return true;           }else{      return false;  }}public List&lt;String&gt; selectMaxCont(){          List&lt;String&gt; list = new ArrayList&lt;String&gt;();   Cursor cursor = this.db.query(TABLE_NAME, new String[]{""word""}, null, null, null, null, ""cont desc"");   if(cursor.moveToFirst()){       do{   list.add(cursor.getString(0));       }while(cursor.moveToNext());   }   if(cursor != null &amp;&amp; !cursor.isClosed()){       cursor.close();   }   return list;}public List&lt;String&gt; selectAll() {      List&lt;String&gt; list = new ArrayList&lt;String&gt;();      Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""word"" }, null, null, null, null, ""cont desc"");      if (cursor.moveToFirst()) {         do {            list.add(cursor.getString(0).toUpperCase());          } while (cursor.moveToNext());      }      if (cursor != null &amp;&amp; !cursor.isClosed()) {         cursor.close();      }      return list;   }private static class OpenHelper extends SQLiteOpenHelper {  OpenHelper(Context context) {     super(context, DATABASE_NAME, null, DATABASE_VERSION);  }  @Override  public void onCreate(SQLiteDatabase db) {     db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY, word TEXT, cont INTEGER)"");           }  @Override  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {     Log.w(""SMS Words Database"", ""Upgrading database, this will drop tables and recreate."");     db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);     onCreate(db);  } }}</code></pre>","399459","","1228","","2013-01-22 15:14:55","2013-01-22 15:14:55","How to make my Android app update in time","<android><database><sms><android-emulator>","0","4","1","2013-01-22 15:15:08",""
"3544214","1","","","2010-08-23 01:33:27","28","14114","<p>I have an EditText box and I want the default keyboard that comes up when it is selected to be the numeric keypad, since <strong>most of the time</strong> users will be entering numbers. However, I do want to allow users to enter alphabetic characters too, if they need to. Using <code>android:inputType=""number""</code> restricts input to numeric digits only. What options do I have?</p>","427955","","385478","","2013-01-23 10:24:49","2013-10-27 03:06:29","EditText with number keypad by default, but allowing alphabetic characters","<android>","12","0","4","",""
"3544445","1","","","2010-08-23 02:53:46","2","5726","<p>I just start to use robotium. The demo can be run without any problem, but when I wrote first test script by using <code>EditText</code> and <code>Button</code>, problems occured. My environment is android 2.1 and the script is quite simple, just input username and psw, then click sumbit button to login.<br>The script is as follows:</p><pre><code>package com.tpc.test;import com.tpc.login.Login;import com.jayway.android.robotium.solo.Solo;import android.test.ActivityInstrumentationTestCase2;import android.test.suitebuilder.annotation.Smoke;public class LoginTest extends ActivityInstrumentationTestCase2&lt;Login&gt;{    private Solo solo;    public LoginTest() {        super(""com.tpc"", Login.class);    }     public void setUp() throws Exception {         solo = new Solo(getInstrumentation(), getActivity());          }     @Smoke     public void testApp() throws Exception {         String appName = solo.getCurrentActivity().getClass().getSimpleName();         System.out.println(appName);         solo.getButton(0).getClass().getSimpleName();         solo.assertCurrentActivity(""Expected login activity"", appName);                  System.out.println(solo.getButton(0).getText());//can get the text of button         solo.enterText(0, ""name""); //input name to the 1st EditText is OK         solo.enterText(1, ""psw"");   // Actually inout psw after name to the 1st EditText         solo.clickOnButton(0);       //Expect click the 1st button.Actually click the 1st EditText         //assert of sample, not been modified               boolean expected = true;         boolean actual = solo.searchText(""Note 1"") &amp;&amp; solo.searchText(""Note 2"");         assertEquals(""Note 1 and/or Note 2 are not found"", false, actual);     }    @Override    public void tearDown() throws Exception {        try {            solo.finalize();        } catch (Throwable e) {            e.printStackTrace();        }        getActivity().finish();        super.tearDown();    } }</code></pre><p>One problem is both name and psw is filled in the first <code>EditText</code>,the other is <code>solo.clickOnButton(0);</code> click the first <code>EditText</code>, NOT the first <code>Button</code>. I also tried to use the text name of the <code>Button</code>, but the result was the same. It seems all the operations been put to the first <code>EditText</code>. I wanna what's the problem. Any suggestion?thanks</p>","427989","","12707","","2010-08-23 04:02:53","2012-11-24 09:32:42","problem of robotium","<android><robotium>","4","1","2","",""
"3544557","1","3553132","","2010-08-23 03:24:15","0","2256","<p>I am trying to post from android to GAE, I am getting unknown host exception. Here is my code,</p><pre><code>HttpClient httpclient = new DefaultHttpClient();      HttpPost httppost = new HttpPost(""http://silver-kites.appspot.com"");      try {          // Add your data         List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);          nameValuePairs.add(new BasicNameValuePair(""abc"", ""123""));          nameValuePairs.add(new BasicNameValuePair(""xyz"", ""456""));          httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));          // Execute HTTP Post Request          HttpResponse response = httpclient.execute(httppost);        HttpEntity entity = response.getEntity();        if(entity != null){          InputStream inputStream = entity.getContent();          ResponseText.setText(convertStreamToString(inputStream));        }    } catch (ClientProtocolException e) {        ResponseText.setText(e.getMessage());     } catch (IOException e) {        ResponseText.setText(e.getMessage());    }</code></pre><p>When I am trying to connect to localhost:8888 am getting connection refused. I donno how to go pass thru this. Help me.</p>","368999","","","","","2011-01-05 23:53:46","unknown host exception from android to GAE","<android><google-app-engine>","4","1","","",""
"3544660","1","3544693","","2010-08-23 03:55:12","2","3767","<p>I figured out how to pass a String value between activites thanks to this site, however I'm having trouble passing an image. What I'm trying to to is have a user click a button that opens the gallery and allows selecting of a picture. Then I have another button that opens another activity that displays an ImageView. I want to be able to have that ImageView's image be the chosen one from the previous activity. </p><p>Here is the class that has the button I'm clicking to open the gallery and retrieve the chosen image:</p><pre><code>public class EnterEdit extends Activity implements View.OnClickListener {private static final int SELECT_IMAGE = 0; String filepath; Bundle fieldresults; Intent b;  @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.enteredit);  Button selectwallpaper = (Button) findViewById(R.id.selectwallpaper);  selectwallpaper.setOnClickListener(this);  Button previewwallpaper = (Button) findViewById(R.id.previewwallpaper);  previewwallpaper.setOnClickListener(this);  fieldresults = new Bundle();  b = new Intent(this, PreviewScreen.class); } @Override public void onClick(View view)  {  switch (view.getId())  {   case R.id.selectwallpaper:    Intent gallery = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);    startActivityForResult(gallery, SELECT_IMAGE);    break;   case R.id.previewwallpaper:     startActivity(b);     }    break;     } protected void onActivityResult(int requestCode, int resultCode, Intent data) {  super.onActivityResult(requestCode, resultCode, data);   if (resultCode == RESULT_OK)   {    if (requestCode == SELECT_IMAGE)    {     Uri selectedimage = data.getData();     String[] filepathcolumn = {MediaStore.Images.Media.DATA};     Cursor cursor = getContentResolver().query(selectedimage, filepathcolumn, null, null, null);     cursor.moveToFirst();     int columnindex = cursor.getColumnIndex(filepathcolumn[0]);     filepath = cursor.getString(columnindex);     cursor.close();     fieldresults.putString(""bitmap"", filepath);     b.putExtras(fieldresults);    }   } }}</code></pre><p>And here is the class that should display the chosen image:</p><pre><code>public class PreviewScreen extends Activity implements View.OnClickListener { @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.previewscreen);  Bundle fieldresults = this.getIntent().getExtras();  String backgroundpath = fieldresults.getString(""bitmap"");  String background = BitmapFactory.decodeFile(backgroundpath);  ImageView gallerypic = (ImageView) findViewById(R.id.gallerypic);  gallerypic.setImageBitmap(background);  }}</code></pre><p>What I'm not sure about is in the <code>OnActivityResult</code> if I should pass the <code>selectedImage</code> or the  chosenimage in the <code>b.putExtra(""bitmap"", selectedimage);</code> line. I tried both but I didn't see an image on the second activity. Also I wasn't sure in the <code>PreviewScreen</code> class if I'm setting the imageview correctly. Any help is appreciated. Thanks.</p>","421399","","421399","","2010-08-26 05:08:57","2010-08-26 05:08:57","Passing image to another activity","<android><android-intent><bundle><imageview>","1","0","5","",""
"3544738","1","3549642","","2010-08-23 04:25:13","5","5103","<p>I'm setting an ArrayAdapter and I get the following error:</p><pre><code> Thread [&lt;1&gt; main] (Suspended (exception NullPointerException)) ArrayAdapter.createViewFromResource(int, View, ViewGroup, int) line: 355    ArrayAdapter.getView(int, View, ViewGroup) line: 323    ListView(AbsListView).obtainView(int, boolean[]) line: 1294 ListView.measureHeightOfChildren(int, int, int, int, int) line: 1198    </code></pre><p>My symptomremedyActivity.java looks like:</p><pre><code>    setContentView(R.layout.symptomremedy);    ListView remedyList = (ListView) findViewById(R.id.ListView_SymptomRemedy);    remedyList.setTextFilterEnabled(true);    ArrayAdapter&lt;String&gt; adapt = new ArrayAdapter&lt;String&gt;(this, R.layout.menu_item, remedyArray);    remedyList.setAdapter(adapt);</code></pre><p>and my symptomremedy.xml layout looks like:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;Buttonandroid:id=""@+id/Button_BACK""android:layout_width=""wrap_content""android:layout_height=""@dimen/menu_button_height""android:layout_alignTop=""@+id/Button_BACK""android:layout_below=""@+id/ImageView_MenuHeader""android:textSize=""@dimen/menu_button_text_size""android:text=""@string/back""&gt;&lt;/Button&gt;&lt;ListView        android:layout_height=""wrap_content""        android:id=""@+id/ListView_SymptomRemedy""        android:layout_width=""fill_parent""        android:background=""@color/menu_white""        android:divider=""@drawable/straight_divider""        android:listSelector=""@drawable/textured""        android:layout_alignParentTop=""true""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>and menu_item.xml layout looks like:</p><pre><code>&lt;TextViewxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:textSize=""@dimen/menu_item_size""android:text=""test string""android:textColor=""@color/menu_black""android:layout_height=""fill_parent"" /&gt;</code></pre><p>I've done something similar in other Activities with no problems, so I can't figure out why there is a problem here.  All of the fields involved are non-null, i.e. remedyArray, etc.  Anyone have any idea what the problem is?   </p>","148635","","","","","2013-10-01 23:36:31","android - ArrayAdapter.createViewFromResource(int, View, ViewGroup, int) line: 355 NullPointerException","<android>","3","0","1","",""
"3544764","1","3544804","","2010-08-23 04:31:52","1","1444","<p>I want to layout a button with Drawable image on the top of it and text below the image. <strong>I am very new to this so please use detailed instructions.</strong> I have not experimented with drawable images yet so I want to clarify before I continue. </p><p>If I want to above the text (ie the text is not on the image) how do I go about doing this? I also want the text to be centered in below and (working without the drawable) there is a gravity command for center-horizontal and bottom. I tried: </p><pre><code>android:gravity=""bottom, center_horizontal""</code></pre><p>This made an error. Appreciate the help and remember I am a beginner to Eclipse and Java.</p><p>Thanks in advance.      - James</p><p>PS Help me build my rep please.</p>","413926","","","","","2010-08-23 04:41:17","Button Layout with Drawable and Text","<android><button>","1","1","","",""
"3544781","1","3583964","","2010-08-23 04:35:10","10","7619","<p>I am trying to extend HashMap as a Parcelable and I got the syntax to compile, however, at runtime it throws an exception and returns a null pointer trying to un-marshal the data.</p><p>The sender has to cast to (Parcelable) to resolve ambiguity, however, the receiver complains that is expected Parcelable but found HashMap.</p><p>Has anyone been successful with this?Is my syntax wrong?Is there a better solution?</p><p>Following is the code:</p><ul><li>HomeActivity.java - the sender</li><li>ContentViewActivity.java - the receiver</li><li>ContentItemSimple.java - as its nameimplies (wraps a String and Integer)</li><li>ContentItemCollection.java - this isthe HashMap</li></ul><p>HomeActivity.java</p><pre><code>package com.mobibob.android.studyparceable;import java.util.HashMap;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Parcel;import android.os.Parcelable;import android.text.format.Time;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class HomeActivity extends Activity implements OnClickListener {    private static final String TAG = ""HomeActivity"";    private ContentItemSimple mContentItemSimple = null;    private ContentItemContainer mContentItemContainer = null;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.home);        Button click = (Button) findViewById(R.id.button_clickit);        click.setOnClickListener(this);        mContentItemSimple = new ContentItemSimple();        mContentItemSimple.name = ""mobibob"";        mContentItemSimple.year = 2010;        String value = ""value"";        Time nowTime = new Time();        nowTime.setToNow();        mContentItemContainer = new ContentItemContainer();        mContentItemContainer.put(""string"", new String(""baseball is great!""));        mContentItemContainer.put(""integer"", new Integer(1234));//        mContentItemContainer.put(""boolean"", new Boolean(true));//        mContentItemContainer.put(""date"", nowTime);//        mContentItemContainer.put(""parcel"", new Bundle());        Log.d(TAG, ""..... "" + mContentItemContainer.toString());    }    @Override    public void onClick(View v) {        Intent i = new Intent(getBaseContext(), ContentViewActivity.class);        i.putExtra(ContentItemSimple.EXTRA_CONTENT_DETAIL, mContentItemSimple);        i.putExtra(ContentItemContainer.EXTRA_CONTENT_CONTAINER, (Parcelable) mContentItemContainer);        startActivityForResult(i, 0);    }}</code></pre><p>ContentViewActivity</p><pre><code>package com.mobibob.android.studyparceable;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;import com.mobibob.android.studyparceable.ContentItemSimple;public class ContentViewActivity extends Activity implements OnClickListener {    private static final String TAG = ""ContentViewActivity"";    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.content_view);        Button gohome = (Button) findViewById(R.id.button_gohome);        gohome.setOnClickListener(this);        ContentItemSimple ci = null;        ContentItemContainer cx = null;        try {            ci = getIntent().getParcelableExtra(ContentItemSimple.EXTRA_CONTENT_DETAIL);            Log.i(TAG, ""ci = "" + ci.toString());            cx = getIntent().getParcelableExtra(ContentItemContainer.EXTRA_CONTENT_CONTAINER);            Log.i(TAG, ""cx = "" + cx.toString());            TextView tvName = (TextView) findViewById(R.id.ci_name);            tvName.setText(ci.name);            TextView tvYear = (TextView) findViewById(R.id.ci_year);            tvYear.setText(String.format(""%d"", ci.year));        } catch (Exception e) {            Log.e(TAG, e.toString());            e.printStackTrace();        }    }    @Override    public void onClick(View v) {        finish();    }}</code></pre><p>ContentItemSimple.java</p><pre><code>package com.mobibob.android.studyparceable;import android.os.Parcel;import android.os.Parcelable;import android.util.Log;public class ContentItemSimple implements Parcelable {        public static final String TAG = ""ContentItem"";    public static final String EXTRA_CONTENT_DETAIL = ""contentDetail"";    public String name = ""name"";    public Integer year = Integer.MIN_VALUE;    ContentItemSimple() {        name = new String("""");        year = new Integer(Integer.MIN_VALUE);    }    ContentItemSimple(Parcel in) {            try {                name = in.readString();                year = in.readInt();            } catch (Exception e) {                Log.e(TAG, e.toString());                e.printStackTrace();        }    }    @Override    public String toString() {        return String.format(""name=%s age=%d"", name, year);    }    @Override    public int describeContents() {        return 0;    }    @Override    public void writeToParcel(Parcel dest, int flags) {        dest.writeString(name);        dest.writeInt(year);    }    public static final Parcelable.Creator&lt;ContentItemSimple&gt; CREATOR = new Parcelable.Creator&lt;ContentItemSimple&gt;() {        public ContentItemSimple createFromParcel(Parcel in) {        return new ContentItemSimple(in);        }        public ContentItemSimple[] newArray(int size) {        return new ContentItemSimple[size];        }    };}</code></pre><p>ContentItemContainer.java</p><pre><code>package com.mobibob.android.studyparceable;import java.util.HashMap;import java.util.Iterator;import android.os.Parcel;import android.os.Parcelable;public class ContentItemContainer extends HashMap&lt;String, Object&gt; implements Parcelable {    /**     * Container for wddx 'struct' elements.     */    private static final long serialVersionUID = 1L;    // public String name = ""?"";    // public String value = ""?"";    public static final String EXTRA_CONTENT_DETAIL = ""contentDetail"";    public static final String EXTRA_CONTENT_CONTAINER = ""contentContainer"";    public static final String EXTRA_CONTENTDETAIL_NAME = ""name"";    public static final String EXTRA_CONTENTDETAIL_VALUE = ""value"";//    private static HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();    ContentItemContainer() {        super();    }    ContentItemContainer(Parcel in) {        in.readMap(this, ContentItemContainer.class.getClassLoader());    }    @Override    public String toString() {        StringBuilder sb = new StringBuilder("""");        Integer x = 0;        Iterator&lt;HashMap.Entry&lt;String, Object&gt;&gt; it = this.entrySet().iterator();        while (it.hasNext()) {            HashMap.Entry&lt;String, Object&gt; pairs = (HashMap.Entry&lt;String, Object&gt;) it.next();            x++;            sb.append(""\n""+x.toString()+"": "").append(""name="").append(pairs.getKey()).append("" value="").append(pairs.getValue().toString());        }        return sb.toString();    }    @Override    public int describeContents() {        return 0;    }    @Override    public void writeToParcel(Parcel dest, int flags) {        dest.writeMap(this);    }    public static final Parcelable.Creator&lt;ContentItemContainer&gt; CREATOR = new Parcelable.Creator&lt;ContentItemContainer&gt;() {        public ContentItemContainer createFromParcel(Parcel in) {            return new ContentItemContainer(in);        }        public ContentItemContainer[] newArray(int size) {            return new ContentItemContainer[size];        }    };}</code></pre>","157804","","","","","2010-08-27 12:48:54","Is it possible to create a HashMap that is Parcelable on Android?","<android><hashmap><parcelable>","1","3","3","",""
"3544826","1","","","2010-08-23 04:48:27","1","2374","<p>I have made a sample application to flip through different layouts in a viewflipper.</p><p>XML is basically (pseudo-code)</p><pre><code>&lt;ViewFlipper&gt;&lt;LinearLayout&gt;&lt;TextView text:""this is the first page"" /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout&gt;&lt;TextView text:""this is the second page"" /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout&gt;&lt;TextView text:""this is the third page"" /&gt;&lt;/LinearLayout&gt;&lt;/ViewFlipper&gt;</code></pre><p>And in Java code,</p><pre><code>public boolean onTouchEvent(MotionEvent event)case MotionEvent.ACTION_DOWN {   oldTouchValue = event.getX()} case MotionEvent.ACTION_UP {   //depending on Direction, do viewFlipper.showPrevious or viewFlipper.showNext   //after setting appropriate animations with appropriate start/end locations} case MotionEvent.ACTION_MOVE {   //Depending on the direction   nextScreen.setVisibility(View.Visible)   nextScreen.layout(l, t, r, b) // l computed appropriately   CurrentScreen.layout(l2, t2, r2, b2) // l2 computed appropriately}</code></pre><p>Above pseudo code works well moving linearlayouts inside viewflipper when dragging on the screen (just like the home screen).</p><p>The problem is when I do nextScreen.setVisibility(View.VISIBLE). When the next screen is set visible, it flickers on the screen before moving to its appropriate position. (I guess it is made visible at 0 location.)</p><p>Is there a way to load the next screen without making it flicker on the screen? I want it to be loaded (made visible) out of screen so it doesn't flicker.</p><p>Thank you very much for your time and help!</p>","428031","","","","","2010-09-28 14:10:01","Android Home Screen like effect flickering problem when set child.setvisibility(View.Visible)","<android><flicker><visible><viewflipper><homescreen>","1","0","1","",""
"3544869","1","","","2010-08-23 05:05:19","-1","111","<p>there are some error in valuse folder:  </p><pre><code>An error has occurred. See error log for more details.java.lang.NullPointerException</code></pre>","217590","","","","","2010-08-23 07:07:27","when i creat a android project in eclipse, some error shows","<android><eclipse>","1","2","","2012-08-21 23:56:18",""
"3544875","1","3548285","","2010-08-23 05:07:11","2","5487","<p>I am trying to display map in Android for the first time.Now <strong><code>I want to display 3 buttons on the map, and when I clicked on a particular button, that button's click event should be raised.</code></strong> The map should be in full-screen and buttons are at the below side.</p><p>I don't know how I do this? When we want to display map using a MapView we have to extends the MapActivity class. So please suggest some ideas, examples or reference sites.</p><p>Edited:</p><p>I have displayed map using the following Layout:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;com.google.android.maps.MapView         android:id=""@+id/mapView01""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:enabled=""true""        android:clickable=""true""        android:apiKey=""my generated api key""        /&gt;    &lt;Button         android:text=""Button""         android:id=""@+id/Button01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","379693","","2140191","","2013-05-08 06:22:53","2013-05-08 06:22:53","Android - map with 3 buttons","<android><android-layout><android-mapview><android-button>","2","2","2","",""
"3544913","1","3545151","","2010-08-23 05:19:23","14","18326","<p>I have a database, a <code>ListView</code>, and a <code>CustomCursorAdapter</code> that extends <code>CursorAdapter</code>. A menu button adds an item to the database. I want the <code>ListView</code> to update and show this change. Normally it doesn't show this new item until i go to the homescreen and reopen the application. </p><p>I did eventually get it to work by calling <code>cursor.requery()</code> or <code>mCustomCursorAdapter.changeCursor(newCursor)</code> whenever I added a new item, but when I set autoRequery to false in the <code>CursorAdapter</code> constructor, it worked just the same. Why does it update correctly when autoRequery is set to false?</p><p>Am I using <code>CursorAdapter</code> correctly? What is the standard way of keeping the list updated with the database? And what does autoRequery do?</p>","316146","","493939","","2011-11-19 15:51:21","2011-11-19 15:51:21","Android: how to use CursorAdapter?","<android><android-cursoradapter>","2","1","18","",""
"3544959","1","3545426","","2010-08-23 05:32:04","0","623","<p>I am using the default android sample code ""Bluetooth Chat"" with HTC Hero. Search device is working and when I click on the list, it can do the pair job and display connecting on the title. But it will throw IOException when call BluetoothServer.connect().</p><p>PS: I am not connecting to a bluetooth adapter on PC. </p>","411771","","","","","2010-08-23 07:17:22","Why BluetoothChat sample cannot connect?","<android><sample>","1","0","","",""
"3545007","1","","","2010-08-23 05:46:14","3","22231","<p>I am having a problem right now with <code>setOnClickListener</code>.</p><p>When i put this following line:</p><pre><code>button.setOnClickListener(this);</code></pre><p>And run the application then it does not run and shows a message that ""Application closed forcefully"".</p><p>Could you please help me how I can set button onclick event in Android 2.2?</p>","428064","","720508","","2012-10-02 06:10:09","2014-03-14 15:18:49","Button setonclicklistener error","<android><events><button><onclick>","6","1","3","",""
"3545016","1","3546948","","2010-08-23 05:48:01","1","3838","<pre><code>    ParsedNotificationDataSet result = new ParsedNotificationDataSet();    Cursor c = db.rawQuery(""select * from notificationtable"", null);    if (c.getCount() &gt; 0) {        c.moveToFirst();        do {            result.setclassurl(c.getString(c.getColumnIndex(""Id"")));            result.settype(c.getString(c.getColumnIndex(""type"")));            result.setschool(c.getString(c.getColumnIndex(""school"")));            result.setdescription(c.getString(c.getColumnIndex(""description"")));            result.settitle(c.getString(c.getColumnIndex(""title"")));            result.setdatePosted(c.getString(c.getColumnIndex(""datePosted"")));            results.add(result);        } while (c.moveToNext());    }</code></pre><p>Here is my code to fetch data from the database. In my opinion it should work properly but at the very first time it generates a <code>java.lang.NullPointerException</code> exception. After that it runs without a problem. What modifications do I need to make to resolve this issue?</p>","339116","","648313","","2011-12-25 13:49:08","2011-12-25 13:50:13","android code to fetch data from database","<android><nullpointerexception><android-cursor>","2","2","2","",""
"3545094","1","","","2010-08-23 06:12:30","0","354","<p>Is it possible to add or change the existing applications?</p><p>For example, I would like to add a new floating window following the current people when I open the contact manager.</p><p>I just want to change it a little bit. And I don't want to rewrite all the features of contact manager.</p><p>Is it possible to do this?</p><p>As I understanding, the view of the contact manager is controlled by the activities of the ""contact manager"" application. How can my application react when the user opening the contact manager?</p>","428078","","","","","2011-02-10 14:26:44","How to add/change features of the existing application?","<android><activity>","2","0","","",""
"3545185","1","3547881","","2010-08-23 06:35:10","2","5571","<p>I created a new library and added the jars from web harvester to do a bit of web scraping in my android project. in my main activity I import classes that I need. but starting the project on my phone I get a </p><p><em>08-23 08:28:09.763: ERROR/dalvikvm(2123): Could not find class 'org.webharvest.definition.ScraperConfiguration', referenced from method html.parser.MainActivity.onCreate</em></p><p>any ideas?</p>","401025","","","","","2013-07-22 13:00:17","Importing Class from External Jar, Android","<android><eclipse><jar>","3","3","","",""
"3545196","1","3545781","","2010-08-23 06:36:14","6","4543","<p>I want to be able to iterate through all of the fields in the generated R file.</p><p>Something like:</p><pre><code>for(int id : R.id.getAllFields()){//Do something with id, like create a view for each image}</code></pre><p>I've tried reflection, but I can't seem to load a specific inner class that's contained inside the R class. So, for example, this wouldn't work for me:</p><pre><code>Class c = Class.forName(""packageName.R.id"")</code></pre><p>I can reflect on the R class itself, but I need the fields within the id class. </p><p>I also tried looking through the Resources class, but couldn't find anything there. In that case, it seems you can take a resourceID and get the string name of that id, or take a string name and get the corresponding resourceID. I couldn't find anything like:</p><pre><code>int[] Resources.getAllResourceIDs()</code></pre><p>Maybe I'm going about this wrong. Or maybe I shouldn't fight typing them all in by hand, e.g.:</p><pre><code>int[] myIds = {R.id.firstResource, R.id.secondResource}</code></pre><p>This approach has the downside of not being as flexible when working with my UI designer. Whenever he adds a new resource to the XML file, I'll have to update the code. Obviously not too painful, but it would still be nice to have and it seems like it should be doable.</p><p>EDIT:</p><p>The answer below about ViewGroup.getChildCount()/ViewGroup.getChildAt() works fine. But, I also had to find a way to instantiate my XML ViewGroup/Layout. To do that, try something like:</p><pre><code>LayoutInflater li = MyActivity.getLayoutInflater();ViewGroup vg = (ViewGroup) li.inflate(R.layout.main, null);</code></pre>","428100","","428100","","2010-08-26 06:17:55","2011-09-07 06:40:10","Android: Programatically iterate through Resource ids","<android>","3","2","5","",""
"3545345","1","3545475","","2010-08-23 07:03:48","3","4970","<p>I want to do optimization of my android application. </p><p>Can anyone please tell what are different ways to optimize code and performance in android? </p><p>I gone through one tool i.e. <a href=""http://developer.android.com/resources/articles/zipalign.html"" rel=""nofollow"">Zipalign: an Easy Optimization</a>.</p><p>Any other tools avaliable?</p><p>Thank you.</p>","363503","","363503","","2010-08-25 10:19:47","2012-07-02 12:53:32","Optimization of Android Applications","<android><performance><optimization><testing>","4","5","2","2013-03-16 13:04:13",""
"3545493","1","3545572","","2010-08-23 07:27:56","5","5711","<p>Is it possible to do this? I'm reading an XML file that has the Base64 string of an image. I'm planning to use Base64.decode to have the byte array of the image string. I'm stuck though on how to use it in an ImageView. Do i have to create a 'drawable' class first then set it to ImageView's src property?</p><p>Thanks!</p>","273259","","","","","2012-05-23 01:11:44","Display byte[] to ImageView in Android","<android>","2","0","1","",""
"3545638","1","","","2010-08-23 07:56:45","0","1376","<p>I have an android application having an AlertDialog with OK and Cancel buttons. When the dialog shows without pressing the OK or Cancel button, just press Home button of device. The Home screen will show. Now open another application suppose Camera. Take some picture or Video. Now get out from the Camera application. Now open my android application and surprisingly the alertdialog have disappeared. Why?</p>","424854","","984393","","2012-08-22 02:25:34","2012-08-22 02:25:34","AlertDialog disappears after switching activity","<android><android-dialog>","3","2","1","",""
"3545691","1","","","2010-08-23 08:06:30","0","677","<p>HI , </p><p>I need to keep track of installed applications which are used most and least in android device...  can anyone help me how to do this programmatically in android...?? </p><p>My question some thing like , I need to capture the event/Intent which will/may happen when the apllication is launched every time...(like BOOT_COMPLETED will be brodcasted when device booted).</p>","428168","","179850","","2011-02-21 19:13:01","2011-02-21 19:13:01","how to keep track of which applications used most in android phone","<android>","2","3","","",""
"3545871","1","3551740","","2010-08-23 08:33:01","4","498","<p>If you have an application with a GUI totally working on 2D drawing, what should be the best practice to handle what to draw and where to touch?</p><p>An example for better understanding:<br>I have a game with a map. On this map I can build houses and stuff.<br>I also have an information bar which can be extended. On the extended bar I draw some information about the game and it also offers the interface to change different values. If a touch occurs, I have to check if the information bar is extended or not, to determine if I want to change something on the map or something on the bar.</p><p>That's done by the State Pattern, but I have some doubt if that's the right one because I think it can be a bit complex because of possible ""sub-states"".</p><p>So basically the question: Is the State Pattern (from GoF) the best practice to handle a pure graphical GUI?</p>","180538","","13531","","2011-02-09 23:04:56","2011-02-09 23:04:56","Best practice: Design pattern for 2D HUD screen navigation","<java><android><design-patterns><gui>","1","0","3","",""
"3545912","1","","","2010-08-23 08:40:26","-3","10625","<p>How can i connect to the server in Android . Give me Some code it will really helpful for me . </p>","428192","","","","","2013-08-21 17:25:51","Server Connection in Android Application","<android>","2","0","1","2013-08-21 18:44:40",""
"3545969","1","6934392","","2010-08-23 08:49:26","3","8832","<p>I am trying to using remote service in android.can anybody tell how and where to create aidl file in eclipse in android?</p><p>Thanks</p>","426344","","","","","2012-11-20 06:16:11","How and where to create aidl file in eclipse using android","<android>","2","0","1","",""
"3545973","1","3547018","","2010-08-23 08:50:10","-1","69","<p>Hey folks,I really like your site and I think this is the place where I find answers to my questions!I am planning an app, which shall do a couple of things but since I'm kind of lost in all the information conserning Android I really need some advice what I have to look out for and which of my goals might turn out tricky.I want to do the following things with my app:</p><ul><li><p>Since it uses classes of a third party framework which strongly uses threads and reflections of which I don't know much myself since I'm a very basic programmer, I need to know what I have to watch out for.</p></li><li><p>In these threads I want to receive sensordata like the gps data or the compass data frequently and pass it to another thread which calculates stuff with those values and</p></li><li><p>last but not least I want to send those information to a server in my Wifi-Network which offers webservices via SOAP messages.</p></li></ul><p>Any advice (descriptions, how tos, tutorials, threats etc.) on one if those to topics is highly appreciated!Thank you folks!</p>","345925","","","","","2010-08-23 11:19:12","Basic Prblems Android, need to know where to find Information, need Advice","<android><multithreading><web-services>","1","3","","2013-07-10 12:49:47",""
"3546030","1","3560384","","2010-08-23 08:59:51","1","3011","<p>Basically I am trying to recreate the default contact screen when you click on ""+"" button another row of Phone number added to the list.</p><p>Right now I have an ImageView as the ""+"" button and a ListView to contain the list of phone numbers. The problem is that the ListView doesn't expand when I add more item into the list.</p><p>I could build the same look with LinearLayout but how can I save all those numbers that way?</p><p>Below is the layout of the item that will be inflate with custom Adapter</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""60px""  android:stretchColumns=""1""  android:background=""#FFFFFFFF""  android:gravity=""center_vertical""&gt;  &lt;TableRow&gt;    &lt;Button        android:id=""@+id/type""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingLeft=""10dp""        android:text=""Home"" /&gt;        &lt;RelativeLayout            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:paddingLeft=""10dp""            android:paddingRight=""10dp""            &gt;               &lt;EditText                android:id=""@+id/value""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:layout_alignParentTop=""true""                android:layout_alignParentLeft=""true""                android:text=""""                android:hint=""Name""                android:lines=""1""                android:textSize=""10pt""                android:typeface=""sans""                android:textColor=""#FF000000""                android:gravity=""left""                /&gt;        &lt;/RelativeLayout&gt;    &lt;ImageView      android:id=""@+id/del""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:layout_alignParentRight=""true""      android:layout_alignParentTop=""true""      android:paddingRight=""14dp""      android:src=""@android:drawable/ic_delete"" /&gt;  &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>This is the ListView portion.</p><pre><code>&lt;ListView                  android:id=""@+id/phoneList""                  android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:background=""#FFFFFFFF""                  android:scrollbars=""none"" /&gt;</code></pre><p>This is really confusing :S. Could anyone help me please?</p>","271736","","","","","2012-05-14 14:05:46","How to expanding ListView as list item populate?","<android>","3","0","1","",""
"3546084","1","","","2010-08-23 09:06:02","3","812","<p>How I should go about recording a video screen capture of an OpenGL application?</p><p>So far my plan of attack is to take individual screenshots then run it through a video encoder.</p><p>Does anyone here know of any sample code I can look at or has any suggestions of things I can look at?</p><p>I'm looking for the OpenGL app to capture in game footage and save it as video content.</p>","243803","","3383428","","2014-03-11 20:57:39","2014-03-11 20:57:39","Android screen video recording","<android><opengl-es><video-encoding>","1","2","1","",""
"3546238","1","","","2010-08-23 09:25:45","0","34","<p>I'm creating a dynamic tabs. In each newly created tabs , i'm opening a file. I want to get the filename or file descriptor of the selected tab to do file operations on that corresponding file. For example If i want to delete the file, the file and the corresponding tab should be closed.Please give suggestions...........</p><p>Thanks in advance.</p>","428231","","","","","2011-01-03 10:03:18","Problem in edittext content","<java><android>","1","1","","",""
"3546362","1","","","2010-08-23 09:44:26","2","5557","<p>Can anybody please tell what toString in Android is for and how it can be used?</p><p>As example would be highly appreciated.</p><p>Thanks in Advancejohn</p>","384176","","267269","","2010-08-23 10:21:56","2014-01-28 09:18:03","Android + toString","<android><tostring>","3","2","","",""
"3546380","1","3564147","","2010-08-23 09:46:40","0","2617","<p>I am using an ActivityGroup and when I finish a top-level Activity (e.g. with destroyActivity method) and display one from history, the getCurrentActivity method returns the last Activity - the finished one. I need to access currently displayed activity, which is actually shown.</p>","403324","","","","","2010-08-25 08:42:20","getCurrentActivity() and ActivityGroup","<android>","1","1","","",""
"3546475","1","","","2010-08-23 09:59:59","0","266","<p>can someone give me a guide on how I can add headers to my native c file.</p><p>So here's the details.</p><p>I was able to setup my android project to call a native function from a .so file. And actually I need to add box2d to my project, but I when I include the header files, it won't make. So basically my problem is how do I tell the make file to include a whole folder with header and cpp files.</p><p>I tried adding the path directly to the include statement just for the sake of testing it. The error goes away, but new errors come out.</p><p>Can anyone give me a simple guide how I to do this?Or what lines in the android.mk file should I add?I've been struggling for a week now, and other tutorials are really not that helpful.</p>","428239","","","","","2010-09-20 22:21:32","how to add includes in native c code that will be compiled by android ndk","<android><android-ndk>","2","0","","",""
"3546635","1","","","2010-08-23 10:24:11","2","912","<p>I'm having some trouble understanding why this code</p><pre>public class BitmapAllocTest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);               byte[] b = new byte[20 * 1000 * 1000];        b = null;        Bitmap.createBitmap(2500, 2000, Bitmap.Config.ARGB_8888);    }}</pre><p>throws an OutOfMemory exception on a device with a 24mb heap limit. If I comment out either of the allocations it runs fine. I was under the impression that the java vm would try to garbage collect before throwing OutOfMemory exceptions.</p><p>I suspect it having to do with android allocating the bitmaps on the native heap.</p>","428295","","","","","2010-08-27 19:36:15","Android bitmap allocation weirdness","<android><bitmap><out-of-memory>","2","0","","",""
"3546666","1","4070825","","2010-08-23 10:27:46","1","500","<p>I created an <code>Activity</code> which allows navigating between pages with a couple of Buttons (Previous and Next). When the user clicks one of the buttons, the <code>Activity</code> (same) needs to be ""refreshed"". In order to do this, I set up the buttons to make a call to </p><pre><code>onCreate(this);</code></pre><p>after they set up the other stuff that the activity uses for the paging to work.</p><p>And it is working so far, but I'm wondering if there is a better way. Is there?</p>","425749","","119895","","2010-08-23 11:06:08","2010-11-01 16:22:26","Refreshing an Activity","<android><activity>","3","4","0","",""
"3546675","1","","","2010-08-23 10:28:41","0","158","<p>How will i be able to find out the content type of an application, I have an application i need to be able to know what exactly that application contains, like if it has video or audio or images or just text.</p><p>Is there anyway i can find this?</p><p>thanks in advance.</p>","415053","","","","","2013-11-07 19:41:22","How to find the content type of the application in android","<android><types><content>","1","2","","",""
"3546916","1","3547058","","2010-08-23 11:05:42","2","1344","<p>I want to restrict capital letter typing through keyboard on my form.</p><p>any one guide me how to achieve this?</p>","249991","","119895","","2010-08-23 11:29:02","2010-08-23 11:40:37","how to restrict capital letter typing in android programmatically?","<android><activity>","2","0","","",""
"3546959","1","","","2010-08-23 11:11:27","2","814","<p>I'd like to keep track of all activities in the activity stack. Does anyone know how to do this from code?</p>","428168","","101318","","2011-04-21 14:04:51","2013-03-08 08:05:37","How to keep track of activities in activity stack","<android><activity>","2","3","","",""
"3547040","1","","","2010-08-23 11:22:54","1","1241","<p>I want to show <code>EditText</code> and <code>Button</code> in one line. But the size of the button is the fixed to some pixels. I wanted to get the width of <code>Button</code> programatically so that i can adjust width of <code>EditText</code> on changing the orientation to vertical or horizontal my XML file is as follows</p><pre><code>&lt;LinearLayout     android:id=""@+id/middleLayout""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:orientation=""horizontal""     &gt;&lt;EditText     android:layout_height=""50px""     android:layout_width=""wrap_content""     android:id=""@+id/searchBox""    android:layout_marginTop=""2px""    android:visibility=""visible""    android:singleLine=""true""    android:hint=""Enter Zip Code, City &amp;amp; State""    /&gt;&lt;Button    android:layout_height=""wrap_content""    android:layout_width=""20px""     android:id=""@+id/searchBtn""    android:visibility=""visible""    android:layout_marginTop=""3px""    android:text=""Search""    /&gt;  &lt;/LinearLayout&gt;</code></pre><p>I am calculating it by following code.</p><pre><code>searchBox = (EditText) findViewById(R.id.searchBox);   searchbutton = (Button) findViewById(R.id.searchBtn);  int searchIconWidth = searchbutton.getWidth(); searchBox.setWidth(getting_screen_width() -  searchIconWidth );</code></pre><p>for calculating screen width I have used following</p><pre><code>private int getting_screen_width()     {     DisplayMetrics dm = null;    dm = new DisplayMetrics();    getWindowManager().getDefaultDisplay().getMetrics(dm);    String width = """"+dm.widthPixels ;    dm = null;       return Integer.parseInt(width);    }</code></pre><p>But when I run above code than <code>EditText</code> takes full width &amp; Search button is not shown. What can be the problem in getting the Button width in Pixels.</p><p>Please help me out. Thanks in advanced.</p>","329701","","119895","","2010-08-23 11:33:17","2010-08-23 11:38:29","How to get width of the Button in android","<android><android-emulator>","1","1","","",""
"3547084","1","3547725","","2010-08-23 11:28:53","0","3755","<p>I need to know how he takes drawable object.I'm collecting some ImageView objects in array, they have background images that are rather big in resolution so they take lot of memory... I have read somewhere that it will automatically create image with resolution that my imageView have, so i think it will take less memory than first one...Please tell me, if i set scaleType property, will it scale that image? Will that help me to save memory? </p>","654799","","","","","2010-08-23 12:57:34","How works android ImageView android:scaleType=""fitXY"" property?","<android><imageview>","1","0","","",""
"3547118","1","3547148","","2010-08-23 11:34:50","0","1482","<p>Does anyone know how to access the contacts from the Galaxy S?</p><p>I have this line of code:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW, Contacts.CONTENT_URI);startActivity(intent);</code></pre><p>and it works on the emulator as well as on the Samsung i5700.  I tried running my app on Samsung i9000 (Galaxy S) but it crashes.</p><p>I am getting the following error from LogCat:</p><pre><code>08-23 11:28:19.511: INFO/ActivityManager(2234): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android.contacts/contacts }08-23 11:28:19.516: DEBUG/AndroidRuntime(5067): Shutting down VM08-23 11:28:19.516: WARN/dalvikvm(5067): threadid=3: thread exiting with uncaught exception (group=0x4001dc20)08-23 11:28:19.516: ERROR/AndroidRuntime(5067): Uncaught handler: thread main exiting due to uncaught exception08-23 11:28:19.526: INFO/Lights(2234): set_light_backlight[0~255]:(42) gamma_value:(4) BRIGHTNESS_MODE(1)08-23 11:28:19.526: VERBOSE/AudioHardwareALSA(2183): ------------------------&gt;&gt;&gt;&gt;&gt;&gt; ALSA OPEN mode 0,device 2 08-23 11:28:19.526: ERROR/AndroidRuntime(5067): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=content://com.android.contacts/contacts }08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.app.Activity.startActivityForResult(Activity.java:2758)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.app.Activity.startActivity(Activity.java:2864)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at au.com.orionmedia.vidcall.KeypadActivity.onClick(KeypadActivity.java:313)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.View.performClick(View.java:2417)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.View.onTouchEvent(View.java:4232)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.View.dispatchTouchEvent(View.java:3762)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1713)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1131)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.app.Activity.dispatchTouchEvent(Activity.java:2070)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1697)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.os.Handler.dispatchMessage(Handler.java:99)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.os.Looper.loop(Looper.java:123)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at android.app.ActivityThread.main(ActivityThread.java:4363)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at java.lang.reflect.Method.invokeNative(Native Method)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at java.lang.reflect.Method.invoke(Method.java:521)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)08-23 11:28:19.526: ERROR/AndroidRuntime(5067):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I tried accessing the phonebook from the launcher, and this is what I get:</p><pre><code>08-23 17:50:53.885: INFO/ActivityManager(2244): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.contacts/com.sec.android.app.contacts.PhoneBookTopMenuActivity }08-23 17:50:54.055: INFO/ContactsListActivity(2401): Called with action: com.android.contacts.action.LIST_DEFAULT08-23 17:50:54.205: INFO/ActivityManager(2244): Displayed activity com.android.contacts/com.sec.android.app.contacts.PhoneBookTopMenuActivity: 208 ms (total 1265628 ms)</code></pre><p>Based on those logs, I am guessing that the phone does not use the default contacts application and it does not handle the intent I am firing from my app.</p><p>I tried changing the URI I am passing to the intent, but it doesn't work either.</p><p>Has anybody else seen this problem? Any suggestions on what I can try next?</p><p>Thank you!- Zarah</p>","395576","","","","","2010-10-04 04:27:36","Accessing the phonebook on Galaxy S crashes the app","<android><android-intent><contacts>","3","0","1","",""
"3547144","1","3547356","","2010-08-23 11:38:49","0","814","<p>friend's,   i need help on placing images(back and forward images) at two end of my gallery view ,i have gallery to list menus to scroll horizontally,and this gallery is in RelativeLayout how can i get the images at two ends of gallery without scrolling.</p><p>Thanks in advance.</p>","407506","","407506","","2010-08-23 11:45:19","2010-08-23 12:21:22","How to set images at the ends of Gallery view(right and left)","<android>","2","0","1","",""
"3547169","1","3549979","","2010-08-23 11:42:44","1","268","<p>I recently released a game on the Android market. It seems to be working fine for most people, but everyone using a Samsung Galaxy S is reporting the same problem: The graphics for the game are not being drawn on screen (though they appear to be present, sound effects are still generated). The game uses a SurfaceView to draw the various elements from PNG graphics, and everything is scaled so that it will work on any resolution. I don't have a Galaxy S, so debugging is quite hard, can anyone who's had experience developing on a Galaxy S let me know if they found any particular quirks with the device?</p>","319618","","","","","2010-09-22 18:35:18","What quirks should I look out for when developing for the Samsung Galaxy S?","<android><testing><android-hardware>","3","1","0","",""
"3547439","1","3547504","","2010-08-23 12:18:42","2","1321","<p>Hi allI will try to be specific if I can - please be patient, first time asker and relatively new to programming on this platform. Apologies if this has been asked/answered before - please link it to me. I have searched up and down but find other unrelated (to me at least) problems.</p><p>The real puzzler for me is that my app is crashing on my emulator but when installed on my phone (via upload of apk to phone and then using an AppInstaller app from market) it works.</p><p>The crash comes from a NullPointerException at the numbered line in the following code snippet (my code) of a custom list cursor adapter.  </p><pre><code>// TaskListCursorAdapter.java@Overridepublic void bindView(View view, Context context, Cursor cursor) {    super.bindView(view, context, cursor); // &lt;&lt;&lt; LINE 36    // DO OTHER BINDING OF STRINGS TO TEXT VIEWS ETC</code></pre><p>The following error dump is created.</p><pre><code>08-23 21:58:57.251: ERROR/AndroidRuntime(346): Uncaught handler: thread main exiting due to uncaught exception08-23 21:58:57.411: ERROR/AndroidRuntime(346): java.lang.NullPointerException08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.SimpleCursorAdapter.bindView(SimpleCursorAdapter.java:149)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at adriaansapps.com.tasks.TaskListCursorAdapter.bindView(TaskListCursorAdapter.java:36)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at adriaansapps.com.tasks.TaskListCursorAdapter.newView(TaskListCursorAdapter.java:83)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.CursorAdapter.getView(CursorAdapter.java:182)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.AbsListView.obtainView(AbsListView.java:1274)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1147)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.ListView.onMeasure(ListView.java:1060)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:619)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:280)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:569)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:361)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.View.measure(View.java:7964)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewRoot.performTraversals(ViewRoot.java:763)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.os.Handler.dispatchMessage(Handler.java:99)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.os.Looper.loop(Looper.java:123)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at android.app.ActivityThread.main(ActivityThread.java:4363)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at java.lang.reflect.Method.invokeNative(Native Method)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at java.lang.reflect.Method.invoke(Method.java:521)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-23 21:58:57.411: ERROR/AndroidRuntime(346):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Curiously I have been happily programming and debugging away all day and out of the blue a long working and bug free portion of my app now throws up this error.</p><p>I suspect it might be a problem with the databases, but really not sure - nothing seems out of place there. Up until today I had a database with only one table - today I added a new table which also has a ""_id"" field as the name autoincrement key field, which I read in the docs was required for android list adapters (if memory serves). Having some experience in coding and some minor experience with databases, that seems like a bad idea to me but I am uncertain of if that is the problem and/or how else to do it.</p><p>The crash I am listing here does not display or make reference to the data in the other, new table. The cursor does not contain any query data from it. In fact if I rename the key field ""_id"" of the new table to something else (ie ""_blah""), the crash remains.</p><p>Like I said, if I upload the apk to my phone, it works.</p><p>I have tried the following on the emulator:- restarting adb (and eclipse) - no result - uninstall from emulator - no result- destory AVD profile and recreate - no result</p><p>I am developing this under the Android 2.1 SDK, and have been for the last few weeks. I have only ever had that SDK installed, I am yet to update to 2.2.</p><p>Not sure what else I can say here - hoping somebody here has experience enough to shed some light on it.</p><p>Without a fix to this, I can anticipate a very slow development process here on out (assuming I have to upload to my phone to test new code changes...).</p><p>Sorry for being long winded - hoping I am providing enough info for one of you smarter people to nail this. Thanks</p>","428371","","428371","","2010-08-28 05:06:41","2010-12-12 12:32:42","Custom list cursor adaptor crashes at bindView on emulator -- not on phone","<android><cursor><adapter><listadapter>","4","0","0","",""
"3547467","1","3547575","","2010-08-23 12:23:47","0","484","<p>In Android I am writing an application in which, I would like to capture an event if in case user doesn't do any activity (tapping/key press). </p><p>For better context - It is like session timeout.</p><p>Basic solution  - I can  override the key press/tapping event and put one timer which continuously run either as thread or service. In my opinion this is bit heavier solution in terms of resource.</p><p>Any thoughts for elegant solution?</p>","279990","","133203","","2010-08-23 12:31:37","2010-08-23 12:39:58","Android: light weight solution to detect keypress","<android><mobile>","1","0","","",""
"3547470","1","3547577","","2010-08-23 12:24:06","0","5159","<p>I 'm trying to read and display contacts from phone book in android. My Device is synced up with gmail and funambol which togehter have more than 600 records. Now by default my application reads gmail contacts. On selecting any contact from the displayed list, it throws an exception as the list is displaying a gmail contact which just has email and no phone no.</p><p>I  need phone no to use in my application.</p><p>thanks</p>","218665","","","","","2010-08-23 12:40:21","Reading contacts from phone book in Android","<android><sdk>","1","0","1","",""
"3547658","1","","","2010-08-23 12:49:11","4","12430","<p>I am trying to connect to a paired <code>bluetooth</code> device (baracoda d-fly bar code reader). I tried the program <code>GetBlueDemo</code> from market and this manages to read from its socket.</p><p>I wrote my own proof of concept, but i just keep getting an excpetion when i try to connect to the device. </p><pre><code>08-23 14:39:28.635: DEBUG/BluetoothTest(19238): Could not connect to socket08-23 14:39:28.635: DEBUG/BluetoothTest(19238): java.io.IOException: socket failed to connect08-23 14:39:28.635: DEBUG/BluetoothTest(19238):     at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:255)08-23 14:39:28.635: DEBUG/BluetoothTest(19238):     at org.me.barcodetest.MainActivity$ConnectRunnable.run(MainActivity.java:211)08-23 14:39:28.635: DEBUG/BluetoothTest(19238):     at java.lang.Thread.run(Thread.java:1102)</code></pre><p>Any suggestions on what i am doing wrong?</p><pre><code>package org.me.barcodetest;import android.app.Activity;import android.app.AlertDialog;import android.app.AlertDialog.Builder;import android.app.Dialog;import android.app.ProgressDialog;import android.bluetooth.BluetoothAdapter;import android.bluetooth.BluetoothDevice;import android.bluetooth.BluetoothSocket;import android.content.DialogInterface;import android.content.DialogInterface.OnCancelListener;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.util.Set;import java.util.UUID;public class MainActivity extends Activity {private static final int REQUEST_ENABLE_BT = 2;private BluetoothAdapter bluetoothAdapter;private UUID applicationUUID = java.util.UUID.randomUUID();private static final String logTag = ""BluetoothTest"";@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();    if (bluetoothAdapter == null) {        Log.d(logTag, ""Could not get bluetooth adapter"");        return;    }    searchForDevices();}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    if (requestCode == REQUEST_ENABLE_BT) {        if (requestCode == RESULT_OK) {            Log.d(""BluetoothTest"", ""bluetooth enabled"");            searchForDevices();        } else {            Log.d(""BluetoothTest"", ""Could not enable bluetooth device"");        }    }}public void lineReadFromBluetoothDevice(String line) {    Log.d(logTag, ""Mottok: "" + line);}private void searchForDevices() {    if (bluetoothAdapter.isEnabled()) {        Set&lt;BluetoothDevice&gt; devicesAvailable = bluetoothAdapter.getBondedDevices();        if (devicesAvailable.isEmpty()) {            informUserNoDevicesPaired();        } else {            askUserToPickDeviceToUse(devicesAvailable);        }    } else {        Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);        startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);    }}private void askUserToPickDeviceToUse(Set&lt;BluetoothDevice&gt; devicesAvailable) {    final ListView view = new ListView(this);    view.setChoiceMode(ListView.CHOICE_MODE_SINGLE);    ArrayAdapter&lt;BluetoothDevice&gt; adapter =            new ArrayAdapter(this, R.layout.devicesavailabletextview, devicesAvailable.toArray(new BluetoothDevice[devicesAvailable.size()])) {                @Override                public View getView(int position, View convertView, ViewGroup parent) {                    TextView view = (TextView) super.getView(position, convertView, parent);                    BluetoothDevice bluetoothDevice = (BluetoothDevice) getItem(position);                    view.setText(bluetoothDevice.getName() + "" : "" + bluetoothDevice.getAddress());                    return view;                }            };    view.setAdapter(adapter);    view.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position, long arg3) {            pairToDevice((BluetoothDevice) view.getItemAtPosition(position));        }    });    Dialog dialog = new Dialog(this);    dialog.setContentView(view);    dialog.setCancelable(true);    dialog.show();}private void informUserNoDevicesPaired() {    Builder dialogBuilder = new AlertDialog.Builder(this);    dialogBuilder.setMessage(""Ingen \""Paired\"" enheter"");    dialogBuilder.setPositiveButton(""Søk"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int arg1) {            dialog.dismiss();        }    });    dialogBuilder.setOnCancelListener(new OnCancelListener() {        public void onCancel(DialogInterface dialog) {            dialog.dismiss();            finish();        }    });    dialogBuilder.show();}private void showError(String message) {    Builder dialogBuilder = new AlertDialog.Builder(this);    dialogBuilder.setMessage(""Det oppstod en feil i programmet:\n\n"" + message);    dialogBuilder.setOnCancelListener(new OnCancelListener() {        public void onCancel(DialogInterface dialog) {            dialog.dismiss();            finish();        }    });    dialogBuilder.show();}private void pairToDevice(BluetoothDevice bluetoothDevice) {    openSocket(bluetoothDevice);}private void openSocket(BluetoothDevice bluetoothDevice) {    try {        final ProgressDialog dialog = new ProgressDialog(this);        final ConnectRunnable connector = new ConnectRunnable(bluetoothDevice, dialog);        dialog.show(this, ""Kobler til"", ""Koblier til "" + bluetoothDevice.getName() + "" : "" + bluetoothDevice.getAddress(),                true, true,                new OnCancelListener() {                    public void onCancel(DialogInterface dialog) {                        connector.cancel();                    }                });        new Thread(connector).start();    } catch (IOException ex) {        Log.d(logTag, ""Could not open bluetooth socket"", ex);        showError(""Kunne ikke åpne socket grunnet feil: "" + ex.getMessage());    }}private void closeSocket(BluetoothSocket openSocket) {    try {        openSocket.close();    } catch (IOException ex) {        Log.d(logTag, ""Could not close exisiting socket"", ex);    }}private void startListeningForInput(BluetoothSocket socket) {    new Thread(new InputReader(socket)).start();}private void dismissDialog(final Dialog dialog) {    runOnUiThread(new Runnable() {        public void run() {            dialog.dismiss();        }    });}private class ConnectRunnable implements Runnable {    private final ProgressDialog dialog;    private final BluetoothSocket socket;    public ConnectRunnable(BluetoothDevice device, ProgressDialog dialog) throws IOException {        socket = device.createRfcommSocketToServiceRecord(applicationUUID);        this.dialog = dialog;    }    public void run() {        try {            bluetoothAdapter.cancelDiscovery();            socket.connect();        } catch (IOException connectException) {            Log.d(logTag, ""Could not connect to socket"", connectException);            closeSocket(socket);            return;        }        startListeningForInput(socket);        dismissDialog(dialog);    }    public void cancel() {        try {            socket.close();        } catch (IOException e) {            Log.d(logTag, ""Canceled connection"", e);        }    }}private class InputReader implements Runnable {    private final BluetoothSocket socket;    public InputReader(BluetoothSocket socket) {        this.socket = socket;    }    @Override    public void run() {        try {            final InputStream input = socket.getInputStream();            final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(input, ""UTF-8""));            String line;            while ((line = bufferedReader.readLine()) != null) {                lineReadFromBluetoothDevice(line);            }        } catch (IOException ex) {            showError(""Mistet forbindelsen: "" + ex.getMessage());        }    }    public void cancel() {        try {            socket.close();        } catch (IOException e) {        }    }}}     &lt;uses-permission android:name=""android.permission.BLUETOOTH"" /&gt;     &lt;uses-permission android:name=""android.permission.BLUETOOTH_ADMIN"" /&gt;</code></pre><p>devicesavailabletextview:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;</code></pre>","386702","","717341","","2013-03-09 16:10:46","2013-06-18 10:31:29","Connecting to paired bluetooth device (BluetoothSocket) in android 2.1","<android><bluetooth>","2","0","2","",""
"3547692","1","3547798","","2010-08-23 12:53:27","0","6306","<p>I have a binary file in the <code>R.raw</code> folder. Now I am able toget the file name and can read the file as well, but I need to find out the completepath of the file in string format.</p><p>any help will be appreciated.</p>","397901","","119895","","2010-08-23 13:00:21","2011-11-22 18:05:54","getting the full path of R.raw folder","<android>","1","2","","",""
"3547720","1","","","2010-08-23 12:57:13","0","907","<p>I cant seem to get scroll bar with ths following layout.</p><p></p><pre><code>&lt;TableLayout android:layout_height=""wrap_content""    android:stretchColumns=""*"" android:background=""#ff0000""    android:layout_margin=""1dip"" android:layout_width=""75dip""    android:layout_gravity=""center""&gt;    &lt;TableRow android:background=""@color/custom_button_bggreen""        android:layout_margin=""2dip""&gt;        &lt;TextView android:text=""H"" android:background=""@color/custom_button_bggreen""            android:gravity=""center"" android:textSize=""20dip"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:stretchColumns=""*""    android:background=""#ff0000"" android:layout_margin=""1dip""&gt;    &lt;TableRow android:background=""@color/custom_button_bggreen""        android:layout_margin=""2dip""&gt;        &lt;TextView android:text=""Hydrogen"" android:background=""@color/custom_button_bggreen""            android:gravity=""center"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:stretchColumns=""*""    android:background=""#ff0000"" android:layout_margin=""1dip""&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:text=""General Properties""            android:background=""#0000ff"" android:gravity=""center"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:stretchColumns=""*""    android:background=""#ff0000""&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:stretchColumns=""*""    android:background=""#ff0000"" android:layout_margin=""1dip""&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:text=""Physical Properties""            android:background=""#0000ff"" android:gravity=""center"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:stretchColumns=""*""    android:background=""#ff0000""&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:stretchColumns=""*""    android:background=""#ff0000"" android:layout_margin=""1dip""&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:text=""Atomic Properties""            android:background=""#0000ff"" android:gravity=""center"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;TableLayout android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:stretchColumns=""*""    android:background=""#ff0000""&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow android:background=""#00ff00"" android:layout_margin=""2dip""&gt;        &lt;TextView android:id=""@+id/button"" android:text=""+""            android:background=""#0000ff"" android:layout_margin=""2dip""            android:gravity=""left"" /&gt;        &lt;TextView android:text=""label"" android:background=""#0000ff""            android:layout_margin=""2dip"" android:gravity=""left"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;Button android:layout_width=""80dip"" android:layout_height=""wrap_content""    android:text=""Back"" android:id=""@+id/backkButton""    android:layout_gravity=""center""&gt;&lt;/Button&gt;</code></pre><p></p><p>Can any one of you point the problem please?</p><p>Thanks.</p>","418366","","","","","2010-08-23 13:03:26","Cant get scroll bar in android","<android>","2","0","","",""
"3547748","1","","","2010-08-23 13:01:16","1","1533","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2280298/how-to-retreive-java-script-function-value-in-webview-component"">How to retreive java script function value in webview component</a>  </p></blockquote><p>I have used HTML/CSS/js to make UI for my android app. (port from iPhone app)</p><p>One of the HTMLs contains a form. I need to get the values entered in that form and use them in android code. the target of the form is the page itself and the method is GET.</p><p>How can i get the values entered by the user in that form?</p>","428433","","","","","2010-08-24 09:45:43","get the values of the fields in a form in an android webview android","<android><forms><request><webview>","0","1","","2012-02-14 23:10:19",""
"3547921","1","","","2010-08-23 13:19:52","0","630","<p>Respected All,</p><p>I have to read xml files from server and display data from all files. some data contains character '?' which gives me SAXException while parsing. I have tried to convert UTF-8 format. but it gives me out of application as soon as that char is found in file.I have used SAXParser to parse xml file.</p><p>If you have any solution to this problem please help me.<br>                                                                                                        Thank You</p>","395627","","101258","","2010-08-23 13:27:30","2010-08-23 13:44:05","How to remove ? character while parsing xml file in android","<android><encoding><saxparseexception>","2","2","","",""
"3547947","1","3746662","","2010-08-23 13:22:52","3","1984","<p>I'm working on adding a calibration feature to an accelerometer-driven game. For the calibration, I need a single value from the accelerometer. Should I register a listener, get the first value it gives me, and unregister it, or is there a better way to get just one value?</p>","118391","","","","","2011-02-02 00:06:54","Get a single accelerometer value","<android><accelerometer>","2","0","1","",""
"3548095","1","3548394","","2010-08-23 13:39:39","4","3410","<p>I would like to write an app on Android to upload my GPS location to an external website once every ~5 minutes. This needs to have as minimal an impact on battery life as possible, but it also needs to work without any user interaction. (Background: I'm competing in an Ironman triathlon which will take me about 14 hours to complete, and want to broadcast my location in near-real-time but without having to worry about fiddling with my phone.)</p><p>So my initial thought is to write a Service which uses LocationManager.requestLocationUpdates() with a minTime of 5 minutes, but will this actually wake the device up every 5 minutes for my service to do its job?</p><p>It sounds like I would also need to use AlarmManager.setInexactRepeating() to make sure my service is awake while it completes its task but how does that play with requestLocationUpdates()? Should I instead set minTime=0 on requestLocationUpdates() but then go back to sleep as soon as the next update is obtained?</p><p>Any general guidance on how to design this is greatly appreciated. I'm a competent Java programmer &amp; will be using Google Maps on the server to plot my location, but am pretty new to Android development so I'm basically looking for a high-level plan on how to architect the client app.</p>","393931","","","","","2010-10-23 03:05:55","Obtain Android GPS location once every few minutes","<android><gps><android-service>","1","2","4","",""
"3548296","1","","","2010-08-23 14:05:08","1","2104","<p>friends i am downloading some images from website using xmlrpc now i want write the url of those images into xml files how to add data to exiting xml file in android </p>","400942","","","","","2010-08-23 16:45:12","how to write data to the existing xml file using code in android","<android><xml><xml-parsing>","0","3","1","",""
"3548406","1","3646326","","2010-08-23 14:18:03","0","2425","<p>I have a listview that needs to be multiple choice (i.e each list item has a checkbox which can be checked / unchecked)The list view is in a tabhost and is the content for teh first tab.</p><p>My set up is like so:</p><p>My tab is set up with:</p><pre><code>TabSpec tab = tabHost.newTabSpec(""Services"");tabHost.addTab(tabHost.newTabSpec(""tab_test1"").setIndicator(""Services"").setContent(new Intent(this, ServiceList.class)));</code></pre><p>When the tab is clicked new activity ServiceList is started</p><p>ServiceList is defined as such:</p><pre><code>    public class ServiceList extends ListActivity{        private EscarApplication application;        ListView listView;         @Override           public void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.service_list);             ServiceList.this.application = (EscarApplication) this.getApplication();             final ListView listView = getListView();         }         protected void onListItemClick(ListView l, View v, int position, long id) {            String.valueOf(id);            Long.toString(id);            ((CheckedTextView) v).setChecked(true);            super.onListItemClick(l, v, position, id);        }         @Override         public void onStart() {             super.onStart();            //Generate and display the List of visits for this day by calling the AsyncTask             GenerateServiceList services = new GenerateServiceList();             int id = ServiceList.this.application.getVisitId();             services.execute(id);             listView  = getListView();             listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);         }        //The AsyncTask to generate a list         private class GenerateServiceList extends AsyncTask&lt;Integer, String, Cursor&gt; {              // can use UI thread here              protected void onPreExecute() {              }              // automatically done on worker thread (separate from UI thread)              protected Cursor doInBackground(Integer...params) {                  int client_id = params[0];                  ServiceList.this.application.getServicesHelper().open();                  Cursor cur = ServiceList.this.application.getServicesHelper().getPotentialVisitServices(client_id);                  return cur;               }              // can use UI thread here              protected void onPostExecute(Cursor cur){                    startManagingCursor(cur);                  // the desired columns to be bound                  String[] columns = new String[] {ServicesAdapter.KEY_SERVICE};                  // the XML defined views which the data will be bound to                  int[] to = new int[] {R.id.display_service};                  SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(ServiceList.this, R.layout.service_list_element, cur, columns, to);                  // set this adapter as your ListActivity's adapter                  ServiceList.this.setListAdapter(mAdapter);ServiceList.this.application.getServicesHelper().close();                     }         }    }</code></pre><p>So, everything works ok until I click on my list item to change the checkbox state.</p><p>The part of teh code set to handle click events is causing me problems:</p><pre><code> protected void onListItemClick(ListView l, View v, int position, long id) {                String.valueOf(id);                Long.toString(id);                ((CheckedTextView) v).setChecked(true);                super.onListItemClick(l, v, position, id);            }</code></pre><p>My understanding is that the View v passed to the onListItemClick method reperesents my list element, so I am trying to cast v as a CheckedTextView and set teh checked value to true, however this just causes my app to crash. Am I missing something simple here, or is there an easier way to do this?</p><p>Thanks</p><p>Kevin</p>","409826","","","","","2010-09-05 14:09:27","Android CheckedTextView - Changing checked status on click","<android><listviewitem><checkedtextview>","1","1","","",""
"3548441","1","3765577","","2010-08-23 14:22:30","33","26340","<p>My application need to create a small progressBar programmatically.ProgressBar doesn't have method to set the style (I want a smallprogressBar). The constructor can take a AttributeSet, however it is ainterface and require me implements a set of functions. Is there a wayto set the progressBar small style? ( I can't use xml to createprogressBar)</p>","164460","","56285","","2014-01-15 16:05:25","2014-01-15 16:05:25","How to create a ProgressBar programmatically?","<android><android-progressbar>","2","0","5","",""
"3548533","1","3591668","","2010-08-23 14:32:11","12","37497","<p>I'm trying to deploy an application with an existing SQLite database.</p><p>I've read through and attempted to implement several samples online however I've found that they are always missing some code and either do not compile or work as advertised.</p><p>Does anyone have a Full Android Database Helper class for deploying an existing SQLite database on Android?</p>","102526","","102526","","2012-11-28 18:04:40","2013-02-12 10:04:51","What is a Full Android Database Helper class for an existing SQLite database?","<android><database><sqlite><setup>","2","6","14","2012-11-28 17:21:05",""
"3548545","1","3549734","","2010-08-23 14:33:48","1","334","<p>I'm writing a fairly simple app which, upon a fatal error, displays a dialog box apologising to the user.  This dialog has a button which gives the user the opportunity to let me know that the app has failed and why.</p><p>It seems a little overkill to create an email for this task - especially an email from the user themselves.  Is there a nice, simple way to send some feedback to me? This won't be an FC situation so Froyo's new feedback mechanism won't come into play.  Anyway - I'd like to get these reports from pre-Froyo users as well. </p>","398293","","","","","2011-02-08 23:57:16","Getting Error Feedback in Android","<android>","4","1","","",""
"3548666","1","","","2010-08-23 14:48:50","27","36685","<p>I have a <code>SurfaceView</code> that is being used to draw images, and I would like to overlay them onto a live-feed from the phone's camera.</p><p>Currently, the <code>SurfaceView</code> that contains the images have a white-background, but if I were to overlay them onto the phone's camera feed, they would have to be transparent. The camera and animation drawing cannot be done on the same <code>SurfaceView</code>.</p><p>What is the best course to pursue the use of multiple views that involve managing the camera and drawing images? Is it possible to make a <code>SurfaceView</code> transparent? </p>","155726","","155726","","2010-09-09 02:25:12","2012-10-18 10:25:47","Overlay images onto Camera preview SurfaceView","<android><graphics><camera><surfaceview>","5","0","27","",""
"3548982","1","3549644","","2010-08-23 15:21:07","0","908","<p>Is there a way to extend a drawable (just like how shapes work, create your own tag) and allow it to be inflated from XML?  Or is drawable only for the allowed 9 types?</p>","13046","","","","","2010-08-23 16:36:22","Inflating Drawables from XML in Android","<android>","1","1","","",""
"3549432","1","3559733","","2010-08-23 16:10:01","3","1634","<p>I have a static library, Foo, that is used by a shared library, Bar. Bar is the native shared library loaded by my Android app. Foo contains JNI functions that are only called by Java code and not by any C++ code in Bar. Because of this, those JNI functions get stripped out of the static library (Foo) when the shared library (Bar) is built. I'm currently using a slightly hacky method to prevent that from happening.</p><p>So, in this case, is there a way to tell the compiler to not strip the JNI (or any) functions out when linking?</p>","93802","","","","","2012-09-09 09:03:37","Preventing functions from being stripped from a static library when linked into a shared library?","<android><jni>","2","0","1","",""
"3549596","1","3551010","","2010-08-23 16:30:06","20","6214","<p>I am working on a small android project where it is necessary to share some data amongst several activities and a service that runs in a separate process. I would just like to know what are my options in terms of sharing data? Application class? IPC? File-based? Broadcasts? Thanks guys!</p>","410951","","272824","","2010-08-23 16:37:33","2011-08-05 10:54:52","Sharing data amongst activities and services","<android><design-patterns>","1","0","8","",""
"3549712","1","3551072","","2010-08-23 16:43:47","4","6792","<p>Is it possible to have an index on the righthand side of a ListView?  This is possible on the iPhone where running down the righthand side the alphabet is shown.  Touching a letter on the alphabet brings one to the beginning of the items in the ListView that start with that letter.</p><p>Is there built-in code in Android for this functionality?  Or is this something one would have to custom make?</p>","148635","","272824","","2010-08-26 05:21:09","2012-10-15 04:17:15","android - index for ListView?","<android><design-patterns>","3","1","7","",""
"3550021","1","3551980","","2010-08-23 17:22:13","0","1137","<p>How, in android, do I start an app set as the default (i.e. Handcent for Messaging, Dolphin for browsing)?</p><p>I can only find how to use definite package names for intents:</p><pre><code>Intent i = new Intent(Intent.ACTION_MAIN);        i.addCategory(Intent.CATEGORY_LAUNCHER);        switch (position) {        case 0: //messages            i.setPackage(""com.android.mms"");            break;        case 1: //inbox            i.setPackage(""com.android.email"");            break;        case 2: //browser            i.setPackage(""com.android.browser"");        default:            i = null;        }</code></pre>","428665","","","","","2010-08-24 22:27:44","Launching default apps with intents","<android><android-intent><default><package><messages>","2","3","","",""
"3550024","1","5180156","","2010-08-23 17:22:17","17","22163","<p>Is it possible with Android to have a search bar for a ListView so that when the search bar is touched a keyboard pops up, and when text is typed into the search bar, the items that match in the ListView are shown?</p><p>What I really need is the search bar that brings up a keyboard.</p><p>Update:</p><p>I've added the EditText field that brings up a keyboard and I can type into the EditText field.  What I want is to have the first few characters of the items in the list shown in the ListView match the characters typed into the EditText window.</p><p>I've tried following the approach listed here <a href=""http://stackoverflow.com/questions/1737009/answer-to-making-a-nice-looking-listview-filter-on-android/1737042#1737042"">ListView Filter</a> but I am a little confused as to how much filtering is already done in ListView?  </p><p>1)  Do I need to create a separate array that stores the values that match the text typed into EditText?  From this post <a href=""http://stackoverflow.com/questions/3414490/listview-not-updating-after-filtering"">Call adapter.notifyDataSetChanged</a>, it appears that ListView already has a shadow array to do this, and it gets updated when adapter.notifyDataSetChanged(); is called.</p><p>2)  Do I need to call adapter.notifyDataSetChanged(); to have ListView updated after I type some text in the EditText window?</p><p>3)  Do I need to extend ListActivity as this <a href=""http://stackoverflow.com/questions/3033791/the-method-setlistadapterarrayadapter-is-undefined-for-the-type-create"">post</a> indicates?  If so how do I extend my activity class if the activity class is already being extended from the main activity?</p><p>4)  What I currently have is the following:</p><pre><code>ArrayAdapter&lt;String&gt; adapter = null;private EditText filterText = null;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.symptom);    ListView symptomList = (ListView) findViewById(R.id.ListView_Symptom);    symptomList.setTextFilterEnabled(true);    symptomList.setFastScrollEnabled(true);    filterText = (EditText) findViewById(R.id.search_box);    filterText.addTextChangedListener(filterTextWatcher);    adapter = new ArrayAdapter&lt;String&gt;(this, R.layout.menu_item, symptomsArray);    symptomList.setAdapter(adapter);    private TextWatcher filterTextWatcher = new TextWatcher() {        public void afterTextChanged(Editable s) {        }        public void beforeTextChanged(CharSequence s, int start, int count,                int after) {        }        public void onTextChanged(CharSequence s, int start, int before,                int count) {            adapter.getFilter().filter(s);            adapter.notifyDataSetChanged();        }    };</code></pre><p>Unfortunately at the moment when I type in the EditText box, I get a NullPointer Exception in </p><pre><code> Thread [&lt;7&gt; Filter] (Suspended (exception NullPointerException))   ArrayAdapter$ArrayFilter.performFiltering(CharSequence) line: 437   Filter$RequestHandler.handleMessage(Message) line: 234  Filter$RequestHandler(Handler).dispatchMessage(Message) line: 99    Looper.loop() line: 123 HandlerThread.run() line: 60    </code></pre><p>Any idea what I am missing?</p>","148635","","148635","","2010-09-04 02:43:16","2012-11-22 14:27:20","android - search listview?","<android>","4","0","11","",""
"3550052","1","","","2010-08-23 17:25:51","1","699","<p>I am using InteliJ Idea Community edition to develop android apps. I was trying to write UnitTests for a HelloWorld App as described in <a href=""http://developer.android.com/guide/developing/testing/testing_otheride.html"" rel=""nofollow"">link text</a>. However I keep on getting an error </p><pre><code>Found main project package: com.example.helloandroidFound main project activity: .HelloAndroidError: Unable to load the main project's default.properties</code></pre><p>On going through the files that were created by InteliJ Idea, I saw that all the files as mentioned in <code>d.android.com/guide/developing/other-ide.html#CreatingAProject</code> are being created except for <code>defaul.properties</code> and <code>build.properties</code>. </p><p>Is there any way we can create these files?</p>","428598","","243782","","2010-08-23 19:27:32","2011-06-29 20:11:16","default.properties not being created","<android><testing>","2","0","","",""
"3550136","1","","","2010-08-23 17:37:31","4","7621","<p>I am looking for a way to change the light sensitivity of my Evo 4G camerea. I know it is not the camera's shutter speed because it is a digital camera. The next most relevant aspect is the ISO setting, but the Android SDK does not have a way to manipulate it. Does any one know an alternative? i.e scene mode, exposure or effects  </p><p>**parameter.set(""iso"", int) sets the iso. </p><p>Does anyone have the run down on what scene mode values represents?</p><hr><p>Thanks for the input. I have looked over those pages numerous times. I was looking for a function similar to parameter.set(""iso"", int) because this function was successful in changing the iso setting. The camera does not have aperture as a setting. Maybe I can manipulate some firmware files.  </p>","428676","","53114","","2011-08-27 10:09:32","2011-08-27 10:09:32","Camera ISO setting/ shutter speed","<android><camera><iso>","2","2","","",""
"3550149","1","3551272","","2010-08-23 17:40:44","1","787","<p>I'm trying to save photos that I taken with my app to a specific directory. It was working but I'm getting close to being finished with the app and wanted to try a fresh install. I deleted the folder where the photos were being saved and now it won't remake them. Here's my code.</p><pre> PictureCallback jpegCallback = new PictureCallback() { //      public void onPictureTaken(byte[] data, Camera camera) {       FileOutputStream outStream = null;       try {                       android.os.Environment.getExternalStorageState();            // create a File object for the parent directory              File PhotoDirectory = new File(                      android.os.Environment.getExternalStorageDirectory()+                      ""/GrowJournalPhotos/""+journ_id+""/""+plant_id+""/"");        // have the object build the directory structure, if needed.        PhotoDirectory.mkdirs();        // create a File object for the output file        File outputFile = new File(PhotoDirectory, ""photo.jpg"");        // now attach the OutputStream to the file object, instead of a String representation        outStream = new FileOutputStream(outputFile);    //----LINE 82----//         // Write to SD Card         outStream.write(data);         outStream.close();         Log.d(TAG, ""onPictureTaken - wrote bytes: "" + data.length);         setResult(RESULT_OK);            finish();       } catch (FileNotFoundException e) { //          e.printStackTrace();       } catch (IOException e) {         e.printStackTrace();       } finally {       }       Log.d(TAG, ""onPictureTaken - jpeg"");     }   };</pre><p>And the IO error:</p><pre>08-23 13:26:18.263: WARN/System.err(9515): java.io.FileNotFoundException: /sdcard/GrowJournalPhotos/geo a/1/photo.jpg08-23 13:26:18.263: WARN/System.err(9515):     at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:244)08-23 13:26:18.263: WARN/System.err(9515):     at java.io.FileOutputStream.(FileOutputStream.java:97)08-23 13:26:18.263: WARN/System.err(9515):     at java.io.FileOutputStream.(FileOutputStream.java:69)08-23 13:26:18.263: WARN/System.err(9515):     at com.grower.beta.takephoto$3.onPictureTaken(takephoto.java:82)08-23 13:26:18.263: WARN/System.err(9515):     at android.hardware.Camera$EventHandler.handleMessage(Camera.java:323)08-23 13:26:18.263: WARN/System.err(9515):     at android.os.Handler.dispatchMessage(Handler.java:99)08-23 13:26:18.263: WARN/System.err(9515):     at android.os.Looper.loop(Looper.java:123)08-23 13:26:18.263: WARN/System.err(9515):     at android.app.ActivityThread.main(ActivityThread.java:4595)08-23 13:26:18.263: WARN/System.err(9515):     at java.lang.reflect.Method.invokeNative(Native Method)08-23 13:26:18.263: WARN/System.err(9515):     at java.lang.reflect.Method.invoke(Method.java:521)08-23 13:26:18.263: WARN/System.err(9515):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-23 13:26:18.263: WARN/System.err(9515):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-23 13:26:18.263: WARN/System.err(9515):     at dalvik.system.NativeStart.main(Native Method)08-23 13:26:18.263: DEBUG/CameraDemo(9515): onPictureTaken - jpeg</pre><p>I do have permissions set to write to external storage.If I create the directory manually, mounting as drive on computer and creating the first folder ""/sdcard/GrowJournalPhotos/"" everything else will work. Defiantly need to make sure the app will create the entire directory, when necessary. </p>","393328","","393328","","2010-08-23 21:05:15","2010-08-23 21:05:15","Directory creation failing... Java, Android","<java><android>","3","0","","",""
"3550216","1","3550524","","2010-08-23 17:50:07","0","871","<p>I'm making something of a todo list and the one issue I'm facing is that I cannot figure out how to make it for when I click on an item within a listview the text in that row gets the strikethrough effect. I know I'm supposed to call:</p><pre><code>TextView text = (TextView)view.findViewById(android.R.id.text);text.setPaintFlags(text1.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);</code></pre><p>I'm calling it from on <code>onListItemClick</code> but it crashes when I click an item. Any suggestions?</p>","427377","","250259","","2012-08-15 01:01:17","2012-08-15 01:01:17","Strikethough text in listview?","<android>","1","0","","",""
"3550421","1","","","2010-08-23 18:16:54","1","1036","<p>No matter which type of android virtual device I create from the Android SDK and AVD Manager, whenever I start it, my entire laptop just shuts down after getting the blue screen of death. I see this error in the Event system Log (""Driver VPCAppSv.sys has been blocked from loading."") but not sure if it's related to it or not.  </p><p>Anyone have any ideas?  I've installed again 3 times with no luck.</p>","428698","","","","","2012-01-06 13:29:54","Android Emulator gives blue screen of death","<android><sdk><emulator><avd><vpc>","1","2","1","",""
"3550593","1","3551887","","2010-08-23 18:34:32","0","1101","<p>I'm attempting to turn a web interface into an Android one by parsing the web page for relevant data and then allowing the user to send back data to the server. Using simple HttpClient code I have managed to get the web page and then parse the necessary information. I'm unfamiliar with sending data back, so, I'm hoping someone can shed some light. Here's the relevant HTML code from the login page.</p><pre><code>&lt;table cellspacing=0 cellpadding=0&gt;&lt;tr&gt;&lt;td valign=top align=center&gt;&lt;table cellspacing=0 cellpadding=0 border=0  width=220 align=center class=table_back&gt;&lt;tr&gt;&lt;td&gt;&lt;table cellspacing=1 cellpadding=1 border=0 width=100%&gt;&lt;tr class=table_row1&gt;&lt;form action=""i.cfm?&amp;1028&amp;p=login&amp;se=4"" method=post name=stepform&gt;&lt;Td align=right nowrap&gt;&amp;nbsp;Empire Name&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;input type=text name=nic size=16 &gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=table_row2&gt;&lt;Td align=right&gt;Password&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;input type=password name=password size=16 &gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=table_row1&gt;&lt;Td align=right valign=top&gt;Server&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;select name=server&gt;&lt;option value=""0"" &gt;Normal&lt;/option&gt;&lt;option value=""1"" &gt;Fast&lt;/option&gt;&lt;option value=""2"" &gt;Slow&lt;/option&gt;&lt;option value=""3"" &gt;Ultra&lt;/option&gt;&lt;option value=""4"" selected&gt;RT&lt;/option&gt;&lt;/select&gt;&lt;font class=smallfont&gt; &lt;a href=javascript:ch('i.cfm?popup=help&amp;type=server');&gt;What is this &lt;img src=i/help.gif&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=table_row2&gt;&lt;Td align=right&gt;&amp;nbsp;IP&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;69.47.105.149 &lt;font class=smallfont&gt;(United States of America)&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr class=table_row1&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;input type=submit value=""  Login  "" &gt;&lt;/td&gt;&lt;/tr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/table&gt;</code></pre><p>As you can see there are 3 inputs needed, the ""Empire Name"", ""Password"", and the ""Server"" which consist of 5 options. How would I go about sending this data back to the server over httpClient, assuming that I have gathered the relevant information form my Android GUI. Any help is greatly appreciated.</p>","423519","","","","","2010-08-23 21:57:16","Sending html commands over httpclient android","<html><android><httpclient>","3","5","1","",""
"3550913","1","3551655","","2010-08-23 19:17:43","1","3952","<p>I have the following code that if not connected to the internet hits the catch but crashes the app with the error in the subject.  Is there a graceful way to detect the connection being up or just ignore this?</p><pre><code> try {        GeoPoint center = myMapView.getMapCenter();        double minLat = (double) (center.getLatitudeE6() - (myMapView                .getLatitudeSpan() / 2)) / 1E6;        double maxLat = (double) (center.getLatitudeE6() + (myMapView                .getLatitudeSpan() / 2)) / 1E6;        double minLng = (double) (center.getLongitudeE6() - (myMapView                .getLongitudeSpan() / 2)) / 1E6;        double maxLng = (double) (center.getLongitudeE6() + (myMapView                .getLongitudeSpan() / 2)) / 1E6;        /* Create a URL we want to load some xml-data from. */        URL url = new URL(                ""http://www.test.com/feed.asp?maxlat=""                        + Double.toString(maxLat) + ""&amp;maxlon=""                        + Double.toString(maxLng) + ""&amp;minlat=""                        + Double.toString(minLat) + ""&amp;minlon=""                        + Double.toString(minLng));        /* Get a SAXParser from the SAXPArserFactory. */        SAXParserFactory spf = SAXParserFactory.newInstance();        SAXParser sp = spf.newSAXParser();        /* Get the XMLReader of the SAXParser we created. */        XMLReader xr = sp.getXMLReader();        /* Create a new ContentHandler and apply it to the XML-Reader */        XMLHandler myXMLHandler = new XMLHandler();        xr.setContentHandler(myXMLHandler);        /* Parse the xml-data from our URL. */        xr.parse(new InputSource(url.openStream()));        /* Parsing has finished. */        /* Our ExampleHandler now provides the parsed data to us. */        /*         * ParsedExampleDataSet parsedExampleDataSet =         * myExampleHandler.getParsedData();         */        ArrayList&lt;Ship&gt; shipArray = myXMLHandler.getShipArray();        ArrayList&lt;pfOverlayItem&gt; overArray = myXMLHandler.getOverlayArray();        mainOverlayArray = overArray;        pfOverlayItem tempOver = null;        Drawable marker = null;        for (int i = 0; i &lt; mainOverlayArray.size(); i++) {            tempOver = mainOverlayArray.get(i);            // tempOver.setMarker(getIcon(tempOver.getshipTypeInt()));            tempOver.setMarker(getPlaneIcon(tempOver.getcourse()));        }        sites = new SitesOverlay();    } catch (Exception e) {        /* Display any Error to the GUI. */        Log.e(""Error"", ""Problem processing XML"", e);    }</code></pre>","103999","","","","","2012-01-14 07:00:11","Android unknownhostexception","<android><connection><internet>","3","0","","",""
"3550958","1","3551172","","2010-08-23 19:24:26","0","374","<p>I want to create a list with some text and a photo miniature in each row.So I created a row layout with a TextView and a ImageView, my question is how do I make the ImageView just a little square and then make an image adapt to the size of the ImageView?</p>","419921","","","","","2010-08-24 01:47:16","Creating photo miniature in a List View row","<android>","3","0","","",""
"3551122","1","3551202","","2010-08-23 19:47:35","1","798","<p>Can I find out from my Android app, what is the browser's user agent string?</p>","243225","","","","","2012-05-23 07:47:49","How to find out browser's user agent in Android","<android>","1","0","1","",""
"3551128","1","","","2010-08-23 19:48:38","0","245","<p>In java, a Shape is described by a PathIterator which describes the different lines, curves, moveTos, etc... which compose the shape.  Does android expose similar functionality?:</p><ol><li>A class which is a flexible collection of lines/curves/moveTos</li><li>A method in that class, or a wrapper for that class, which can be used to retrieve and iterate the description.</li></ol><p>Thanks </p>","426493","","","","","2010-08-23 20:07:35","Does android sdk provide any sort of iterable Path?","<java><android>","1","0","","",""
"3551169","1","3560677","","2010-08-23 19:54:04","27","33423","<p>I have a <code>PreferenceCategory</code>, xml file and I have defined all preferences in it, I call this from class that extends <code>PreferenceActivity</code>. I am unable to set the background of my settings screen, this screen is displayed with help of xml file shown below. Please see that I have already defined the <code>android:background=""#041A37""</code>, still the screen remains default color: black.</p><pre><code>public class MyPreferenceActivity extends PreferenceActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        Context mContext=super.getBaseContext();        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.layout.preference);        //v.setBackgroundColor(Color.rgb(4, 26, 55));    }}</code></pre><hr><p>preference.xml is </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""    android:background=""#041A37"" &gt;    &lt;PreferenceCategory&gt;        &lt;com.dropcall.SeekBarPreference            android:background=""#041A37""            android:defaultValue=""5""            android:key=""@string/Interference_Delay""            android:progressDrawable=""@drawable/seekbardrawable""            android:title=""Seconds Delay until intereference"" /&gt;        &lt;com.dropcall.SeekBarPreference2            android:defaultValue=""30""            android:key=""@string/Drop_Delay""            android:progressDrawable=""@drawable/seekbardrawable""            android:title=""Seconds delay until drop"" /&gt;        &lt;CheckBoxPreference            android:background=""@drawable/state_normal""            android:defaultValue=""true""            android:key=""@string/Drop_Option""            android:title=""Close after call drop"" /&gt;        &lt;CheckBoxPreference            android:background=""@drawable/state_normal""            android:defaultValue=""true""            android:key=""@string/Timer_Option""            android:title=""Start timers on launch"" /&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><hr><p>Although I have set <code>android:background=""#041A37""</code> in every file, the background doesn't turn into navy blue, or any other color for that matter. It remains default color, black. How to change the background color. Please let me know any pointers / hints , if you had faced same issue let me know what changes you made to set the background color.</p>","357349","","1627730","","2013-01-17 15:21:34","2013-04-11 17:02:11","change background color of Preference","<android><android-emulator>","6","1","12","",""
"3551193","1","3551217","","2010-08-23 19:57:47","4","2554","<p>i found that code to record, but I always get:</p><p>The method setOutputFile(FileDescriptor) in the type MediaRecorder is not applicable for the arguments (Uri)</p><p>So how would I need to describe the filepath that it works?thx</p><pre><code>// Prepare recorder source and typeMediaRecorder recorder = new MediaRecorder();recorder.setAudioSource(MediaRecorder.AudioSource.MIC);recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);// File to which audio should be recordedFile outputFile = getFileStreamPath(""output.amr"");Uri target = Uri.parse(outputFile.getAbsolutePath());recorder.setOutputFile(target);// Get ready!recorder.prepare();// Start recordingrecorder.start();// Stop and tidy uprecorder.stop();recorder.release();</code></pre>","355372","","","","","2010-08-23 20:01:43","Android Record Audio","<android>","1","0","1","",""
"3551624","1","","","2010-08-23 20:54:19","0","2524","<p>How could I get and use the number of satellites before starting location tracking? </p><p>For example I want to start location tracking only when there are min X satellites in use.</p>","243782","","","","","2011-01-06 12:09:08","How to start location tracking based on GPS number of satellites?","<android><location>","1","2","","",""
"3551645","1","3551919","","2010-08-23 20:57:09","0","704","<p>i am creating an application where i am calling my database from a different activity but i keep getting all sorts of errors from on the database side of things. At first i was getting an ""SQLiteException no such data"" and when i deleted my application and installed it back, its now ""android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed"".</p><p>i have no idea what to do anymore. Have gone through so many different examples on creating database but i don't know if i am missing something?.. Here is my code for the database side:</p><pre><code>import android.content.ContentValues;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class DBAdapter {    private static final String DATABASE_NAME = ""MemoData.db"";    private static final int DATABASE_VERSION = 1;    public static final String DATABASE_TABLE = ""Memo"";    public static final String KEY_ID = ""_id"";    public static final String NAME = ""Title"";    public static final String START_DATE = ""start_date"";    public static final String END_DATE = ""end_date"";    public static final String NOTES = ""notes"";    private static final String TAG = ""DBAdapter"";    private static final String DATABASE_CREATE = ""create table Memo (_id integer primary key autoincrement,""           + ""Title text not null, start_date text not null,""
        + ""end_date text not null, ""        + ""notes text not null);"";    private final Context context;       private DBHelper dbhelper;    private SQLiteDatabase db;    public DBAdapter(Context context) {        this.context = context;        dbhelper = new DBHelper(context);    }    private static class DBHelper extends SQLiteOpenHelper {        DBHelper(Context context){            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db) {            db.execSQL(DATABASE_CREATE);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            Log.w(TAG,""upgrading Database from version""+ oldVersion+ ""to""                    +newVersion+ ""which oold data will be lost"");            db.execSQL(""DROP TABLE IF EXITS Memo"");            onCreate(db);        }    }    public DBAdapter open()throws SQLException {        db = dbhelper.getWritableDatabase();        return this;    }    public void close(){        dbhelper.close();    }  public long createItem(String Title, String start_date,String end_date,String notes){             open();            ContentValues initialValues = new ContentValues();            initialValues.put(NAME, Title);            initialValues.put(START_DATE, start_date);            initialValues.put(END_DATE, end_date);            initialValues.put(NOTES, notes);            return db.insert(DATABASE_TABLE, null, initialValues);            }      public Cursor retrieveItems(){            SQLiteDatabase db = dbhelper.getWritableDatabase();            String[] resultColumns = new String[] {NAME,START_DATE,END_DATE,NOTES };          Cursor cursor = db.query(DATABASE_TABLE, resultColumns, null, null, null, null, null);            Integer cindex = cursor.getColumnIndex(""Title"");            String result = ""Result = "";            if(cursor.moveToFirst()){                do {                    result += cursor.getString(cindex)+ ""-"";                }while(cursor.moveToNext());            }            return cursor;        }}</code></pre><p>and here is the main error output:</p><p>08-23 22:38:17.104: ERROR/Database(775): Error inserting notes=Notes: end_date=Due Date: Title=Name of Item: start_date=Start Date:08-23 22:38:17.104:ERROR/Database(775): android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed</p><p>08-23 22:38:17.104: ERROR/Database(775):at android.database.sqlite.SQLiteStatement.native_execute(Native Method)</p><p>08-23 22:38:17.104: ERROR/Database(775):at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:66)</p><p>08-23 22:38:17.104: ERROR/Database(775):at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1313)</p><p>08-23 22:38:17.104: ERROR/Database(775):at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1173)</p><p>08-23 22:38:17.104: ERROR/Database(775):at com.Memo.DBAdapter.createItem(DBAdapter.java:94)</p><p>08-23 22:38:17.104: ERROR/Database(775):at com.Memo.NewItem.save(NewItem.java:365)</p>","316843","","316843","","2010-08-23 22:57:59","2010-08-23 22:57:59","Android Database Problems","<android>","1","1","","",""
"3551697","1","3551743","","2010-08-23 21:05:35","3","6718","<p>Question is as simple as the title: How to measure GPS signal strength?</p>","243782","","","","","2010-11-17 22:30:53","How to measure GPS signal strength on Android?","<android><location>","2","0","1","",""
"3551818","1","","","2010-08-23 21:24:01","1","1362","<p>I'm trying to do a relatively simple bitwise query operation with SQLite on Android.  When I use bind variables, I get no data returned when I believe should get some rows back.  If I hardcode the bind variable's value directly into the SQL, it works just fine.  I'm thinking I have some silly syntax issue somewhere, but I just can't see it.</p><p>So this code works just fine:</p><pre><code>String selection = new String(FLAGS + "" &amp; 2 = 2"");cursor = db.query(TABLE_NAME, ALL_COLUMNS, selection,    null, null, null, null, null );</code></pre><p>This code however (using bind variables), returns no rows:</p><pre><code>String selection = new String(FLAGS + "" &amp; ? = ?"");String[] selectionArgs = new String[]{""2"", ""2""};cursor = db.query(TABLE_NAME, ALL_COLUMNS, selection,    selectionArgs, null, null, null, null );</code></pre><p>They both result into a syntactically identical query being built when I inspect the cursor's mQuery property through the debugger.  The latter does have the mBindArgs property populated correctly as well.  I'm at a loss as to how this could be failing.  There are no exceptions thrown or anything, it just doesn't return any rows.</p><p>I can take the failing query, and manually swap the question marks for the two's and paste it into the ADB SQLite command line interface and it works just fine as well.</p>","382437","","","","","2011-07-04 10:18:54","Android SQLite and Bind Variables Problem","<android><sqlite>","2","0","","",""
"3551821","1","3551906","","2010-08-23 21:24:42","40","72506","<p>I am using the following code to download a file from my server then write it to the root directory of the sd card, it all works fine:</p><pre><code>package com.downloader;import java.io.File;import java.io.FileOutputStream;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import android.os.Environment;import android.util.Log;public class Downloader {    public void DownloadFile(String fileURL, String fileName) {        try {            File root = Environment.getExternalStorageDirectory();            URL u = new URL(fileURL);            HttpURLConnection c = (HttpURLConnection) u.openConnection();            c.setRequestMethod(""GET"");            c.setDoOutput(true);            c.connect();            FileOutputStream f = new FileOutputStream(new File(root, fileName));            InputStream in = c.getInputStream();            byte[] buffer = new byte[1024];            int len1 = 0;            while ((len1 = in.read(buffer)) &gt; 0) {                f.write(buffer, 0, len1);            }            f.close();        } catch (Exception e) {            Log.d(""Downloader"", e.getMessage());        }    }}</code></pre><p>However, using <code>Environment.getExternalStorageDirectory();</code> means that the file will always write to the root <code>/mnt/sdcard</code>.  Is it possible to specify a certain folder to write the file to?</p><p>For example: <code>/mnt/sdcard/myapp/downloads</code></p><p>Cheers</p><p>Eef</p>","30786","","","","","2014-01-30 08:05:31","Android write to sd card folder","<java><android><http><download><android-sdcard>","3","1","34","",""
"3551827","1","","","2010-08-23 21:25:03","0","308","<p>I got this class, and nothing inside the onCreate is happening? Does it not automatically get called upon initialization?</p><p>Code is below, Thanks alot!   - Micheal</p><pre><code>package com.michealbach.livedrops;import java.io.IOException;import java.util.List;import java.util.Locale;import android.app.Activity;public class AnyClass extends Activity {double latitude = 0; double longitude = 0;String addressString = ""Address Initialized"";String postalString = null;  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    postalString = ""Why doesn't this String change happen at all?"";  }public double getLongitude() {    return longitude;}public double getLatitude() {    return latitude;}public String getAddress() {    return addressString;}public String getPostal() {    return postalString;}}</code></pre><p>Doing this results in a ""application has stopped unexpectedly. Please try again"". If I initialize the string to some set of characters instead of null, it'll just stay that way. Should it not do what is inside the onCreate() and make that change? </p>","428858","","428858","","2010-08-24 17:03:08","2010-08-24 17:03:08","Android: Nothing past onCreate is happening","<android><location><geocoding><locationmanager><oncreate>","1","0","","",""
"3551937","1","3596484","","2010-08-23 21:42:07","0","1553","<p>I'm writing an image file uploader for android for my favorite image gallery software and it uses FTP.I've started using Apache-Commons Net FTP as my ftp library based on <a href=""http://stackoverflow.com/questions/1567601/android-ftp-library"">past stack overflow questions</a>. Like so:</p><pre><code>FTPClient ftp = new FTPClient();try{  ftp.connect(host);  Log.i(TAG,""we connected"");  if(!ftp.login(user,pass)){    ftp.logout();    //TODO: alert user it didn't happen    return;  }      String replyStatus = ftp.getStatus();  Log.i(TAG,replyStatus);  int replyCode = ftp.getReplyCode();  if (!FTPReply.isPositiveCompletion(replyCode))  {        ftp.disconnect();    //TODO: alert user it didn't happen    return;  }      Log.i(TAG,""we logged in"");  ftp.changeWorkingDirectory(path);  ftp.setFileType(ftp.BINARY_FILE_TYPE);  for(int i = 0; i &lt; contentUris.size(); i++){    Log.i(TAG,""uploading new file"");    Uri stream = (Uri) contentUris.get(i);    //InputStream in = openFileInput(getRealPathFromURI(stream));    InputStream in =this.getContentResolver().openInputStream(stream);    BufferedInputStream buffIn=null;    buffIn=new BufferedInputStream(in);    ftp.setFileType(ftp.BINARY_FILE_TYPE);    boolean Store = ftp.storeFile(""test.jpg"", buffIn);    Log.i(TAG, ""uploaded test"");  }        ftp.disconnect();}      catch(Exception ex){  //do something wise and smart and useful}</code></pre><p>I see in the log that I'm getting logged in, I'm able to change directories, and when I upload I get a test.jpg in my directory, but with 0 bytes size.</p><p>What gives?  Am I not opening the input stream right? How do I properly do it?</p><p>If I'm not giving enough detail, let me know - the <a href=""http://github.com/mattkatz/UpFuckr/blob/master/src/com/morelightmorelight/upfuckr/upfuckr.java"" rel=""nofollow"">full code is also available on github</a></p>","13774","","13774","","2010-08-25 01:06:11","2010-08-29 20:35:32","Why is my InputStream not working in Android?","<java><android><open-source><ftp><apache-commons>","1","0","","",""
"3551938","1","3551997","","2010-08-23 21:42:31","6","6887","<p>Suppose I am creating an Android application that's like an SMS app.  The requirements are as follows:</p><ol><li>The user can receive multiple notifications, each one having a dynamic ID of type int.</li><li>When a notification is selected, it loads an activity which displays a corresponding message (the SMS).</li><li>The single notification that was selected should be automatically dismissed.</li></ol><p>My idea for how to handle this was to use putExtra to add the integer ID to the intent, which would then be accessible from the intent within the activity it loads, which would then dismiss the notification that called it.</p><p>For my test case, here are the specs:</p><ol><li>Notifications will eventually begenerated from a service, for nowthey are being spawned when the testuser presses a button.</li><li>When a notification is selected, thecalled activity toasts the message,then attempts to dismiss thenotification. (For the sake ofvisibility)</li></ol><p>Here are my problems:</p><ol><li>When the first notification isselected, it is correct.  Thenotification is dismissed.</li><li>When each successive notification isselected, the first notification'sID is shown, and nothing isdismissed.</li><li>I am a Java novice, more accustomedto scripting languages (such asPerl, PHP, etc) :)</li></ol><p>Here is my source:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android = ""http://schemas.android.com/apk/res/android""    android:orientation = ""vertical""    android:layout_width = ""fill_parent""    android:layout_height = ""fill_parent""&gt;    &lt;Button        android:id=""@+id/create_notification""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:padding=""10dp""        android:text = ""Create new notification""    /&gt;</code></pre><h2>    </h2><pre><code>package org.test.notifydemo;import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.Toast;import java.util.Random;public class aRunNotificationDemo extends Activity{    private NotificationManager mNotificationManager;    @Override    public void onCreate( Bundle icicle )    {        super.onCreate( icicle );        setContentView( R.layout.run_notify_demo );        mNotificationManager = (NotificationManager) getSystemService( aRunNotificationDemo.NOTIFICATION_SERVICE );        int close_notify_id = getIntent().getIntExtra( ""notification_id"", 0 );        if ( close_notify_id != 0 )        {            Toast.makeText( aRunNotificationDemo.this, ""Dimissing this notification: "" + Integer.toString(close_notify_id), Toast.LENGTH_SHORT ).show();            mNotificationManager.cancel( close_notify_id );        }        findViewById( R.id.create_notification ).setOnClickListener( new MyButtonListener() );    }    private class MyButtonListener implements Button.OnClickListener    {        public void onClick( View my_view )        {            Random randGen = new Random();            int notify_id = randGen.nextInt();            int icon = R.drawable.icon_notification_01;            CharSequence tickerText = Integer.toString(notify_id) + "" New SMS!"";            long when = System.currentTimeMillis();            Notification my_notification = new Notification(icon, tickerText, when);            Context context = getApplicationContext();            CharSequence contentTitle = Integer.toString(notify_id) + "" New SMS Available!"";            CharSequence contentText = Integer.toString(notify_id) + "" There is a new SMS available."";            Intent notificationIntent = new Intent( aRunNotificationDemo.this, aRunNotificationDemo.class );            notificationIntent.putExtra( ""notification_id"", notify_id );            PendingIntent contentIntent = PendingIntent.getActivity( aRunNotificationDemo.this, 0, notificationIntent, 0 );            my_notification.setLatestEventInfo( context, contentTitle, contentText, contentIntent );            mNotificationManager.notify( notify_id, my_notification );        }    }}</code></pre>","397122","","","","","2010-08-23 21:51:40","Cancel dynamic notification in Android when the notification is selected","<android><notifications><android-intent>","1","0","4","",""
"3551959","1","3552129","","2010-08-23 21:45:55","4","1397","<p>Is there a simple line of code that would allow only loading the code if the OS version meets the requirements? </p><p>Lets say I have my target OS as 2.2 but the min sdk is 3 for android 1.5 so even if i have some code in my project that isn't compatable with 1.5 it will still compile since the target OS is 2.2. Anyway, I want to ad a feature that requires code that's not in the 1.5 SDK and will cause a crash if it's loaded on a 1.5 phone. Is there a simple thing like this that I can do? So i dont have to make the entire app not available to 1.5 users?</p><pre><code> if (Android OS == &gt;2.1){            //Insert code here that requires 2.1 and up}        else{            //insert code that would appear is OS is &lt;2.1}</code></pre>","393373","","54742","","2010-08-23 23:38:41","2012-01-10 03:42:53","Possible to only load specific lines of code according to Android OS version?","<java><android><android-1.5-cupcake>","4","1","7","",""
"3551989","1","","","2010-08-23 21:50:50","1","2605","<p>I don't if what I am trying to do is possible :</p><p>I am trying to build the tesseract project (libocr) with the ndk.Compilation is ok but linking is wrong...</p><p>with a lot of error like this :</p><pre><code>Android NDK: WARNING: Unsupported source file extensions in /home/jpprade/dev/tesseract3/jni/Android.mk for module ocr    Android NDK:   ccstruct/detlinefit ccmain/tessembedded textord/strokewidth    SharedLibrary  : libocr.so/home/jpprade/dev/tesseract3/obj/local/armeabi/objs/ocr/ccutil/basedir.o: In function `getpath(char const*, STRING&amp;)':/home/jpprade/dev/tesseract3/jni/ccutil/basedir.cpp:59: undefined reference to `STRING::operator=(char const*)'...</code></pre><p>It seems that I have this error becaus stl is not supported in the ndk. Is that right ?</p><p>I thought that I could solve this issue by using STLport.So I compiled it and I got a file libstlport.so.</p><p>But now I don't know what to do to finish building libocr and where I have to put the libstlport.so</p><p>I guess that in the end I ll have two file to load in java : libocr.so and libstlport.so but I don't if it is possible and how to achive that .</p><p>Thanks for any help !</p>","336657","","","","","2010-09-25 06:06:54","android library linking","<android><android-ndk><android-ndk-r4>","1","0","","",""
"3552059","1","3552082","","2010-08-23 22:01:36","0","2142","<p>Hallo,</p><p>Any idea where I can find a simple tabs example?</p><p>The Android Developers Hello Views Tab Layout example only details how to use separate Activities for each Tab.</p><p>I would like to use tabs to extend a screen of settings without scrolling, i.e. there are too many options for a single screen, so I'd like to split them over two tabs, but still handle them in the same Activity.</p><p>Each tab can refer to a separate layout file if that is how it needs to be done,</p><p>TIA,</p><p>-Frink</p>","131209","","","","","2012-08-08 15:17:29","how to use android tabs in the same Activity","<android>","2","0","","",""
"3552144","1","","","2010-08-23 22:17:07","0","701","<p>Does anybody know how to compare two song stored in two files and see, if they are same or not?</p>","428889","","","","","2010-08-23 22:21:02","Is there a way to compare two song(Audio/Vedio) file?","<android>","1","0","","",""
"3552218","1","3559142","","2010-08-23 22:33:20","1","2195","<p>I'm starting with Android development and I have no idea what's wrong on the this command line:</p><p><code>C:\Documents and Settings\Gabriel.Esquivel.android\avd>android create avd -n Evo4G -t 9 -c 8000MB -s 480-800 Valid skins: WVGA854, WQVGA400, HVGA (default), WQVGA432, WVGA800, QVGAError: '480-800' is not a valid skin name or size (NNNxMMM)</code></p><p>I am trying to create the following AVDs <a href=""http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations/"" rel=""nofollow"">http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations/</a>, but it won't work on from Android SDK Manager. There seems to be bug that throws the following error ""SD Card size must be at least 9MB"".  So I have decided to try from command prompt as I read on other blog that it will allow me to create AVDs without getting SDs less than 9MB errors.</p><p>Now the problem is that it won't take specific dimensions for the skin <code>-s width-height </code></p>","250435","","250435","","2010-08-24 14:08:34","2013-02-04 22:29:03","Android create avd size on windows command prompt","<android><winapi><windows-xp>","1","2","","",""
"3552357","1","","","2010-08-23 23:01:51","2","1552","<p>my app has widgets that have an ImageView and a TextView. On the onUpdate() method of the WidgetProvider, I put a Bitmap inside the ImageView this way:</p><pre><code>Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.widget_btn);Bitmap bitmap2 = BitmapManager.setColor(bitmap, red, green, blue);views.setImageViewBitmap(R.id.image, bitmap2);</code></pre><p>setColor() method is this:</p><pre><code>public synchronized static Bitmap setColor(Bitmap org, float r, float g, float b){    sColorMatrix.setScale(r, g, b, 1);    sColorPaint.setColorFilter(new ColorMatrixColorFilter(sColorMatrix));    // RGB_565 is faster, but loses transparency    Bitmap ret = Bitmap.createBitmap(org.getWidth(), org.getHeight(), Bitmap.Config.ARGB_8888);    try{        sColorCanvas.setBitmap(ret);        //sColorCanvas.drawColor(Color.);        sColorCanvas.drawBitmap(org, 0, 0, sColorPaint);    } catch (Throwable t){    }    return ret;}</code></pre><p>The problem is that sometimes the widget throws a RuntimeException because somebody has recycled the Bitmap, and I don't know what to do. Some suggestions?</p><p>I can attach the stacktrace if it can be useful. Thank you!</p><hr><p>This is the stacktrace:</p><pre><code>java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@462605a8   at android.graphics.Canvas.throwIfRecycled(Canvas.java:955)   at android.graphics.Canvas.drawBitmap(Canvas.java:1044)   at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:323)   at android.widget.ImageView.onDraw(ImageView.java:923)   at android.view.View.draw(View.java:6739)   at android.view.ViewGroup.drawChild(ViewGroup.java:1648)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.ViewGroup.drawChild(ViewGroup.java:1646)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.ViewGroup.drawChild(ViewGroup.java:1646)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.widget.AbsListView.dispatchDraw(AbsListView.java:1365)   at android.widget.ListView.dispatchDraw(ListView.java:3046)   at android.view.View.draw(View.java:6845)   at android.widget.AbsListView.draw(AbsListView.java:2257)   at android.view.ViewGroup.drawChild(ViewGroup.java:1648)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.ViewGroup.drawChild(ViewGroup.java:1646)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.View.draw(View.java:6742)   at android.widget.FrameLayout.draw(FrameLayout.java:352)   at android.view.ViewGroup.drawChild(ViewGroup.java:1648)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.ViewGroup.drawChild(ViewGroup.java:1646)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.ViewGroup.drawChild(ViewGroup.java:1646)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.ViewGroup.drawChild(ViewGroup.java:1646)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.ViewGroup.drawChild(ViewGroup.java:1646)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.View.draw(View.java:6742)   at android.widget.FrameLayout.draw(FrameLayout.java:352)   at android.view.ViewGroup.drawChild(ViewGroup.java:1648)   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)   at android.view.View.draw(View.java:6742)   at android.widget.FrameLayout.draw(FrameLayout.java:352)   at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1872)   at android.view.ViewRoot.draw(ViewRoot.java:1422)   at android.view.ViewRoot.performTraversals(ViewRoot.java:1167)   at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)   at android.os.Handler.dispatchMessage(Handler.java:99)   at android.os.Looper.loop(Looper.java:144)   at android.app.ActivityThread.main(ActivityThread.java:4937)   at java.lang.reflect.Method.invokeNative(Native Method)   at java.lang.reflect.Method.invoke(Method.java:521)   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)   at dalvik.system.NativeStart.main(Native Method)</code></pre>","305582","","50776","","2012-04-05 12:36:46","2012-04-05 12:36:46","RuntimeException on widget that has a Bitmap (Android)","<android><bitmap><widget><recycle><runtimeexception>","2","0","","",""
"3552436","1","","","2010-08-23 23:20:11","1","623","<p>I use tabs in my Android application and one of my tabs contains a listview.  I'm noticing some weird behavior when I override isEnabled in my list's adapter and then try to use the D-pad to move up and down through the list and to my tabs.  </p><p>If the 0th item of the list is enabled, then everything works as expected - I can move down through the list, and then up again and once I reach the top of the list, pressing up moves focus to my tab.</p><p>However, if the 0th item is DISABLED (isEnabled in my adapter returns false), then when I press up while position 1 is focused, the focus gets stuck.  It doesn't move up to the tab as I would have expected and instead stays on position 1 of the list.</p><p>Any ideas?</p>","409127","","","","","2010-08-24 01:21:04","Need help with focus in Android list when the first list item should be disabled","<android><listview><focus>","1","0","","",""
"3552549","1","3552886","","2010-08-23 23:48:47","1","414","<p>I've been wondering if it is possible to use an <code>IntentService</code> to do some networking while keeping the queue of pending intents prioritized. My goal to be able to download some images in the background, add more if needed (send another <code>Intent</code>) and be able to reset the queue if necessary (preferably using a specific Intent). That is all possible with an <code>IntentServie</code> but when I send that 'stop' <code>Intent</code> it needs to be processed as the next item in the queue, not the last where it is right now.</p><p>EDIT</p><p>For those interested I have taken the AOSP code for <code>IntentService</code> and modified it to meet my needs. The reason I cannot just subclass IntentHandler is because of the private <code>ServiceHandler</code> class inside of <code>IntentHandler</code>.</p><p>Inside of the <code>ServiceHandler</code> I have a new method:</p><pre><code> public final boolean sendPriorityMessage(Message msg)        {            int priority = msg.arg2;            //Log.i(GenericList.TAG,""recieved message priority: ""+priority);            if(priority&gt;PRIORITY_NORMAL){                return sendMessageAtFrontOfQueue(msg);            }else{                return sendMessage(msg);                }        }</code></pre><p>This method is called from <code>onStart</code> instead of just <code>sendMessage</code></p><pre><code> @Override    public void onStart(Intent intent, int startId) {        Message msg = mServiceHandler.obtainMessage();        msg.arg1 = startId;        msg.obj = intent;        try{            msg.arg2 = intent.getExtras().getInt(KEY_PRIORITY);        }catch(Exception e){            msg.arg2 = PRIORITY_NORMAL;        }        mServiceHandler.sendPriorityMessage(msg);    }</code></pre><p>Overall the code is still limited but I am able to fast track some messages to the front of the queue, which is what I was after anyway.</p>","413575","","413575","","2010-08-24 20:19:52","2010-08-24 20:19:52","Using an IntentService to do Prioritized Networking","<java><android><service><android-intent><priority-queue>","1","0","2","",""
"3552577","1","","","2010-08-23 23:58:05","0","328","<p>I am going through the Android tutorials and at some point an app won't load. The last message on the console is ""Installing RelativeLayout.apk..."" and it just stays there forever, instead of going on to the ""Success"" message.  Visually, what is happening on the emulator is that it starts with the ""A N D R O I D"" phase, goes on to the chrome ""android"" phase, goes on to the home page, and then the little animating battery icon stops moving.  After that we go back to the chrome ""android"" and just stay there forever.  Quitting the emulator and rerunning the app doesn't help.</p><p>Looking at the log, using the adb tool with logcat, at one point the log lists service after service that died.  This occurs right after this log message:</p><pre><code>D/Zygote  (   32): Process 59 terminated by signal (11)</code></pre><p>When I run adb logcat and have the emulator window visible at the same time, I can see that the battery icon stops animating just about when this message appears.  No idea what this means.</p><p>I can fix the problem by going to Window --> Android SDK and AVD Manager which has a list of the AVD's if you click on ""Virtual Devices"" on the left.  What I discovered to work is to quit the emulator, then in this window to select the AVD I'm trying to use, click ""Start..."" on the right, then in the Launch Options box that comes up, check <strong>Wipe user data</strong>, then hit Launch.  The emulator will run until the home page shows up, then I can run my tutorial just fine.</p><p>What's causing the problem?  What am I doing wrong?  I blogged about this in my <a href=""http://intoapps.blogspot.com"" rel=""nofollow"">Into Apps</a> blog and I'd like to be able to post the solution to the mystery as well.</p>","414680","","","","","2010-08-24 01:07:56","Android Virtual Device gets hosed somehow","<android><android-emulator>","1","0","","",""
"3552581","1","3580499","","2010-08-23 23:58:58","2","1961","<p>I received this error while trying to open a dialog from my Android activity. A Google search did not provide any helpful interpretations. Hoping someone has some idea what this exception even means?</p><pre><code>08-21 00:42:48.515: ERROR/AndroidRuntime(880): Uncaught handler: thread main exiting due to uncaught exception08-21 00:42:48.595: ERROR/AndroidRuntime(880): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.view.ViewRoot.setView(ViewRoot.java:429)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:178)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.app.Dialog.show(Dialog.java:231)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.app.Activity.showDialog(Activity.java:2407)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at net.sosiouxme.WhenDidI.custom.AlarmEditActivity.openNewAlarmDialog(AlarmEditActivity.java:179)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at net.sosiouxme.WhenDidI.custom.AlarmEditActivity.onOptionsItemSelected(AlarmEditActivity.java:188)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at net.sosiouxme.WhenDidI.activity.TrackerEdit.onOptionsItemSelected(TrackerEdit.java:146)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.app.Activity.onMenuItemSelected(Activity.java:2085)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:820)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:813)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:519)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.view.View.onTouchEvent(View.java:3828)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.widget.TextView.onTouchEvent(TextView.java:6291)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.view.View.dispatchTouchEvent(View.java:3368)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1525)08-21 00:42:48.595: ERROR/AndroidRuntime(880):     at android.os.Handler.dispatchMessage(Handler.java:99)`</code></pre><p>It might be helpful in the above to know that TrackerEdit inherits from AlarmEditActivity. TrackerEdit has an OptionsMenu, and when I choose an option from that menu it attempts to bring up a dialog via openDialog. The stack trace seems to indicate that it crashes before ever getting a chance to create the dialog. Any help would be appreciated.</p><p><strong>EDIT</strong> - yes, alright, some code might be pretty helpful, though I thought it might be pretty clear that my classes were the part that started with net.sosiouxme and received onOptionsItemSelected and called Activity.showDialog(). But OK, here are those bits from AlarmEditActivity:</p><pre><code>/* ***************************** event handling *************************** */@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case R.id.new_alarm:        openNewAlarmDialog();        break;    }    return super.onOptionsItemSelected(item);}/* * Open dialog for user to create a new alarm */public void openNewAlarmDialog() {    Alarm alarm = new Alarm(mTracker.getId());    alarm.setIvalWeeks(1);    mAlarmToEdit = alarm;    mViewOfAlarmToEdit = null;    showDialog(ALARM_DIALOG); // which is 0}</code></pre><p>The code isn't doing anything terribly interesting. When the menu item is chosen, it tries to show a dialog. The code never got to the point where a dialog was to be created, so I haven't even had the chance to mess that up. About the only thing that's remotely interesting about the activity is that the real activity is TrackerEdit which extends AlarmEditActivity, so the code being executed is in the parent of the activity.</p>","262768","","262768","","2010-08-24 23:40:19","2010-08-27 00:15:50","Error trying to open a dialog: android.view.WindowManager$BadTokenException","<android><dialog>","1","3","","",""
"3552616","1","3554010","","2010-08-24 00:06:40","2","1723","<p>I am about to start writing a web app for the latest smartphones using HTML5, CSS3 and JavaScript. I don’t need a framework so much as a library like jQuery.</p><p>I looked at jQTouch which is great for iPhone and apparently has support coming for Android too but I am looking to cover Blackberry device Software v4.6 upwards and WebOS 5 as well.</p><p>Does anyone have any ideas of alternatives to jQTouch or experience using jQTouch with Android's native browser, Blackberry's browser or WebOS native browser?</p>","268987","","","","","2010-08-24 07:29:05","Is there an equivilent of jQTouch that covers iPhone, Android, WebOS and Blackberry OS?","<javascript><iphone><android><blackberry><webos>","4","0","","",""
"3552644","1","3553707","","2010-08-24 00:11:21","2","170","<p>I'd like the activity stack for my app to contain multiple instances of the same activity, each working on different data.  So I'd have activity A working with data a, b, c and d in my activity stack ad I'd have 4 instances of activity A that I'd call A(a), A(b), A(c) &amp; A(d).  I'd also like to arrange it so that if the user asks to work with data c again then it won't start a new activity, but rather will just bring the already running activity A(c) to the front.</p><p>Any suggestions on the best way to achieve this?</p>","405814","","","","","2010-08-24 05:04:27","Controlling Activities","<android>","3","2","","",""
"3552660","1","3552726","","2010-08-24 00:14:48","0","289","<p>I am trying to create a very simple help page in my app. The layout xml for the page contains only a textview that displays the help info. In the Eclipse layout view, the layout looks perfect... however, when i try to load it in the emulator (via an OptionsMenu) it comes up as a blank black screen. What am I doing wrong??</p><p>Here is the Code:</p><pre><code>//This is my Help page codepackage com.soapbox.servicerec;import android.app.Activity;import android.content.Intent;import android.view.Menu;import android.view.MenuItem;public class HelpPage extends Activity { private static final int INSERT_ID = Menu.FIRST; private static final int ACTIVITY_CREATE=0;  protected void onCreate(){   setContentView(R.layout.help_page);         setTitle(R.string.help_title);           }  public boolean onCreateOptionsMenu(Menu menu) {         super.onCreateOptionsMenu(menu);         menu.add(0, INSERT_ID, 0, R.string.menu_insert);         return true;}  public boolean onMenuItemSelected(int featureId, MenuItem item) {         switch(item.getItemId()) {             case INSERT_ID:                 createNote();                 return true;         }         return super.onMenuItemSelected(featureId, item);  }  private void createNote() {         Intent i = new Intent(this, NoteEdit.class);         startActivityForResult(i, ACTIVITY_CREATE);     }}</code></pre><p>AND the layout XML...</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:orientation=""vertical""     android:background=""@android:color/white""&gt;   &lt;TextView android:textSize=""16px"" android:textColor=""@android:color/black"" android:layout_height=""fill_parent""    android:layout_width=""fill_parent"" android:gravity=""center_horizontal"" android:paddingLeft=""10px""    android:paddingRight=""10px"" android:text=""@string/help_text""/&gt;&lt;/LinearLayout&gt;</code></pre>","415560","","","","","2010-08-24 00:28:33","Android: My Help Page comes up BLANK!","<android><xml>","2","1","","",""
"3552743","1","3552841","","2010-08-24 00:34:21","0","255","<p>I am trying to create an App that has a similar layout as the view you get when you edit a contact. The main functionality I need is the ability to click a ""+"" or ""-"" button in the row and add/remove another row where the user can input another line of data.</p><p>What is the best way to go about doing this?</p><p>I have looked into the expandable lists but I am not sure if this is what I should be using or if it is just a list with a custom adapter.</p>","428979","","","","","2010-08-24 01:00:14","Android: Edit a view similar to the edit contacts view","<android>","1","0","","",""
"3552888","1","3630091","","2010-08-24 01:11:51","0","1220","<p>I saw in Android 2.1 highlight it said new platform support: ""Bluetooth 2.1, New BT profiles: Object Push Profile (OPP) and Phone Book Access Profile (PBAP)"". Now I have bluetooth adpater with OPP support. I can search and pair with it. But how can I get the txt file it send to me. There is no API for this function. I'm using the BluetoothChat sample code like structure as below. But the code is block in ""bytes = mmInStream.read(buffer);"".And nothing happens. Why? Nothing received?</p><pre><code>private class ConnectedThread extends Thread {    private final BluetoothSocket mmSocket;    private final InputStream mmInStream;    private final OutputStream mmOutStream;    public ConnectedThread(BluetoothSocket socket) {        Log.d(TAG, ""create ConnectedThread"");        mmSocket = socket;        InputStream tmpIn = null;        OutputStream tmpOut = null;        // Get the BluetoothSocket input and output streams        try {            tmpIn = socket.getInputStream();            tmpOut = socket.getOutputStream();        } catch (IOException e) {            Log.e(TAG, ""temp sockets not created"", e);        }        mmInStream = tmpIn;        mmOutStream = tmpOut;    }    public void run() {        Log.i(TAG, ""BEGIN mConnectedThread"");        byte[] buffer = new byte[1024];        int bytes;        // Keep listening to the InputStream while connected        while (true) {            try {                // Read from the InputStream                bytes = mmInStream.read(buffer);                // Send the obtained bytes to the UI Activity                mHandler.obtainMessage(BluetoothChat.MESSAGE_READ, bytes, -1, buffer)                        .sendToTarget();            } catch (IOException e) {                Log.e(TAG, ""disconnected"", e);                connectionLost();                break;            }        }    }    /**     * Write to the connected OutStream.     * @param buffer  The bytes to write     */    public void write(byte[] buffer) {        try {            mmOutStream.write(buffer);            // Share the sent message back to the UI Activity            mHandler.obtainMessage(BluetoothChat.MESSAGE_WRITE, -1, -1, buffer)                    .sendToTarget();        } catch (IOException e) {            Log.e(TAG, ""Exception during write"", e);        }    }    public void cancel() {        try {            mmSocket.close();        } catch (IOException e) {            Log.e(TAG, ""close() of connect socket failed"", e);        }    }}</code></pre>","411771","","","","","2010-09-02 18:36:23","How to connect a bluetooth adapter with Object Push Protocol?","<android><bluetooth>","1","0","","",""
"3552927","1","3553725","","2010-08-24 01:22:17","1","988","<p>I have an application that listens for screen off, and user present intents.  Since you cant register to receive screen off intents from the manifest, I am registering them in a service.</p><p>Do I really need to have a whole service to ensure that I always get notified of when the screen shuts off, and the user unlocks the phone?  Seems really wasteful :-(</p><p>The code I use in my service:</p><pre><code>@Overridepublic void onCreate() {    super.onCreate();    Log.d(TAG, ""Service created."");    // register receiver that handles user unlock and screen off logic    IntentFilter filter = new IntentFilter(Intent.ACTION_USER_PRESENT);    filter.addAction(Intent.ACTION_SCREEN_OFF);    BroadcastReceiver mReceiver = new ScreenReceiver();    registerReceiver(mReceiver, filter); }</code></pre>","289182","","","","","2011-06-01 08:58:16","Is it a good idea to have a service just to register for intents?","<android>","4","0","2","",""
"3552930","1","3571441","","2010-08-24 01:22:47","0","1997","<p>As part of learning android, I am following the <a href=""http://developer.android.com/guide/tutorials/notepad/index.html"" rel=""nofollow"">NotePad tutorial</a></p><p>One thing I noticed in the tutorials, the DB connection isn't being closed explicitly and it makes sense since startManagingCursor() handles it itself.</p><p>But if start/stop the app in a speedy manner (I manually started app by clicking it's icon and closed it by pressing back) I noticed DB wasn't getting closed &amp; the following error was getting generated:</p><pre><code>08-23 18:11:55.637: WARN/SQLiteCompiledSql(10784): Releasing statement in a finalizer. Please ensure that you explicitly call close() on your cursor: SELECT _id, title, body FROM notes08-23 18:11:55.637: WARN/SQLiteCompiledSql(10784): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here</code></pre><p>Closing the DB connection explicitly in onDestroy resolved the issue, but I guess this shouldn't have happened. Is it ok ?</p>","109603","","","","","2010-08-26 01:24:07","startManagingCursor() is slow?","<android><activity><cursor>","1","0","","",""
"3553017","1","3553102","","2010-08-24 01:49:53","38","22092","<p>I've seen the ""share via"" dialogs that are in apps like TFLN (texts from last night).Looks like this: <img src=""http://garr.me/wp-content/uploads/2009/12/sharevia.jpg"" alt=""share dialog""></p><p>I am looking to share text. Can someone point me in the right direction? Is this done with intents?</p>","412554","","703019","","2012-04-04 08:05:38","2012-11-24 04:50:45","Android Share Via Dialog","<android>","3","0","28","",""
"3553083","1","3554507","","2010-08-24 02:05:31","3","1354","<p>I need help with server and I'm new with it. Got a help from my friend but still can't work. I can't login. There is no error so called 'detected' when running the application. I can't login. Somehow the connection wasn't properly established. </p><p>This is my java file open in eclipse;</p><pre><code>package log1.log2;import java.io.ObjectOutputStream;import java.net.HttpURLConnection;import java.net.URL;import java.util.Vector;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.widget.Toast;import java.io.ObjectInputStream;public class Login extends Activity { DBAdapter db = new DBAdapter(this);/** Called when the activity is first created. */ private EditText etUsername; private EditText etPassword; private Button btnLogin; private Button btnRegister; private TextView lblResult; private String username; private String password; private String user; private String value; Vector SendVEctor = new Vector(); Vector receiveVEctor = new Vector();     @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Get the EditText and Button References        etUsername = (EditText)findViewById(R.id.usernametxt);        etPassword = (EditText)findViewById(R.id.passwordtxt);        btnLogin = (Button)findViewById(R.id.btnLogin);        btnRegister = (Button)findViewById(R.id.btnRegister);        lblResult = (TextView)findViewById(R.id.msglbl);        //Cursor c = (Cursor) db.getAllTitles();        //Button btnArrival = (Button) findViewById(R.id.btnRegister);     //btnArrival.setOnClickListener(this);    // Set Click Listener        btnRegister.setOnClickListener(new OnClickListener() {         @Override         public void onClick(View v) {          Intent intent=new Intent(Login.this,Register.class);            startActivity(intent);         }        });    btnLogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v)  {  String a = ""http://172.27.32.251:9090/jsp-examples/ferryhub"";   URL url = null;      HttpURLConnection httpurlconnection = null;      try {       url = new URL(a);       httpurlconnection = (HttpURLConnection) url         .openConnection();       httpurlconnection.setDoOutput(true);       httpurlconnection.setRequestMethod(""POST"");      Toast.makeText(Login.this, a, Toast.LENGTH_SHORT).show();       Toast.makeText(Login.this, ""Toast1"", Toast.LENGTH_SHORT).show();       ObjectOutputStream dos = new ObjectOutputStream(httpurlconnection.getOutputStream());       SendVEctor.add(etUsername.getText().toString());//foodname       SendVEctor.add(etPassword.getText().toString());//foodname       dos.writeObject(SendVEctor);                 dos.close();                 ObjectInputStream ois = new ObjectInputStream(httpurlconnection.getInputStream());                 receiveVEctor = (Vector)ois.readObject();       Toast.makeText(Login.this, receiveVEctor.get(0).toString(), Toast.LENGTH_SHORT).show();       if(receiveVEctor.equals(""Login Success""))       { etUsername.setText("""");        etPassword.setText("""");         Toast.makeText(Login.this, receiveVEctor.get(0).toString(), Toast.LENGTH_SHORT).show();        Intent myIntent = new Intent(((View) v).getContext(),Register.class);     startActivityForResult(myIntent, 1);       }//end inner if       else if(receiveVEctor.equals(""Login Fail""))       { etUsername.setText("""");        etPassword.setText("""");         Toast.makeText(Login.this, receiveVEctor.get(0).toString(), Toast.LENGTH_SHORT).show();       }//end inner if       else       {        Toast.makeText(Login.this, ""error"", Toast.LENGTH_SHORT).show();        }      }//end try      catch (Exception e) {       e.printStackTrace();       Toast.makeText(Login.this, ""error2"", Toast.LENGTH_SHORT).show();      }//end catch       finally {       if (httpurlconnection != null)        httpurlconnection.disconnect();      }//end finally  }//end else   }); }}</code></pre><p>Everytime when I run my application, the toast will appear with the message <code>error2</code> after showing <code>http://172.27.32.251:9090/jsp-examples/ferryhub</code> and <code>toast1</code>.</p><p>If I'm not wrong the problem is that there is no successful connection to the servlet. I hope to hear from good tips soon. Thank you for reading my question.</p><p>-Dayne</p><hr><p>Hello again</p><p>I've run the program again without editing and check the logcat. I can't find any errors..</p><p>here's how it looks like:</p><pre><code>08-24 07:52:37.875: INFO/NotificationService(54): enqueueToast pkg=log1.log2 callback=android.app.ITransientNotification$Stub$Proxy@43904308 duration=008-24 07:52:37.895: INFO/NotificationService(54): enqueueToast pkg=log1.log2 callback=android.app.ITransientNotification$Stub$Proxy@43925200 duration=008-24 07:52:37.945: WARN/System.err(216): java.net.SocketException: Permission denied (maybe missing INTERNET permission)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.platform.OSNetworkSystem.createSocketImpl(Native Method)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.platform.OSNetworkSystem.createSocket(OSNetworkSystem.java:85)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.net.PlainSocketImpl2.create(PlainSocketImpl2.java:59)08-24 07:52:37.975: WARN/System.err(216):     at java.net.Socket.checkClosedAndCreate(Socket.java:829)08-24 07:52:37.975: WARN/System.err(216):     at java.net.Socket.connect(Socket.java:984)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:67)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:151)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:73)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:826)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:812)08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1153)08-24 07:52:37.984: WARN/System.err(216):     at log1.log2.Login$2.onClick(Login.java:95)08-24 07:52:37.984: WARN/System.err(216):     at android.view.View.performClick(View.java:2344)08-24 07:52:37.984: WARN/System.err(216):     at android.view.View.onKeyUp(View.java:3939)08-24 07:52:37.984: WARN/System.err(216):     at android.widget.TextView.onKeyUp(TextView.java:4413)08-24 07:52:37.984: WARN/System.err(216):     at android.view.KeyEvent.dispatch(KeyEvent.java:895)08-24 07:52:37.984: WARN/System.err(216):     at android.view.View.dispatchKeyEvent(View.java:3647)08-24 07:52:37.984: WARN/System.err(216):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)08-24 07:52:37.984: WARN/System.err(216):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)08-24 07:52:37.984: WARN/System.err(216):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)08-24 07:52:37.984: WARN/System.err(216):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)08-24 07:52:37.984: WARN/System.err(216):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1708)08-24 07:52:37.984: WARN/System.err(216):     at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1197)08-24 07:52:37.994: WARN/System.err(216):     at android.app.Activity.dispatchKeyEvent(Activity.java:1967)08-24 07:52:37.994: WARN/System.err(216):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1684)08-24 07:52:37.994: WARN/System.err(216):     at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2329)08-24 07:52:37.994: WARN/System.err(216):     at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2299)08-24 07:52:37.994: WARN/System.err(216):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1621)08-24 07:52:37.994: WARN/System.err(216):     at android.os.Handler.dispatchMessage(Handler.java:99)08-24 07:52:37.994: WARN/System.err(216):     at android.os.Looper.loop(Looper.java:123)08-24 07:52:37.994: WARN/System.err(216):     at android.app.ActivityThread.main(ActivityThread.java:4203)08-24 07:52:37.994: WARN/System.err(216):     at java.lang.reflect.Method.invokeNative(Native Method)08-24 07:52:37.994: WARN/System.err(216):     at java.lang.reflect.Method.invoke(Method.java:521)08-24 07:52:37.994: WARN/System.err(216):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)08-24 07:52:37.994: WARN/System.err(216):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)08-24 07:52:37.994: WARN/System.err(216):     at dalvik.system.NativeStart.main(Native Method)08-24 07:52:38.004: INFO/NotificationService(54): enqueueToast pkg=log1.log2 callback=android.app.ITransientNotification$Stub$Proxy@438ad2c8 duration=008-24 07:52:38.206: INFO/ARMAssembler(54): generated scanline__00000077:03515104_00001A01_00000000 [ 46 ipp] (68 ins) at [0x2ac120:0x2ac230] in 1976229 ns</code></pre><p>I hope you can point out the actual error and tell me what I should do.</p><p>Thank you for reading my post.</p><p>-Dayne</p><hr><p>Hi again</p><p>As for the internet permission statement, I did at that line in my manifest xml file. I insert it under login activity as shown below:</p><pre><code>&lt;activity android:name=""Login""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.EDIT"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;         &lt;activity android:name=""AdminMain""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.EDIT"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;</code></pre><p>Is there any other possible things that I might missed? I hope you have a thing or two to tell me. Thank you.</p><p>-Dayne</p>","380770","","380770","","2010-08-24 08:03:45","2010-08-24 08:03:45","Android server; login page","<android><database><servlets>","1","4","","",""
"3553163","1","3553803","","2010-08-24 02:26:38","7","17073","<p>I have two buttons that increment and decrement a value by one with each press and they're working just fine with the onClickListener. I see that an onLongClickListener exists, which I assume is for touch and hold events. How would I have the number rapidly increment/decrement if the button is held?</p><p>Am I correct in assuming that onLongClickListener only fires once per long click? Is there a more appropriate listener or a property somewhere that I'm not aware of?</p>","429040","","","","","2012-03-28 17:23:56","Android long-touch event","<java><android><listener>","2","3","10","",""
"3553244","1","3648054","","2010-08-24 02:53:01","73","34992","<p>Well, here's my request. I don't know OpenGL already, and I'm not willing to learn it, I want to learn OpenGL ES directly since I'm targeting my development to android, however. I want to learn openGL ES in order to develop my <em>2D</em> games, I choosed that for performances purpose (since basic SurfaceView drawing isn't that efficient when it comes to RT games).My question is: Where to start ?I've spent over a month browsing google and reading/trying some tutorials/examples I've found anywhere <em>but</em> to be honnest, it didn't help much and this is for two reasons:1- Almost <em>all</em> the articles/tutorials I've came across are 3D related (I only want to learn how to do my 2D Sprites drawing)2- There's no base to start from since all the articles targets a specific things like: ""How to draw a triangle (with vertices)"", ""How to create a Mesh""... etc</p><p>I've tried to read some source code too (ex.: replica island) but the codes are too complicated and contains a lot of things that aren't necessary; result: I get lost among 100 .java files with weird class names and stuff (:P)</p><p>I guess there's no course like the one I'm looking for, but i'll be very glad if somebody could give me some guidelines and some <em>links</em> maybe to learn what I'm up to (Only OpenGL ES 2D Sprites rendering ! Nothing 3D)</p><p>Thank you very much for reading my posting, and I'm looking forward to hearing from you</p><p>Best regards</p>","429059","","","","","2013-11-14 17:56:31","Android OpenGL ES and 2D","<android><opengl-es><2d>","3","4","61","",""
"3553547","1","3553692","","2010-08-24 04:19:44","0","199","<p>I was able to setup geolocation accessibility in my webview for any android phone running 2.0 and up easily. However I really need to get this feature working on 1.5 and 1.6 phones as well. From what i've read it seems like this feature used to be accomplished with ""Gears"" and apparently there is a way to use <code>addJavascriptInterface</code> to implement this. I can't seem to find any examples anywhere. I'm actually suprised there isn't more information on this or at least easy to find information. </p>","393373","","","","","2011-01-27 15:12:50","Using Gears for Geolocation in Webview? (for 1.5 phones)","<java><android><geolocation><google-gears>","1","1","","",""
"3553564","1","","","2010-08-24 04:26:06","0","212","<p>I'm adding admob ads to my app that has a CountDownTimer that changes a time countdown display in its onTick() callback function. The time display uses a TextView and is changed via .setText().Everything works fine until I add the admob code. Seems that the ads break the TextView redraws when running. When I stop the CountDownTimer and update the TextView, the redraw happens.I'm not certain why this is happening, and since CountDownTimer is implemented using os.Handler, I can't think of a better way to do this. Calling TextView.invalidate doesn't work either.</p><p>Any ideas?</p>","429097","","","","","2010-12-29 03:09:06","Admob prevents TextView UI updates with a CountDownTimer in Android?","<android><admob>","1","2","","",""
"3553589","1","3682200","","2010-08-24 04:35:46","6","4170","<p>I'm pretty new to Android app development, and I've been playing around with swipe gestures using Android's SimpleOnGestureListener and a ViewFlipper.  There are 3 children of the ViewFlipper, and each is a ScrollView.  They're all dynamically populated when the Activity loads, and they don't change after that.  The ScrollView is where the SimpleOnGestureListeners are attached.  </p><p>Here's the layout I'm using:<br>+ViewFlipper<br>++ScrollView (x3, one for each page, each with the following:)<br>+++LinearLayout (vertical)<br>++++TextView<br>++++TableLayout (dynamically populated w/TableRows)<br>++++View  </p><p>I extended the onFling method with the common tutorial code you can find anywhere online, and it works great--except when one of the ScrollViews doesn't contain enough content to scroll.  </p><p>I've narrowed the problem down to touch detection by overriding and calling super on every one of the SimpleOnGestureListener's methods to add a print-to-log.  </p><p>When I swipe on a page that scrolls, I get something full of ""in onClick"" ""in onScroll"" ""in onFling"" etc.  On a page that's too short to scroll, I get ""in onClick"" ""in onShowPress"" ""in onLongPress"", and that's only if I'm touching the content <em>within</em> the too-short scrollview's children--if I touch elsewhere I get no events at all.  </p><p>Ideas on what's wrong, or how to detect the swipe gesture no matter how big the ScrollView is?</p><p>EDIT:  I've determined that when I run this on an Android 2.2 emulator, as opposed to the Android 2.1u1 DroidX emulator I've been using, it goes away.  This is reproducible across multiple environments.</p><hr><p>I have some more insight on this;  it seems as though onInterceptTouchEvent is not called for every motion event when a scrollview is contained within a flipper (or a WorkspaceView).</p><p>In particular, the behavior I found while modifying another view class to fix this very same issue (it is not unique to flippers) was as follows--note that this is Android 2.1 only:</p><p>If the scrollview is long enough to scroll, the ACTION_DOWN motion event is caught by the ScrollView, and every subsequent ACTION_MOVE event goes through onInterceptTouchEvent of the flipper, where it is intercepted and handled appropriately.  In android 2.2, this behavior happens regardless of the scroll length.</p><p>Back to 2.1:  If the scrollview is not long enough to scroll, the ACTION_DOWN motion event is <em>not</em> caught by the scrollview, but instead comes back to the onTouchEvent of the flipper.  All subsequent ACTION_MOVE events of the same gesture <em>skip</em> the onInterceptTouchEvent function and go straight to the onTouchEvent function!</p><p>The way I resolved this was to take the functionality I had in onTouchEvent for ACTION_MOVE events and refactor it into its own method.  In this way, I can have onTouchEvent call onInterceptTouchEvent followed by that functionality if it detects that the event has previously gone unhandled.</p><pre><code>case MotionEvent.ACTION_MOVE:                if (touchState == TOUCH_STATE_SCROLLING) {                    handleScrollMove(ev);                } else {    //              Log.d(""workspace"",""caught a move touch event but not scrolling"");                    //NOTE:  We will never hit this case in Android 2.2.  This is to fix a 2.1 bug.                    //We need to do the work of interceptTouchEvent here because we don't intercept the move                    //on children who don't scroll.                    Log.d(""workspace"",""handling move from onTouch"");                    if(onInterceptTouchEvent(ev) &amp;&amp; touchState == TOUCH_STATE_SCROLLING){                        handleScrollMove(ev);                    }                }                break;</code></pre><p>This is from WorkspaceView.java (a modification of Android's Workspace.java, found at the andro-views project on google code, and now here: <a href=""http://stackoverflow.com/questions/2501307/horizontal-tabish-scroll-between-views/4336295#4336295"">Horizontal ""tab""ish scroll between views</a> ).  In the case that we receive a move event, and we are scrolling (which only happens if we have deliberately chosen to intercept it--ie, it's set in the intercept function, so we've been to the intercept function already) we perform the move behavior we desire.  If we receive a move event here and we are not scrolling, then we send the event back through onIntercept, and then see if we're now set to scrolling.  If so, we perform the action.</p><p>It's not elegant, but it works!</p>","429108","","429108","","2010-12-09 21:06:35","2010-12-09 21:06:35","Scrollview doesn't swipe when it's too short to scroll","<android><scrolling><scrollview><viewflipper>","2","0","1","",""
"3553657","1","3553851","","2010-08-24 04:53:42","0","291","<p>I was reading over <a href=""http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html"" rel=""nofollow"">http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html</a> But I'm really not grasping how to ignore certain lines of code. I have this Activity (posted below) and it's a simple webview. However, I want to have geolocation enabled(even if it is only for 2.0 and up phones), since these methods weren't introduced until SDK 5 (android 2.0) and I would like the webview to be able to at the very least be able to load on a 1.5 phone rather than just crashing. Could someone possibly show me how to take this code and make it ignore the lines of code that i pointed out with the starred comments when the users phone SDK is LESS than SDK 5?</p><pre><code>package com.my.app;import com.facebook.android.R;//NEEDS TO BE IGNORED**********************************************************import android.webkit.GeolocationPermissions;import android.webkit.GeolocationPermissions.Callback;//END**************************************************************************import android.app.Activity;import android.app.ProgressDialog;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.util.Log;import android.view.KeyEvent; import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.webkit.CookieSyncManager;import android.webkit.WebChromeClient;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Toast;//GeolocationPermissionsCallback NEEDS TO BE IGNORED**********************************************************public class Places extends Activity implements GeolocationPermissions.Callback{         private ProgressDialog progressBar;        public WebView webview;        private static final String TAG = ""Main"";        String geoWebsiteURL = ""http://google.com"";        @Override          public void onStart()        {           super.onStart();           CookieSyncManager.getInstance().sync();        }    public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);        CookieSyncManager.createInstance(this);        CookieSyncManager.getInstance().startSync();        webview = (WebView) findViewById(R.id.webview);        webview.setWebViewClient(new testClient());        webview.getSettings().setJavaScriptEnabled(true);        webview.getSettings().setPluginsEnabled(true);        webview.loadUrl(""http://google.com"");        progressBar = ProgressDialog.show(Places.this, """", ""Loading Page..."");        //THIS NEEDS TO BE IGNORED************************************************************        webview.getSettings().setGeolocationEnabled(true);        GeoClient geo = new GeoClient();        webview.setWebChromeClient(geo);            }    public void invoke(String origin, boolean allow, boolean remember) {    }    final class GeoClient extends WebChromeClient {    @Override    public void onGeolocationPermissionsShowPrompt(String origin,    Callback callback) {    super.onGeolocationPermissionsShowPrompt(origin, callback);    callback.invoke(origin, true, false);    }//END OF CODE THAT NEEDS TO BE IGNORED************************************************    }    private class testClient extends WebViewClient {         @Override         public boolean shouldOverrideUrlLoading(WebView view, String url) {            Log.i(TAG, ""Processing webview url click..."");            view.loadUrl(url);            return true;          }        public void onPageFinished(WebView view, String url) {            Log.i(TAG, ""Finished loading URL: "" +url);            if (progressBar.isShowing()) {                progressBar.dismiss();            }            if (url.startsWith(""mailto:"") || url.startsWith(""geo:"") ||                    url.startsWith(""tel:"")) {                                                Intent intent = new Intent                    (Intent.ACTION_VIEW, Uri.parse(url));                                                startActivity(intent);                    }        }    }        public boolean onKeyDown(int keyCode, KeyEvent event) {             if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {                 webview.goBack();                 return true;             }                if (keyCode == KeyEvent.KEYCODE_SEARCH) {                    Intent z = new Intent(this, Search.class);                    startActivity(z);                  }              return super.onKeyDown(keyCode, event);              }        public boolean onCreateOptionsMenu (Menu menu) {            super.onCreateOptionsMenu(menu);            MenuInflater inflater = getMenuInflater();            inflater.inflate(R.menu.menu, menu);            return true;        }    @Override    public boolean onOptionsItemSelected (MenuItem item) {            switch (item.getItemId()) {            case R.id.home:                Intent m = new Intent(this, Home.class);                startActivity(m);                return true;            case R.id.refresh:                webview.reload();                Toast.makeText(this, ""Refreshing..."", Toast.LENGTH_SHORT).show();                return true;    }    return false;        }    public void onStop()    {       super.onStop();       CookieSyncManager.getInstance().sync();        }} </code></pre>","393373","","","","","2010-08-24 06:12:14","How to Ignore certain methods and code in a Class? Based on SDK","<java><android><backwards-compatibility><android-1.5-cupcake>","1","0","2","",""
"3553699","1","","","2010-08-24 05:02:38","0","1531","<p>I want to use my image to replace the Compass image of MyLocationOverlay, how can i implement?</p>","429079","","","","","2011-10-10 20:53:46","How can I replace the Compass image of MyLocationOverlay?","<android><maps>","2","0","","",""
"3553763","1","","","2010-08-24 05:20:38","2","157","<p>What are the disadvantages of running services in Android in Foreground.??  I recently read that if you want your services to last longer and not get killed easily we need to run the service in foreground.</p>","396437","","","","","2013-10-10 01:04:59","Android Services","<android><service>","1","1","","",""
"3553779","1","3553811","","2010-08-24 05:25:18","45","17610","<p>How do I disable the keyboard when a button is pressed?</p>","454665","","557015","","2012-09-04 10:22:13","2014-03-26 20:00:36","Android dismiss keyboard","<android>","6","1","11","",""
"3553782","1","3553938","","2010-08-24 05:27:02","8","5281","<p>I tried using the following data in my intent filter:</p><pre><code>&lt;data android:scheme=""http"" android:host=""an.example.i.p"" android:pathPrefix=""t"" /&gt;</code></pre><p>Why doesn't the following url trigger it?</p><pre><code>http://an.example.i.p/t/v2.aspx/chase/a.test.auto</code></pre>","165495","","","","","2010-08-24 06:15:11","Android intent filter data path example","<android><android-intent><intentfilter>","1","0","2","",""
"3553815","1","4779025","","2010-08-24 05:40:11","1","350","<p>i want to know how i can work with android sdk on my new machine. Windows 7 ...64 bit processor? When i 'm working in eclipse my ADt gets installed but when i try to add the virtual device the destination..path (SDK-2.2 or 2.1) is not displayed.</p>","396437","","","","","2011-01-24 05:50:24","Android Installation. Problem with Android SDK","<android><eclipse>","1","2","","",""
"3553862","1","","","2010-08-24 05:57:26","2","3912","<p>I have an application.In that if we press on home button app closes but when i launch the app it resumes where i stopped.I mean it do not closed completely.how to solve this problem.</p>","429152","","","","","2013-02-14 11:21:27","How to exit an application completely in ANDROID","<android>","4","1","1","",""
"3553916","1","3554405","","2010-08-24 06:09:42","7","919","<p>I am using GestureOverlayView with ViewFlipper, and it takes about one second for the android to recognize my gesture and flip to next view. However, the Android calendar flips almost immediately. I checked the Android calendar code, and it uses GestureDetector. Is there big difference between these two gesture detecting mechanisms? </p><p>I am also wondering what's the difference between these two mechanism of detecting gestures. I know GestureOverlayView came out at 1.6, while GestureDetector was in 1.0. But why didn't they just deprecate GestureDetector when GestureOverlayView came out?</p>","412759","","","","","2010-08-24 07:43:43","The performance of GestureOverlayView and GestureDetector","<android>","1","0","2","",""
"3553952","1","","","2010-08-24 06:21:07","0","2378","<p>In my application in android 1.6 I m calling the default camera using </p><pre><code>Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);</code></pre><p>and mentioning output directory </p><pre><code>intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment.getExternalStorageDirectory() + ""/image.jpg"")));</code></pre><p>This works fine. However, if I replace it by </p><pre><code>intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment.getDataDirectory() + ""/image.jpg"")));</code></pre><p>the ok (attach) button doesnt respond. I have added the following in AndroidManifest.xml</p><pre><code>&lt;uses-permission android:name=""android.permission.CAMERA""/&gt;</code></pre><p>How to solve this ?</p>","368084","","","","","2010-08-24 17:42:20","Problem saving the image in a particular directory in android","<android>","2","0","","",""
"3554053","1","","","2010-08-24 06:45:53","3","680","<p>So from what I've known, if I do an <code>AsyncTask</code> inside an <code>Activity</code>, the task may be killed when user quits the <code>Activity</code> before it is finished. One solution I've seen is using <code>IntentService</code>, which the system will try hard not to kill.</p><p>My problem is that <code>IntentService</code> only uses one background thread to run all the tasks one by one. I have several independent tasks that I wish to run concurrently, and that makes a difference in the UI (not serious, but could surprise user).</p><p>How do I accomplish this? I imagine I could have several <code>IntentService</code> but this seems awkward and not scalable. How do I maintain sort of a threadpool that has a good priority, so that it won't get killed to easily by the system?</p><p>If I start a (normal) <code>Service</code>, then launch some <code>AsyncTask</code>s within there, does that result in a higher priority?</p><p>Many thanks.</p>","159759","","","","","2010-08-24 08:16:33","More than one worker threads with same priority as IntentService?","<android><design-patterns><concurrency><service><backgroundworker>","1","0","","",""
"3554234","1","3557770","","2010-08-24 07:18:56","0","3962","<p>I would like to show a number of alertdialogs, so the user has to handle off some questions (a little like a wizard).</p><p>Is it possible to make the alertDialog wait until the user chooses something and then returning the choisen value?</p><pre><code>    HashMap&lt;Integer, Question&gt; questions = DataConnector.getCallQuestions(position);    int nextQuestion = position;    while(nextQuestion != 0){        Question question = questions.get(nextQuestion);        CharSequence[] items = (String[])question.getAnswers();        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setTitle(question.getQuestion());        builder.setItems(items, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int item) {            }        });        AlertDialog alert = builder.create();        //I would like to do something like this:        nextQuestion = alert.getClickedItem();    }</code></pre><p><em>EDIT</em>. Reponse to chris:</p><p>The execution of the program should wait until the user chooses one of the options in the alertDialog</p><p>Is this possible?</p><p>Like this:</p><pre><code>    private int answer = 0;    ....    ...methode(){    //show dialog    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setTitle(question.getQuestion());    builder.setItems(items, new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int item) {            CallHandleMenu.this.answer = item; //setting answer        }    });    builder.create().show();    //Here I need to know the answer (the answer should not be 0 here)</code></pre>","373207","","63550","","2011-12-30 11:26:28","2011-12-30 11:27:44","AlertDialog gets a return value without a handler","<java><android><return><handler><alertdialog>","2","0","","",""
"3554250","1","3555003","","2010-08-24 07:21:02","0","2185","<p>I need to create a similar function to Toast.makeText(...) but more fast to disappear. I have seen such messagebox in the software ""Le monde fr"" when you select a button from the toolbar down. Its appear and disappear very fast if you move to another icon. I m looking to do the same functionnality but cannot figure out how to do that. Messagebox should not be modal, what i want is kind of a fast tooltip. The tooltip should appear and disappear fast. any ideas ?</p>","429222","","21234","","2010-08-24 07:22:07","2010-08-24 09:23:29","How to create a fast auto dismiss message box under ANDROID?","<android><tooltip><messagebox>","4","1","1","",""
"3554377","1","","","2010-08-24 07:39:07","35","19752","<p>I have added an image right of the text in an EditText widget, using the following XML:</p><pre><code>&lt;EditText  android:id=""@+id/txtsearch""  ...  android:layout_gravity=""center_vertical""  android:background=""@layout/shape""  android:hint=""Enter place,city,state""  android:drawableRight=""@drawable/cross"" /&gt;</code></pre><p>But I want to clear the EditText when the embedded image is clicked.<br>Please any one tell the answer</p>","454665","","648313","","2012-03-28 13:31:36","2014-04-08 19:02:24","Handling click events on a drawable within an EditText","<android><android-widget><edittext><compound-drawables>","10","2","21","",""
"3554390","1","","","2010-08-24 07:41:32","1","424","<p>I got a strange problem when I run my app on Nexus One, Android 2.2. In my app, I used a native .so lib, built under NDK. In Java code, I have 2 threads: one UI thread, one to run codes from native so lib, and then updates the UI with the result data.In C++ code, I have a global variable ""int count"", which records the times a specific method ""myMethod"" is called, and the count is increased by one every time ""myMethod"" is called.When I run my app in Nexus One, with Android 2.2, the strange problem occured. In my log, the count is 1, 2, 3, and then a message says ""08-24 12:32:57.961: DEBUG/dalvikvm(19244): GC_FOR_MALLOC freed 267 objects / 13712 bytes in 48ms"". After this GC_FOR_MALLOC event, my count is reset, starting from 1 again, and then 2, 3, 4...Then it seems that there are 2 threads running the same ""myMethod"", each outputs its own trace, mixed with each others trace randomly. For example, the trace can be</p><pre><code>    1, 2, 3, GC_FOR_MALLOC, 1, 2, 3, 4, 5, GC_FOR_MALLOC, 4, 5, 6, GC_FOR_MALLOC, 6, 7...</code></pre><p>When I run the same app with exactly the same code on Android Emulator, 2.1 or 2.2, the problem never showed up, and there are no GC_FOR_MALLOC event on emulator.</p><p>Some one met this problem before?Thank you for your help!</p>","429224","","","","","2010-10-22 12:11:47","A Strange C++ code problem in NDK, Nexus One","<android><multithreading><android-ndk><nexus-one>","2","0","","",""
"3554427","1","3566871","","2010-08-24 07:46:23","4","1144","<p>We were wondering if when using <code>Bundle</code> with serializable or parcelable objects, when does the marshalling actually happen? As soon as you put it in the bundle? Since bundles are mostly used to simply pass around data between two screens (we're not even talking about IPC here!), there doesn't seem to be much point in marshalling an object, since it stays in memory all the time, no?</p><p>Are we right in assuming that marshalling (be it Java serializing or Android parcelling) only happens if</p><ol><li>the data must be passed to another process, e.g. during RMI, or</li><li>the component (activity or service) gets destroyed and instance state must be written to disk?</li></ol><p>I've seen Android framework engineers (I believe it was Dianne Hackborn) say that one should use <code>Parcelable</code> instead of <code>Serializable</code> because the former is much faster. How much faster? And will this even make a difference if the object isn't marshalled most of the time anyway (assuming our assumptions about this were right)?</p>","127013","","","","","2010-08-25 14:26:12","Does a serializable object always get serialized when put in a bundle?","<android><marshalling><bundle><serializable><parcelable>","2","0","5","",""
"3554685","1","3554969","","2010-08-24 08:27:10","1","3218","<p>i try to animate a TextView on a changeTextBut always see only one direction of the animation, i only see the fadeout</p><p>What i try is: beforChange = fadeOut and onChange or after fadein</p><p>here is my code in the onCreate method of my activity:</p><pre><code>    final Animation out = new AlphaAnimation(1.0f, 0.0f);    out.setDuration(1000);    final Animation in = new AlphaAnimation(0.0f, 1.0f);    in.setDuration(1000);    bidFirst.setAnimation(out);    bidMiddle.setAnimation(out);    bidLast.setAnimation(out);    TextWatcher bidWatcher = new TextWatcher() {      public void onTextChanged(CharSequence s, int start, int before, int count) {        in.startNow();        bidFirst.setAnimation(out);        bidMiddle.setAnimation(out);        bidLast.setAnimation(out);      }      public void beforeTextChanged(CharSequence s, int start, int count, int after) {        out.startNow();        bidFirst.setAnimation(in);        bidMiddle.setAnimation(in);        bidLast.setAnimation(in);      }      public void afterTextChanged(Editable s) {      }    };    bidFirst.addTextChangedListener(bidWatcher);    bidMiddle.addTextChangedListener(bidWatcher);    bidLast.addTextChangedListener(bidWatcher);</code></pre><p>i think there is something wrong in my code but for my believe it has to work.</p><p>What i have now is: on every setText the changed Text only FadeOut but after the text has changed and never FadeIn!?</p>","421901","","","","","2010-08-24 09:10:11","How to animate a FadeOut and FadeIn while textView changed text","<android><animation><fadein><fadeout><textwatcher>","2","0","1","",""
"3554722","1","3554949","","2010-08-24 08:32:41","9","11758","<p>I have used the android internal storage to save a file for my application (using openFileOutput) but I would like to delete that file,is it possible and how?thanks maxsap.</p>","234898","","","","","2012-11-21 09:21:25","How to delete internal storage file in android?","<android>","4","0","1","",""
"3555250","1","3555297","","2010-08-24 09:47:58","0","103","<p><strong>Hello,</strong> I have a line drawn vertically, let's say it has 100 pixels. I want to make this line half lenght white, half lenght red. Can I achieve this with a gradient ? </p><p>I tried stuff like</p><pre><code>linePaint.setShader(new LinearGradient(x,y, x1, y2, new int[] { Color.WHITE, Color.RED},null,Shader.TileMode.MIRROR));canvas.drawLine(x,y,x1,y1,linePaint);</code></pre><p>In .NET is very simple to do this with a gradient but in Android I'm stuck. Any help is really appreciated. Thank you.</p>","379865","","133203","","2010-08-24 09:52:59","2010-08-24 09:55:18","Android BiColored line","<android>","1","0","","",""
"3555342","1","","","2010-08-24 10:05:27","0","1341","<p>Is there a way to load an image file into an ImageView object, and thendefine a transparent color for this object ?</p>","164460","","","","","2010-11-26 11:17:49","android image transparency","<android><image><transparent>","1","0","","",""
"3555348","1","3563698","","2010-08-24 10:06:20","1","2601","<p>I'm working on an application using the SMS apis for android. The receiving end is an embedded unit that only supports 7-bit encoded SMS and the string I'm sending consists only of symbols from this particular alphabet which makes you think that Android is going to send it encoded as 7 bit. But that is not the case.</p><p>Therefore I'm searching for a way to specify what encoding to use. See below for what my code looks like today. The method gsm7BitPackedToString turns a byte-array to a 7-bit string, i.e. the string only consists of 7-bit compatible characters and is copied from the internal android api.</p><pre><code>private static boolean sendMessage(String tel,byte[] message,int septets) {    SmsManager sms = SmsManager.getDefault();    if (septets != -1) {        String a = GsmAlphabet.gsm7BitPackedToString(message,0,septets);        sms.sendTextMessage(tel, null, a, null, null);        return true;    }    return false;}</code></pre><p>I have considered the following solutions:</p><ul><li>Using some sort of internal method but none of the ones <a href=""http://www.tutorialforandroid.com/2009/11/calling-private-methods-in-android.html"" rel=""nofollow"" title=""Calling Private Methods In Android- sendRawPdu"">I've read about</a> seems to exist anymore.</li><li>Sending a data message but this requires an additional User-Data Header that the receiving end also doesn't support.</li></ul><p>Any help is appreciated :-)</p>","414817","","","","","2011-05-14 18:31:01","Defining data encoding of SMS messages in Android","<android><encoding><sms><pdu><7bit>","2","2","","",""
"3555466","1","4494619","","2010-08-24 10:26:36","1","1585","<p>How can I implement the fairly new <code>Voice Actions</code> from Google, in Android?<br>I'm thinking about the possibility to listen to the <code>Listen to</code> action as used by some music application.<br>Is there a specific broadcast my app must register as a receiver to?</p>","367101","","","","","2010-12-20 22:28:50","Implement Google Voice Actions in Android","<android><action><voice><broadcastreceiver><receive>","1","0","1","",""
"3555494","1","3555606","","2010-08-24 10:31:45","2","175","<p>My app uses a method that was deprecated since Android 2.1 with a different method and I would like to make it work from 1.5 to 2.2.  Is there a way for my app to determine which Android version the user has and call the correct method based on that?  Or is there a better way to do this?</p>","274365","","241605","","2013-02-24 11:34:09","2013-02-24 11:34:09","Android deprecated method backward-compatible","<android>","1","0","2","",""
"3555536","1","3555619","","2010-08-24 10:36:48","2","4320","<p>I'm starting with android, and the app I'm developing is gonna need custom widgets look (glossy buttons, animated backgrounds etc.),I've googled for any external libraries to achieve this and did not find anything.</p><p>let me guess, the only way to this is by painly extending base view classes and overriding onDraw etc. ?</p>","311017","","311017","","2010-08-25 09:52:11","2013-01-01 12:47:23","android UI external libraries?","<android><android-widget><android-sdk-2.1><android-ui>","2","0","3","",""
"3555594","1","3555645","","2010-08-24 10:44:19","2","4605","<p>can we show the dialog when our appliaction/activity startup?</p>","421645","","272824","","2010-08-24 10:51:39","2010-08-25 12:16:07","show dialog when application/activity startup","<android><dialog>","4","2","","2012-08-23 03:01:14",""
"3555601","1","3558063","","2010-08-24 10:45:29","3","819","<p>What is the correct way to save images in png format, if I want to use it in my Android OpenGL ES application as texture?</p><p>Somehow some textures work, and some texture get incorrect vertex mapping. The code is the same, the image is different.</p>","333361","","","","","2010-08-24 15:21:34","Correct way to use png/jpg in OpenGL ES","<android><opengl-es><png>","1","2","","",""
"3555677","1","","","2010-08-24 10:55:58","1","776","<p>I tested my app on some Android 2.1 and 2.2 devices. So I think that they support OpenGL ES 1.1But on some devices I had problems whit my app. I get an unsupported operation exception means the device does not support the GL 11 interface. Is this a hardware problem? Are there some possibilities to avoid this problem?</p><p>Thanks,Mijat</p>","429411","","","","","2010-08-25 11:38:56","Android Devices Problems with OpenGL ES GL 11","<android><opengl-es><device>","2","1","","",""
"3555697","1","3555765","","2010-08-24 10:58:39","0","441","<p>friend's,  I there any possibility to bind the result of Intent class in xml layout,</p><p>i'm doing it so for sending mail,i'm using below code for sending mail in</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);                sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                sendIntent.putExtra(Intent.EXTRA_EMAIL,                new String[] { ""info@blacksheep.com"" });                sendIntent.setType(""vnd.android.cursor.dir/email"");</code></pre><p>when i use the above code it opens a new page,but i need it to be in the layout alone.How can i get it.</p><p>Thanks in advance.</p>","407506","","","","","2010-08-24 11:07:44","How to set Intent result in Layout","<android>","1","0","","",""
"3555755","1","","","2010-08-24 11:06:31","15","8978","<p>Hi I need to copy/move the contents of <code>data/tombstones</code> to <code>sdcard/tombstones</code></p><p>I'm using the command below:</p><pre><code>mv data/tombstones /sdcard/tombstones""failed on 'tombstones' - Cross-device link""</code></pre><p>but I'm getting above error.</p>","492729","","933198","","2013-01-09 01:10:18","2014-04-07 17:43:13","How can I copy the contentsof data/ to sdcard/ without using adb?","<android>","3","5","8","",""
"3555780","1","3555833","","2010-08-24 11:09:08","1","881","<p>Hai All,         I have a Gallery which Contains text Value such as Movie, Music, Games, Magzine etc., My Problem is, Whenever the User Scrolls the Gallery, I want to get the Postion of the Element.</p><p>For Instance,              User Scrolls the Gallery from Movie to Games means then i have to get the Position of Currently Selected Element ie postion of Games.</p><p>Thanks In Advance,</p>","424413","","424413","","2011-01-24 15:07:27","2011-01-24 15:07:27","How to Get the Postion of Elements in the Gallery when the User Scrolling it?","<android><gallery>","1","0","0","",""
"3555868","1","3556267","","2010-08-24 11:20:32","7","5226","<p>Pictures: <a href=""http://img838.imageshack.us/img838/1402/picse.png"">http://img838.imageshack.us/img838/1402/picse.png</a></p><p>How do I make the layout in Pic. 2 using RelativeLayout ONLY. Below is the xml layout of the first screenshot.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;&lt;TextView    android:id=""@+id/timer_textview""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center""    android:layout_marginTop=""10dip""    android:textSize=""30sp""    android:layout_alignParentTop=""true""    android:text=""@string/timer_start"" /&gt;&lt;ListView     android:id=""@+id/questions_listview""    android:layout_below=""@id/timer_textview""      android:layout_width=""wrap_content""    android:layout_height=""fill_parent"" /&gt;&lt;Button android:id=""@+id/true_btn""    android:text=""@string/true_option""    android:layout_alignParentBottom=""true""    android:layout_weight=""1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;&lt;Button    android:id=""@+id/false_btn""    android:text=""@string/false_option""    android:layout_toRightOf=""@id/true_btn""    android:layout_alignBaseline=""@id/true_btn""    android:layout_weight=""1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","421372","","421372","","2010-08-24 11:25:36","2010-08-29 11:59:44","How do I achieve the following result using RelativeLayout?","<android><design><user-interface><relativelayout>","2","1","3","",""
"3555924","1","3556190","","2010-08-24 11:28:03","1","2134","<p>How would i be able to get the mimeType from an application.</p><p>I am working on an application which filters certain installed applications based on the mimeType.</p><p>could someone please help me with this issue ?</p><p>thanks alot</p>","415053","","","","","2010-08-25 04:45:17","how to get the mimeType from an application?","<android><mime-types>","4","0","","",""
"3556042","1","3614180","","2010-08-24 11:44:35","2","4119","<p>I have an android application that I want to always be running in landscape mode.</p><p>I have the following code implemented to keep the app in landscape mode all the time:</p><p>inside my activity in the Application Manifest<br>android:screenOrientation=""landscape""</p><p>This seems to launch and keep the application in landscape view for the whole duration of the application.  Perfect!</p><p>However, if I have the app running on my HTC Aria (Android 2.1) and the phone locks, if I unlock the phone, I see the application for probably half a second and it's in portrait orientation and then quickly switches back to landscape mode.  It is quite frustrating because all of my views are jumbled around and it looks unprofessional as you can imagine.  This happens in both the emulator and on my real phone.</p><p><strong>Does anyone know how to stop the application from temporarily rotating when the phone is unlocked?</strong></p><p><strong>Additions:</strong><br>I have tried overriding onConfigurationChanged() but with no success.</p><p>I have also tried putting setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); into the onResume() but the app still shows as the incorrect orientation for a split second when the phone is unlocked.</p>","107459","","107459","","2010-08-26 11:00:41","2012-02-26 22:50:13","How can I stop auto screen rotation in my Android app when unlocking the phone from standby","<android><screen-rotation>","3","3","","",""
"3556196","1","","","2010-08-24 12:04:47","0","1816","<p>I am in process of  creating some test application ""Time Tracker"" app like stopwatch so I start app go to Activity where I start time counter and  now  I need some functionality   to send my activity  to background or minimize or  hide  and  after some period  to call this  activity again and  stop her counter to get passed time period .</p><p>How can I send Activity to back and call her to front but not  to stop timer counter ??</p>","365860","","","","","2010-08-24 12:14:15","android: How can I send an activity to background & call her from there","<android><background><activity><minimize>","1","1","","",""
"3556297","1","","","2010-08-24 12:16:53","0","421","<p>Friend's I have a problem when click the back button either in device or customised back button in header,it never back to show the list content,it simply shows the blank screen.</p><p>For example - -</p><p>I have list view - list1,in it's onclick event i move to next listview -list2, and from list2 -onclick event i move to webview there i have back button in my titlebar,when i click it throws null pointer exception even from device back button also getting same,and the list show empty. where my webview is in New Activity.</p><p>Here my code for back button onClick, { finish(); } How can i resolve it.</p><p>Thanks in advance.</p>","407506","","","","","2010-08-25 08:32:31","Facing problem when using back button in title bar","<android>","1","3","","",""
"3556366","1","","","2010-08-24 12:26:41","2","9046","<p>I want to write a Android Program for Camera that captures pictures. I written code in such a way when I click a button, it should be captured, but noting is happeneing. Button click happens , but control doesnot come to ""onPictureTaken"". I am pasting my code here:</p><h2>Activity</h2><pre><code>package com.andr.sai.camerademo;import java.io.IOException;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.PixelFormat;import android.hardware.Camera;import android.os.Bundle;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.View;import android.view.Window;import android.view.WindowManager;import android.view.View.OnClickListener;import android.widget.Button;public class camerademo extends Activity implements SurfaceHolder.Callback  {    /** Called when the activity is first created. */ SurfaceView mSurfaceView ; SurfaceHolder    mSurfaceHolder; boolean mPreviewRunning; Camera  mCamera; Bitmap bitmap = null;  Button b1;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        getWindow().setFormat(PixelFormat.TRANSLUCENT);        requestWindowFeature(Window.FEATURE_NO_TITLE);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,        WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.camera_surface);        b1=(Button)findViewById(R.id.b1);        mSurfaceView = (SurfaceView) findViewById(R.id.surface_camera);        mSurfaceHolder = mSurfaceView.getHolder();        mSurfaceHolder.addCallback(this);        mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);        b1.setOnClickListener(new OnClickListener()        {  @Override   public void onClick(View arg0) {   System.out.println(""111111111111111111111111"");   Camera.PictureCallback mPictureCallback = new Camera.PictureCallback()    {    public void onPictureTaken(byte[]imageData, Camera arg1) {     System.out.println(""2222222222222222222222222222222222222"");     BitmapFactory.Options opt = new BitmapFactory.Options();                  bitmap = BitmapFactory.decodeByteArray(imageData, 0, imageData.length, opt);     }   };   }        }        );    } @Override public void surfaceChanged(SurfaceHolder holder, int arg1, int w, int h) {  if (mPreviewRunning) {   mCamera.stopPreview();   }   Camera.Parameters p = mCamera.getParameters();   p.setPreviewSize(w, h);   mCamera.setParameters(p);   try {   mCamera.setPreviewDisplay(holder);   } catch (IOException e) {   e.printStackTrace();   }   mCamera.startPreview();   mPreviewRunning = true; } @Override public void surfaceCreated(SurfaceHolder arg0) {  mCamera = Camera.open();  } @Override public void surfaceDestroyed(SurfaceHolder arg0) {  mCamera.stopPreview();  mPreviewRunning = false;  mCamera.release(); } public void onDraw(Canvas c)  {  c.drawColor(Color.WHITE);  c.drawBitmap( bitmap, 10, 10, null); }}</code></pre><h2>camera_surface.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;SurfaceView    android:id=""@+id/surface_camera""   android:layout_width=""fill_parent""    android:layout_height=""10dip""   android:layout_weight=""1""&gt; &lt;/SurfaceView&gt; &lt;Button   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:text=""Gettt""   android:id=""@+id/b1""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>In debug mode I ran this one and I am getting the following debug strings:</p><pre><code>08-24 17:43:41.293: ERROR/MediaPlayerService(30):   error: -208-24 17:43:41.303: ERROR/MediaPlayer(30): Unable to to create media player08-24 17:43:41.303: ERROR/CameraService(30): Failed to load CameraService sounds.08-24 17:43:41.334: ERROR/MediaPlayerService(30):   error: -208-24 17:43:41.344: ERROR/MediaPlayer(30): Unable to to create media player08-24 17:43:41.344: ERROR/CameraService(30): Failed to load CameraService sounds.08-24 17:43:41.354: DEBUG/CameraService(30): Client::Client X (pid 421)08-24 17:43:41.364: DEBUG/CameraService(30): CameraService::connect X08-24 17:43:41.364: DEBUG/CameraService(30): getParameters(picture-format=jpeg;picture-size=213x350;preview-format=yuv422sp;preview-frame-rate=15;preview-size=176x144)08-24 17:43:41.445: DEBUG/CameraService(30): setParameters(preview-size=320x432;preview-format=yuv422sp;picture-size=213x350;picture-format=jpeg;preview-frame-rate=15)08-24 17:43:41.445: DEBUG/CameraHardwareStub(30): initHeapLocked: preview size=320x43208-24 17:43:41.455: DEBUG/CameraService(30): setPreviewDisplay(0xe1f0) (pid 421)08-24 17:43:41.464: DEBUG/CameraService(30): startPreview (pid 421)08-24 17:43:41.464: DEBUG/CameraService(30): startCameraMode(0) (pid 421)08-24 17:43:41.464: DEBUG/CameraService(30): startPreviewMode (pid 421)</code></pre><p>Can u help me how to run Sample camera program in Android , to take pictures.</p>","429501","","105224","","2010-08-24 12:31:05","2012-12-14 11:51:07","how to run Sample camera program in Android , to take pictures","<android><android-widget>","2","2","0","",""
"3556497","1","3560743","","2010-08-24 12:42:37","1","544","<p>We have written an Android application which sends stack traces to our server, if any occur. Sometimes we get weird stack traces that seem not to be an exception from our application. For example:</p><pre><code>java.lang.NullPointerExceptionat android.widget.FastScroller.scrollTo1(FastScroller.java:306)at android.widget.FastScroller.onTouchEvent(FastScroller.java:507)at android.widget.AbsListView.onTouchEvent(AbsListView.java:1894)at android.widget.ListView.onTouchEvent(ListView.java:3083)at android.view.View.dispatchTouchEvent(View.java:3386)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:831)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1710)at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1197)at android.app.Activity.dispatchTouchEvent(Activity.java:1993)at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1694)at android.view.ViewRoot.handleMessage(ViewRoot.java:1525)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:3952)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>There is no mention of our own classes, only Android's standard classes. It's obvious that this exception takes place when scrolling of item list (ListView) occurs, but I can't even uderstand how I can fix this bug. I can't reproduce this bug. What do you usually do when you encounter the same problem? Any ideas?</p>","206350","","29639","","2010-08-24 13:07:51","2010-08-24 20:27:32","How do you understand the cause of exception having stacktrace?","<android><stack-trace><nullpointerexception>","1","2","0","",""
"3556569","1","3618725","","2010-08-24 12:50:50","4","1706","<p>The problem appears in Android 2.2. It seems cool because it can auto-hide.But I don't like it quite much because the bar is an indicator for ""Whether there is more content not present on the widget"". Hiding it maybe neat, but may get the users wrong sometimes. In ListView, I find it a fatal bug at all. When there is more content to show, no scrollbar present, AND when wipe the screen down-wards, no scroolbar appears. Only when use the traceball or Dpad to move focus, there appears the scrollbar. BUT THERE IS WORSE: when you wipe down-wards to move the scrollbar down, nothing happens! The touch feature is almost disabled here.</p><p>Can anyone help me here? Thanks!</p>","414787","","","","","2011-10-11 17:29:51","Android: ScrollBar bug in 2.2 for ListView","<android><listview><scrollbar><android-sdk-2.2>","2","2","1","",""
"3556764","1","3558472","","2010-08-24 13:15:39","2","4126","<p>is it possible to programatically access specific rows in a list of CheckedTextViews to change the state of their textboxes?</p><p>my program has a listview which has several CheckedTextViews which the user can press to toggle state.</p><p>I want to save the state of the checkboxes when the user leaves the activity, so I have in my onPause method:</p><pre><code>public void onPause(){         super.onPause();         SparseBooleanArray positions;         positions = listView.getCheckedItemPositions();         ListAdapter items = listView.getAdapter();         int j = items.getCount();         ArrayList&lt;Long&gt; ids = new ArrayList&lt;Long&gt;();         for (int k =0; k &lt; j;k++){             if(positions.get(k)==true){                 ids.add(items.getItemId(k));                }         }          this.application.getServicesHelper().open();         this.application.getServicesHelper().storeServices(ids,visit_id);         this.application.getServicesHelper().close();     }</code></pre><p>which very simply iterates the list view, adds the checked items to an ArrayList and then saves that list of ids to the database. </p><p>My problem lise in trying to reset the list once a user goes back to that activity.</p><p>so far in my onStart method, I recall the checked items from the database, but I do not know how to march the ids returned to the listview elements. can I do something like:</p><p><code>listView.getElementById(id_from_database).setChecked</code>?</p><p>I know I cant use getElementById but I have it here to show what I mean</p><p>Thanks in advance</p><p>Kevin</p>","409826","","","","","2010-08-24 16:09:34","Programatically access specific rows in List of CheckedTextView's - Android","<android><listview><list><checkedtextview>","2","0","","",""
"3556880","1","","","2010-08-24 13:26:08","1","605","<p>Is there a tool or application that I can use to stamp Android .APK files (on my server, before a download) with a unique number that is queryable at runtime?</p>","3886","","","","","2010-09-15 21:26:08","Stamping Android APK files","<android>","5","0","","",""
"3556940","1","","","2010-08-24 13:31:36","1","2358","<p>I have been playing with android:gravity attribut but still cannot make my text content justify in the textview. Does anybody know if it is supported ? Is there a way ? Anybody succeeded ?</p>","429222","","","","","2013-12-13 12:31:01","Does anybody know how to justify a textview content in a ANDROID layout?","<android><textview><justify>","4","0","1","",""
"3556983","1","","","2010-08-24 13:34:34","1","609","<p>I am newbie to androids Apps, guys i have one doubt,Whether is it possible to add buttons(ok,cancel) in the ContextMenu,if so please provide some reference..</p><p>Forgive me if i have asked a silly novice question</p><p>Thanks a lot in Advance</p>","384193","","","","","2010-08-24 15:09:02","How to add buttons in ContextMenu in Android","<android>","1","0","","","2010-08-24 13:35:04"
"3557087","1","3557296","","2010-08-24 13:45:06","4","478","<p>I am developing an Android application where you should be able to browse restaurants.</p><p>Im retrieving the information about the restaurants from a service, they are not stored locally on the device. But I want to allow the user to add a restaurant to his/her favorites. </p><p>What is the ""best"" way to store that kind of info on the device? Should I use Shared Preferences or Sqlite db? Or any other suggestions?</p>","297410","","","","","2010-08-24 14:06:26","what is the best way to store data such as 'Favorites' on an Android-app?","<android>","2","0","","",""
"3557146","1","3559606","","2010-08-24 13:50:34","4","4247","<p>Having checked out the froyo code I can successfully build froyo, but what I really want is only building libwebcore.so, is there a special target for this?</p><p>Just make -f Android.mk in external/webkit isn't working for the obvious reasons.</p>","4735","","995926","","2012-05-05 13:46:52","2012-05-05 13:46:52","How to build _just_ libwebcore.so instead of the whole froyo source","<android><webkit><android-2.2-froyo>","2","1","2","",""
"3557159","1","","","2010-08-24 13:52:00","1","4175","<p>I need to create a Robotium application that would use Settings application to turn ON/OFF WIFi from menu Settings->Wireless &amp; networks->Wi-Fi. I managed to find some sample code <a href=""http://code.google.com/p/robotium/wiki/RobotiumForAPKFiles"" rel=""nofollow"">here</a> that demonstrates how to launch application by having apk file only. The problem is that my Robotium application should have the same signature with the (system) Settings application. While trying to run application I get the error message: </p><blockquote>  <p>Test run failed: Permission Denial:  starting instrumentation  ComponentInfo{com.jayway.test/android.test.InstrumentationTestRunner}  from pid=354, uid=354 not allowed  because package com.jayway.test does  not have a signature matching the  target com.android.settings</p></blockquote><ol><li>Can I somehow make it work with the Android Emulator?</li><li>If I compile an Android phone image, how can I use the Android system signature with my application?</li></ol>","342863","","1034755","","2011-11-08 02:13:56","2014-04-16 13:16:35","How can I sign my application with the system signature key?","<android>","2","0","1","",""
"3557461","1","3557529","","2010-08-24 14:24:06","0","1043","<p>I have an Android app that in the onCreate() method, preloads a lot of graphics.</p><p>When I test my app on my HTC Aria and launch it, it runs fine.  However, if I press the back button to exit my app, and then launch the app again, it crashes with an OutOfMemoryError: bitmap size exceeds VM budget.  If I then launch the app for the third time (right after it has crashed) it launches fine.  Then if I close and re-launch it, it crashes again with out of memory.  It continues this every-other-time-crashing pattern forever if I keep trying.</p><p>I checked to see what life cycle methods were being called and onStop() and onDestroy() are both being called when I exit the app, yet I have a feeling that something is not yet being cleaned up and that by ""crashing"" the app when I try to launch it the second time, it somehow free's the memory.</p><p>Any thoughts on what could be happening or how to remedy this?  Please let me know if you need me to post more info.  Thanks!</p><p>Info:<br>My app is fairly simple and only has 1 activity that plays some frame animations.</p>","107459","","107459","","2010-08-24 14:29:43","2010-08-24 14:52:07","In my Android app, every other time I launch my app, it crashes with OutOfMemory Exception","<android><memory><crash>","3","0","","",""
"3557730","1","","","2010-08-24 14:47:56","0","1728","<p>I want to pass an array from one Activity to another Activity,for example I need to pass an array from image_view Activity to Blackimage Activity.Please give solution to this problem in Android.</p>","410757","","1624458","","2012-09-14 10:42:13","2012-09-14 10:42:13","how to pass an array from one activity to another activity in android","<android>","5","0","","",""
"3557900","1","3558173","","2010-08-24 15:06:27","0","844","<p>I've downloaded a few networking apps (games) that have you log in, then take you to a ""home"" type screen where you can change your settings, or start a new game, or view your buddies etc.</p><p>My question is two-part:</p><p>1) how are these ""multipanel"" apps created?  Is each panel its own activity?  I've tried adding different panels through Views, but on the apps I described above, when I hit the back button on my phone, it takes me to the previous screen and in my apps, it just takes me out of the app when I hit back (again I'll I've done are add separate views).  Can someone point me in the right direction of what I need to do to create a multipanel application that when I click a button, a new panel loads, then when I hit back on the phone, it takes me to the previous panel?</p><p>2) one of my panels will be a login page which I will post the log-in credentials via http post to my server for authentication.  I would like to remember the log-in ""token"" that is passed back to the client so they don't have to log in every time they use my application.  Again, referring to some of the apps that I have, they offer this feature but I can not locate anything on the phone where it would be saved.  Is this done with xml usually?</p><p>Thanks for your time.</p>","233971","","","","","2010-08-24 15:35:34","create ""multipanel"" login and remember login info - android","<android><login><views><activity>","2","0","","",""
"3557972","1","","","2010-08-24 15:13:28","2","5339","<p>I'm making an app that needs to sort a Sqlite table of weeks by date and display just the date and the total hours worked that week in a listview. </p><p>My activity extends listview and uses SimpleCursorAdapter to populate the listview. My date column is a TEXT field formatted like this ""YYYY-MM-DD""</p><p>Here is my database query function, I base my database helper class off of the google notepad example.</p><pre><code>public Cursor getAllWeeks()    {        Cursor mCursor = mDb.query(true, DATABASE_TABLE, null, null, null, null, null, ""weekdate ASC"", null);        if (mCursor != null)        {            mCursor.moveToFirst();        }        return mCursor;    }</code></pre><p>And I hook it to the ListView like this:</p><pre><code>public class WeekList extends ListActivity implements OnClickListener{    final static int DELETE_ID = Menu.FIRST + 1;    public static NotesDbAdapter DBadapter;    public static Cursor ListCursor;    static final String[] displaycolumns = {""weekdate"", ""weektotalhours""};    static final int[] listitemviews = {R.id.TextViewListItem1, R.id.TextViewListItem2};    @Override    public void onCreate(Bundle icicle)    {        super.onCreate(icicle);        setContentView(R.layout.weeklist);        Log.i(""bendebug"", ""logtest"");        DBadapter = new NotesDbAdapter(this);        DBadapter.open();        ListCursor = DBadapter.getAllWeeks();        this.setListAdapter(new SimpleCursorAdapter(this, R.layout.listitemlayouts, ListCursor,                 displaycolumns, listitemviews));        findViewById(R.id.ButtonAddWeek).setOnClickListener(this);        //Activate the context menu        registerForContextMenu(getListView());    }</code></pre><p>The problem I am having is that my cursor doesn't seem sorted properly, my weeklist looks like this:</p><pre><code>2010-7-192010-7-232010-7-242010-7-6</code></pre><p>Instead of being properly sorted. I'm probably missing something really obvious, since I'm a total noob trying to teach myself.</p><p>Obviously i shortened the code to make it more readable, since the rest of the activity is irrelevant AFAIK but I would be happy to post the complete code for the activity on request, it's really basic anyway.</p>","429685","","","","","2010-08-24 21:28:45","How can i get SQLite to sort by date properly using YYYY-MM-DD format?","<java><android><sqlite3>","3","0","1","",""
"3557996","1","3558088","","2010-08-24 15:15:47","12","20372","<p>I want to make a http request with android. </p><p>is use this:</p><pre><code>void testHTTP() {  HttpClient httpClient = new DefaultHttpClient();  HttpUriRequest request = new HttpPost(""http://www.google.com"");  try {   HttpResponse response = httpClient.execute(request);   //System.out.println(""response protocol version: "" + response.getProtocolVersion());  } catch (ClientProtocolException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  } }</code></pre><p>I have the internet permission set in my manifest file.</p><p>I keep getting <code>java.net.UnknownHostException: www.google.com</code></p><p>My final purpose ios to be able to invoke a web service. So, I initially tried the ksoap2 library and the proper url and got the same result.</p><p>I suspect I have some bad setting either in my app or in my emulator.</p><p>can you give me some pointers on where to look?</p><p>it would also bee useful a working example of something similar. then i could check and if the problem persists i would know that is my development setup at fault. </p><p>btw, i am using mac snow leopard with eclipse and android 2.2 as a setup</p><p>thanks</p><p>regards </p>","428433","","","","","2013-12-18 05:33:37","android httprequest java.net.UnknownHostException","<android><http><request>","6","0","1","",""
"3558028","1","","","2010-08-24 15:19:15","0","118","<p>I'm trying to produce a simple server that will allow me test the Androids security features. I need to develop an application that will open a socket. I've produced something similar in C, but I am having no look with java. Here's the application in C</p><pre><code>// simpleserver3.c#define MY_PORT     9999#define MAXBUF      99void indata(int clientfd, struct sockaddr_in client_addr){char buffer[12];printf(""%s:%d connected\n"", inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));recv(clientfd, buffer, MAXBUF, 0); //this is will overflow the bufferprintf(""%X \n"", &amp;buffer);}int main(int Count, char *Strings[]){struct sockaddr_in self, client_addr;int sockfd,clientfd;/*---Create streaming socket---*/if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) &lt; 0 ) //socketfd = handle for socket{    perror(""Socket"");    exit(errno);}/*---Initialize address/port structure---*/bzero(&amp;self, sizeof(self));self.sin_family = AF_INET;self.sin_port = htons(MY_PORT);self.sin_addr.s_addr = INADDR_ANY;/*---Bind the structure to the socket handle ---*/if ( bind(sockfd, (struct sockaddr*)&amp;self, sizeof(self)) != 0 ){    perror(""socket--bind"");    exit(errno);}/*---Make it a ""listening socket""---*/if ( listen(sockfd, 20) != 0 ){    perror(""socket--listen"");    exit(errno);}//set socklen_t to length of client addresssocklen_t addrlen=sizeof(client_addr);/*---accept a connection (creating a data pipe)---*/clientfd = accept(sockfd, (struct sockaddr*)&amp;client_addr, &amp;addrlen); //create handle for communicatingindata(clientfd, client_addr);close(clientfd);close(sockfd);return;}</code></pre><p>Any sugguestion would be great, Aneel</p>","429708","","54742","","2010-08-24 15:32:08","2010-08-24 15:32:08","Trying to produce an exploitable Android Server","<android><exploit>","2","0","","",""
"3558106","1","3558178","","2010-08-24 15:26:48","1","1747","<p>I need to save some state when the user leaves my game during game play. Saving the state doesn't seem to be an issue, but I can't figure out how to restore it. The <code>onCreate</code> function isn't called when the <code>Activity</code> is resumed (only when it is first created), so I can't get my state back there. Logically, I would use <code>onRestoreInstanceState</code>, but it isn't being called.</p><pre><code>@Overrideprotected void onRestoreInstanceState(Bundle savedInstanceState) {    super.onRestoreInstanceState(savedInstanceState);    Log.d(""RocketLaunch"", ""onRestoreInstanceState()"");    savedState = savedInstanceState;}</code></pre><p>I see log output from <code>onSaveInstanceState</code>, <code>onResume</code>, <code>onCreate</code>, etc, but I never see a log message from <code>onRestoreInstanceState</code> and <code>savedState</code> is always null. Why isn't <code>onRestoreInstanceState</code> being called, and is there another way to get my state back?</p><p>Thanks!</p>","118391","","","","","2010-08-24 15:35:58","Where to restore instance state?","<android>","1","0","1","",""
"3558183","1","","","2010-08-24 15:36:21","6","3569","<p>I have an application with 4 tabs. By default every tab width is 1/4 of the screen width. How can I override this?</p><p>I need the tabs to have a different width for each one. Any ideas on how to accomplish that?</p>","417131","","","","","2012-03-19 05:05:44","Different sized tabs in Android","<android><tabs><width><android-tabhost><tabwidget>","3","2","1","",""
"3558284","1","3587052","","2010-08-24 15:46:17","1","313","<p>Now I have (1: the UI-loop, there my SurfaceView is placed), (2: a second thread, there the draw function from the UI-loop is called AND the update calculations from my Engine) and (3: the engine, there all the calculations stuff are).</p><p>Now I wonder how the best and smoothest way to do the SurfaceView independent from the actual frame rate. How shall I do so it will compensate if there is a low frame rate?</p><p>I think my current solution isn't enough, see code below.</p><p>Thread-class</p><pre><code>//Constructor stuff....int static delay = 0; /* My delay in milliseconds, depends most onwhich sort of game I'm trying to make */@Overridepublic void run() { while (state==RUNNING) {       long beforeTime = System.nanoTime();       engine.updateSprites(); //Update calculations from my engine //Rita Canvas c = null; try {            c = surfaceHolder.lockCanvas(null);       synchronized (surfaceHolder) {           view.myDraw(c);    //My draw function     } } finally {     if (c != null) {         surfaceHolder.unlockCanvasAndPost(c);     } } sleepTime = delay-((System.nanoTime()-beforeTime)/1000000); /* 1000000 because  of the nanoTime gives us the current timestamp in nanoseconds */        try {            if(sleepTime&gt;0){            Thread.sleep(sleepTime);                      }        } catch (InterruptedException ex) {         } }</code></pre><p>Is this code enough to ensure the independent from low frame rate? If not, where is my way to go?</p><p>Thanks in advance!</p>","386562","","","","","2010-08-27 18:23:25","Compensate drawing delay from the game logic updates","<java><android>","2","0","","",""
"3558320","1","3566034","","2010-08-24 15:49:53","7","1688","<p>I added a ViewSwitcher to a LinearLayout, which has two views of different height, However it seems the ViewSwitcher is occupying space of the biggest of the views, rather than arranging itself. Is this how it should be?</p><p>What to do in the other case? I was trying to create an accordion, where the title panel, when clicked grows in size</p>","13046","","","","","2012-12-27 02:38:22","ViewSwitcher and layout height in Android","<android>","1","0","4","",""
"3558371","1","3558419","","2010-08-24 15:54:25","3","1294","<p>Howdy, I am a programmer that has worked almost exclusively with c++/c#/vbs and am just now entering into the world of Android development. I am running into a few issues that I cant seem to find answers for/ dont want to watch lengthy tutorial videos to find out so I figured I would ask here and get a quick answer.</p><p>I dont know if this is the best way to do this, so I am open to any suggestions.</p><p>I need some custom data containers for my program, lets say I want an 'Achievement' class so I can have an array of them!</p><p>now in C# I would do something like </p><pre><code>public class Achievment  {    bool locked;    string achName;    string achSubName;    public Achievement(string name, string subname)    {        //ctor code goes here    }}</code></pre><p>Thats not everything I would need but thats the idea of the data layout I would like. However when I try to make a custom class in Eclipse it is all up in my grill about 'Public type achievement must be defined in its own file?' I'm writing this in the application's .java file... Is there somewhere else this should go? I am so confused. Basically java may as well be swahili to me... I like my intuitive c# layouts!</p><p>Like essentially I want to store my data separate from my UI, and when I generate an 'Achievement List' it looks at the current user's achievement array and populates from there. Good, bad?</p><p>Any answers that are not in the form of a redirect to a tutorial are much appreciated!</p>","369449","","369449","","2010-08-24 16:00:24","2010-08-24 16:38:23","Android Programming Question","<java><android><eclipse>","4","0","1","",""
"3558385","1","3558613","","2010-08-24 15:55:16","6","26379","<p>I have an application building against Android 2.1 and I want to override the back button.</p><p>I have followed the example here:</p><p><a href=""http://android-developers.blogspot.com/2009_12_01_archive.html"">http://android-developers.blogspot.com/2009_12_01_archive.html</a></p><p>And my code is as follows:</p><hr><pre><code>    @Override    public boolean onKeyDown(int keyCode, KeyEvent event)  {        if (Integer.parseInt(android.os.Build.VERSION.SDK) &lt; 5                &amp;&amp; keyCode == KeyEvent.KEYCODE_BACK                &amp;&amp; event.getRepeatCount() == 0) {            Log.d(""CDA"", ""onKeyDown Called"");            onBackPressed();        }        return true;    }    @Override    public void onBackPressed() {    Log.d(""CDA"", ""onBackPressed Called"");        Intent setIntent = new Intent(Intent.ACTION_MAIN);        setIntent.addCategory(Intent.CATEGORY_HOME);        setIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        startActivity(setIntent);         return;    }   </code></pre><hr><p>It works on pre 2.x devices but doesn't work on a Hero with 2.1 update-1 and a Nexus One with 2.2.</p><p>Is there somwthing I am missing from the example? Or can anyone point out why it isn't working?</p><p>I dont even get the button pressed in the logcat.</p>","243999","","","","","2012-06-18 19:14:39","Android - onBackPressed() not working","<android><override><back-button>","3","0","2","",""
"3558482","1","","","2010-08-24 16:05:12","0","1064","<p>Firstly, I am new to android development. My app has been working fine with a number of different activities up until today.</p><p>I have been trying to add a new <code>&lt;Button /&gt;</code> element to one of my layout xml files. However, if I give it a new id (e.g., <code>android:id=""@+id/button_unique""</code>) my app crashes on load, presumably as the resources are being loaded. If I change the id to an existing id (or remove <code>android:id</code> attribute completely) then the app loads fine.</p><p>The new resource id does appear in R.java. However, I can see a <code>No package identifier when getting value for resource number 0x7f060000</code> error in the logcat console. I'm not sure if this is related?</p><p>Perhaps i'm making a silly mistake somewhere, but if anybody could help me get to the bottom of this it would be much appreciated.</p><p>Thanks</p>","116220","","116220","","2010-08-25 09:29:56","2012-05-22 17:41:09","Android @+id in layout xml crashing app","<xml><android><layout><crash>","2","1","1","",""
"3558572","1","3558692","","2010-08-24 16:15:52","1","614","<p>From this article: <a href=""http://developer.android.com/guide/publishing/publishing.html#marketintent"" rel=""nofollow"">http://developer.android.com/guide/publishing/publishing.html#marketintent</a></p><p>Android Market could be invoked by an ACTION_VIEW intent with URI like </p><pre><code>http://market.android.com/details?id=&lt;packagename&gt; </code></pre><p>How does it work? Is the market.android.com return some info to browser to help it open the Android Market application? or just the browser locally does the trick?</p><p>Is it possible to set up an open URI who could do the same thing?</p><p>For example, I have an app called MyBooks(com.mybooks.app) and a site like:</p><pre><code>http://www.mybooks.com</code></pre><p>an url could be</p><pre><code>http://www.myboos.com/details?id=0001</code></pre><p>and when Browser opens this url, the site will return some kind of pre-defined response, which might contains an Intent action string, like ""com.myboos.app.action.VIEW"" and the queried id 0001.</p><p>Browser could then try to start an Activity using that action ""com.mybooks.app.action.View"", if there is an Activity for that, start it and pass the id in. If not, it tries to connect another URL like</p><pre><code>http://www.myboos.com/details?id=0001&amp;installed=false</code></pre><p>Is this possible to work on any version of the Android?</p>","234939","","","","","2010-08-24 16:31:46","Is it possible to set up an open URI for Android application?","<android>","2","0","","",""
"3558635","1","3558712","","2010-08-24 16:24:28","1","429","<p>So basically the title sounds way fancier than the actual question.</p><p>I am writing an application in which I would like to implement an achievement system. If I have all of my achievements created as instances of a generic class, how do I write a method to validate those achievements (i.e. determine if the user has met or exceeded goals) when the type of feat accomplished may vary, the number of conditions to be met may vary and the type of validation may vary?</p><p>For example:</p><p>Achievement - 10,000 points!<br>Type - point total<br>Value (X) - 10,000<br>Conditions - 1<br>Validation - greater than X  </p><p>vs.</p><p>Achievement - Ultra-frag<br>Type - kills<br>Value (X) - 10<br>Type - time<br>Value (Y) - 10 seconds<br>Conditions - 2<br>Validation - at least X in less than Y  </p><p>I am trying to avoid hardcoding a validation function for every achievement since they are mainly generic and the only difference is how they are validated.</p><p>Like the achievement class looks something like</p><pre><code>public class Achievement {    boolean locked;    String name;    String desc;    public Achievement(string n, string d)    {        //ctor code    }}</code></pre><p>I am trying to think of a way to do this without function pointers and I am failing miserably. Also, can you even use function pointers in java? Im new to the language :(</p>","369449","","","","","2010-08-24 16:40:18","What are some methods of dynamic validation for a generic class?","<java><android><eclipse><algorithm><achievements>","2","2","","",""
"3558807","1","","","2010-08-24 16:44:05","0","281","<p>ok i have an sql database (we'll call it DATABASE1) that receives inputs of names from the user and they can input as many as they want.. what i need to do now is hard code a database or spreadsheet or matrix or something (we will call it DATASET1) that DATABASE1 can work with.. however the thing is is that DATASET1 is comprised of names of groups and each group contains a group of people.. think of DATASET1 as something like this..</p><p>group 1   =   ""john""   ""jim    ""joe""   ""ryan""   ""luke""<BR>group 2   =   ""jim""    ""bob""   ""tim""<BR>group 3   =   ""blake""  ""john""  ""bill""  ""frank""<BR>...<BR>...<BR>...</p><p>so as you can see each group is a different set of names and there is no defined number for how many names are in each group.. now what i need to accomplish is that DATASET1 needs to work with DATABASE1 (which by the way will end up being very large.. it will start at 200 groups but will only continue to get bigger with updates.. probably in the thousands) and check for subsets.. my program needs to browse DATASET1 and take each group and see if it is a subset of DATABASE1 in the fastest/most efficient way possible.. anyone have any ideas about an approach?</p>","407775","","","","","2010-08-24 20:00:51","creating and working with a large 2 dimensional dataset in android","<android><database>","1","0","","",""
"3558934","1","","","2010-08-24 16:57:45","5","4538","<p>I am trying to apply a selector to a ListView to make it easy for those without touch screens to navigate my app. The thing is, by applying the selector to the ListView, it only seems to apply the background colors to the entire list, not the items inside of it.</p><p><strong>Any ideas? Here's some code:</strong></p><pre><code>    &lt;ListView   android:id=""@android:id/list""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:listSelector=""@drawable/listselector""   /&gt;   &lt;TextView android:id=""@android:id/empty""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""There are no Clients yet.""        /&gt;</code></pre><p><strong>listselector.xml in drawable folder:</strong></p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector    android:id=""@+id/myselector""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;!-- Non focused states --&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""false""        android:state_pressed=""false""        android:drawable=""@color/darkblue"" /&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""true""        android:state_pressed=""false""        android:drawable=""@color/green"" /&gt;    &lt;!-- Focused states --&gt;    &lt;item        android:state_focused=""true""        android:state_selected=""false""        android:state_pressed=""false""        android:drawable=""@color/green"" /&gt;    &lt;item        android:state_focused=""true""        android:state_selected=""true""        android:state_pressed=""false""        android:drawable=""@color/green"" /&gt;    &lt;!-- Pressed --&gt;    &lt;item        android:state_pressed=""true""        android:drawable=""@color/green"" /&gt;&lt;/selector&gt;</code></pre>","312390","","","","","2012-05-07 23:19:38","Android: Entire ListView changes color on focus, not just ListView child item","<android><xml>","1","2","2","",""
"3558977","1","","","2010-08-24 17:03:08","5","6225","<p>I have a Broadcast receiver setup so that a pop-up message is displayed to the user after each upgrade of my app, or if this is the first time the package is installed. I tested this on my Droid running Android 2.2 both as a fresh install and after upgrading my app, as well in the Emulator running 1.5 and 1.6, and I see everything run fine.</p><p>However, I received an error report from a user that lists the following exception:</p><pre><code>java.lang.RuntimeException: Unable to instantiate receiver com.name.pkg.FirstRunBroadcastReceiver: java.lang.ClassNotFoundException: com.name.pkg.app_name.FirstRunBroadcastReceiver in loader dalvik.system.PathClassLoader[/data/app/com.name.pkg.app_name.apk]at android.app.ActivityThread.handleReceiver(ActivityThread.java:2789)at android.app.ActivityThread.access$3200(ActivityThread.java:125)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4627)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.ClassNotFoundException: com.name.pkg.app_name.FirstRunBroadcastReceiver in loader dalvik.system.PathClassLoader[/data/app/com.name.pkg.app_name.apk]at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)at java.lang.ClassLoader.loadClass(ClassLoader.java:573)at java.lang.ClassLoader.loadClass(ClassLoader.java:532)at android.app.ActivityThread.handleReceiver(ActivityThread.java:2780)... 10 more</code></pre><p>Can someone tell me why one of my users received this exception?</p><p>In my Manifest file, I have things setup like this:</p><pre><code>&lt;receiver android:name="".FirstRunBroadcastReceiver""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.intent.action.PACKAGE_REPLACE""/&gt;        &lt;data android:scheme=""package"" android:path=""com.name.pkg.app_name""&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>The class FirstRunBroadcastReceiver is setup like this:</p><pre><code>package com.name.pkg.app_name;public class FirstRunBroadcastReceiver extends BroadcastReceiver{    @Override    public void onReceive(Contenxt context, Intent intent)    {        Uri uri = intent.getData();        if( uri.toString().compareTo(""package:com.name.pkg.app_name"") == 0 )        {            //set shared prefs data to determine if start-up message should be shown        }    }}</code></pre><p>Upon a first time install, the default value for the shared prefs is set so that the pop-up message will be displayed, but I wouldn't think that would have anything to do with this exception.</p><p>I tested it again, and I don't receive an exception. Thanks for any help you can provide.</p>","377507","","377507","","2010-08-24 20:04:33","2012-11-04 23:56:47","Android Broadcast Receiver Error: Class not found exception","<android><exception><broadcastreceiver>","2","2","3","",""
"3559053","1","3561626","","2010-08-24 17:13:07","1","1005","<p>I'm trying to implement a database in my application.  I'm following a tutorial about writing my own ContentProvider, but I'm confused about SQLiteOpenHelper::getType.  We're supposed to write it and, essentially, write a switch that returns the MIME type corresponding to the type of data we're dealing with.</p><p>I don't fully understand it.  I'm not sure, even though I have an example, what is precisely supposed to be conveyed here.  How do I determine the MIME type of my different tables of data?  Could someone give me a good explanation of this?</p><p><a href=""http://thinkandroid.wordpress.com/2010/01/13/writing-your-own-contentprovider/"" rel=""nofollow"">tutorial</a></p>","406790","","","","","2010-08-24 22:51:03","Could someone explain SQLiteOpenHelper getType","<android><database><android-contentprovider>","1","1","","",""
"3559171","1","3561563","","2010-08-24 17:25:15","0","1225","<p>I have an extended ImageView that I'm reusing 7 times horizontally (within a LinearLayout) across my screen.  Directly above and below this ImageView are other extended ImageViews that are within their own LinearLayouts.  I'm spacing these all evenly by using the weight property within the LinearLayout so they space evenly across the screen.  What I need to do is have this middle ImageView be able to float on top of either the top or bottom ImageViews to which it lines up with an animation.  Is there some sort of z-index I can put on elements so that I can float this middle IV above the others?</p><p>Snippet of my xml:</p><pre><code>&lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/opponentrow""&gt;    &lt;ImageView        android:id=""@+id/your1""        android:layout_width=""45px""        android:layout_height=""60px""        android:src=""@drawable/topimage""        android:layout_weight=""1"" /&gt;        ...&lt;/LinearLayout&gt;&lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:id=""@+id/tokenrow""&gt;    &lt;ImageView        android:id=""@+id/your1""        android:layout_width=""20px""        android:layout_height=""20px""        android:src=""@drawable/centerimage""        android:layout_weight=""1"" /&gt;        ...             &lt;/LinearLayout&gt;&lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;ImageView        android:id=""@+id/your1""        android:layout_width=""45px""        android:layout_height=""60px""        android:src=""@drawable/bottomimage""        android:layout_weight=""1"" /&gt;        ...&lt;/LinearLayout&gt;</code></pre><p>the ellipses just indicate that those imageviews are repeated 7 times each.  Also, they are not TRUE ImageViews as I said, they are extended.</p><p>here is a snippet for the imageview that's in the middle (one with centerimage as its source) that does the animation (this is within the .java file)</p><pre><code>    public Tokens(Context context) {        super(context);        // TODO Auto-generated constructor stub        setOnClickListener(myListener);    }    private OnClickListener myListener = new OnClickListener(){    public void onClick(View v) {        doAnimate();    }}; private void doAnimate(){    final Animation animUp = new TranslateAnimation(0,0,0,-22);    animUp.setDuration(200);    animUp.setFillAfter(true);    final Animation animDown = new TranslateAnimation(0,0,0,22);    animDown.setDuration(200);    animDown.setFillAfter(true);    if(avail)        startAnimation(animDown);}</code></pre><p>some important considerations: I need to retain the even horizontal spacing for the 7 elements (all 3 rows of them).  I'm open to using a different Layout type if my objectives can't be met with LinearLayout.</p><p>thanks for your time</p>","233971","","44390","","2012-06-15 16:48:51","2012-06-15 16:48:51","float animated ImageView on top of other elements within LinearLayout - android","<android><animation><layout><z-index><android-linearlayout>","1","0","","",""
"3559394","1","3559877","","2010-08-24 17:48:59","3","836","<p>So basically I would like my app to read info from a database, this info would be a string that is valid java code. Once read, I would like my app to execute this string as if it were code. Is there any functionality packaged with the android sdk that supports this?</p><p>Essentially I want the phone to populate some data with information queried from a database. One of these pieces of information would be a statement like:</p><pre><code>""return data.ZombieKillTotal &gt;= 100000;""</code></pre><p>Which would be used inside a statement like:</p><pre><code>registerAchievement(new Achievement(""Zombie Killer"", new AchievementValidator() {     public boolean isSatisfied(Data data) { ExecStringAsCode(query result) }     });</code></pre><p>I just don't know what to use for 'ExecStringAsCode' :(</p>","369449","","","","","2010-08-24 18:43:13","Can android execute string as code?","<java><android><eclipse><scripting>","3","5","","",""
"3559605","1","","","2010-08-24 18:12:19","0","178","<p>does anyone had success in POSTing from android emulator to GAE? I am trying and I am getting Unknown Host Exception.</p><p>Do I need to do some settings in emulator? Please help me. I am using HttpClient and HttpPost, and also set uses INTERNET permission.</p>","368999","","","","","2012-01-18 00:16:32","does anyone had success in posting from android emulator to GAE?","<android><google-app-engine>","1","0","1","",""
"3559750","1","3559806","","2010-08-24 18:28:03","0","231","<p>I am having a problem getting the ListView to display properly.  It currently looks like this with the following xml code:<br><img src=""http://i.stack.imgur.com/mcC9J.png"" alt=""alt text""></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:background=""@drawable/favs_main""&gt;    &lt;Button        android:text=""Return to Home""        android:id=""@+id/return_button""        android:layout_width=""150dp""         android:layout_height=""wrap_content""        android:layout_marginTop=""10dp""        android:layout_centerHorizontal=""true""        android:layout_alignParentBottom=""true""        android:textSize=""15sp""/&gt;    &lt;ListView        android:id=""@+id/favsListView""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_marginTop=""180dp""        android:layout_above=""@id/return_button""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>If you notice the list is down on the screen.  I want it to be just below the favorites text instead of just above the return to home button.  The catch however is that I always want the button to show and the list view to just occupy the space between the favorites text and the button.  The text is from the background image so I can't just align below that.  So even with 100 items I would still like to show the button.</p><p>Thanks for the help</p>","336861","","","","","2010-08-25 13:03:14","How to get UI to look right","<android><xml><gui>","5","0","1","",""
"3559979","1","5916660","","2010-08-24 18:53:43","2","2104","<p>When changing the custom locale the label of the phone types change to the appropriate language. Does anybody know how to get the localized label of the phone types? </p><p>I pick a contact in my app to get its phone number and if there is more then one number I use an AlertDialog to let the user select the currect one. In this pick list, I want to show the label of the type, so it's easier for the user to select. Since they labels are somewhere in the Android system, it must be possible to get the localized label. Unfortunately, the Phone.LABEL is null when reading the phone number.</p>","424478","","","","","2013-01-13 16:42:57","how to get the localized label of the phone types?","<android><numbers><types><phone><localized>","3","1","1","",""
"3560050","1","3560193","","2010-08-24 19:02:09","0","1909","<p>I created a ScrollView and want it to expand to the available space, without having to set a fixed height (i.e. ""250px"") for it.</p><p>As such, I created a RelativeLayout. The basic outline follows:</p><pre><code>&lt;RelativeLayout&gt;    &lt;LinearLayout         android:id=""@+id/x"" &gt;        &lt;TextView             android:text=""Title"" ... /&gt;    &lt;/LinearLayout&gt;    &lt;ScrollView         android:id=""@+id/y""        android:layout_below=""@id/x"" /&gt;    &lt;LinearLayout        android:layout_below=""@id/y""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:gravity=""center_horizontal|bottom"" &gt;        &lt;Button ...&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>The idea of the Layout is to have the Title on top, the Button in near the bottom of the screen and the ScrollView in between those two.</p><p>The problem is, I still have to use android_height in the definition of ScrollView, so its still fixed to that height.</p><p>How can I work around this?</p><p>Thanks.</p>","425749","","","","","2010-08-25 21:55:08","Defining a ScrollView without setting it's height","<android><scrollview><relativelayout>","1","0","","",""
"3560104","1","3560342","","2010-08-24 19:10:07","3","1971","<p>I'm trying to experiment with LED colors on my Nexus One and i'm having problems with creating any LED-light (color) with notification. LED-light isn't working. I have tested hardware malfunction and that isn't the problem. Here is the code.</p><pre><code>    Notification notification = new Notification(R.drawable.icon, tickerText, System.currentTimeMillis());    notification.ledARGB = Color.WHITE;    notification.ledOnMS = 300;    notification.ledOffMS = 1000;    notification.flags = Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_AUTO_CANCEL;    //notification.defaults = Notification.DEFAULT_ALL;    notification.setLatestEventInfo(this, getText(R.string.tekst1),                   text, makeIntent(R.drawable.icon));    notificationManager.notify(R.layout.main, notification);</code></pre><p>Can somebody tell me what am I doing wrong? Tnx.</p>","99821","","","","","2010-08-27 17:20:02","Notification LED - color","<java><android><notifications><nexus-one>","3","2","3","",""
"3560133","1","3580048","","2010-08-24 19:13:15","0","205","<p>i have a nexus one with firmware 2.2 = sdk 8</p><p>when i dont use:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""8"" /&gt;</code></pre><p>the app works just fine.But when I add this (and as my device is 2.2 = sdk 8, so it should be same)my imagepositions are wrong and the app totaly slow down ?</p><p>How do I set the minSDk right?</p><p>thxchris</p>","355372","","","","","2010-08-26 22:26:20","android min sdk bug?","<android>","2","0","","",""
"3560140","1","3560204","","2010-08-24 19:13:56","1","507","<p>I'm trying to find out if it is possible to modify the notification of another app (the calendar app from Samsung) from my own app. Specifically I'd like to change the alarm for a calendar event from a one-time sound (which is silent, if the phone is set to vibrate) to a repeating vibrate. </p><p>Can I even modify the notifications belonging to a differnt app?</p><p>If I can't, could my app get notified about all notifications and just rethrow my own, modified notifications?</p>","347857","","","","","2010-08-24 19:21:45","Modify notification of another app on Android","<android><mobile><notifications><vibrate>","1","1","","",""
"3560511","1","","","2010-08-24 19:55:49","6","2875","<p>I have a problem re. an Android application's resources:</p><p>My application has misc. modes (edit/plan/exec), which I would like to describe using an enumeration type. I would, however, like to populate the enumeration-values with strings that stem from the resource string.xml file, i.e. instead of </p><pre><code>enum Mode {    EDIT (""edit""),     PLAN (""plan""),     EXEC (""exec"");    String name;    Mode(String name) { this.name = name; }    @Override        public String toString() { return this.name; }};</code></pre><p>I would like to write something like:</p><pre><code>enum Mode {    EDIT (getResources().getText(R.string.mode_edit).toString()),    PLAN (getResources().getText(R.string.mode_plan).toString())),    EXEC (getResources().getText(R.string.mode_exec).toString()));    String name;    Mode(String name) { this.name = name; }    @Override        public String toString() { return this.name; }}</code></pre><p>which would e.g. allow to modify the modes' names using the resource file and thus allow for later name modifications without code changes, internationalization, etc.</p><p>The problem is, that the standard access to the resources is via an Activity's getResources()-method which is only available in the constructor (and during instance methods). The enumeration declaration, however, is part of a class' static initialization code. Is there any way to access an app's resources in a static way?</p><p>Michael</p>","423411","","","","","2010-08-26 08:24:20","Static access to an Android app's resources?","<android><android-widget>","2","0","2","",""
"3560808","1","3590747","","2010-08-24 20:36:54","0","732","<p>I'm trying to display contact information, and from another question on stackOverflow I've got the following snippet</p><pre><code>String[] projection = new String[] {        ContactsContract.Contacts.DISPLAY_NAME,        ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME,        ContactsContract.CommonDataKinds.Email.DISPLAY_NAME     };    Uri contacts =  ContactsContract.Contacts.CONTENT_LOOKUP_URI;    //id of the Contact to return.    long id = 3;    //Make the query.     Cursor managedCursor = managedQuery(contacts,                                        projection, // Which columns to return                                         null,       // Which rows to return (all rows)                // Selection arguments (with a given ID)                                        ContactsContract.Contacts._ID = ""id"",                 // Put the results in ascending order by name                                        ContactsContract.Contacts.DISPLAY_NAME + "" ASC"");</code></pre><p>It seems that the managedQuery has been changed in 2.2 (I belive the original question where I got this was referenced to 2.0)</p><p>What has changed in 2.2? I can't find a way of displaying emails, phone numbers etc for a contact</p><p>EDIT : This is all I can find from the android debugging logs</p><pre><code>08-24 20:49:51.893: ERROR/DatabaseUtils(519): Writing exception to parcel08-24 20:49:51.893: ERROR/DatabaseUtils(519): java.lang.IllegalArgumentException: URI: content://com.android.contacts/contacts/lookup, calling user: com.example.android.contactmanager, calling package:com.example.android.contactmanager08-24 20:49:51.893: ERROR/DatabaseUtils(519):     at com.android.providers.contacts.LegacyApiSupport.query(LegacyApiSupport.java:1911)08-24 20:49:51.893: ERROR/DatabaseUtils(519):     at com.android.providers.contacts.ContactsProvider2.query(ContactsProvider2.java:4697)08-24 20:49:51.893: ERROR/DatabaseUtils(519):     at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:150)08-24 20:49:51.893: ERROR/DatabaseUtils(519):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)08-24 20:49:51.893: ERROR/DatabaseUtils(519):     at android.os.Binder.execTransact(Binder.java:288)08-24 20:49:51.893: ERROR/DatabaseUtils(519):     at dalvik.system.NativeStart.run(Native Method)</code></pre>","155695","","155695","","2010-08-24 21:02:55","2010-08-28 12:29:19","Android; How does the manageQuery work in 2.2?","<android><contacts><android-2.2-froyo>","1","0","","",""
"3560864","1","","","2010-08-24 20:43:53","0","310","<p>Hello stackOverflow readers,</p><p>I am hoping that this is a simple setup issue, but here it goes:</p><ul><li>Eclipse 3.6.0  </li><li>AVD 2.2 and 1.5 (created both and tried with both) </li><li>XP Pro 2002 SP3</li></ul><p>I followed the tutorial at site <a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/hello-world.html</a> but my custom TextView control never rendered.</p><p>I set a few breakpoints in the <strong>public class HelloAndroid extends Activity</strong> method and these breakpoints are never tripped.  It is as if my <strong>android.process.acore</strong> is never run, based on the console output.</p><p>I am tempted to remove all and reinstall the packages, but I thought I would ask the web for a little guidance first.  </p><p>This is the output in the console window:</p><pre><code>[2010-08-24 12:05:08 - HelloAndroid2] Android Launch![2010-08-24 12:05:08 - HelloAndroid2] adb is running normally.[2010-08-24 12:05:08 - HelloAndroid2] Performing com.example.helloandroid2.HelloAndroid activity launch[2010-08-24 12:05:08 - HelloAndroid2] Automatic Target Mode: launching new emulator with compatible AVD 'My_avd_2_point_2'[2010-08-24 12:05:08 - HelloAndroid2] Launching a new emulator with Virtual Device 'My_avd_2_point_2'[2010-08-24 12:05:11 - HelloAndroid2] New emulator found: emulator-5554[2010-08-24 12:05:11 - HelloAndroid2] Waiting for HOME ('android.process.acore') to be launched...</code></pre><p>&lt; I then kill the Android simulator here ></p><pre><code>[2010-08-24 12:05:34 - HelloAndroid2] emulator-5554 disconnected! Cancelling 'com.example.helloandroid2.HelloAndroid activity launch'!</code></pre><p>Thanks in advance for helping me understand this issue.</p>","430012","","1108213","","2012-03-18 18:44:43","2012-03-18 18:44:43","HelloAndroid does not show my TextView control","<android>","2","1","","",""
"3560924","1","3560972","","2010-08-24 20:51:44","0","293","<p>What does this line from the following code sample mean? </p><pre><code>synchronized (_surfaceHolder) {    _panel.onDraw(c);}</code></pre><p>I can guess what it does, but what is it called and how does it works? Is it a nameless synchronized function?</p><pre><code>class TutorialThread extends Thread {    private SurfaceHolder _surfaceHolder;    private Panel _panel;    private boolean _run = false;    public TutorialThread(SurfaceHolder surfaceHolder, Panel panel) {        _surfaceHolder = surfaceHolder;        _panel = panel;    }    public void setRunning(boolean run) {        _run = run;    }    @Override    public void run() {        Canvas c;        while (_run) {            c = null;            try {                c = _surfaceHolder.lockCanvas(null);                synchronized (_surfaceHolder) {                    _panel.onDraw(c);                }            } finally {                // do this in a finally so that if an exception is thrown                // during the above, we don't leave the Surface in an                // inconsistent state                if (c != null) {                    _surfaceHolder.unlockCanvasAndPost(c);                }            }        }    }</code></pre>","426929","","688393","","2011-12-09 19:18:18","2011-12-09 19:18:18","what is this nameless function?","<android>","1","0","","",""
"3560963","1","3561028","","2010-08-24 20:56:17","50","23049","<p>OK, this should really be asked to someone from Google, but I just want other opinions.</p><p>Even Android supports Native code applications, the main development tool is Java. But why? I mean, isn't it too slow to interpret code on a mobile device? When introducing Froyo, Google said that new JIT compiler can achieve 2-5 times faster applications. This means, that using Java over native code is 2-x times slower.</p><p>Yes, I know that using managed code applications is safer in terms of system stability, since virtual machine has better control of program, but still, this performance drop is huge, and I don't see any point why to use it.</p>","307797","","321731","","2013-11-24 09:53:41","2013-11-24 09:53:41","Why does Android use Java?","<java><android>","9","11","13","2010-08-24 23:00:54",""
"3561205","1","","","2010-08-24 21:32:10","0","394","<p>My app is set in landscape only mode thanks to an attribute in my manifest file, but with froyo came universal rotation and a problem. It will force the screen to landscape but if the user is holding the phone upside down my app will appear upside down. Is there a way for me to set my app to only rotate when the user has their phone orientented in both landscape positions?</p>","385051","","","","","2010-08-26 12:36:16","froyo's universal rotation and my landscape only app","<android><design><rotation><manifest>","1","0","","",""
"3561356","1","3565153","","2010-08-24 21:55:01","1","1294","<p>I am new to Android development. Is there a quicker/better way to design the UI than to explicitly write it in XML? Perhaps an Eclipse plug-in to visually create UI?</p>","19875","","","","","2011-03-01 17:54:32","Best way to design Android UI?","<android>","4","0","1","2012-10-24 13:51:24",""
"3561360","1","","","2010-08-24 21:55:15","0","295","<p>I have created an application that displays XML data information on the top section of my Linear layout.  Below that I have a video that is streaming and takes a while to start playing.  How would I set a dialogue to display until the video appears?</p>","2186261","","","","","2010-08-24 22:18:37","Display a Dialog while video is streaming","<android>","1","0","","",""
"3561482","1","","","2010-08-24 22:19:59","1","150","<p>I have several audio files in the res/raw folder.When I run the following code I was assuming that just the ""sound1"" file would be played, instead all of the files in the folder get played one after another, not just ""sound1"".</p><pre><code>  MediaPlayer mp = MediaPlayer.create(this, R.raw.sound1);  try {    mp.start();  } catch (IllegalArgumentException e) {    e.printStackTrace();  } catch (IllegalStateException e) {    e.printStackTrace();  }</code></pre><p>What am I missing?Thanks for any help!</p>","378458","","","","","2011-03-25 18:27:57","Android Audio Question","<android>","2","2","0","",""
"3561529","1","3561598","","2010-08-24 22:29:08","0","823","<p>I would like to provide the appearance of DB for my web service without storing it into the DB as a cache or middleware.</p>","157804","","","","","2010-08-24 22:45:10","Can one use the Android ContentProvider to serve up an http response (non DB)?","<android><http><response><android-contentprovider>","1","0","","",""
"3561588","1","3561859","","2010-08-24 22:43:22","1","879","<p>I'm developing an Activity that does some of its own state management.  I'm trying to differentiate the following onResume cases:</p><ol><li>New launch</li><li>task switch (home button long-click)</li><li>resume after other activity in the same application</li><li>wake-up after sleep</li><li>orientation change</li></ol><p>Is there something in the Activity's intent, or elsewhere, that can help me differentiate these?</p><p>For the curious and some context... I'd like to preserve my internal history stack on 4 &amp; 5.  On cases 2 &amp; 3, I would preserve the same current page, but erase the history (allow the normal back button functionality to take over at that point).  Case 1 would initialize to the activity's internal start page (and can be detected easily enough with some help from onCreate).</p>","152543","","152543","","2011-04-02 17:21:04","2011-04-02 17:21:04","In Android, how can I detect why my activity was resumed?","<android><android-intent><android-lifecycle>","1","2","","",""
"3561736","1","3561995","","2010-08-24 23:13:10","1","2226","<p>I've put a little app together that has three tabs to show three different web pages. It does work however I am bit worried I haven't got enough control over how this whole thing works. When I click a tab, I get a web page loaded (see code sample below), now when I click another tab another page loads in another view. When I go back to the first tab, the whole thing get initilized again and the page loads. Is there a way how I can control this and keep the underneeth tab's activity in its current state as long as I want (and say only ""refresh"" the page when it changes).</p><p>do I need to handle onPause()/onResume() methods for that or instead implement my tabs as views of a single activity (is this possible at all?)? How do I store the state of my activity to avoid re-initializing it every time?</p><p>this how activities are hooked to tabs:</p><pre><code>intent = new Intent().setClass(this, tab_schedule.class);  spec = tabHost.newTabSpec(""Schedule"").setIndicator(""Schedule"",    res.getDrawable(R.drawable.tab_icon_schedule)).setContent(    intent);  tabHost.addTab(spec);</code></pre><p>the tab_schedule.class does a simple web page load:</p><pre><code>@Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.tab_people);  try {   WebView currentView = (WebView) findViewById(R.id.tab_people_WebView);   currentView.getSettings().setJavaScriptEnabled(true);   currentView.loadUrl(""http://pda.lenta.ru"");  } catch (Exception e) {   Log.v(""webClientInit"", e.getMessage());  } }</code></pre>","220255","","234039","","2010-08-25 00:11:04","2010-12-19 08:55:10","Android tabs - avoid recreating activities on tab clicks","<android><view><activity><tabs>","2","0","2","",""
"3561958","1","3562118","","2010-08-25 00:10:42","1","1421","<p>Does anyone know how to get the android device system log programatically using Java? This would be something similar to what is available on lower panel on the Dalvik Debug Monitor.</p><p>Thanks in advance.</p>","422299","","","","","2010-08-25 00:52:24","How to get android system log from a Java program","<java><android><logging>","2","1","","",""
"3562201","1","3562218","","2010-08-25 01:17:12","3","1476","<p>I have a SQLiteDatabase data member that I initialize in onCreate and call .close() on in onPause(), onStop(), and onDestroy(). It is re-initialized in onResume(). It seems to run just fine but when I looked at the debugger it see this:</p><pre><code>08-24 20:23:50.014: ERROR/Database(6767): Leak found08-24 20:23:50.014: ERROR/Database(6767): java.lang.IllegalStateException: /data/data/com.hh.Timepunch/databases/times_database.db SQLiteDatabase created and never closed08-24 20:23:50.014: ERROR/Database(6767):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1695)08-24 20:23:50.014: ERROR/Database(6767):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:739)08-24 20:23:50.014: ERROR/Database(6767):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:761)08-24 20:23:50.014: ERROR/Database(6767):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:754)08-24 20:23:50.014: ERROR/Database(6767):     at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:476)08-24 20:23:50.014: ERROR/Database(6767):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)08-24 20:23:50.014: ERROR/Database(6767):     at com.hh.Timepunch.TimeSheetActivity.onCreate(TimeSheetActivity.java:72)08-24 20:23:50.014: ERROR/Database(6767):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-24 20:23:50.014: ERROR/Database(6767):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)08-24 20:23:50.014: ERROR/Database(6767):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)08-24 20:23:50.014: ERROR/Database(6767):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)08-24 20:23:50.014: ERROR/Database(6767):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)08-24 20:23:50.014: ERROR/Database(6767):     at android.os.Handler.dispatchMessage(Handler.java:99)08-24 20:23:50.014: ERROR/Database(6767):     at android.os.Looper.loop(Looper.java:123)08-24 20:23:50.014: ERROR/Database(6767):     at android.app.ActivityThread.main(ActivityThread.java:4363)08-24 20:23:50.014: ERROR/Database(6767):     at java.lang.reflect.Method.invokeNative(Native Method)08-24 20:23:50.014: ERROR/Database(6767):     at java.lang.reflect.Method.invoke(Method.java:521)08-24 20:23:50.014: ERROR/Database(6767):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-24 20:23:50.014: ERROR/Database(6767):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-24 20:23:50.014: ERROR/Database(6767):     at dalvik.system.NativeStart.main(Native Method)08-24 20:23:50.054: ERROR/Database(6767): Leak found08-24 20:23:50.054: ERROR/Database(6767): java.lang.IllegalStateException: /data/data/com.hh.Timepunch/databases/times_database.db SQLiteDatabase created and never closed08-24 20:23:50.054: ERROR/Database(6767):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1695)08-24 20:23:50.054: ERROR/Database(6767):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:739)08-24 20:23:50.054: ERROR/Database(6767):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:761)08-24 20:23:50.054: ERROR/Database(6767):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:754)08-24 20:23:50.054: ERROR/Database(6767):     at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:476)08-24 20:23:50.054: ERROR/Database(6767):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)08-24 20:23:50.054: ERROR/Database(6767):     at com.hh.Timepunch.TimepunchActivity.onCreate(TimepunchActivity.java:60)08-24 20:23:50.054: ERROR/Database(6767):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-24 20:23:50.054: ERROR/Database(6767):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)08-24 20:23:50.054: ERROR/Database(6767):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)08-24 20:23:50.054: ERROR/Database(6767):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)08-24 20:23:50.054: ERROR/Database(6767):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)08-24 20:23:50.054: ERROR/Database(6767):     at android.os.Handler.dispatchMessage(Handler.java:99)08-24 20:23:50.054: ERROR/Database(6767):     at android.os.Looper.loop(Looper.java:123)08-24 20:23:50.054: ERROR/Database(6767):     at android.app.ActivityThread.main(ActivityThread.java:4363)08-24 20:23:50.054: ERROR/Database(6767):     at java.lang.reflect.Method.invokeNative(Native Method)08-24 20:23:50.054: ERROR/Database(6767):     at java.lang.reflect.Method.invoke(Method.java:521)08-24 20:23:50.054: ERROR/Database(6767):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-24 20:23:50.054: ERROR/Database(6767):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-24 20:23:50.054: ERROR/Database(6767):     at dalvik.system.NativeStart.main(Native Method)08-24 20:23:50.199: ERROR/libs3c2drender(1912): int S3c2DRender::DoG2D(unsigned int, s3c_img*, s3c_rect*, unsigned int, s3c_img*, s3c_rect*, int, int)::S3C_G2D_ROTATOR_18176 fail</code></pre><p>One of the places I get this error is when going away from this activity:</p><pre><code>public class TimepunchActivity extends Activity {        Calendar timeNow = Calendar.getInstance();        SQLiteDatabase timesDatabase;        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.timepunch);            //Create/open and configure database (if necessary)            timesDatabase = openOrCreateDatabase(                    ""times_database.db"",                    SQLiteDatabase.CREATE_IF_NECESSARY,                    null);            timesDatabase.setLocale(Locale.getDefault());            timesDatabase.setLockingEnabled(false);            timesDatabase.setVersion(3);            //lenient is set to true so incrementing minute 59 auto increments hour, etc            timeNow.setLenient(true);            //Create table (if necessary)            final String dbCommand = ""CREATE TABLE IF NOT EXISTS Timepunches (punch INTEGER PRIMARY KEY);"";            timesDatabase.execSQL(dbCommand);            updateLastInPunch();            Button punchButton = (Button)findViewById(R.id.punch_button);            punchButton.setHapticFeedbackEnabled(true);            punchButton.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    //Insert data                    ContentValues punchValue = new ContentValues();                    punchValue.put(""punch"", timeNow.getTimeInMillis());                    long newPunchID = timesDatabase.insert(""Timepunches"", null, punchValue);                    punchValue.clear();                    //if punch already exists                    if (newPunchID &lt; 0) {                        AlertDialog.Builder builder = new AlertDialog.Builder(TimepunchActivity.this);                        builder.setTitle(""Whoops"")                            .setMessage(""I've already recorded a punch for this time and day."")                            .setCancelable(true)                            .setNeutralButton(""Oh"", new DialogInterface.OnClickListener() {                                public void onClick(DialogInterface dialog, int id) {                                    dialog.cancel();                                }                            })                            .show();                    }                    else {                    }                } //end setOnClick()            }); //end click listener for punchButton        } //end onCreate()        @Override        public void onResume() {            super.onResume();            checkFirstTimer();            //Open and configure database            timesDatabase = openOrCreateDatabase(                    ""times_database.db"",                    SQLiteDatabase.CREATE_IF_NECESSARY,                    null);            timesDatabase.setLocale(Locale.getDefault());            timesDatabase.setLockingEnabled(false);            timesDatabase.setVersion(3);            //Update date object for current time            timeNow.setTimeInMillis(System.currentTimeMillis());            timeNow.set(Calendar.SECOND, 0);            timeNow.set(Calendar.MILLISECOND, 0);            updateClock((TextView)findViewById(R.id.current_time_textbox), timeNow);            updateLastInPunch();        } //end onResume()        @Override        public void onPause() {            super.onPause();            timesDatabase.close();        } //end onResume()        @Override        public void onStop() {            super.onStop();            timesDatabase.close();        } //end onResume()        @Override        public void onDestroy() {            super.onDestroy();            timesDatabase.close();        } //end onResume()        //Shows last in-punch that has no out-punch        // if there is none it hides the section        public void updateLastInPunch() {            Cursor punchCursor = timesDatabase.query(""Timepunches"", null, null, null, null, null, ""punch ASC;"");            TextView inPunchLabel = (TextView)findViewById(R.id.in_punch_label_textview);            TextView inPunchTV = (TextView)findViewById(R.id.in_punch_time_textview);            //odd count means there is a missing punch (assumed to be latest in punch)            // therefore show last in punch            if ((punchCursor.getCount()%2) != 0) {                punchCursor.moveToLast();                Calendar lastIn = Calendar.getInstance();                lastIn.setTimeInMillis(punchCursor.getLong(0));                updateClock((TextView)findViewById(R.id.in_punch_time_textview), lastIn);                inPunchLabel.setVisibility(View.VISIBLE);                inPunchLabel.setAnimation(fadeInAnimation);                inPunchLabel.startAnimation(fadeInAnimation);                inPunchTV.setVisibility(View.VISIBLE);                inPunchTV.setAnimation(fadeInAnimation);                inPunchTV.startAnimation(fadeInAnimation);            }            else {                //only fade when ""turning off"" last punch display                // (don't fade away when returning to screen)                if (inPunchLabel.getVisibility() == View.VISIBLE) {                    inPunchLabel.setAnimation(fadeOutAnimation);                    inPunchLabel.startAnimation(fadeOutAnimation);                    inPunchLabel.setVisibility(View.INVISIBLE);                    inPunchTV.setAnimation(fadeOutAnimation);                    inPunchTV.startAnimation(fadeOutAnimation);                    inPunchTV.setVisibility(View.INVISIBLE);                }            }            punchCursor.close();        } //end getLastInPunch()    } //end TimepunchActivity</code></pre><p>The odd thing is, though, is that this error isn't persistent.</p><p>Do I have to do more then call .close()?</p>","402682","","","","","2010-08-25 01:31:30","Android thinks I'm not closing my database! Why?","<java><android><database><sqlite>","2","1","0","",""
"3562213","1","3572200","","2010-08-25 01:21:50","1","3740","<p>This is a follow up question of <a href=""http://stackoverflow.com/questions/3550593/sending-html-commands-over-httpclient-android"">http://stackoverflow.com/questions/3550593/sending-html-commands-over-httpclient-android</a> , I have successfully POSTed to the server and recieved 200 code but when I attempt to move to another page it does not recognize that I have logged in. I am wondering if it is a session issue or if i need to follow the redirect after the POST. How would I go about following a redirect? Again any help is greatly appreciated. Here is a simple HttpClient / POST app I created from examples in order to help me quickly test any changes.</p><pre><code>public class HttpClientTest extends Activity{HttpClient client = new DefaultHttpClient();@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final Button btnFetch = (Button)findViewById(R.id.button);    final TextView txtResult = (TextView)findViewById(R.id.content);    final Button login = (Button)findViewById(R.id.button2);    btnFetch.setOnClickListener(new Button.OnClickListener(){        public void onClick(View v){            getRequest(txtResult);        }    });    login.setOnClickListener(new Button.OnClickListener(){        public void onClick(View v){            try {                login(txtResult);            } catch (UnsupportedEncodingException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }    });}public void getRequest(TextView txtResult){    HttpGet request = new HttpGet(""http://gc.gamestotal.com/i.cfm?f=com_empire&amp;cm=3"");    try{        HttpResponse response = client.execute(request);        txtResult.setText(Parser.request(response));    }catch(Exception ex){        txtResult.setText(""Failed!"");    }}public void login(TextView txtResult) throws UnsupportedEncodingException, IOException{    String action = ""i.cfm?&amp;1028&amp;p=login&amp;se=4"";    String yourServer = ""http://gc.gamestotal.com/"";    HttpPost post = new HttpPost(yourServer + action);    List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();    params.add(new BasicNameValuePair(""nic"", ""user""));    params.add(new BasicNameValuePair(""password"", ""password""));    params.add(new BasicNameValuePair(""server"", ""4""));    UrlEncodedFormEntity entity = new UrlEncodedFormEntity(params, ""UTF-8"");    post.setEntity(entity);    try{        HttpResponse response = client.execute(post);        txtResult.setText(response.getEntity().toString());    }catch(Exception ex){        txtResult.setText(""Failed!"");    }}</code></pre><p>}</p><p>I first press the login button on the UI which gives me the Http/1.1 200 OK response code, but when I press the btnFetch button which sends me to a page in which you must but logged in to access, I get the not logged in page. Any ideas?</p>","423519","","","","","2012-03-02 11:40:35","HttpClient Post session issue? How do I know if session has been created?","<android><post><httpclient>","2","4","2","",""
"3562319","1","","","2010-08-25 01:55:41","1","1286","<p>I have a ListView that can have one or more clickable items. When I apply a rotate animation the coordinates that are clicked correspond to the original position of the ListView items. For example a list with one item in portrait mode rotated 180 degrees will have the item upside down on the bottom of the screen, but the item gets the click event when I click the top of the screen. 180 degrees is just an example I want to be able to move an arbitrary angle. I've looked through all the listView properties but none seem to have any effect on the clickable coordinates. I would assume willChangeTransformationMatrix would do the trick but it doesn't, neither does invalidate or invalidateViews. Is there a property I'm overlooking or how would I go about moving the coordinates to the right place?</p><p>Thanks</p><p>sample code- list items highlight correctly when clicked, rotate with dpad_center, after rotated items highlight when original position is clicked. I've tried animating the animation, animationSet, and layoutAnimationController all same result.</p><pre><code>public class ToDoList extends Activity {    ListView myListView;  /** Called when the activity is first created. */  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    final ListView myListView = new ListView(this);    final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();    todoItems.add(0, ""asdf"");    todoItems.add(0, ""1234"");    // Create the array adapter to bind the array to the listview    final ArrayAdapter&lt;String&gt; aa;    aa = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,todoItems);    // Bind the array adapter to the listview.    myListView.setAdapter(aa);    setContentView(myListView);    myListView.setOnKeyListener(new OnKeyListener() {        public boolean onKey(View v, int keyCode, KeyEvent event) {          if (event.getAction() == KeyEvent.ACTION_DOWN)            if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER)            {              aa.notifyDataSetChanged();              //myEditText.setText("""");              RotateAnimation  ranim = new RotateAnimation(0f, 180f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);              ranim.setDuration(1000);                ranim.setFillAfter(true);              ranim.willChangeBounds();              ranim.willChangeTransformationMatrix();              ranim.setInterpolator(new LinearInterpolator());              myListView.startAnimation(ranim);              AnimationSet set = new AnimationSet(true);              set.addAnimation(ranim);              set.willChangeTransformationMatrix();              set.setInterpolator(new LinearInterpolator());              //set.setFillAfter(true);              //set.setFillEnabled(true);              LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);              controller.setInterpolator(new LinearInterpolator());              myListView.setLayoutAnimation(controller);              return true;            }          return false;        }      });  }}</code></pre>","430189","","227466","","2011-02-27 09:36:18","2012-07-10 07:41:11","Android-Clicking a Rotated ListView gives wrong coordinates","<android><animation>","2","0","","",""
"3562585","1","3562642","","2010-08-25 03:02:13","1","267","<p>I am downloading a text-file from example.com/test.txt and I need the contents only during the runtime of my app, they don't need to be saved to a static file.</p><p>My code so far:</p><pre><code>            InputStream input = new BufferedInputStream(getURL.openStream());            OutputStream output = new FileOutputStream(tempFile);            byte data[] = new byte[1024];            long total = 0;            while ((count = input.read(data)) != -1) {                output.write(data, 0, count);            }            output.flush();            output.close();            input.close();</code></pre><p>How would I go about writing the online-file contents to a String rather than saving the file locally? I have tried appending <code>data</code> to a String in the while-statement, but just get garbled text (as expected, but I don't know what else to do). Convert <code>byte</code> back to String?</p><p>Thanks for your help! </p>","241189","","","","","2010-08-25 03:34:30","Cache online-file contents in String rather than local file","<android>","2","0","","",""
"3562748","1","5698866","","2010-08-25 03:53:49","3","302","<p>Android Market links go to 404 on non Android browsers. When will Google fix this?</p><p>It's really annoying having to check the user-agent and displaying something else for non Android browsers.</p>","338981","","","","","2011-04-18 05:29:32","Android Market links on non Android browsers","<android><http-status-code-404><links><marketplace>","1","3","","",""
"3562947","1","6187853","","2010-08-25 04:55:53","2","735","<p>please help me. i need a code that will tweet using oauth + twitter api...</p><p><a href=""http://www.youtube.com/watch?v=25o0b2aEw0E"" rel=""nofollow"">http://www.youtube.com/watch?v=25o0b2aEw0E</a></p><p>i have used this project and i m getting error </p><p>08-25 11:47:32.747: WARN/System.err(2029): org.apache.http.client.HttpResponseException: Unauthorized08-25 11:47:32.747: WARN/System.err(2029):     at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:71)08-25 11:47:32.747: WARN/System.err(2029):     at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:59)08-25 11:47:32.756: WARN/System.err(2029):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657)08-25 11:47:32.756: WARN/System.err(2029):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:627)08-25 11:47:32.756: WARN/System.err(2029):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:616)08-25 11:47:32.756: WARN/System.err(2029):     at com.test.twitter.BLOA$PostTask.doInBackground(BLOA.java:336)08-25 11:47:32.756: WARN/System.err(2029):     at com.test.twitter.BLOA$PostTask.doInBackground(BLOA.java:1)08-25 11:47:32.756: WARN/System.err(2029):     at android.os.AsyncTask$2.call(AsyncTask.java:185)08-25 11:47:32.756: WARN/System.err(2029):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)08-25 11:47:32.756: WARN/System.err(2029):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)08-25 11:47:32.756: WARN/System.err(2029):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)08-25 11:47:32.756: WARN/System.err(2029):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)08-25 11:47:32.756: WARN/System.err(2029):     at java.lang.Thread.run(Thread.java:1060)</p><p>and i want to solve that error while i m posting tweet.. pls helpthanks and regards... </p>","411893","","411893","","2010-08-25 06:54:52","2011-05-31 12:52:41","i am getting httpresponse exception : unauthorised for the twitter application + oauth.. how to solve it?","<android><twitter><oauth>","1","2","3","",""
"3562952","1","","","2010-08-25 04:57:19","2","1511","<p>I am new to android,I try to make translate animation..</p><p>this is my xml code: (<strong>rail.xml</strong>)</p><pre><code>&lt;translate xmlns:android=""http://schemas.android.com/apk/res/android"" android:fromXDelta=""100%p"" android:toXDelta=""0"" android:duration=""4000"" /&gt;</code></pre><p>and this is my java code:</p><pre><code>final Animation animShow = AnimationUtils.loadAnimation( this, R.anim.rail);for(int i = 1; i &lt; 5; i++ ){    animShow.setRepeatCount(i);    textTV.setText(""Hello Android!!"");    textTV.startAnimation(animShow);}</code></pre><p>I want to ask, how do I change the text of each animation repeat??please help and thanks a lot...</p>","430280","","","","","2012-10-05 12:13:17","Translate Animation Problem","<android><text><animation><translate>","1","0","","",""
"3562953","1","","","2010-08-25 04:57:24","4","655","<p>I am learning Android development, specifically to eventually do OpengL 2.0 ES on it.  </p><p>So far I have read that the NDK supports Opengl 2.0 ES.  </p><p>However, is there also a Java API for it?  </p><p>If there is a Java API for it, which one is recommended?  I know both C++ and Java, so it is not a big deal if I have to use the NDK, but I would prefer to work only in Java if possible and without a big performance hit.</p>","430277","","","","","2012-02-03 08:06:45","OpenGL ES 2.0 possible without NDK?","<android><opengl-es>","2","0","1","",""
"3563085","1","3563835","","2010-08-25 05:31:50","0","1605","<p>I'd like to launch a video capture Intent that calls me back with some kind of result.  So far it correctly launches the G1's default Camcorder app, but when I finish recording the video in Camcorder, it just sits there (still in the Camcorder app) instead of calling my onActivityResult() method. </p><p>Is this just a shortcoming of Camcorder, or is there a special flag or extra I can set to tell it to return control when it's done recording?  Ideally it would pass me back a handle to the video - a URI, an InputStream, a file path.</p><p>The code:</p><pre><code>protected void launchRecordVideoActivity() {    Intent intent = new Intent (android.provider.MediaStore.ACTION_VIDEO_CAPTURE);startActivityForResult (intent, RequestCodes.RECORD_VIDEO);}</code></pre><p>RequestCodes is my own interface containing int constants.</p><pre><code>public void onActivityResult (int requestCode, int resultCode, Intent intent) {    ...}</code></pre><p>The contents of onActivityResult don't matter because my app is never called back at all.onActivityResult is not being called.</p><p>Any suggestions?  I can also bake the video recording directly into the app, but I'd prefer not to.</p>","340733","","340733","","2010-08-25 05:39:03","2010-11-22 10:52:51","startActivityForResult(android.provider.MediaStore.ACTION_VIDEO_CAPTURE) never returns result","<android><video-capture><android-intent>","2","1","","",""
"3563224","1","3563372","","2010-08-25 06:03:39","1","261","<pre><code>    b = this.getIntent().getExtras();    s = this.getIntent().getStringExtra(""DEFAULTTEXT"");    public void onClick(View v)         {            String a = ""http://152.226.152.156:1010/jsp-examples/test1"";             URL url = null;                HttpURLConnection httpurlconnection = null;                try {                 url = new URL(a);                 httpurlconnection = (HttpURLConnection) url                   .openConnection();                 httpurlconnection.setDoOutput(true);                 httpurlconnection.setRequestMethod(""POST"");                 Toast.makeText(Booking.this, a, Toast.LENGTH_SHORT).show();                 Toast.makeText(Booking.this, ""Toast1"", Toast.LENGTH_SHORT).show();                 ObjectOutputStream dos = new ObjectOutputStream(httpurlconnection.getOutputStream());                 SendVEctor.add(txtArrivalTime.getText().toString());                 SendVEctor.add(txtFerry.getText().toString());                 SendVEctor.add(txtStatus.getText().toString());                 SendVEctor.add(txtDestination.getText().toString());                 SendVEctor.add(s.toString());                    dos.writeObject(SendVEctor);                     dos.close();</code></pre><p>s would be my intent and how would i put it into my SendVEctor?</p><p>Thank you.</p>","358218","","358218","","2010-08-25 06:14:57","2010-08-25 06:34:43","How would i call a intent and put it into my vector?","<java><android><string><vector>","2","0","","",""
"3563269","1","3699651","","2010-08-25 06:13:53","4","3213","<p>I'm trying to create a transparent (no button background) ImageButton that has a custom selector. I have the selector working against the button but I now want the selector drawables to cross-fade into each other.I saw the TransitionDrawable object that can be represented in XML. Is there a way to connect this into my selector?</p><p>Below is the XML layout code to create the image button on the screen in the lower left corner of the screen. It currently goes from one image to the next abruptly ignoring the transition XML.</p><p><strong>selector_button.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true"" android:drawable=""@drawable/transition_normal_to_pressed"" /&gt; &lt;!-- pressed --&gt;    &lt;item android:state_focused=""true"" android:drawable=""@drawable/transition_pressed_to_normal"" /&gt; &lt;!-- focused --&gt;    &lt;item android:drawable=""@drawable/menu_normal"" /&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p><strong>transition_normal_to_pressed.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;transition xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:drawable=""@drawable/menu_pressed"" /&gt;    &lt;item android:drawable=""@drawable/menu_normal"" /&gt;&lt;/transition&gt;</code></pre><p><strong>activity.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ImageButton        android:id=""@+id/btnMenu""        android:background=""@android:color/transparent""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/selector_button""        android:layout_alignParentLeft=""true""        android:layout_alignParentBottom=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","42005","","","","","2013-03-25 08:35:13","ImageButton using Transitions in Android","<android><imagebutton><transitions>","2","0","2","",""
"3563365","1","","","2010-08-25 06:33:12","1","1555","<p>I need to apply custom font in to MenuItem. Is it possible to apply custom font in to MenuItem? </p><p>I'm relay appreciate you any comment. </p><p><br>Chandana</p>","377438","","","","","2010-08-25 06:39:18","Android Menuitem Font change","<android>","0","1","","",""
"3563482","1","","","2010-08-25 06:56:12","0","759","<p>In my application, I'm creating dynamic tabs.Inside framelayout I've created a edittext.For each tab i create content of tab will be edittext. When i type in editext of one tab and later if i create a new tab  and when I switch between these tabs, it shows the content of editext as empty.</p><h3>Update:</h3><p>I don't want to create a separate activity for each tab.I'l explain along with the code.</p><pre><code>public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final TabHost tabs = (TabHost)this.findViewById(R.id.tabs);      tabs.setup();        TabHost.TabSpec spec1=tabs.newTabSpec(f);   spec1.setContent(R.id.content1);   spec1.setIndicator(f);tabs.addTab(spec1);tabs.setCurrentTab(i);list.add(spec1);  i++;    Addbtn.setOnClickListener(new OnClickListener(){    @Override   public void onClick(View arg0)   {          final TabHost tabs = (TabHost)this.findViewById(R.id.tabs);      tabs.setup();          TabHost.TabSpec spec1=tabs.newTabSpec(f);     spec1.setContent(R.id.content1);     spec1.setIndicator(f);    tabs.addTab(spec1);    tabs.setCurrentTab(i);    list.add(spec1);      i++;    });</code></pre><p>Default one tab will be there. here content of tab is edittext. When i click on button new tab will be created. problem is with the content of tab. In default tab if i type in edittext, and create a new tab and switch to the default tab the content of default would be lost. </p>","428231","","1288","","2011-03-24 01:39:31","2011-03-24 01:39:31","Edittext and Tab Issue","<android>","2","0","","",""
"3563593","1","","","2010-08-25 07:13:03","6","9181","<p>I have just downloaded the facebook SDK from <a href=""http://github.com/facebook/facebook-android-sdk"">http://github.com/facebook/facebook-android-sdk</a>I unpack it from git and opened Eclipse. I then created a new project using existing source and selected the facebook directory. So the sdk project came up correctly (i think). Then I created a new project again using existing source and selected the ""Simple"" example.Its came up with errors. I went in the properties and selected Build Path section and added the facebook SDK project and applyed. All the errors disappear.I then tried to run the Example but im getting an exception on the first call to facebook SDK function ! Exception is NoClassDefFoundError. Its seems that at runtime it cannot find the class of the SDK. How come ? Any suggestions ? Someone did sucessfully run this example ? Any help would be greatly appreciated.</p>","429222","","","","","2013-12-12 09:26:46","Android facebook SDK doing error java.lang.NoClassDefFoundError?","<android><facebook><noclassdeffounderror>","8","1","3","",""
"3563622","1","3569419","","2010-08-25 07:17:06","1","670","<p>I'm attempting to develop an application that scapes html of a site for relevant data and then display it back to the user in a more UI friendly way. I'm assuming that you can start a webView by</p><pre><code>mWebView = (WebView) findViewById(R.id.webview);</code></pre><p>but never setting the content to the actual view. So now my question is, can I take the html from the webview, scrape it, then somehow have the webview post back the forms, all while staying in the background? Any help is appreciated.</p><p>Or does anyone know of source such as htmlunit that will compile within android?</p>","423519","","","","","2010-08-25 19:16:18","Can I start a webview out of view, scrape the html, and post forms through it?","<html><android><webview>","1","0","","",""
"3563676","1","","","2010-08-25 07:24:38","0","526","<p>I have Tow Activities A and B. when i Switch between A to B i need animation for Activity B.When i pressesd back button in activity B the Activity B exit with Animation.</p><p>Please Answer to this question.</p><p>Hope your Qucik Response.</p>","454665","","","","","2011-04-01 16:58:27","Android Activity change","<android>","2","1","","",""
"3563693","1","3707716","","2010-08-25 07:26:31","0","1752","<p>I've been trying to make a simple live wallpaper out of a boot animation. So basically i have about 50 .pngs in my drawable folder. I'm able to set the animation to about 10-20 frames and it works great. But once i set it to about 30 frames...I get an OutOfMemory Error. I was hoping maybe someone could take a look at my code and maybe give an example of how I could achieve more frames? That would help so much i've been looking at this for hours > &lt;</p><p>Here's my code:</p><pre><code>package com.androidnetwork.animlivewp;import android.content.res.Resources;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Matrix;import android.graphics.Paint;import android.os.Handler;import android.os.SystemClock;import android.service.wallpaper.WallpaperService;import android.util.Log;import android.view.MotionEvent;import android.view.SurfaceHolder;public class AnimatedLiveWallpaper extends WallpaperService {    private final Handler mHandler = new Handler();    @Override    public void onCreate() {        super.onCreate();    }    @Override    public void onDestroy() {        super.onDestroy();    }    @Override    public Engine onCreateEngine() {        return new CubeEngine();    }    class CubeEngine extends Engine {        private final Paint mPaint = new Paint();        private float mPosY;        private boolean mAnime = true;        private Matrix mMatrix = new Matrix();        private final Runnable mDrawAnim = new Runnable() {            public void run() {                drawFrame();            }        };        private boolean mVisible;        private static final int NUM_RES = 30;        private final Bitmap[] mPics = new Bitmap[NUM_RES];        CubeEngine() {            Resources res = getResources();            for (int i = 0; i&lt; NUM_RES; i++) {                int id = res.getIdentifier(""boot_00"" + (100 + (i + 1)), ""drawable"", ""com.androidnetwork.animlivewp"");                mPics[i] = BitmapFactory.decodeResource(res, id);            }        }        @Override        public void onCreate(SurfaceHolder surfaceHolder) {            super.onCreate(surfaceHolder);            setTouchEventsEnabled(false);        }        @Override        public void onDestroy() {            super.onDestroy();            mHandler.removeCallbacks(mDrawAnim);        }        @Override        public void onVisibilityChanged(boolean visible) {            mVisible = visible;            if (visible) {                drawFrame();            } else {                mHandler.removeCallbacks(mDrawAnim);            }        }        @Override        public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) {            super.onSurfaceChanged(holder, format, width, height);            float w = mPics[0].getWidth();            float h = mPics[0].getHeight();            float s = width / (float)w;            mMatrix.reset();            mMatrix.setScale(s, s);            mPosY = (height - (h * s)) / 2f;            drawFrame();        }        @Override        public void onSurfaceCreated(SurfaceHolder holder) {            super.onSurfaceCreated(holder);        }        @Override        public void onSurfaceDestroyed(SurfaceHolder holder) {            super.onSurfaceDestroyed(holder);            mVisible = false;            mHandler.removeCallbacks(mDrawAnim);        }        @Override        public void onOffsetsChanged(float xOffset, float yOffset,                float xStep, float yStep, int xPixels, int yPixels) {            drawFrame();        }        @Override        public void onTouchEvent(MotionEvent event) {            if (event.getAction() == MotionEvent.ACTION_MOVE) {                mAnime = !mAnime;            }            super.onTouchEvent(event);        }        void drawFrame() {            final SurfaceHolder holder = getSurfaceHolder();            Canvas c = null;            try {                c = holder.lockCanvas();                if (c != null) {                    // draw something                    drawAnim(c);                    //drawTouchPoint(c);                }            } finally {                if (c != null) holder.unlockCanvasAndPost(c);            }            // Reschedule the next redraw            mHandler.removeCallbacks(mDrawAnim);            if (mVisible &amp;&amp; mAnime) {                mHandler.postDelayed(mDrawAnim, 1000 / 10);            }        }        private int idx = 0;        void drawAnim(Canvas c) {            c.save();            c.translate(0, mPosY);            c.drawBitmap(mPics[idx], mMatrix, mPaint);            if (mAnime) ++idx;            if (idx == NUM_RES) idx = 0;            c.restore();        }    }}</code></pre><p>And here's a logcat if that'll help at all:</p><pre><code>08-22 19:45:05.508: ERROR/AndroidRuntime(12277): FATAL EXCEPTION: main    08-22 19:45:05.508: ERROR/AndroidRuntime(12277): java.lang.OutOfMemoryError: bitmap size exceeds VM budget    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.Bitmap.nativeCreate(Native Method)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.Bitmap.createBitmap(Bitmap.java:435)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:346)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:372)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at com.androidnetwork.animlivewp.AnimatedLiveWallpaper$CubeEngine.&lt;init&gt;(AnimatedLiveWallpaper.java:55)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at com.androidnetwork.animlivewp.AnimatedLiveWallpaper.onCreateEngine(AnimatedLiveWallpaper.java:32)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:814)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.os.Handler.dispatchMessage(Handler.java:99)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.os.Looper.loop(Looper.java:123)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at android.app.ActivityThread.main(ActivityThread.java:4627)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at java.lang.reflect.Method.invokeNative(Native Method)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at java.lang.reflect.Method.invoke(Method.java:521)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)    08-22 19:45:05.508: ERROR/AndroidRuntime(12277):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","393373","","19750","","2011-03-31 15:43:19","2011-03-31 15:43:19","Live Wallpaper OutOfMemory Error when i have more than 30 frames","<java><android><out-of-memory><live-wallpaper>","4","2","1","",""
"3563723","1","","","2010-08-25 07:30:55","0","992","<p>I have two Activities A and B . When i swithc between activity A to B the Activity b comes with 3d transition animation.when i press a back button in Activity B the Activity B exits with Animation.</p><p>Please Answer.</p><p>Hope Your Quick Response.</p>","454665","","","","","2011-08-30 08:05:14","Adding Animation in Activity Change in android","<android>","1","1","","",""
"3563728","1","","","2010-08-25 07:31:52","23","8478","<p>My app uses a uncaught exception handler that sends the stack trace to me when the app crashes. Often I get this report from random users. </p><p>I cannot replicate it, the opening of the database always succeeds in my case. This is not a database stored on external SD card, only a database opened with <code>SQLiteOpenHelper(context, ""SomeName"", null, someVersionCode)</code>.</p><p>Do you have any experience with this? What are the possibilities that I can check before opening the database?</p><p>Thank you!</p><pre><code>android.database.sqlite.SQLiteException: unable to open database file    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)    at android.app.ActivityThread.access$2200(ActivityThread.java:119)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4363)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:521)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)    at dalvik.system.NativeStart.main(Native Method)Caused by: android.database.sqlite.SQLiteException: unable to open database file    at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)    at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1698)    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:739)    at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:761)    at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:754)    at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:476)    at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)</code></pre>","11238","","","","","2013-10-21 11:36:16","Random exception android.database.sqlite.SQLiteException: unable to open database file","<android><database><sqlite>","8","3","8","",""
"3563761","1","","","2010-08-25 07:36:44","1","746","<p>i implemented the xmpp client in android.its working fine.the next task i focused on group communication from android.please anybody help me in the java code which related to group communication from xmpp.</p><p>thnku in advance</p><p>regardsrenuka</p>","430394","","","","","2012-09-13 11:27:58","xmpp group communication","<android><client><xmpp>","2","0","","",""
"3563869","1","","","2010-08-25 07:53:17","0","2191","<p>I'm looking at replacing the default Android text messing app with my own, but I don't exactly know how to send SMS and MMS text messages.  I would like to at least get it so that I can send SMS first, since I would assume that sending MMS would be much more difficult.</p><p>So, what exactly should be done when sending messages of these types? Any code examples that would be easy enough to understand?</p><p>Thanks!</p>","362857","","","","","2010-08-25 12:00:21","Sending SMS and MMS","<android>","2","1","0","",""
"3563896","1","3563971","","2010-08-25 07:56:52","0","569","<p>I am trying to create an app where, when you search for a particular animal, from a webservice, I get all the Animal names I have on my server along with their Image URLs. What I want to do is to sift through these Images like you can in case of an album art.</p><p>If I have to cache(i.e. ship) the images with my app, I will do that to improve the experience. However the major question I have is implementing this Album Art kind of functionality.</p><p>What should I use? 2D, 3D animation? OpenGl? Any samples greatly appreciated. </p>","400924","","44729","","2010-08-25 14:29:26","2010-08-25 14:29:26","Cover art in Android","<android><opengl-es><3d>","1","0","0","",""
"3563902","1","","","2010-08-25 07:57:32","1","1739","<p>I have a strange problem with StateListDrawable or maybe (probably) I'm missing something. I created a test application for it and the same problem occurs. So, this is my StateListDrawable resourse in file test_selection.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;item android:state_selected=""true""&gt;  &lt;shape android:shape=""rectangle"" android:background=""#ff0000""&gt;   &lt;corners android:radius=""10dp"" /&gt;   &lt;gradient android:startColor=""#ff5555""    android:endColor=""#ff5555"" android:angle=""0"" /&gt;  &lt;/shape&gt; &lt;/item&gt; &lt;item android:state_selected=""false""&gt;  &lt;shape android:shape=""rectangle"" android:background=""#eeeeee""&gt;   &lt;corners android:radius=""10dp"" /&gt;   &lt;gradient android:startColor=""#eeeeee""    android:endColor=""#eeeeee"" android:angle=""0"" /&gt;  &lt;/shape&gt; &lt;/item&gt;&lt;/selector&gt;</code></pre><p>It's a very simple selector that draw a red color for selected state and a white rect for the unselected one. </p><p>My main.xml template is very simple. I simply use a TextView that uses the selection as background.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt; &lt;TextView android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:text=""@string/hello""  android:textSize=""30dp"" android:id=""@+id/test_view_example"" android:background=""@drawable/test_selection""/&gt; &lt;Button android:layout_width=""wrap_content""  android:layout_height=""wrap_content"" android:id=""@+id/refresh""  android:onClick=""updateView"" android:text=""refresh""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>My Activity code is also very simple.</p><pre><code>public class TestDrawableStateActivity extends Activity { private final static int[] SELECTED_STATE = { android.R.attr.state_selected }; private final static int[] UNSELECTED_STATE = {}; private TextView textView;  /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  textView = (TextView) findViewById(R.id.test_view_example); } @Override protected void onResume() {  super.onResume();  // Carichiamo la Drawable   if(textView.getBackground().setState(SELECTED_STATE)){    textView.invalidate();  }   } public void updateView(View view) {  if(textView.getBackground().setState(SELECTED_STATE)){   textView.invalidate();  }; }}</code></pre><p>When Activity starts I try to set the state of my Drawable (the StateListDrawable) with the value SELECTED. It seems all very simple.... but the problem is that the state is not shown. If, later, I click a button and execute the method updateView() the state changes.Where is my problem? Where am I wrong?</p><p>Thankx a lotMax</p>","430421","","","","","2010-12-23 17:49:46","Android refresh StateListDrawable problem","<android><view><invalidate>","1","0","","",""
"3563908","1","3629056","","2010-08-25 07:58:29","10","2404","<p>How do you create an animated dashed or dotted border of an arbitrary shape in Android? In XML (preferred) or programmatically.</p><p>See picture below for an example.</p><p><img src=""http://i.stack.imgur.com/YYUMf.gif"" alt=""alt text""></p>","143378","","143378","","2010-08-26 01:45:44","2010-09-02 16:41:54","Animated Dashed Border in Android","<android><animation><border>","3","4","6","",""
"3563945","1","","","2010-08-25 08:04:14","3","2938","<p>I am developing a portable library on Java which will run on mobile device (android, blackberry) and I am looking for a lightweight ORM framework that i can use.  Here is a <a href=""http://java-source.net/open-source/persistence"" rel=""nofollow"">list of ORM frameworks</a> I found from Google. I've used only hibernate and I'm not familiar with most of them so any advice on which ORM framework I should use? Here are my requirements:</p><ol><li>The framework must be on java2me</li><li>Must run on android, android wraps database connection so connection is not directly accessible and some frameworks use the connection.</li><li>Must be portable</li></ol><p>Any help will be great.</p>","184601","","179850","","2012-06-09 12:45:50","2013-04-13 17:59:28","portable lightweight java orm framework for android","<java><android><orm><frameworks><portability>","0","5","","2013-04-15 15:57:12",""
"3563955","1","5951577","","2010-08-25 08:05:57","0","656","<p>Does camera width and height in Camera.Parameters change when we change orientation from portrait to landscape ? </p>","368084","","379693","","2010-08-26 05:06:09","2011-05-10 14:25:39","Android Camera width and height dependent on orientation?","<android><android-camera><android-camera-intent>","1","0","","",""
"3564126","1","","","2010-08-25 08:38:55","0","511","<p>Friend's,       I need to place an seperator in between the gallery elements,i have set horizontal scroll menus using gallery,here i to place a seperator between gallery elements.</p><p>Example design:     ------------------------                     Games | Music | Movies                    ------------------------i need to place an vertical line between the menus.how can i get it.</p><p>Thanks in advance.</p>","407506","","","","","2011-07-13 13:42:12","How to place seperator in between gallery elements","<android>","3","1","","",""
"3564161","1","3570077","","2010-08-25 08:44:21","0","716","<p>Is there any way to monitor the performance of a thread on Android phone. </p><p>As in any POSIX library?</p><p>I want to find the time taken by a ""thread"" during execution, while many other applications might also be running.</p><p>Thank You.</p>","277553","","","","","2013-03-07 11:03:16","Thread Performance in Android","<android><posix>","1","0","1","",""
"3564204","1","3564293","","2010-08-25 08:51:10","1","772","<p>I have a client that gave me a .psd file that contains the entire screen of an <code>Activity</code> with all the graphics. The resolution is 480x800. The client wants the application to look identical to the one in the .psd file. The problem is that different devices have different resolutions and sizes. I know that the density is what really matters but how can I scale the graphics to look the same on all the devices? For example, I exported all the layers and recreated the screen in Android but, for some reason, the screen looks more crowded on a Nexus One (480x800).</p><p>One idea would be to create 9 patch images from the graphics and use for <code>ImageView</code>s android:background instead of android:src right?</p><p>Isn't it better to have a 320x480 resolution for the graphics? Or do I need for both resolutions? Also, I have to consider the height of the status bar which I understood it is 25dip but I am not certain about this.</p><p>So, to summarize, I am interested to find out what is the best way for a client to give you the mockups and graphics so that it is easy for the developer to implement according to the specifications.</p>","292263","","","","","2010-08-25 09:04:46","From .psd to screen","<android><psd>","1","1","","",""
"3564241","1","","","2010-08-25 08:56:59","3","7773","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/230193/what-can-you-not-do-on-the-dalvik-vm-androids-vm-that-you-can-in-sun-vm"">What can you not do on the Dalvik VM (Android&rsquo;s VM) that you can in Sun VM?</a>  </p></blockquote><p>What ever interviews i have faced.In every interview when interviewers come on android topic they ask this question.""what is the difference between Dalvik VM vs Sun JVM?"".i have given some answers like.<a href=""http://stackoverflow.com/questions/230193/what-can-you-not-do-on-the-dalvik-vm-androids-vm-that-you-can-in-sun-vm"">http://stackoverflow.com/questions/230193/what-can-you-not-do-on-the-dalvik-vm-androids-vm-that-you-can-in-sun-vm</a></p><p>but i think they wanted more.</p>","241518","","","","","2010-08-25 09:12:18","Dalvik VM vs Sun JVM","<java><android>","1","2","","2010-08-25 09:22:15",""
"3564265","1","3564620","","2010-08-25 09:00:03","1","683","<p>Can anybody tell what is the use of a <code>BroadcastReceiver</code> and give an example in Android?</p><p>Can someone give a time zone change example using a <code>BroadcastReceiver</code>?</p>","426344","","759866","","2013-12-25 20:50:05","2013-12-25 20:50:05","What is the use of broadcast receiver in Android?","<android>","3","0","","",""
"3564393","1","3564622","","2010-08-25 09:20:02","6","8166","<p>I know this has been asked a lot of times in StackOverflow already, but I haven't quite found a solution yet. My app sends an email with a link in it that when clicked should launch the app.</p><p>According to @hackbod, the best way to do it is to make use of the Intent URI (see <a href=""http://stackoverflow.com/questions/2430045?tab=votes#tab-top"">this</a>). Here's my code that sets the intent and puts it in the email body:</p><pre><code>Intent customIntent = new Intent(CUSTOM_ACTION);customIntent.setPackage(MY_PACKAGE);customIntent.addCategory(MY_CAT_BROWSABLE);customIntent.addCategory(MY_CAT_DEFAULT);String customUri = customIntent.toUri(Intent.URI_INTENT_SCHEME);String emailBody = getString(R.string.intent_link, customUri);Intent intent = new Intent(Intent.ACTION_SEND);intent.setType(""text/html"");intent.putExtra(Intent.EXTRA_SUBJECT, ""Recommending vid"");intent.putExtra(Intent.EXTRA_TEXT   , Html.fromHtml(emailBody));try {    startActivity(Intent.createChooser(intent, ""Choose email client:""));} catch (android.content.ActivityNotFoundException ex) {    Toast.makeText(this, ""There are no email clients installed."", Toast.LENGTH_SHORT).show();}</code></pre><p>This is what I get from LogCat:</p><pre><code>08-25 17:01:23.333: VERBOSE/Test URI(16987): intent:#Intent;action=com.test.project.action.VIEW_VID_FROM_LINK;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;package=com.test.project;end08-25 17:01:23.338: VERBOSE/Test email text(16987): Hi,&lt;br&gt;&lt;br&gt;Testing intents from an email.&lt;br&gt;&lt;br&gt; A standard website: &lt;a href=http://www.google.com&gt;Go to Google&lt;/a&gt;.&lt;br&gt;&lt;br&gt; This link should launch the app: &lt;a href=intent:#Intent;action=com.test.project.action.VIEW_VID_FROM_LINK;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;package=com.test.project;end&gt;Click link to launch&lt;/a&gt;.</code></pre><p>When I view the email from my phone using the GMail app, I can click on the Google link and it launches the browser, no problem with that.</p><p>But the link for the intent is not even clickable (While from the draft it looks like it <em>should</em> be clickable). Has anybody tried this and made it work?</p><p><img src=""http://i.stack.imgur.com/qoK5d.jpg"" alt=""From draft: link looks clickable""><img src=""http://i.stack.imgur.com/OL3nJ.jpg"" alt=""Sent email: link not clickable""> </p><p>EDIT #1: I have also tried setting the action to Intent.ACTION_VIEW but the link is still not clickable.</p><p>EDIT #2: Apparently, the link really <em>is</em> clickable. I tried using another email client, and the links are clickable! Seems like there is a bug in GMail. Oh well.  But apparently, this is harder than I thought.  I tried using:</p><pre><code>Uri.Builder builder = new Uri.Builder();builder.scheme(""my.own.scheme"");builder.authority(""my.authority"");Uri newUri = builder.build();Intent customIntent = new Intent(CUSTOM_ACTION, newUri);</code></pre><p>As suggested by @CommonsWare, I tried checking if there are receivers of this <code>customIntent</code>. Apparently there is one, which is what I was expecting. So next step is to make this intent into a URI that I can use in the email.  I used:</p><pre><code>String customUri = customIntent.toUri(Intent.URI_INTENT_SCHEME);</code></pre><p>which, based on my understanding of the documentation, should give me something like the usual http links, only with the scheme set to <code>intent</code>. I can then use this <code>customUri</code> as the value for the links in the email.  BUT, it looks like this is not the case. Does anybody have an example of what <code>.toUri</code> must return?</p>","395576","","395576","","2010-08-25 14:00:11","2011-12-15 21:10:56","Launching my app using the intent URI","<android><email><uri><android-intent>","2","4","5","",""
"3564459","1","3564565","","2010-08-25 09:29:00","0","1626","<p>The Listitem would not be retrieved from the db. It is passed over from another class. </p>","358218","","358218","","2010-08-27 02:55:14","2012-11-10 08:27:56","How would i delete a listitem from a listview?","<android><eclipse><listitem>","2","4","","",""
"3564464","1","3564816","","2010-08-25 09:29:33","0","8502","<p>I m trying to delete a record from a SQLiteDB via Android Application,This is the way that i used the code to delete the record</p><pre>//Snippet of code in my DBAdapter Classpublic boolean DeleteRecord(String ContactName) {    Log.i(TAG, ""DeleteRecord(String ContactName)"");    Log.i(TAG, ContactName);    return db.delete(TABLE_SIMPLETABLE_CLIENT1,KEY_EMPLOYEE_NAME + ""=""             +ContactName,null);    }</pre><p>and from the another class, i trying to call this method by opening the DB and calling this method and again closing the DB, this is how i have coded,</p><p>//Snippet of code in my DBApplication Class</p><pre>public void onClick(DialogInterface dialog,    int which) {DBAdapter.open();DBAdapter.DeleteRecord(DeleteRecord);  //DeletRecord is string value that in DB(Sivaram)                       DBAdapter.close();}</pre><p>When i deploy it , i an getting  the following error, </p><pre>08-25 14:52:20.602: ERROR/AndroidRuntime(231): android.database.sqlite.SQLiteException: no such column: Sivaram: , while compiling: DELETE FROM SimpleTable1 WHERE Employee_Name=Sivaram</pre><p>please help me, in finding out the solution</p><p>Thanks in advance...</p>","384193","","","","","2011-06-08 08:55:07","Android: SQLite Not able to delete a specific record","<android><sqlite>","4","1","","","2010-08-25 09:29:48"
"3564467","1","","","2010-08-25 09:30:27","2","3224","<p>I am am trying to connect to a SOAP web service using ksoap2 library. I have read a bunch of docs about it, but i am stuck as my request is not an ordinary one.</p><p>I need to specify some headers prior to sending the request.</p><p>when is use a soap client to test the webservice i also need to put this in the soap enveope header section:</p><pre><code>&lt;SOAP-ENV:Header&gt;&lt;mns:AuthIn xmlns:mns=""http://enablon/wsdl/"" SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""&gt; &lt;UserInfo xsi:type=""wsdlns:AuthHeader""&gt;  &lt;EnaHomeSite xsi:type=""xsd:string""&gt;sss&lt;/EnaHomeSite&gt;  &lt;EnaUserName xsi:type=""xsd:string""&gt;sadsa&lt;/EnaUserName&gt;  &lt;EnaPassword xsi:type=""xsd:string""&gt;qwertf&lt;/EnaPassword&gt; &lt;/UserInfo&gt;&lt;/mns:AuthIn&gt;&lt;/SOAP-ENV:Header&gt;</code></pre><p>The rest of my code is similar to <a href=""http://android.amberfog.com/?p=45"" rel=""nofollow"">this</a> approach</p><p>The emulator takes a bit of time to precess so i assume it contacts the server, but the call to ...call crases with:</p><pre><code>org.xmlpull.v1.XmlPullParserException: expected: END_TAG {http://schemas.xmlsoap.org/soap/envelope/}Body (position:END_TAG &lt;/{http://schemas.xmlsoap.org/soap/envelope/}SOAP-ENV:Fault&gt;@1:505 in java.io.InputStreamReader@43ef45e8) </code></pre><p>My question is how do i attach the header mentioned above to my request?</p><p>I didn't manage to fine nice doc for ksoap. maybe some tutorials or examples. can anyone point me to some docs. I have found the javadoc, but it is rather thin.</p><p>I have also tried to format my own raw HTTP request. (managed to do so on iPhone and it works just fine). However i can't seem to be able to add the body of the request in. I mean the big soap xml containing all headers namespaces and required data for the call. Any pointer on this direction would be also much appreciated.</p><p>Thanks a lot, guys.</p><p>Cheers,Alex</p>","428433","","1393623","","2013-10-04 03:51:47","2013-10-04 03:51:47","SOAP web service on android","<android><web-services><authentication><soap><ksoap2>","1","0","","",""
"3564517","1","","","2010-08-25 09:35:47","0","583","<p>I am developing a web application for android. if my web page contains any email address and user click on that then browser  opens mail client dialog box even i have not attached any mailto link for those address.for example:  abc@gmail.com   if you click on text  abc@gmail.com in android browser it will open mail client.it works fine for iphone. because of this my own attached click event is not getting fired.</p><p>Expected Result : mail client dialog box should be open only if i have attached mailto link.</p><p>please help me how to get rid of this auto opening mail client dialog box when i have not attached any mailto link.</p><p>is there any way to stop it from javascript or any other possible solution. </p>","430504","","430504","","2010-08-27 09:30:32","2010-08-27 09:30:32","Auto opening email client dialog box on click of text( which is a email) in android browser","<android>","0","2","","",""
"3564555","1","3565396","","2010-08-25 09:40:50","0","405","<p>I have the following code that responds to a button click, changes the view and then after 5 seconds switches the view back:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.menu);    Button test = (Button)findViewById(R.id.browseLocation);    test.setOnClickListener(testListener);}private TimerTask revert = new TimerTask(){    @Override    public void run() {        setContentView(R.layout.menu);    }};private OnClickListener testListener = new OnClickListener() {    public void onClick(View v) {        setContentView(R.layout.test);        Timer tim = new Timer();        tim.schedule(revert, 5000);    }};</code></pre><p>However this code does not work. The run method of the timetask is hit but setContentView fails. I assume it has something to do with scope inside the timetask.How can I achieve the desired result?</p>","197310","","197310","","2010-08-25 11:26:33","2010-08-25 12:40:59","Switching Views inside a TimerTask - Android","<java><android>","3","2","","",""
"3564629","1","","","2010-08-25 09:51:32","0","814","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3480715/how-to-develop-a-soft-keyboard-for-android"">How to develop a soft keyboard for Android?</a>  </p></blockquote><p>How to add a new key in android keyboard.</p>","454665","","","","","2010-08-25 10:07:10","Android Keyboard","<android>","1","0","","2012-08-23 12:11:44",""
"3564693","1","3564760","","2010-08-25 10:00:01","0","3377","<p>I could not find out OS of Lot of mobiles? for example MicroMax , Videocon Mobiles in India, they did not give that details in their specification, what os will it have? why they did not give that details? but JVMs are there...any help please?</p>","141302","","","","","2010-09-02 02:11:17","how to find OS of Mobile generally?","<android><iphone><mobile><operating-system><mobile-phones>","3","3","","",""
"3564941","1","","","2010-08-25 10:33:03","2","422","<p>i would like to categorize applications.When an app comes to foreground i should be able to detect that this app has video,audio,just text, or 3D graphics.</p><p>I tried using 2 options to categorize them:</p><ol><li>to get the permissions used in the apps, but couldn't get permissions for 3rd party apps(only the native apps), is it true that you cannot get permissions for 3rd party apps? or am i missing something?</li><li>to pick out all installed apps based on mimeType, but i get only the native apps, or maybe certain apps(intents of apps) don't have the mimeType specified(am not sure).</li></ol><p>is there any other way to categorize the installed applications? I would really appreciate it if someone could help me out with this?</p><p>thanks alot</p>","415053","","","","","2010-08-25 10:33:03","Categorize applications","<android><category>","0","1","","",""
"3565066","1","3566163","","2010-08-25 10:48:51","1","1178","<p>Friend's    I have a task to parse thumbnail images and to set it on grid view,where url image content to be in different height and width(some images to be 60*60, or 110*80),how can i set images in grid have uniform height and width.</p><p>Thanks in advance.</p>","407506","","","","","2013-03-15 13:17:56","How to set Grid images have uniform height and width","<android>","1","0","1","",""
"3565134","1","","","2010-08-25 10:57:15","1","240","<p>I'm trying to run a android app while the screen is black, i used a service and i tryed to add also a WakeLock of the type ""PARTIAL_WAKE_LOCK"".</p><p>The service play a song and save data from the accelerometer to the db, but when i press the red phone button to make the screen black, it play the song but it don't save data to the db. Have anyone a idea of why it don't save data to the db?</p><p>Tnk's</p><p>Valerio</p>","314554","","","","","2012-05-24 21:32:37","Running a Android App while the screen is black","<android><database><service>","1","0","","",""
"3565135","1","","","2010-08-25 10:57:23","0","1755","<p>I am creating a custom view which populates based on a condition ""Yes"" or ""No"", implemented through RadioButtons &amp; ViewStub. Unfortunately things are not going as planned:</p><p>CustomView -- artooConditional:</p><pre><code>public artooConditional(Context context, AttributeSet attrs) {        super(context, attrs);        setAttributes(attrs);    }    private void setAttributes(AttributeSet attrs) {        TypedArray a = getContext().obtainStyledAttributes(attrs,                R.styleable.artooConditional);        mLayout = a.getResourceId(R.styleable.artooConditional_layout, NO_ID);        LayoutInflater inflater = (LayoutInflater) getContext()                .getSystemService(getContext().LAYOUT_INFLATER_SERVICE);        View v = inflater.inflate(R.layout.types_conditional, null, false);        addView(v, new LayoutParams(LayoutParams.FILL_PARENT,                LayoutParams.WRAP_CONTENT));        RadioGroup group = (RadioGroup) v                .findViewById(R.id.types_conditional_group);        layout = (ViewStub) v.findViewById(R.id.types_conditional_layout);        group.setOnCheckedChangeListener(new OnCheckedChangeListener() {            @Override            public void onCheckedChanged(RadioGroup group, int checkedId) {                if (checkedId == R.id.types_conditional_yes) {                    if (!inflated) {                        layout.setLayoutResource(mLayout);                        layout.inflate();                        inflated = true;                    }                    // layout.setVisibility(View.VISIBLE);                } else {                    // if (layout.getVisibility() != View.GONE)                    layout.setVisibility(View.GONE);                    inflated = false;                }            }        });        a.recycle();    }</code></pre><p>Supporting xml layout:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:a=""http://schemas.android.com/apk/res/com.android.artoo.types.buttondialog""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:orientation=""vertical""&gt;    &lt;RadioGroup android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:id=""@+id/types_conditional_group""&gt;        &lt;RadioButton android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""Yes"" android:layout_weight=""1"" android:id=""@+id/types_conditional_yes""/&gt;        &lt;RadioButton android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""No"" android:layout_weight=""1"" android:id=""@+id/types_conditional_no""/&gt;    &lt;/RadioGroup&gt;    &lt;ViewStub android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:id=""@+id/types_conditional_layout"" android:visibility=""gone""/&gt;&lt;/LinearLayout&gt;</code></pre><p>LogCat:</p><pre><code>08-25 16:14:39.579: ERROR/AndroidRuntime(356): Uncaught handler: thread main exiting due to uncaught exception08-25 16:14:39.599: ERROR/AndroidRuntime(356): java.lang.IllegalStateException: ViewStub must have a non-null ViewGroup viewParent08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewStub.inflate(ViewStub.java:246)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at com.android.artoo.types.buttondialog.artooConditional$1.onCheckedChanged(artooConditional.java:67)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.widget.RadioGroup.setCheckedId(RadioGroup.java:172)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.widget.RadioGroup.access$600(RadioGroup.java:52)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.widget.RadioGroup$CheckedStateTracker.onCheckedChanged(RadioGroup.java:342)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.widget.CompoundButton.setChecked(CompoundButton.java:125)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.widget.CompoundButton.toggle(CompoundButton.java:85)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.widget.RadioButton.toggle(RadioButton.java:69)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.widget.CompoundButton.performClick(CompoundButton.java:97)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.View.onTouchEvent(View.java:4133)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.widget.TextView.onTouchEvent(TextView.java:6510)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.View.dispatchTouchEvent(View.java:3672)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.app.Activity.dispatchTouchEvent(Activity.java:1987)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.os.Handler.dispatchMessage(Handler.java:99)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.os.Looper.loop(Looper.java:123)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at android.app.ActivityThread.main(ActivityThread.java:4203)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at java.lang.reflect.Method.invokeNative(Native Method)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at java.lang.reflect.Method.invoke(Method.java:521)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)08-25 16:14:39.599: ERROR/AndroidRuntime(356):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I can see, the first time the ViewStub is inflated, its parent becomes null and thus is causing an error when I click ""Yes"" after clicking ""No"". Whats the best way to create such a view?</p><p>Any help will be most appreciated. Thanks</p><p>Sameer</p>","356580","","","","","2011-06-14 10:06:07","Custom View - Conditional View -- ViewStub & RadioButtons","<android><view><radio-button><viewstub>","1","2","","",""
"3565206","1","3567085","","2010-08-25 11:09:33","3","453","<p>I create a cool Home application in Android.</p><p>As this is a Home I don't want her to appear in the Launcher, in the list of all applications.</p><p>That's pretty easy, but now I would like the settings of this application to appear. So, I created the preferences of my application this way in the Manifest:</p><pre><code>   &lt;activity android:name="".Preferences"" android:label=""@string/application_name""&gt;   &lt;intent-filter&gt;          &lt;action android:name=""android.intent.action.MAIN"" /&gt;          &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;    &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>That work pretty well and I have an extra icon in the Launcher!</p><p>The only problem is that nothing happen when I click on the Icon.</p><p>Therefore, I can launch my Preferences from within the application:</p><pre><code>    final Intent preferences = new Intent(Launcher.this,Preferences.class);            menu.add(0, MENU_PREFERENCES, 0, R.string.application_name).setIcon(            R.drawable.ic_menu_preferences).setAlphabeticShortcut('F').setIntent(              preferences);</code></pre><p>So why is the shortcut in the launcher totally useless and does not launch anything???</p><p>More informations here:</p><p>Log when I launch from within the application: (PREFERENCES ARE LAUNCHED, WORKED FLAWLESSLY)</p><pre><code>    08-25 13:13:03.009: INFO/ActivityManager(63): Starting activity: Intent { cmp=com.myapp.home/.Preferences }</code></pre><p>When I launch from the launcher: (NOTHINHG HAPPEN)</p><pre><code>    08-25 13:13:45.489: INFO/ActivityManager(63): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.myapp.home/.Preferences }</code></pre><p>My activity:</p><pre><code>    public class Preferences extends PreferenceActivity {     @Override     protected void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      addPreferencesFromResource(R.xml.preferences);     }    }</code></pre><p>Thank a lot for any help.</p>","327402","","327402","","2010-08-25 11:14:53","2010-08-26 08:35:16","Creating a second shortcuts in the Launcher","<java><android><home><launcher>","1","0","1","",""
"3565252","1","3565756","","2010-08-25 11:15:01","0","1028","<p>I need to make a WebView show some web pages where some parts are offline (on the SD card) and some are online (retrieved via http). For instance, som pictures or javascript files may be local on the sd card, and some may be online. Target is Android 1.6, and I have full control over the server, and the files on the server.</p><p>Any ideas?</p>","1507543","","1507543","","2010-08-25 14:46:49","2010-08-25 14:46:49","WebView using offline and online files for a page","<android>","1","2","","",""
"3565393","1","3565473","","2010-08-25 11:37:09","2","1730","<p>I've been searching, but can't find a way to do this.  I want theability to re-arrange Views in a LinearLayout, without specifyingspecific pixel locations, at runtime.  for my proof of concept, I havea layout with 2 TextViews, one red, and one black.  The red TextViewis on the left.  I want onClick to set it to be on the right, withoutadjusting margins, as if I'd re-written the XML of the layout, withthe red TextView second.  Is there a way to do this?  I can't seem tofind it.</p>","430609","","21234","","2010-08-25 11:59:49","2010-08-25 11:59:49","Want to change LinearLayout layout at runtime","<android><android-linearlayout>","1","0","","",""
"3565438","1","3565598","","2010-08-25 11:44:30","4","8635","<p>I have seen the example <a href=""http://stackoverflow.com/questions/3150830/android-encryption"">here</a>. All well and good and I understand it, however it relies on the bounceycastle library for the provider. I don't want to bundle any additional third party libraries with my app if I can help it. I don't need fort knox style security, just some basic symmetric encryption for transmitting over the wire. How can I do basic encryption on Android with out third party libraries?</p><p>thanks </p>","146588","","","","","2013-07-02 10:40:47","Basic encryption on Android","<android><encryption>","2","0","3","",""
"3565548","1","3565576","","2010-08-25 12:00:41","0","234","<p>Can anyone help me, how to go the previous page from Current Page.</p><p>For Instance:</p><p>First User Clicks Music Page it invokes a WebView wich displays the Music Url &amp; then the User Clicks Back button, At that time previous page(ie Music Page) must be dispalyed.</p><p>Thanks in Advance,</p><p>Tilsan</p>","424413","","3603","","2010-08-25 12:02:28","2010-08-25 12:04:05","How to find Back Button Using Android?","<android>","1","5","1","","2010-08-25 12:01:44"
"3565622","1","","","2010-08-25 12:09:22","2","1240","<p>I wrote a little widget for Android devices.</p><p>The widget uses <code>AlarmManager</code> to set recurring updates.I'm using the <code>RTC</code> clock for the <code>AlarmManager</code>.</p><p>According to the documentation, if the device is sleeping, the <code>RTC</code> clock won't wake up the device and the next update will be when the device is woken.</p><p>I have a log file for the widget which shows when it was updated.</p><p>Even when I don't touch the device , I still see updates in the log file.</p><p>Why is that? shouldn't the device be sleeping and thus my widget shouldn't update?</p><p>I'm using <code>System.currentTimeMillis()</code> for the starting time so it should be correct for <code>RTC</code> clock.</p>","430638","","875020","","2014-03-17 18:50:28","2014-03-17 18:50:28","Android AlarmManager RTC doesn't pause while device is sleeping","<android><alarmmanager><sleep><real-time-clock>","1","4","","",""
"3565683","1","3571061","","2010-08-25 12:16:03","1","536","<p>I am developing an application based on the zxing library and I would like the user to be able to decode a photo that is stored on the sd card.</p><p>I have found an example under the androidTest example but when I tried to use it I found that in class BenchmarkThread in line 96 eclipse complained that HybridBinarizer is not known.</p><p>what I have to import in order to make it work?</p><p>also is there any other example I could read? </p>","234898","","759866","","2014-02-15 15:27:00","2014-02-15 15:27:00","zxing how to decode from a file?","<android><decoding><zxing>","1","0","","",""
"3565737","1","3785419","","2010-08-25 12:22:47","0","175","<p>I made a small test application that uses the GPS module. To test it, I used telenet to connect to the emulator and send geo fix coordonates.</p><p>Sending geo fix 90 90 from telnet made my application react ok.</p><p>After reading a while I found about the DDMS. There seems to be a problem with sending coordinates from it to the device. No matter what option I try: Manual or KML file (the KML loads fine) the device only receives one 0.0 and 0.0 coordinates, no matter what I send it.</p><p>What am I doing wrong ?</p>","379865","","","","","2010-09-24 08:34:00","Using DDMS to send KLM coordonates","<android>","1","0","1","",""
"3565777","1","3566356","","2010-08-25 12:28:30","1","183","<p>I'm new to all this.  I have 2 Android Application Development books that I've read through, but I still don't understand somethings.</p><p>I was trying to make a 'flash card' type program for my daughter.  I already had images had up since I had printed them out previously.  But I can't find anyway to display them.</p><p>The closest I got was creating a Gridview with all the images listed, when I do this, I can only scroll up and down and it won't stop scrolling with the image centered.</p><p>I probably don't want a Gridview anyways since I need to be able to tap on the card to 'turn it over'.</p><p>If anyone can point me in the right direction, tell me what I should be looking for.  A different Widget, some fancy xml, or do I need to dive into 2d/3d graphics?</p>","157603","","","","","2010-08-25 13:33:46","Android, wide or multiple screens","<android>","1","0","1","",""
"3566010","1","3567657","","2010-08-25 12:56:16","5","7185","<p>I know, there are several questions of this type but I tried all of it and it still doesn't work.<br>Ok, for my app; I've got an Activity. In this Activity, there are 4 Tabs, and the fourth one contents a list and a record button. When I am pushing record, there is a GPS Listener which starts. After getting a new gps value, it pushes it into the list.<br>This works so far!<br>If I click the Home Button it still works, if I longpress it then. It resumes that Activity with the specific Tab open and the list still hold the listitems and the gps listener is still active.<br>This works also fine!<br>Now I wanted to add a notification, which shows the count of gps values of the list as .number. On every new gps signal, it updates the notification icon with the new number. This is no problem, but the action to click on the notification totally screws up my application.</p><p>The actual code looks like this:</p><pre><code>public void callNotify(String text) {    notif = new Notification();    Intent contentIntent = new Intent(this, tabactivity.class);    contentIntent.putExtra(""fid"", this.specialvalue);    contentIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP        | Intent.FLAG_ACTIVITY_SINGLE_TOP);    notif.icon = R.drawable.icon;    notif.setLatestEventInfo(this, getString(R.string.app_name), text,        PendingIntent.getActivity(this.getBaseContext(), 0, contentIntent,            PendingIntent.FLAG_UPDATE_CURRENT));    notif.ledARGB = Color.RED;    notif.ledOnMS = 200;    notif.ledOffMS = 200;    notif.flags = Notification.FLAG_SHOW_LIGHTS        | Notification.FLAG_ONGOING_EVENT        | Notification.FLAG_ONLY_ALERT_ONCE;    notif.number = notifyNumber;    mNotificationManager.notify(notifyNumber, notif);}public void updateNotify(String text) {    notifyNumber++;    notif.number = (int) (notifyNumber / 2);    Intent contentIntent = new Intent(this, tabactivity.class);    contentIntent.putExtra(""fid"", this.specialvalue);    contentIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP        | Intent.FLAG_ACTIVITY_SINGLE_TOP);    notif.setLatestEventInfo(this, getString(R.string.app_name), text,        PendingIntent.getActivity(this.getBaseContext(), 0, contentIntent,            PendingIntent.FLAG_UPDATE_CURRENT));    mNotificationManager.cancel((notifyNumber - 2));    mNotificationManager.notify(notifyNumber, notif);}</code></pre><p>So, the updateNotify() is called on a new gps signal. And the callNotify() is the first one, before it starts the gps listener. And, yeah, the notifyNumber/2 was my intention, because I work with that number further.</p><p>If I compile it like this, and click on the Notification, it opens a NEW tabactivity on the first tab. If I click back then, I get a lot of errors (database is still open, nullpointers and stuff). I think because it starts a new tabactivity and the other one is still open, 'cause I can see the gps listener is still working.</p><p>So, what I want is, that I can do the following:I open my app, go to the tabactivity, open tab 4, click record. If I click back then, it should hide the app, also, if I just click the home button. But there is a notification.If I click on that one, it should just show the hidden activity again and thats it. So, what I am doing wrong there?I thought, the Flags FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_SINGLE_TOP should solve the problem?</p>","381036","","281545","","2013-07-19 16:21:05","2013-07-19 16:21:05","Notification Resume Activity","<android><notifications><resume>","1","0","3","",""
"3566089","1","3566131","","2010-08-25 13:04:40","2","1056","<p>Hopefully this is very simple.</p><p>I have a central activity that can be launched from two separate classes. I was hoping that in this central activity I could have an IF statement like</p><pre><code>if(this.getIntent() == MainMenu.class){  // Do something here}</code></pre><p>But obviously that isn't legal so how could I structure an expression to check from what class an intent was started. </p><p>Many thanks</p>","300037","","","","","2010-08-25 13:10:44","Using the IF statement to see what intent started the activity - ANDROID","<android><activity><if-statement><android-intent>","2","0","","",""
"3566187","1","","","2010-08-25 13:16:41","1","3686","<p>HI,</p><p>Iam writing GridView by using BaseAdapter with 2 columns.Each column with One Image and Text.It works smoothly.I had given focus by using below code in onConfig...</p><pre><code>public void onConfigurationChanged(Configuration newConfig) {    gridview.requestFocusFromTouch();    gridview.setSelection(0);}</code></pre><p>It works when my view configuration changes.But Same doesn't work in onCreate() method.I used below all methods in onCreate() but my view doesn;t get focus.How to give focus for the first image when running my application.I want focus on first image when view inflates on the device.Please give me guidance?</p><pre><code>gridview.requestFocus();gridview.requestFocusFromTouch();gridview.setSelected(true);gridview.setSelection(0);gridview.setFocusable(true);gridview.setFocusableInTouchMode(true);gridview.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);</code></pre><p>Regards,Rajendar Are</p>","430710","","","","","2011-07-29 06:17:41","How to get focus to GridView First Image Android?","<android>","3","1","","",""
"3566294","1","3566361","","2010-08-25 13:28:07","0","583","<p>I'm using the following tutorial  <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a> in order to create a map view and plot points on to it. I have all of that done fine but now I'd like to embed an image and even audio within the Alert dialogs that pop up. Is this possible in the current context? How would I do it?</p>","358438","","","","","2010-08-25 13:34:58","Images and Audio in an Alert Dialog","<java><android><image><google-maps><audio>","1","0","","",""
"3566303","1","3566968","","2010-08-25 13:29:04","6","876","<p>So during certain states in my app, I want to disable certain CheckBoxPreferences in my setting-menu. However, if the user clicks them, I want an explanatory toast to be shown. If i just do setEnable(false); on the CheckBoxPreference, I do get the right look and feel. But I cant get a toast to be shown on click. On the other hand, I have failed in manually making a CheckBoxPreference look like it is disabled.</p>","249871","","","","","2010-08-25 14:34:40","Make Preference look disabled, but still register clicks","<android><preferences>","1","0","","",""
"3566387","1","3568036","","2010-08-25 13:38:41","1","804","<p>I have an android app that repeatedly collects fingerprints from the wifi-networks that are around (for scientific reasons, not to invade anybodies privacy). </p><p>Anyways, imagine I have a function that does this work and it's called <strong>scanWifi()</strong>. I initally wanted to start it like this: </p><pre><code>ExecutorService mExecutor = Executors.newSingleThreadScheduledExecutor();mExecutor.scheduleAtFixedRate(new Runnable() {    @Override    public void run() {        scanWifi();    }}, 0, interval, TimeUnit.MILLISECONDS);</code></pre><p>Sadly, this only works reliably when the phone is plugged in. If it's plugged out and lays there for a while, it doesn't run my scanWifi() function every minute. Sometimes there are gaps of several minutes between single calls to scanWifi().</p><p>I also tried doing the same thing using a Timer/TimerTask with similarly poor results. </p><p>The only thing that seems to work more or less reliable until now is to post it to a handler and call it repeatedly, like this: </p><pre><code>Handler h = new Handler();Runnable r = new Runnable() {    @Override    public void run() {        if (!mIsStopped) {            scanWifi();            h.postDelayed(this, mInterval);        }    }};h.post(r);</code></pre><p>Why is that the case? Is the CPU sleeping and thus misses the scheduled execution? I hold a <a href=""http://developer.android.com/reference/android/os/PowerManager.html#PARTIAL_WAKE_LOCK"" rel=""nofollow"">partial wakelock</a> in my app.</p>","367197","","","","","2010-08-25 16:19:10","Android ""misses"" periodical execution of Thread using ScheduledExecutorService","<android><threadpool><executorservice>","1","0","","",""
"3566424","1","3566474","","2010-08-25 13:42:25","0","219","<p>I'm looking for the best way to do the following..</p><p>I've got a loop like so...</p><pre><code>        while(mcursor.moveToNext()){        String tname = mcursor.getString(4);        String tmessage = mcursor.getString(7);        String tlink = mcursor.getString(5);        String tsname = mcursor.getString(3);        Double tlat = mcursor.getDouble(1);        Double tlng = mcursor.getDouble(2);    }</code></pre><p>for every element of the loop I want to apply the following...</p><pre><code>     GeoPoint point = new GeoPoint(tlat,tlng);   OverlayItem overlayitem = new OverlayItem(point, tname, tmessage);    itemizedoverlay.addOverlay(overlayitem);    mapOverlays.add(itemizedoverlay);</code></pre><p>How would I do this? The answer is probably obvious but I'm confusing myself.</p>","358438","","1968437","","2013-01-13 02:43:47","2013-01-13 02:43:47","Java loop troubleshooting","<java><android><sqlite><loops>","4","0","","",""
"3566678","1","3574184","","2010-08-25 14:08:15","4","1289","<p>Heya, I get a very strange error that I just cannot sort out when attempting to serialize objects to JSON on all android platforms, from 1.5 through to 2.2 (both on phones and emulators).</p><p>I receive this error:</p><pre><code>E/AndroidRuntime(21017): Uncaught handler: thread AsyncTask #2 exiting due to uncaught exceptionE/AndroidRuntime(21017): java.lang.RuntimeException: An error occured while executing doInBackground()E/AndroidRuntime(21017):    at android.os.AsyncTask$3.done(AsyncTask.java:200)E/AndroidRuntime(21017):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)E/AndroidRuntime(21017):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)E/AndroidRuntime(21017):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)E/AndroidRuntime(21017):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)E/AndroidRuntime(21017):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)E/AndroidRuntime(21017):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)E/AndroidRuntime(21017):    at java.lang.Thread.run(Thread.java:1096)E/AndroidRuntime(21017): Caused by: java.lang.NoSuchMethodError: org.json.JSONStringer.objectE/AndroidRuntime(21017):    at com.qype.radar.api.json.JsonSerializationHelper.startModel(JsonSerializationHelper.java:119)E/AndroidRuntime(21017):    at com.qype.radar.api.json.JsonSerializationHelper.serializeCheckin(JsonSerializationHelper.java:94)E/AndroidRuntime(21017):    at com.qype.radar.api.QypeApiImpl.submitCheckin(QypeApiImpl.java:157)E/AndroidRuntime(21017):    at com.qype.radar.activities.tasks.SubmitCheckinTask.doCheckedInBackground(SubmitCheckinTask.java:29)E/AndroidRuntime(21017):    at com.qype.radar.activities.tasks.SubmitCheckinTask.doCheckedInBackground(SubmitCheckinTask.java:1)E/AndroidRuntime(21017):    at com.github.droidfu.concurrent.BetterAsyncTask.doInBackground(BetterAsyncTask.java:154)E/AndroidRuntime(21017):    at android.os.AsyncTask$2.call(AsyncTask.java:185)E/AndroidRuntime(21017):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)E/AndroidRuntime(21017):    ... 4 more</code></pre><p>when arriving at the line 'stringer.object' from 'startModel()' when serializing a review in this code:</p><pre><code>package com.qype.radar.api.json;import org.json.JSONException;import org.json.JSONStringer;import com.qype.radar.model.Review;public class JsonSerializationHelper {    private JSONStringer stringer = new JSONStringer();    ...    public String serializeReview(Review review) throws JSONException {        startModel(""review"");        value(""rating"", review.getRating());        value(""language"", review.getLanguage());        value(""content"", review.getText());        return endModel();    }    ...    private JSONStringer startModel(String name) throws JSONException {        stringer.object();        stringer.key(name);        stringer.object();        return stringer;    }    private String endModel() throws JSONException {        stringer.endObject();        stringer.endObject();        return stringer.toString();    }    private void value(String key, String value) throws JSONException {        stringer.key(key);        stringer.value(value);    }    private void value(String key, int value) throws JSONException {        stringer.key(key);        stringer.value(value);    }}</code></pre><p>The strangest thing about this is that the code compiles fine, and upon debugging, the JSONStringer object is instantiated ok, but any calls to it throw this error. I also am able to, using Java's reflection, discover that the class does exist, and the methods I can retrieve from the class object are all there, and can be invoked without error.</p><p>The org.json package is a standard in Android, and has been available since API version 1.</p><p>Any help to resolve this issue would be appreciated, as I simply don't know where to look.</p>","405413","","","","","2010-08-26 10:23:58","NoMethodError on standard Android runtime object","<android><json><nosuchmethoderror>","1","1","4","",""
"3566785","1","","","2010-08-25 14:18:51","0","143","<p>Hi friendsi want to clear sd card memory via android codingThanks</p>","410757","","","","","2010-08-25 15:12:01","sdcard in android","<android>","1","1","","",""
"3566808","1","8789208","","2010-08-25 14:20:19","0","652","<p>I've got an activity with the following layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;    &lt;com.google.android.maps.MapView        android:id=""@+id/map""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""    &lt;LinearLayout        android:id=""@+id/view""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""        android:gravity=""center""        android:padding=""5dp"" &gt;        &lt;TextView            android:id=""@+id/text""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:textColor=""#FFF""            android:padding=""5dp"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I want to be able to hide/show the seperate LinearLayout with id 'view' and then let the MapView resize according to the space left. When I try this the seperate LinearLayout is never shown. I'm not sure what is going on! Is the LinearLayout forever hidden? is it behind the Mapview?</p><pre><code>private void showMessage() {    LinearLayout layout = (LinearLayout) findViewById(R.id.view);    layout.setVisibility(View.VISIBLE);}private void hideMessage() {    LinearLayout layout = (LinearLayout) findViewById(R.id.view);    layout.setVisibility(View.GONE);}</code></pre>","253612","","253612","","2010-08-25 14:48:28","2012-01-09 13:33:23","Android Resize MapView after Visbility change","<java><android><google-maps>","1","2","","",""
"3567019","1","3567385","","2010-08-25 14:39:31","2","1569","<p>I'm trying to make a canvas where the client can sign his name. It works well in Chrome v6:<img src=""http://i.stack.imgur.com/dYF0L.jpg"" alt=""alt text""></p><p>but on Android 1.5 instead of drawing the browser scrolls the page and draws nothing:<img src=""http://i.stack.imgur.com/gVvWA.jpg"" alt=""alt text""></p><p>I borrows the code from <a href=""http://devfiles.myopera.com/articles/649/example2.js"" rel=""nofollow"">Opera's website</a>.Can I disable the scrolling or how can I make this work? </p><p>Thank you!</p><p><strong>EDIT</strong></p><p>using the events <code>touchstart</code>, <code>touchmove</code> and <code>touchend</code>:</p><p>on a LG GW620R using a stylus:<img src=""http://i.stack.imgur.com/kYD8h.jpg"" alt=""alt text""></p><p>on a Motorola Milestone:<img src=""http://i.stack.imgur.com/mDi5D.jpg"" alt=""alt text""></p><p>on a Samsung Galaxy:<img src=""http://i.stack.imgur.com/80ty7.jpg"" alt=""alt text""></p><p><strong>EDIT 2</strong>works better whitout using the finger nail</p>","286557","","286557","","2010-08-25 15:49:18","2011-07-22 12:32:13","Paint on Canvas in Android's browser, page scroll?","<javascript><android><browser><html5><canvas>","3","0","0","",""
"3567312","1","3568992","","2010-08-25 15:05:48","15","31926","<p>I have done some extensive searching for code examples on this but cannot find anything. </p><p>In particular, I am looking to add a shadow to a png drawable I am using in an ImageView.  This png drawable is a rounded rect with transparent corners.</p><p>Can somebody please provide a code example of how to add a decent drop shadow to a view either in code or XML?</p>","69634","","","","","2013-05-07 14:29:36","Android Drop Shadow on View","<android><xml><imageview><shadow><dropshadow>","2","0","13","",""
"3567360","1","","","2010-08-25 15:10:34","0","355","<p>I've got the following code which gets information from a database and plots it on a map. The information is there and clickable but the actual icon <code>androidmarker</code> is not visable. Why? How do I fix this?</p><pre><code>public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tweets = new LocationData(this);    mapView = (MapView) findViewById(R.id.mapView);    mapView.setSatellite(true);    mc = mapView.getController();    mc.setZoom(17);    mapView.setBuiltInZoomControls(true);    // Add the MyPositionOverlay    positionOverlay = new MyPositionOverlay();    List&lt;Overlay&gt; overlays = mapView.getOverlays();    overlays.add(positionOverlay);    //Add the Mapitems Overlay.    mapOverlays = mapView.getOverlays();    Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);    itemizedoverlay = new Mapitems(drawable, this);    mylocation();    distance(lat,lng);    addmark();    mapView.invalidate();}public void addmark(){    SQLiteDatabase db = tweets.getWritableDatabase();    String count = ""SELECT * FROM tweets;"";    Cursor mcursor = db.rawQuery(count, null);    startManagingCursor(mcursor);    mcursor.moveToFirst();      if(mcursor != null &amp;&amp; mcursor.moveToFirst())    {            do            {                System.out.println(""WHAT"");            String tname = mcursor.getString(4);            String tmessage = mcursor.getString(7);            Double tlat = mcursor.getDouble(1);            System.out.println(""lat"" + tlat);            Double tlng = mcursor.getDouble(2);            System.out.println(""lng"" + tlng);            GeoPoint point = new GeoPoint(                    (int) (tlat*1E6),                    (int) (tlng*1E6));            OverlayItem overlayitem = new OverlayItem(point, tname, tmessage);            itemizedoverlay.addOverlay(overlayitem);            mapOverlays.add(itemizedoverlay);            }while(mcursor.moveToNext());    }}</code></pre>","358438","","86860","","2010-08-25 15:17:42","2010-08-25 15:49:09","Marker icon not showing up but is clickable","<java><android><google-maps>","1","2","","",""
"3567420","1","","","2010-08-25 15:15:30","10","5456","<p>I am trying to write an application that will dynamically load data to map while user pans or zooms it.  </p><p>I need to track when the map is finished to change its view state (stops panning or zooming) and then load a new portion of data for creating markers. But in fact Google Maps API doesn't have any events to handle this.  </p><p>There are some methods like creating an empty overlay to control <code>onTouch</code> events and so on, but map panning could last long after user finished his touch because GMaps use some kind of inertia to make the pan smoother.</p><p>I tried to subclass <code>MapView</code> but its <code>draw()</code> method is <code>final</code> thus it cannot be overridden.</p><p>Any ideas how to make precise handling of pan and zoom finishing?</p>","422913","","128421","","2012-04-09 18:57:11","2012-04-09 18:57:11","How to catch that map panning and zoom are really finished?","<android><google-maps><drag><dynamic-data>","2","0","10","",""
"3567595","1","3569182","","2010-08-25 15:29:54","0","1760","<p>I'm trying to implement a ContentProvider wrapped around an SQLite database.</p><p>I've followed the tutorial here in building my ContentProvider: <a href=""http://thinkandroid.wordpress.com/2010/01/13/writing-your-own-contentprovider/"" rel=""nofollow"">tutorial</a></p><p>I want to test what I have; so I'm attempting to instantiate my new ContentProvider, retrieve a Cursor from the query handler, and attach it to my CursorAdapter.  Currently, I'm doing this in the onCreate of my Activity (I know this is bad practice, I'm just testing, I will move it to a service eventually).</p><pre><code>Uri uri = Uri.parse(""content://com.test.db.providers.Messages/messages"");String s[] = {""_id"", ""delivery_id"", ""user_id"", ""created_on"", ""subject"", ""summary"", ""messagetext"", ""read"", ""status""};MessagesProvider p = new MessagesProvider();if (p.open()) {   Cursor messages = p.query(uri, s, null, null, null);   startManagingCursor(messages);}</code></pre><p>When I launch my application, the onCreate method of my extended ContentProvider gets executed.  The database helper object gets created, the database gets created, and the onCreate method returns true.  However, when I try to use my ContentProvider (with the code above), in the open() method the database helper object gets created, but getWritableDatabase() returns null.  Also, when I call open(), the reference to getContext() is null.</p><p>Note: everything else seems to be working fine.  When I call query, it hits my query handler, recognizes the Uri and attempts to run my query code (which obviously blows up because the database object is null).</p><p>Here are my extended ContentProvider and database helper:</p><pre><code>package com.test.db.providers;import android.content.ContentProvider;import android.content.ContentUris;import android.content.ContentValues;import android.content.UriMatcher;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.net.Uri;import com.test.db.DbDefinitions;import com.test.db.DbHelper;public class MessagesProvider extends ContentProvider { private DbHelper mDbHelper;    private SQLiteDatabase mDb;    private static final UriMatcher sUriMatcher;    private static final String PROVIDER_NAME = ""com.test.db.providers.Messages"";    private static final Uri CONTENT_URI = Uri.parse(""content://"" + PROVIDER_NAME + ""/messages""); public static final String id = ""_id""; public static final String delivery_id = ""delivery_id""; public static final String user_id = ""user_id""; public static final String created_on = ""created_on""; public static final String subject = ""subject""; public static final String summary = ""summary""; public static final String messagetext = ""messagetext""; public static final String status = ""status"";    private static final int MESSAGES = 1;    private static final int MESSAGES_ID = 2;    static {     sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);     sUriMatcher.addURI(PROVIDER_NAME, ""messages"", MESSAGES);     sUriMatcher.addURI(PROVIDER_NAME, ""messages/#"", MESSAGES_ID);    }    public boolean open() {        mDbHelper = new DbHelper(getContext());        mDb = mDbHelper.getWritableDatabase();        return (mDb == null) ? false : true;    }    public void close() {     mDbHelper.close();    }    @Override    public boolean onCreate () {     mDbHelper = new DbHelper(getContext());     mDb = mDbHelper.getWritableDatabase();     return (mDb == null) ? false : true;    }    @Override    public String getType (Uri uri) {     switch (sUriMatcher.match(uri)) {      case MESSAGES:       return ""vnd.android.cursor.dir/com.test.messages"";      case MESSAGES_ID:       return ""vnd.android.cursor.item/com.test.messages"";      default:       throw new IllegalArgumentException(""Unknown URI "" + uri);     }    }    @Override    public Cursor query (Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {     switch (sUriMatcher.match(uri)) {      case MESSAGES:       return queryMessages(uri, projection, selection, selectionArgs, sortOrder);      default:       throw new IllegalArgumentException(""Unknown Uri "" + uri);     }    }    @Override    public Uri insert (Uri uri, ContentValues initialValues) {     switch (sUriMatcher.match(uri)) {   case MESSAGES:    return insertMessages(uri, initialValues);   default:    throw new IllegalArgumentException(""Unknown URI "" + uri);     }    }    @Override    public int update (Uri uri, ContentValues values, String selection, String[] selectionArgs) {     switch (sUriMatcher.match(uri)) {      case MESSAGES:       return updateMessages(uri, values, selection, selectionArgs);      default:       throw new IllegalArgumentException(""Unknown URI "" + uri);     }    }    @Override    public int delete (Uri uri, String selection, String[] selectionArgs) {     switch (sUriMatcher.match(uri)) {   case MESSAGES:    return deleteMessages(uri, selection, selectionArgs);   default:    throw new IllegalArgumentException(""Unknown URI "" + uri);     }    }    /*     * Messages     */    private Cursor queryMessages(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {     Cursor c = mDb.query(DbDefinitions.TABLE_MESSAGES, projection, selection, selectionArgs, null, null, sortOrder);     if (c != null) {      c.moveToFirst();     }     return c;    }    private Uri insertMessages(Uri uri, ContentValues initialValues) {  ContentValues values;  if (initialValues != null)   values = new ContentValues(initialValues);  else   values = new ContentValues();  long rowId = mDb.insert(DbDefinitions.TABLE_MESSAGES, summary, values);  if (rowId &gt; 0) {   Uri messageUri = ContentUris.withAppendedId(CONTENT_URI, rowId);   getContext().getContentResolver().notifyChange(messageUri, null);   return messageUri;  }  throw new SQLException(""Failed to insert new message "" + uri);    }    private int updateMessages(Uri uri, ContentValues values, String where, String[] whereArgs) {     int result = mDb.update(DbDefinitions.TABLE_MESSAGES, values, where, whereArgs);     getContext().getContentResolver().notifyChange(uri, null);     return result;    }    public int deleteMessages(Uri uri, String where, String[] whereArgs) {     // TODO flag message as deleted     return 0;    }}package com.test.db;import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;public class DbHelper extends SQLiteOpenHelper { public DbHelper(Context context) {  super(context, DbDefinitions.DATABASE_NAME, null, DbDefinitions.DATABASE_VERSION); } @Override    public void onCreate(SQLiteDatabase db) {     db.execSQL(DbDefinitions.DB_CREATE);     db.execSQL(DbDefinitions.DB_TEST_DATA);    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {     // TODO run upgrade string     db.execSQL(""DROP TABLE IF EXISTS "" + DbDefinitions.TABLE_MESSAGES);     onCreate(db);    }}</code></pre><p>I'm wondering if I should somehow be referencing whatever instance of MessagesProvider was created when I launched the application, instead of declaring a new one (p) and using it?</p><p>I updated the onCreate code in my Activity to the following, but managedQuery returned null:</p><pre><code>Uri uri = Uri.parse(""content://com.test.db.providers.Messages/messages"");String s[] = {""_id"", ""delivery_id"", ""user_id"", ""created_on"", ""subject"", ""summary"", ""messagetext"", ""read"", ""status""};Cursor messages = managedQuery(uri, s, null, null, null);if (messages != null)    startManagingCursor(messages);ExampleCursorAdapter msg =     new ExampleCursorAdapter(this, messages);setListAdapter(msg);</code></pre>","406790","","406790","","2010-12-30 17:37:15","2010-12-30 17:37:15","Extended ContentProvider not behaving properly","<android><sqlite><cursor><android-contentprovider>","2","5","","",""
"3567649","1","","","2010-08-25 15:35:31","0","535","<p>I'm completely stumped on the use of <code>ViewGroup</code> and adding views programmatically. I've got an overriden <code>ViewGroup</code> class to which I want to add a <code>View</code>.  Here is the constructor:</p><pre><code>public TestView(Context context) {    super(context);    textView = new TextView(context);    textView.setText(""This is a test."");    textView.setId(1);    textView.setTextColor(Color.rgb(0, 0, 0));    textView.setVisibility(VISIBLE);    addView(textView,        new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));}</code></pre><p>I can see everything I draw in the <code>ViewGroup</code>'s <code>onDraw()</code> override, but I never see the textView getting drawn. This should be easy, so what am I missing?</p><p>Thanks!</p>","430890","","194309","","2011-07-02 07:19:53","2011-07-02 07:19:53","adding a View programmatically","<android>","2","0","","",""
"3567651","1","3567683","","2010-08-25 15:35:54","2","2110","<p>In the Dev guide's Icon Design Guidelines, there is a recommended color palette given for the Launcher icon. If you look at the HEX color codes in the bottom row, the green and the orange are given the same code (#FF6600). This is the correct code for the orange, so what is the correct code for the green?</p>","430891","","","","","2010-08-25 16:12:41","Correct HEX code for Android Recommended Palette","<android>","1","1","","",""
"3567667","1","3568305","","2010-08-25 15:37:14","25","4019","<p>I'm quite new to Android development.</p><p>When is it a good idea to create an Android Service instead of just using a simple Singleton class?</p><p>Take, for example, the data layer downloading information feeds from the internet.</p><p>Using a Service seems too much for some cases but sometimes I might need access to a <code>Context</code> so I'm a little unsure about how to design the app.</p>","3055","","","","","2010-08-25 16:45:52","Android: When to use Service vs Singleton?","<android><android-service>","1","0","11","",""
"3567681","1","3654608","","2010-08-25 15:38:18","2","1632","<p>I'm currently having trouble with a SlidingDrawer. I want it to be closed when the application starts so it doesn't get in the way. However, it is determined that it will be open, despite putting <code>slide.close()</code> in the onCreate() of my activity. It seems to be closed if i use <code>slide.animateClose()</code> instead, but this slows my application down loads. </p><p>How do I make it closed by default?</p><p>Cheers</p><pre><code>    &lt;SlidingDrawer     android:layout_width=""fill_parent""     android:padding=""4dp""     android:id=""@+id/Mnu_Slide""     android:content=""@+id/Mnu_SlideCont""     android:handle=""@+id/Mnu_SlideBtn""     android:layout_gravity=""bottom""     android:layout_height=""112dp""&gt;    &lt;ImageView         android:id=""@id/Mnu_SlideBtn""         android:src=""@drawable/handle1""         android:layout_height=""wrap_content""         android:layout_width=""wrap_content"" /&gt;    &lt;LinearLayout         android:id=""@id/Mnu_SlideCont""         android:layout_height=""wrap_content""         android:layout_width=""fill_parent""         android:orientation=""horizontal""         android:gravity=""center_vertical|center_horizontal"" android:background=""@drawable/tray1xml""&gt;            &lt;ImageView                 android:id=""@+id/Mnu_Chem""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:src=""@drawable/icon"" /&gt;            &lt;ImageView                 android:id=""@+id/Mnu_Physics""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:src=""@drawable/physicon"" /&gt;    &lt;/LinearLayout&gt; &lt;/SlidingDrawer&gt;</code></pre>","428665","","","","","2010-09-06 22:26:00","Android SlidingDrawer default state?","<android><android-widget><slidingdrawer>","1","0","","",""
"3567732","1","3576941","","2010-08-25 15:43:10","0","696","<p>I have implemented the SectionIndexer on my Adapter and the FastScroll as well. The fast scroll appears, but the alphabetic indexer is always ""A"" as I scroll</p><p>The list is about 1000 items long.</p><p>Here's my implementation of the SectionIndexer.</p><pre><code>    @Override    public int getPositionForSection(int section) {        return alphaIndexer.getPositionForSection(section);    }    @Override    public int getSectionForPosition(int position) {        return alphaIndexer.getSectionForPosition(position);    }    @Override    public Object[] getSections() {        return alphaIndexer.getSections();    }</code></pre>","172861","","","","","2010-08-26 15:58:18","Android SectionIndexer Does not Show Alphabetic Preview beyond ""A""","<android>","1","0","","",""
"3567753","1","3567870","","2010-08-25 15:46:13","7","4639","<p>I want to develop a small Android app to measure the current noise level (probablyin dB). But I have no idea what to look for in the libs. I don't want to record the noise. Can someone give me a pointer what classes to look at?</p>","324531","","","","","2013-02-05 10:19:18","Query noise level in Android","<android><microphone><noise>","3","0","5","",""
"3567954","1","3568735","","2010-08-25 16:09:46","0","1166","<p>Im dragging my images into the drawable-hdpi folder in Eclipse and when I load them in the program they are 2/3rd the original size. (my 500x150 .png is being loaded as a 333x100 .png)Any advice on how I should be creating/loading images for android?</p><pre><code>private Bitmap mGrass;BitmapFactory.Options options = new BitmapFactory.Options();options.inPreferredConfig = Bitmap.Config.ARGB_8888;mGrass = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.grass, options);canvas.drawBitmap(mGrass, 0, 0, noPaint);</code></pre>","430919","","","","","2010-08-25 17:44:26","Displaying PNG files in android (images being resized)","<android><png>","1","0","1","",""
"3568021","1","","","2010-08-25 16:17:31","1","968","<p>Is there any way that we can send a request invitation to user/friend from facebook android sdk?  </p><p>Thank you very much.</p><p>Best Regards,Eve</p>","430926","","","","","2012-11-02 08:53:13","Facebook android sdk send request","<android><facebook>","1","0","","",""
"3568142","1","","","2010-08-25 16:29:19","5","3125","<p>I have an application that I'd like to add auto-update functionality (its not in the marketplace).  I have all the code in place that would check to see if there is an update available and then i call something like this:</p><p>Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse(Configuration.APK_URL));c.startActivity(intent);  </p><p>which starts downloading the file, although is there a way that I can programatically tell it to ""open"" the file to begin the installation process without the user having to go to the downloads and clicking on it?</p>","424477","","","","","2012-01-05 19:40:37","Android: how to open an apk file after downloading for auto-update?","<android>","2","0","5","",""
"3568182","1","3568288","","2010-08-25 16:32:41","2","6008","<p>So I am going through the Android development tutorial and I have run into an early problem when creating menus. I created a folder under <code>res</code> called <code>menu</code> and put in <code>game_menu.xml</code> as I was told. </p><p>But the line <code>inflater.inflate(R.menu.game_menu, menu);</code> is telling me that <code>R.menu</code> cannot be resolved. As I probably shouldn't edit <code>R.java</code> by hand, I would appreciate some help on what to do.</p>","430945","","321366","","2011-12-02 14:25:32","2013-11-12 05:14:38","R.menu cannot be resolved","<java><android>","4","0","","",""
"3568227","1","","","2010-08-25 16:36:52","1","1754","<p>I have an application that acts like a clapperboard, in which I use a variable i going to i++ every millisecond (I need milliseconds to display frames per second, and the chronometer updates only once per second), then I display it in the format HH:MM:SS:FF. I also have a quit button which goes by</p><pre><code>if (item.getTitle() == ""Quit"") {Process.killProcess(id);}</code></pre><p>The problem is that I want the app to remember the value of i when I press quit, so the timer would start at the same point it was before quitting it if I start it again.I tried</p><pre><code>public void onSaveInstanceState(Bundle outState) {outState.putLong(MILLISECONDS, i);super.onSaveInstanceState(outState);}</code></pre><p>then calling it by</p><pre><code>public void onStart(Bundle savedInstanceState) {super.onStart();i = savedInstanceState.getLong(MILLISECONDS);}</code></pre><p>and</p><pre><code>public void onRestoreInstanceState(Bundle savedInstanceState) {super.onRestoreInstanceState(savedInstanceState);i = savedInstanceState.getLong(MILLISECONDS);}</code></pre><p>but it doesn't work.Also if I go with</p><pre><code>onCreate(Bundle savedInstanceState) {...i = savedInstanceState.getLong(MILLISECONDS);...}</code></pre><p>the app force closes.Any idea of what I'm doing wrong, please? Thank you very much.</p>","425830","","15168","","2013-12-31 01:20:34","2013-12-31 01:20:34","Android onSaveInstance State not working (for me)","<android><variables>","2","0","","",""
"3568250","1","12537450","","2010-08-25 16:39:37","7","1518","<p>I am developing an app with numerous Activities.  I would like to create a persistent notification that (more or less) says, ""AppName - Return to AppName"" that will be present whenever my background services are running.  <em>Creating and disposing of the notification was no problem.</em></p><p>Now, the user could be on any of several screens/Activities, leave the application, then want to re-enter the app via the notification.  <strong>The problem is</strong>, the notification must have an intent, which launches a <strong>predetermined Activity</strong>.  I want the notification to re-enter the app in <strong>whatever Activity is at the top of the history stack</strong>.</p><p>My first attempt at an ugly workaround was to make an activity (let's call it ""returnFromNotify"") whose only job was to ""finish"" itself in it's ""onCreate"".  The notification would open ""returnFromNotify"" in the scope of the applications history, which would then immediately remove itself, sending the user back to the previous history state in the application stack.  This seems to work... unless the user has used ""back"" to completely back out of the app.  Then, when they hit the notification, ""returnFromNotify"" loads, then finishes, sending them back out to the home screen (as there are no activities in the history stack for the app).</p><p>I considered trying to detect if there was anything in the history stack before ""returnFromNotify"", and if not, fire up my main Activity.  I can't seem to find a way to do this, either.</p><p>Any input or suggestions for a Java/Android novice?  FYI, My primary history is with script-based languages.</p>","397122","","258497","","2010-08-31 17:34:52","2012-09-21 20:03:38","Use a persistent notification to allow the user to return to running Android app","<android><notifications><history><android-notifications>","5","0","5","",""
"3568406","1","","","2010-08-25 16:58:45","-1","1854","<p>Hos do I make a list with notifications in the notification bar (the pull down menu with USB connection mode etc)?</p>","430976","","70386","","2011-04-18 13:33:22","2013-07-14 14:38:50","Android notification","<android>","1","1","1","",""
"3568414","1","3568439","","2010-08-25 16:59:07","1","1032","<p>I've got an iphone app and I'm looking to port some of the data-layer objective-c code to a scripting language which can also run on an android phone.</p><p>Any suggestions on what to use? I'd also like to be able to push new scripts to the app for bug fixes. Not sure if this is against the iphone SDK agreement or not.</p>","430975","","","","","2010-08-25 19:11:33","Common scripting language that can be used on Android and iPhone","<iphone><android>","4","0","","",""
"3568635","1","","","2010-08-25 17:33:00","9","2864","<p>I am trying to create a Android application that uses an existing web service. However, the existing web service uses Kerberos for authentication and I am having trouble getting Android using the android-xmlrpc library to authenticate with the service. If anyone has any experience with this, please respond.</p><p>I am completely new to this kind of stuff, so any advice would be greatly appreciated!</p><p>Thanks,Dave</p>","431007","","","","","2011-11-17 21:06:47","Android authenticating with Kerberos","<android><kerberos><xml-rpc>","1","1","2","",""
"3568657","1","","","2010-08-25 17:34:36","1","584","<p>I have a jar that I need to reference from my Android project. I also have the src of the jar, so I could include it in the project itself. I was wondering if referencing a jar vs. compiling it in with the project using Dalvik makes any difference in terms of final Dalvik package size that gets generated.</p>","431013","","","","","2012-06-28 07:03:49","Reference a jar or compile it with Dalvik?","<android><dalvik>","2","0","1","",""
"3568764","1","","","2010-08-25 17:47:35","0","551","<p>I'm looking for a way to make Overlayitem hold more than just a title and snippet, e.g a link to a picture, a music file playing.. something like that. is this possible?</p>","358438","","","","","2011-06-08 06:26:38","OverlayItem hold more than title + snippet","<java><android><google-maps>","1","0","","",""
"3568919","1","4631206","","2010-08-25 18:08:03","13","7098","<p>Heres the dilemma:I am showing a screen with 3 input fields and 2 buttons inside of a tab(there are 3 tabs total, and they are on the bottom of the screen).  the 2 buttons are set to the bottom left and right of the screen, right above the tabs.  when i click on an input field, the tabs and buttons are all pushed up on top of the keyboard.</p><p>i desire to only push the buttons up, and leave the tabs where they originally are, on the bottom.  i am thinking of setting the visibility of the tabs to GONE once i determine that the soft keyboard is showing, and visibility to VISIBLE once the soft keyboard is gone.</p><p>is there some kind of listener for the soft keyboard, or maybe the input field? maybe some tricky use of <code>OnFocusChangeListener</code> for the edit text?  How can i determine whether the keyboard is visible or not?</p>","416412","","","","","2011-07-07 13:41:42","Android: how can i tell if the soft keyboard is showing or not?","<android>","3","0","1","",""
"3568961","1","3569007","","2010-08-25 18:14:26","6","630","<p>I have some images in my drawable folder and they have landscape versions in drawable-land. However I want some of the landscape images to be shared, as it seems a waste to duplicate the file with a different name. Is it possible to make a sym link (shortcut) or something for one of the duplicated files to prevent wasting space</p><p>Folder explanation below as I'm not great at explaining myself:</p><pre><code>/drawable &gt; image1.png&gt; image2.png /drawable-land&gt;image1.png  &lt;-- This image&gt;image2.png  &lt;-- is identical to this file</code></pre>","315998","","","","","2010-08-25 18:20:23","Avoiding duplicate resources in android project","<android><image><resources><drawable>","1","0","2","",""
"3569138","1","","","2010-08-25 18:37:50","0","47","<p>Is there a simple way to get the CREATE string from each of your tables in Android instead of redefining them in onCreate override.  I am annoyed enough to just parse the whole thing for each table, but I am hoping there is an easier way I have not found yet.</p>","431077","","","","","2010-08-25 18:48:07","pulling ""Create"" strings from SQLite3 databases","<android><sqlite3><oncreate>","1","0","","",""
"3569280","1","","","2010-08-25 18:58:03","0","2330","<p>I am pretty new to Android and mobile development in general. I am creating an Android application that plays a video using VideoView after a button is selected. The problem is when you rotate the phone the video restarts. I know its because the activity is destroyed and recreated when it is rotated. So I just locked the video player in landscape view. But by default you have to tilt the phone to the left (right side up) to be able to see it correctly. The other way just shows the video upside down.</p><p>Is there a way to show the video correctly if the user tilts the phone to the right (left side up)? Thanks for any input.</p>","469194","","","","","2014-02-18 08:37:49","Android VideoView Landscape Orientation Problem","<android><rotation><orientation><screen-orientation><videoview>","2","0","","",""
"3569313","1","3572335","","2010-08-25 19:02:01","7","11565","<p>I've exported an apk from eclipse. I am able to install it without any problem if I copy it to the phone's sd card.</p><p>When trying to download via phone's (Galaxy S) browser I get:""Download unsuccessful"".</p><p>I have set mime type application/vnd.android.package-archive in the mime.types, restarted apache, still same result.Also tried :</p><pre><code>&lt;a href=""downloads/my_apk.apk"" type=""application/vnd.android.package-archive""&gt;Download App&lt;/a&gt;</code></pre><p>Still no luck.</p><p>I am able to download and install applications from android market. I suspect that apache is not sending the mime type but this is just a shot in the dark.How can I fix the problem and be able to install APKs from my web server? (or at least to check if apache sends correct header with mime type)</p><p>Any help will be appreciated.</p>","425183","","425183","","2010-08-25 19:19:24","2011-06-03 01:59:54","Can't install APK hosted my own apache server","<android>","3","2","4","",""
"3569314","1","3570646","","2010-08-25 19:02:03","1","1084","<p>Can anyone help me to create footer in a grid view for Android? I have a grid view which displays the images in the net below that I'm using a textview to display <code>click here to view more images</code>. My problem is to display the message in the gridview. Please help on regarding this one.</p>","424413","","1128737","","2012-01-12 16:36:58","2013-12-10 08:53:11","Need help in the creation of footer in grid view","<android>","2","0","","",""
"3569315","1","","","2010-08-25 19:02:06","28","51085","<pre><code>package supa.mack.doppler;import java.util.Set;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;import android.bluetooth.*; import android.widget.Toast;public class doppler_test extends Activity {TextView out;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);out = (TextView) findViewById(R.id.out);// Getting the Bluetooth adapterBluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();out.append(""\nAdapter: "" + adapter);// Check for Bluetooth support in the first place // Emulator doesn't support Bluetooth and will return nullif(adapter==null) { out.append(""\nBluetooth NOT supported. Aborting."");return;}// Starting the device discoveryout.append(""\nStarting discovery..."");adapter.startDiscovery();out.append(""\nDone with discovery..."");// Listing paired devicesout.append(""\nDevices Pared:"");Set&lt;BluetoothDevice&gt; devices = adapter.getBondedDevices();for (BluetoothDevice device : devices) {out.append(""\nFound device: "" + device);}Button searchButton=(Button) findViewById(R.id.search_button);searchButton.setOnClickListener(new View.OnClickListener(){public void onClick(View v) {Intent intent=new Intent(doppler_test.this,search_result.class);startActivity(intent);}}); }} </code></pre><p>--------------------------------------…</p><p>Here is the code where the problem lies....</p><p>It doesn't give me an error it says exactly this when I run the android emulator</p><pre><code>""[2010-08-25 09:12:42 - doppler_test] ActivityManager: Warning: Activity not started, its current task has been brought to the front""</code></pre><p>What I think this means is that the intent of the bluetooth function and the button intent is only operation on a hierarchy system. What I mean by this is that if I were to move the button opperator above the Bluetooth stuff the button will work, but currently when the app is run Bluetooth works but when I press the search button nothing happens.</p><p>What else may be helpful is my XML code for the button so here it is......</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.co…android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:gravity=""center_horizontal""android:background=""@color/purple_flurp""…&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""@string/hello""/&gt;&lt;Buttonandroid:id=""@+id/search_button""android:layout_height=""wrap_content"" android:text=""@string/search"" android:layout_width=""fill_parent""/&gt;&lt;TextView android:text=""@+id/TextView01"" android:id=""@+id/out"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>--------------------------------------…</p><p>any ideas?Anything would be great!Thanks</p>","431097","","","","","2013-09-16 09:47:20","ActivityManager: Warning: Activity not started, its current task has been brought to the front","<android><eclipse><bluetooth>","5","0","7","",""
"3569351","1","","","2010-08-25 19:07:49","0","1505","<p>sorry for my English.</p><p>I'm developing an Android application, consisting in various activities and a service which is activated by ""main"" activity. The service checks every 3 seconds (this interval is arbitrary) about active network connections into mobile phone. If there's a connection to a PC inside my local network, I then make a call to a web server there.</p><p>The problem is, I try to reach host PC through this function:</p><pre><code>public boolean checkNet() {    HttpClient client;    HttpPost postMethod;    HttpParams httpParams;    URI uri;    try {        uri = new URI(Const.HOST_ADDRESS);        postMethod = new HttpPost(uri);        postMethod.addHeader(""Content-Type"", ""text/xml"");        httpParams = postMethod.getParams();        HttpConnectionParams.setSoTimeout(httpParams, 1000);        HttpConnectionParams.setSocketBufferSize(httpParams, 512);        HttpConnectionParams.setStaleCheckingEnabled(httpParams, false);        HttpConnectionParams.setConnectionTimeout(httpParams, 1000);        client = new DefaultHttpClient();    }    catch (URISyntaxException use) {}    try    {         client.execute(postMethod);         return true;    }    catch (ClientProtocolException cpe) {    }    catch (IOException e) {    }    return false;}</code></pre><p>I do use this method, instead of checking WifiManager's and internal Android methods, because I have a situation like this: I can be connected to an open-encryption AP, but it has a login system (coova). Here, I can be associated (and have an IP inside LAN), but if I'm not logged I won't have access to any network, so I have to implement a ""network-checking-wrapper"".</p><p>So, if there was an exception in execute function because my host PC isn't reachable, DDMS will show me how heap size and allocation size will grow without control. I suspect that it's because of the sub-calls inside ""execute"" don't properly close obsolete references... for instance, here's a example of allocation tracker:</p><pre><code>java.lang.AbstractStringBuilder enlargeBuffer AbstractStringBuilder.java 99 false java.lang.AbstractStringBuilder append0 AbstractStringBuilder.java 170 false java.lang.StringBuilder append StringBuilder.java 224 false org.apache.http.conn.HttpHostConnectException &lt;init&gt;    HttpHostConnectException.java 48 false org.apache.http.impl.conn.DefaultClientConnectionOperator openConnection DefaultClientConnectionOperator.java 133 false org.apache.http.impl.conn.AbstractPoolEntry open AbstractPoolEntry.java 164 false org.apache.http.impl.conn.AbstractPooledConnAdapter open AbstractPooledConnAdapter.java 119 false org.apache.http.impl.client.DefaultRequestDirector execute DefaultRequestDirector.java 348 false </code></pre><p>Thanks in advance.</p>","431101","","10593","","2011-01-04 05:31:01","2012-09-22 14:55:40","Android's memory leak because of HttpClient","<android><memory-leaks><httpclient>","2","1","","",""
"3569412","1","","","2010-08-25 19:15:22","7","13712","<p>I am unable to customize my checkbox , although I have defined the background in the xml preference file, it doesn't pull the file.1. I am trying to display custom images for checkbox and have defined the selector xml as ""android_button.xml"" which looks like :</p><pre><code>   &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_checkable=""true""      android:drawable=""@drawable/state_normal"" /&gt; &lt;!-- pressed --&gt;&lt;item  android:state_checked=""true""      android:drawable=""@drawable/android_pressed"" /&gt; &lt;!-- focused --&gt;&lt;item android:drawable=""@drawable/state_normal"" /&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p>state_normal and android_pressed are two .png images in res>drawable folder.</p><p>2.my Checkbox preference.xml file is :</p><pre><code>          &lt;CheckBoxPreference android:key=""@string/Drop_Option""            android:title=""Close after call drop""            android:defaultValue=""true""            android:background=""@drawable/android_button""            /&gt;</code></pre><p>Is there any error in the definition, The only change that shows up in screen is the android:title text, if I change the text, it changes the text. Nothing else changes. How do I fix this. Thank you for your suggestion. </p>","357349","","","","","2012-05-07 22:50:37","customize check box preference","<android><android-emulator><android-manifest>","1","0","6","",""
"3569509","1","3569536","","2010-08-25 19:27:49","1","363","<p>I really like the toolbar in Astro app for Android and I was wondering: Do you know if it is reusable component, is it open source, if yes - where to find it; if not - can you provide a link to similar open source component.</p><p><img src=""http://i.stack.imgur.com/AQodw.png"" alt=""alt text""></p>","425183","","","","","2010-08-25 19:30:54","Reusable component: toolbar like in astro app for Android","<android><android-ui>","1","0","","",""
"3569580","1","","","2010-08-25 19:37:02","2","4588","<p>i am using grid view for display images,so i want to add text or button ie ""Next Images"" gridview end,its like footer of grid view,anybody knows please give answer to me...</p><p>Thanks all</p>","410757","","69755","","2010-08-25 19:40:30","2011-01-15 15:29:15","How to add text or button in gridview end in android","<android>","2","0","","",""
"3569631","1","","","2010-08-25 19:45:09","0","223","<pre><code>package and.views;</code></pre><p>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;</p><p>public class androidView extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public boolean onCreateOptionsMenu(Menu menu)    {        super.onCreateOptionsMenu(menu);        menu.add(0,0, 0, ""AutoComplete"");         menu.add(0,1, 1, ""Button"");         menu.add(0,2, 2, ""CheckBox"");        menu.add(0,3, 3, ""EditText"");         menu.add(0,4, 4, ""RadioGroup"");        menu.add(0,5, 5, ""Spinner""); </p><pre><code>    return true;}/** Override onOptionsItemSelected to execute code for each menu item */public boolean onOptionsItemSelected(MenuItem item){    switch(item.getItemId())    {    case 0:        showAutoComplete();        return true;    case 1:        return true;    case 2:        return true;    case 3:        return true;    case 4:        return true;    case 5:        return true;    }    return true;}</code></pre><p>public void showAutoComplete()    {         Intent autocomplete = new Intent(this, AutoComplete.class);<br>   try{  </p><pre><code>    this.startActivity(autocomplete);</code></pre><p>}catch(Exception e){    System.out.print("" activity not found"");}   }}</p><hr><p>2nd class</p><pre><code>package and.views;</code></pre><p>import android.app.Activity;import android.graphics.Color;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.AutoCompleteTextView;import android.widget.Button;</p><p>public class AutoComplete extends Activity{    public void onCreate(Bundle icircle) {        super.onCreate(icircle);        setContentView(R.layout.autocomplete);       ArrayAdapter monthArray=new ArrayAdapter(this, android.R.layout.simple_list_item_1, Months);       final AutoCompleteTextView textView= (AutoCompleteTextView)findViewById(R.id.testAutoComplete);       textView.setAdapter(monthArray);       final Button changeButton=(Button)findViewById(R.id.testAutoComplete);       changeButton.setOnClickListener(new Button.OnClickListener(){          public void onClick(View v)          {              changeOption(textView);          }</p><pre><code>   });   final Button changeButton2 = (Button) findViewById(R.id.textColorButton);   changeButton2.setOnClickListener(new Button.OnClickListener()    { public void onClick(View v)   { changeOption2(textView);   }   });}   static final String[]Months= new String[]{ ""January"",""February"",""March"",""April"",""May"",""June"",""July"",""August"", ""September"",""October"",""November"",""December"" }; public void changeOption(AutoCompleteTextView text){     if (text.getHeight()==100){ text.setHeight(30);} else    {     text.setHeight(100);     } } public void changeOption2(AutoCompleteTextView text){     text.setTextColor(Color.RED); }}</code></pre><hr><p>Manifest file</p><pre><code>enter code here&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>                                                                            </p><pre><code>&lt;activity android:name="".AutoComplete"" android:label=""AutoComplete"" android:launchMode=""standard"" android:enabled=""true""&gt;</code></pre><p>                                            </p><p> </p>","431127","","","","","2011-04-02 07:23:38","using two or more activty on Android: code below, dont know whats the problem","<android><activity>","2","0","","",""
"3569679","1","","","2010-08-25 19:51:14","3","198","<p>I've been reading through the <a href=""http://developer.android.com/guide/publishing/licensing.html"" rel=""nofollow"">Android documentation</a> for implementing application licensing. Seems somewhat straight forward but it looks as though the example code is tailored for a full fledged android application and not a widget.</p><p>Is there an alternate way to implement application licensing for a widget app?</p><p>Thanks.Brianwww.jaydien.com</p>","416530","","","","","2011-04-05 20:47:02","How to properly license a Widget as opposed to an application?","<android><android-widget>","1","1","1","",""
"3569751","1","","","2010-08-25 19:58:20","1","2975","<p>I'm trying to write a resolution independent Android game. I have some text I want to render onto the canvas and use Paint.setTextSize(...) to set the size of the text. What does the parameter represent? The height of the letters in pixels?</p><p>I'm not sure how to set this parameter based on the density or size of the screen either. I generally want my text to fill a certain rectangle of the screen as well as possible (i.e. I want the text to get as close to the full height of the rectangle without the width of the text going outside the rectangle) but I'm not sure how I would do this. I know layouts and textview widgets could help but as it's a game I need a lot of flexibility in the presentation.</p>","431144","","","","","2012-04-27 00:47:51","What does the parameter to Paint.setTextSize() represent?","<java><android><gui>","1","0","","",""
"3569774","1","3570329","","2010-08-25 20:02:08","1","4280","<p>I am creating an app where i need to use map view and allow users to search for an address.However I do not need the full Maps app functionality. how can I perform a search like in The maps app ( where it auto completes the address) in my own MapVeiw?</p>","407133","","","","","2010-08-25 21:24:30","How To search for an address with MapView?","<android>","1","0","1","",""
"3569787","1","3570553","","2010-08-25 20:04:14","0","209","<p>Is there a way to craft a daemon process as to make it ""unlistable"" to a process viewer?</p><p>OR</p><p>is there a way to dynamically change a process name?</p><p>I'd like to design a security application without having to modify the firmware, if possible (yes I know about ""security through obscurity""...).</p>","171461","","171461","","2010-08-25 20:14:35","2010-08-25 21:56:40","unlisted android process","<android>","1","0","","",""
"3569884","1","3570305","","2010-08-25 20:18:02","0","165","<p>What I need to do is auto-register device if not already done and then start polling messages with the credentials I received through this registration.</p><p>Now, after I read quite a bit about services, threads, asynctasks and the AlarmManager I'm totally confused about how to handle this.</p><p>So, there are my two main tasks. What would you recommend as a not-too-silly approach</p><ol><li><p>RegistrationI'm currently spawning a service from my UI thread if there are no credentials saved in the DB. Inside this service I start an asynctask that POSTs my request to the server and receives the credentials for the new device. stopSelf ends the service.</p><p>Would you guys play it like that?</p></li><li><p>Polling. I have not a single clue how I should do that. I'd like to poll messages quite often during the app is on top, lets say every minute. Otherwise, when the app is not running I thought about using the setInexactRepeating() method of the AlarmManager and poll lets say every 15 minutes. </p></li></ol><p>Is there a better or a more gentle on resources way to do that?</p>","419501","","257111","","2012-04-30 21:33:12","2012-04-30 21:33:12","Confused about how to approach a registration and polling of messages with Android","<android><service><android-asynctask><alarmmanager>","1","0","","",""
"3569936","1","","","2010-08-25 20:26:53","0","1772","<p>I have some questions about the Android service and activity lifecycles. Hope you guys can help me out. I have written an application that uses GPS location and stores them. It must monitor the GPS location updates constantly to work properly.</p><p>Right now, it's all in one activity. So when you close the activity, you loose everything and can't continue monitor location updates. This is why I wanted to make a background service for the monitoring part. And I've been reading the Android Developer Guide and the Reference, but still can't fully understand the activity-service-process-lifecycle thing.</p><p>Consider this: you start the application. It gets a GPS fix and now you can start monitoring the location updates and save them. When you do so, it should start a service that receives GPS location updates. So now you have an activity AND a service running in the same process. Ok. But what happens if you push the hardware Back-button on your phone? Will only the activity be killed with the process still running your service? Or will it kill both, the activity and the service and thus also the process? Is there some way to ensure the service keeps running in the same process after the activity is killed? But a way not so complicated as the whole aidl thing for remote processes?</p><p>Creating a service in a new process seems unnecessary to me, because no other application should use my service, I just need the monitoring part to keep running while the (GUI) activity is dead. I wanted to make something like the Local Service example on the Developer site, but I must be sure the service keeps running after the activity is killed.</p>","243820","","","","","2010-08-25 20:50:11","Android Services and Activities","<android><process><service><activity><gps>","1","0","1","",""
"3569952","1","3570087","","2010-08-25 20:29:27","2","4148","<p>In my Android client I want to receive JSON objects from a server. By googling I found a lot of different possibilities how to best parse the InputStream from the Server, but most of them wrote their own parser. Isn't there a library which does this parsing for me? Or how should I best implement it by myself?</p>","","anon","","","","2013-01-24 03:31:17","Best practice to parse a JSON object on the client in Java & Android","<java><android><json>","5","0","1","",""
"3569964","1","3570519","","2010-08-25 20:30:32","3","1102","<p>I am using an SQLite database to store and retreive my app data, and what to check for duplicate entries. I attempt to retrieve all entries where the titles match, as such:</p><pre><code>Cursor c = mDb.query(DatabaseHelper.GOALS_TABLE_NAME,                      new String[] { Goals.GOAL_ID, Goals.TITLE },                      Goals.TITLE + ""='"" + title + ""'"", null, null, null,                      null, null);</code></pre><p>where title is the one to compare against. </p><p>This query runs, but the cursor gives a count of -1. A call without the where clause also returns -1, but I know data is present, as I am able to bind a list view to it.</p><p>Is there something I am missing, do I have to populate the cursor somehow?</p><p>Thanks in advance, </p><p>Venatu</p>","431176","","69755","","2010-08-25 20:32:53","2012-02-04 19:54:42","Cursor returns a count of -1, but items are present?","<android>","1","2","","",""
"3570146","1","3570172","","2010-08-25 20:59:09","4","2389","<p>Would like a button in my widget to fire the APPWIDGET_UPDATE intent on the widget class to force an update, but I dont see APPWIDGET_UPDATE as a static field in Intent.</p><p>Is this possible, and how would one do this?</p><pre><code>Intent intent = new Intent(context, BaseWidgetProvider.class);intent.setAction({APPWIDGET_UPDATE INTENT HERE})PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);views.setOnClickPendingIntent(R.id.MyWidgetButton, pendingIntent);</code></pre>","289182","","","","","2013-10-11 10:34:09","Is it possible to throw an intent for APPWIDGET_UPDATE programmatically?","<android>","2","0","3","",""
"3570255","1","3570327","","2010-08-25 21:13:40","1","1016","<p>I am getting the following error when I try to launch an activity containing a tabhost.  </p><blockquote>  <p>08-25 16:51:42.551:  ERROR/AndroidRuntime(27863):  java.lang.RuntimeException: Unable to  start activity  ComponentInfo{com.paratransit/com.paratransit.jobDialog}:  java.lang.RuntimeException: Could not  create tab content because could not  find view with id 2131165185</p></blockquote><p>This is my code.  Can anyone help?</p><p><strong>Java</strong></p><pre><code>public Class jobDialog extends TabActivity {    TabHost tabs; int jobCurrentTab = -1; @Override public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);        Bundle extras = getIntent().getExtras();        setContentView(R.layout.job_dialog);     tabs = getTabHost();        tabs.setup();     setupTabs(); } public void setupTabs() {           TabSpec tspec1 = tabs.newTabSpec(""First Tab"");      tspec1.setIndicator(""Summary"", getResources().getDrawable(R.drawable.tab_main)).setContent(R.id.jobDetail1);         tabs.addTab(tspec1);      TabSpec tspec2 = tabs.newTabSpec(""Second Tab"");      tspec2.setIndicator(""Details"", getResources().getDrawable(R.drawable.tab_message)).setContent(R.id.jobDetail2);      tabs.addTab(tspec2);      TabSpec tspec3 = tabs.newTabSpec(""Third Tab"");      tspec3.setIndicator(""Notes"", getResources().getDrawable(R.drawable.tab_jobs)).setContent(R.id.jobDetail3);      tabs.addTab(tspec3);</code></pre><p><strong>XML</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:padding=""5dp""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;       &lt;LinearLayout   android:id=""@+id/jobDetail1""      android:orientation=""vertical""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent"" &gt;     &lt;/LinearLayout&gt;         &lt;LinearLayout   android:id=""@+id/jobDetail2""      android:orientation=""vertical""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent"" &gt;     &lt;/LinearLayout&gt;    &lt;LinearLayout   android:id=""@+id/jobDetail3""      android:orientation=""vertical""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent"" &gt;     &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre>","355663","","9796","","2010-08-25 21:25:15","2012-10-03 14:08:27","Android tabhost issue...code included","<java><android><android-tabhost>","2","0","","",""
"3570311","1","3573158","","2010-08-25 21:21:58","3","2543","<p>I have a ScrolLView that wraps a ViewFlipper. The content in the ViewFlipper is not of equal height, so my second screen has a very long scrollbar that goes on and on with blank content:</p><pre><code>&lt;ScrollView android:id=""@+id/outer_scroll""xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:fillViewport=""true""&gt;&lt;ViewFlipper android:id=""@+id/flipper""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;EditText android:id=""@+id/desc"" style=""@style/DescriptionArea""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:enabled=""false"" android:focusableInTouchMode=""false""android:background=""@null"" /&gt;&lt;LinearLayout android:id=""@+id/details_root""android:orientation=""vertical"" android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:padding=""10dp""&gt;&lt;TextView android:id=""@+id/item_details"" style=""@style/DetailsLarge""android:textColor=""#000"" android:visibility=""gone""android:layout_width=""wrap_content"" android:layout_height=""fill_parent""android:text=""@string/item_details_tags"" /&gt;&lt;TextView android:id=""@+id/tags"" android:layout_width=""wrap_content""android:layout_height=""fill_parent"" android:textColor=""#000""android:visibility=""gone"" /&gt;&lt;/LinearLayout&gt;&lt;/ViewFlipper&gt;&lt;/ScrollView&gt;</code></pre><p>So, for example, the EditText block is very long, and the scroll bar captures it all. I fling to the LinearLayout, and the scrollbar continues way past the TextView content. I essentially need it to ""recalculate"" the view height.</p><p>Also, wrapping the EditText and LinearLayout within their own ScrollViews is not an option, because then the soft/virtual keyboard blocks the EditText content.</p>","213345","","","","","2012-01-17 13:19:48","Recalculate ScrollView on different ViewFlipper views?","<android><xml><scrollview><viewflipper>","2","1","2","",""
"3570362","1","3573115","","2010-08-25 21:29:57","2","482","<p>I have an activity that extends ViewFactory. The activity does nothing more than act as documentation for my app, with 5 different 'views'.</p><p>Each view is placed inside a ScrollView in a TextSwitcher. The problem that I am facing is that if one of the five views has more text than the next view, there is empty scroll space.</p><p>Any ideas on how I can get rid of this space?</p><p>Thanks!</p>","354607","","","","","2010-08-26 07:59:49","getting rid of extra space in text switcher","<android>","1","0","","",""
"3570409","1","","","2010-08-25 21:35:00","1","1920","<p>The company I work for is developing an Android App that plays a video file from a URL on web. Thevideo URL is a parameter for a PHP script that encode it properly and redirects to the encoded video as shown below:</p><pre><code>header('Content-Type: video/'.$format);header('Location:'.$output_video);</code></pre><p>Where <code>$output_video</code> is the URL to the encoded video (it works if we use this URL in the browser) and <code>$format</code> is the video format.</p><p>But when I try executing the <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo_Video.html"" rel=""nofollow"">MediaPlayerDemo_Video</a> from the API Demos using the streaming mode, I get an error like this:</p><pre><code>MediaPlayer Command PLAYER INIT completed with an error or info PVMFErrCorruptMediaPlayer error (1. -10)MediaPlayer Error (1.-10)</code></pre><p>If we hard-code the URL and format in the PHP script, it also does not work out, but with a different error:</p><pre><code>MediaPlayer info/warning (1. 28)MediaPlayer Info (1 .28)</code></pre><p>Does anyone have an idea on how to workaround this?</p><p>Thanks in advance! </p>","416590","","","","","2013-12-03 06:54:51","Android MediaPlayer Streaming from a PHP Redirect does not work-out!","<php><android><video><redirect><media-player>","4","0","1","",""
"3570592","1","3571242","","2010-08-25 22:03:52","1","317","<p>How can I tell if a device is using HTC's SenseUI?</p><p>I thought about using android.os.Build information, but they seem inconsistent.. is there a more definitive way?</p><p>I need to be able to tell if I can launch the calendar by using com.android.calendar or com.htc.calendar.</p><p>I welcome any suggestions!!</p>","354130","","","","","2012-10-10 18:38:26","Determining if a device is using HTC SenseUI","<android>","3","1","","",""
"3570605","1","","","2010-08-25 22:05:59","5","5404","<p>I have an ImageButton and a TextView wrapped in a LinearLayout like this:</p><pre><code>    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_weight=""20"" android:gravity=""center""        android:clickable=""true"" android:id=""@+id/action_showhide""&gt;        &lt;ImageButton android:id=""@+id/test""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:src=""@drawable/ic_toggle_hide_states"" android:background=""@null""&gt;&lt;/ImageButton&gt;        &lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""@string/txtHide""            android:textColor=""@drawable/orange"" android:textStyle=""bold""&gt;&lt;/TextView&gt;    &lt;/LinearLayout&gt;</code></pre><p>The ImageButton is backed by a custom drawable for normal, focused and pressed states.  I would like to allow the user to click anywhere in the LinearLayout to fire an OnClick event.   The code below shows the set up for the OnClickListener:</p><pre><code>    final LinearLayout actionHide = (LinearLayout) findViewById(R.id.action_showhide);    actionHide.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            Log.d(AppAdvocate.TAG, ""Event caught"");        }    });</code></pre><p>The code works when the user clicks anywhere on the TextView but when the user clicks on the ImageButton the event doesn't bubble up to the LinearLayout.  I am not defining an onClickListener for the button.  I want the drawable for my ImageButton to change so I don't want to set it to clickable=false.  Is there a way to bubble up the event?</p>","233202","","1952862","","2013-01-29 19:47:17","2013-05-13 09:10:23","Capturing LinearLayout onClick events with ImageButton inside it","<android><android-linearlayout><imagebutton><onclicklistener>","3","0","","",""
"3570690","1","3570706","","2010-08-25 22:21:18","57","33826","<p>I'd like to store some application settings (like the URL of an API, and some settings for testing) for an Android application.</p><p>I mostly work as a <a href=""http://en.wikipedia.org/wiki/.NET_Framework"">.NET</a> developer, so I'm used to using the file <code>app.config</code> for this purpose. What's a good way to do it in Android?</p>","56861","","63550","","2012-07-08 18:52:25","2013-06-18 20:53:45","What's the best way to do ""application settings"" in Android?","<android>","2","0","26","",""
"3570710","1","3639716","","2010-08-25 22:24:31","2","320","<p>This little web page runs fine on my desktop but when selecting the area with a G-1 Android device (select box that says statewide..) the data refreshed with the requested data in the table but the text in the select box does not change,,, the other select boxes (month and year) work fine.. Fwiw the data is still rough and so is the gadget...I've rebooted and restarted the g-1 to no avail..<a href=""http://dl.dropbox.com/u/4303088/gadgetdraftok.html"" rel=""nofollow"">http://dl.dropbox.com/u/4303088/gadgetdraftok.html</a></p><p>The broader question, i guess, here is how to debug a web page on any android browser? we don't have a firebug equivalent..</p><p>Further I confirmed the same bug in the Moto Cliq browser (also old still a 1.5) very strange every once in a while the G-1 operates correctly, but I can't figure out how to get it to do it, just that every once in a while the select shows in the window when selected and the data refreshes..</p><p>I have verified that this seems to be a verified bug in the early browsers... so now I'm trying to figure a work around, I added setFocus on the select box but it is ignored on the Android G-1<strong>*<em>New info</em>*</strong>I actually used this test tool from W3schools try-it site and it demonstrates the non-behavior in just a few lines..<a href=""http://www.w3schools.com/js/tryit.asp?filename=tryjs_focus"" rel=""nofollow"">http://www.w3schools.com/js/tryit.asp?filename=tryjs_focus</a> i.e. it works fine on desktop but does not give focus when on phone.. anyone have a work around idea? ( I figured setFocus would be my silver bullet but sadly no)</p><p>I have three select boxes on the app so I need to display the selected info...as the selection is served.. not just initialization. FWIW the behavior seems to be on select boxes that have the selection dynamically loaded,, when I finish all three boxes will need dynamic loading now only the area box is dynamic, year/month are coded and so work.</p>","137783","","137783","","2010-08-30 18:33:58","2010-09-03 21:37:28","Select items runs fine in Chrome et al but not on Android G-1 browser?","<javascript><android><browser><setfocus>","2","3","","",""
"3570764","1","","","2010-08-25 22:36:17","2","704","<p>Using com.example.android.notepad and ExpandableList2.java fromcom.example.android.apis.view, I have written a simple applicationthat contains a content provider serving two tables in an sqlitedatabase and a display activity that uses my ExpandableListActivitysubclass. I am using my own layouts for the ExpandableList, and thegroup and child layouts. The contents of the database are beingdisplayed properly in the display activity, and the groups collapseand expand fine. However, if I expand a group, and click on a child toselect it, I get the following stack dump:</p><p>Thread [&lt;3> main] (Suspended (exception IllegalStateException))<br/>        CursorWindow.getLong(int, int) line: 331<br/>        SQLiteCursor(AbstractWindowedCursor).getLong(int) line: 108<br/>        ContentResolver$CursorWrapperInner(CursorWrapper).getLong(int) line:127<br/>        CursorTreeAdapter$MyCursorHelper.getId(int) line: 435<br/>        SongsList$SetListExpandableListAdapter(CursorTreeAdapter).getChildId(int, int)line: 172<br/>        ExpandableListConnector.getItemId(int) line: 428<br/>        AbsListView$PerformClick.run() line: 1635<br/>        ViewRoot(Handler).handleCallback(Message) line: 587<br/>        ViewRoot(Handler).dispatchMessage(Message) line: 92<br/>        Looper.loop() line: 123<br/>        ActivityThread.main(String[]) line: 4203<br/>        Method.invokeNative(Object, Object[], Class, Class[], Class, int,boolean) line: not available [native method]<br/>        Method.invoke(Object, Object...) line: 521<br/>        ZygoteInit$MethodAndArgsCaller.run() line: 791<br/>        ZygoteInit.main(String[]) line: 549<br/>        NativeStart.main(String[]) line: not available [native method]<br/></p><p>My SimpleCursorTreeAdapter:</p><pre><code>public class SetListExpandableListAdapter extendsSimpleCursorTreeAdapter {    public SetListExpandableListAdapter(Context context, Cursor cursor, int groupLayout,            int childLayout, String[] groupFrom, int[] groupTo, String[] childrenFrom,            int[] childrenTo)     {  super(context, cursor, groupLayout, groupFrom, groupTo,       childLayout, childrenFrom, childrenTo);    }    @Override    protected Cursor getChildrenCursor(Cursor setListCursor) {        Uri.Builder builder =            SetListDefs.Songs.CONTENT_URI.buildUpon();        Uri songsUri = builder.build();        return managedQuery(songsUri, mSongProjection,            ""SETLIST = '"" +               Long.toString(setListCursor.getLong(mSetListIdColumnIndex)) + ""'"",             null, null);    }}</code></pre><p>I've yet to be able to set a breakpoint in my code that is reachedbefore the IllegalStateException gets thrown. Looks to me that I'mdoing what the examples do, but apparently there is something I'mmissing.</p><p>Some help would be greatly appreciated. </p>","267257","","267257","","2010-08-25 22:43:31","2010-08-25 22:43:31","IllegalStateException with ExpandableListActivity and SimpleCursorTreeAdapter","<android><sqlite3><expandablelistview><android-contentprovider>","0","5","1","",""
"3570831","1","3570850","","2010-08-25 22:51:48","0","220","<p>Here is my LogCat log:</p><pre><code>08-25 22:35:27.989: ERROR/AndroidRuntime(327): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 3 </code></pre><p>Here is the <code>onCreate(Bundle)</code> method where I get the cursor:</p><pre><code>private static final String[] PROJECTION = {     Formulas._ID, Formulas.TITLE, Formulas.FORMULA };@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Uri uri = getIntent().getData();    Cursor formulaCursor = managedQuery(uri, PROJECTION, null, null, null);    String formulaName = formulaCursor.getString(formulaCursor.getColumnIndex(Formulas.TITLE));    String formula = formulaCursor.getString(formulaCursor.getColumnIndex(Formulas.FORMULA));    ((TextView) findViewById(R.id.formula)).setText(formula);    ((TextView) findViewById(R.id.formula_name)).setText(formulaName);}</code></pre><p>And here is where I actually start the activity:</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {    Uri formula = ContentUris.withAppendedId(getIntent().getData(), id);    startActivity(new Intent(Intent.ACTION_VIEW, formula));}</code></pre><p>I already have my own content provider and I set it up properly.</p>","200477","","","","","2010-08-25 22:55:27","CursorIndexOutOfBoundsException caused by Uri","<java><android><cursor><uri><android-contentprovider>","1","0","","",""
"3570912","1","3571172","","2010-08-25 23:08:00","0","3078","<p>Does anyone know how to filter out the logcat ('adb shell logcat') so that it only shows the log statements after <em>current date and time</em> ? Thanks in advance.</p>","422299","","422299","","2010-08-26 00:25:47","2010-08-26 00:59:56","Android adb logcat time filter","<android><logging><filtering><adb><logcat>","2","1","","",""
"3570914","1","3586478","","2010-08-25 23:08:25","12","6134","<p>I have a programmatically generated image that I want to send as an attachment via the <code>ACTION_SEND</code> and <code>EXTRA_STREAM</code> method.</p><p>But how do i do this?</p><p>My first attempt (writing to my <code>context.getCacheDir()</code> based file path) appeared to work in the Gmail preview (no image preview, but attached file name and icon was visible), but the attachment never arrived on the recipient side. I guess this has something to do with permissions on the generated file, but how to avoid this? Do I need to set more permissive settings on these generated files (so that the Gmail activity can access)? Is that even possible for the app's cache folder?</p><p>Is there another file location that would be more suitable to write my files to? I considered the downloads folder, but think it would be an awkward location for something that only needs to exist until it has been emailed.</p><p>I have even tried encoding my image purely in a <code>data:image/png;base64,ABCD...</code> style URI. This, too, showed up in Gmail preview (attachment icon, but no file name), but did not result in a recipient-side attachment.</p><p>Has anyone been able to attach a one-shot generated image to an email intent by any means? What options may I have overlooked?</p>","8668","","","","","2013-04-30 22:12:51","Android: How do I attach a temporary, generated image to an email?","<android><image><email><attachment><dynamically-generated>","3","0","13","",""
"3571025","1","","","2010-08-25 23:28:54","3","1020","<p>I am working on an Android game, and want to release a Lite version with limited features as well.  Is there a way I can configure Eclipse to build a second package?  Or will I have to have a separate set of code to build the lite version?</p>","431304","","","","","2010-08-25 23:34:39","Buil Android Lite Version","<android><eclipse>","1","0","3","",""
"3571327","1","","","2010-08-26 00:45:03","0","154","<p>I wanna use a specific input method in my application, so I tried this.</p><pre><code>Settings.Secure.putString(mContext.getContentResolver(),                Settings.Secure.DEFAULT_INPUT_METHOD, KEYBOARD_ID);</code></pre><p>but this needs a system permission.</p><p>Is there another way to determine a specific input method and is it possible ?</p><p>thanks</p>","225818","","49246","","2010-11-13 10:16:54","2010-11-13 10:16:54","is it possible to determine a specific input method","<android><android-input-method>","0","3","1","",""
"3571358","1","","","2010-08-26 00:54:11","2","208","<p>I get this error when I attempt to publish an update to an app on the market. I'm using the same keystore and the same key as the previous update I published. I've no idea what to do. There are no errors or issues when signing or zipaligning.</p><p>I've only ever had 2 keystores and 2 keys on this computer. I've tried one, then the other, and both at once. The market never accepts it as being signed with same key.</p><p>Help!</p>","92259","","","","","2011-05-24 15:06:49","The apk must be signed with at least one certificate in common with the previous version","<android>","0","0","","",""
"3571446","1","3589501","","2010-08-26 01:25:04","0","1108","<p>My Android application has a MapView. I want to divide that MapView into a grid according to latitude and longitude, and shade the different cells of that grid different colors based upon a certain criteria. What's the simplest way to do this?</p><p>I could create semi-transparent, solid-color PNG Drawable rectangular images and put them in an ItemizedOverlay centered on the central points of the cells, but then the rectangles would grow and shrink as the user zoomed in and out on the map. I could extend MapView and override the zoom functions so that the rectangles got re-sized when the user zoomed, but that seems really complicated for something that should be simple! Please tell me a better way to do it?</p>","400765","","","","","2010-08-28 04:45:05","How can I draw, on an Android MapView, rectangles that automatically re-size when the user zooms in and out?","<android><android-mapview>","1","0","","",""
"3571568","1","","","2010-08-26 02:02:06","4","4100","<p>I am trying to send a raw image from the previewcallback from the phone to PC. The PC will then process the image. I am use OpenCV library to do the image processing. At the moment i just write a function in previewcallback to save the byte array to a file,and copy the file to pc and I wrote a simple program to first read in the file and save it into memeory and then directly copy the data to the IplImage.imageData. But I always get a garbage image.</p><p>I use this function I found on net to do the converstion between YUV420SP to ARGB.Thanks for your help.</p><pre><code>void decodeYUV420SP(int* rgb, char* yuv420sp, int width, int height) {    int frameSize = width * height;    for (int j = 0, yp = 0; j &lt; height; j++) {        int uvp = frameSize + (j &gt;&gt; 1) * width, u = 0, v = 0;        for (int i = 0; i &lt; width; i++, yp++) {            int y = (0xff &amp; ((int) yuv420sp[yp])) - 16;            if (y &lt; 0) y = 0;            if ((i &amp; 1) == 0) {                v = (0xff &amp; yuv420sp[uvp++]) - 128;                u = (0xff &amp; yuv420sp[uvp++]) - 128;            }            int y1192 = 1192 * y;            int r = (y1192 + 1634 * v);            int g = (y1192 - 833 * v - 400 * u);            int b = (y1192 + 2066 * u);            if (r &lt; 0) r = 0; else if (r &gt; 262143) r = 262143;            if (g &lt; 0) g = 0; else if (g &gt; 262143) g = 262143;            if (b &lt; 0) b = 0; else if (b &gt; 262143) b = 262143;            rgb[yp] = 0xff000000 | ((r &lt;&lt; 6) &amp; 0xff0000) | ((g &gt;&gt; 2) &amp; 0xff00) | ((b &gt;&gt; 10) &amp; 0xff);        }    }}</code></pre>","431384","","1085483","","2013-02-15 15:05:10","2013-08-02 18:30:27","Android Yuv420sp to ARGB in OpenCV","<android><opencv><image-processing>","4","1","1","",""
"3571731","1","3571931","","2010-08-26 02:52:28","0","742","<p>I am just digging into Android, and want to build a simple application that gets data from wifi/3g from a website, like a classic RSS feed, and/or a post-back to a remote database. A tutorial that does a good job explaining it to a ""busy developer"".</p><p>Can anyone reference a good tutorial site, or a book that covers this topic well ?</p>","193467","","193467","","2010-08-26 03:01:21","2010-08-26 05:02:23","How do i access web data via android?","<android>","2","0","","",""
"3571772","1","","","2010-08-26 03:04:34","1","682","<p>I'm very new to Android programming...well, programming in general!  </p><p>Almost every tutorial out there for Android programming says to run ""activitycreator.bat"".  But where the heck is it?  It's not in the tools directory on my machine.  I've searched the whole drive and I don't have it.  Help!</p>","431410","","","","","2010-08-26 03:50:28","I give...where is the ""activitycreator.bat"" file?","<android>","1","0","","",""
"3571808","1","3572740","","2010-08-26 03:14:56","1","4069","<p>I am wondering how does webview load a particular URL. Does it create a new thread or load the URL in the same thread i.e. UI thread? The reason I am asking this is I am facing some weird wakeup lock issue when I launch an Activity from current Activity (in current Activity's onCreate method) which creates a WebView in it's onCreate method and loads a URL using loadUrl method. So when I am done  with this activity and go back to the Activity which launched this is restarted because wakeup lock time was expired.<br>I googled it and found out that if onCreate method of an Activity takes too long then this type of issue might occur. Have any of you faced this kind of issue involving a WebView? Any kind of help would be really appreciated.<br> Here is sample code.<pre><code>Activity A:class ActivityA {  onCreate(){    initializeSomething();    registerSomeEvents();    startSomething();  }  onSomeListener(){    if(someFlag) {      startActivity(ActivityB);      //this will pause the current activity i.e. ActivityA    }  }}Activity B:class ActivityB(){  onCreate() {    if(someFlag){ //someFlag is coming in intent     helper = createHelperX();    } else {     helper = createHelperY();    }    helper.pleaseHelp(); //this does the rest of thing using activity instance}</p><p>HelperX:</p><p>class HelperX(){  createHelper() {    //setup layout views etc, no WebView here    //and wait for user interaction    //register some events  }  onSomeEvent(){    if(someOtherFlag) {      startActivityForResult(ActivityB); //and pass some flag, now this flag will trigger HelperY  }}</p><p>HelperY:class HelperY(){  createHelper() {    //setup views etc , this contains a WebView and calls loadURL.  }}</code></pre></p>","195802","","73488","","2010-08-26 05:00:07","2010-08-26 07:04:02","Does WebView's loadUrl method run on UI thread?","<android><multithreading><webview>","1","5","","",""
"3571814","1","3972187","","2010-08-26 03:16:55","16","8540","<p>Basically, I want to make an audio visualizer.  I know it's possible, because my phone came with a few live wallpapers that do it.  The problem is, I can't seem to figure out how to do this with the Android API.</p><p>My app would pick up the currently playing media stream and then depending upon the volume that is playing at that time, it would display more or less bars on the screen.</p><p>How can I do this?  It looks like I could do something like this using the microphone, but I want to be able to do it for music, podcasts, etc.</p>","302118","","302118","","2010-08-28 03:01:19","2013-10-31 12:56:35","Accessing the Android media stream for audio visualization","<java><android><audio>","6","2","19","",""
"3571818","1","","","2010-08-26 03:18:18","3","1489","<p>I have an application that adds an event to the calendar on the device. I have the following URLs for the Calendar ContentProvider:</p><pre><code>Pre Froyo: content://calendar/calendarsFroyo: content://com.android.calendar/calendars</code></pre><p>These urls work fine for Nexus One but do not return any calendars on HTC Desire/Incredible/Hero. Probably all phones with a Sense UI. This happens on 2.1 and 2.2.</p><p>Has anybody run into this problem before and has any workarounds?</p>","16071","","","","","2011-02-25 13:06:54","Calendar ContentProvider URL on Android phones with Sense UI","<android><calendar><htcsense>","1","3","6","",""
"3571890","1","","","2010-08-26 03:42:32","0","463","<p>I create a dialog box with TimePicker inside it. This works very well on portraid mode, however, once it is changed into landscape mode, the timepicker minus button looks cropped. </p><p>here's my code:test.xml </p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt; &lt;TextView android:id=""@+id/text1""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Time = "" android:textSize=""28dp""/&gt;&lt;TimePicker android:id=""@+id/PickTime"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@id/text1"" android:layout_alignLeft=""@id/text1""/&gt;&lt;Button android:id=""@+id/StartStop"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Start""android:layout_below=""@id/text1"" android:layout_toRightOf=""@id/PickTime""/&gt;&lt;/RelativeLayout&gt; </code></pre><p>My code for displaying the dialog box:</p><pre><code>            LayoutInflater factory;            factory = LayoutInflater.from(this);            View textEntryView = factory.inflate(R.layout.test, null);            AlertDialog dialog = new AlertDialog.Builder(this)                 //.setTitle(""Auto-Shutdown Setting"")                .setView(textEntryView)                .setPositiveButton(""Close"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                        dialog.cancel();                        /* User clicked OK so do some stuff */                    }                })                .create();            dialog.show();            TimePicker timePicker = (TimePicker) dialog.findViewById(R.id.PickTime);            timePicker.setIs24HourView(true);            timePicker.setCurrentHour(12);            timePicker.setCurrentMinute(15);            timePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {                public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {                }            });</code></pre><p>Anyone knows why this is happening? Is it possible to customize the size of the dialog box (make it bigger)? Any other solution would be appreciated.</p><p>Thanks!</p>","423594","","","","","2010-08-26 03:42:32","Android TimePicker looks cropped","<android>","0","2","","",""
"3571923","1","3572473","","2010-08-26 03:52:16","14","18554","<p>I am 99% there. I need to have a Edittext beside a Search button. The EditText should fill as much of the width as possible, the button should be to the right and be just big enough to have it's text</p><p>It looks like this now:</p><p>[EDIT TEXT][Search]</p><p>but should look like this:</p><p>[.......EDIT TEXT.......][Search]</p><pre><code>&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;        &lt;EditText android:id=""@+id/search_box""             android:layout_alignParentLeft=""true""            android:layout_centerVertical=""true""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:hint=""type to filter""            android:inputType=""text""            android:maxLines=""1"" /&gt;        &lt;Button android:id=""@+id/search_text""            android:layout_toRightOf=""@id/search_box""            android:text=""Search""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""/&gt;  &lt;/RelativeLayout&gt;</code></pre>","172861","","","","","2010-08-26 06:15:17","Android EditText and Button on same line","<android><layout>","4","0","3","",""
"3572034","1","3572046","","2010-08-26 04:24:59","8","3726","<p>Is there a way to get the API level used by a given Android device?</p><p>I want to make one version of an application that does not use AnticipateOvershootInterpolator() and another that uses it for devices using API levels greater than 3.</p>","348058","","267702","","2013-05-25 01:19:31","2013-05-25 01:19:31","Is there a way to tell at run-time what API level an Android device is running?","<android>","2","0","1","",""
"3572215","1","3572234","","2010-08-26 05:13:09","0","590","<p>Is it possible to call the built-in Video Recorder in Android through an implicit <code>Intent</code>? I did some search but haven't figured out yet.</p><p>Many thanks.</p>","159759","","","","","2010-08-26 05:19:08","What Action to invoke the Video Camera in Android?","<android><action><android-intent><video-capture>","1","0","","",""
"3572239","1","","","2010-08-26 05:20:15","-1","596","<p>sometimes i am getting these exception console</p><pre><code>[2010-08-26 10:50:18 - ddms]ADB rejected shell command (ls -l /): [2010-08-26 10:50:25 - ddms]ADB rejected shell command (ls -l /): [2010-08-26 10:50:38 - ddms]ADB rejected shell command (ls -l /): [2010-08-26 10:50:45 - ddms]ADB rejected shell command (ls -l /): [2010-08-26 10:50:58 - ddms]ADB rejected shell command (ls -l /): [2010-08-26 10:51:04 - ddms]ADB rejected shell command (ls -l /): [2010-08-26 10:51:19 - ddms]ADB rejected shell command (ls -l /): [2010-08-26 10:51:25 - ddms]ADB rejected shell command (ls -l /): </code></pre>","421645","","","","","2012-10-09 13:53:47","ddms exception in android","<android>","2","2","","",""
"3572400","1","","","2010-08-26 05:58:58","0","808","<p>I have uploaded an application in Android market. But when I search for the app the app do not appear in the autocomplete box which appears below the search box. </p><p>For example, if I type ""h"" in the search box the autocomplete box will have the applications with ""h"". But in my case I need to type the complete name of the application. </p><p>Why is it so? Is there something that I am missing.</p>","261566","","","","","2010-08-26 08:30:00","App not showing up in Search Result in Android market","<android><search><google-play>","1","2","0","",""
"3572410","1","","","2010-08-26 06:01:05","0","216","<p>Will i be able to replace the existing application with a new application to android market, if i am enhancing it with more features</p>","313613","","","","","2010-08-26 08:05:26","Will i be able to replace the existing application with a new application, if i'm enhancing it with more features","<android><publishing>","2","0","","",""
"3572463","1","3572553","","2010-08-26 06:12:00","362","139799","<p>In Android programming, what exactly is a <code>Context</code> class and what is it used for? I read about it on the developer site, but I am unable to understand it clearly.</p>","431505","","1014743","","2012-12-13 23:15:03","2014-03-10 00:51:54","What is Context in Android?","<android><android-context>","19","2","171","",""
"3572470","1","3572530","","2010-08-26 06:14:29","4","3873","<p>I've to make a media player in android which uses OpenGl for 3D graphics....These graphics could be the same as used in Windows Media PLayer background etc. I'm new to OpenGL...  Can you please suggest some tutorials or the approach that i should follow for the same. .. An example using OpenGL in Android wwould be appreciated....  Thank you in advance....</p>","396437","","44729","","2010-08-26 14:41:02","2012-08-07 09:40:26","Android OpenGL help needed","<java><android><opengl-es>","1","2","4","",""
"3572541","1","3572728","","2010-08-26 06:30:59","0","527","<p>My question is a very simple one i'm sure. It's just I'm not quite sure how to effectively describe what i'm trying to achieve. </p><p>Anyway to the point, I have a simple button, I know how to ""link"" a raw sound file to hand make it play. BUT what i want to do is maybe link a 3 second sound to the button and just have it loop while the user holds the button, and then stops playing when the button is let go. Anyone have any example links they could share that would be great! Thank you!</p><p>edit:Thank you Cpt.Ohlund!</p><p>Thanks that was definately helpful and did the trick, however i ran into 1 more small problem maybe you could help me with I'm using a ""Custom Button"" as seen on <a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-formstuff.html</a> </p><p>It worked fine before i added the ""onTouch Listener. The Button now doesn't use it's android:state_pressed Item it just displays the normal item but not the pressed item. At least It plays the sound now. But, Any Ideas?</p>","393373","","393373","","2010-08-26 07:41:04","2010-08-26 07:41:04","How to have a sound consistently looped while button is pressed and stopped on release?","<java><android><loops><audio><mpmusicplayercontroller>","1","0","","",""
"3572545","1","","","2010-08-26 06:31:23","0","155","<p>Usually resources such as threads, services, memory allocation... are allocated and defined per Activity.Hence, resources will be allocated on Activity.onCreate() and freed on Activity.pause().This is very well defined.</p><p>But, suppose my resources are allocated per Application (i.e I define a service which is used by several activities, OR, I instantiate a thread in the Native layer using NDK). Allocating these resources is not a problem. It can simply be done when the first Activity starts. The problem is - when should these resources by freed? How do I know when my application ends? According to the documentation: <a href=""http://developer.android.com/reference/android/app/Application.html#onTerminate"" rel=""nofollow"">http://developer.android.com/reference/android/app/Application.html#onTerminate</a>() - "" <strong>Note: never depend on this method being called; in many cases an unneeded application process will simply be killed by the kernel without executing any application code.""</strong></p><p>Any ideas anyone?</p><p>Thanks,Eyal </p>","431516","","","","","2010-08-26 06:41:05","Freeing Application resources","<android>","1","0","","",""
"3572567","1","3572635","","2010-08-26 06:35:33","1","657","<p>I came to  know that Qt framework can let us develop Applications for <a href=""http://en.wikipedia.org/wiki/Qt_%28framework%29"" rel=""nofollow"">Android and iPhone</a>. Have some ever developed applications and submitted the Apps in App store and Android market. Is it similar to Titanium in the way of using same source code base for different platforms. If that is the case, can we use the same code for Nokia Applications. </p>","189006","","","","","2010-08-26 06:43:10","Is Qt framework similar to Titanium?","<iphone><android><qt><titanium>","1","0","1","",""
"3572674","1","4577159","","2010-08-26 06:50:48","4","1401","<p>Is there any way to intercept javascript triggered URL in a <code>WebView</code> just like normal hrefs using <code>shouldOverrideUrlLoading()</code>?</p>","195802","","436938","","2011-12-11 20:55:13","2011-12-11 20:55:13","Is there any way to intercept javascript triggered URL in webview?","<javascript><android><android-webview>","1","0","4","",""
"3572701","1","3572823","","2010-08-26 06:57:16","0","211","<p>I am working with android's 9 patch image emulator to create 9 patch image..</p><p>Can anyone tell me how it actually works?On what basis it Scale the image?What are the parameters it considers to stretch image?</p><p>Thanks</p>","1386533","","","","","2011-05-29 12:34:59","How 9patchimage works","<android>","2","0","","",""
"3572773","1","3572841","","2010-08-26 07:09:25","3","642","<p>I am creating the custom textview i want to give  black textcolor to this textview. how can i set textcolor. my code is</p><p>TextView textview = new TextView(this);</p><p>textview.setText(""Please follow this Description"");</p><p>setContentView(_textview);</p><p>when i use textview.setTextColor(Integer.parseInt(""#000000""))</p><p>Thanks in advance</p>","339116","","","","","2010-08-26 07:50:58","how to give textcolor to textview in class file","<android><custom-controls>","2","0","","",""
"3572775","1","3572860","","2010-08-26 07:09:35","2","855","<p>I'm looking an option to buy a verisign ssl certificate for my company.previously we were using godaddy but godaddy ssl is not installed on blackberry. we can install manually or programmatically but its a extra over head for users. you can <a href=""http://stackoverflow.com/questions/3510499/how-to-remove-keystore-security-prompt"">see here</a> what problem we are facing with goddady</p><p>So now we are moving to verisign ssl certificate. many different verisign ssl certificates are available.<a href=""http://www.verisign.com/ssl/buy-ssl-certificates/compare-ssl-certificates/index.html"" rel=""nofollow"">http://www.verisign.com/ssl/buy-ssl-certificates/compare-ssl-certificates/index.html</a></p><p>So my question is Which verisign SSL Certificate should I go with, that covers most of theblackberry , iphone and android devices.</p>","241518","","241518","","2010-08-26 07:16:13","2011-08-31 09:40:07","Which verisign SSL Certificate should I go with?","<iphone><android><blackberry><ssl><verisign>","1","0","1","",""
"3572780","1","","","2010-08-26 07:10:31","7","5484","<p>Hi   I need simple explanation about shared preference in android and preference data</p>","410871","","","","","2013-04-14 17:32:18","Android-sharedpreference","<android>","2","0","5","","2010-08-26 07:10:31"
"3573004","1","","","2010-08-26 07:42:18","3","4467","<p>I'm trying to figure out how to work around my problem. I've read <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/a2aac88a08cb56c2/b7dff4ba388cd664?lnk=gst&amp;q=SurfaceView#b7dff4ba388cd664"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/a2aac88a08cb56c2/b7dff4ba388cd664?lnk=gst&amp;q=SurfaceView#b7dff4ba388cd664</a> which sort of answers my question but as far as I can tell, it's a sort of ""tough luck"" answer. So here's my problem:</p><p>I'm using SurfaceView in the normal way (lock/unlockAndPost) to draw a bitmap of my game background whenever the surface is changed (e.g. orientation etc) and I'm rendering a series of moving circles (up to 30 with a radius of about 25.f). The x,y data for the positions of these circles is coming from a server and that all runs fine. All circle objects are stored in a list and their position is updated taking care to ensure this update is synchronized. However, when I draw these circles to the screen (during canvas.lock() ), most of the time they render fine but occasionally (e.g. once every few seconds) some of the circles seem to tear or flicker briefly for a frame. The number of circles is always constant so that's not the problem and there's no concurrent modifications to the list of circles (as I said, it is synchronized). I have even tried drawing all these circles to a Bitmap on each  render loop and drawing that bitmap to the main canvas. This just seems to affect the perfomance even more (~13FPS as opposed to ~30FPS when drawing circles directly to main canvas). Sorry if the information is a little vague guys, (trying to keep the company happy :p ) but I was just wondering if anyone could give me a clue? Or am I just out of luck. I should note that the positioning data coming from the server is realtime data and it is vitally important that the rendering reflects these realtime positions.</p><p>Thanks for any help!Chris</p><p>EDIT:</p><p>Fair enough. Here is the run() from the render thread.</p><pre><code>@Override    public void run() {        Canvas c;        while (mRun) {            c = null;            try {                c = mSurfaceHolder.lockCanvas(null);                synchronized (mSurfaceHolder) {                    panel.onDraw(c);                }            } finally {                if (c != null) {                    mSurfaceHolder.unlockCanvasAndPost(c);                }            }        }    }</code></pre><p>Pretty standard stuff (almost a carbon copy of lunar lander :p)</p><pre><code>@Overridepublic void surfaceCreated(SurfaceHolder holder) {    mBackground= Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.RGB_565);    screenOrientation = getResources().getConfiguration().orientation;    if(thread.getState()== Thread.State.TERMINATED){        thread = new RenderThread(holder, this);        thread.setRunning(true);        thread.start();    }else {        thread.setRunning(true);        thread.start();    }}@Overridepublic void surfaceChanged(SurfaceHolder holder, int format, int width,        int height) {    Canvas c = new Canvas(mField);    c.drawARGB(255,0,144,0);    backgroundDetails.renderOnPanel(c, this);    screenOrientation = getResources().getConfiguration().orientation;}</code></pre><p>Pretty easy to follow, just redraw the background bitmap if the orientation changes and start the rendering thread.</p><pre><code>public void onDraw(Canvas canvas) {    canvas.drawBitmap(mField,0,0,null);    drawPositionBeans(canvas, this);}</code></pre><p>And finally:</p><pre><code>    public void onDraw(Canvas canvas, RadarView radarView) {    float beanX=0, beanY=0;    float radius = 25.0f;    final List&lt;PositionBean&gt; copyOfList = Collections.synchronizedList(positionBeans.getPositionBeans());    synchronized(copyOfList){        try {            for (final PositionBean pb : copyOfList)            {                if (panel.getOrientation() == Configuration.ORIENTATION_PORTRAIT) {                    beanX = (float)pb.getY()*(-1);                    beanY = (float)pb.getX();                } else {                    beanX = (float)pb.getY()*(-1);                    beanY = (float)pb.getX()*(-1);                }                mPaint.setARGB(255,pb.getRgbColor().getR(), pb.getRgbColor().getG(), pb.getRgbColor().getB());                panel.drawSpot(canvas, beanX, beanY, radius, mPaint);                mPaint.setStyle(Paint.Style.STROKE);                mPaint.setARGB(255,255,222,1);                for (int j = 0; j &lt; selectedBean.size(); ++j)                {                    if(pb.getTrack()==selectedBean.get(j)) {                        panel.drawSpot(canvas, beanX, beanY, radius+1, mPaint);                    }                }                mPaint.setStyle(Paint.Style.FILL);            }        } catch(Exception e) {            Log.e(""render"", ""Exception Drawing Beans: "" + e);        }    }}</code></pre><p>Thanks again guys.Chris</p>","410921","","410921","","2010-08-26 08:15:09","2012-03-20 01:08:17","SurfaceView flickering/tearing","<android><rendering><flicker><surfaceview><tearing>","3","4","","",""
"3573147","1","3573285","","2010-08-26 08:03:18","1","534","<p>I've got a problem to publish my Android Application.</p><p>here's what i've done,</p><p>so I have my application run on development environment (eclipse - testing using device), then i do right click on my project folder - android tools - export signed application package, then i create new key store and add my information there, then it'll produce the .apk</p><p>then i put it up on my own webserver (I intend to put it on my own web server and android market place as well)</p><p>but then, once i try to download my .apk from my testing handset - it said:""cannot download. the content the content is not supported on this phone""</p><p>this is weird, since i do my testing on this same handset as well -.-! :(</p><p>so my question are:</p><ol><li>what is the proper way to sign my app so it can be downloaded all the way through my own web server?</li><li>but I still can put it up on android market as well? - I have my android market account.</li></ol><p>is there any walk-through for it?</p><p>Well Hope someone can give me the answer, I really appreciate your help!</p><p>Thanks &amp; Cheers!</p>","286080","","286080","","2010-08-26 12:25:35","2010-08-26 12:25:35","Signing and publishing Android Application","<android><mobile><publish><signing>","1","2","1","",""
"3573240","1","","","2010-08-26 08:16:03","0","560","<p>Is there any way that we can accept/ignore a request invitation from facebook android sdk?<br>I only can find how to attend/declined event invitation.</p><p>/EVENT_ID/attending<br>/EVENT_ID/maybe/EVENT_ID/declined</p><p>how about the other request, like friend request, or request to join application?</p><p>Thank you very much.</p><p>Best Regards, Eve</p>","430926","","","","","2010-08-26 08:16:03","Facebook android-accept request","<android><facebook><request><send>","0","2","","",""
"3573266","1","3978100","","2010-08-26 08:19:08","1","13384","<p>I am looking for simple binder IPC example in C/C++. Recently I started reading about the Android Binder basic (http://bharathi.posterous.com/android-binder) and gone thru the code in Android source also. Most of the binder usage part is in C++. Can some one explain why C++ is used instead of C?</p>","423671","","","","","2012-08-04 16:42:28","Android Binder Example","<android>","2","0","1","2011-12-21 14:05:33",""
"3573390","1","","","2010-08-26 08:35:23","1","1914","<p>I need to test my android app 24h day and I have 3 ubuntu boxes to do it.I would like to connect my development system (MOTODEV Studio 1.3) to a Remote Device.</p><p>Well, the interface ask me about ip for machine and port to connect to.</p><p>But it doesn't.  I found that the adb sever on remote seems not to listen to external ports, only internal loopback, making connections machine-machine impossible.</p><p>Could it be true?  If so, why there is a section on Device to connect to Android Remote Device on MOTODEV Studio?</p><p>I've found an explanation and a workaround in this post (http://rxwen.blogspot.com/2009/11/adb-for-remote-connections.html) but it seems complicated and post's links doesn't work, so I'm confused whether there is a solution to do that.</p><p>I seem so simple..... I cann't beleave there is not a way.</p>","362628","","","","","2010-09-08 18:42:31","Connecting android emulator in another machine","<android><emulator><adb>","1","1","","",""
"3573391","1","","","2010-08-26 08:35:29","0","603","<p>i am developing  app like USATODAY,i am displaying image in webview one by one few image have same height and width some image have different height and weight,i want to display all images are same height and width in webview..how can i set all images have same height and width in webview..</p><p>Thanks all</p>","410757","","","","","2010-08-27 10:18:58","how to set uniform image hieght and width in webview for android","<android>","1","0","","",""
"3573526","1","3573695","","2010-08-26 08:55:54","1","123","<p>Can anyone please tell me how can I get all the column names used in a database table in Android?</p>","395028","","303363","","2014-03-10 09:14:15","2014-03-10 09:14:15","How to get all the columns in Android?","<android><sqlite>","2","0","","",""
"3573531","1","3574221","","2010-08-26 08:56:11","0","1340","<p>Pretty new to Android development here... Is there an example out there of a working app with source that does something when you shake the phone? Is this doable in a background app? Done quite a bit of googling and can't find any good examples; only tutorials with little context.</p><p>Thanks!</p>","145279","","","","","2010-08-26 10:29:52","Handling Shake Events in Android (1.5+?)","<android><accelerometer><shake>","1","0","1","",""
"3573668","1","3573843","","2010-08-26 09:14:38","1","1215","<p>I want to have a grid with 3 columns and 3 rows and an image button in each cell (center of cell).</p><p>I tried with gridview but I can't fix the number of rows.I tried with a tablelayout and 3 tablerows, but I can't change width/height at runtime</p><p>Any ideas?</p>","431652","","168175","","2013-03-16 09:11:01","2013-03-16 09:11:01","3 by 3 grid with image button in each cell on Android","<android><layout><runtime><tablerow>","1","0","","",""
"3573669","1","3705598","","2010-08-26 09:14:38","0","186","<p>How to create Customize Layout in Android? My problem is I'm displaying Images in grid view, when the user reaches the last image in the grid view, it must display the message:  ""click here to View More Images""</p>","424413","","2660","","2011-11-28 15:20:34","2011-11-28 15:20:34","Create Customize layout in Android","<android><layout><view><custom-view>","1","0","","",""
"3573732","1","3573772","","2010-08-26 09:22:56","1","88","<p>I am developing android Applications and testing in on HTC magic (version 1.5). Will it bring any problem on running with higher version of Android devices.</p>","431655","","321731","","2014-03-21 22:29:38","2014-03-21 22:29:38","Version with 1.5 to run on device with version 2.1","<android>","1","0","","",""
"3573826","1","3574745","","2010-08-26 09:35:28","4","1499","<p>I'm currently looking for a way to launch the default browser application on Android and pass a session cookie to it.</p><p>My application communicates with an external API over which I have no control using HttpClient, then passes the user to the site for the final stages.</p><p>I am aware that this is probably possible using a WebView, However I very specifically need to open the external browser application rather than using an internal WebView.</p><p>I know that:</p><pre><code>Intent.ACTION_VIEW</code></pre><p>Can be used to open the browser, however I have not managed to find much information about actually passing any additional data through.</p><p>Any help is much appreciated.</p>","393688","","393688","","2014-01-30 02:07:59","2014-01-30 02:07:59","Android: Open Browser with Supplied Session Cookie","<android><android-intent>","2","0","4","",""
"3573831","1","3574513","","2010-08-26 09:36:22","3","451","<p>I'm making a media player application in android where one part of my screen has a animation which is made in OpenGL (ofcourse with Android/JAVA).....So my screen consists of 2 parts:1)  Left hand side consists of all the widgets (using xml).2)  Right hand side consists of the animation made in OpenGL. </p><p>I'm able to make the  Gui (xml part) and also the animation (opengl).Can i integrate the GUI made in XML file with the animation (made using GLSurfaceview)??</p><p>Thanks in advance....reply urgently.... </p>","396437","","44729","","2010-08-26 14:40:40","2010-08-26 14:40:40","Android OPenGL+ XML integration","<java><android><xml><opengl-es>","1","0","","",""
"3573859","1","","","2010-08-26 09:40:33","2","840","<p>As the title suggests, I would like to create a mobile app that runs in the background and catches ""incoming call"" events. Moreover I would like to use a <a href=""http://mashable.com/2010/08/11/cross-platform-mobile-development-tools/"" rel=""nofollow"">Cross-Platform Development Tool</a> to do this.</p><p>I looked at three tools: <a href=""http://www.phonegap.com/"" rel=""nofollow"">PhoneGap</a>, <a href=""http://rhomobile.com/"" rel=""nofollow"">Rhomobile</a> and <a href=""http://www.appcelerator.com/"" rel=""nofollow"">Appcelerator</a>. But I couldn't find any documentation or examples that suggest they support such events.</p><p>It seems like the iPhone (correct me if I'm wrong) does not support this but <a href=""http://developer.android.com/reference/android/telephony/PhoneStateListener.html"" rel=""nofollow"">Android</a> and <a href=""http://www.blackberry.com/developers/docs/6.0.0api/net/rim/blackberry/api/phone/PhoneListener.html"" rel=""nofollow"">Blackberry</a> do.</p><p>Did I miss something when I looked at the above mentioned tools and platforms?<br/>Are there any other well established Cross-Platform Mobile Tools that could solve my problem?<br/>Keeping the cross-platform support in mind, what approach would you follow to develop such an app?</p>","101434","","","","","2010-08-26 09:50:55","Create a mobile app that listens to incoming phone call events","<iphone><android><blackberry><mobile><cross-platform>","1","0","","",""
"3573867","1","3574144","","2010-08-26 09:41:02","5","736","<p>I have written an Android Application and the generated .APK file I uploaded in Android Market. So, a User can download that apk  and install in his device.How can I restrict my apk to launch , if he calls from other application through Intent. That means my application should not respond to any intents from other outside Applications.</p><p>Is there any possible way to restrict my application's launch from intents from other application.?I will be waitinig for reply.Thanks in Advance,</p>","429501","","429501","","2010-08-26 12:05:01","2010-08-26 12:05:01","Android App should NOT launch on receiving Intent","<android><android-widget>","1","0","4","",""
"3573977","1","","","2010-08-26 09:56:19","2","1840","<p>I'm currently fighting against the OnLongClickListener on Android Api Lvl 8.</p><p>Take this code:</p><pre><code>this.webView.setOnLongClickListener(new OnLongClickListener() {    @Override    public boolean onLongClick(View v) {        System.out.println(""long click"");        return true;    }});</code></pre><p>It works perfectly. I can press anywhere on the WebView and the event triggers every time.</p><p>Now take a look at this one:</p><pre><code>this.webView.setOnLongClickListener(new OnLongClickListener() {    @Override    public boolean onLongClick(View v) {        final EditText editText = getUrlTextField();        switch (editText.getVisibility()) {        case View.VISIBLE:            editText.setVisibility(View.GONE);            return true;        case View.GONE:            editText.setVisibility(View.VISIBLE);            return true;        default:            return false;        }    }});</code></pre><p>Assuming the URL EditText components is currently visible, it gets gone from the display and should be shown again when another long click event is triggered.But if you run this, the event just works once (!) when one performs a long click on any position on the WebView. To make things complicated, the long click works again when it is performed on a link on the website...</p><p>Can anyone explain if it is a bug in the sdk and/or if there is a mistake in my thinking how the OnLongClickListener is working?!? :/</p><p><strong>EDIT:</strong></p><p>I've run now several different scenarios on a Nexus One and come to following conclussion: Changing the layout on runtime more or less kills the OnLongClickListener... I haven't found a way to get it work reliably at all...</p><p>I would really appreciate if anyone could give me a hint... I'm at my wits end :(</p>","418693","","1016716","","2012-04-30 08:30:47","2013-06-25 23:35:59","Android OnLongClickListener strange / unreliable behaviour","<android><click><listener><behavior><long-click>","2","0","1","",""
"3573991","1","3574005","","2010-08-26 09:59:24","1","1149","<p>why is the default language set in my android emulator some asian language?where can i set the keyboard to english?</p><p>thanks!</p>","97688","","","","","2010-08-26 10:01:14","android: default language set to asian","<android>","1","0","","",""
"3574069","1","","","2010-08-26 10:09:55","0","1397","<p>as a newbie, I tried out the HelloAndroid example at developer.android.com. After apgrading the UI to XNL layout as described, I get these error messages in the console log:</p><p><em>[2010-08-26 11:44:49 - HelloAndroid] WARNING: Application does not specify an API level requirement![2010-08-26 11:44:49 - HelloAndroid] Device API version is 8 (Android 2.2)</em></p><p>The programmatic UI layout worked fine before. Where die I make a mistake?</p>","431711","","","","","2013-02-21 17:25:15","Newbie problem: Unable to launch Android application in console","<android><eclipse>","3","0","1","",""
"3574164","1","","","2010-08-26 10:21:25","3","1063","<p>I wrote new example similar to WebView Demo and registered my Java object with addJavascriptInterface() to webview. and in Java script I am able to call java methods. </p><p>Later, I modified android browser code and tried to add Object to javascript,in a same way. but object members are not accessible in javascript and I get runtime error like </p><p>""Uncaught TypeError: Object com.android.browser.BrowserActivity$MyJavaScriptInterface@43bf7eb8 has no method 'launchPlayer' ""</p><p>Where as launchPlayer method is available in MyJavaScriptInterface class.</p><p>Can anybody tell me what is the difference in Browser app, which stops exporting methods to Javascript.</p>","431720","","","","","2010-08-26 10:21:25","addJavascriptInterface : object method not found","<android>","0","3","","",""
"3574226","1","","","2010-08-26 10:30:16","1","3018","<p>friend's,  I have task to set menus in horizontal scrolling with images at two ends to show availability of menus. I did it by using gallery view, but i need to place an seperator (Vertical Line) between menus,i can't able to get the seperator in between the gallery.How can i get it.</p><p>i need the view below </p><pre><code>        ----------------------------------------         &lt;   menu1     |  menu2  |   menu3   &gt;       -----------------------------------------</code></pre><p>just refer CBSNews application if u have.</p><p>Thanks in advance. </p>","407506","","501859","","2011-04-19 09:41:23","2011-04-19 09:41:23","How to set horizontal scroll menu bar","<android>","1","0","","",""
"3574310","1","","","2010-08-26 10:41:27","0","1476","<p>I have this code:</p><pre><code>public static class ExportDatabaseFileTask extends AsyncTask&lt;String, Void, Boolean&gt; {    private Context ctx;    /**     *     */    public ExportDatabaseFileTask(Context ctx) {        super();        this.ctx = ctx;    }    // automatically done on worker thread (separate from UI thread)    protected Boolean doInBackground(final String... args) {        File dbFile = new File(Environment.getDataDirectory()                + ""/data/com.mypkg/databases/log.db"");        File exportDir = new File(Environment.getExternalStorageDirectory(), """");        if (!exportDir.exists()) {            exportDir.mkdirs();        }        File file = new File(exportDir, dbFile.getName());        try {            file.createNewFile();//*            this.copyFile(dbFile, file);            return true;        } catch (IOException e) {            Log.e(""mytag"", e.getMessage(), e);            return false;        }    }    // can use UI thread here    protected void onPostExecute(final Boolean success) {        if (success) {            Toast.makeText(ctx, ""Export successful!"", Toast.LENGTH_SHORT).show();        } else {            Toast.makeText(ctx, ""Export failed"", Toast.LENGTH_SHORT).show();        }    }    void copyFile(File src, File dst) throws IOException {        FileChannel inChannel = new FileInputStream(src).getChannel();        FileChannel outChannel = new FileOutputStream(dst).getChannel();        try {            inChannel.transferTo(0, inChannel.size(), outChannel);        } finally {            if (inChannel != null)                inChannel.close();            if (outChannel != null)                outChannel.close();        }    }}</code></pre><p>On the marked line of</p><pre><code>file.createNewFile();</code></pre><p>I get <code>java.io.IOException: Parent directory of file is not writable: /sdcard/log.db</code></p><p>I have an sdcard installed and I can easily copy files to it. What might be wrong?</p>","243782","","","","","2010-08-26 10:45:05","I get Parent directory of file is not writable for an SDCard export","<java><android>","1","0","","",""
"3574313","1","10630861","","2010-08-26 10:42:24","6","16859","<p>I am using the following code to use camera by using intent.In the parameter of intent I am passing <code>android.provider.MediaStore.ACTION_IMAGE_CAPTURE</code>.It is able to open the camera.But the problem is that it stops unexpectedly.The problem is that it gives null pointer exception on <code>OnActivityResults</code>.I have used the below code:</p><pre><code>public class demo extends Activity {Button ButtonClick;int CAMERA_PIC_REQUEST = 2; /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ButtonClick =(Button) findViewById(R.id.Camera);    ButtonClick.setOnClickListener(new OnClickListener (){        @Override        public void onClick(View view)        {            Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);            // request code            startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);        }    });}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    if( requestCode == CAMERA_PIC_REQUEST)    {    //  data.getExtras()        Bitmap thumbnail = (Bitmap) data.getExtras().get(""data"");        ImageView image =(ImageView) findViewById(R.id.PhotoCaptured);        image.setImageBitmap(thumbnail);    }    else     {        Toast.makeText(demo.this, ""Picture NOt taken"", Toast.LENGTH_LONG);    }    super.onActivityResult(requestCode, resultCode, data);}}</code></pre><p>Can anyone help me to solve this problem?</p>","1386533","","1288","","2011-07-05 11:19:41","2014-02-24 11:29:44","Using intent to use Camera in Android","<android><camera>","4","3","2","",""
"3574365","1","","","2010-08-26 10:50:56","6","5464","<p>i am having difficulties to have my android app running in the emulator to connect to servers in my local network.i am getting a</p><pre><code>java.net.UnknownHostException</code></pre><p>but the servers are resolvable fine from the machine where the emulator is run.</p><p>thanks for any help on this topic!</p>","97688","","97688","","2010-08-26 12:24:01","2012-09-07 12:34:23","android emulator access server in local network","<java><android><networking><android-emulator><emulator>","2","0","2","",""
"3574599","1","","","2010-08-26 11:23:58","2","3033","<p>All these days i used to test my application on my HTC Legend (2.1 OS) only, and i had all my images resources in drawable-hdpi folder.. and everything worked fine</p><p>and today i wanted to test my Application on Android 1.5, so i recreated all the images with lower resolution and kept it under drawable-mdpi folder, so now i have High resolution images in drawable-hdpi folder and lower resolution images in drawable-mdpi folder..</p><p>Everything looked great on both the HTC Legend and Emulator(with Android 1.5)</p><p>Later i found out that the images in drawable-mdpi are shown in my HTC Legend too and not the images in drawable-hdpi</p><p>in my manifest file i have also included </p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;supports-screens android:anyDensity=""true"" /&gt;</code></pre><p>Can anyone help me with this, I want to know as to why the images in drawable-hdpi are not used?</p>","367016","","","","","2013-01-16 09:05:17","HDPI and MDPI Problem","<android>","3","0","2","",""
"3574644","1","3574792","","2010-08-26 11:31:34","24","29028","<p>I want to show the location of an address in Google Maps.</p><p>How do I get the latitude and longitude of an address using the Google Maps API?</p>","421645","","2249404","","2013-09-16 09:58:14","2013-09-16 09:58:14","How can I find the latitude and longitude from address?","<android><google-maps><google-geocoder>","4","1","19","",""
"3574674","1","","","2010-08-26 11:36:30","5","3850","<p>I have an android application that loads web pages in an activity with a WebView. I am using the retrieving the page manually and using WebView's <strong>loadDataWithBaseURL</strong> to display it on screen. Everything there is fine.</p><p>Now, i am trying to override the Back button press to simulate going back in the WebView history stack. I am able to override the Back button press, i can see that there is a history stack in the WebView, i can see that the history url is correct, but when i call WebView's <strong>goBack()</strong> method, it displays a blank page. </p><p>Anyone encountered this before or give me a couple of suggestions to proceed from this?</p><p><strong>Edit</strong>: If i use WebView's <strong>loadUrl</strong> method, the Back button with an override works as intended. But why.... If i need to handle this manually, how do i start messing with history pages?  </p>","377844","","641020","","2011-09-22 10:06:00","2012-03-16 14:09:09","Android: WebView's method goBack() shows a blank page","<android><android-webview>","3","0","","",""
"3574687","1","3574963","","2010-08-26 11:38:17","6","1107","<p>I've got an application that uses overridePendingTransition to do some custom animations upon transitioning from one activity to the other. This was made available in Android 2.0, but I want to make the application work on Android 1.6. I figured if I just checked that android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT, and if not, don't do the overridePendingTransition.</p><p>However, I get a VerifyError, which I assume is caused by this:    VFY: Unable to resolve virtual method 346: ../../Login: overridePendingTransition (II)V</p><p>Is it not possible to use newer functionality conditionally based on the SDK version? </p>","397060","","","","","2010-08-26 12:18:48","VerifyError, or using overridePendingTransition while maintaining compatibility?","<android><backwards-compatibility><verifyerror>","1","0","3","",""
"3574754","1","","","2010-08-26 11:48:28","1","565","<p>I have an Activity ""A"" which instantiates two objects from the Facebook Android SDK. I put these two objects into a static HashMap with unique static keys and their references. From other activities ""B"" and ""C"" I'm able to get these two corresponding references via myhashmap.get(). These two Activities are within the same application. So far so good.</p><p>Within Activity ""A"" I start a Service also part of the same application. My problem is that I now want to get access to my two objects stored in the static HashMap of Activity ""A"" but the HashMap is empty?!?</p><p>So my question how can I get access to objects which were created by my Activity ""A"" from my service ?</p><p>Any tips are more than welcome</p><p>ThanksFrank</p>","431804","","","","","2010-12-27 07:53:14","Android: Exchange objects between Activity and Service","<android><data><service><activity><exchange-server>","1","0","","",""
"3574781","1","","","2010-08-26 11:51:59","2","682","<p>I am writing automated test cases using Instrumentation.  ""waitforMonitorWithTimeout""always timesout.  If I use waitForMonitor everything is fine.    The two linesof code are below. (I comment out one of them when building my test project). </p><p>Activity currentActivity = instrumentation.waitForMonitorWithTimeout(monitor, (long)30);</p><p>Activity currentActivity = instrumentation.waitForMonitor(monitor);</p><p>Are there known issues with ""waitforMonitorWithTimeout""?   I have to use the timeoutto determine if an event occured (and thus transition to a new activity) or not. </p>","431806","","","","","2010-12-06 19:27:32","Android waitForMonitorWithTimeout method not working","<android>","2","0","1","",""
"3574827","1","","","2010-08-26 11:58:04","3","4529","<p>Is it possible to display particular entries in a Spinner list as disabled?i.e. I want to always display a spinner with 4 entries (North, South, East and West, say), but I want to be able to disable any one of these so that is appears greyed out and not selectable.</p><p>Is this possible, or will I have to recreate the list each time, leaving out the invalid entries?</p><ul><li>Frink</li></ul>","131209","","","","","2011-04-29 19:09:58","How to disable an item in a Spinner","<android>","2","0","","",""
"3575055","1","3575114","","2010-08-26 12:32:57","0","1065","<p>I've an IntentService which updates an AppWidget. That Service starts every time the AppWidget is being placed on the Screen or when the AlarmManager /ContentObserver / OnChangeListener get called. It stops itself after updating the widget.</p><pre><code>UpdateService.java:@Overridepublic void onCreate() {    contentObserver = new CustomContentObserver();    registerContentObserver(contentObserver);    /* Am I registering several instances here or is this fine? */    onChangeListener = new CustomSharedPreferencesOnChangeListener();    sharedPreferences.registerOnSharedPreferenceChangeListener(onChangeListener);    Intent updateIntent = new Intent(this, UpdateService.class);    pendingIntent = PendingIntent.getService(this, 0, updateIntent, 0);    alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);}@Overridepublic void onStart(Intent intent, int startId) {    if(AppWidget.DISABLE.equals(intent.getAction())) {        unregisterContentObserver(contentObserver);         sharedPreferences.unregisterOnSharedPreferenceChangeListener(onChangeListener);        alarmManager.cancel(pendingIntent);    } else {        /* Scheduling next update */        alarmManager.set(AlarmManager.RTC_WAKEUP, nextUpdateTime, pendingIntent);        /* Updating the Widget ... */        updateWidget();        /* Stopping the Service */        stopSelf();    }}</code></pre><p>The service shouldn't start when there is no widget to update, so I have to unregister the listener and observer and cancel the pending intent. </p><p>I am wondering what the best way is to clean up the resources? Starting the service to stop it seems a bit awkward to me. </p><pre><code>AppWidget.java:@Overridepublic void onDisabled(Context context) {    Intent intent = new Intent(context, UpdateService.class);    intent.setAction(DISABLE);    context.startService(intent);    context.stopService(intent);    super.onDisabled(context);}</code></pre><p>I am also wondering about the costs of starting and stopping a service. Would it be better to let the Service run all the time and clean up in onDestroy() when the last widget is removed?</p>","58978","","","","","2010-08-26 12:41:22","Lifecycle of a Service and the best way to unregister Listeners","<android><service><appwidget>","1","0","","",""
"3575099","1","","","2010-08-26 12:38:42","1","835","<p>This question is on Android ADB. I am fairly new on Android / ADB. </p><p>My requirement is to have a synchronous / ""continuous data transfer"" kind of connection using ADB (with the device and hosted PC). </p><p>Currently i need to invoke the ADB shell each and every time when i want to send some data/file to the device, Is it possible to have a ""continuous-data-transfer"" kind of connection. I looked into port-forwarding and similar stuffs and got the understanding that you can actually configure two ports on device + PC to have a connection, but not sure if we need to invoke ADB shell each time.</p><p>Please let me know if you need any further info on this.</p><p>Thanks in Advance. </p>","398728","","","","","2012-02-29 05:17:01","ADB Connection problem","<android><adb>","1","0","0","",""
"3575112","1","","","2010-08-26 12:40:48","0","1364","<p>I have a need to generate a table layout dynamically using code.  I can't get it to display.  I've reduced the table generation code segment down to its basics to try and nut it out but even this greatly simplified version isn't working (ie. doesn't display).  Can someone please point out what I'm doing wrong?  Thanks.</p><pre><code>public class TableByCodeTest extends Activity{    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TableLayout tableLayout = new TableLayout(this);    tableLayout.setLayoutParams(        new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    TableRow firstTableRow = new TableRow(this);    firstTableRow.setLayoutParams(        new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));    TextView title = new TextView(this);    title.setText(R.string.title);    title.setLayoutParams(        new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));    firstTableRow.addView(title);    tableLayout.addView(firstTableRow);    setContentView(tableLayout);    }}</code></pre>","366189","","","","","2010-08-26 12:51:34","TableLayout generated by code isn't displaying","<android><tablelayout>","1","1","","",""
"3575167","1","3575223","","2010-08-26 12:49:54","1","6994","<p>How to create an Http Connection to retrive a web page content to my android? Please post example code for this.</p>","436765","","","","","2010-08-26 12:55:29","HTTP connection in Android","<android><http>","1","0","","",""
"3575254","1","","","2010-08-26 12:59:25","0","614","<p>I just worked my Android application with device (HTC Magic) version 1.5 and it loads properly and when i try to load the same application  with the other phone by installing the .apk file of version1.5 with android version 2.1  and kernel version 2.6.29 omap1 but now i couldnt find my application getting installed on my device...</p><p>I have sent a link to view the screenshot for error <a href=""http://img137.imageshack.us/img137/6411/img0981jw.jpg"" rel=""nofollow"">http://img137.imageshack.us/img137/6411/img0981jw.jpg</a>.In the screenshot you can see Quadmon icon on top and it says it can not install app in Korean.</p><p>I have just followed the instructions given in this link  (http://www.waxworlds.org/edam/software/android/how-to-install-an-apk-on-your-android-device) to install .apk file into my htc magic phone.</p><p>Is there any other way to get distributed my apk file into the device?</p>","431655","","213269","","2010-11-10 11:50:37","2011-10-06 14:18:46","Error on installing .apk file with version 2.1","<android><android-emulator><apk><installing>","1","0","","",""
"3575268","1","3863330","","2010-08-26 13:01:29","1","1717","<p>Been stuck on this for a while and tried a few various things.</p><p>Basically I've overridden frame layout to create myself a custom button. The frame layout has two children a button and a linearlayout with items in it.</p><p>The problem is I'm trying to the get the button to stretch to the size of the frame layout (i.e. fill parent) and it isn't doing. Here is the code, just ask if you want more detail:</p><pre><code>public class ReminderButton extends FrameLayout{private TextView text;private ImageView video;private ImageView pdf;public Button button;private LinearLayout itemsLayout;public ReminderButton(Context context, AttributeSet attrs) { super(context, attrs); this.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT)); this.setFocusable(false); LinearLayout itemsLayout = new LinearLayout(context); itemsLayout.setOrientation(LinearLayout.HORIZONTAL); itemsLayout.setFocusable(false); itemsLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); itemsLayout.setWeightSum(100); LinearLayout textLayout = new LinearLayout(context); textLayout.setFocusable(false); textLayout.setLayoutParams(new LinearLayout.LayoutParams(0,LayoutParams.FILL_PARENT, 80)); textLayout.setGravity(Gravity.CENTER); text = new TextView(context); text.setFocusable(false); text.setTextColor(Color.WHITE); text.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); text.setPadding(5, 3, 3, 3); LinearLayout imagesLayout = new LinearLayout(context); imagesLayout.setOrientation(LinearLayout.VERTICAL); imagesLayout.setFocusable(false); imagesLayout.setLayoutParams(new LinearLayout.LayoutParams(0,LayoutParams.FILL_PARENT, 20)); imagesLayout.setGravity(Gravity.CENTER);    video = new ImageView(context);    video.setFocusable(false);    video.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    video.setImageResource(R.drawable.ic_video_small);    pdf = new ImageView(context);    pdf.setFocusable(false);    pdf.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    pdf.setImageResource(R.drawable.ic_pdf_small);    // TODO this doesn't go big enough!            button = new Button(context);    button.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));    button.setBackgroundResource(R.drawable.custom_button);    // Add the text to its linear layout    textLayout.addView(text);    // Add the video and pdf icons to the vertical linear layout i.e. below each other    imagesLayout.addView(video);    imagesLayout.addView(pdf);    // Add the text and the layout containing the images to the horizontal linear layout i.e. next to each other    itemsLayout.addView(textLayout);    itemsLayout.addView(imagesLayout);    // Add the items layout and the buttons layout to the frame i.e. on items on top of the button    this.addView(button);    this.addView(itemsLayout);}</code></pre>","413127","","29995","","2012-05-05 15:30:54","2012-05-05 15:30:54","Android programmatic FrameLayout used as a button - how to fill_parent?","<android><xml><layout><button>","1","0","","",""
"3575303","1","3575647","","2010-08-26 13:05:52","6","6565","<p>I've been experimenting with the Android SDK over the past few days, in readiness to write an App for the store, however I've run across a bit of a problem.</p><p>The App I'll be writing requires that the user has a Google account associated with the phone. Retreiving and making use of the Auth token etc was not a problem, however I would like to be able to show the activity that a user would normal reach by going through the menus Settings->Accounts->Add Account.</p><p>Now through experimentation I've been able to launch this activity from the shell using the following command.</p><pre><code>am start -n com.google.android.gsf/.login.AccountIntroActivity</code></pre><p>I'm having trouble performing the same action in JAVA using the Intent class.</p><p>Would anyone be able to tell me firstly whether or not this can be done via JAVA, and secondly how I could go about it please?</p><p>If I have to settle for the Sync Settings screen then I will (this can be achieved through the Settings.ACTION_SYNC_SETTINGS intent), however it'd be quite nice to be able to direct the user straight to the required screen.</p>","266115","","995926","","2012-05-05 13:47:19","2012-05-05 13:47:19","Programatically starting the 'Add Account' activity in Android 2.2","<android><login><android-intent><android-2.2-froyo>","4","0","2","",""
"3575376","1","3580552","","2010-08-26 13:13:56","2","1181","<p>I'm working on an 'IDE' for Android - it could be useful for editing short scripts / making quick adjustments to files. At the moment I'm just using a simple EditText, but I am wanting to add several features, for example Line Numbering down the left hand side of the EditText and Code Highlighting.</p><p>Does anyone have any suggestions about how to approach this? For the code highlighting, I'm guessing I'll need to write my own subclass of EditText. For the line numbering, could I have a thin vertical TextView that has the same text size as the EditText??</p><p>Yes, I'm aware editing code on a mobile sized screen is painful.</p><p>Thanks!</p>","885287","","","","","2012-01-16 03:14:47","Line Numbers, Code Highlighting in TextView","<android><syntax-highlighting><edittext><line-numbers>","1","0","","",""
"3575503","1","","","2010-08-26 13:27:36","1","856","<p>I am working on a small application which should be represented by an AppWidget. The AppWidget should look like many other widgets on my HTC Desire. Most of them consist of an icon and a title below the icon. The title always looks identical, it is white text on a black rounded banner. I have not found a way to get this layout without painting all by myself. What do I have to do, to get the app title shown below the AppWidget?</p><p>Thank in advance,Wolfgang</p>","431861","","","","","2010-12-19 18:57:21","Title of Android AppWidget below widget-icon","<android><android-widget>","1","0","1","",""
"3575538","1","3575909","","2010-08-26 13:30:48","0","1296","<p>Hi I am developing app which downloads the images from the web siteand then i am displaying them as slide show.  Now I want save thedownloaded images into my SD card please help me.</p><p>My current attempt is:</p><pre><code>File imageFileFolder = new File(Environment               .getExternalStorageDirectory(), ""test"");imageFileFolder.mkdir();File imageFileName = new File(imageFileFolder, date               + pBean.getAuthorName());InputStream fis = pBean.getInputStream();byte[] data = new byte[fis.available()];fis.read(data);FileOutputStream fos = new FileOutputStream(imageFileName);fos.write(data);fos.close();fis.close();</code></pre>","400942","","79125","","2011-02-22 00:40:06","2011-02-22 00:40:06","How to store downloaded images in to android SD card","<android>","2","1","1","",""
"3575619","1","3576520","","2010-08-26 13:39:45","3","367","<p>I'm trying to create a ServerSocket on a port below 1024.</p><p>Obviously, this is restricted to root access only. </p><p>But I'm struggling on getting the right permissions for my app.</p><p>I'm using this code, for example, to test if I have root access (or trigger the dialog)</p><p>But it still doesn't let me ServerSocket work.</p><p>AFAIK, the process that is created with the SU command has the root access, not my app. How do I get root access into my own process?</p><pre><code>public static boolean getRoot() {        try {            Process p = Runtime.getRuntime().exec(""su"");            DataOutputStream os = new DataOutputStream(p.getOutputStream());            os.writeBytes(""echo \""Do I have root?\"" &gt;/system/sd/temporary.txt\n"");            os.writeBytes(""exit\n"");            os.flush();            try {                p.waitFor();                if (p.exitValue() != 255) {                    return true;                } else {                    return false;                }            } catch (InterruptedException e) {                e.printStackTrace();                return false;            }        } catch (IOException e) {            e.printStackTrace();            return false;        }    }</code></pre>","310455","","","","","2010-08-26 15:12:38","How do I open a socket below 1024","<android>","1","0","","",""
"3575669","1","3575736","","2010-08-26 13:44:50","4","9127","<p>I have an activity with multiple list views that are continuously receiving new values form a socket thread, another thread parses the data and updates the array adapters, then the ui thread calls notifyDataSetChanged() to cause the list to refresh.</p><p>My issue is that im refreshing all the list a couple of time a second, this causes the UI to be very laggy when some animations need to happen.</p><p>I was wondering what the best way is to update multiple lists with multiple value changes every second?</p><p>Thanks,  Totem.</p>","274180","","","","","2010-08-26 15:06:56","Android ListView ArrayAdapter data updates Best Practices","<android><listview><adapter>","3","0","2","",""
"3575714","1","","","2010-08-26 13:49:22","0","1966","<p>How to code for reading a pdf file in android? i want to build an app like RepliGo reader. So, Please enlighten me to read pdf by using android sdk or ndk. </p>","285163","","","","","2010-08-26 13:58:51","How to code for reading pdf file in android?","<android>","1","0","1","",""
"3575932","1","","","2010-08-26 14:10:14","0","628","<p><a href=""http://developer.android.com/guide/tutorials/views/hello-gallery.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-gallery.html</a></p><p>I followed the guide exactly, I can compile and run the program but it crashes on load.</p><p>When I try to view main.xml in I get errors in the Console.</p><pre><code>java.lang.NullPointerException at android.view.GestureDetector.&lt;init&gt;(GestureDetector.java:347) at android.view.GestureDetector.&lt;init&gt;(GestureDetector.java:331) at android.widget.Gallery.&lt;init&gt;(Gallery.java:181) at android.widget.Gallery.&lt;init&gt;(Gallery.java:175) at sun.reflect.GeneratedConstructorAccessor38.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at android.view.LayoutInflater.createView(LayoutInflater.java:500) at android.view.BridgeInflater.onCreateView(BridgeInflater.java:77) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122) at android.view.LayoutInflater.rInflate(LayoutInflater.java:618) at android.view.LayoutInflater.inflate(LayoutInflater.java:407) at android.view.LayoutInflater.inflate(LayoutInflater.java:296) at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:397) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.computeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.recomputeLayout(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.GraphicalLayoutEditor.onXmlModelChanged(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.xmlModelChanged(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor$XmlModelStateListener.modelChanged(Unknown Source) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.fireModelChanged(AbstractStructuredModel.java:553) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.internalModelChanged(AbstractStructuredModel.java:887) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.changedModel(AbstractStructuredModel.java:382) at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.changedModel(DOMModelImpl.java:167) at org.eclipse.wst.sse.ui.StructuredTextEditor.savedModel(StructuredTextEditor.java:2814) at org.eclipse.wst.sse.ui.StructuredTextEditor.doSave(StructuredTextEditor.java:1826) at com.android.ide.eclipse.adt.internal.editors.AndroidEditor.doSave(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.doSave(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.showEditorInput(Unknown Source) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2847) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768) at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760) at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2682) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:365) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526) at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48) at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:843) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1131) at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1235) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:264) at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:258) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:298) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)</code></pre><p><strong>EDIT: Actually, If I make a new project and just add a Gallery I still get the NullPointerException.  I don't think that should be the default behavior.</strong></p>","157603","","483113","","2012-10-03 16:20:44","2012-10-03 16:20:44","Gallery Demo NullPointerException","<android><gallery>","2","0","","",""
"3575982","1","","","2010-08-26 14:14:54","1","1014","<p>I need to display a msgbox in the onFinish method of mu main activty.But I get the following exception : </p><p>android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@43202998 is not valid; is your activity running?</p><p>No, my activity is not running, I'm in the onFinish treatment, but I doesn't have any other context...  </p>","164460","","","","","2012-11-28 11:37:44","android messagebox","<android><messagebox>","1","1","","",""
"3576040","1","","","2010-08-26 14:21:16","0","645","<p>i would like to remake a program i made for androidin android it looks pretty nice and is very touch friendly</p><p>now i need to make it for symbianwhat would be the best approach to achieve similar graphics and functionality</p><p>i tried searching in j2mebut the graphics look so very outdated :(</p><p>here are some screens of the android interface<a href=""http://i77.photobucket.com/albums/j74/bertyhell/krist/datacheck.png"" rel=""nofollow"">http://i77.photobucket.com/albums/j74/bertyhell/krist/datacheck.png</a>http://i77.photobucket.com/albums/j74/bertyhell/krist/datacheck1.png</p><p>i just need to make sure the buttons are big enoughand that scrolling can be done with hand gestures</p><p>any suggestions?</p>","373207","","","","","2010-09-01 07:51:59","j2me touch gui looking like android","<android><gui><java-me><touch><port>","3","0","1","",""
"3576087","1","3576171","","2010-08-26 14:25:30","4","10885","<p>I'm using the following code :</p><blockquote>  <p>ImageView i = new ImageView(mContext);</p>    <p>i.setImageResource(mImageIds[position]);</p>    <p>i.setScaleType(ImageView.ScaleType.FIT_XY);</p><pre><code>       //pixels settings !!!</code></pre>    <p>i.setLayoutParams(new Gallery.LayoutParams(200, 100));</p></blockquote><p>but as you can see, it is setting the layout dimensions in pixels.</p><p>Does anybody know how to do the same thing but in ""dip"" ?</p>","429222","","","","","2012-12-13 15:03:41","android Imageview layoutparams in dip?","<android><imageview><dip>","3","0","2","",""
"3576117","1","3576350","","2010-08-26 14:28:51","2","3462","<p>I have an android XML and I am trying to get the ads to show up at the bottom of a tabview, but they are not showing up. I think I am just missing something very simple, but I have been looking at this for far too long and I hope someone can help me out. Here is the XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""xmlns:myapp=""http://schemas.android.com/apk/res/com.Vdrop""    android:id=""@android:id/tabhost""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:padding=""5dp""&gt;        &lt;TabWidget android:id=""@android:id/tabs""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;            &lt;com.admob.android.ads.AdView                android:id=""@+id/ad""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""           android:gravity=""bottom""           myapp:backgroundColor=""#000000""           myapp:primaryTextColor=""#FFFFFF""           myapp:secondaryTextColor=""#CCCCCC""  /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Any thoughts?</p>","428979","","428979","","2010-08-26 14:34:53","2012-05-04 17:07:34","Android Tabview Layout with Admob","<android><admob>","3","0","1","",""
"3576160","1","3586233","","2010-08-26 14:33:50","16","3509","<p>My music application constantly plays music in the background, however I'd like to be able to detect when another application starts playing audio (such as the YouTube app) so I can pause/mute/stop the audio in my application.</p><p>This will allow a user to continue browsing the web whilst listening to music, but then if they wish to watch a video at any point, they can do so without audio conflict.</p><p>One solution might be to listen for a broadcast which states when an application begins using the AudioManager. Does such an Intent Action exist?</p><hr><p><strong>Edit:</strong> As in the answer provided below, there appears to be a method of detecting the loss of audio focus in 2.2 with <code>AudioManager.OnAudioFocusChangeListener</code>.</p><p>Great, but is there a solution for the more common versions of Android? Ideally 1.5+.</p>","172749","","881229","","2014-04-01 19:52:30","2014-04-01 19:52:30","Android: Detect another application has started playing audio","<android><audio><android-intent><broadcastreceiver>","1","0","9","",""
"3576188","1","","","2010-08-26 14:37:06","1","1159","<p>I am using two Activities, <strong>Old Activity</strong> and <strong>New Activity</strong>. I want to pass a value from <strong>New Activity</strong> to <strong>Old Activity</strong>. How can I accomplish this?</p>","410757","","496830","","2011-10-17 20:40:37","2011-10-17 20:40:37","How can I pass a value from a new Activity to an old Activity?","<android><activity>","1","1","","",""
"3576234","1","3730955","","2010-08-26 14:43:44","2","726","<p>I've been watching Virgil's presentation at the Google I/O on REST-heavy applications.</p><p><a href=""http://www.youtube.com/watch?v=xHXn3Kg2IQE"" rel=""nofollow"">Google I/O 2010 - Android REST client applications</a></p><p>Though the notepad tutorial makes database calls directly from the UI layer, Virgil suggests making database calls in a Service.</p><p>At the moment, my Activity's onCreate method uses an extended ContentProvider to access an SQLite database to query a Cursor to attach to the Activity's ListView.</p><p>I'd like to move this code into a Service.  Easy enough.  My question is, what is the appropriate way to transfer the Cursor back to the UI layer?  I've seen many questions posed and there always seems to be someone suggesting there is a more appropriate way to do it.  What is that way?</p><p>More specifically, I so far gather that the Activity should register as some sort of listener.  When the Cursor is retrieved in the Service, a notification is set to the UI layer to access it.  Where does the Service shove it so the Activity can grab it?</p><p>Also, my considered architecture is to have an extended Service, which is called by Activities.  Inside this Service, database transactions will be made through the use of an extended ContentProvider, any listening Activities will be notified, and threads will be launched to hit web services.  So, I have 1 extended Service, 1 extended ContentProvider and several extended Threads for different web services.  Does this seem acceptable?</p>","406790","","","","","2013-02-13 09:37:58","Database calls in services","<android><sqlite><service><android-contentprovider>","2","1","1","",""
"3576240","1","3576271","","2010-08-26 14:44:15","0","393","<p>i want to integrate googles ads to my application.the one that you see at the bottom of the screen on most free apps.</p><p>but i could not find any website related to that topic. is it related to google adsense?</p><p>thanks for any links and guides on how to set it up in the layout!</p>","97688","","","","","2011-01-27 11:24:23","android google ads footer","<android><ads>","2","0","","",""
"3576405","1","","","2010-08-26 14:58:30","0","427","<p>Hey all,I have an application that has many screens. Is it possible to detect if the screen NOT belonging to the application (not defined in my android manifest) comes into visibility?</p>","402274","","","","","2010-12-23 19:23:00","Android: Detecting application backgrounding","<android>","2","1","","",""
"3576413","1","3576440","","2010-08-26 14:59:02","8","20557","<p>I have an Android app where I want to check to see if an app name that is installed matches a string passed to the function containing this code. The code and example is below:</p><pre><code>private Boolean checkInstalledApp(String appName){    PackageManager pm = this.getPackageManager();     Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);     mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);     List&lt;ResolveInfo&gt; list = pm.queryIntentActivities(mainIntent, 0);    Boolean isInstalled = false;    for(ResolveInfo info: list) {      if (info.activityInfo.applicationInfo.loadLabel( pm ).toString()==appName){          isInstalled = true;          break;        }    }     return isInstalled;}</code></pre><p>Assuming you called <code>checkInstalledApp(""SetCPU"");</code> and the app name on the phone is called the same thing it should return <code>true</code>. However, it never does. I logged the results and it should match up but it does not. Can anyone please enlighten me as to why this doesn't work?</p>","114650","","40342","","2013-06-06 13:49:52","2013-06-06 13:49:52","Why is my String to String comparison failing?","<java><android><string>","4","0","","",""
"3576467","1","3577403","","2010-08-26 15:04:44","2","425","<p>I have 20 cards of which there are 10 pair of images. The player is meant to find a match of each card/image. The problem is that if a player taps or clicks each card twice then that card gets decremented from the remaining ones . I need to disable the click listener of the ImageView. How can do that?</p><pre><code>ivOne = (ImageView)findViewById(R.id.ivOne);ivOne.setId(a[0]);//final ImageView ivOne = (ImageView)findViewById(R.id.ivOne);//ivOne.setEnabled(false);ivOne.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                ivOne.setBackgroundResource(images[a[0]]);                Log.e(""r[0]:"", Integer.toString(a[0]));                if (firstTap)                {                    firstId = v.getId();                    firstTap = false;                }                else                {                     //ivOne.setEnabled(false);                     int secondId = v.getId();                     Log.e(""secondId"", Integer.toString(secondId));                     if ((secondId == firstId) &amp;&amp; (score != 0))                      {                           //ivOne.setEnabled(false);                       if (ivOneScored == false)                           {                         score--;                         ivOneScored = true;                       }                     }                        firstTap = true;                }                tvScore.setText(""Remaining:"" + Integer.toString(score));            }    });</code></pre>","2355649","","345717","","2010-08-26 15:06:32","2010-08-26 17:20:38","Android: Help required in card matching game?","<android>","3","0","1","",""
"3576507","1","3576744","","2010-08-26 15:11:02","55","41293","<p>I am wanting to allow the user of my android application the ability to set some parameters.  The radio button is ideal for this situation.  However, I don't like the radio buttons are rendered.  </p><p>Is it possible to change the radio button icon?  For example, is it possible to create a custom layout for each row and in that layout reference my own icon and change the font et al.</p>","69983","","","","","2013-06-19 22:57:14","Is it possible to change the radio button icon in an android radio button group","<android><radio-button>","2","0","28","",""
"3576652","1","","","2010-08-26 15:28:24","5","1285","<p>I need my app to connect to a PC via USB cable and continuously send/receive data.</p><p>I wanna use <code>ObjectInputStream/OutputStream</code> for this.</p><ol><li><p>Is TCP the only way? </p></li><li><p>Is the only way to have ADB installed and use ADB forward for this? Can't I transfer data without the user to have ADB installed?</p></li></ol>","342559","","2153784","","2011-08-28 14:06:35","2013-11-15 01:13:36","Android USB communication","<android><usb><communication>","2","0","","",""
"3576676","1","3576984","","2010-08-26 15:30:54","6","7373","<p>I have 5 pins added to a map. How can I tell the MapView to zoom as much as possible and keep all pins in view?</p>","172861","","548526","","2012-12-11 10:14:48","2012-12-11 10:14:48","Android Map Zoom to Show all Pins","<android><android-mapview>","2","2","6","",""
"3576714","1","","","2010-08-26 15:34:02","0","970","<p>friend's</p><p>I have a horizontal scrollview with text fields,here i need to get the first and last position of textview when i scrolled it,how can i get the position of textview when i scrolled.and also need to know how to set color for text when i clicked the particular text from this.</p><p>sample code....</p><pre><code>&lt;HorizontalScrollView android:id=""@+id/gv""        android:layout_width=""wrap_content"" android:layout_marginTop=""0dip""        android:layout_height=""wrap_content"" android:background=""#ffffff""        android:scrollbars=""none"" android:layout_weight=""1"" android:layout_gravity=""center""&gt;        &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;               &lt;TextView android:id=""@+id/music2"" android:text=""Music"" android:layout_width=""wrap_content""                android:layout_marginLeft=""5dip"" android:textSize=""15sp"" android:layout_height=""wrap_content""                android:background=""@drawable/selector"" style=""@style/FirstText""                android:gravity=""center""/&gt;                &lt;TextView android:textColor=""#000000"" android:paddingLeft=""10dip""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""|""/&gt;               &lt;TextView android:id=""@+id/movies2"" android:text=""Movies"" android:layout_width=""wrap_content""                android:textSize=""15sp"" android:layout_marginLeft=""5dip"" android:layout_height=""wrap_content""                android:background=""@drawable/selector"" style=""@style/FirstText""  android:gravity=""center""/&gt;                &lt;TextView android:textColor=""#000000"" android:paddingLeft=""10dip""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""|""/&gt;               &lt;TextView android:id=""@+id/interview2"" android:text=""Interview"" android:layout_width=""wrap_content""                android:textSize=""15sp"" android:layout_marginLeft=""5dip"" android:layout_height=""wrap_content""                 android:background=""@drawable/selector"" style=""@style/FirstText""  android:gravity=""center""/&gt;                &lt;TextView  android:textColor=""#000000"" android:paddingLeft=""10dip""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""|""/&gt;</code></pre><p>....</p><p>Thanks in advance</p>","407506","","","","","2010-08-26 16:29:20","how to get first and last position of textview from horizontal scroll view","<android>","1","0","","",""
"3576755","1","","","2010-08-26 15:38:39","1","921","<p>How do I add the built-in buttons for switching between Satellite and and Traffic view. </p><p>I can add my own buttons and call the  setSatellite(boolean), setTraffic(boolean) methods, but I was hoping there are built in buttons to do that like the Zoom buttons.</p>","172861","","","","","2011-08-22 12:00:55","Android MapView Controls for changing to Satellite view","<android><android-mapview>","0","0","3","",""
"3576812","1","3721410","","2010-08-26 15:45:22","12","11461","<p>I am trying to get AdMob ads to display in my android application and have been unable to do so. I have contacted their support and have not received any response in almost a week, so I figured I would now ask for help here.</p><p>First some code:<br><code>AndroidManifest.xml</code></p><pre><code>&lt;manifest     xmlns:android=""http://schemas.android.com/apk/res/android""     android:versionCode=""1"" package=""com.foo.application""&gt;  &lt;application&gt;    &lt;meta-data         android:value=""admob-publisher-id-here""         android:name=""ADMOB_PUBLISHER_ID"" /&gt;  &lt;/application&gt;  &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;/manifest&gt;</code></pre><p>Yes, <strong>admob-publisher-id-here</strong> is my real publisher id in the actual manifest file.</p><p><code>main_layout.xml</code></p><pre><code>&lt;LinearLayout     android:id=""@+id/adhost""     android:layout_width=""fill_parent""    android:padding=""5dip"" android:layout_height=""wrap_content""    android:minHeight=""20dip""     xmlns:android=""http://schemas.android.com/apk/res/android""     xmlns:app=""http://schemas.android.com/apk/res/com.foo.application""&gt;  &lt;com.admob.android.ads.AdView       android:id=""@+id/ad""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       app:backgroundColor=""#000000""       app:primaryTextColor=""#FFFFFF""       app:secondaryTextColor=""#CCCCCC""      app:keywords=""android at&amp;amp;t t-mobile iphone blah""/&gt;&lt;/LinearLayout&gt;</code></pre><p><code>attr.xml</code></p><pre><code>&lt;resources&gt;  &lt;declare-styleable name=""com.admob.android.ads.AdView""&gt;                &lt;attr name=""backgroundColor"" format=""color"" /&gt;    &lt;attr name=""primaryTextColor"" format=""color"" /&gt;    &lt;attr name=""secondaryTextColor"" format=""color"" /&gt;    &lt;attr name=""keywords"" format=""string"" /&gt;    &lt;attr name=""refreshInterval"" format=""integer"" /&gt;  &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p><code>MainActivity.java</code></p><pre><code>import android.app.Activity;import android.os.Bundle;import android.util.Log;import com.admob.android.ads.AdManager;import com.admob.android.ads.AdView;import com.foo.application.R;public class MainActivity extends Activity {  private AdView ad;  public MainActivity ( ) {        AdManager.setTestDevices ( new String[] {      // made this up for this            ""012345678994814751742145548AAAAAAA""         } );        AdManager.setTestAction ( ""url"" );    }    @Override    public void onCreate ( Bundle savedInstanceState ) {      super.onCreate ( savedInstanceState );        setContentView(R.layout.main_layout);        if ( AdManager.isTestDevice ( this ) ) {          // this logs            Log.w ( ""foo-app"", ""we are on a test device"" );        }        ad = ( AdView ) this.findViewById ( R.id.ad );        if ( ad != null ) {            ad.setVisibility ( View.VISIBLE );            ad.setAdListener ( new AdListener () );        }    }}</code></pre><p><code>AdListener.java</code></p><pre><code>package com.foo.applicationimport android.util.Log;import com.admob.android.ads.AdView;import com.admob.android.ads.SimpleAdListener;class AdListener extends SimpleAdListener {    @Override    public void onFailedToReceiveAd ( AdView adView ) {      // this is what logs        Log.w ( ""foo-app"", ""failed to receive ad"" );        super.onFailedToReceiveAd ( adView );    }    @Override    public void onFailedToReceiveRefreshedAd ( AdView adView ) {        Log.w ( ""foo-app"", ""failed to receive refreshed ad"" );        super.onFailedToReceiveRefreshedAd ( adView );    }    @Override    public void onReceiveAd ( AdView adView ) {        Log.w ( ""foo-app"", ""receive ad"" );        super.onReceiveAd ( adView );    }    @Override    public void onReceiveRefreshedAd ( AdView adView ) {        Log.w ( ""foo-app"", ""receive refreshed ad"" );        super.onReceiveRefreshedAd ( adView );    }}</code></pre><p>In the logcat, i see the following:</p><pre><code>INFO/AdMobSDK(29541): To get test ads on this device use AdManager.setTestDevices( new String[] { ""012345678994814751742145548AAAAAAA"" } )WARN/AdMobSDK(29541): Ignoring requestFreshAd() because we are requesting an ad right now already.WARN/AdMobSDK(29541): Ignoring requestFreshAd() because we are requesting an ad right now already.WARN/foo-app(29541): we are on a test deviceWARN/foo-app(29541): failed to receive ad</code></pre><p>The AdListener is indicating that it is unable to retrieve the ad. I have an active data connection, plus I am in Test Mode, so it is supposed to always show an ad, according to the <a href=""http://developer.admob.com/wiki/Android#SDK_Integration_Instructions"">admob wiki</a>. There are no errors in the logcat, nor is the application force closing at all. </p><p>Anyone have any ideas or do you see something I am doing wrong?</p><p><strong>update: I got a response from admob, but all they said was i was creating the aeveiw twice, which I am not</strong></p>","32502","","32502","","2010-09-01 10:47:13","2012-02-15 15:47:15","Admob ad never displays in View","<android><admob>","4","1","5","",""
"3576828","1","","","2010-08-26 15:46:22","2","2042","<p>Is there a way to listen for outgoing SMS messages in Android?  If so, is it possible to prevent the message from being sent?</p>","243164","","","","","2010-08-26 15:51:06","Is it possible to block outgoing SMS on an Android phone?","<java><android><sms><android-intent><dalvik>","1","0","","",""
"3576887","1","6206765","","2010-08-26 15:51:31","3","887","<p>I have about 400 unit tests that I have written for my Android application. If I run the tests package by package, everything works fine and all my tests pass. However, if I try to run them all at once, eventually (about 360 tests in), Android starts spitting out <code>!!! Failed Binder Transaction Errors !!!</code>. After about 10-20 of these errors, the process for the application I am testing gets killed and the unit tests never even complete. </p><p>I should note that during this time Eclipse reports <code>Collecting test information</code> in the Console. I think that is odd because it shows that it is running tests even though the JUnit UI doesn't reflect that. When everything works properly, during the <code>Collecting test information</code> phase I see the tests run, the JUnit UI then comes up, and then all the tests are run again (I know this by reading logcat). That is (I think) a separate issue, but I felt I would mention it if anybody knew what that was about. </p><p><strong>Edit as of June 6th 2011</strong></p><p>As per Christopher's answer below, I have verified that this only happens when attempting to run this through Eclipse. If i run my test suite using ANT, all the tests finally execute. </p><p>When I attempt to run my test suite now, Eclipse essentially hangs on ""collecting test information"". I haven't let it run for an extended period of time, but I will give that a try as soon as I can to see if it ever completes. </p>","413379","","413379","","2011-06-02 14:17:55","2011-06-02 14:17:55","Large amount of unit tests cause freezes with Failed Binder Transaction","<java><android><unit-testing><junit>","2","2","4","",""
"3576989","1","3578773","","2010-08-26 16:03:09","1","5151","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device"">Determine if running on a rooted device</a>  </p></blockquote><p>On Launch of the application, I want to detect if the device running is rooted.Is there proper way of detecting it?</p><p>I don't think trying to write a file to '\data' to see if rooted is a good solution.(Since even rooted devices may have that path unprivileged)</p>","432056","","","","","2011-11-11 17:35:07","How can you detect if the device is rooted in the app?","<android><root><detect>","2","0","3","2011-11-11 23:26:24",""
"3577013","1","3577069","","2010-08-26 16:05:23","7","3375","<p>I would like to ask what is the good practice on using anonymous classes vs. named inner classes? </p><p>I am writing an Android application, which includes many UI elements (buttons, text fields, etc). For many of them I need some kind of listeners, so in <code>onCreate</code> of the application I have bunch of quite small anonymous classes like:</p><pre><code>someButton.setOnClickListener(    new View.OnClickListener() {        public void onClick(View v) {            // do something...        }    });</code></pre><p>Each of of such anonymous class is 5 - 20 lines big - small enough and fits good for recommendations from <em>Java™ in a Nutshell</em> book:</p><blockquote>  <p>In general, you should consider using an anonymous class instead of a local class if:</p>    <ul>  <li>The class has a very short body.</li>  <li>Only one instance of the class is needed.</li>  <li>The class is used right after it is defined.</li>  <li>The name of the class does not make your code any easier to understand.</li>  </ul></blockquote><p>But the problem, IMO, is that <code>onCreate</code> becomes quite big and the code becomes more complex to read and understand by quick looking in to it. It is still easy to understand, but simply too big.</p><p>So what would be better practice in such case - have bunch of small inner sub-classes, where each of it is nicely separated , but used just once or better keep using anonymous classes instead?</p>","283037","","","","","2014-01-18 01:15:15","Java/Android: anonymous local classes vs named classes","<java><android><subclass><anonymous-class>","6","1","4","",""
"3577035","1","","","2010-08-26 16:07:59","4","2635","<p>Has anyone tried to use a newer version of Apache HttpClient on Android? There's an annoying bug in the HttpClient used by Android and I was wondering if I would run into problems trying to redistribute HttpClient 4.1 with my app.</p>","139298","","168868","","2012-07-30 20:44:18","2012-07-30 20:44:18","Apache HttpClient 4.1 on Android","<android><apache-httpclient-4.x>","4","0","2","",""
"3577043","1","","","2010-08-26 16:08:41","1","476","<p>I would expect (based on intuition, and the implementation of <a href=""http://download.oracle.com/javase/6/docs/api/java/awt/geom/AffineTransform.html"" rel=""nofollow""><code>AffineTransform</code></a> in Java):  </p><pre><code>a.postConcat(b) -&gt;  a = a x b  a.preConcat(b) -&gt; a = b x a</code></pre><p>but according to the android documentation:  </p><pre><code>public boolean preConcat (Matrix other)  </code></pre><p>Preconcats the matrix with the specified matrix. M' = M x other  </p><pre><code>public boolean postConcat (Matrix other)  </code></pre><p>Postconcats the matrix with the specified matrix. M' = other x M</p><p>This seems backwards to me, am I missing something?</p>","426493","","230513","","2010-08-26 17:05:36","2013-01-13 12:49:51","Is matrix concatenation backwards in Android?","<java><android>","1","4","1","",""
"3577058","1","","","2010-08-26 16:10:38","1","4634","<p>I am playing with the Android TTS engine. I am trying to set it to speak in Spanish from Mexico, rather than from Spain.</p><p>I have tried several combination's of language code / country code but I have not been able to get anything by Spanish from Spain. Here is my code currently</p><pre><code>loc = new Locale(""es"", ""MEX"");myTts.setLanguage(loc);say(""Hello"");</code></pre><p>I have also tried (""es"",""US""), (""es"",""LA""), (""spa"",""US""), (""spa"",""MEX"") with every combination that I can think of it is showing me this in the log:</p><p>TtsEngine::setLanguage found matching language(spa) but not matching country(MEX).</p><p>loaded es-ES successfully</p><p>I can exit my app and open up the TTS Service Extended. If I set the language to either Spanish[es] or Spanish-Latin America. Either way when I hit 'listen to preview' I get ""Hola"" which is expected. But from my application I get ""Heyyo"" instead of ""Hola"". Can anyone see what I am doing incorrectly to set my language?</p>","432060","","168868","","2012-01-01 20:54:04","2014-03-25 14:49:49","Android TTS Languages","<android><text-to-speech>","3","0","","",""
"3577446","1","","","2010-08-26 16:53:16","-1","310","<p>how to get  font from the previous activity on current activity on canvas</p>","414549","","","","","2010-08-26 16:59:02","how to get font from the previous activity on current activity on canvas","<android>","1","0","","",""
"3577549","1","","","2010-08-26 17:05:42","1","84","<p>Things had been going swimmingly, but as of last night, when I hit a breakpoint in <em>my own code</em> (not Android code--I've found plenty of people looking for answers to that question, and I get why that's not available), I'm presented with ""Source Not Found"". I can try ""Edit Source Lookup Path ..."" all I want but to no avail.</p><p>What might have caused this to stop working, and what can I do to fix it?</p><p>Thanks!</p>","8117","","","","","2010-08-26 18:21:42","What broke my Android Development Environment?","<java><android><eclipse><source-code>","1","0","3","",""
"3577566","1","","","2010-08-26 17:08:48","7","23311","<p>I don't understand why I'm getting this exception when hitting the back button. I have the IntentReceiver registered in the onCreate method and it is supposed to be unregistered in the onPause method. My Log.w() call inside of the onPause method leads me to believe that the unregisterReceiver() method is being called, but I am getting this exception still.</p><p>Any thoughts?</p><pre><code>private PlayerReceiver playerReceiver;public void onCreate(Bundle savedInstanceState) { ...     IntentFilter playerFilter;          playerReceiver = new PlayerReceiver();     playerFilter = new IntentFilter(PlayerService.BUFFERING_FAILURE);     playerFilter.addAction(PlayerService.BUFFERING_SUCCESS);     registerReceiver(playerReceiver, playerFilter); ...}protected void onPause() { ...     if (playerReceiver != null){         unregisterReceiver(playerReceiver);         Log.w(TAG, ""playerReceiver has been unregistered"");         playerReceiver = null;     } ...}public class PlayerReceiver extends BroadcastReceiver {    public void onReceive(Context context, Intent intent) {        if (intent.getAction().equals(PlayerService.BUFFERING_FAILURE)){            setListenButton(false);        }        closePlayDialog();    }}</code></pre><p>LogCat Output</p><p>08-26 11:44:28.646: WARN/WWOZMain(1058): playerReceiver has been unregistered</p><p>08-26 11:44:29.476: ERROR/ActivityThread(1058): Activity org.wwoz.WWOZMain has leaked IntentReceiver org.wwoz.WWOZMain$PlayerReceiver@43e4dd60 that was originally registered here. Are you missing a call to unregisterReceiver()?</p><p>08-26 11:44:29.476: ERROR/ActivityThread(1058): android.app.IntentReceiverLeaked: Activity org.wwoz.WWOZMain has leaked IntentReceiver org.wwoz.WWOZMain$PlayerReceiver@43e4dd60 that was originally registered here. Are you missing a call to unregisterReceiver()?</p>","1094550","","1094550","","2010-08-26 22:11:39","2011-06-10 08:20:19","Android: Leaked IntentReceiver exception is being thrown even though I call unregisterReceiver","<android><exception>","2","2","0","",""
"3577624","1","3881105","","2010-08-26 17:15:10","0","2103","<p>I need to add a header to the top of the expanded children in an ExpandableListView. The same header should appear at the top of all expanded children. I've been trying to do it from the adapter like this:</p><pre><code>public int getChildrenCount(int groupPosition) { //Add one extra to children size return mGroups.get(groupPosition).size()+1;} public View getChildView(int groupPosition, int childPosition,        boolean isLastChild, View convertView, ViewGroup parent) {    //if childPosition 0 return the header    if(childPosition == 0)return convertView = mInflater.inflate(R.layout.child_header, null);    //childPosition -1 is the actual item    ChildItem childItem = (ChildItem) getChild(groupPosition, childPosition-1);    ChildViewHolder holder = null;    if (convertView == null) {        convertView = mInflater.inflate(R.layout.child_row, null);    } else {    holder = (ChildViewHolder) convertView.getTag();    }    if(holder == null){        holder = new ChildViewHolder(convertView);        convertView.setTag(holder);    }    holder.getTextLabel().setText(childItem.name);    holder.getPriceLabel().setText(String.valueOf(childItem.price));    return convertView;}</code></pre><p>ChildViewHolder handles finding Views in the child row. This seems to work but then randomly convertView will be the R.layout.child_header at childPosition other than 0. This then breaks getTextLabel() call.</p><p>Is there a better way of doing this? what I really want is something like this:</p><pre><code>myExpandableListView.addChildHeaderView(new ChildHeader())</code></pre><p>I've solved the problem by creating the view like this instead of as above</p><pre><code>if(convertView!=null){    holder = (ChildViewHolder) convertView.getTag(); }if(holder == null){    convertView = mInflater.inflate(R.layout.child_row, null);    holder = new ChildViewHolder(convertView);    convertView.setTag(holder);}</code></pre><p>Thanks!</p>","119203","","119203","","2010-08-30 10:06:04","2010-10-07 11:20:05","Android ExpandableListView Child Headers","<android><expandablelistview>","1","2","1","",""
"3577639","1","","","2010-08-26 17:17:13","0","2523","<p>I'm drawing a ProgressBar in a custom View (SurfaceView) to it's Canvas, and it's drawn as expected. Except that it's not animating, no matter what I do.My custom view is animated properly, but I cant change the progress of the ProgressBar.</p><p>I've created the ProgressBar like this:</p><pre><code>mImageProgressbar = new ProgressBar(context);mImageProgressbar.setIndeterminate(true);int pad = 50;mImageProgressbar.setPadding(pad, pad, pad, pad);mImageProgressbar.layout(0, 0, 200, 200);mImageProgressbar.setEnabled(true);</code></pre><p>And I draw it something like this (slightly simplified):</p><pre><code>Canvas c = mSurfaceHolder.lockCanvas(null);mImageProgressbar.draw(c);</code></pre><p>And I've tried updating it's progress manually as well:</p><pre><code>mImageProgressbar.setProgress( (int)(System.currentTimeMillis()%1000) );</code></pre><p>Any ideas on what I need to do in order for my ProgressBar to animate or change it's progress would be appreciated.</p>","233947","","","","","2010-11-15 02:39:42","Android ProgressBar not animating","<android><progress-bar>","2","0","","",""
"3577640","1","","","2010-08-26 17:17:14","0","1157","<p>How to post message to Facebook using HTTP in Android? Maybe there are more simple ways?</p>","432137","","","","","2012-11-17 16:07:28","Post message on a wall of Facebook in Android","<android><http><facebook>","1","2","","",""
"3577648","1","3703952","","2010-08-26 17:17:58","0","646","<p>I've created a home screen widget by extending the AppWidgetProvider. It works fine on all phones tested so far except Motorola's Droid 2 from Verizon. It's running Android 2.2. What I noticed is when my widget is first place onto a homescreen it works for about +/- 15 seconds. Then I see the widget receives the action com.motorola.blur.home.ACTION_WIDGET_ADDED and the widget stops responding? The buttons on the widget still show pressed or selected states but the widget code itself is no longer called?</p>","420008","","","","","2010-09-13 20:03:06","com.motorola.blur.home.ACTION_WIDGET_ADDED causes my AppWidgetProvider to stop responding?","<android><android-widget>","1","0","","",""
"3577689","1","3581119","","2010-08-26 17:23:02","7","868","<p>I may be assigned an Android project, and have minimal experience with Java but a lot of experience with Flash Builder.  Does anyone have an opinion on <a href=""http://labs.adobe.com/technologies/air2/android/"">Adobe AIR for Android</a>, which lets you ""publish ActionScript projects to run as native applications for the Android OS""?  I'm generally wary of cross-compilers, but don't have a desire to learn Java either...</p>","165673","","773263","","2012-05-14 00:09:28","2012-05-14 00:09:28","Thoughts on Adobe AIR for Android?","<android><air><adobe><flash-builder><air-android>","2","0","3","",""
"3577695","1","","","2010-08-26 17:24:04","1","6400","<p>I would like to create a UI where half of the screen is a ListView and the bottom half is another view. Not sure how to specify the maximum height for the ListView.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content"" android:text=""Hello StockTwits!""/&gt;&lt;ListView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/ListView""&gt;&lt;/ListView&gt;&lt;ViewFlipper android:id=""@+id/ViewFlipper"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;LinearLayout android:id=""@+id/LinearLayoutST"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;&lt;ImageView android:id=""@+id/ImageView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/icon""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:id=""@+id/LinearLayoutChart"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;&lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""View 2""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:id=""@+id/LinearLayoutDetails"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;&lt;TextView android:id=""@+id/TextView02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""View 3""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;/ViewFlipper&gt;&lt;/LinearLayout&gt;</code></pre>","19875","","","","","2014-04-04 23:18:13","How can I set the maximum height on a ListView?","<android><listview><android-widget>","3","0","","",""
"3577790","1","3577823","","2010-08-26 17:34:51","9","3006","<p>We have customers asking for apps that can run on both iPhone and Android.  I realize this will mean two different development projects, but wonder if anyone has any advice/creative tips on this subject?  e.g. Ways to maximize shared resources?</p><p>NOTE: Realize making the app web-based would be most effective way, but looking for advice on cross-development on the native platforms.</p>","165673","","165673","","2010-08-26 18:27:33","2010-08-26 19:14:23","Developing apps for both iPhone and Android","<iphone><android><cross-platform>","3","2","5","",""
"3577866","1","3577919","","2010-08-26 17:43:34","27","31040","<p>I am trying to get a GeoPoint for -23.4456 by 45.44334</p><p>What values do I pass into the constructor of the GeoPoint as it take Ints only.</p>","172861","","","","","2013-10-05 01:54:22","Android GeoPoint with lat/long values","<android><android-mapview>","4","1","6","",""
"3577894","1","","","2010-08-26 17:45:45","1","876","<p>I need to validate a self-signed certificate when connecting to a .NET web service using <code>HttpClient</code>. Can anyone redirect me to any resources ?</p><p>Thanks,<br /> Teja.</p><p>Edit: From what I've learned after posting, the following src code from <a href=""http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java"" rel=""nofollow"">http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java</a> should help -</p><pre><code>public final static void main(String[] args) throws Exception {    DefaultHttpClient httpclient = new DefaultHttpClient();    KeyStore trustStore  = KeyStore.getInstance(KeyStore.getDefaultType());            FileInputStream instream = new FileInputStream(new File(""my.keystore""));     try {        trustStore.load(instream, ""nopassword"".toCharArray());    } finally {        instream.close();    }    SSLSocketFactory socketFactory = new SSLSocketFactory(trustStore);    Scheme sch = new Scheme(""https"", socketFactory, 443);    httpclient.getConnectionManager().getSchemeRegistry().register(sch);    HttpGet httpget = new HttpGet(""https://localhost/"");    System.out.println(""executing request"" + httpget.getRequestLine());    HttpResponse response = httpclient.execute(httpget);    HttpEntity entity = response.getEntity();    System.out.println(""----------------------------------------"");    System.out.println(response.getStatusLine());    if (entity != null) {        System.out.println(""Response content length: "" + entity.getContentLength());    }    if (entity != null) {        entity.consumeContent();    }    // When HttpClient instance is no longer needed,     // shut down the connection manager to ensure    // immediate deallocation of all system resources    httpclient.getConnectionManager().shutdown();        }</code></pre><p>Now my trouble is generating the my.keystore file and creating a password for it. Any tips?</p><p>Thanks,Teja.</p><p>edit2: More updates. Tried using keytool on mac to export it to a .keystore, couldn't figure out how to do it. It keeps saying ""Given final block not properly padded"".</p><p>Why is it making me jump through so many hoops? :@ This was so easy on the B'Berry and the Droid :(</p>","116858","","116858","","2010-08-26 19:40:33","2010-08-26 19:40:33","Validating self-signed secure certificate, Android","<android><https><httpclient>","0","4","","",""
"3577911","1","3577954","","2010-08-26 17:46:30","0","1114","<p>I am drawing several lines on a canvas using drawline, the lines are semi transparent (their paint has an alpha value &lt;255) only problem is that the point at which they cross creates a dot of less transparent color (obviously) is there a simple way to avoid this?</p>","315998","","","","","2010-08-26 17:51:14","Canvas drawline with semi transparent lines overlap problem","<android><canvas>","1","0","","",""
"3577953","1","3578909","","2010-08-26 17:51:13","1","743","<p>i want to clear variable value when will i close activity</p><p>Thanks All</p>","410757","","410757","","2010-08-26 19:11:45","2010-08-26 19:47:18","How to remove static variable value ,when will i close my activity","<android>","1","2","","",""
"3578007","1","","","2010-08-26 17:58:57","1","1777","<p>if I create a new arraylist of size 5...</p><pre><code>    Player P;    ArrayList&lt;Player&gt; orderedPlayers = new ArrayList&lt;Player&gt;(5);</code></pre><p>and then I try to add to the middle of that arraylist...</p><pre><code>    orderedPlayers.add(2, P);</code></pre><p>I get an indexoutofbounds... I also get indexoutofbounds if I use set instead of add...</p><pre><code>    orderedPlayers.set(2, P);</code></pre><p>in fact the only way I can add P to the arraylist is if I use the 0 index...</p><pre><code>    orderedPlayers.add(0, P);</code></pre><p>and also for some strange reason when I do that my debugger in eclipse sees that element added to the 4th index of orderedPlayers instead of the 0th... is ArrayList buggy or am I completely missing something? how would I add to the middle of a null ArrayList?</p>","432173","","","","","2010-08-26 18:09:11","adding to the middle of an empty ArrayList?","<java><android>","7","0","1","",""
"3578036","1","3630685","","2010-08-26 18:02:13","0","5711","<p>Hi I have recently noticed that when Running the function  <code>geoCoder.getFromLocationName()</code> on android 2.2 (Froyo) then i Receive a IOExeption (Which does not occur on other SDK versions).</p><p>After some reserch i have found suggentions to add the following Permisions:</p><p><code>&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></p><p>However this does not solve the problem, and this appears to be a Android SDK Bug. Is there a knows solution to this problem?</p><p>EDIT: Here is the stack trace though it is not particularly helpful the inner stack trace is null so not great.</p><blockquote>  <p>08-26 18:37:53.831: WARN/System.err(347):     at android.location.Geocoder.getFromLocationName(Geocoder.java:159)  08-26 18:37:53.831: WARN/System.err(347):     at com.Finko.HomeScreen.onCreate(HomeScreen.java:32)  08-26 18:37:53.851: WARN/System.err(347):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  08-26 18:37:53.851: WARN/System.err(347):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)  08-26 18:37:53.851: WARN/System.err(347):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)  08-26 18:37:53.861: WARN/System.err(347):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)  08-26 18:37:53.861: WARN/System.err(347):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)  08-26 18:37:53.871: WARN/System.err(347):     at android.os.Handler.dispatchMessage(Handler.java:99)  08-26 18:37:53.882: WARN/System.err(347):     at android.os.Looper.loop(Looper.java:123)  08-26 18:37:53.882: WARN/System.err(347):     at android.app.ActivityThread.main(ActivityThread.java:4627)  08-26 18:37:53.891: WARN/System.err(347):     at java.lang.reflect.Method.invokeNative(Native Method)  08-26 18:37:53.903: WARN/System.err(347):     at java.lang.reflect.Method.invoke(Method.java:521)  08-26 18:37:53.903: WARN/System.err(347):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  08-26 18:37:53.911: WARN/System.err(347):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  08-26 18:37:53.911: WARN/System.err(347):     at dalvik.system.NativeStart.main(Native Method)</p></blockquote>","407133","","407133","","2010-08-26 18:40:38","2010-09-05 12:35:29","geoCoder.getFromLocationName throws IO exeption in Froyo","<android><android-sdk-2.2>","3","1","","",""
"3578261","1","","","2010-08-26 18:28:11","1","438","<p>This is an issue that has been plaguing me for a while now. I am trying to use SQLite DBs to store information in my application. Once I open a DB, I close it right after I'm finished. Here is a rough overview of what I do:</p><pre><code>getWriteableDB;// Perform DB OperationscloseDB;</code></pre><p>This works great, most of the time. Occasionally, the DB files become corrupt and it has to delete them and create a new one. On top of that, sometimes it fails when creating a new DB with a ""Failed to setLocale() when constructing, closing the database"".</p><p>I'm really stumped by all of this as I thought SQLite was supposed to be pretty dependable. It's been more trouble than it's worth in my experience, but perhaps I am doing something wrong.</p><p>Also, when my application has multiple tables, I've begun to put only one table in each DB so that if one table operation messes up, it only corrupts that table's information and not any other tables information.</p><p>Thanks,</p><p>groomsy</p>","349179","","349179","","2010-08-26 18:40:51","2010-08-26 18:40:51","Android SQLite DB Becomes Corrupt","<android><sqlite>","0","5","","",""
"3578266","1","","","2010-08-26 18:28:52","2","348","<p>A number of users of my app have reported that on the Nexus One, running Froyo 2.2, the app appears multiple times in the 'Recent Apps' list that is displayed when you long press the home button.</p><p>Personally, I have not been able to replicate the issue. Have tried killing the app with a task killer then restarting it to see if that would cause the app to appear more than once on the list. Also tried spawning multiple thread from within an activity in the app, but still no go. I have also tested on Droid phones running 2.2 as well as on the 2.2 emulator but to no avail. It is curious that only Nexus One Froyo users experience the issue.</p><p>The app has one main launcher activity, about 30 different activities and is divided into 4 main tasks to help manage the activity stack. The app also has an IntentService for running network operations in the background.</p><p>Is there any know scenario that could cause an app to appear multiple times in the 'Recent Apps' list? Is the 'Recent Apps' list populated based on the app package name e.g. com.mycompany.myappname or based on the tasks defined in the application manifest file?</p>","432204","","404469","","2010-10-26 12:45:50","2011-02-25 22:42:05","Android app appears multiple times in the 'Recent Apps' list","<android><package><android-intent>","1","3","2","",""
"3578312","1","","","2010-08-26 18:34:32","3","567","<p>If I launch an activity from my ListView, when I go back to the ListView it is reset back to the beginning - the original position within the ListView is lost.</p><p>This does not happen if I change the orientation of the device.  onRestoreInstanceState is called and the position within the ListView is maintained.</p><ol><li><p>What is causing the position in my ListView to be reset when it is covered by an activity?  Note that onDestroy is not being called, just onPause(), onStop(), onStart() and onResume().  The position is OK after onStop() and is already reset when onStart() is called.</p></li><li><p>If I have to manage this myself what's the best method?  I can save off the position with getFirstVisiblePosition() and restore it with setSelection().  But I'd really like the position to be stored in the instance state.  Any suggestions here?</p></li></ol><p>Regards</p><p>Phil</p>","405814","","","","","2011-02-18 08:36:42","ListView position onStart","<android><listview>","1","1","","",""
"3578336","1","3578399","","2010-08-26 18:36:59","1","852","<p>First and foremost, are there many android developers here?  Is this a good place for Android related discussions?</p><p>I seem to be missing a rather large concept of Android development. The gist is I am struggling understanding how to tie an application together. I’m not sure how to explain it, so I thought I would do my best with an example from the Android ApiDemo… assuming you are familiar with it.</p><p>Inside the com.example.android.apis.view namespace of the ApiDemo, there is a class called Animation3.java.  Animation3 inherits the activity class and there is some code inside to display animation.  I can’t find a reference to the class (Animation3) anywhere in the demo’s code (except for its definition obviously). The only mention I found is in the manifest xml file. So how the heck does this activity get started? Don’t we need to create an instance of the class somewhere and fire off a method to start it? I don’t understand how to generate the code that ultimately glues this class to the rest of the application.</p><p>Additionally, what about other classes like views or viewgroups? How do I generate code outside the class that initiates/starts/uses/calls (insert proper term) the class.</p><p>I would appreciate any code examples as well as any concept explanation or reference documents. So far I’ve read pages and pages on activities and views but I’m really struggling how to tie things together.</p><p>Thanks for all your help. </p>","432209","","","","","2011-11-26 12:46:57","Not understanding a basic concept of Android application development","<java><android><eclipse>","4","1","1","",""
"3578441","1","3584963","","2010-08-26 18:48:06","7","7989","<p>Is there a good example showing how to query a server and downloading the response (JSON or XML)?</p>","19875","","","","","2010-08-27 17:02:19","Example of how to download JSON from server?","<android><xml><json><httpclient>","2","0","3","",""
"3578586","1","3688583","","2010-08-26 19:07:39","2","9217","<p>I just installed the whole shebang in order to develop android apps in Eclipse (I'm running 64-bit gentoo). Everything seems to go fine, and I created the dev group's hello-world example:</p><pre><code>package com.nfshost.flyingmonkey.android;import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class HelloAndroid extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView tv = new TextView(this);        tv.setText(""Hello, Android"");        setContentView(tv);    }}</code></pre><p>I go to try and run it in eclipse, and according to the console it seems to work:</p><pre><code>[2010-08-26 14:03:18 - HelloAndroid] ------------------------------[2010-08-26 14:03:18 - HelloAndroid] Android Launch![2010-08-26 14:03:18 - HelloAndroid] adb is running normally.[2010-08-26 14:03:18 - HelloAndroid] Performing com.nfshost.flyingmonkey.android.HelloAndroid activity launch[2010-08-26 14:03:18 - HelloAndroid] Automatic Target Mode: using device '015D7D330A028012'[2010-08-26 14:03:18 - HelloAndroid] Uploading HelloAndroid.apk onto device '015D7D330A028012'[2010-08-26 14:03:18 - HelloAndroid] Installing HelloAndroid.apk...[2010-08-26 14:03:20 - HelloAndroid] Success![2010-08-26 14:03:20 - HelloAndroid] Starting activity com.nfshost.flyingmonkey.android.HelloAndroid on device [2010-08-26 14:03:21 - HelloAndroid] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.nfshost.flyingmonkey.android/.HelloAndroid }</code></pre><p>Only, the emulator never shows up on my screen like the guide says it will (http://developer.android.com/guide/tutorials/hello-world.html#run)</p>","146587","","","","","2013-06-25 06:48:00","Android emulator does not start in eclipse","<android><eclipse><android-emulator>","4","3","","",""
"3578692","1","3578811","","2010-08-26 19:20:49","0","291","<pre><code>Log.i(""CONNECT TO THE NETZ!"",""BOOM"");</code></pre><p>Prints nothing in LogCat. Why? </p>","19875","","","","","2010-08-26 19:33:10","Why don't my logs print?","<android><logging><logcat>","1","0","","",""
"3578751","1","3580392","","2010-08-26 19:26:55","4","2018","<p>I am developping an application using a ContentProvider. It is declared in the manifest :</p><pre><code>&lt;provider android:name=""foor.bar.FooBarProvider""          android:authorities=""foo.bar.FoorBarProvider"" /&gt;</code></pre><p>Everything is working fine, I can access the provider. The problem is that I want to create a demo version of my app and I want it to share the same content provider so when the user install the full version, the data is kept in sync. Also, it should be possible to install only the full or the demo version. Therefore, I have to include my content provider in <strong>both</strong>.</p><p>Now, when I try to install both apps, I get a *INSTALL_FAILED_CONFLICTING_PROVIDER* error message, obviously because both AndroidManifest declare the same content provider. </p><p>Is there a way to tell in the Manifest that this content provider should be used only if it doesn't already exists ? Or another workaround ?</p><p>A solution would be that the full version migrate the data from a demo content provider to the full version content provider, but I would rather avoid that.</p>","116067","","","","","2010-08-26 23:42:16","Conflicting content providers","<java><android><android-contentprovider>","1","0","2","",""
"3578808","1","3663262","","2010-08-26 19:33:04","2","852","<p>I'm trying to parse an xml file from a website. Let's say the website is ""http://example.com""</p><p>This website has a htaccess rewrite rule setup to redirect anything with a ""www"" prefix to the host back to example.com.  so ""http://www.example.com"" would redirect to ""http://example.com""</p><p>In my code I have a URL that i get the InputStream of.</p><pre><code>protected InputStream getInputStream() {    try {        return feedUrl.openConnection().getInputStream();    } catch (IOException e) {        throw new RuntimeException(e);    }}</code></pre><p>In this case feedUrl is poingting to ""http://www.example.com/file.xml"" and when I do the following:</p><pre><code>try {    Xml.parse(this.getInputStream(), Xml.Encoding.UTF_8, root.getContentHandler());} catch (Exception e) {    throw new RuntimeException(e);}</code></pre><p>I get an exception thrown and I believe it's not redirecting to ""http://example.com/file.xml""</p><p>I could obviously just statically change where my feedUrl variable is pointing to, but I need this to be dynamic.</p>","375490","","375490","","2010-08-26 19:43:06","2010-09-07 22:33:27","Android InputStream following a rewriterule","<android><url><mod-rewrite>","1","0","","",""
"3578859","1","3579124","","2010-08-26 19:39:10","1","1842","<p>I'm new to opengl-es on android and struggling to get my head around the concept of texturing.</p><p>I am looking to produce a tilemap of various difference textures. I understand that it is better to use an atlas of all the combined textures so I don't repeatedly rebind. However I am unsure quite how to then map these textures on to my tilemap.</p><p>I understand the process of specifiying vertices and then coordinates of where on the texture map I wish to take them from (i drew a picture too!)</p><p><a href=""http://images.redial.net/Hmm.jpg"" rel=""nofollow"">Click for image - curse newbies not allowed to post images :(</a></p><p>But my question is can I draw a triangle strip that is, in effect, longer than one ""tile"" but map a different area of the texture to that ""tile"".</p><p>So instead of drawing a triangle strip pretending to be a quad, one at a time for each tile, can I somehow draw a whole row of the tilemap (like 1,2,3,4 and cleverly shift around the texture coordinates so each ""tile"" is now from a different area of the texture? So for example I draw a triangle strip 4 tiles long but shift the texture coordinates so the first ""tile"" is the yellow of my texture the second red ... third blue... etc</p><p>If I've not explained myself too well apologies!</p><p>It might just be that this is not possible and I have to draw each one individually which seems like I've saved effort with an atlas, then had to draw them all out slowly anyway regardless. Hmm.</p>","432272","","","","","2012-12-05 13:19:11","Texture mapping to triangle strip from atlas Opengl ES","<android><opengl-es><mapping><textures>","1","0","","",""
"3578929","1","3598725","","2010-08-26 19:50:54","2","2576","<p>Ok so I've read the Custom Dialog explanation on the And Dev website<a href=""http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog</a></p><p>It show's you how to make a custom dialog, but not how to customise the title!</p><p>Basically my title is too long and I want it to scroll (like textview) or better still have a 'marquee' effect i think it's called.</p><p>Or if I can't make it scroll, give it more space to wrap onto more lines!</p><p>Any ideas, I don't hold out much hope as it's not on android.dev :-(</p>","413127","","","","","2013-08-01 11:31:16","Android: How to create a Dialog with a Scrolling title?","<android><xml><dialog><title>","3","0","","",""
"3579027","1","3580189","","2010-08-26 20:02:10","3","4071","<p>I have an app that needs to send a periodic heart beat to a server, but when the phone goes into standby mode the background heartbeat thread dies. Is there anyway to wake the phone from standby, send the heartbeat and then go back to sleep programmatically? I want to avoid using PARTIAL_WAKE_LOCK if possible.</p><p>Thanks</p>","146588","","","","","2010-08-26 22:54:18","Android - periodically wake up from standby mode?","<android>","1","2","3","",""
"3579037","1","","","2010-08-26 20:03:32","1","1332","<p>For some reason whenever I checkout my Android project from the SVN repository into Eclipse it fails to recognize that it is an Android project.  </p><p>Even when I use ""Convert to Android Project"" it says: ""Project1 does not exist.""  </p><p>What might be the problem or how do I checkout an android project from a repository?</p>","432299","","491044","","2011-03-10 15:15:57","2012-03-21 17:04:26","Checkout Android Project in Eclipse","<android>","1","1","","",""
"3579045","1","3579240","","2010-08-26 20:04:31","1","5308","<p>I've been stuck on this for a while so I thought I would ask.  Previously I had an ImageView with buttons underneath.  But I would like to have the buttons on top, and the ImageView underneath the buttons, but can't figure out how to do it.  Here is the XML I have at the moment.  Does anyone know what is wrong?</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical"" &gt;    &lt;RelativeLayout        android:id=""@+id/RelativeLayout01""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:orientation=""vertical"" &gt;        &lt;Button            android:id=""@+id/Button_ILLNESS""            android:layout_width=""wrap_content""            android:layout_height=""@dimen/menu_button_height""            android:layout_alignTop=""@+id/Button_ILLNESS""            android:text=""@string/illness""            android:textSize=""@dimen/menu_button_text_size"" &gt;        &lt;/Button&gt;        &lt;Button            android:id=""@+id/Button_SYMPTOM""            android:layout_width=""wrap_content""            android:layout_height=""@dimen/menu_button_height""            android:layout_toRightOf=""@+id/Button_ILLNESS""            android:text=""@string/symptom""            android:textSize=""@dimen/menu_button_text_size"" &gt;        &lt;/Button&gt;        &lt;Button            android:id=""@+id/Button_REMEDY""            android:layout_width=""wrap_content""            android:layout_height=""@dimen/menu_button_height""            android:layout_toRightOf=""@+id/Button_SYMPTOM""            android:text=""@string/remedy""            android:textSize=""@dimen/menu_button_text_size"" &gt;        &lt;/Button&gt;        &lt;Button            android:id=""@+id/Button_HELP""            android:layout_width=""wrap_content""            android:layout_height=""@dimen/menu_button_height""            android:layout_toRightOf=""@+id/Button_REMEDY""            android:text=""@string/help""            android:textSize=""@dimen/menu_button_text_size"" &gt;        &lt;/Button&gt;        &lt;Button            android:id=""@+id/Button_INFO""            android:layout_width=""wrap_content""            android:layout_height=""@dimen/menu_button_height""            android:layout_toRightOf=""@+id/Button_HELP""            android:text=""@string/info""            android:textSize=""@dimen/menu_button_text_size"" &gt;        &lt;/Button&gt;    &lt;/RelativeLayout&gt;    &lt;RelativeLayout        android:id=""@+id/RelativeLayout02""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" &gt;    &lt;/RelativeLayout&gt;    &lt;ImageView        xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/ImageView_MenuHeader""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:src=""@drawable/splash_android_650x480"" &gt;    &lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre>","148635","","1318946","","2014-02-10 11:42:09","2014-02-10 11:43:02","android - buttons above ImageView?","<android><android-imageview><relativelayout>","1","2","1","",""
"3579106","1","","","2010-08-26 20:11:49","0","176","<p>I have an android application that runs well on my emulator, but when i deploy the .apk to a real phone, it works for about 4-5 minutes and then unexpectedly crashes. Is there anyway I could get a stack trace or more helpful information to show up on the android when it does this? Any particular way to get a log?</p><p>And also, what is the best practice for unit testing on android?</p><p>-M@</p>","432221","","","","","2010-08-26 21:44:24","Logging a phantom error in production for android?","<android><logging>","2","2","","",""
"3579293","1","3590660","","2010-08-26 20:38:35","1","3323","<p>I typically use Eclipse with the Android Plug-in for mobile phone development. I was wondering how I could use this existing setup to develop and test Android Tablet applications. Anyone have any suggestions/experience with this? Any alternatives for testing?</p><p>Update:<a href=""http://www.droidsector.com/blog/2010/05/21/how-to-emulate-a-tablet-in-android-sdk-2-2/"" rel=""nofollow"">http://www.droidsector.com/blog/2010/05/21/how-to-emulate-a-tablet-in-android-sdk-2-2/</a></p><p>:-)</p>","300972","","300972","","2010-09-02 21:23:21","2012-01-19 06:46:53","Android Tablet Application Development","<android><android-emulator>","2","1","","",""
"3579294","1","3579711","","2010-08-26 20:38:36","0","1218","<p>I would like to be able to pull out different fields like Name and Symbol etc. How can I create my JSONObject in Android to do this?</p><pre><code> {      ""query"": {        ""count"": ""1"",        ""created"": ""2010-08-26T07:09:40Z"",        ""lang"": ""en-US"",        ""results"": {          ""quote"": {            ""symbol"": ""AAPL"",            ""Ask"": ""241.07"",            ""AverageDailyVolume"": ""23885200"",            ""Bid"": ""241.04"",            ""AskRealtime"": ""241.07"",            ""BidRealtime"": ""241.04"",            ""BookValue"": ""47.194"",            ""Change_PercentChange"": ""-1.88 - -0.77%"",            ""Change"": ""-1.88"",            ""Commission"": null,            ""ChangeRealtime"": ""-1.88"",            ""AfterHoursChangeRealtime"": ""N/A - N/A"",            ""DividendShare"": ""0.00"",            ""LastTradeDate"": ""8/26/2010"",            ""TradeDate"": null,            ""EarningsShare"": ""13.285"",            ""ErrorIndicationreturnedforsymbolchangedinvalid"": ""N/A"",            ""EPSEstimateCurrentYear"": ""14.43"",            ""EPSEstimateNextYear"": ""17.48"",            ""EPSEstimateNextQuarter"": ""4.89"",            ""DaysLow"": ""240.91"",            ""DaysHigh"": ""245.74"",            ""YearLow"": ""164.11"",            ""YearHigh"": ""279.01"",            ""HoldingsGainPercent"": ""- - -"",            ""AnnualizedGain"": ""-"",            ""HoldingsGain"": null,            ""HoldingsGainPercentRealtime"": ""N/A - N/A"",            ""HoldingsGainRealtime"": null,            ""MoreInfo"": ""cnsprmiIed"",            ""OrderBookRealtime"": ""N/A"",            ""MarketCapitalization"": ""220.2B"",            ""MarketCapRealtime"": null,            ""EBITDA"": ""17.498B"",            ""ChangeFromYearLow"": ""+76.90"",            ""PercentChangeFromYearLow"": ""+46.86%"",            ""LastTradeRealtimeWithTime"": ""N/A - &lt;b&gt;241.01&lt;/b&gt;"",            ""ChangePercentRealtime"": ""N/A - -0.77%"",            ""ChangeFromYearHigh"": ""-38.00"",            ""PercebtChangeFromYearHigh"": ""-13.62%"",            ""LastTradeWithTime"": ""2:54pm - &lt;b&gt;241.01&lt;/b&gt;"",            ""LastTradePriceOnly"": ""241.01"",            ""HighLimit"": null,            ""LowLimit"": null,            ""DaysRange"": ""240.91 - 245.74"",            ""DaysRangeRealtime"": ""N/A - N/A"",            ""FiftydayMovingAverage"": ""254.598"",            ""TwoHundreddayMovingAverage"": ""243.902"",            ""ChangeFromTwoHundreddayMovingAverage"": ""-2.892"",            ""PercentChangeFromTwoHundreddayMovingAverage"": ""-1.19%"",            ""ChangeFromFiftydayMovingAverage"": ""-13.588"",            ""PercentChangeFromFiftydayMovingAverage"": ""-5.34%"",            ""Name"": ""Apple Inc."",            ""Notes"": ""-"",            ""Open"": ""245.48"",            ""PreviousClose"": ""242.89"",            ""PricePaid"": null,            ""ChangeinPercent"": ""-0.77%"",            ""PriceSales"": ""3.89"",            ""PriceBook"": ""5.15"",            ""ExDividendDate"": ""21-Nov-95"",            ""PERatio"": ""18.28"",            ""DividendPayDate"": ""N/A"",            ""PERatioRealtime"": null,            ""PEGRatio"": ""0.89"",            ""PriceEPSEstimateCurrentYear"": ""16.83"",            ""PriceEPSEstimateNextYear"": ""13.90"",            ""Symbol"": ""AAPL"",            ""SharesOwned"": null,            ""ShortRatio"": ""0.40"",            ""LastTradeTime"": ""2:54pm"",            ""TickerTrend"": ""&amp;nbsp;==+=+-&amp;nbsp;"",            ""OneyrTargetPrice"": ""332.00"",            ""Volume"": ""11819994"",            ""HoldingsValue"": null,            ""HoldingsValueRealtime"": null,            ""YearRange"": ""164.11 - 279.01"",            ""DaysValueChange"": ""- - -0.77%"",            ""DaysValueChangeRealtime"": ""N/A - N/A"",            ""StockExchange"": ""NasdaqNM"",            ""DividendYield"": null,            ""PercentChange"": ""-0.77%""          }        }      }    }</code></pre><p>This code can pull out quote, but I'm not sure how to get the individual fields:</p><pre><code>JSONObject query = (json.getJSONObject(""query"").                                    getJSONObject(""results"").                                    getJSONObject(""quote""));            System.out.println(query.toString());</code></pre>","19875","","19875","","2010-08-26 21:29:02","2011-12-05 11:50:23","How can I parse this JSON in Android?","<android><json><parsing>","2","0","1","",""
"3579381","1","","","2010-08-26 20:51:00","1","453","<p>im making an android game and i want to insert a movie clip (.flv) of exlosion into the game, how do i do that?</p>","432334","","","","","2010-08-26 21:39:33","how to insert a movie clip into my game?","<android>","2","0","","",""
"3579567","1","","","2010-08-26 21:13:00","0","1579","<p>How can I integrate into the Android SDK tools to do for example:</p><ol><li>See a list of installed devices</li><li>Start a new device to run</li><li>See a list of devices started</li><li>Install my application (uninstall before install).</li></ol><p>I got this from the command line but want to use it from an application.</p>","188674","","909742","","2013-12-08 22:46:18","2013-12-08 22:46:18","Integrate With Android SDK Tools","<c#><android>","3","1","","",""
"3579615","1","3639445","","2010-08-26 21:20:39","4","1559","<p>Most of the time I write code for embedded modules or small programs on my computer to analyze data that said code generates.  Now I've been asked to prototype a mobile application to analyze/display that data instead.  I have no (6-year old CS101) experience with either of the popular languages (Obj-C/Java?), let alone with any of the APIs/libraries available on the 4-5 popular mobile OSs, so I'm more or less at square one.</p><p>Adapting the embedded hardware to talk to a phone is fairly straightforward, just add a Bluetooth module that I can configure to emulate a serial port (using SPP profile), but I don't know where to start on the other side.</p><p><strong>What sort of mobile OS/device should I target</strong> for ease/speed of developing a Bluetooth serial port profile (SPP) application from having equal (no) experience on them all?  </p><h3>BlackBerry</h3><ul><li>Everyone has one around here (except me), so this is where I'm being nudged towards unless there are significant obstacles or another is vastly better (faster)</li><li>Smaller community</li><li>Lots of dev-blogs moan about poor SDK/tools</li><li>""BlackBerry devices have limited support for SPP."" (<a href=""http://docs.blackberry.com/en/admin/deliverables/1854/Security_for_BlackBerry_Devices_with_Bluetooth_Wireless_Technology.pdf"" rel=""nofollow"">PDF</a>, p. 9)</li></ul><h3>Android</h3><ul><li>Very few phones around here.</li><li>API makes it seem very <a href=""http://developer.android.com/reference/android/bluetooth/BluetoothSocket.html"" rel=""nofollow"">straightforward</a> to look for devices and connect to them.</li><li>Large dev community, (many more examples to peruse).</li></ul><h3>WM6</h3><ul><li>I have a (bad) WM6.5 phone.</li><li>Smaller community</li><li>Phones can have various stacks (MS, Widcomm), which are not interoperable, some don't support SPP, and I don't know what my phone (HTC Ozone) has...</li></ul><h3>iOS</h3><ul><li>Don't have/never used a Mac, iPhones only marginally popular around my organization.</li><li>Large dev community</li><li>Can only connect to <a href=""http://developer.apple.com/iphone/library/qa/qa2009/qa1657.html"" rel=""nofollow"">approved Bluetooth devices</a>(?)  Kills that option dead if I read it right.</li></ul><h3>Some portable framework (Appcelerator, PhoneGap)</h3><ul><li>Seems impossible as they can't get at the Bluetooth.</li></ul>","194586","","1023248","","2012-02-08 12:10:37","2012-02-08 12:10:37","What's the quickest mobile platform to create a Bluetooth application on?","<android><iphone><blackberry><windows-mobile><bluetooth>","3","0","","",""
"3579717","1","3580170","","2010-08-26 21:33:06","0","722","<p>is it possible to provide directions on a map on Android from 1 place (e.g a specific lat/lng) to another  specific lat/lng? I realise this is doable with the Google-maps API but can you do it within Androids native implementation?</p>","358438","","","","","2012-06-12 10:39:02","Provide directions on an Android Google-Maps activity","<android><google-maps>","2","0","","",""
"3579775","1","3585482","","2010-08-26 21:42:27","1","3671","<p>I am writing code that will allow the user to browse through the files on their SD card to locate images and them load them using openGL ES 2.0. This works fine when I had used just an EditText to type in the file path, but now that I have implemented a file browser that makes the exact same call with a String of the file path I get ""Call to openGL API without a current context"" in the LogCat.</p><p>I assumed this had something to do with the loader activity being over top the GLSurfaceView so I set up that activity terminates before any of the openGL calls were ever made, but no dice.</p><p>What gives?</p><p>Here are some code snippets:</p><p>Called when the user has clicked a file within the loader</p><pre><code>    public void backOut(String filePath) {        // inform the main Activity of the file to load...        Intent i = new Intent();        i.putExtra(""filePath"", filePath);        setResult(Activity.RESULT_OK, i);        // ... and end the load activity        finish();    }</code></pre><p>Inside the main Activity, which holds the GLSurfaceView</p><pre><code>@Override public void onActivityResult(int requestCode, int resultCode, Intent data) {       super.onActivityResult(requestCode, resultCode, data);   switch(requestCode) {     case (1) : {       if (resultCode == Activity.RESULT_OK) {       String toLoad = data.getStringExtra(""filePath"");      Log.v(TAG, toLoad);      gl.informRendererLoadTexture(toLoad);      }       break;     }   } }</code></pre><p>And in the GLSurfaceView</p><pre><code> public void informRendererLoadTexture(String filePath){     _filePath = filePath;     queueEvent(new Runnable(){            public void run() {                _renderer.loadGLTexture(_filePath);            }});</code></pre>","423492","","","","","2011-06-30 05:38:21","No current openGL context when returning from activity?","<android><opengl-es>","1","2","1","",""
"3579845","1","3579878","","2010-08-26 21:53:23","0","42","<p>Something odd is going on, I think...</p><p>I have menu with sub-menu items.One sub-menu gets GPS location, does some calc's and updates two display fields.  No problems.</p><p>The other sub-menu takes user input and does calc's <strong>BUT</strong>, it uses the same display stuff as the fist sub-menu but, won't update the two fields with the new input for display.  I have a second display just to see whats going on and this display does update the two fields correctly.</p><p>There are no differences between these displays (declarations, parameters or values) <strong>HOWEVER</strong>, and here's the lead-up to the <strong>odd</strong> thing, I got a warning when setting the display for the two fields (for displaying in the second sub-menu) and used a suggestion from the pop-up.</p><p>The suggestion was to make the TextView static.  I clicked it for one (left the other as-is for trial and commented it).  The warning went away but, <strong>crash!</strong> at run time.</p><p>So, here's the <strong>odd</strong> thing:  Nowhere do I see anything that makes this TextView static!  All related declarations and ref's to it are identical to the one I didn't make static.  In fact, I tried to manually make the second one static but couldn't.  I also checked the R.java file but nothing related in there...</p><p>Fortunately, I was able to use 'Undo' the Make-it-static.</p><p>Any comment/clarification for my education?Thanks</p>","382200","","","","","2010-08-26 21:58:46","Android - Something Odd... Question","<android>","1","0","","",""
"3580043","1","","","2010-08-26 22:25:30","1","32","<p>I am playing a audiofile with Soundpools .play</p><pre><code>backstreamid=mSoundPool.play(playid, streamVolume, streamVolume, 1, 0, 1.3f);  </code></pre><p>but I need to know when the sound stops playing, how could I realize this?I need the PITCH Option.. any solution (even if its not with soundpool) is welcome</p><p>thxchris</p>","355372","","","","","2010-08-26 22:25:30","Android Soundloop get playlength","<android><audio>","0","0","","",""
"3580051","1","3585062","","2010-08-26 22:26:31","16","8750","<p>As per the <a href=""http://stackoverflow.com/questions/3567312/android-drop-shadow-on-view/3568992#3568992"">original question</a>, The end result is a rounded-rect <code>png</code> in an <code>ImageView</code> with a natural looking drop shadow.</p><p>I have the shadow working, but when it draws, it makes the entire image black.</p><p><img src=""http://i.stack.imgur.com/kZJF4.png"" alt=""alt text""></p><p>How can I prevent the original image (definitely not black) from being black when adding the shadow?</p><pre><code>    BlurMaskFilter blurFilter = new BlurMaskFilter(2, BlurMaskFilter.Blur.OUTER);    Paint shadowPaint = new Paint();    shadowPaint.setMaskFilter(blurFilter);    int[] offsetXY = new int[2];    Bitmap originalBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.pier_t);    Bitmap shadowImage = originalBitmap.extractAlpha(shadowPaint, offsetXY);    Canvas c = new Canvas(shadowImage);    c.drawBitmap(originalBitmap, -offsetXY[0], -offsetXY[1], null);    imageView.setImageBitmap(shadowImage);</code></pre><p><br/><br/><br/><br/><strong>UPDATE:</strong></p><p>I implemented Josh's suggestion about copying over to the correct color space and now it works great! For future searchers, <strong>this code produces a drop shadow on an image view</strong>. You can play around with the x and y, as well as the OUTER constant to get the desired effect.</p><pre><code>BlurMaskFilter blurFilter = new BlurMaskFilter(2, BlurMaskFilter.Blur.OUTER);Paint shadowPaint = new Paint();shadowPaint.setMaskFilter(blurFilter);int[] offsetXY = new int[2];Bitmap originalBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.pier_t);Bitmap shadowImage = originalBitmap.extractAlpha(shadowPaint, offsetXY);Bitmap shadowImage32 = shadowImage.copy(Bitmap.Config.ARGB_8888, true);Canvas c = new Canvas(shadowImage32);c.drawBitmap(originalBitmap, -offsetXY[0], -offsetXY[1], null);imageView.setImageBitmap(shadowImage32);</code></pre><p><img src=""http://i.stack.imgur.com/bzBZW.png"" alt=""alt text""></p>","69634","","69634","","2010-08-27 17:24:31","2010-08-27 17:24:31","How to prevent Android's drawBitmap from only drawing black images?","<android><paint><blur><shadow><drawbitmap>","2","2","20","",""
"3580062","1","3587546","","2010-08-26 22:29:05","3","4621","<p>I am trying to get a JSON response from our server and the response string seems is always being truncated when the string length reaches to around 5525 characters.</p><pre><code>HttpClient httpClient = new DefaultHttpClient();HttpPost post = new HttpPost(URL);ResponseHandler&lt;String&gt; responseHandler= new BasicResponseHandler();String testResponse = httpClient.execute(post, responseHandler);</code></pre><p>I also tried this by using HttpEntity and reading the response stream. But that also truncates the string at approximately that length. </p><pre><code>            HttpClient httpClient = new DefaultHttpClient();            HttpPost post = new HttpPost(URL);//          HttpGet get = new HttpGet(URL);            HttpResponse response = null;            HttpEntity entity = null;            InputStream inputStream = null;            BufferedReader reader = null;            String result = """";            try {                response = (HttpResponse)httpClient.execute(post);                entity = response.getEntity();                if(entity != null){                    inputStream = entity.getContent();                }                reader = new BufferedReader(new InputStreamReader(inputStream), 8000);                StringBuffer builder = new StringBuffer("""");                String line = reader.readLine();                while(line != null){                    Log.v(tag, ""int max::::::::: ""+Integer.MAX_VALUE);                    Log.v(tag, ""LINE::::::::: ""+line+reader.toString());                    Log.v(tag, ""reader::::::::: ""+reader.toString());                    builder.append(line+""\n"");                    line = reader.readLine();                }                inputStream.close();                result = builder.toString();            } catch (ClientProtocolException e) {                e.printStackTrace();            } catch (IOException e) {                e.printStackTrace();            } finally{                if(inputStream != null){                    try{                        inputStream.close();                    }catch(IOException e){                        e.printStackTrace();                    }                }            }</code></pre><p>Please let me know how I can handle this problem.I used this post as the reference while creating this.<a href=""http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restful-client-at-android/"" rel=""nofollow"">http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restful-client-at-android/</a></p><p>Thank you.</p>","229266","","115145","","2010-08-27 00:15:11","2010-08-27 19:35:22","String is being truncated when its too long","<java><android><httpclient>","4","2","3","",""
"3580082","1","","","2010-08-26 22:31:52","2","1051","<p>I am working with android, trying to animate some text (make it bigger and smaller over time) and I have the following issue.  I cant animate the text using the following:</p><blockquote>  <p>int textSize = calculateTextSize();</p>    <p>paint.setTextSize(textSize);</p>    <p>canvas.drawText(""Some Text"", 10, 25, paint);</p></blockquote><p>calculateTextSize , shrinks or enlarge the text size over time.</p><p>The issue is that the text doesnt animate, but 'jumps' over from size 20, to 19 to 18, etcIts not an animation, but changing the text of sizes.</p><p>How I can animate text on the canvas on andriod?</p><p>Thanks</p>","237115","","","","","2010-08-26 22:54:48","android- animate text on canvas","<android><canvas><drawing>","1","0","1","",""
"3580179","1","","","2010-08-26 22:52:09","0","46","<p>I'm new at this. I'm using the T-Mobile G1.  What I have is a <strong>3 tab app</strong>(that is based on the example of the <strong>TAB APP</strong>).  Whenever you switch between portrait and landscape by opening/closing the keyboard,</p><p>(1)the screen(s) do not scroll and,</p><p>(2)if you are on screen 1 or 2 and open/close the keyboard, the app will reset to screen 0.</p><p>I have no idea how to fix the error or where to look for the solution.  I would appreciate any help in getting these 2 errors solved. Thank you all for you help and time,</p><p>Rc3375@gmail.com</p>","263203","","","","","2011-03-02 21:02:11","NewB Problem with tabs","<android><indexing><scrollbars>","2","0","","",""
"3580351","1","3580514","","2010-08-26 23:33:56","5","2105","<p>I want to save an ArrayList so that it is persistent. The contents can change. What is the best way of approaching this in android?</p>","19875","","19875","","2010-08-27 00:06:35","2010-08-27 00:20:38","What is the best way to save the contents of an ArrayList?","<android><serialization><arraylist><sharedpreferences>","2","0","","",""
"3580612","1","","","2010-08-27 00:53:26","0","78","<p>android Remote services can be seted ip? I have two machine, want to set ip and access each other's remote service,the way can be done?</p>","350694","","","","","2010-08-27 09:32:20","android Remote services can be seted ip?","<android>","1","0","","",""
"3580647","1","3916584","","2010-08-27 01:06:10","6","907","<p>How can I use JMock on the Android?  I've several posts saying its not possible, but surely there's <strong>some</strong> way to do it?  </p><p>The issue seems to be getting the Android to even recognize the JMock jar file.  So maybe there's a solution with putting the jar into assets and making a custom class loader?  That seems like a lot of trouble, but does it sound like it would work?</p>","85348","","","","","2010-10-13 22:12:37","Using JMock on the Android","<android><classloader><jmock>","1","0","1","",""
"3580688","1","","","2010-08-27 01:18:10","0","110","<p>I'm trying to customize my buttons in my view a bit and give them my own look. Whenever I set a picture as a background so that the button looks different though, I seem to lose my cursor. I can use my trackball to go through the items still but when I come to one of my custom buttons the cursor does not show. I have the same problem with some TextViews that I made clickable. Any ideas?</p>","288437","","","","","2010-08-27 04:23:57","Cursor not highlighting buttons etc","<android><button><textview>","1","0","","",""
"3580747","1","","","2010-08-27 01:37:00","5","2049","<p>I'm wanting to target WVGA (480x800) and FWVGA (480x854) devices with my program. My question is: for my full screen background bitmaps which resolution should I make them? </p>","19072","","","","","2011-02-16 09:18:26","Android: Should my graphics by 480x800 or 480x854?","<android>","4","0","1","",""
"3580749","1","","","2010-08-27 01:38:23","0","860","<p>I'm trying to make a timer in which you can insert how much time you want by clicking on the textview or some other button. My problem is I can not figure out how to get the code right so that it will set the string. The string is one that is set up before the class in the string xml. Here is the code that I am working with. This is the dialog that shows when you want to set the string. Thanks. The length2 is the string that is erroring. </p><pre><code>timeDisplay = (TextView) findViewById(R.id.timer);        timeDisplay.setOnLongClickListener(new View.OnLongClickListener() {         public boolean onLongClick(View view) {          Dialog dialog = new Dialog(Score.this);          dialog.setContentView(R.layout.custom_dialog);          dialog.setTitle(""Set Time"");          dialog.setCancelable(true);          final EditText min = (EditText) dialog.findViewById(R.id.min);          final EditText sec = (EditText) dialog.findViewById(R.id.sec);          Button btn = (Button)dialog.findViewById(R.id.positive);          btn.setOnClickListener(new View.OnClickListener() {     @Override     public void onClick(View v) {      Double min2 = Double.parseDouble(min.getText().toString());            Double sec2 = Double.parseDouble(sec.getText().toString());            {Double time = ((min2 * 60) + sec2);            length2.setText(time.toString());             }     }});          dialog.show();}     });</code></pre><p>my string xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""hello""&gt;Hello World, Score!&lt;/string&gt;    &lt;string name=""app_name""&gt;Basketball Score Keeper&lt;/string&gt;    &lt;string name=""start""&gt;Start&lt;/string&gt;    &lt;string name=""pause""&gt;Pause&lt;/string&gt;    &lt;string name=""resume""&gt;Resume&lt;/string&gt;    &lt;string name=""restart""&gt;Restart&lt;/string&gt;    &lt;string name=""timer""&gt;00:00&lt;/string&gt;    &lt;string name=""length2""&gt;10000&lt;/string&gt;&lt;/resources&gt;</code></pre><p>my full code </p><pre><code>import android.app.Activity;import android.app.Dialog;import android.content.DialogInterface;import android.content.Intent;import android.os.Bundle;import android.os.CountDownTimer;import android.view.View;import android.view.View.OnLongClickListener;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ImageView;import android.widget.Spinner;import android.widget.TextView;import android.widget.AdapterView.OnItemSelectedListener;public class Score extends Activity implements AdapterView.OnItemSelectedListener {    private Button Button01;    private Button Button02;    private Button Button03;    private Button Button04;    private TextView TextView01;    private TextView TextView02;    private TextView TextView03;    private TextView TextView06;    private Spinner Spinner01;    private Spinner Spinner02;    TextView timeDisplay;    int state = 0;    int length = R.string.length2;    long startTime = 0;    long currentTime = 0;    long timeElapsed = 0;    long timeRemaining = 0;    long prevTimeRemaining = 0;    Button control;    MyCount counter;    String[] goal={""Three"", ""Foul"", ""Two""};    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        Button01 = (Button) findViewById(R.id.Button01);        Button02 = (Button) findViewById(R.id.Button02);        Button03 = (Button) findViewById(R.id.Button03);        Button04 = (Button) findViewById(R.id.Button04);        TextView01 = (TextView) findViewById(R.id.TextView01);        TextView02 = (TextView) findViewById(R.id.TextView02);        TextView03 = (TextView) findViewById(R.id.TextView03);        TextView06 = (TextView) findViewById(R.id.TextView06);        Spinner spin = (Spinner) findViewById(R.id.Spinner01);        spin.setOnItemSelectedListener((OnItemSelectedListener) this);        ArrayAdapter&lt;String&gt; aa=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, goal);        aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        spin.setAdapter(aa);        Button01.setOnLongClickListener(subtractLeft);        Button02.setOnClickListener(new Button.OnClickListener() {public void onClick(View v){my_func1();}});        Button03.setOnLongClickListener(subtractRight);        Button04.setOnClickListener(new Button.OnClickListener() {public void onClick(View v){my_func2();}});        timeDisplay = (TextView) findViewById(R.id.timer);        timeDisplay.setOnLongClickListener(new View.OnLongClickListener() {            public boolean onLongClick(View view) {                Dialog dialog = new Dialog(Score.this);                dialog.setContentView(R.layout.custom_dialog);                dialog.setTitle(""Set Time"");                dialog.setCancelable(true);                final EditText min = (EditText) dialog.findViewById(R.id.min);                final EditText sec = (EditText) dialog.findViewById(R.id.sec);                Button btn = (Button)dialog.findViewById(R.id.positive);                btn.setOnClickListener(new View.OnClickListener() {                    @Override                    public void onClick(View v) {                        Double min2 = Double.parseDouble(min.getText().toString());                        Double sec2 = Double.parseDouble(sec.getText().toString());                        {Double time = ((min2 * 60) + sec2);                        length2.setText(time.toString());                         }                    }});                dialog.show();}                 });        control = (Button) findViewById(R.id.control);        counter = new MyCount(length, 100);      }      public void control(View view) {        switch (state) {        case 0:          startTime = System.currentTimeMillis();          counter.start();          control.setText(R.string.pause);          state = 1;          break;        case 1:          // pause          currentTime = System.currentTimeMillis();          timeElapsed = currentTime - startTime;          if (prevTimeRemaining == 0)            timeRemaining = length - timeElapsed;          else            timeRemaining = prevTimeRemaining - timeElapsed;          counter.cancel();          timeDisplay.setText(formatTime(timeRemaining));          control.setText(R.string.resume);          prevTimeRemaining = timeRemaining;          // resume          counter = new MyCount(timeRemaining, 100);          state = 0;          break;        case 2:          prevTimeRemaining = 0;          counter = new MyCount(length, 100);          control.setText(R.string.start);          timeDisplay.setText(R.string.timer);          state = 0;        }      }      public class MyCount extends CountDownTimer {        public MyCount(long millisInFuture, long countDownInterval) {          super(millisInFuture, countDownInterval);        }        public void onFinish() {          timeDisplay.setText(""done!"");          state = 2;          control.setText(R.string.restart);        }        public void onTick(long millisUntilFinished) {          timeDisplay.setText(formatTime(millisUntilFinished));        }      }      public String formatTime(long millis) {          String output = ""00:00"";          long seconds = millis / 1000;          long minutes = seconds / 60;          // long hours = minutes / 60;          seconds = seconds % 60;          minutes = minutes % 60;          // hours = hours % 60;          String secondsD = String.valueOf(seconds);          String minutesD = String.valueOf(minutes);          // String hoursD = String.valueOf(hours);           if (seconds &lt; 10)            secondsD = ""0"" + seconds;          if (minutes &lt; 10)            minutesD = ""0"" + minutes;          // if (hours &lt; 10)            // hoursD = ""0"" + hours;          output = minutesD + "" : "" + secondsD;          return output;        }    public void setSpinner02(Spinner spinner02) {        Spinner02 = spinner02;    }    public Spinner getSpinner02() {        return Spinner02;    }    public void setSpinner01(Spinner spinner01) {        Spinner01 = spinner01;    }    public Spinner getSpinner01() {        return Spinner01;    }    public void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position, long id)    {    if (""Three"".equals(goal[position]))    {TextView03.setText(""3"");}    if (""Foul"".equals(goal[position]))    {TextView03.setText(""1"");}    if (""Two"".equals(goal[position]))    {TextView03.setText(""2"");}    }    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {        // TODO Auto-generated method stub        TextView03.setText(""2"");        TextView06.setText(""2"");    }    void my_func1() {        int scoreLeft;         int addOne;        int scoreLeftTotal;        addOne = Integer.parseInt(TextView03.getText().toString());        scoreLeft = Integer.parseInt(TextView01.getText().toString());        scoreLeftTotal = (scoreLeft + addOne);        TextView01.setText("""" + scoreLeftTotal);        }   void my_func2() {            int scoreRight = Integer.parseInt(TextView02.getText().toString());            int addOne = Integer.parseInt(TextView03.getText().toString());            {int scoreRightTotal = (scoreRight + addOne);            TextView02.setText("""" + scoreRightTotal);            }    }    private OnLongClickListener subtractLeft = new OnLongClickListener() {         public boolean onLongClick(View v) {        int scoreLeft = Integer.parseInt(TextView01.getText().toString());        int addOne = Integer.parseInt(TextView03.getText().toString());        {int scoreLeftTotal = (scoreLeft - addOne);        TextView01.setText("""" + scoreLeftTotal);        }        return true;         }};private OnLongClickListener subtractRight = new OnLongClickListener() {     public boolean onLongClick(View v) {    int scoreRight = Integer.parseInt(TextView02.getText().toString());    int addOne = Integer.parseInt(TextView03.getText().toString());    {int scoreLeftTotal = (scoreRight - addOne);    TextView02.setText("""" + scoreLeftTotal);    }    return true;     }};</code></pre><p>}</p>","288437","","288437","","2010-08-27 22:59:02","2011-05-09 08:34:46","Setting string content","<android><string><timer>","1","4","0","",""
"3580954","1","3589426","","2010-08-27 02:34:59","3","1265","<p>Could someone maybe tell me what i'm doing wrong? I'm betting im missing one small thing. I've looked on the developer site and i've read some tutorials and i'm just not seeing what i did wrong.</p><p>I'm trying to use a ListPreference to decide which sound to play on a button click.</p><p>I have this at the top:</p><pre><code>public String greensound;</code></pre><p>Here's my OnClick code:</p><pre><code>case R.id.green:     SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);     greensound  = prefs.getString(""greensound"", ""gsone"");       if (greensound == ""gsone"") {        mSoundManager.playSound(1);        } else if (greensound == ""gstwo"") {        mSoundManager.playSound(2);        } else if (greensound == ""gsthree"") {        mSoundManager.playSound(3);       } break;</code></pre><p>Here's my xml:</p><pre><code>&lt;ListPreference android:title=""Geen Button"" android:key=""greensound""android:summary=""Select sound for the Green Button"" android:entries=""@array/green_list"" android:entryValues=""@array/green_list_values""android:defaultValue=""gsone""&gt;&lt;/ListPreference&gt;</code></pre><p>here's my Settings.java:</p><pre><code>package com.my.app;import android.os.Bundle;import android.preference.PreferenceActivity;public class Settings extends PreferenceActivity {    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.settings);    }}</code></pre><p>and here's my array's if that will help at all:</p><pre><code>//This is the one I want to display to the user    &lt;string-array name=""green_list""&gt;       &lt;item&gt;Sound One&lt;/item&gt;      &lt;item&gt;Sound Two&lt;/item&gt;      &lt;item&gt;Sound Three&lt;/item&gt;      &lt;item&gt;Sound Four&lt;/item&gt;      &lt;item&gt;Sound Five&lt;/item&gt;    &lt;/string-array&gt;    &lt;string-array name=""green_list_values""&gt;       &lt;item&gt;gsone&lt;/item&gt;      &lt;item&gt;gstwo&lt;/item&gt;      &lt;item&gt;gsthree&lt;/item&gt;      &lt;item&gt;gsfour&lt;/item&gt;      &lt;item&gt;gsfive&lt;/item&gt;    &lt;/string-array&gt;</code></pre><p>edit: added a logcat that kinda looked possibly related.</p><pre><code>08-27 01:52:07.738: WARN/Resources(6846): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090000}08-27 01:52:07.748: WARN/Resources(6846): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090000}08-27 01:52:07.758: WARN/Resources(6846): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090000}</code></pre><p>DDMS > File Explorer > Data > Data > packageName > SharedPreferencesThis is what was in there:</p><p>com.my.app_preferences.xml:</p><pre><code>&lt;?xml version='1.0' encoding='utf-8' standalone='yes' ?&gt;&lt;map&gt;&lt;string name=""redsound""&gt;rsone&lt;/string&gt;&lt;string name=""greensound""&gt;gsone&lt;/string&gt;&lt;/map&gt;</code></pre><p>_has_set_default_values.xml:</p><pre><code>&lt;?xml version='1.0' encoding='utf-8' standalone='yes' ?&gt;&lt;map&gt;&lt;boolean name=""_has_set_default_values"" value=""true"" /&gt;&lt;/map&gt;</code></pre><p>This all really confuses me more because...It looks like greedsound does infact = gsone so.... I don't understand whats wrong its not even playing the default sound. and yes i've tested </p><pre><code>mSoundManager.playSound(1); mSoundManager.playSound(2); mSoundManager.playSound(3);</code></pre><p>all without the other code and they work great. I'm not sure what's work</p>","393373","","393373","","2010-08-28 19:13:23","2010-09-05 03:42:05","Simple ListPreference is not working. Any ideas?","<java><android><settings><listpreference>","3","0","","",""
"3580972","1","","","2010-08-27 02:37:50","3","606","<p>We generate a temporary file on an Android device and attach it to an email. We use a custom Content Provider to feed that file to the email application. The problem is that the email application access the file many times, instead of once, until it finally sends the email (for example, every time it writes a draft we get a request).</p><p>That makes hard to know <em>when</em> to delete that temporary file.</p><p>Any ideas on a safe method to know when our email was delivered so we can clean the device and not leave trash behind? (periodically delete also does not seem right as the phone can be for a while with the email in the Drafts folder)</p><p>Thanks a lot for the help!</p>","432491","","","","","2011-06-13 13:38:52","When to delete a temporary file used in Intent.SEND for attached email?","<android><email><attachment><android-contentprovider>","1","0","1","",""
"3581208","1","","","2010-08-27 03:51:40","1","1983","<p>Is there a way I can have the MediaController show always?</p><pre><code>    videoView = (VideoView) findViewById(R.id.videoView);</code></pre><p>String path = ""/sdcard/feiyang/video/sfqx.3GP"";</p><p>MediaController m = new MediaController(this);  videoView.setMediaController(m);  videoView.setVideoPath(path);  videoView.start();</p><p>i use m.show(0); but it does not work.</p>","410220","","","","","2013-01-02 13:27:27","show the MediaController","<android>","2","0","0","",""
"3581243","1","","","2010-08-27 04:04:18","3","1845","<p>I'm sure this might be a simple question, but unfortunately this is my first time using Java and working the Android SDK.</p><p>I am uploading files on Android using the Apache HTTP libraries, in particular using the MultipartEntity.</p><p>I'm uploading to a service that allows me to send them chunks of the file, and once complete, they'll reassemble the chunks.  I'd like to take advantage of this feature.</p><p>Here's the scenario.</p><p>File FOO.BAR is 20 MB.  I'd split it into some arbitrary chunk size, let's say 1 MB, which means 20 chunks.   Chunks #3 and #14 fail (maybe the cellular/WiFi connection was bad).  I can now re-upload just these two chunks and everything will be good.</p><p>What I'd like to know is how can I read only part of a file (like the data between 3MB and 4MB)?  </p><p>The file piece should be an InputStream or File object.</p><p>Thanks,Makoto</p>","388065","","","","","2010-08-27 05:45:49","Read a segment of a file in Java / Android","<java><android><http><file-upload>","3","0","","",""
"3581379","1","3581411","","2010-08-27 04:44:34","1","9198","<p>I want to place a textview on the right of a layout and on the left of a layout, but they keep stacking ontop of each other:</p><pre><code>&lt;LinearLayout        android:layout_width=""0dip""        android:layout_weight=""1""        android:layout_height=""fill_parent"" android:orientation=""horizontal""&gt;        &lt;TextView            android:id=""@+id/lefttext""            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:text=""Symbol""/&gt;       &lt;TextView            android:id=""@+id/righttext""            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:text=""Price""/&gt;    &lt;/LinearLayout&gt;</code></pre>","19875","","","","","2013-02-03 22:42:43","How to place textview on right and left of layout?","<android><layout><textview><android-linearlayout>","3","0","","",""
"3581436","1","","","2010-08-27 05:00:58","0","859","<p>I'm doing visual design for an Android App supporting WVGA.What should the pixel width and height in Photoshop be?Does it have to be 480x800? Or can I still design in 320x480?Thank you so much!</p>","432569","","","","","2010-11-19 13:10:04","Android: WVGA (480x800), width and height in photoshop?","<android>","1","0","","",""
"3581444","1","","","2010-08-27 05:03:12","0","263","<p>I want to develop a application with widget. Now i only can find the applicaion in widget but cannot find the application in ""all programs""</p><p>Thank you</p><p>my AndroidMainfest.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android"" package=""test.testing_v1_0"" android:versionCode=""1"" android:versionName=""1.0""&gt; &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;  &lt;activity android:name="".MyActivity"" android:label=""@string/app_name""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;   &lt;/intent-filter&gt;  &lt;/activity&gt;  &lt;receiver android:name="".testing123"" android:label=""@string/app_name""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;   &lt;/intent-filter&gt;   &lt;meta-data android:resource=""@xml/widget_provider_full""    android:name=""android.appwidget.provider""&gt;   &lt;/meta-data&gt;  &lt;/receiver&gt;  &lt;service android:name="".testing123$UpdateService"" /&gt;  &lt;activity android:name="".MyActivity""&gt;   &lt;intent-filter&gt;    &lt;action android:name=""android.appwidget.action.APPWIDGET_CONFIGURE"" /&gt;    &lt;meta-data android:resource=""@xml/widget_provider_full"" android:name=""android.appwidget.provider""&gt;    &lt;/meta-data&gt;   &lt;/intent-filter&gt;  &lt;/activity&gt; &lt;/application&gt; &lt;uses-sdk android:minSdkVersion=""7"" /&gt; &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt; &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre>","362053","","805865","","2012-01-10 20:10:11","2012-01-10 20:10:11","Program with widget","<android><widget>","1","0","","",""
"3581595","1","","","2010-08-27 05:41:22","0","2381","<p>I am new To android.I have Some Code..I have </p><p>Simple.java :</p><pre><code> public class Simple extends Activity {     /** Called when the activity is first created. */      Button show;      TextView view;    EditText edit; @Override  public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main);       show=(Button)findViewById(R.id.show);      view=(TextView)findViewById(R.id.view);      edit=(EditText)findViewById(R.id.edit);show.setOnClickListener(new OnClickListener(){    public void onClick(View view){    show();    }});}public void show(){    String text=edit.getText().toString();    view.setText(text);    Intent t=new Intent(this,Show.class);    startActivity(t);}</code></pre><p>}</p><p>When i tried To Display the text in the same activity it works...I am trying to pass the text Which i typed in EditText and to display it to Show.class</p><p>the code  for Show.class</p><p>public class Show extends Activity {</p><pre><code>private Simple simple;TextView text1;Button back;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.next);    back=(Button)findViewById(R.id.button);    text1=(TextView)findViewById(R.id.then);    back.setOnClickListener(new OnClickListener(){        public void onClick(View view){            start();        }    });}public void start(){        String t=simple.edit.getText().toString();        text1.setText(t);    Intent t=new Intent(this,Simple.class);    startActivity(t);}</code></pre><p>}</p><p>I tried this one I am not able to Display the text which i gave in editText in Simple.java.I know it is basic but I do know. So Please Help me out.Thanks in Advance..</p>","366916","","","","","2010-08-27 10:16:04","Android-How To Make the Text display","<android>","2","0","","",""
"3581623","1","","","2010-08-27 05:45:41","1","155","<p>Rating Bar in the ApiDemos app runs fine on 1.5 and 2.1 simulator.  But when I tried it on the popular module AT&amp;T Galaxy 2.1, it get truncated on the portrait mode.  I am expecting to see 5 stars but only 4 are show.  In landscape mode, it's showing 6 stars.</p><p>Any Idea?</p>","432596","","443075","","2011-05-29 07:19:55","2011-05-29 07:19:55","Rating Bar in ApiDemos app get cropped in AT&T Galaxy 2.1 phone","<android><widget><rating>","0","1","1","",""
"3581722","1","9220238","","2010-08-27 06:04:31","1","656","<p>Is it possible by pressing a button in my <code>Activity</code> to make the volume bar appear? The volume bar is the view that appears when you press one of the hardware volume buttons.</p><p>Is there a API function to do this or do I have to recreate that view by hand?</p>","292263","","","","","2013-07-14 06:59:21","Trigger system volume bar","<android><volume>","2","0","","",""
"3581723","1","","","2010-08-27 06:04:38","0","940","<p>I am writing the code for the tab activity but there is a problem. When I navigate from 1 tab to another tab then it does not finish the activity of the previous tab. Suppose there are 3 tab Activities A, B, C then by default it goes to A. Then I go to tab B and then to tab C. But, when I press back button then it goes to the previous tab. I don't want to open the previous tab. Please give me the solution for this.</p><p>Here is my Code</p><pre><code>intent = new Intent().setClass(this, ShowNotification.class);            // Initialize a TabSpec for each tab and add it to the TabHost            spec = tabHost.newTabSpec(""A"").setIndicator(""A"",                          res.getDrawable(R.drawable.notification))                      .setContent(intent);            tabHost.addTab(spec);intent = new Intent().setClass(this, Classes.class);            spec = tabHost.newTabSpec(""B"").setIndicator(""B"",                          res.getDrawable(R.drawable.myclasses))                      .setContent(intent);            tabHost.addTab(spec); intent = new Intent().setClass(this, ShowSettings.class);        spec = tabHost.newTabSpec(""C"").setIndicator(""C"",                          res.getDrawable(R.drawable.setting))                      .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(Integer.parseInt(getIndex));</code></pre><p>Please give me any link by which we can use views instead of activities</p>","339116","","1903853","","2014-02-07 11:06:11","2014-02-07 11:06:11","Tab Activity finished","<android><tabactivity>","0","3","","",""
"3581730","1","3581765","","2010-08-27 06:06:17","2","2460","<p>i want to check the sms sending through th e emulator to phone can we do that?</p>","421645","","","","","2012-08-21 13:26:05","can we send sms through emulator in android?","<android>","4","0","","",""
"3581753","1","","","2010-08-27 06:11:26","3","5938","<p>I'm an Android newbie.  This should be the easiest thing in the world, but figuring it out is driving me batty: how do I get the dimensions of a view or layout?</p><p>The standard approach seems to be something along the lines of:</p><p>((LinearLayout)this.findViewById(R.id.MyLayout)).getWidth();</p><p>Except that this always returns zero, since I'm trying to do this when the Activity starts up (onCreate) and the geometry isn't set yet.  I tried putting in sleeps to give it a chance to set up the layout, except that it <em>won't</em> set up the layout until onCreate returns.  So it's clearly not threaded.  :P</p><p>I found a bunch of pages talking about overriding all sorts of different callback functions in order to be sure that the layout is loaded when you call getWidth -- but all of them threw errors when I tried to put the overrides in my Activity.  So I can assume that they were callbacks for the layouts and/or views being measured.  The problem with that is that I'm not using custom view/layout classes -- just the standard ones.  So I can't just add an override, as far as I know.</p><p>Anyone know what I should do?  I've spent something like 8 hours on this problem and gotten nowhere.  And it's something that's normally such a trivial thing to do in most development environments!</p>","416650","","","","","2012-11-18 01:02:14","Can't figure out how to get view/layout width/height","<android>","5","0","","",""
"3581812","1","3581845","","2010-08-27 06:20:42","2","1829","<p>Android: i am using gps check box in my application, which user check this we use gps location of the user.</p><p>Now i have to make change if user check this checkbox we use gps location and if user remain this box checked then we have to detect user location every after 10 mins and if location is different we have to prompt user that location is change and if user want to use new location.</p><p>any idea how appy listner which get fire every after 10 min and get stop after detecting location ? any good idea to implement it just want you guys idea.</p>","216431","","","","","2012-03-11 06:47:31","android detect gps location every after 10 mins","<android><gps>","2","0","2","",""
"3581816","1","3581973","","2010-08-27 06:21:35","1","2019","<p>I am writing a simple Android app and have a database that will send back information into the app. I am new to Android and am looking for a simple example that demonstrates how the Android App can process a JSON response received from a HTTP request.</p><p>I need to see what classes are used for Android apps to process a HTTP response. A reference to a good tutorial, or if you're keen, write a very basic method to do the job. Thanks</p>","193467","","","","","2012-09-07 03:46:08","I need a simple java example of processing a JSON response via HTTP for Android App?","<android><json>","3","0","1","",""
"3581869","1","","","2010-08-27 06:32:53","0","793","<p>Hai , I need a solution for , how to send an image  behind the scenes i.e; with out users further input ? Can any one help me to sort out this ?</p><p>thanking you .Srinivas</p>","414777","","491044","","2011-03-11 09:15:52","2011-03-11 09:15:52","Sending Image behind the scenes in android?","<android><sms>","2","0","","",""
"3581920","1","3615406","","2010-08-27 06:43:20","1","2369","<p>I'm trying to download Eclipse IDE for Android development. I've downloaded the setup but whenever I try to open the dmg it gives the an error saying:</p><p>""Can't open the application Eclipse because it is not supported on this type of Mac.""</p><p>The Processor of my Mac is 1.83 GHz Intel Core Duo and version of my Mac OS X is 10.6.4. </p><p>I downloaded ""Eclipse IDE for Java Developers""  4m  <a href=""http://www.eclipse.org/downloads/"" rel=""nofollow"">http://www.eclipse.org/downloads/</a></p><p>Anyone have the idea about the problem?</p>","408569","","408569","","2010-08-27 09:08:20","2013-09-10 16:17:27","Unable to install Eclipse IDE on my Mac","<java><android><eclipse><osx><osx-snow-leopard>","4","1","","",""
"3582073","1","3582668","","2010-08-27 07:11:24","2","3700","<p>Hey guys I'm having trouble with a spiner throwing a nullPointerExpression I'm sure I'm missing something stupid? </p><p>Thanks for you help</p><p>here is my code:</p><p>public class main extends Activity {    /** Called when the activity is first created. */</p><pre><code>public TextView strCurrency;public TextView strCurrencyOUT;Button butCalc;private Spinner spinner; private static final String[] array = { ""AUD"", ""CAD"", ""USD"", ""GBP"",};</code></pre><hr><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    strCurrency = (TextView) this.findViewById(R.id.txtCurrency);    strCurrencyOUT = (TextView) this.findViewById(R.id.txtOUT);    butCalc = (Button) this.findViewById(R.id.butCalc);    butCalc.setOnClickListener(new Button.OnClickListener() { public void onClick (View v){ calculate(); }});    Spinner spinner = (Spinner) findViewById(R.id.widget28);    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,   android.R.layout.simple_spinner_item, array);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(adapter);</code></pre><hr><pre><code>public void calculate() {    String   str = (String) spinner.getSelectedItem();            strCurrencyOUT.setText(str);</code></pre><hr><p><strong>Logcat</strong></p><pre><code>W/KeyCharacterMap(  205): No keyboard for id 0W/KeyCharacterMap(  205): Using default keymap: /system/usr/keychars/qwerty.kcm.binD/AndroidRuntime(  205): Shutting down VMW/dalvikvm(  205): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)E/AndroidRuntime(  205): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  205): java.lang.NullPointerExceptionE/AndroidRuntime(  205):    at biz.thorley.Currency.main.calculate(main.java:58)E/AndroidRuntime(  205):    at biz.thorley.Currency.main$1.onClick(main.java:40)E/AndroidRuntime(  205):    at android.view.View.performClick(View.java:2344)E/AndroidRuntime(  205):    at android.view.View.onTouchEvent(View.java:4133)E/AndroidRuntime(  205):    at android.widget.TextView.onTouchEvent(TextView.java:6510)E/AndroidRuntime(  205):    at android.view.View.dispatchTouchEvent(View.java:3672)E/AndroidRuntime(  205):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  205):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  205):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  205):    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)E/AndroidRuntime(  205):    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)E/AndroidRuntime(  205):    at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202)E/AndroidRuntime(  205):    at android.app.Activity.dispatchTouchEvent(Activity.java:1987)E/AndroidRuntime(  205):    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)E/AndroidRuntime(  205):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1658)E/AndroidRuntime(  205):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  205):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  205):    at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime(  205):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  205):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  205):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime(  205):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime(  205):    at dalvik.system.NativeStart.main(Native Method)I/Process (   53): Sending signal. PID: 205 SIG: 3I/dalvikvm(  205): threadid=7: reacting to signal 3E/dalvikvm(  205): Unable to open stack trace file '/data/anr/traces.txt': Permission deniedI/Process (  205): Sending signal. PID: 205 SIG: 9I/ActivityManager(   53): Process biz.thorley.Currency (pid 205) has died.I/WindowManager(   53): WIN DEATH: Window{438d8e38 biz.thorley.Currency/biz.thorley.Currency.main paused=false}W/UsageStats(   53): Unexpected resume of com.android.launcher while already resumed in biz.thorley.CurrencyW/InputManagerService(   53): Got RemoteException sending setActive(false) notification to pid 205 uid 10023</code></pre>","382957","","1722818","","2013-07-23 06:12:38","2013-07-23 06:12:38","android spinner NullPointerException","<java><android><sdk><nullpointerexception>","2","0","","",""
"3582168","1","","","2010-08-27 07:28:29","0","163","<p>can we run our android application in all iphone devices?</p>","421645","","","","","2010-08-27 10:20:29","does all device support android application?","<android>","5","3","0","2012-08-24 01:02:43",""
"3582196","1","3582203","","2010-08-27 07:33:30","2","1784","<p>I have 3 video files each of 70 MB in my raw folder besides other audio files of few KBs. I am getting an installation error of insufficient space on the DROID while testing my app. I tried uninstalling apps and am now left with apps that are essential to the device.</p><p>What needs to be done to resolve this issue? I also wonder what will be the app size that i am allowed to upload to the android market?</p><p>Thank you.</p>","2355649","","","","","2010-08-27 07:35:11","Android: Whats the maximum size of app that i can upload to the market?","<android>","1","0","","",""
"3582202","1","3582641","","2010-08-27 07:34:28","0","386","<p>Android: i want to create service by extending a Service class which i start when application get started and all activities can share its state and when i want stop it from other activity and when i want start it again from any activity ?</p>","216431","","","","","2010-08-27 08:55:27","android service by mean share by all activities","<android><service>","1","0","1","",""
"3582254","1","","","2010-08-27 07:46:55","0","727","<p>I have read some post about apps programming for Iphone and Android, but I have one question. Is it posible when there is a mobile website optimized for mobile phones, that I can create apps for Iphone, Android, Win 7 and Blackberry, that only statrts the browser as instance and display the mobile website? What do you think, is this ok? Do you have any ideas or examples for that kind of apps? I mean this is not an app, that should be has access to the hardware of the phone, only web app.</p><p>ThanksNik</p>","423792","","","","","2010-08-27 08:07:34","Android, Iphone app with JS and HTML","<iphone><android>","3","0","","",""
"3582283","1","","","2010-08-27 07:52:48","0","827","<p>I've a listView Activity where user could open a dialog to display more information about a line of the list. </p><p>On the Dialog user could modify a line. So my purpose is to refresh listView when User modify it by the Dialog.</p><p>The problem is that I couldn't use myArrayAdapter.notifyDataSetChanges() so How I could do that ?</p>","335500","","","","","2010-08-27 12:15:39","ListView Activity & Dialog","<android><listview><dialog>","1","4","","",""
"3582377","1","","","2010-08-27 08:12:55","2","1133","<p>I have videos that should be run on android. and those videos will be host on web server -  so my android app will hit the web server to play the video.</p><p>I try several way to encode the video and the result is not good enough, sometimes the sound and the video is not align or sometimes the video is not shown but i can still hear the audio, or some is work on one handset but not in another handset :(</p><p>I've tried handbrake, format factory, and many else free software from internet, no none is good so far (or i miss setting it).</p><p>okay, so my questions are:</p><ol><li>what is the proper setting for the video encoder?</li><li>is there any limitation? - actually my video is in portrait dimension</li><li>what is the best software to encode? (free? :D) - can i just use adobe media encoder?</li></ol><p>Thank you guys,Regards,</p>","286080","","","","","2010-08-27 08:41:58","the best way to Encode Video For Android","<android><video><media><player><encoder>","1","0","1","",""
"3582387","1","3614507","","2010-08-27 08:14:56","0","337","<p>Please throw some light on How the prelinking or preloading is handled in Android-x86 platform. Because, I am seeing only prelink-linux-arm.map in the code. The x86 loader is also using the same filename? If so, Is the loading address in the map file is same for both x86 and ARM platform?</p>","423671","","","","","2010-09-01 01:46:16","Android x86 Prelink","<android>","1","0","","",""
"3582603","1","","","2010-08-27 08:49:39","9","14921","<p>I would like to implement some sort of remote assistance tool (like vnc) for Android. Is there the possibility to capture a screen programmatically on the device?</p>","432723","","418183","","2011-05-19 10:29:34","2014-04-10 10:09:20","Programmatic screencapture on mobile device","<android><screenshot>","6","0","10","",""
"3582692","1","3645754","","2010-08-27 09:05:13","1","989","<p>I have the following error but cannot workout the problem, i am READING MP3 files and the below error seems to come as it tries to WRITE MP4 files.</p><pre><code>AudioFile f = AudioFileIO.read(m_file.get(x));</code></pre><p>Error comes after calling the above and passing the first MP3 file</p><pre><code>08-27 09:51:47.671: ERROR/dalvikvm(4485): Could not find class     'javax.swing.tree.DefaultMutableTreeNode', referenced from method     org.jaudiotagger.audio.mp4.Mp4TagWriter.write08-27 09:51:47.671: WARN/dalvikvm(4485): VFY: unable to resolve check-cast 303 (Ljavax/swing/tree/DefaultMutableTreeNode;) in Lorg/jaudiotagger/audio/mp4/Mp4TagWriter;08-27 09:51:47.671: WARN/dalvikvm(4485): VFY:  rejecting opcode 0x1f at 0x00aa08-27 09:51:47.671: WARN/dalvikvm(4485): VFY:  rejected Lorg/jaudiotagger/audio/mp4/Mp4TagWriter;.write (Lorg/jaudiotagger/tag/Tag;Ljava/io/RandomAccessFile;Ljava/io/RandomAccessFile;)V08-27 09:51:47.671: WARN/dalvikvm(4485): Verifier rejected class Lorg/jaudiotagger/audio/mp4/Mp4TagWriter;08-27 09:51:47.671: WARN/dalvikvm(4485): threadid=17: thread exiting with uncaught exception (group=0x4001da28)08-27 09:51:47.681: ERROR/AndroidRuntime(4485): Uncaught handler: thread MagentoBackground exiting due to uncaught exception08-27 09:51:47.781: ERROR/AndroidRuntime(4485): java.lang.VerifyError: org.jaudiotagger.audio.mp4.Mp4TagWriter08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at org.jaudiotagger.audio.mp4.Mp4FileWriter.&lt;init&gt;(Mp4FileWriter.java:36)08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at org.jaudiotagger.audio.AudioFileIO.prepareReadersAndWriters(AudioFileIO.java:244)08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at org.jaudiotagger.audio.AudioFileIO.&lt;init&gt;(AudioFileIO.java:182)08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at org.jaudiotagger.audio.AudioFileIO.getDefaultAudioFileIO(AudioFileIO.java:126)08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at org.jaudiotagger.audio.AudioFileIO.read(AudioFileIO.java:148)08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at it.cloudspace.rhythmrunner.main.getSongs(main.java:115)08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at it.cloudspace.rhythmrunner.main.access$3(main.java:103)08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at it.cloudspace.rhythmrunner.main$2.run(main.java:62)08-27 09:51:47.781: ERROR/AndroidRuntime(4485):     at java.lang.Thread.run(Thread.java:1060)08-27 09:51:47.871: INFO/Process(76): Sending signal. PID: 4485 SIG: 308-27 09:51:47.871: INFO/dalvikvm(4485): threadid=7: reacting to signal 308-27 09:51:48.271: INFO/dalvikvm(4485): Wrote stack trace to '/data/anr/traces.txt'08-27 09:51:48.301: ERROR/vending(4501): com.android.vending.api.LocalAssetDatabase.buildPackageNameMap(): Multiple assets with package name com.google.android.apps.unveil08-27 09:51:48.311: ERROR/vending(4501): com.android.vending.api.LocalAssetDatabase.buildPackageNameMap(): Multiple assets with package name com.amazon.kindle08-27 09:51:54.061: DEBUG/dalvikvm(3189): GC freed 13924 objects / 712680 bytes in 590ms</code></pre>","381258","","","","","2010-09-05 10:33:52","Android jAudioTagger Problem - Reading mp3 file - VerifyError","<android><tags><mp3><verifyerror>","1","0","","",""
"3582814","1","3634814","","2010-08-27 09:24:15","0","75","<p>I have implemented application in which i am using tabs and want to fetch the images,audio,video from server and show on appropiate tab.</p><p>can anybody help me ..</p><p>Thanks Rakesh</p>","1386533","","","","","2010-09-03 10:21:56","fetch media from internet and storing in imageview","<android>","1","0","","",""
"3582828","1","","","2010-08-27 09:26:08","0","1268","<p>In my application, I have problem with activity management.Indeed, consider I have 3 activities :- Splashscreen- SignIn- Home</p><p>I would see :- First launch (user not logged) : Splashscreen -> SignIn -> Home (log in valid)- Other launch (user registered) : Splashscreen -> Home (auto log)</p><p>The problem is :Back from SignIn or Home closes always the application.But with the first launch, back from Home go back to SignIn.How to prevents this ?</p><p>Thanks</p>","432753","","","","","2010-08-27 10:24:31","Android activity stack problem","<android><activity><history><task>","2","0","","",""
"3582927","1","3583134","","2010-08-27 09:37:43","1","112","<p>When I start a new Android project in Eclipse (Helios), the strings.xml has 2 strings, <code>app_name</code> and <code>hello</code> (which is normal, of course), but they're not shown in the resources view. They seem blank and on clicking anywhere or typing in either views brings up an error dialog, saying ""An error occured.. <code>java.lang.NullPointerException</code>. I'm able to add more attributes, but this dialog keeps on coming. And no programs have failed to run yet.<br>What is really the problem and how can I solve it?<br>Thanks</p>","309802","","309802","","2010-08-27 09:45:24","2010-08-27 10:05:52","Android/Eclipse problem","<eclipse><android>","2","1","","",""
"3582976","1","4207344","","2010-08-27 09:44:24","0","1012","<p>I got one question regarding the intent action ""ACTION_CALL"". </p><p>What is the correct way of getting back to the own application/activity after the user ends the call? </p><p>The only way that came to my mind uses a PhoneStateListener in a background services that waits for the CALL_STATE_IDLE event starting up the application again. But I am not quite sure if that is the correct/intended way of using the intent.</p><p>I am looking forward reading your answers. </p><p>Thank you very much! </p>","391216","","","","","2011-04-04 13:41:55","Android Intent Action ""ACTION_CALL"" - Correct way of getting back to own application after call?","<android>","1","0","2","",""
"3582995","1","","","2010-08-27 09:47:04","0","140","<p>What is the most efficient way to deliver the same set of functions on different mobile platforms (Windows, Blackberry &amp; Android, possibly iPhone)?</p><p>What are your real life experience of the conversion of a common design to the minimum possible sets of source code? What are the good/bad tools?</p>","416315","","416315","","2010-09-07 14:32:43","2010-09-07 14:32:43","What is the most efficient way to deliver the same functionality on Windows Mobile, Android & Blackberry?","<android><windows-mobile><blackberry>","1","0","","",""
"3583244","1","","","2010-08-27 10:23:56","2","465","<p>I'm using a lot of animation drawables on my app and not all frames are gettings played. I'm wondering if there is another, more efficient method of doing frame by frame animations than AnimationDrawable?</p>","409853","","","","","2011-07-04 14:19:06","Is it possible to do frame by frame animation without AnimationDrawable?","<android><animation>","1","2","","",""
"3583264","1","5514668","","2010-08-27 10:27:36","8","5099","<p>I've created a web view app, the page that is displayed features market:// links but upon clicking them I get the 404 screen along with the error that the protocol is not supported. I've tried looking through documentation but was unable to find anything relating to this. Any help is much appreciated.</p>","319940","","1503078","","2013-11-22 00:25:58","2013-11-22 00:25:58","Support for other protocols in Android webview","<android><android-webview><custom-url><uri-scheme>","3","0","3","",""
"3583371","1","","","2010-08-27 10:40:43","2","690","<p>I'm trying to record video from the Camera using the MediaRecorder. Here's a code snippet</p><p>snip..<pre><code>  mr.setAudioSource( MediaRecorder.AudioSource.MIC );  mr.setVideoSource( MediaRecorder.VideoSource.CAMERA);  mr.setOutputFormat( MediaRecorder.OutputFormat.THREE_GPP );  mr.setAudioEncoder( MediaRecorder.AudioEncoder.AMR_NB );  mr.setVideoEncoder( MediaRecorder.VideoEncoder.MPEG_4_SP );  mr.setVideoSize( 200, 200 );  mr.setVideoFrameRate( 15 );</pre></code>..snap</p><p><p>Code executes on a MileStone/Droid, non-empty output file will be created. But when I try to view the video, it looks like this:</p><p><img src=""http://i.stack.imgur.com/fgPVk.png"" alt=""alt text""></p><p>My first thoughts were about some sort of encoding error, so I tried every possible OutputFormat/VideoEncoder combination, with no effetcs on the result.</p><p>LogCat shows the following error   CameraInput: Unsupported parameter(x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value)</p><p>But I can't figure out, what I may have set wrong. I used camera.getParameters(), set the preview size with the returned params and then pushed them back using camera.setParameters()...</p><p>Worked thru every piece of sample code I could find, but still found no solution. </p><p>Does anyone have any ideas ?</p>","393827","","476681","","2011-12-23 13:54:39","2012-11-29 23:35:11","Android: recorded video seems *distorted*","<android><video>","4","0","1","",""
"3583405","1","","","2010-08-27 10:45:49","7","15175","<p>I'm trying to store the index of the currently selected tab in onSaveInstanceState so I can restore it. However the getCurrentTab apparantely gives me back the String I used in the etTabHost().newTabSpec, which I find a bit weird since the documentation says it returns an int and setCurrentTab also taking an int.Does anyone know how I can get the index of my currently selected tab so I can restore it?</p>","432825","","","","","2014-03-26 16:05:21","Get index of selected tab in tabHost","<android><android-sdk-2.2><android-tabhost>","2","4","4","",""
"3583555","1","3583629","","2010-08-27 11:09:09","1","186","<p>I in my android application I want to track GPS information and use this information in all activity.</p><p>Is it a good way to use onLocationChanged, in the Application class?</p><p>I also want to have a timer that will measure the elapsed time, and use in all applications not only in one Activity</p><p>The information onLocationChanged and timer and want to use in all activities in my application</p><p>Functions are not problem, problem is that I want to use function information in all my android application!</p>","432848","","1228","","2010-08-27 11:25:06","2010-08-27 11:34:09","Where is a good place to grab GPS data?","<android><gps><timer>","2","0","","",""
"3583570","1","3583665","","2010-08-27 11:11:04","1","2045","<p>I want to set the text size of the <code>ListView</code>. I am not use the XML Layout file.</p><p>How to do this in coding?</p>","387466","","119895","","2010-08-27 11:17:16","2011-06-18 05:35:35","Set the size of text in ListView","<android>","3","0","","",""
"3583584","1","4477793","","2010-08-27 11:13:14","1","173","<p>I am working android application  my problem is  i am using  handlers this handler running audio files  this audiofiles running automatically  every 5 seconds  i am closing total activity   application will be closed but audiofile  also running last position file </p><p>how to resolve this problem    please forward some suggestion or some solution its urgent i am new developer in android </p>","254790","","","","","2010-12-18 11:13:26","handler running then close total activity media file continue how to resolve the problem","<android>","1","2","2","",""
"3583726","1","3585644","","2010-08-27 11:36:43","1","1754","<p>when open my apps gallery is running and set current gallery image to imageview and playing one audio file through media player if i come out of my aps even it is running </p><p>i tried to give mp.stop() and mp.release() in destroy method but it wont work for meplease suggest me</p><p>Thanks in Advance</p><p>aSwan</p>","1746300","","","","","2010-08-27 15:21:06","how to stop media player in android","<android>","1","3","","",""
"3583744","1","3584092","","2010-08-27 11:38:48","2","955","<p>In need in my application to fetch remote HTML document and parse some parts out of it.As I don't want to play with string parsing, which would be really lots of work, I thought about using XSLT, which would let me build small XML document out of HTML and then read it easy.</p><p>Seems there is no XSLT support in Android? What other ways I could parse HTML without parsing content as simple string directly?</p>","283037","","36305","","2010-08-27 12:38:23","2010-08-27 12:38:23","Parsing HTML in Android: no XSLT? What to use?","<html><android><xml><parsing><xslt>","1","0","2","",""
"3583755","1","3585575","","2010-08-27 11:40:28","0","2671","<p>I have a REST web service that returns an xml result like this:</p><pre><code>- &lt;MyCategories xmlns=""http://schemas.datacontract.org/2004/07/ceva"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""&gt;- &lt;Category&gt;  &lt;CategoryName&gt;First category&lt;/CategoryName&gt;   &lt;Id&gt;1&lt;/Id&gt;   &lt;/Category&gt;- &lt;Category&gt;  &lt;CategoryName&gt;Second category&lt;/CategoryName&gt;   &lt;Id&gt;2&lt;/Id&gt;   &lt;/Category&gt;- &lt;Category&gt;  &lt;CategoryName&gt;Third category&lt;/CategoryName&gt;   &lt;Id&gt;3&lt;/Id&gt;   &lt;/Category&gt;  &lt;/MyCategories&gt;</code></pre><p>I acces the web service like this:</p><pre><code>     HttpClient httpclient = new DefaultHttpClient();       HttpGet request = new HttpGet(WebServiceURL);       request.addHeader(""deviceId"", deviceId);       BasicResponseHandler handler = new BasicResponseHandler();       result = httpclient.execute(request, handler);</code></pre><p>In result I get the xml response from the web service. I want to be able to use this result and display it in a listview.</p><p>How can I achieve this ?Thank you.</p>","379865","","","","","2010-08-27 15:14:29","Android REST XML result to Listview","<android><rest><sax><xml-parsing>","1","0","2","",""
"3583840","1","3586898","","2010-08-27 11:54:53","1","1230","<p>I am developing an application for the Parisian Metro.One of the functions is a map where you can click the metro stations and see what are the metro lines, and when are the next 4 trains on this station.</p><p>I have hence created a <code>MapActivity</code> and an <code>ItemizedOverlay</code> classes.</p><p>On my device it is working perfectly, but I am getting some logs from the users with a crash, and I really don't understand what's wrong.</p><p>My map activity adds ONE <code>ItemizedOverlay</code> that displays a blue dot for the current user location. This overlay also listens to onTap, which depending on the coordinates of the tap, will try to find metro stations (for which I know the lat/lon coordinates). This is working perfectly.</p><p>The stack trace of the crash is:</p><pre><code>java.lang.NullPointerExceptionat com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:42)at com.google.android.maps.MapView.onDraw(MapView.java:494)at android.view.View.draw(View.java:6535)at android.view.ViewGroup.drawChild(ViewGroup.java:1531)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)at android.view.ViewGroup.drawChild(ViewGroup.java:1529)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)at android.view.View.draw(View.java:6538)at android.widget.FrameLayout.draw(FrameLayout.java:352)at android.view.ViewGroup.drawChild(ViewGroup.java:1531)at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)at android.view.View.draw(View.java:6538)at android.widget.FrameLayout.draw(FrameLayout.java:352)at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)at android.view.ViewRoot.draw(ViewRoot.java:1349)at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4363)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Sometimes it comes from different lines but it always finishes crashing at <code>OverlayBunde.java:42</code></p><p>As is does not mention my code, I don't know what's wrong.</p><p>You can get the source code of the <code>MapActivity</code> and the the <code>ItemizedOverlay</code>: <a href=""http://code.google.com/p/metroparis/source/browse/trunk/src/org/bicou/metro/"" rel=""nofollow"">http://code.google.com/p/metroparis/source/browse/trunk/src/org/bicou/metro/</a></p><p>The activity class is <code>ACarteStations</code> and the overlay class is <code>StationMetroMapOverlay</code>.</p><p>I am sorry that the code is in French. I will translate it eventually :)If you need translations about the variable names, just let me know.</p><p>Hope you can help me!!</p>","334493","","","","","2010-08-27 17:57:06","Problem with draw() on a MapView ItemizedOverlay","<android><google-maps>","1","1","1","",""
"3583876","1","3584478","","2010-08-27 12:01:11","1","1233","<p>I have the following scenario.</p><p>I send a XML file to a server as a request and get a XML file as response and all that as a background thread on Android.</p><p>The XML request is serialized using various values. The XML response is then read by SAX and put into a list. The whole request/response process happens in a background thread using the <code>AsyncTask</code> class.</p><p>The problem is that I have different types of responses and I have no idea what approach to take to parse the response based on the request sent.</p><p>How do I tell Android to use parser A based on request A and parser B based on request B?</p><p><strong>EDIT:</strong> With different types of responses I mean the XML file looks different. It has different tags and different attributes.</p>","418183","","418183","","2011-07-04 21:25:17","2011-07-04 21:25:17","How to parse different XML files using SAX on Android?","<android><xml><parsing><sax>","2","0","1","",""
"3583972","1","3585608","","2010-08-27 12:14:22","0","2535","<p>When I click on a menu item I am presented with the following message in DDMS:</p><p><strong>Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43882778</strong></p><p>Here is most of the code from the Main class where the onMenuClick is being ignored.</p><pre><code>public class Main extends TabActivity { public static final int ACTIVITY_CREATE = 0; private static final int ADD_ID = Menu.FIRST; private Long listId; private DbHelper mDbHelper; private Cursor mCursor; /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // Set the list id        Bundle extras = getIntent().getExtras();        if (extras != null) {         listId = extras.getLong(""listId"");        }        // Open the database        mDbHelper = new DbHelper(this);        mDbHelper.open();        // Setup the tabs        createTabs();    }    public void createTabs() {     mCursor = mDbHelper.fetchAllCategories(listId);     startManagingCursor(mCursor);     for (int i = 0; i [less than symbol] mCursor.getCount(); i++)     {      createTab(    mCursor.getLong(mCursor.getColumnIndexOrThrow(""_id"")),    mCursor.getString(mCursor.getColumnIndexOrThrow(""category"")));     }    }    public void createTab(Long categoryId, String category) {        TabHost tabHost = getTabHost();        TabHost.TabSpec spec;        Intent intent;        intent = new Intent();      intent.putExtra(""Test"", category);      intent.setClass(this, Categories.class);  spec = tabHost.newTabSpec(category);   spec.setContent(intent);   spec.setIndicator(category);  tabHost.addTab(spec);         } @Override public boolean onCreateOptionsMenu(Menu menu) {  super.onCreateOptionsMenu(menu);  menu.add(0, ADD_ID, 0, R.string.menu_addCategory).setIcon(R.drawable.add_grey);  return true; } @Override public boolean onMenuItemSelected(int featureId, MenuItem item) {  switch (item.getItemId()) {  case ADD_ID:   addCategory();   return true;  }  return super.onMenuItemSelected(featureId, item); } public void addCategory() {  Intent intent = new Intent();  intent.setClass(this, CategoryEdit.class);  startActivityForResult(intent, ACTIVITY_CREATE); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) {  super.onActivityResult(requestCode, resultCode, intent);  switch (requestCode) {  case ACTIVITY_CREATE:   if (resultCode == RESULT_OK) {    Bundle createExtras = intent.getExtras();    mDbHelper.addCategory(createExtras.getString(""category""));   }  } }}</code></pre><p>Originally my CategoryEdit.class wasn't listed in the AndroidManifest.xml file.  I have added that to the manifest and still receive the same error.</p>","422967","","476681","","2011-12-23 13:50:30","2011-12-23 13:50:30","onMenuItemSelected never executes","<android>","2","0","2","",""
"3584024","1","","","2010-08-27 12:20:24","0","1011","<p>I have a <code>TextView</code> and I want to increase its height on runtime.</p><p>I have used <code>android:layout_height=""wrap_content""</code> but it did not gave me the desired result.</p><p>I'm using a Relative Layout.</p><p>i get text through edittext and i want to set it on textview.when i do this it shows only one line, and when i click on edittext it get expanded and full message is shown.</p>","432901","","432901","","2010-08-28 14:30:33","2010-08-28 14:30:33","Increase height of TextView on runtime","<android>","2","1","","",""
"3584180","1","3584440","","2010-08-27 12:39:16","1","5318","<p>i am developing chat application in android...i got some exception when i run my application</p><pre><code>08-27 18:05:29.545: WARN/System.err(809): java.security.KeyStoreException: KeyStore jks implementation not found08-27 18:05:29.565: WARN/System.err(809):     at java.security.KeyStore.getInstance(KeyStore.java:134)08-27 18:05:29.565: WARN/System.err(809):     at org.jivesoftware.smack.ServerTrustManager.&lt;init&gt;(ServerTrustManager.java:61)08-27 18:05:29.589: WARN/System.err(809):     at org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:1246)08-27 18:05:29.594: WARN/System.err(809):     at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:313)08-27 18:05:29.594: WARN/System.err(809):     at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)08-27 18:05:29.604: WARN/System.err(809):     at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)</code></pre><p>and also getting verify exception but i checked my username and password...</p><pre><code>08-27 18:05:31.184: ERROR/AndroidRuntime(809): FATAL EXCEPTION: Thread-908-27 18:05:31.184: ERROR/AndroidRuntime(809): java.lang.VerifyError: org.jivesoftware.smack.sasl.SASLMechanism08-27 18:05:31.184: ERROR/AndroidRuntime(809):     at java.lang.Class.getDeclaredConstructors(Native Method)08-27 18:05:31.184: ERROR/AndroidRuntime(809):     at java.lang.Class.getConstructor(Class.java:477)08-27 18:05:31.184: ERROR/AndroidRuntime(809):     at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:303)08-27 18:05:31.184: ERROR/AndroidRuntime(809):     at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395)08-27 18:05:31.184: ERROR/AndroidRuntime(809):     at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:349)08-27 18:05:31.184: ERROR/AndroidRuntime(809):     at com.sample.test.HelloFormStuffActivity$1.run(HelloFormStuffActivity.java:41)08-27 18:05:31.184: ERROR/AndroidRuntime(809):     at java.lang.Thread.run(Thread.java:1096)</code></pre>","421645","","","","","2010-08-27 13:08:23","how to implement chat application in android?","<android>","1","0","","",""
"3584253","1","","","2010-08-27 12:47:43","1","923","<p>My app is comprised of a set of reusable Activities that other apps can reuse. For various reasons, I would like my Activities to be launched in context of the invoking Activity's process, instead of always being launched in my Activity's process (default behavior on Android). How can I achieve this?</p>","204317","","","","","2010-08-27 13:07:33","Android: How to launch external activity in current activity's process?","<android>","1","0","","",""
"3584267","1","3585036","","2010-08-27 12:49:32","21","6707","<p>I like to save very simple a few Data.best like in iPhone I can do with NSUserDefaults.</p><p>What is the similar command here in Android?(just saving a few Variables, to be reused as long the application is installed)I dont like to use a complicated Database just to do that.</p><p>thxchris</p>","355372","","","","","2013-09-02 16:22:07","Android similar NSUserDefaults from iPhone","<android>","2","0","8","",""
"3584297","1","3584488","","2010-08-27 12:52:27","7","9216","<p>I am facing this problem and finding solution for this issue since last 2 weeks.</p><p>Right now i have developed an android application for the client perpose, whose size is 54 MB, from which 52 MB of only Images/Photos.</p><p><strong>[Edit: I need to keep images in ""drawable"" folder ]</strong></p><p>So i want to install it in sd-card on Android SDK 2.2 for that i have already set <code>android:installLocation=""preferExternal""</code> in the AndroidManifest.xml file. I have created <strong>256MB sd-card</strong> while creating an avd , <strong>heap size - 192</strong> , <strong>ram size - 192</strong></p><p>but it still showing me an error:</p><blockquote>  <p>[2010-08-27 17:58:28 - demo_test]  Failed to upload demo_test.apk on  device 'emulator-5554'<br>  [2010-08-27  17:58:28 - demo_test]  java.io.IOException: Unable to upload  file: No space left on device<br>  [2010-08-27 17:58:28 - demo_test]  Launch canceled!</p></blockquote><p><strong>Edit:</strong></p><p><img src=""http://i.stack.imgur.com/koxVw.png"" alt=""alt text""></p><ol><li>Is this memory related issue of internal memory or external memory?</li><li>What i have to do to run application and still test with emulator?</li><li>How do i install application in sd-card in Android sdk 2.2?</li></ol>","379693","","213269","","2010-12-21 15:11:45","2014-01-06 14:39:17","Installing application on SD-card in Android sdk 2.2","<android><installation><apk><sd-card>","6","11","3","",""
"3584504","1","3584685","","2010-08-27 13:15:45","2","172","<p>I have got 2 tables: <code>Contacts</code> and <code>Users</code>.</p><p><code>Contacts</code> table contains <code>user_id</code> which are referring to <code>id</code> in <code>Users</code> table. <code>Contacts</code> also contain <code>list_type</code> column.</p><p><code>Contacts: user_id, list_type</code><code>Users: id, data</code></p><p>How can I delete entries/rows from both tables (<code>Contacts</code> and <code>Users</code>) that are referring to given <code>list_type</code>?</p><p>The trick is that i don't want to delete <code>users</code> who belongs to other contacts <code>list_type</code>.</p><p>EDIT:</p><p>Example:</p><pre><code>Users (id,data)1    John2    Kate3    Alan4    BobContacts (user_id, list_type)1    13    11    24    22    2</code></pre><p>Now I would like to delete list_type = 2, the result should be:</p><pre><code>Users (id,data)1    John - still is here, because it was also referring to list_type = 1 3    AlanContacts (user_id, list_type)1    13    1</code></pre>","361832","","361832","","2010-08-27 15:52:08","2010-08-28 14:33:03","Delete entries from releted tables","<sql><android><sqlite>","3","0","","",""
"3584896","1","","","2010-08-27 14:01:36","1","1932","<p>I am trying to create authentication system which pops up the login window if the device has been off (SCREEN_OFF) for more than INTERVAL.</p><p>I have registered a BroadcastReceiver to listen to SCREEN_ON/OFF events in the onCreate() of the launchable activity:</p><pre><code>/* Listen to Screen On &amp; Off events */  IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);  filter.addAction(Intent.ACTION_SCREEN_OFF);  BroadcastReceiver screenOnOff = new ScreenOnOff();  registerReceiver(screenOnOff, filter);</code></pre><p>ScreenOnOff -- is a BroadcastReceiver which among other things does:</p><pre><code>@Override public void onReceive(Context context, Intent intent) {mAuthenticationIntent = PendingIntent.getActivity(context, 0,    new Intent(context, AuthenticationActivity.class), 0);String action = intent.getAction();if (action.equals(Intent.ACTION_SCREEN_OFF)) {   AlarmManager mAlarmManager = (AlarmManager) context     .getSystemService(context.ALARM_SERVICE);   mAlarmManager.set(AlarmManager.ELAPSED_REALTIME, System     .currentTimeMillis()     + interval, mAuthenticationIntent);   Log.d(LOG_TAG, ""Alarm Set!"");  }</code></pre><p>When the alarm goes off, the program crashes:</p><pre><code>08-27 19:18:02.207: ERROR/ActivityThread(3165): Activity com.artoo.ArtooSlateActivity has leaked IntentReceiver com.artoo.authentication.ScreenOnOff@4495bca0 that was originally registered here. Are you missing a call to unregisterReceiver()?08-27 19:18:02.207: ERROR/ActivityThread(3165): android.app.IntentReceiverLeaked: Activity com.artoo.ArtooSlateActivity has leaked IntentReceiver com.artoo.authentication.ScreenOnOff@4495bca0 that was originally registered here. Are you missing a call to unregisterReceiver()?08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ActivityThread$PackageInfo$ReceiverDispatcher.&lt;init&gt;(ActivityThread.java:939)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ActivityThread$PackageInfo.getReceiverDispatcher(ActivityThread.java:734)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:791)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ContextImpl.registerReceiver(ContextImpl.java:778)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ContextImpl.registerReceiver(ContextImpl.java:772)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:318)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at com.artoo.ArtooSlateActivity.onCreate(ArtooSlateActivity.java:50)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3815)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ActivityThread.access$2400(ActivityThread.java:125)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.os.Handler.dispatchMessage(Handler.java:99)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.os.Looper.loop(Looper.java:123)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at java.lang.reflect.Method.invokeNative(Native Method)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at java.lang.reflect.Method.invoke(Method.java:521)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-27 19:18:02.207: ERROR/ActivityThread(3165):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Any help will be most appreciated.</p><p>Thanks, Sameer</p>","356580","","","","","2010-08-27 15:00:22","Leaked Intent & AlarmManager","<android><alarmmanager>","1","0","2","",""
"3584973","1","","","2010-08-27 14:08:34","1","687","<p>I have a task to show images in grid ,i got the view what i needed but i have to place  <strong>click here to view more..</strong> at bottom.</p><p>Here i'm facing problem to place the text below image has a common,for example,each row have three images in grid and it looks:</p><pre><code>    ----------------------   | img1   img2   img3   | img4    ...   ...   |    | click here to view more..</code></pre><p>after img3, img4 in next row in the grid</p><p>How can i place text in the view has like above?</p><p>here my code for <code>imageview.xml</code>:</p><pre><code>&lt;RelativeLayout android:id=""@+id/RelativeLayout01"" android:layout_width=""100dip"" android:background=""@color/white""    android:layout_height=""80dip"" xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_gravity=""center_horizontal""&gt;    &lt;ImageView android:id=""@+id/jr_lb_list_icon"" android:layout_width=""60dip"" android:layout_height=""65dip""               android:scaleType=""fitCenter"" android:background=""@drawable/border""              android:layout_centerInParent=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>here my code for <code>imageview.xml</code>:</p><pre><code>&lt;merge android:layout_width=""wrap_content"" android:layout_height=""340dip"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;GridView                     android:id=""@+id/jr_lookbook_grid"" android:layout_width=""fill_parent""                    android:layout_height=""320dip"" android:numColumns=""4""                    android:verticalSpacing=""10dp"" android:horizontalSpacing=""10dp""                    android:columnWidth=""90dp"" android:stretchMode=""columnWidth""                    android:adjustViewBounds=""true""                    android:background=""@drawable/shape""                                android:gravity=""center""  android:layout_weight=""1""                    /&gt;                      &lt;/LinearLayout&gt;&lt;TextView android:text=""Next"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@color/gold""/&gt;&lt;/merge&gt;</code></pre><p>Please, help me to get  the text below, I tried to put layout for textview but i can't get view what i need.anybody help me get it...</p>","407506","","407506","","2010-08-27 19:17:52","2011-01-15 15:23:12","how to place a line of text below the end of grid","<android>","1","1","","",""
"3585009","1","3585405","","2010-08-27 14:13:19","9","5715","<p>I want to raise a notification showing an icon in the status bar - so far so good, but actually I would like this icon to be a 3 character String.</p><p>So my question is: Is there a way to convert my String into a <code>Drawable</code> to display it as Icon in the status bar?</p><p>EDIT: I recently found an app which does something similar - Battery Indicator</p><p>It shows the current battery level as notification icon in the status bar - I wonder if it really uses different 100 images</p><p><img src=""http://i.stack.imgur.com/NxUia.png"" alt=""Screenshot""></p>","415347","","415347","","2010-08-28 09:28:18","2013-05-07 18:32:03","Convert String to Drawable","<android>","6","2","1","",""
"3585556","1","3585701","","2010-08-27 15:11:32","0","6492","<p>How does one send a simple email message, in code, on Android?</p>","424413","","110358","","2012-04-09 00:38:42","2013-05-07 12:49:40","How to send email in Android ?","<android><email>","4","0","4","",""
"3585708","1","3585746","","2010-08-27 15:28:19","0","3625","<p>I would like to be able to alter the size of some of my ImageViews based on what Drawable they are showing. I've not yet decided on whether I'll get them to read the new dimensions from the Drawable or if I will just have an array/enum storing the heights of these, but what I need help with is the actual changing of the ImageView size.</p><p>Which of the many many functions for altering sizes of things should I be using to change the size of an ImageView while still retaining its relative positioning in the RelativeLayout it is a part of? I can't work out if I should be changing the bounds of the Drawable or if I should be redefining the LayoutParams of the ImageView or some other method altogether. The drawables are always going to be the same width, but their height will change depending on what is in each tile of a map (which this is rendering).</p>","414266","","82118","","2011-04-13 19:04:44","2011-04-13 19:04:44","Need to resize Android ImageView to match changing Drawable size","<android><imageview><drawable>","1","0","","",""
"3586076","1","","","2010-08-27 16:06:16","1","1289","<p>My android application uses jtwitter and doesn't see api.twitter.com host</p><pre><code>    Twitter twitter = new Twitter(""user"", ""pass"");    System.out.println(twitter.getStatus(""somebody""));    twitter.setStatus(""my stat"");</code></pre><p>But java desktop application works pretty good. What is the problem can be with android? I added even uses-permission INTERNET</p>","432137","","","","","2012-06-10 20:34:24","android app cannot connect to twitter","<android><twitter><internet>","1","1","","",""
"3586174","1","","","2010-08-27 16:18:24","5","1664","<p>Lately I've been doing a lot of web development on my Droid via ssh using the ConnectBot app and a few other apps for reference.  I've also been doing a lot of Android development back home in eclipse, and I wondered: would it be possible to develop and test my android projects right on my phone?  All I can do at the moment is either write the code via ssh and then open it later with eclipse to finish it up, or remotely use eclipse via LogMeIn Ignition or VNC.  Does anyone know a native way to do what I'm trying to do, preferably offline?</p>","433128","","","","","2013-11-24 21:48:17","Is it possible to develop for Android on Android?","<java><android><mobile><ssh>","6","2","3","",""
"3586217","1","3586243","","2010-08-27 16:22:25","4","3046","<p>I'm trying to create an android application which will generate random series of values (integer numbers in this case) in a given range (but <strong>NOT</strong> equal between them) and display them in a simple TextView</p><p>Let's say we have the range <strong>R = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]</strong></p><p>Each time I press the button <strong><em>""Generate""</em></strong> I want to randomly generate  5 different results </p><p><strong>Example for each ""Generate"":</strong></p><ul><li>4, 9, 2, 12, 10</li><li>5, 1, 6, 8, 13</li><li>10, 4, 6, 8, 2</li><li>etc...</li></ul><p><strong>EDIT (works now) Thanks for all the help!</strong></p><pre><code>public class random extends Activity {static final Integer[] data = new Integer[] {    1, 2, 3, 4, 5, 6, 7, 8    };@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    Random r = new Random();    Set&lt;Integer&gt; mySet = new HashSet&lt;Integer&gt;();    while (mySet.size() &lt; 5) {       int idx = r.nextInt(data.length);       mySet.add(data[idx]);    }    String text = """";    for (Integer i : mySet) {       text = text + i + "", "";     }       TextView Numbers = (TextView)findViewById(R.id.shownumbers);       Numbers.setText(text);  }}</code></pre>","383576","","321731","","2014-02-04 19:51:26","2014-02-04 19:51:26","How to select random values from a given range","<android><random><range>","6","1","2","",""
"3586226","1","3603303","","2010-08-27 16:24:16","0","1161","<p>I'm trying to figure out how to launch a Service from a singleton class I've created.</p><p>According to the Android documentation, startService is a method of Context.  So, in the method call I am making to the singleton class, I figured I would pass on the application Context as a parameter.  Easy enough.  However, when I try to use that context.startService, it says startService is not a method of Context.  So how do I actually launch a Service from my own class?</p><p>API 7</p><p>Why I'm doing this:</p><p>Despite the examples that have been provided with the Android SDK (where database calls are made directly from the UI), Virgil, in his 2010 Google I/O presentation suggested a few models for REST-heavy applications that behave differently.  The one I'm attempting to follow is as such (as I understand it):</p><p>Activity calls ""Service Helper"" (singleton), Service Helper launches Service, Service queries database for Cursor, Service also launches thread which calls web service to update database, Service notifies Service Helper that is has completed querying for Cursor, Service Helper notifies Activity that it has Cursor.</p>","406790","","","","","2010-09-10 08:48:45","Launching service from class without a Context","<android><service><context>","1","2","","",""
"3586235","1","3589352","","2010-08-27 16:25:14","3","3601","<p>I have a relative layout which looks like this:<img src=""http://i.stack.imgur.com/6MSWm.png"" alt=""alt text""></p><p>Here is the code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;       &lt;TextView        android:id=""@+id/nameText""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:padding=""5dip""        android:layout_alignParentLeft=""true""        android:text=""Symbol""        /&gt;    &lt;TextView        android:id=""@+id/priceText""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:padding=""5dip""        android:layout_toRightOf=""@+id/nameText""        android:gravity=""right""             android:text=""100""     /&gt;      &lt;TextView        android:id=""@+id/changeText""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:padding=""5dip""        android:layout_toRightOf=""@+id/priceText""        android:gravity=""right""             android:text=""1.3""        /&gt;  &lt;/RelativeLayout&gt;</code></pre><p>How can I get the company name to line up next to the number 1.3?</p>","19875","","","","","2012-08-14 20:01:06","How to create column-like layout for ListView rows?","<android><listview><layout><textview><relativelayout>","3","0","","",""
"3586237","1","","","2010-08-27 16:25:27","4","1935","<p>I would like to create a search in my app which acts like the map search in the Google Maps app.I have creates an an auto complete text view which updates dynamically based on the results of the <code>Geocoder.GetLocationByName()</code> Method.However the results retrieved from this function are really bad and not at all consistent with the text I pass to it.Is there a better method of doing this to achieve accurate results?</p>","407133","","","","","2013-12-26 13:17:16","How to implement a search like the google maps address search?","<android>","2","0","2","",""
"3586281","1","3586372","","2010-08-27 16:33:13","1","718","<p>I have an application for Android which communicates with a Google App Engine (GAE) back-end. For authentication I have a user name and password, however I don't wanna store the plain text password on the client and transfer it in plain text on an insecure channel. So I was thinking  of hashing the password when the users enters it the first time (registration or login) and store it hashed on the phone as well as on the GAE database. However, I'm not sure which cryptographic hash function to use, currently thinking about sha1(), and if I need to do something else or just a <code>sha1(plainTextPassword)</code>.</p><p>Any recommendations? </p>","184367","","","","","2010-08-27 16:45:11","Encrypt plain text password for GAE <> Android communication","<android><google-app-engine><authentication><encryption>","1","0","","",""
"3586343","1","","","2010-08-27 16:41:35","0","146","<p>I am a complete newb and know nothing.  I'm probably very inefficient at what I have already, but that's the learning curve.  I'm making an Android app, using Eclipse to do it.</p><p>The app will have 3 screens. On the first two screen is a list of buttons. The user taps on the buttons that apply to the situation and then that button disappears from that screen and appears on screen 3.  Screen 2 is the same as screen 1 but with a separate list (selection still mixes with screen 3).</p><p>I am setting up screen one, am typing out many, many strings (it's a long list) in my strings.xml.  Let's assume it's a shopping list program.  The strings are set up like:</p><pre><code>&lt;string name=""vc002""&gt;Bread&lt;/string&gt;&lt;string name=""vc003""&gt;Butter&lt;/string&gt;</code></pre><p>And so on.  Layout is like this:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/v001""    android:layout_gravity=""center""    /&gt;&lt;Button android:id=""@+id/vb01"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:layout_gravity=""center"" android:text=""@string/vc001"" /&gt;&lt;Button android:id=""@+id/vb02"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:layout_gravity=""center"" android:text=""@string/vc002"" /&gt;</code></pre><p>And this is the following Activity, screen 1:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;public class VenialListActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final Button vb01 = (Button)findViewById(R.id.vb01);        vb01.setOnClickListener(new View.OnClickListener() {         public void onClick(View v){         vb01.setVisibility(View.INVISIBLE);         };         ;           }    );    }       }</code></pre><p>And now I'm stuck.  The button disappears as expected but I don't know how to make it appear on screen 3.  Similarly, I'd like to be able to tap a button on screen 3 (in case of a mistap) and send it back home and make it visible again.</p><p>Anyone able to help me out?  I apologise if I have broken any site rules or if I give someone a headache with my newbness.  I don't exactly know what the above is actually doing, I just know that it works so I shouldn't break it.  It's like learning Latin or Greek or Dvorak typing.  It's bound to be slow going and I'm going to make more mistakes than not.  Regardless, I do thank you for your time and patience if you've made it this far.  =)</p>","433131","","","","","2010-08-27 18:15:29","Need help with a simple concept in Android","<android>","1","3","1","",""
"3586440","1","","","2010-08-27 16:53:29","0","335","<p>i have a custom CursorAdapter that populates a list view from a database. my problem is that the list view never shows the last entry i made in the database. it always shows the one before the last and for some reason when i scroll down the list, the first entry i made to the database, is always the last entry too. i don't know if its just the emulator or something else. please here is the main code for the customised CursorAdapter. thank you</p><pre><code>private void fillData() {        Cursor c = adapter.retrieveItems();         startManagingCursor(c);String[] from = new String[]{DBAdapter.NAME, DBAdapter.START_DATE, DBAdapter.START_TIME};int[] to = new int[]{R.id.viewNameId, R.id.viewDateId, R.id.viewTimeId, };  customCursorAdapter items = new customCursorAdapter(this, R.layout.view_items, c,from,         to); setListAdapter(items);                 }    public class customCursorAdapter extends SimpleCursorAdapter {        private int layout;        Context context;public customCursorAdapter(Context context, int layout, Cursor c, String[]from, int[] to) {                        super(context, layout, c, from, to);            this.layout = layout;            this.context = context;         }        @Override        public void bindView(View view, Context context, Cursor c) {            int namecol = c.getColumnIndex(DBAdapter.NAME);             String name = c.getString(namecol);            TextView viewItemName = (TextView)findViewById(R.id.viewNameId);            if(viewItemName != null){            viewItemName.setText(name);            viewItemName.setTextColor(Color.RED);            }        }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {          LayoutInflater inflater = LayoutInflater.from(context);        final View view = inflater.inflate(layout, parent, false);            return view;        }    }</code></pre>","316843","","","","","2010-08-27 16:53:29","Custom CursorAdapter problem","<android>","0","5","","",""
"3586627","1","3867577","","2010-08-27 17:19:55","0","1711","<p>I have an intent filter to intercept urls from the browser on my domain. This will give the user the the choice of using the native application or the browser. I have setup the following intent filter as so.</p><pre><code>&lt;intent-filter&gt;       &lt;action android:name=""android.intent.action.VIEW""/&gt;          &lt;category android:name=""android.intent.category.DEFAULT""/&gt;      &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;      &lt;data android:host=""myDomain"" android:pathPrefix=""/custom/"" android:scheme=""http"" /&gt; &lt;/intent-filter&gt;</code></pre><p>Now, it's not my intention to trap the user in the native application as there is much benefit from using the browser. So I would like to give the user some ability to  go back to the browser within the application. I have created a button with an onClick that simply creates an intent for View and the url that would represent it. This will present the user with the choice dialog again.</p><p>The catch to this is that a user is also allowed to select a checkbox to always use the native application. While that is well and good, sometimes absolutes are wrong. So if I am reading a blog post that mentions a specific url and a specific part of that document, intercepting the url is not what the user intended but will send them to the native application. Also then upon selecting the button with the intent, they will immediately be sucked back into the application.</p><p>How can you structure a ACTION_VIEW intent for the system browser or at least detect that the user has selected always use the native app so that you can use the ACTION_WEB_SEARCH (it has a different UI behavior with the history stack, which is why I wouldn't opt to use this action all the time).</p>","307990","","","","","2010-10-05 20:45:44","Android Intent Filters : How do you use Intent.CATEGORY_BROWSABLE correctly?","<android><android-manifest>","1","0","1","",""
"3586637","1","","","2010-08-27 17:21:17","0","1027","<p>I am developing an location aware application that needs to know the users location.The problem is that the application doesn't seem to work properly.</p><p>By properly I mean that every time I have to first open an application (like cardio trainer) in order to get a GPS signal and then run my program, otherwise the GPS icon on the notification bar is blinking like it blinks when the device tries to get GPS signal and after a while it stops and no location is returned!</p><p>this is really weird because it shouldent stop, is there an interval that android provides the gps to get signal?</p><p>on the documentation I haven't found anything about that.</p><p>my code is as follows:</p><pre><code>lm.isProviderEnabled(LocationManager.GPS_PROVIDER);lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 60000, 10, locationListenerGps);LocationListener locationListenerGps = new LocationListener() {    public void onLocationChanged(Location location) {        locationResult.gotLocation(location);        Log.e(""##################"",""MyLocation got GPS location accuracy:        ""+location.getAccuracy()+"" Altitute: ""+location.getAltitude()+"" log:        ""+location.getLongitude()+"" lat: ""+location.getLatitude());     }    public void onProviderDisabled(String provider) {}    public void onProviderEnabled(String provider) {}    public void onStatusChanged(String provider, int status, Bundle extras) {}  };</code></pre><p>That should open the gps provider and register a listener called locationListenerGps that would be called by the location manager every 1 minute or 10 meters right?</p><p>why I have to open cardioTrainer first to get a GPS signal?</p><p>thanks in advanced maxsap </p>","234898","","","","","2010-08-27 23:09:00","android location listener question","<android>","1","4","","",""
"3586750","1","3586841","","2010-08-27 17:34:35","2","3717","<p>Which parameter passing method is used in Android? Pass by reference or Pass by Value? Please provide an Android Specific example for the same. </p>","393792","","","","","2010-08-27 17:47:42","Android Parameter Passing Method","<android>","2","1","","",""
"3586763","1","3588813","","2010-08-27 17:35:47","9","23989","<p>I know that if you do something like</p><pre><code>myTextView.setText(""This is on first line \n This is on second line"");</code></pre><p>Then it will display properly like this:</p><blockquote>  <p>This is on first line<br>  This is on second line</p></blockquote><p>When I store that string in a database and then set it to the view it displays as such:</p><blockquote>  <p>This is on first line \n This is on second line</p></blockquote><p>Here is the line of code I use to extract the string from the database:</p><pre><code>factView.setText(factsCursor.getString(MyDBAdapter.FACT_COLUMN));</code></pre><p>I simply populate the database from a text file where each line is a new entry into the table so a line would look like this ""This is on first line \n This is on second line"" and it is stored as text.</p><p>Is there a reason that it isn't displaying the \n characters properly?  It must be something to do with the string being in the database.  Any suggestions?</p>","336861","","336861","","2010-08-28 21:48:31","2013-06-02 04:46:50","New Line character \n not displaying properly in textView Android","<android><sqlite><textview>","5","2","7","",""
"3586938","1","3586970","","2010-08-27 18:04:54","1","2314","<p>Is there any library out there that allows me to receive logs from the app via email?</p>","244296","","","","","2010-08-27 21:04:18","How to send logcat via email?","<android><logging><logcat>","3","0","","",""
"3586971","1","3586994","","2010-08-27 18:08:58","0","294","<p>just curious to know android Graphical components (View) have their own specific renderer  or they are using something like AWT, Swing or...?</p>","393786","","","","","2010-08-27 18:12:13","GUI Renderer in Android","<java><android>","1","0","2","",""
"3587060","1","","","2010-08-27 18:24:34","5","9333","<p>I'm trying to integrate the <code>Paypal API</code> to make my app donation based. I have two questions: </p><ol><li><p>I can see the button, I click it but it doesn't do anything! (the activity for checkoutIntent doesn't fire?)</p></li><li><p>What are your experiences with donation based android apps? I want to make about $250 a month of this thing, is that even possible?</p></li></ol><p><br/></p><pre><code>public class Donate extends Activity implements OnClickListener {     PayPal ppObj = PayPal.initWithAppID(this.getBaseContext(), ""APP-80W284485P519543T"", PayPal.ENV_SANDBOX);     @Override     public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.donate);      LinearLayout mainLayout = (LinearLayout)findViewById(R.id.LinearLayout01);      if (ppObj == null) ppObj = PayPal.initWithAppID(this.getBaseContext(), ""APP-80W284485P519543T"", PayPal.ENV_SANDBOX);      CheckoutButton payPalButton = (CheckoutButton) ppObj.getPaymentButton(PayPal.BUTTON_294x45, this, PayPal.PAYMENT_TYPE_HARD_GOODS);      payPalButton.setOnClickListener(this);      mainLayout.addView(payPalButton);     }     public void onClick(View arg0) {      PayPalPayment newPayment = new PayPalPayment();      newPayment.setAmount((float) 1.00);      newPayment.setCurrency(""USD"");      newPayment.setRecipient(""example@example.com"");      Intent checkoutIntent = new Intent(this, PayPalActivity.class);      checkoutIntent.putExtra(PayPalActivity.EXTRA_PAYMENT_INFO, newPayment);      this.startActivityForResult(checkoutIntent, 1);     }     @Override        public void onBackPressed() {      Intent menuIntent = new Intent(Donate.this, MTGTools.class);         this.startActivity(menuIntent);        }    }</code></pre>","432221","","493939","","2012-05-05 18:41:05","2014-04-16 17:20:07","Android and Paypal API integration","<android><integration><paypal-api>","1","5","3","",""
"3587138","1","","","2010-08-27 18:36:41","0","846","<p>I recently switched to Ubuntu and decided to use NetBeans for Java development instead of Eclipse which I used on Windows.</p><p>The problem is, in the Eclipse I used on Windows, I had a folder named ""drawable-hdpi"" with the standard app icon in and a few other folders like ""drawable-mdpi"" (I think).</p><p>But with NetBeans, there doesn't seem to be any folders named ""drawable"".</p><p>Is this right, or is there something wrong that I need to fix?</p><p>Thanks for reading,Alex.</p>","427234","","","","","2010-08-27 20:33:27","Android Development Missing ""drawable"" folder (NetBeans IDE)","<android><netbeans><folder><drawable>","1","0","","",""
"3587168","1","9357100","","2010-08-27 18:41:34","0","433","<p>How to force <code>BluetoothServerSocket</code> to stop waiting for an incoming connection started with <code>accept()</code>?</p><p>When I'm calling <code>stop()</code> all I get is <em>""ERROR/BluetoothSppPort(2211): invalid port state for disconnection""</em> in LogCat.</p><p>I need to stop controlling thread but it can't be destroyed while the socket is waiting for a connection.</p><p>I know about <code>accept(int timeout)</code> but it is not what I need.</p><p>Are there any solutions or workarounds?</p>","433242","","1050382","","2014-02-17 20:45:07","2014-02-17 20:45:07","How to close BluetoothServerSocket while it waiting for connection?","<android><bluetooth>","1","2","2","",""
"3587217","1","3587288","","2010-08-27 18:49:30","1","5470","<p>I would like to change the default value of DatePicker programatically, but it seems there is no DatePicker.setMonth\Year\DayOfMonth function or something similar...</p><p>Any ideas?</p>","433261","","","","","2010-08-27 18:58:37","DatePicker default value","<android><datepicker>","1","0","","",""
"3587254","1","3624713","","2010-08-27 18:53:39","29","44242","<p>I am trying to login to a site and maintain that session/cookie so that the server will recognize my login, but I am struggling to figure out a way of extracting the cookie from the response and setting into a request to maintain my login. I'm wondering if I should go about taking the header ""Set-Cookie"" or using a CookieStore. Any help is greatly appreciated. Here is my code that I have, with comments where I think the getHeader/getCookie methods would go.</p><pre><code>public class Http{DefaultHttpClient client = new DefaultHttpClient();HttpGet request;HttpEntity entity;HttpResponse response;HttpPost post;CookieStore cookieStore = new BasicCookieStore();HttpContext localContext = new BasicHttpContext();public static void setContext(){    localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);}public static void getPage(String url) throws Exception{    request = new HttpGet(url);    response = client.execute(request, localContext);    PARSER.preParse(url, response);}public static HttpResponse postPage(List&lt;NameValuePair&gt; params, String host, String action) throws Exception{    post = new HttpPost(host + action);    post.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));    response = client.execute(post, localContext);    entity = response.getEntity();    if(entity != null)    {        entity.consumeContent();    }    return response;}public void destoyHttp(){    client.getConnectionManager().shutdown();}}</code></pre><p>In hopes of others better understanding my confusion am adding code that I know DOES work and maintains a session but when I tried to move the code into my actual application it broke somewhere down the line.</p><pre><code>public class HttpClientTest extends Activity{DefaultHttpClient client = new DefaultHttpClient();HttpGet request;HttpEntity entity;List&lt;Cookie&gt; cookies;HttpResponse response;HttpPost post;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    try {        getRequest();    } catch (Exception e) {        Log.d(""My Activity"", ""Failed"");        e.printStackTrace();    }}public void getRequest() throws Exception{    final String TAG = ""MyActivity"";    request = new HttpGet(""http://gc.gamestotal.com/i.cfm?p=login&amp;se=4"");    response = client.execute(request);    String action = ""i.cfm?&amp;1028&amp;p=login&amp;se=4"";    String yourServer = ""http://gc.gamestotal.com/"";    post = new HttpPost(yourServer + action);    List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();    params.add(new BasicNameValuePair(""nic"", ""myusername""));    params.add(new BasicNameValuePair(""password"", ""mypassword""));    params.add(new BasicNameValuePair(""server"", ""4""));    post.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));    response = client.execute(post);    entity = response.getEntity();    if(entity != null){        entity.consumeContent();    }    request = new HttpGet(""http://gc.gamestotal.com/i.cfm?f=com_empire&amp;cm=3"");    response = client.execute(request);    if(entity != null)    {        entity.consumeContent();    }    }}</code></pre><p>I know for a fact it works, and you can see that in this code I consumeContent() but adding that to the top code didn't seem to make a difference so I left it out. Any Ideas?</p><p>Edit: I am still unable to get the code working in keeping a session going. I am posting the cookies from my current code, along with the cookies of the second code that is working. Perhaps someone will notice an issue, I certainly do not.</p><pre><code>08-31 06:53:50.318: VERBOSE/SFGC(496): - [version: 0][name: CFID][value: 26651316][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:53:50.329: VERBOSE/SFGC(496): - [version: 0][name: CFTOKEN][value: 96917381][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:53:50.329: VERBOSE/SFGC(496): - [version: 0][name: CFCLIENT_SFGC_106Y][value: CFTOKEN2%3D735125416524430%23COUNTRY%3D56%23DOWNLOADFLAG%3D0%23OCHAT%3D1%23PM%5FDATE%3D%7Bts+%272010%2D08%2D31+14%3A53%3A45%27%7D%23REGION%3D3%23SCREEN%3D800%23S%5FGC%5FIMAGELOC%3Di%2Fw%2F%23TIMEZONE%3D%2D600%23][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:53:50.339: VERBOSE/SFGC(496): - [version: 0][name: CFGLOBALS][value: HITCOUNT%3D2%23LASTVISIT%3D%7Bts+%272010%2D08%2D31+14%3A53%3A45%27%7D%23TIMECREATED%3D%7Bts+%272010%2D08%2D31+14%3A53%3A39%27%7D%23][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:53:51.938: VERBOSE/SFGC(496): - [version: 0][name: CFID][value: 26651316][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:53:51.938: VERBOSE/SFGC(496): - [version: 0][name: CFTOKEN][value: 96917381][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:53:51.938: VERBOSE/SFGC(496): - [version: 0][name: CFCLIENT_SFGC_106Y][value: CFTOKEN2%3D735125416524430%23COUNTRY%3D56%23DOWNLOADFLAG%3D0%23OCHAT%3D1%23PM%5FDATE%3D%7Bts+%272010%2D08%2D31+14%3A53%3A45%27%7D%23REGION%3D3%23SCREEN%3D800%23S%5FGC%5FIMAGELOC%3Di%2Fw%2F%23TIMEZONE%3D%2D600%23][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:53:51.948: VERBOSE/SFGC(496): - [version: 0][name: CFGLOBALS][value: HITCOUNT%3D3%23LASTVISIT%3D%7Bts+%272010%2D08%2D31+14%3A53%3A46%27%7D%23TIMECREATED%3D%7Bts+%272010%2D08%2D31+14%3A53%3A39%27%7D%23][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:52:41.628: DEBUG/MyActivity(469): - [version: 0][name: CFID][value: 26651274][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:52:41.638: DEBUG/MyActivity(469): - [version: 0][name: CFTOKEN][value: 58361320][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:52:41.638: DEBUG/MyActivity(469): - [version: 0][name: CFCLIENT_SFGC_106Y][value: CFTOKEN2%3D735125815099420%23COUNTRY%3D56%23DOWNLOADFLAG%3D0%23OCHAT%3D1%23PM%5FDATE%3D%7Bts+%272010%2D08%2D31+14%3A52%3A36%27%7D%23REGION%3D3%23SCREEN%3D800%23S%5FGC%5FIMAGELOC%3Di%2Fw%2F%23TIMEZONE%3D%2D600%23][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:52:41.648: DEBUG/MyActivity(469): - [version: 0][name: CFGLOBALS][value: HITCOUNT%3D2%23LASTVISIT%3D%7Bts+%272010%2D08%2D31+14%3A52%3A36%27%7D%23TIMECREATED%3D%7Bts+%272010%2D08%2D31+14%3A52%3A33%27%7D%23][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:52:44.138: DEBUG/MyActivity(469): - [version: 0][name: CFID][value: 26651274][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:52:44.138: DEBUG/MyActivity(469): - [version: 0][name: CFTOKEN][value: 58361320][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:52:44.138: DEBUG/MyActivity(469): - [version: 0][name: CFCLIENT_SFGC_106Y][value: CFTOKEN2%3D735125815099420%23COUNTRY%3D56%23DOWNLOADFLAG%3D0%23OCHAT%3D1%23PM%5FDATE%3D%7Bts+%272010%2D08%2D31+14%3A52%3A36%27%7D%23REGION%3D3%23SCREEN%3D800%23S%5FGC%5FIMAGELOC%3Di%2Fw%2F%23TIMEZONE%3D%2D600%23][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]08-31 06:52:44.138: DEBUG/MyActivity(469): - [version: 0][name: CFGLOBALS][value: HITCOUNT%3D4%23LASTVISIT%3D%7Bts+%272010%2D08%2D31+14%3A52%3A38%27%7D%23TIMECREATED%3D%7Bts+%272010%2D08%2D31+14%3A52%3A33%27%7D%23][domain: gc.gamestotal.com][path: /][expiry: Sun Sep 27 00:00:00 GMT+00:00 2037]</code></pre>","423519","","423519","","2010-08-31 07:40:49","2010-09-02 07:43:12","How do I manage cookies with HttpClient in Android and/or Java?","<java><android><cookies><httpclient>","2","0","25","",""
"3587303","1","3588070","","2010-08-27 19:00:47","1","662","<p>I wonder if someone can help me... I've been developing VB.Net for years and C++/VB before that. I've also got some PHP experience. I'm now moving to Java to write an app for my Android mobile. I'm trying to use <a href=""http://developer.motorola.com/docstools/motodevstudio/"" rel=""nofollow"">MOTODev Studio</a> (Which extends eclipse)</p><p>I've not developed in Java before so it's a bit of a learning curve anyway. I'm fairly confident I'll be able to work out the important bits but I'm in a new IDE in a new language developing for a new platform.</p><p>As I'm new to Java, I was hoping to be able to rely on auto-code generation, intellisense, etc. I'm starting to think this was either very optimistic or I'm using eclipse very poorly.</p><p>For example, I know I need to override the <code>OnClickListener()</code> event but am unsure of the exact syntax. In VS, I'd just start typing <code>Override</code> in a class and up would pop intellisense with everything I can override and the appropriate signature, however, in eclipse none of the intellisense options seem to apply when I type <code>public void</code>or <code>@Override</code>. Is this because I'm doing something wrong/is eclipse intellisense incomplete not very good?</p><p>In VS there's a bar at the top of the code page which lists objects in the file on the left and methods of the current object on the right. Does eclipse have an equivalent? If so, where?</p><p>I've managed to use the IDE to the extent that I've got a ""Hello World"" installed on my mob so it's more code generation techniques than windows/dialogues/etc.</p><p>I suppose what I really need is for someone to recommend some good resources to help me transition. I'd also appreciate any comments or advice from others that have done similar</p><p>Thanks in advance</p>","156755","","","","","2010-08-28 14:34:56","Transitioning from VS2010 to Eclipse IDE for Android/Java dev","<java><android><visual-studio><eclipse>","3","0","1","",""
"3587375","1","","","2010-08-27 19:10:40","9","8393","<p>Is there any free single-signon mechanism for Android that gracefully works with non-webapps? Say, something along the lines of...</p><ol><li><p>You launch my app and use it until it makes a request from the app server that requires authentication. It responds to that request with a random token that the server will associate with you for a short time.</p></li><li><p>The app presents you with a username field, a password field, and a submit button.</p></li><li><p>You enter your username and password. The app then forwards your username and hashed password, along with the token generated by the app server, to the login service.</p></li><li><p>The login service determines whether or not your username and password are valid. If they are, it digitally timestamps and signs the token, and returns the signed token to the app.</p></li><li><p>The app relays the signed token to the server.</p></li><li><p>The server checks the signature, satisfies itself that it's valid and signed by an authority it trusts, and proceeds as though the user had presented IT with a valid local username and password instead.</p></li></ol><p>I suspect I'm just getting lost in nomenclature, but the impression I've gotten so far is that all the usual SSO providers -- Twitter, Facebook, etc -- only allow users to log in using a normal browser, and that you're either not allowed to do what I described, or they do something to make it effectively impossible with anything besides a normal browser (like dynamically creating the login form via Javascript in an effort to prevent developers from trying to use their own apps as a login facade).</p><p>Alternatively, does there exist any workflow like THIS...</p><ol><li><p>You launch my app and use it until the web service requires you to log in. The app server generates a token and returns it to the app.</p></li><li><p>The app spawns a new browser via intent that sends you to the login provider's web site, passing the token via intent to the browser (and ultimately the provider) as a POSTed formvar.</p></li><li><p>You log in using the browser window, and the browser window closes -- returning you to my app.</p></li><li><p>The login provider signs the token, then sends it directly to my app server via HTTP POST so I can note its submission, verify the cert, and treat it as though it were instead a valid username and password submitted directly by the user to the app server himself.</p></li></ol>","388603","","","","","2011-02-28 15:57:49","Android SSO (Single sign-on) for app","<android><single-sign-on>","1","3","3","",""
"3587504","1","3587760","","2010-08-27 19:27:30","2","13049","<p>I would like to serialize an object to XML inside Android.</p><p>Any libs suggested? </p><p>PS: Already tried XStream, but it doesn't serialize enums correctly with Android. The issue is here: <a href=""http://stackoverflow.com/questions/3533894/serialization-problem-with-enums-at-android"">http://stackoverflow.com/questions/3533894/serialization-problem-with-enums-at-android</a> </p>","114919","","","","","2011-02-01 01:29:47","Android XML Object Serialization","<android><xml><serialization>","3","0","","",""
"3587644","1","3890865","","2010-08-27 19:48:20","6","7379","<p>I have this sprite rotating algorithm (its poorly named and just used for testing).  It is so close, sprites drawn with it do rotate.  Everyframe I can add +5 degrees to it and see my nice little sprite rotate around.  The problem is, the other stuff drawn to the canvas now flickers.  If I don't do the rotation the regular drawn sprites work great.  I think I am close but I just don't know what piece I am missing.  Below is my two ""Draw_Sprite"" methods, one just draws the previously resource loaded bitmap to the canvas passed in.  The other one, does some rotation the best I know how to rotate the sprite by so x many degrees..and then draw it.  If I have a nice game loop that draws several objects, one type is the rotated kind.  Then the non-rotated sprites flicker and yet the rotated sprite never does.  Though if I draw the non-rotated sprites first, all is well, but then the Z-Ordering could be messed up (sprites on top of UI elements etc)...  The method definitions:</p><pre><code>    /************************************************* * rotated sprite, ignore the whatever, its for ease of use and testing to have this argument list * @param c canvas to draw on. * @param whatever ignore  * @param rot degrees to rotate * @return */public int Draw_Sprite(Canvas c, int whatever, int rot) {       //rotating sprite    Rect src = new Rect(0, 0, width, height);    Rect dst = new Rect(x, y, x + width, y + height);    Matrix orig = c.getMatrix();            mMatrix = orig;    orig.setTranslate(0, 0);    orig.postRotate(rot, x+width/2, y+height/2);     c.setMatrix(orig);    c.drawBitmap(images[curr_frame], src, dst, null);    c.setMatrix(mMatrix); //set it back so all things afterwards are displayed correctly.    isScaled=false;    return 1;}/******************************************************** * draw a regular sprite to canvas c * @param c * @return */public int Draw_Sprite(Canvas c) {      Rect src = new Rect(0, 0, width, height);    Rect dst = new Rect(x, y, x + width, y + height);           c.drawBitmap(images[curr_frame], src, dst, null);    isScaled=false;    return 1;}</code></pre><p>And now the usage:</p><pre><code>void onDraw(Canvas c){    canvas.drawRect( bgRect, bgPaint); //draw the background    //draw all game objects      // draw the normal items    for (GameEntity graphic : _graphics) {         graphic.toScreenCoords((int)player_x, (int)player_y);        if(graphic.getType().equals(""planet"")) //draw planets            graphic.Draw_Sprite(canvas); //before the rotation call draws fine        else        {            //rotate all space ships every frame so i see them spinning                    //test rotation            mRot +=5;            if(mRot&gt;=360)                mRot=0;            graphic.Draw_Sprite(canvas, 0, mRot); //yes function name will be better in future.  this rotates spins draws fine        }                                  }       thePlayer.Draw_Sprite(canvas); //FLICKERS       drawUI(canvas);//all things here flickr}  </code></pre><p>So it does do it, things after a call to a rotational draw are drawn correctly.  But the problem is it flickrs.  Now One could say I should just do all my non rotational stuff and save that last, but the zordering would be off.... suggestions as to how to tackle this issue of zordering or the flickering?</p>","327258","","327258","","2010-08-30 14:21:32","2012-02-14 16:44:18","Sprite Rotation in Android using Canvas.DrawBitmap. I am close, what am I doing wrong?","<android><rotation><sprite>","2","0","1","",""
"3587756","1","","","2010-08-27 20:05:34","2","1127","<p>I have a Nexus One, running Android 2.2, as the client. I want to make a socket connection to an embedded Linux board (Server). I have been able to get the connection up using the SPP UUID. My question has to do with pairing, actually why does the PIN request keep popping up every time I attempt to connect a socket, when the devices are already paired? Looking at logcat in DDMS it looks like the Linux board (Bluez 2.24) is requesting a PIN. </p><p>08-27 14:58:12.567: INFO/BluetoothEventLoop.cpp(11816): agent_event_filter: Received method org.bluez.Agent:RequestPinCode</p><p>I have tried to reconfigure hcid.conf several ways, but I still get a pairing request on the Nexus One. Any ideas? I saw another post with no answers on trying to handle the pairing request programmatically. Is this the way to go?</p><p>Any help on the would be greatly appreciated! </p>","433311","","433311","","2010-08-27 20:39:22","2012-04-14 10:00:51","Android Bluetooth SPP connection to embedded Linux board - PIN request","<android><bluetooth>","0","0","1","",""
"3587761","1","3587886","","2010-08-27 20:06:52","0","5818","<p>I have a menu and would like to open a new Activity when the user clicks on the menu item:</p><pre><code>@Override    public boolean onOptionsItemSelected(MenuItem item) {        // Handle item selection        switch (item.getItemId()) {        case R.id.add_symbol:           System.out.println(""ADD SYMBOL CLICKED!"");           Intent myIntent = new Intent(this.getContext(), AddStocksActivity.class);           startActivityForResult(myIntent, 0);            return true;        default:            return super.onOptionsItemSelected(item);        }    }</code></pre><p>I'm not sure how to create my Intent properly </p><p>Compiler Error:</p><pre><code>The method getContext() is undefined for the type Main</code></pre>","19875","","19875","","2010-08-27 20:12:06","2010-08-27 20:35:33","How to switch to new Activity from menu?","<android><menu><activity><contextmenu><android-intent>","5","3","","",""
"3587772","1","","","2010-08-27 20:08:46","1","3514","<p>Disabling a radiobutton does not 'grey out' the control in the same way as disabling a checkbox.I was thinking, how difficult would it be to place a semi-transparent black bitmap over the whole radiobutton view, thereby making it appear darker?</p><p>Not really sure where to start on this one, any ideas?</p>","131209","","","","","2010-09-03 19:13:37","Android: How to 'grey out' a radiobutton","<android>","1","0","","",""
"3587847","1","3593533","","2010-08-27 20:21:36","1","903","<p>I have an Android app which needs to play a sound resource on a timed interval, say every 120 seconds.</p><p>I know how to access the sound resources and play them, however it's time timer part I'm not sure of. What's the best approach?</p>","429790","","","","","2010-08-29 04:37:13","Best way to play sound on a timed interval?","<android><audio><timer>","1","0","","",""
"3587899","1","3589048","","2010-08-27 20:30:48","0","1309","<p>I'm trying to connect to connect to my T-Mobile G1 to test a simple android app I an creating.  I cannot get it to show up in the list of connected android devices. Here are the details:</p><ul><li>32-bit Windows XP</li><li>I have enabled USB Debugging on my device</li><li>I am not prompted with the New Hardware Wizard when I plug my device in, it is merely seen as a new removable drive.  It does not appear under any other categories in Device Manager, nor is there a new ""Unknown Device"" entry anywhere to be found</li><li>I have tried ""Update Driver"" and select the driver that Google provides for their official developer devices, but it says ""this driver does not match your device"" or something to that effect.  Probably because it is expected a device type other than ""Disk Drive""</li><li>I have tried uninstalling the device under ""Disk Drives"" and plugging it in again but it always gets reinstalled automatically as a ""Disk Drive""</li><li>I have tried uninstalling the device, manually installing the Google driver from the INF file and plugging in the device and it is still only recognized as a ""Disk Drive""</li><li>Most importantly, I get a blank device list when I run ""adb devices"" from the Android SDK tools directory before and after each step I tried</li></ul><p>After hours of scouring the web I get the distinct impression that a new device category should be popping up in Device Manager if the driver is installed correctly, but I have not been able to get the device to come up as anything other than a new ""Disk Drive""</p><p>Thanks in advance</p>","29798","","29798","","2010-08-27 20:53:02","2011-04-26 18:21:25","T-Mobile G1 won't appear in 'adb devices' list","<android><debugging><usb>","3","0","","",""
"3587920","1","4583023","","2010-08-27 20:34:11","1","849","<p>I'm designing am HTML 5 WebApp -- will use the local db storage, etc. It is targeted for AppPhones (iPhone and Android), and HTML 5 browsers. (IE and old browsers will get the old version of the site.)</p><p><strong>Questions:</strong> </p><ul><li>Is there a max download size for iPhone or Android native browsers?</li><li>Any limitations with PC-based browsers?</li><li>I also plan to encourage users to download via WiFi. I'm considering telling people how long the download will take, based on downloading an initial part of the data. Thoughts on that?</li></ul><p>Of course, the JS will be minimized, the server will compress.</p><p>The download will be JSON, not presentation HTML.</p><p>According to a <a href=""http://mobilegeo.wordpress.com/2010/03/03/html5s-local-sql-database-openlayers/"" rel=""nofollow"">MobileGeo post</a>, iPhone default local db is 5MB. The article says that the data is stored at UTF-16. Maybe I should use JS to locally compress my larger ""text"" fields in the database? </p><p>A <a href=""http://www.w3.org/TR/2008/WD-html5-20080610/structured.html#disk-space"" rel=""nofollow"">2008 HTML5 spec</a> suggests 5MB as a db default max size per domain. </p><p>The current <a href=""http://www.w3.org/TR/2010/WD-IndexedDB-20100819/"" rel=""nofollow"">HTML 5 Indexed Database</a> spec makes a reference to storage quota but nothing concrete.</p>","64904","","64904","","2010-08-27 22:19:41","2011-01-03 08:29:42","Maximum web page size in general? iPhone? Android?","<iphone><android><html5>","1","4","","",""
"3587940","1","3588371","","2010-08-27 20:36:49","2","1809","<p>I first retrieve information from the SQLite database into a cursor.</p><p>The cursor contains a timestamp column in the format: <code>yyyy-MM-dd HH:mm:ss.SSS</code>, for example, <code>2010-08-27 21:25:30.575</code></p><p>Once retrieved, I set a<code>SimpleCursorAdapter</code> like so (code simplified):</p><pre><code>SimpleCursorAdapter adapter =             new SimpleCursorAdapter(this, R.layout.row_layout, cursor, new String{KEY_TITLE, KEY_TIMESTAMP}, new int[]{ R.id.title, R.id.timestamp } );    setListAdapter(adapter);</code></pre><p>The code successfully displays the time and date in the format described above, but I would like to display just the date in DD/MM/YYYY format (or perhaps the user's format based on locale if possible).</p><p><strong>How can I intervene with the SimpleCursorAdapter to change the date to my preferred format?</strong></p><p>N.B. I would be willing to change the way information is passed to the adapter if it simplifies matters. I also wouldn't mind changing the SQLite query for the cursor if SQLite has a built-in formatter.</p>","295199","","","","","2011-01-03 05:14:51","Editing cursor data before ListAdapter displays it in the ListView","<android><datetime><sqlite><android-listview>","3","0","","",""
"3587977","1","","","2010-08-27 20:42:16","0","875","<p>How can I get the alpha/opacity of a <code>View</code> after I've animated it?</p><p>My <code>fadeIn()</code> is below - <code>fadeOut()</code> is the same with the endpoints switched.</p><pre><code>public void fadeIn(View view) {    Animation animation = new AlphaAnimation(0.0f, 1.0f);    animation.setDuration(1000);    animation.setFillAfter(true);    view.startAnimation(animation);}</code></pre>","149992","","","","","2011-07-14 09:06:09","Getting alpha/opacity of a View in Android","<java><android><animation><transparency><alpha>","1","0","1","",""
"3587993","1","3588165","","2010-08-27 20:45:14","0","59","<p>When picking out contact details, is there a built in domain class they can be mapped to? Or, do you have to create your own?</p><p>For example I do the following : </p><pre><code>ContentResolver cr = getContentResolver();Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,        null, null, null, null);String s = null;if (cursor.getCount() &gt; 0){    while (cursor.moveToNext())    {        s = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));    }}</code></pre><p>With <code>s</code>, can I put that into a ""contact"" object/domain class, perhaps something like :</p><pre><code>Contact myContact = new Contact();myContact.setName(s);</code></pre>","155695","","","","","2010-08-27 21:13:08","Android; Pulling out contact info, should you map to custom domain class or is there one provided?","<android><oop><android-2.2-froyo>","1","0","","",""
"3588093","1","3648218","","2010-08-27 21:02:08","3","5030","<p>I have a GLSurfaceView where I show some animations using OpenGL.</p><p>I now want to add a button to this view. How is this accomplished?</p><p>Can it be done without involving the xml layout?</p>","333361","","","","","2010-09-05 23:13:49","Button and GLSurfaceView","<android><button><glsurfaceview>","1","0","5","",""
"3588167","1","","","2010-08-27 21:13:33","0","850","<p>I've created an own <code>accountType</code> and it works fine to insert my contacts to the <code>ContactsContract</code> and I can view all values of these contacts in the Contacts application. But when I click on ""add contact"" or ""edit contact"" I have only input-fields for the given name and for the family name but not for the rest of the fields, like phone, website and so on.</p><p>Where do I have to specify, which fields should be displayed for contacts of my <code>accountType</code>?</p>","414075","","","","","2010-08-27 21:13:33","Custom accountType ""edit contact"" and ""add contact"" shows only name","<android><contacts>","0","2","","",""
"3588275","1","","","2010-08-27 21:31:06","0","2280","<p>I'm attempting to loop through database values creating tabs.  I have setup a method called createTab which accepts a Long value and a String value.  It's working with static data, but I'm struggling to understand how to loop through SQLite database records.</p><p>Here is my failed attempt (replace [lessthan] with less than symbol):</p><pre><code>for (int i = 0; i [lessthan] mCursor.getCount(); i++){ createTab(  mCursor.getLong(mCursor.getColumnIndexOrThrow(""_id"")),  mCursor.getString(mCursor.getColumnIndexOrThrow(""category"")));}</code></pre><p>You probably don't need the LogCat to know what I did wrong in the code above, but just in case...</p><pre>08-27 21:28:18.268: ERROR/AndroidRuntime(232): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 308-27 21:28:18.268: ERROR/AndroidRuntime(232):     at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)08-27 21:28:18.268: ERROR/AndroidRuntime(232):     at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:172)08-27 21:28:18.268: ERROR/AndroidRuntime(232):     at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:99)08-27 21:28:18.268: ERROR/AndroidRuntime(232):     at com.toBuy.Main.createTabs(Main.java:51)08-27 21:28:18.268: ERROR/AndroidRuntime(232):     at com.toBuy.Main.onCreate(Main.java:38)08-27 21:28:18.268: ERROR/AndroidRuntime(232):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)08-27 21:28:18.268: ERROR/AndroidRuntime(232):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)08-27 21:28:18.268: ERROR/AndroidRuntime(232):     ... 11 more08-27 21:28:18.278: INFO/Process(54): Sending signal. PID: 232 SIG: 308-27 21:28:18.278: INFO/dalvikvm(232): threadid=7: reacting to signal 308-27 21:28:18.338: INFO/dalvikvm(232): Wrote stack trace to '/data/anr/traces.txt'08-27 21:28:18.508: INFO/ARMAssembler(54): generated scanline__00000077:03515104_00000000_00000000 [ 27 ipp] (41 ins) at [0x285a68:0x285b0c] in 713498 ns08-27 21:28:18.518: INFO/ARMAssembler(54): generated scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at [0x285b10:0x285c60] in 1897448 ns08-27 21:28:28.086: WARN/ActivityManager(54): Launch timeout has expired, giving up wake lock!08-27 21:28:28.097: WARN/ActivityManager(54): Activity idle timeout for HistoryRecord{4390bf70 com.toBuy/.Main}</pre><p>Thank you for your help.</p>","422967","","920375","","2013-04-25 09:58:31","2013-04-25 09:58:31","How can I reference cursor item in a for loop or while loop?","<android><cursor><android-cursor>","2","0","","",""
"3588282","1","","","2010-08-27 21:32:27","2","2168","<p>I've seen this question asked many times but none of the answers really made sense in what I'm doing...I have an android game (see source at <a href=""http://code.google.com/p/bestcardgameever-android/source/browse/#svn/trunk/bestcardgameever-android/Branches/Yaniv%20For%20Android"" rel=""nofollow"">google source control</a>)It's a card game, and I've used a method that redraws each hand every round - that might be wasteful but I couldnt think of a better way to do it.Here is the code for the redrawHand method:</p><pre><code>private void redrawHand(Hand hand) {  ImageView[] cardView = hand.getCardsViews();  View container = hand.getContainer();  for (int i = 0; i &lt; GameData.YANIV_NUM_CARDS; i++) {   PlayingCard card = hand.getCardByLocation(i);   if (card != null) {    // Show Card    cardView[i].setVisibility(View.VISIBLE);    int resId;    if (hand.shouldCardsBeShown()) {     resId = card.getImageResourceId();    } else {     resId = R.drawable.back;    }    cardView[i].setImageResource(resId);// TODO: Disgusting patch, need to fix asap!!!if (hand.isHumanPlayer()) { // Show isSelected // when selected, move up 15 pixels boolean isSelected = hand.isCardSelected(i); ((LinearLayout.LayoutParams) cardView[i].getLayoutParams()).bottomMargin = isSelected? 15 : 0;}   } else {cardView[i].setVisibility(View.INVISIBLE);   }  }  // Set player name hand.getHandLabelView().setText(hand.getHandLabel());  container.requestLayout(); }</code></pre><p>After installing ACRA (http://code.google.com/p/acra/wiki/ACRAHowTo) I have started getting crash reports from devices claiming saying the following:</p><blockquote>  <p>java.lang.OutOfMemoryError: bitmap size exceeds VM budget   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:363)   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:212)   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:673)   at android.content.res.Resources.loadDrawable(Resources.java:1639)   at android.content.res.Resources.getDrawable(Resources.java:535)   at android.widget.ImageView.resolveUri(ImageView.java:541)   at android.widget.ImageView.setImageResource(ImageView.java:293)   at com.geekadoo.ui.Yaniv.redrawHand(Yaniv.java:765)   at com.geekadoo.ui.Yaniv.performYaniv(Yaniv.java:539)   at com.geekadoo.ui.Yaniv.performYanivHandler(Yaniv.java:503)   at com.geekadoo.ui.Yaniv.access$1(Yaniv.java:502)   at com.geekadoo.ui.Yaniv$2.onClick(Yaniv.java:323)   at android.view.View.performClick(View.java:2196)   at android.view.View.onTouchEvent(View.java:3849)   at android.widget.TextView.onTouchEvent(TextView.java:6376)   at android.view.View.dispatchTouchEvent(View.java:3385)   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:872)   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:872)   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:872)   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:872)   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:872)   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:872)   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:872)   at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:872)   at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1764)   at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1213)   at android.app.Activity.dispatchTouchEvent(Activity.java:2066)   at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1748)   at android.view.ViewRoot.handleMessage(ViewRoot.java:1561)   at android.os.Handler.dispatchMessage(Handler.java:99)   at android.os.Looper.loop(Looper.java:123)   at android.app.ActivityThread.main(ActivityThread.java:3977)   at java.lang.reflect.Method.invokeNative(Native Method)   at java.lang.reflect.Method.invoke(Method.java:521)   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)   at dalvik.system.NativeStart.main(Native Method)</p></blockquote><p>I am not able to understand why this is happening - is there a memory leak? should I somehow release something that I'm missing?Please help, there are a lot of people that can't enjoy this free open source game because of this.Thanks!</p>","380168","","95313","","2010-08-28 01:20:11","2011-09-27 17:11:40","How to fix a ""java.lang.OutOfMemoryError: bitmap size exceeds VM budget "" error on android","<android><memory><leak><out-of-memory>","1","2","","",""
"3588487","1","3588516","","2010-08-27 22:14:50","8","13258","<p>I'm surprisingly frustrated by this, and I suspect the answer is simple.</p><p>I have compiled and signed my android app using the Export Wizard, as described <a href=""http://developer.android.com/guide/publishing/app-signing.html#cert"">here</a> in the section 'Compile and sign with Eclipse ADT'.</p><p>I would like to backup the keystore and have it handy for future app updates, but I can't figure out for the life of me where the keystore is saved. I of course can use Eclipse to go through the process, but if something happens to my computer I'll be pretty screwed.</p><p>Does anyone know where it is stored?</p>","259645","","","","","2014-02-05 07:43:42","Where does Eclipse hide the keystore?","<android><publishing><keystore>","5","0","1","",""
"3588502","1","3588548","","2010-08-27 22:18:26","4","1543","<p>My application starts with a welcome screen Activity, but that screen has an option to skip that screen altogether in future launches.  </p><p>What's the proper Android way to do this?  Initially, I just automatically detected the skipWelcome preference and switched to the 2nd activity from Welcome. But this had the effect of allowing the user to hit the back button to the welcome screen we promised never to show again.</p><p>Right now, in the Welcome activity, I read the preference and call finish() on the current activity:</p><pre><code>    SharedPreferences preferences = getPreferences(MODE_PRIVATE);    boolean skipWelcome = preferences.getBoolean(""skipWelcome"", false);    if (skipWelcome) {        this.finish();    } </code></pre><p>And then I implement onDestroy to move on to the next Activity:</p><pre><code>@Overridepublic void onDestroy() {    super.onDestroy();    startActivity(new Intent(Welcome.this, StartFoo.class));}</code></pre><p>But this makes for some weird visual transitions.  I'm starting to think that I need a base Activity that pops open Welcome only if proper, and then goes to StartFoo.</p>","357951","","","","","2010-08-28 15:03:16","Android: Different start activity depending on user preference","<android><activity><android-intent><splash-screen>","2","0","1","",""
"3588534","1","3601401","","2010-08-27 22:26:43","1","2528","<p>I'm trying to follow the setup instructions on phonegap-android's wiki <a href=""http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse"" rel=""nofollow"">page</a>, but I'm having trouble.  I've got all of the prereqs/path variables/etc set-up, but when I execute the command (in gitbash as per the instructions) for building the project, I get errors which I do not understand.</p><p>Here is the script which I run:</p><pre><code>$ ruby ./droidgap ""C:/android-sdk-windows"" pgtest com.example.android.pgtest ""C:/xfer/input"" ""C:/xfer/output""</code></pre><p>and here is the result I get:</p><p>Building the JAR...<br>'/*' is not recognized as an internal or external command,<br>operable program or batch file.<br>'Licensed' is not recognized as an internal or external command,<br>operable program or batch file.<br>'contributor' is not recognized as an internal or external command,<br>operable program or batch file.<br>'this' is not recognized as an internal or external command,<br>operable program or batch file.<br>'The' is not recognized as an internal or external command,<br>operable program or batch file.<br>you was unexpected at this time.<br>Creating Android project for target level 8<br>Adding www folder to project...<br>Generating manifest...<br>Copying over libraries and assets and creating phonegap.js...<br>c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1418:in <code>stat': No such file or directory<br> - c:/Users/&lt;user&gt;/Desktop/phonegap/framework/phonegap.jar (Errno::ENO<br>ENT)<br>        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1418:in</code>block in fu_each_sr<br>c_dest'<br>        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1432:in <code>fu_each_src_dest0'<br>        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1416:in</code>fu_each_src_dest'<br>        from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:391:in <code>cp'<br>        from ./droidgap:82:in</code>copy_libs'<br>        from ./droidgap:20:in <code>run'<br>        from ./droidgap:157:in</code>'  </p><p>I've looked through the <a href=""http://groups.google.com/group/phonegap"" rel=""nofollow"">phonegap forums</a>, and I've found some hits on part of the error (the part where phonegap.jar could not be found), but nothing on the first part (""_ is not recognized"", etc.).  What am I doing wrong?  Thanks.</p><p>Additional info:<br>-Windows 7 (32 bit)<br>-ruby 1.9.1<br>-java jdk1.6.0_21<br>-ant 1.8.1  </p>","24952","","","","","2011-03-11 03:50:38","phonegap android sample project not building","<android><ruby><phonegap>","2","3","1","",""
"3588585","1","3591323","","2010-08-27 22:37:33","0","253","<p>I have setup 2 test contacts in my emulator.</p><p>I'm running the following query, it should pick them both out, populate my domain object, and add to a list. The output at the bottom should therefore be 2, but it is 5, why is this? (cursor.getCount() is 5 instead of 2)</p><p>I have stepped through each iteration of the while loop and it is retreving the same contact multiple times, but with different values for <code>POSTCODE</code>, such as the phone number</p><pre><code>ContentResolver cr = getContentResolver();        Cursor cursor = cr.query(ContactsContract.Data.CONTENT_URI,                null, null, null, null);        List&lt;MeCercanaContact&gt; contacts = new ArrayList&lt;MeCercanaContact&gt;();        if (cursor.getCount() &gt; 0)        {            while (cursor.moveToNext())            {                MyContact myContact = new MyContact();                String givenName = cursor.getString(cursor.getColumnIndex(                        ContactsContract.Contacts.DISPLAY_NAME));                String postcode = cursor.getString(cursor.getColumnIndex(                        ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE));                myContact.setFirstName(givenName);                myContact.setLastName(postcode);                contacts.add(myContact);            }        }        System.out.println(contacts.size());</code></pre>","155695","","","","","2010-08-28 15:33:32","Android; I only have 2 contacts, yet I can obtain 5 from a query, why?","<android><cursor><contacts><android-2.2-froyo>","1","0","","",""
"3588682","1","3588750","","2010-08-27 23:04:46","4","3652","<p>I have some code in the onCreate method an Activity and noticed that it is being called three times. Is it normal behaviour? Thanks.</p>","425749","","","","","2014-03-06 12:07:41","Is it normal for the ""onCreate"" method to be called multiple times","<android><oncreate>","4","1","2","",""
"3588702","1","3588927","","2010-08-27 23:13:01","0","962","<p>I have a ListView and would like to remove a row item when the user long clicks on selects Remove from the context menu.</p><pre><code>@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 Symbol"");      }      @Override      public boolean onContextItemSelected(MenuItem item) {          if(item.getTitle()==""Remove Symbol""){            Toast.makeText(this, ""Remove clicked!"", Toast.LENGTH_SHORT).show();        }          else {            return false;        }          return true;      }  </code></pre><p>How can I get a reference to the row number that was clicked, so I can remove that index from my array?</p>","19875","","","","","2010-08-28 00:31:20","How to remove an array item from a context menu?","<android><listview><contextmenu><listadapter>","1","0","","",""
"3588704","1","3588717","","2010-08-27 23:13:48","1","290","<p>Why aren't menus inflated automatically for you in Android, the way an Activity's layout is?</p>","253661","","","","","2010-08-28 00:50:50","why aren't menus pre-inflated for you?","<android><menu><inflate>","2","0","","",""
"3588766","1","8722339","","2010-08-27 23:30:44","2","863","<p>There are posts all over the internet about how to hide the address bar in a WebView, but by default the WebView activity does hide the address bar. I'm interested in actually <em>showing</em> the address bar on a WebView inside my own Activity. However, I don't want to pop out to the default browser, because I am using my own <code>WebViewClient</code> which utilizes <code>onPageStarted</code> to detect when a success URL is reached and <code>finish()</code> back to the parent activity.</p><p>I want the address bar to show the user that they are actually at the URL they think they are so that they don't accuse me of phishing. <strong>Is there a way to have a <code>WebView</code> show its address bar with its current URL?</strong></p>","47493","","47493","","2010-08-28 00:14:34","2012-01-04 05:17:08","Show the location or address bar in Android WebView?","<android>","1","0","","",""
"3588893","1","3588982","","2010-08-28 00:18:32","2","6333","<p>I have list of items in my activity which I load dynamically, item after item. Initially I load ""lightweight"" version and when processing is done I want to update the item with new information. Like set some text or replace an image.That means I need to update what <code>ListView</code> item is displaying after <code>Adapter#getView</code> already returns. Of course I don't know if user is actively scrolling and this item is still visible or has been scrolled out ot view. The only thing I can think of is to extend View so it performs some operations on it's own thread and updates itself when done,but will it work?Thanks for your suggestions</p>","135946","","135946","","2011-10-08 04:09:06","2012-01-27 18:53:59","Android - how to update ListView item that is currently displayed","<android><listview><item>","2","0","1","",""
"3588932","1","3589069","","2010-08-28 00:32:50","2","5782","<p>Anytime I try to serialize a file I get the error: FileNotFound. Not sure why. Here is my FileHelper code:</p><pre><code>package org.stocktwits.helper;import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.ObjectInputStream;import java.io.ObjectOutput;import java.io.ObjectOutputStream;import java.util.ArrayList;import org.stocktwits.model.Quote;public class FileHelper {    // Returns the contents of the file in a byte array.    public static byte[] getBytesFromFile(File file) throws IOException {        InputStream is = new FileInputStream(file);        // Get the size of the file        long length = file.length();        // You cannot create an array using a long type.        // It needs to be an int type.        // Before converting to an int type, check        // to ensure that file is not larger than Integer.MAX_VALUE.        if (length &gt; Integer.MAX_VALUE) {            // File is too large        }        // Create the byte array to hold the data        byte[] bytes = new byte[(int)length];        // Read in the bytes        int offset = 0;        int numRead = 0;        while (offset &lt; bytes.length               &amp;&amp; (numRead=is.read(bytes, offset, bytes.length-offset)) &gt;= 0) {            offset += numRead;        }        // Ensure all the bytes have been read in        if (offset &lt; bytes.length) {            throw new IOException(""Could not completely read file ""+file.getName());        }        // Close the input stream and return bytes        is.close();        return bytes;    }    public static void serializeQuotes(ArrayList&lt;Quote&gt; quotes){        try {            // Serialize to a file            ObjectOutput out = new ObjectOutputStream(new FileOutputStream(""quotes.ser""));            out.writeObject(quotes);            out.close();            // Serialize to a byte array            ByteArrayOutputStream bos = new ByteArrayOutputStream() ;            out = new ObjectOutputStream(bos) ;            out.writeObject(quotes);            out.close();            // Get the bytes of the serialized object            //byte[] buf = bos.toByteArray();        } catch (IOException e) {            System.out.println(e);        }    }    @SuppressWarnings(""unchecked"")    public static void deserializeQuotes(ArrayList&lt;Quote&gt; quotes){        try {            // Deserialize from a file            File file = new File(""quotes.ser"");            ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));            // Deserialize the object            quotes = (ArrayList&lt;Quote&gt;) in.readObject();            in.close();            // Get some byte array data            byte[] bytes = FileHelper.getBytesFromFile(file);            // see Reading a File into a Byte Array for the implementation of this method            // Deserialize from a byte array            in = new ObjectInputStream(new ByteArrayInputStream(bytes));            quotes = (ArrayList&lt;Quote&gt;) in.readObject();            in.close();        } catch (ClassNotFoundException e) {            System.out.println(e);        } catch (IOException e) {            System.out.println(e);        }    }   }</code></pre>","19875","","","","","2010-08-28 01:22:08","Problem serializing and deserializing ArrayList","<java><android><serialization><arraylist>","1","6","2","",""
"3588997","1","3589015","","2010-08-28 00:52:33","1","2113","<p>I am having a couple problems with the code from the tutorial: <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">ListView Tutorial</a>. The code snipets giving me problems are: </p><pre><code>static final String[] COUNTRIES = new String[] {</code></pre><p>and</p><pre><code>Toast.makeText(getApplicationContext(), ((View) view).getText(),</code></pre><p>The errors read the following respectively:</p><ul><li>Illegal modifier for parameter COUNTRIES; only final is permitted</li><li>The method getText() is undefined for the type View</li></ul><p>I'm not really sure what to do to resolve them. I am very new to Java and Android programming so please explain it in detail. I would put the entire project in here but I am not quite sure how to package it and put it on here. (Like I said, I'm a Newbie). Thanks in advance.</p><pre><code>package com.android.hellolistview;import android.app.ListActivity;import android.os.Bundle;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;public class HelloListView extends ListActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);      setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, COUNTRIES));      ListView lv = getListView();      lv.setTextFilterEnabled(true);      lv.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, TextView view,            int position, long id) {          // When clicked, show a toast with the TextView text          Toast.makeText(getApplicationContext(), ((TextView) view).getText(),              Toast.LENGTH_SHORT).show();        }      });    }private void setListAdapter(ArrayAdapter&lt;String&gt; arrayAdapter) {    // TODO Auto-generated method stub}  static final String[] COUNTRIES = new String[] {        ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",        ""Angola"", ""Anguilla"", ""Antarctica"", ""Antigua and Barbuda"", ""Argentina"",        ""Armenia"", ""Aruba"", ""Australia"", ""Austria"", ""Azerbaijan"",        ""Bahrain"", ""Bangladesh"", ""Barbados"", ""Belarus"", ""Belgium"",        ""Belize"", ""Benin"", ""Bermuda"", ""Bhutan"", ""Bolivia"",        ""Bosnia and Herzegovina"", ""Botswana"", ""Bouvet Island"", ""Brazil"", ""British Indian Ocean Territory"",        ""British Virgin Islands"", ""Brunei"", ""Bulgaria"", ""Burkina Faso"", ""Burundi"",        ""Cote d'Ivoire"", ""Cambodia"", ""Cameroon"", ""Canada"", ""Cape Verde"",        ""Cayman Islands"", ""Central African Republic"", ""Chad"", ""Chile"", ""China"",        ""Christmas Island"", ""Cocos (Keeling) Islands"", ""Colombia"", ""Comoros"", ""Congo"",        ""Cook Islands"", ""Costa Rica"", ""Croatia"", ""Cuba"", ""Cyprus"", ""Czech Republic"",        ""Democratic Republic of the Congo"", ""Denmark"", ""Djibouti"", ""Dominica"", ""Dominican Republic"",        ""East Timor"", ""Ecuador"", ""Egypt"", ""El Salvador"", ""Equatorial Guinea"", ""Eritrea"",        ""Estonia"", ""Ethiopia"", ""Faeroe Islands"", ""Falkland Islands"", ""Fiji"", ""Finland"",        ""Former Yugoslav Republic of Macedonia"", ""France"", ""French Guiana"", ""French Polynesia"",        ""French Southern Territories"", ""Gabon"", ""Georgia"", ""Germany"", ""Ghana"", ""Gibraltar"",        ""Greece"", ""Greenland"", ""Grenada"", ""Guadeloupe"", ""Guam"", ""Guatemala"", ""Guinea"", ""Guinea-Bissau"",        ""Guyana"", ""Haiti"", ""Heard Island and McDonald Islands"", ""Honduras"", ""Hong Kong"", ""Hungary"",        ""Iceland"", ""India"", ""Indonesia"", ""Iran"", ""Iraq"", ""Ireland"", ""Israel"", ""Italy"", ""Jamaica"",        ""Japan"", ""Jordan"", ""Kazakhstan"", ""Kenya"", ""Kiribati"", ""Kuwait"", ""Kyrgyzstan"", ""Laos"",        ""Latvia"", ""Lebanon"", ""Lesotho"", ""Liberia"", ""Libya"", ""Liechtenstein"", ""Lithuania"", ""Luxembourg"",        ""Macau"", ""Madagascar"", ""Malawi"", ""Malaysia"", ""Maldives"", ""Mali"", ""Malta"", ""Marshall Islands"",        ""Martinique"", ""Mauritania"", ""Mauritius"", ""Mayotte"", ""Mexico"", ""Micronesia"", ""Moldova"",        ""Monaco"", ""Mongolia"", ""Montserrat"", ""Morocco"", ""Mozambique"", ""Myanmar"", ""Namibia"",        ""Nauru"", ""Nepal"", ""Netherlands"", ""Netherlands Antilles"", ""New Caledonia"", ""New Zealand"",        ""Nicaragua"", ""Niger"", ""Nigeria"", ""Niue"", ""Norfolk Island"", ""North Korea"", ""Northern Marianas"",        ""Norway"", ""Oman"", ""Pakistan"", ""Palau"", ""Panama"", ""Papua New Guinea"", ""Paraguay"", ""Peru"",        ""Philippines"", ""Pitcairn Islands"", ""Poland"", ""Portugal"", ""Puerto Rico"", ""Qatar"",        ""Reunion"", ""Romania"", ""Russia"", ""Rwanda"", ""Sqo Tome and Principe"", ""Saint Helena"",        ""Saint Kitts and Nevis"", ""Saint Lucia"", ""Saint Pierre and Miquelon"",        ""Saint Vincent and the Grenadines"", ""Samoa"", ""San Marino"", ""Saudi Arabia"", ""Senegal"",        ""Seychelles"", ""Sierra Leone"", ""Singapore"", ""Slovakia"", ""Slovenia"", ""Solomon Islands"",        ""Somalia"", ""South Africa"", ""South Georgia and the South Sandwich Islands"", ""South Korea"",        ""Spain"", ""Sri Lanka"", ""Sudan"", ""Suriname"", ""Svalbard and Jan Mayen"", ""Swaziland"", ""Sweden"",        ""Switzerland"", ""Syria"", ""Taiwan"", ""Tajikistan"", ""Tanzania"", ""Thailand"", ""The Bahamas"",        ""The Gambia"", ""Togo"", ""Tokelau"", ""Tonga"", ""Trinidad and Tobago"", ""Tunisia"", ""Turkey"",        ""Turkmenistan"", ""Turks and Caicos Islands"", ""Tuvalu"", ""Virgin Islands"", ""Uganda"",        ""Ukraine"", ""United Arab Emirates"", ""United Kingdom"",        ""United States"", ""United States Minor Outlying Islands"", ""Uruguay"", ""Uzbekistan"",        ""Vanuatu"", ""Vatican City"", ""Venezuela"", ""Vietnam"", ""Wallis and Futuna"", ""Western Sahara"",        ""Yemen"", ""Yugoslavia"", ""Zambia"", ""Zimbabwe""      };}</code></pre>","413926","","1228","","2013-08-14 15:53:58","2013-08-14 15:53:58","Hello ListView Tutorial Problem","<android>","5","1","","",""
"3589017","1","3589042","","2010-08-28 00:59:59","1","342","<p>I use this code for connection to my service, but when I put this line  </p><pre><code>this.bindService(service, conn, flags);</code></pre><p>I receive error message: <code>syntax error on token ""}"", { expected after this token ... (1)</code></p><p>here is all code in my class:</p><pre><code>package com.flaxa.fixx;import android.app.Activity;import android.content.ComponentName;import android.content.Intent;import android.content.ServiceConnection;import android.os.Bundle;import android.os.IBinder;import android.view.View;public class MainActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void butonRunOnlyClickHandler(View target) {        Intent activity = new Intent(this, com.flax.trainer.RunOnly.class);        startActivity(activity);                    }    public void butonChallengeClickHandler(View target) {    }    public void butonProgramClickHandler(View target) {    }    public void butonCalculatorClickHandler(View target) {    }    ServiceConnection conn = new ServiceConnection() {        @Override        public void onServiceDisconnected(ComponentName name) {            // TODO Auto-generated method stub        }        @Override        public void onServiceConnected(ComponentName name, IBinder service) {            // TODO Auto-generated method stub        }        this.bindService(new Intent("""") , conn, Context.BIND_AUTO_CREATE);    }; }</code></pre><p>Can some one help my with bindService function, where I'm wrong??</p><p>Thanks</p>","432848","","65977","","2010-08-28 01:56:29","2010-08-28 01:56:29","Syntax error in Android service","<java><android><syntax>","2","0","","",""
"3589053","1","","","2010-08-28 01:17:04","0","1688","<p>I have a dynamic tablelayout that I build programmatically.  Every so often one of the rows has a child SeekBar.</p><p>Any suggestions for how I can programmatically make these SeekBars span across all the table columns?</p><p>Thanks.</p>","366189","","","","","2011-05-10 23:43:43","How can I programmatically span columns in a tablelayout?","<android><span><tablelayout><seekbar>","1","0","","",""
"3589149","1","3590262","","2010-08-28 02:05:24","1","1739","<p>Is it possible to have broadcastReceiver running inside a thread (just broadcastReceiver)? As far as I know, this can't be done unless there is a way to keep the thread alive (even tough there is no work). Please correct me if I'm wrong.</p><p>This is what I want to do: I have a client and a server program that run without knowing when anyone of them will be ready. The client will keep trying to send a request to the server while at the same time monitoring a reply from the server. Upon receiving a reply from the server, that means the server is online. </p><p>I have tried to use thread (on the client) to keep sending a request to the server with a periodical sleep. And then have the client main thread  to do a while loop with a periodical sleep (hoping to catch a reply when there is a broadcast from the server). Unfortunately, this does not work. </p><p>The client extra thread has been verified to send a request, the server has send a reply, but for some reason the client main thread does not receive anything. Implementation of the broadcastreceiver on both server and client have been verified to work, so that's not the issue.</p><p>Anyone has a better solution/approach for this problem? </p>","423594","","","","","2012-01-25 11:02:44","Android - BroadcastReceiver inside a thread","<java><android>","2","2","","",""
"3589153","1","3595095","","2010-08-28 02:09:39","0","259","<p>In my onItemClick method I have:</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {    Uri formula = ContentUris.withAppendedId(Formulas.CONTENT_URI, id);    Cursor formulaCursor = managedQuery(formula, PROJECTION, null, null, null);    formulaCursor.moveToFirst();    searchBar.setText(formulaCursor.getString(formulaCursor.getColumnIndex(Formulas.TITLE)));    startActivity(new Intent(Intent.ACTION_VIEW, formula));}</code></pre><p>Now the problem is that everytime it is called, the managedQuery <b>ALWAYS</b> returns the same result. I selected all the items in my database and the text for the <code>AutoCompleteTextView</code> is <b>ALWAYS</b> the same. I debugged it and found out that <code>Uri formula</code> is exactly what I want to it be, with an id of 3. But <code>Cursor formulaCursor</code> is not. So the problem is the managedQuery. But I see nothing wrong with it?</p>","200477","","","","","2010-08-29 14:20:36","managedQuery always returns the same result","<java><android><cursor><android-contentprovider>","1","2","","",""
"3589218","1","","","2010-08-28 02:37:45","6","2758","<p>I am having problem with a GridView within a RelativeLayout, which is again within a ScrollView. The problem is that the height of the RelativeLayout is not following the height of the contents of the GridView. When there are more than one rows, the GridView is clipped and a scrollbar appears, which is undesirable. I have tried to illustrate my problem using an screenshot from the Android hierarchy viewer. You can see how the red RelativeLayout box has clipped the second row of the GridView. I am pasting the XML layout of the page (page.xml) and the individual grid item (griditem.xml). I have used the following code to inflate the grid items in the gridAdapter code:</p><p>/<strong><em>*</em>***</strong><em>Start of gridAdapter snippet</em><strong><em>*</em>**<em>*</em>**<em>*</em>****</strong>/</p><pre><code>public View getView(int position, View convertView, ViewGroup parent){     View v;        if(convertView==null){            li = LayoutInflater.from(mContext);            v = li.inflate(R.layout.griditem, null);            //code for fetching textView and imageUrl content               TextView tv = (TextView)v.findViewById(R.id.icon_text);            tv.setText(textContent);            ImageView iv = (ImageView)v.findViewById(R.id.icon_image);            //code for fetching and attaching image to imageView        }        else        {            v = convertView;        }        return v;}</code></pre><p>/<strong><em>*</em>***</strong><em>End of gridAdapter snippet</em><strong><em>*</em>**<em>*</em>**<em>*</em>****</strong>/</p><p>/<strong><em>*</em>***</strong><em>Start page.xml</em><strong><em>*</em>**<em>*</em>**<em>*</em>****</strong>/</p><pre><code>&lt;TextView android:id=""@+id/title"" android:layout_weight=""1""        android:layout_width=""320dip""        android:layout_height=""wrap_content""         android:singleLine=""false""        android:textStyle=""bold""         android:textSize=""14dip""         /&gt;&lt;ImageView android:id=""@+id/image""        android:layout_below=""@+id/title""        android:adjustViewBounds=""true""        android:layout_width=""128dip""        android:layout_height=""96dip""         android:layout_marginRight=""4dip""        /&gt;&lt;TextView android:id=""@+id/name""         android:layout_weight=""1""        android:layout_below=""@+id/title""        android:layout_toRightOf=""@+id/image""        android:layout_width=""192dip""        android:layout_height=""wrap_content""        android:paddingTop=""2dip""        android:textSize=""12dip""         android:paddingLeft=""2dip""        /&gt;&lt;TextView android:id=""@+id/location""         android:layout_weight=""1""        android:layout_below=""@+id/name""        android:layout_toRightOf=""@+id/image""        android:layout_width=""192dip""        android:layout_height=""wrap_content""        android:paddingTop=""2dip""        android:textSize=""12dip""         android:paddingLeft=""2dip""        /&gt;&lt;TextView android:id=""@+id/date1""         android:layout_weight=""1""        android:layout_below=""@+id/location""        android:layout_toRightOf=""@+id/image""        android:layout_width=""192dip""        android:layout_height=""wrap_content""        android:paddingTop=""2dip""        android:textSize=""10dip""         android:paddingLeft=""2dip""        /&gt;          &lt;TextView android:id=""@+id/date2""         android:layout_weight=""1""        android:layout_below=""@+id/date1""        android:layout_toRightOf=""@+id/image""        android:layout_width=""192dip""        android:layout_height=""wrap_content""        android:paddingTop=""2dip""        android:textSize=""10dip""         android:paddingLeft=""2dip""        /&gt;&lt;Button android:id=""@+id/button1""        android:text=""buttonText1""        android:layout_weight=""1""        android:layout_below=""@+id/image""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_marginLeft=""96dip""               /&gt;&lt;Button android:id=""@+id/button2""        android:text=""buttonText2""        android:layout_weight=""1""        android:layout_below=""@+id/image""        android:layout_toRightOf=""@+id/button1""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        /&gt;&lt;Button android:id=""@+id/button3""        android:text=""Text""        android:layout_weight=""1""        android:layout_below=""@+id/image""        android:layout_toRightOf=""@+id/button2""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        /&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@+id/gridview""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:layout_below=""@+id/button1""        android:layout_weight=""1""        android:numColumns=""auto_fit""        android:verticalSpacing=""10dip""        android:horizontalSpacing=""10dip""        android:stretchMode=""columnWidth""        android:gravity=""center""        /&gt;</code></pre><p>/<strong><em>*</em>***</strong><em>End page.xml</em><strong><em>*</em>**<em>*</em>**<em>*</em>****</strong>/</p><p>/<strong><em>*</em>***</strong><em>Start griditem.xml</em><strong><em>*</em>**<em>*</em>**<em>*</em>****</strong>/<p>android:gravity=""center_horizontal""></p><p>/<strong><em>*</em>***</strong><em>End griditem.xml</em><strong><em>*</em>**<em>*</em>**<em>*</em>****</strong>/</p><p>Can you tell me what I should do to have the height of the RelativeLayout follow the full length of the gridView?</p><p>Thanks,Kuntal![alt text][1]</p><p>Here is the screenshot:<a href=""http://tinypic.com/r/98rs4n/4"">http://tinypic.com/r/98rs4n/4</a></p>","433494","","433494","","2010-08-28 02:47:20","2012-01-07 06:48:21","Android RelativeLayout height not following GridView height","<android>","4","1","","",""
"3589285","1","3589635","","2010-08-28 03:01:00","5","10013","<p>My ultimate goal is to limit records that are able to be created so that I can have a trial version of my application. I'm thinking I can do this rather simply by returning an int variable within a sqlite count statement, and using a simple IF statement to determine if a new record should be created.</p><p>I call like so:</p><pre>int jcount = 0;            mDbHelper.countjournals(jcount);</pre><p>Right now i'm trying to execute this </p><pre> public int countjournals(int jcount){             mDb.execSQL(jcount + "" = SELECT COUNT(*) FROM ""+DATABASE_JOURNAL_TABLE);            return jcount;        }</pre><p>error that i recieve:</p><pre>08-27 22:42:32.417: ERROR/AndroidRuntime(3976): android.database.sqlite.SQLiteException: near ""0"": syntax error: 0 = SELECT COUNT(*) FROM journals</pre>","393328","","","","","2014-02-13 05:54:32","Return the count of records in a variable, Sqlite, Android, Java","<java><android><sqlite>","5","2","1","",""
"3589310","1","","","2010-08-28 03:12:02","9","1732","<p>I am having an issue where occasionally the MediaPlayer.create method will return null, even though the audio file is definitely there. In fact, if I put the call to create into a while loop, the media player will eventually be created successfully. This only seems to happen on my phone (HTC Hero running 2.1) and never in the emulator. </p><p>Is this just an issue with the phone? Or is there a different way I should be playing these audio files?</p><p>Note that I want to be loading them dynamically which is get I am making the call to getIndentifer. If there is a better way of playing these dynamically please let me know.</p><pre><code>public void playAudio(String audioFile){    //instance variable of type MediaPlayer    _player = null;    while(_player == null){         _player = MediaPlayer.create(_context, getResources().getIdentifier(audioFile, ""raw"", _context.getPackageName()));    }    _player.start();}</code></pre><p><br/></p><p>Thanks.</p>","351414","","351414","","2010-08-28 17:12:22","2010-10-13 03:58:43","Android SDK Mediaplayer.create randomly returns null","<android><media>","1","1","","",""
"3589395","1","3589407","","2010-08-28 03:52:10","1","656","<p>Could someone maybe tell me what i'm doing wrong? I'm betting im missing one small thing. I've looked on the developer site and i've read some tutorials and i'm just not seeing what i did wrong.</p><p>I'm trying to use a ListPreference to decide which sound to play on a button click.</p><p>I have this at the top:</p><pre><code>public String greensound;</code></pre><p>Here's my OnClick code:</p><pre><code>case R.id.green:     SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);     greensound  = prefs.getString(""greensound"", ""gsone"");       if (greensound == ""gsone"") {        mSoundManager.playSound(1);        } else if (greensound == ""gstwo"") {        mSoundManager.playSound(2);        } else if (greensound == ""gsthree"") {        mSoundManager.playSound(3);       } break;</code></pre><p>Here's my xml:</p><pre><code>&lt;ListPreference android:title=""Geen Button"" android:key=""greensound""android:summary=""Select sound for the Green Button"" android:entries=""@array/green_list"" android:entryValues=""@array/green_list_values""android:defaultValue=""gsone""&gt;&lt;/ListPreference&gt;//I also tried removing the default value here it didnt seem to change anything but, should it be removed?</code></pre><p>here's my Settings.java:</p><pre><code>package com.my.app;import android.os.Bundle;import android.preference.PreferenceActivity;public class Settings extends PreferenceActivity {    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.settings);    }}</code></pre><p>and here's my array's if that will help at all:</p><pre><code>//This is the one I want to display to the user    &lt;string-array name=""green_list""&gt;       &lt;item&gt;Sound One&lt;/item&gt;      &lt;item&gt;Sound Two&lt;/item&gt;      &lt;item&gt;Sound Three&lt;/item&gt;      &lt;item&gt;Sound Four&lt;/item&gt;      &lt;item&gt;Sound Five&lt;/item&gt;    &lt;/string-array&gt;    &lt;string-array name=""green_list_values""&gt;       &lt;item&gt;gsone&lt;/item&gt;      &lt;item&gt;gstwo&lt;/item&gt;      &lt;item&gt;gsthree&lt;/item&gt;      &lt;item&gt;gsfour&lt;/item&gt;      &lt;item&gt;gsfive&lt;/item&gt;    &lt;/string-array&gt;</code></pre><p>Here's a logcat that kinda looked possibly related:</p><pre><code>08-27 01:52:07.738: WARN/Resources(6846): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090000}08-27 01:52:07.748: WARN/Resources(6846): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090000}08-27 01:52:07.758: WARN/Resources(6846): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f090000}</code></pre><p>For those that might ask here's my DDMS > File Explorer > Data > Data > packageName > SharedPreferences This is what was in there:</p><p>com.my.app_preferences.xml:</p><pre><code>&lt;?xml version='1.0' encoding='utf-8' standalone='yes' ?&gt;&lt;map&gt;&lt;string name=""redsound""&gt;rsone&lt;/string&gt;&lt;string name=""greensound""&gt;gsone&lt;/string&gt;&lt;/map&gt;</code></pre><p>_has_set_default_values.xml:</p><pre><code>&lt;?xml version='1.0' encoding='utf-8' standalone='yes' ?&gt;&lt;map&gt;&lt;boolean name=""_has_set_default_values"" value=""true"" /&gt;&lt;/map&gt;</code></pre><p>This all really confuses me more because...It looks like greensound does == gsone so.... I don't understand whats wrong its not even playing the default sound. and yes i've tested all this code without the listpreference code and they work great. I'm not sure what's wrong</p><pre><code>mSoundManager.playSound(1); mSoundManager.playSound(2); mSoundManager.playSound(3);</code></pre>","393373","","393373","","2010-08-28 19:14:15","2010-08-28 19:14:15","Very simple ListPreference to play sound is not working. Any ideas? (tons of details)","<java><android><arrays><audio><listpreference>","1","0","1","",""
"3589503","1","3589509","","2010-08-28 04:47:25","1","5042","<p>My Activity needs to monitor the orientation of the device.  Now this works great with <code>onConfigurationChanged()</code>, but I also need to know orientation when my Activity starts.</p><p>So how do find out the current orientation of the device in my <code>onCreate()</code>, for instance?</p>","62076","","","","","2010-08-28 05:03:11","Android: Getting orienation (landscape/portrait) on Activity launch","<android>","1","0","3","",""
"3589565","1","","","2010-08-28 05:13:10","0","2153","<p>Okay well I'm trying to make a Live Wallapper but whenever I click on settings it force closes. Saying the activity is not found which doesn't make any sense because, I have it in the Manifest. This is really starting to bug me as I've been at it for over 2 hours.</p><p>Logcat:<code>08-28 01:06:49.903: INFO/ActivityManager(1089): Starting activity: Intent { cmp=quotesandothers.livewallpaper.quotesandothers/quotesandothers.livewallpaper.quotesandothers (has extras) }08-28 01:06:49.934: ERROR/AndroidRuntime(15221): FATAL EXCEPTION: main08-28 01:06:49.934: ERROR/AndroidRuntime(15221): java.lang.IllegalStateException: Could not execute method of the activity08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.view.View$1.onClick(View.java:2072)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.view.View.performClick(View.java:2408)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.view.View$PerformClick.run(View.java:8816)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.os.Handler.handleCallback(Handler.java:587)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.os.Handler.dispatchMessage(Handler.java:92)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.os.Looper.loop(Looper.java:123)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at java.lang.reflect.Method.invokeNative(Native Method)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at java.lang.reflect.Method.invoke(Method.java:521)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at dalvik.system.NativeStart.main(Native Method)08-28 01:06:49.934: ERROR/AndroidRuntime(15221): Caused by: java.lang.reflect.InvocationTargetException08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at com.android.wallpaper.livepicker.LiveWallpaperPreview.configureLiveWallpaper(LiveWallpaperPreview.java:113)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at java.lang.reflect.Method.invokeNative(Native Method)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at java.lang.reflect.Method.invoke(Method.java:521)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.view.View$1.onClick(View.java:2067)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     ... 11 more08-28 01:06:49.934: ERROR/AndroidRuntime(15221): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {quotesandothers.livewallpaper.quotesandothers/quotesandothers.livewallpaper.quotesandothers}; have you declared this activity in your AndroidManifest.xml?08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.app.Activity.startActivityForResult(Activity.java:2817)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     at android.app.Activity.startActivity(Activity.java:2923)08-28 01:06:49.934: ERROR/AndroidRuntime(15221):     ... 15 more</code></p><p>Manifest:`                                                                    </p><pre><code>    &lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;uses-feature android:name=""android.software.live_wallpaper"" /&gt;</code></pre><p> `</p>","433535","","","","","2011-07-22 12:03:32","Android Activity Not Found Exception Doesn't Make Sense","<android><android-manifest>","1","0","","",""
"3589741","1","","","2010-08-28 06:31:06","7","8196","<p>when we click the widget at that time i need to open a activity screen(or application).How to do this?Thanks in advance !! </p>","398981","","","","","2013-11-26 11:10:14","how to open a application from widget in android?","<android>","3","0","1","",""
"3589876","1","","","2010-08-28 07:26:15","1","812","<p>I have a problem with using the camera of an Android 2.1 phone (HTC Desire), maybe you can help me.After calling camera.open() DDMS in Eclipse shows the following errors:</p><pre><code>ERROR/MediaPlayerService(30):   error: -2ERROR/MediaPlayer(30): Unable to to create media playerERROR/CameraService(30): Failed to load CameraService sounds.</code></pre><p>Test view in the emulator works fine, but on my phone only a popup is shown where I only can close the application.</p>","471391","","387076","","2012-05-12 20:24:56","2012-05-12 20:24:56","Android 2.1 camera preview error","<camera><media-player><android>","0","2","","",""
"3589914","1","","","2010-08-28 07:45:03","1","1100","<p>The AbsoluteLayout class (and contained LayoutParams class with x and y properties) is deprecated.  While it is possible to roll my own class that extends ViewGroup and enables me to control the absolute positioning of the child views - is this the best approach for sprite animation?</p><p>First of all, I've made the assumption that moving ImageViews around by changing their x and y position will be more efficient than redrawing bitmaps inside a SurfaceView.  Is this assumption right?</p><p>My wider question is really: what is the best approach for animating sprites in Android?</p>","433579","","","","","2011-04-11 15:38:41","Alternative to AbsoluteLayout? Best approach for sprite animation?","<android>","2","0","","",""
"3589929","1","7903770","","2010-08-28 07:48:34","1","1583","<p>i want to dynamic design scrollbars in the EditText using code, but i don't find thisapi as setscrollbars, could you tell me if i can programatically? realize </p><pre><code>android:scrollbars=""vertical""</code></pre><p>if possible, how to realize?</p>","233618","","414581","","2011-10-26 14:23:24","2012-07-19 00:14:36","how to realize "" android:scrollbars=""vertical"" "" programatically?","<android>","2","0","0","",""
"3589958","1","","","2010-08-28 07:56:55","1","179","<p>I just started playing with android device and have problem with getting updates from GPS listener.</p><p>Firstly, the code, so You could check if I'm doing everything right:</p><p>In AndroidManifest.xml I have:</p><pre><code>&lt;uses-permission android:name=""android.permission.LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_GPS"" /&gt;</code></pre><p>Location listener is defined as private member of Activity:</p><pre><code>private LocationListener mLocationListener = new LocationListener(){    @Override    public void onLocationChanged(Location pLocation) {        double lLatitude = pLocation.getLatitude();        double lLongitude = pLocation.getLongitude();        mGpsTextView.setText (""Longitude"" + Double.toString(lLongitude) + "" Latitude: "" + Double.toString(lLatitude));    }    @Override    public void onProviderDisabled(String provider) {        mGpsTextView.setText (""Provider disabled"");    }    @Override    public void onProviderEnabled(String provider) {        mGpsTextView.setText (""Provider enabled"");    }    @Override    public void onStatusChanged(String provider, int status, Bundle extras) {        switch (status)        {        case LocationProvider.OUT_OF_SERVICE:            mGpsTextView.setText(""GPS out of service"");            break;        case LocationProvider.TEMPORARILY_UNAVAILABLE:            mGpsTextView.setText(""GPS temorarily unawalible"");            break;        case LocationProvider.AVAILABLE:            mGpsTextView.setText(""GPS avalible"");            break;        default:            mGpsTextView.setText(""GPS crazy"");        }   }};</code></pre><p>In ""onResume"" method I aquire LocationManager and register my listener:</p><pre><code>    mLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);    mLocationManager.requestLocationUpdates (LocationManager.GPS_PROVIDER, 0, 0.0f, mLocationListener);</code></pre><p>In ""onPause"" I remove listener</p><pre><code>    mLocationManager.removeUpdates(mLocationListener);</code></pre><p>Then, when I test the code on emulator with geo fix - everything works perfect. But when I deploy my app on phone the code not work as it should. When the provider is disabled the text on the ""mGpsTextView"" is ""provider disabled"" - so it is ok. But when I run app with gps provider enabled the text on ""mGpsTextView"" and no updates are recived (checked it with debugger - onLocationChanges isn't called).</p><p>Any idea what may be wrong?</p>","210807","","210807","","2010-08-28 08:36:37","2010-10-08 04:36:22","Problem with reciving information from GPS on Android","<android>","1","4","1","",""
"3589963","1","3594134","","2010-08-28 07:57:56","3","2008","<p>I have the following code:</p><pre><code>if (gps_enabled) {        Log.e(""$$$$$$$$$$$$$$"",                ""GPS is enabled requestion location updates... interval value is: ""                        + interval);        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,                locationListenerGps);    }    else{        if (network_enabled) {            Log.e(""$$$$$$$$$$$$$$"",                    ""Network is enabled requestion location updates... interval value is: ""                            + interval);            lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0,                    0, locationListenerNetwork);        }    }</code></pre><p>with that code I can get the location(at least using the network provider! (another issue on another post))I would like to get notifications in a regular interval say every one hour, but passing the parameter to requestLocationUpdates doesn't guarantee that the interval will be maintained (at least that my tests showned,since I expected update every minute but got a lot of updates instead of one!)so i thought of using a timerTask and schedule it, I now have </p><pre><code>timer1.scheduleAtFixedRate(new TimerTask() {        @Override        public void run() {            getLocation();        }    }, 0, 180000);// 3 minutesr...</code></pre><p>where getLocation is the method that I called previously called, but when the timer calls that method then nothing happens, the logs stop at this point </p><pre><code>Log.e(""$$$$$$$$$$$$$$"",                    ""Network is enabled requestion location updates... interval value is: ""                            + interval);</code></pre><p>and I never get notified about my location.any Ideas?thanks in advanced maxsap.</p>","234898","","210807","","2010-08-28 08:01:33","2011-06-16 21:17:07","LocationManager requestLocationUpdates and timertask in android","<android>","1","1","","",""
"3590089","1","3590117","","2010-08-28 08:41:53","1","2237","<p>I wanna know a corresponding method in Android/Java that is like the GetTickCount method in C#/C++?</p>","386562","","918414","","2013-01-31 09:39:26","2013-11-08 21:56:31","Which is Android/Java corresponding method to the C#/C++ method GetTickCount()?","<c#><java><c++><android>","1","0","","",""
"3590229","1","3590311","","2010-08-28 09:32:52","1","392","<p>We're working with a client who's planning on bundling their software on a new piece of hardware.</p><p>The app will be bundled on the internal memory and needs to be updateable but is device specific, it's a hardware exclusive app.</p><p>Ideally we'd like to use the marketplace as the update backbone but there don't seem to be any options for having a private application.</p><p>How is this normally done?</p>","29553","","","","","2010-08-28 10:04:22","Android marketplace private applications for hardware exclusive?","<android><google-play>","1","0","","",""
"3590260","1","","","2010-08-28 09:44:29","4","3216","<p>I'd like to show my own IME in the Select input method chooser dialog like the Japanese IME and the Chinese IME. How can I do that? </p><p>I am new to Android. I have tested Greek IME and other IME. Although <code>.apk</code> is successfully uploaded. But can't show in it and how to choose own IME from this place. </p><p>What do I need to do in my code?</p>","393422","","49246","","2010-11-13 10:26:33","2011-07-04 18:03:05","How to add own custom IME at Select Input method dialog","<android><ime><android-input-method>","2","1","","",""
"3590269","1","","","2010-08-28 09:48:09","0","897","<p>I want to know what IME is using currently in android.</p><p>I tried InputMethodManager.getEnabledInputMethodList(), but I can only get the list of IMEs.</p><p>I can't figure out how to determine which one is currently selected of the list.</p><p>How can I get which input method had selected currently?</p>","433625","","49246","","2010-11-13 10:43:53","2011-07-04 17:58:44","How to know the current IME in Android?","<android><keyboard><ime><android-input-method>","1","1","","",""
"3590443","1","13122117","","2010-08-28 10:47:43","6","7577","<p>What is the maximum memory limits per application for Android 2.2?</p>","433646","","63550","","2010-09-06 14:34:26","2013-12-09 13:31:37","What is the maximum memory limits per application for Android 2.2?","<android><limits>","4","0","1","",""
"3590529","1","","","2010-08-28 11:13:28","0","320","<p>i am developing gmail chat application in android...anybody know how can we get the online user?i would login from my gmail id...i want to show  the my friends who is online from chat list...</p>","421645","","","","","2010-08-28 11:32:13","how can we get online user to gmail chat?","<android>","1","0","","",""
"3590577","1","3590763","","2010-08-28 11:31:46","1","99","<p>i have a list view and custom list adapter for it. There are various other fields in it and a Checkbox. The problem is that it is not able to map Checkboxes properly. I mean if an entry is already present in database it should come checked.</p><p>When i put a log in the View function it shows some of the entries that are repeated, i think this is the main reason.</p><p>I need some help badly.</p><p>Thanks</p>","405521","","","","","2010-08-30 07:07:53","Android list view not mapping correctly","<android><listview>","2","1","","",""
"3590613","1","3590665","","2010-08-28 11:43:16","0","4868","<p>I'm making an android client for a web site. my app have to go through the website, parse HTML, post some forms, send HTTP requests etc.</p><p>What library covering all this stuff you recommand me to use ?</p><p>thanks.</p>","311017","","","","","2011-02-23 08:56:13","A Good JAVA library to parse HTML, POST AND GET HTTP suitable for Mobile?","<java><android><post><android-parser>","3","0","0","",""
"3590885","1","3590899","","2010-08-28 13:23:53","0","420","<p>How Titanium works with android? </p><p>And it is easy to work with titanium for developing android applications? </p>","363503","","","","","2010-08-28 14:03:40","How Titanium is helpful in developing android applications?","<android><titanium>","2","0","","",""
"3590886","1","3592652","","2010-08-28 13:24:07","4","2055","<p>I want to have a <em>textured</em> sphere in OpenGl ES. What is the best way to do this? One option is to create it manually. Another is to create it in e.g. Blender and load it - what file format should I use?</p>","243225","","","","","2011-09-19 22:49:41","Textured sphere in OpenGL ES","<android><opengl-es>","1","0","1","",""
"3590955","1","4281243","","2010-08-28 13:45:27","12","12446","<p>I am facing a problem with a clock widget i made. I want the user to touch the clock and launch the clock app on the phone. this is the code:</p><pre><code>//this worked on my nexus 2.1 if(VERSION.SDK.equals(""7"")){            RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);            Intent AlarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName(""com.android.deskclock"", ""com.android.deskclock.DeskClock""));            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, AlarmClockIntent, 0);            views.setOnClickPendingIntent(R.id.Widget, pendingIntent);            AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views);        }  //this worked on my nexus +froyo2.2             else if(VERSION.SDK.equals(""8"")){            RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);            Intent AlarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName(""com.google.android.deskclock"", ""com.android.deskclock.DeskClock""));            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, AlarmClockIntent, 0);            views.setOnClickPendingIntent(R.id.Widget, pendingIntent);            AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views);        } //this worked on my htc magic with 1.5 and 1.6        else{            RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);            Intent AlarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName(""com.android.alarmclock"", ""com.android.alarmclock.AlarmClock""));            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, AlarmClockIntent, 0);            views.setOnClickPendingIntent(R.id.Widget, pendingIntent);            AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views);        }</code></pre><p>I made the above so the when i touch the clock opens the alarm settings. But is not universal.I found out that on droids with 2.2 does not work. There must be a better solution than creating an if statement for every android phone flavor i  the world. Plus i don not know the package names for all.Anyone knows how to overcome this please help.</p>","364418","","","","","2014-02-27 19:39:50","Intent to launch the clock application on android","<android><android-intent><widget><clock>","6","1","11","",""
"3590965","1","","","2010-08-28 13:50:33","2","6361","<p>I have an image that has a fairly large shadow around it and its background is transparent. I have saved it as a PNG file from photoshop and am using it in an ImageView through xml. This results in the shadow having a banding effect and just doesn't look nice. Not too sure what to do...</p>","362476","","","","","2011-07-12 16:35:17","Transparent PNG image not looking nice","<android><image><mobile><png><transparency>","3","0","2","",""
"3590987","1","","","2010-08-28 13:57:07","10","6597","<p>I'm trying to listen on a port using <code>ServerSocket</code> on an Android device. I want to be able to connect to this port over WiFi using a computer on the same network.</p><p>I get no exception when binding it to a port, however when I check netstat it says:</p><pre><code>Proto Recv-Q Send-Q Local Address           Foreign Address         Statetcp        0      0 (null):4040             (null):*                LISTEN</code></pre><p>I've tried countless ways of binding it to localhost, 0.0.0.0, the WiFi LAN IP address of the device with <code>SocketInetAddress</code> and <code>InetAddress.getByName</code>. Nothing seems to work.</p><p>When I try to connect to the port from a computer in the same WiFi (I've tried both netcat and Java's <code>Socket.connect()</code>), all I can see in Wireshark is an ARP request:</p><pre><code>Who has [phone's LAN address]? Tell [computer LAN address].</code></pre><p>This request repeat itself until timed out.</p><p>I've tried the reverse way, by setting the ServerSocket on the computer and connecting to that port from the phone, that works very well.</p><p>My testing phone is an Samsung Spica i5700 with a custom ROM.</p><p>Any ideas?</p><p>Edit:The code is simple as this:</p><pre><code>ServerSocket server = new ServerSocket();server.setReuseAddr(true);server.setTimeout(0);server.bind(new InetSocketAddress(4040));Socket client = null;while((client = server.accept()) == null);// Connectedenter code hereenter code here</code></pre>","366330","","366330","","2010-08-29 16:37:08","2013-10-16 14:56:18","Can't use ServerSocket on Android","<android><sockets><tcp><bind><serversocket>","3","2","4","",""
"3591000","1","3592301","","2010-08-28 14:01:55","1","1024","<p>im trying to do this on Android:</p><pre><code>Process p = Runtime.getRuntime().exec(""sh"");   DataOutputStream out = new DataOutputStream(p.getOutputStream());   out.writeBytes(""something useful\n"");   out.close();   p.waitFor();   out = new DataOutputStream(p.getOutputStream());   out.writeBytes(""something useful\n"");   out.close();   p.waitFor();</code></pre><p>The second time I execute out.writeBytes(); , I get a java IOException: ""Bad file number"".My app has to execute several native programs, but always use the same process.Anyone know why this does not work?</p>","433732","","","user195488","2010-08-29 13:00:47","2010-08-29 13:00:47","Java - (android) Reuse a process after flushing its OutputStream","<java><android><ioexception>","2","0","","",""
"3591078","1","","","2010-08-28 14:25:14","0","682","<p>I have subclassed ExpandableListActivity to create an activity thatpresents a simple tree view of the 'world at large' and allows theuser to select one for further use by the app. I am having troublesetting focus programatically. One thing that baffles me is that I canuse the D-pad to set focus on any of the child or group items in myExpandableListView, but inside my onChildClick() callback,isFocusable() returns false. If I can set focus with the D-pad, howcan isFocusable() return false?</p><p>My goal is to avoid having the user have to touch individualExpandableListView entries to select them and to provide a couple ofbuttons to move the focus up and down inside the list. I  wantselection to be easy for  folks with no D-pad or with a phone thatonly presents the D-pad when in landscape mode (e.g. Droid) .</p><p>Is there some way I can programatically inject D-pad key clicks intomy app input event stream?</p>","267257","","","","","2011-03-17 17:12:40","Setting focus programatically in ExpandableListView. Emulating D-pad clicks in code?","<android><focus><expandablelistview>","1","0","","",""
"3591189","1","","","2010-08-28 14:58:57","0","1550","<p>I have been trying to add a WebView inside one of the tabs in TabView but it isn't working.When I go to the other tabs i just have TextViews and they work fine, but as soon as I click the tab with the web in it, error it closes unexpectedly.here is my search_result.java that has the tabview</p><pre><code>package supa.mack.doppler;import android.app.Activity;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TabHost;public class search_result extends TabActivity { public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.search_result);     TabHost mTabHost;     mTabHost = getTabHost();     mTabHost.addTab(mTabHost.newTabSpec(""Results"").setIndicator(""Results"").setContent(R.id.textview1));     mTabHost.addTab(mTabHost.newTabSpec(""Location"").setIndicator(""Location"").setContent(R.id.textview2));     mTabHost.addTab(mTabHost.newTabSpec(""Facebook"")       .setIndicator(""Facebook"")       .setContent(new Intent(this, BioActivity.class)));     mTabHost.setCurrentTab(0); Button searchButton=(Button) findViewById(R.id.return_button);    searchButton.setOnClickListener(new View.OnClickListener(){   public void onClick(View v) {   Intent intent=new Intent(     search_result.this,     doppler_test.class     );    startActivity(intent);   }});  }}</code></pre><p>Now here is the search_result.xml where the tabView is defined</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" android:layout_gravity=""center_horizontal""&gt;        &lt;TableLayout    android:id=""@+id/TableLayout01""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:layout_gravity=""center_horizontal"" android:gravity=""center_horizontal""&gt;         &lt;Button      android:id=""@+id/return_button""      android:layout_height=""wrap_content""       android:text=""Return""       android:layout_width=""fill_parent""/&gt;            &lt;TableRow&gt;           &lt;TextView                 android:id=""@+id/textview1""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:text=""Here is the list of people in your location"" /&gt;            &lt;TextView                 android:id=""@+id/textview2""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:text=""Here you will see your exact location to bookmark it"" /&gt;            &lt;TextView                 android:id=""@+id/textview3""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                 android:text=""Reference Facebook To Check The One You Seek"" /&gt;        &lt;/TableRow&gt;      &lt;/TableLayout&gt;    &lt;/FrameLayout&gt;   &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Here is BioActivity.java where the webView is defined</p><pre><code>package supa.mack.doppler;import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class BioActivity extends Activity { WebView browser; public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.web_view);     browser = (WebView) findViewById(R.id.webview);     browser.getSettings().setJavaScriptEnabled(true);     browser.loadUrl(""http://www.google.com""); }}</code></pre><p>And finally this is the web_view.xml where the webView is placed</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;</code></pre><p>O and almost forgot to add my manifest....</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""supa.mack.doppler""      android:versionCode=""1""      android:versionName=""1.0""&gt;        &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;        &lt;activity android:name="".doppler_test""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;  &lt;activity android:name="".search_result""&gt;   &lt;activity android:name="".search_result"" android:label=""@string/app_name""        android:theme=""@android:style/Theme.NoTitleBar""/&gt;        &lt;activity android:name="".BioActivity"" android:label=""@string/app_name""      android:theme=""@android:style/Theme.NoTitleBar""/&gt;  &lt;/activity&gt;&lt;uses-permission android:name=""android.permission.BLUETOOTH_ADMIN"" /&gt;    &lt;uses-permission android:name=""android.permission.BLUETOOTH"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;/application&gt;        &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre><p>Thank you for looking over my code it is really ruining my day not being able to get this to work...</p>","433047","","433047","","2010-08-29 13:19:18","2010-08-29 13:19:18","WebView Inside TabView fail","<android><webview>","2","0","","",""
"3591299","1","3591352","","2010-08-28 15:26:41","1","1780","<p>I have successfully implemented a custom SimpleCursorAdapter for an AutoCompleteTextView, which suggests entries from the database according to what has been entered into the box. However, I am getting the following non-fatal errors:</p><p><em>An exception occured during performFiltering()!<br>java.lang.NullPointerException<br>at com.stev.LondonTaxi.Route.runQuery(Route.java:456) at com.stev.LondonTaxi.AutocompleteAdapter.runQueryOnBackgroundThread(AutocompleteAdapter.java:61)</em></p><p>Relevant extracts from my code are below - I wonder if anyone might be able to shed any light?</p><pre><code>public class Route extends Activity implements View.OnClickListener,AdapterView.OnItemClickListener, FilterQueryProvider {from_adapt.setFilterQueryProvider(this);public Cursor runQuery(CharSequence constraint) {String filter = constraint.toString().toUpperCase() + ""%'""; Cursor all_Cursor_filter = dbse.autocomplete_query(filter);return all_Cursor_filter;     }public class AutocompleteAdapter extends SimpleCursorAdapter implements Filterable { public Cursor runQueryOnBackgroundThread(CharSequence constraint) {    if (getFilterQueryProvider() != null)     { return getFilterQueryProvider().runQuery(constraint); }    return dbAdapt.autocomplete_query();        }</code></pre><p>Steve</p>","278638","","","","","2010-08-28 15:42:41","Null Pointer Exception during PerformFiltering on an AutoCompleteTextView","<android><autocomplete>","1","0","","",""
"3591359","1","","","2010-08-28 15:44:37","2","554","<p>Hello :) I am working on an application that uses the compass and location to draw an arrow at the direction of a location. My problem is when I run my code on the emulator, all the arrows point the correct directions, and when I change the orientation of the emulator to landscape, all the arrows are still correct. But when I run the same application on my Nexus One, the arrows are all correct when the phone is vertical, but when it turns to landscape all of the arrow are off by 90 degrees. It keeps the ""top"" of the phone as the reference to North. Thus you must correct the compass for the orientation of the phone. Does this happen on all real phones and the emulator is the different one? Or is this just the Nexus One? Thanks :)</p>","433791","","","","","2011-06-07 16:05:08","Android Compass Reading Different Values On Different Phones?","<android><compass-geolocation>","1","2","1","",""
"3591465","1","3591481","","2010-08-28 16:16:18","12","15863","<p>It seems like every example I can find of switching between activities involves creating an Intent and passing in the context of a View via an OnClickListener associated with a button.</p><p>But what if you just decide you need to switch activities? In my case, a preference value is causing an Activity switch.</p><p>How do you create an Intent that can cause an Activity switch without an associated OnClickListener?</p>","3886","","600500","","2011-07-23 15:58:04","2013-07-01 15:37:56","On Android, how do you switch activities programatically?","<android><activity>","4","1","4","",""
"3591494","1","3594227","","2010-08-28 16:24:40","4","1294","<p>Is there any way of accessing the internal SD card on Android devices that have internal flash, internal SD and external SD cards?</p>","29553","","","","","2010-08-29 09:32:44","Writing to internal SD card on Android","<android><special-folders><android-sdcard>","1","0","","",""
"3591536","1","3594221","","2010-08-28 16:37:08","0","229","<p>How to create custom view with two independent sections, each slideable? Example would be iPad Zillow -> <a href=""http://www.zillow.com/ipad/"" rel=""nofollow"">http://www.zillow.com/ipad/</a></p><p>I was wondering if this can also be done on the home screen and not only in new app...</p>","433808","","508666","","2014-01-12 03:20:45","2014-01-12 03:20:45","How to make two slideable sections on android device screen?","<android><homescreen>","1","0","","",""
"3591557","1","3594337","","2010-08-28 16:42:59","1","1211","<p>I can't figure out how to tell my Map to redraw its overlays once I've updated them.Can someone enlighten me?</p><p>Currently the user has to touch the screen before the map is redrawn.</p><p>Thanks!</p>","102526","","","","","2011-03-31 04:31:32","Adding items to Android Maps Overlay does not immediately show on map. How do I fix?","<android><android-maps>","3","0","1","",""
"3591784","1","3594216","","2010-08-28 17:47:02","56","50317","<p>I creating all of the elements in my android project dynamically. I am trying to get the width and height of the button so that I can rotate the button around. Just trying to learn how to work with the android language. However, it is returning 0. I did some research and I keep seeing that it needs to be done somewhere other than in the oncreate method. If someone could give me an example of how to do it that would be great. Here is my current code:</p><pre><code>package com.animation;import android.app.Activity;import android.os.Bundle;import android.view.animation.Animation;import android.view.animation.LinearInterpolator;import android.view.animation.RotateAnimation;import android.widget.Button;import android.widget.LinearLayout;public class AnimateScreen extends Activity { /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    LinearLayout ll = new LinearLayout(this);    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);    layoutParams.setMargins(30, 20, 30, 0);    Button bt = new Button(this);    bt.setText(String.valueOf(bt.getWidth()));    RotateAnimation ra = new RotateAnimation(0,360,bt.getWidth() / 2,bt.getHeight() / 2);    ra.setDuration(3000L);    ra.setRepeatMode(Animation.RESTART);    ra.setRepeatCount(Animation.INFINITE);    ra.setInterpolator(new LinearInterpolator());    bt.startAnimation(ra);    ll.addView(bt,layoutParams);    setContentView(ll);}}</code></pre><p>Any help is appreciated.</p>","160463","","","","","2013-08-20 13:30:13","Android get width returns 0","<android><get><width>","4","0","22","",""
"3591901","1","3591956","","2010-08-28 18:19:57","31","4506","<p>Is there XML attribute that does the exact opposite of <code>android:dependency</code>? </p><p>What I would like the dependent preference to be enabled when the other is NOT checked and disabled when it IS checked.</p><p>edit: maybe the issue isn't with <code>android:dependency</code> maybe there is an xml attribute that I can add to make the default for that preference disabled and then <code>android:dependency</code> will toggle it the opposite way like i want.</p><p>edit again:I tried setting <code>android:enabled=""false""</code> in the preference and it disables it like i want but even with it being dependent on the other preference it didn't enable it like i had hoped</p>","393373","","393373","","2010-08-28 18:28:41","2014-03-21 08:26:44","How to do opposite of of preference attribute android:dependency?","<java><android><xml><dependencies><preferences>","4","0","10","",""
"3591959","1","3592011","","2010-08-28 18:36:04","0","558","<p>Good evening everyone!  I am working on learning some java and I have made it to the notepad tutorial and when I go to run it on the emulator, I am getting a few errors, and I'm hoping someone here may be able to help.</p><pre><code>package com.a8a.todolist;import java.util.ArrayList;import android.app.Activity;import android.os.Bundle;import android.widget.EditText;import android.widget.ListView;import android.widget.ArrayAdapter;import android.view.View.OnClickListener;public class ToDoList extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        //Inflat your view        setContentView(R.layout.main);        //Get references to UI widgets        ListView myListView = (ListView)findViewById(R.id.myListView);        final EditText myEditText = (EditText)findViewById(R.id.myEditText);        //Create the array list of to do items        final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();        //Create the array adapter to bind the array to the listview        final ArrayAdapter&lt;String&gt; aa;        **aa = new ArayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,todoItems);**    *Multiple markers at this line    - ArayAdapter cannot be resolved to a type  - Line breakpoint:ToDoList [line: 27] - onCreate*     (Bundle)        //Bind the arary adapter to the listview.        myListView.setAdapter(aa);        **myEditText.setOnKeyListener(new OnKeyListener() {**  *OnKeyListener cannot be resolved to a type*            public boolean onKey(View v, int keyCode, KeyEvent event) {                if (event.getAction() == KeyEvent.ACTION_DOWN)                    if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER)                    {                        todoItems.add(0, myEditText.getText().toString());                        aa.notifyDataSetChanged();                        myEditText.setText("""");                        return true;                    }                return false;            }        });    }}[/CODE]</code></pre><p>The bolded text is whats getting the error and the italics are the error itself.  Any help would be appreciated, if you are able to explain why the change needs to be made as well that would be much appreciated, so I can learn from my mistakes.</p><p>Thanks in advance!</p>","433866","","","","","2010-08-28 18:51:42","Looking for help with 2 errors when compiling the application","<java><android><eclipse><jdk>","2","3","","",""
"3592136","1","3592195","","2010-08-28 19:31:27","0","1209","<p>I would like to know what the best way would be to draw a background image (this would be pretty much static) and a foreground object which would move depending on user input in Android?</p><p>Sort of like a side-scroller game (when the foregroudn object needs to animate and change a lot more than the background).</p><p>TIA</p>","365681","","","","","2011-04-18 14:44:19","Background image with moving foreground graphics","<android>","1","0","","",""
"3592242","1","","","2010-08-28 20:06:45","2","1942","<p>I have downloaded eclipse and the Android sdk and I have now used eclipse to design an android app which runs fine on the emulator. I have also downloaded and installed Kies for file transfer between PC and Samsung phone. I used Kies to download a free app from Android market and checked the format of the downloaded files, one is an ‘app file’, the other is ‘image files’. Do I have to somehow turn the saved files from my eclipse created app into the above file types for transfer to my phone? If so how? If not, which files do I transfer to my phone? Hope someone can help, apologies if I have missed something simple and obvious. Thanks.</p>","433906","","","","","2012-10-16 02:07:41","How do I convert eclipse App for phone?","<android><eclipse>","2","0","0","",""
"3592283","1","3630223","","2010-08-28 20:19:18","2","1942","<p>In my app I'm capturing an image. Everything is working fine unless the phone goes to sleep while the preview is running. Not really sure how to handle it, I'm thinking that it may be best just to prevent the phone from automatically going to sleep while this process is in action. Which i do not know how to do. and if i do that will it prevent the phone from sleeping when i press the power button? perhaps there is a deeper issue here. </p><p>LogCat:</p><pre>08-28 16:17:10.879: WARN/dalvikvm(9652): threadid=3: thread exiting with uncaught exception (group=0x4001b390)08-28 16:17:10.879: ERROR/AndroidRuntime(9652): Uncaught handler: thread main exiting due to uncaught exception08-28 16:17:10.879: ERROR/AndroidRuntime(9652): java.lang.RuntimeException: Method called after release()08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at android.hardware.Camera.setHasPreviewCallback(Native Method)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at android.hardware.Camera.access$600(Camera.java:58)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at android.hardware.Camera$EventHandler.handleMessage(Camera.java:339)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at android.os.Handler.dispatchMessage(Handler.java:99)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at android.os.Looper.loop(Looper.java:123)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at android.app.ActivityThread.main(ActivityThread.java:4595)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at java.lang.reflect.Method.invokeNative(Native Method)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at java.lang.reflect.Method.invoke(Method.java:521)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-28 16:17:10.879: ERROR/AndroidRuntime(9652):     at dalvik.system.NativeStart.main(Native Method)</pre><p>takephoto activity:</p><pre><code>public class takephoto extends Activity {     private static final String TAG = ""GrowJournalDemo"";      Preview preview; // &lt;1&gt;      Button buttonClick; // &lt;2&gt;      String journ_id;      String plant_id;    // private String plantid = ((resource) this.getApplication()).getplantId();      /** Called when the activity is first created. */      @Override      public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.photo);        preview = new Preview(this); // &lt;3&gt;        ((FrameLayout) findViewById(R.id.preview)).addView(preview); // &lt;4&gt;        String journalid = ((resource) this.getApplication()).getjournalName();        plant_id = ((resource) this.getApplication()).getplantId();        journ_id = journalid;        buttonClick = (Button) findViewById(R.id.buttonClick);        buttonClick.setOnClickListener(new OnClickListener() {          public void onClick(View v) { // &lt;5&gt;             // preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);              preview.camera.autoFocus(new Camera.AutoFocusCallback() {                  Camera.ShutterCallback shutterCallback = new Camera.ShutterCallback() {                    public void onShutter() {                      // Play your sound here.                    }                  };                  public void onAutoFocus(boolean success, Camera camera) {                    preview.camera.takePicture(null, null, jpegCallback);                  }                });          }        });        Log.d(TAG, ""onCreate'd"");      }      // Called when shutter is opened      ShutterCallback shutterCallback = new ShutterCallback() { // &lt;6&gt;        public void onShutter() {          Log.d(TAG, ""onShutter'd"");        }      };      // Handles data for raw picture      PictureCallback rawCallback = new PictureCallback() { // &lt;7&gt;        public void onPictureTaken(byte[] data, Camera camera) {          Log.d(TAG, ""onPictureTaken - raw"");        }      };      // Handles data for jpeg picture      PictureCallback jpegCallback = new PictureCallback() { // &lt;8&gt;        public void onPictureTaken(byte[] data, Camera camera) {          FileOutputStream outStream = null;          try {              android.os.Environment.getExternalStorageState();            // create a File object for the parent directory              File PhotoDirectory = new File(                      android.os.Environment.getExternalStorageDirectory()+                      ""/GrowJournalPhotos/""+journ_id+""/""+plant_id+""/"");              // have the object build the directory structure, if needed.              PhotoDirectory.mkdirs();              // create a File object for the output file              File outputFile = new File(PhotoDirectory, ""photo.jpg"");              // now attach the OutputStream to the file object, instead of a String representation              outStream = new FileOutputStream(outputFile);            outStream.write(data);            outStream.close();            Log.d(TAG, ""onPictureTaken - wrote bytes: "" + data.length);            setResult(RESULT_OK);            finish();          } catch (FileNotFoundException e) { // &lt;10&gt;            e.printStackTrace();          } catch (IOException e) {            e.printStackTrace();          } finally {          }          Log.d(TAG, ""onPictureTaken - jpeg"");        }      };    }</code></pre><p>Preview surfaceview:</p><pre><code>public class Preview extends SurfaceView implements SurfaceHolder.Callback {    private static final String TAG = ""Preview"";      SurfaceHolder mHolder;  // &lt;2&gt;      public Camera camera; // &lt;3&gt;      Preview(Context context) {        super(context);        // Install a SurfaceHolder.Callback so we get notified when the        // underlying surface is created and destroyed.        mHolder = getHolder();  // &lt;4&gt;        mHolder.addCallback(this);  // &lt;5&gt;        mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); // &lt;6&gt;      }      // Called once the holder is ready      public void surfaceCreated(SurfaceHolder holder) {  // &lt;7&gt;        // The Surface has been created, acquire the camera and tell it where        // to draw.        camera = Camera.open(); // &lt;8&gt;        try {          camera.setPreviewDisplay(holder);  // &lt;9&gt;          camera.setPreviewCallback(new PreviewCallback() { // &lt;10&gt;            // Called for each frame previewed            public void onPreviewFrame(byte[] data, Camera camera) {  // &lt;11&gt;              Log.d(TAG, ""onPreviewFrame called at: "" + System.currentTimeMillis());              Preview.this.invalidate();  // &lt;12&gt;            }          });        } catch (IOException e) { // &lt;13&gt;          e.printStackTrace();        }      }      // Called when the holder is destroyed      public void surfaceDestroyed(SurfaceHolder holder) {  // &lt;14&gt;        camera.stopPreview();        camera.release();        camera = null;      }      // Called when holder has changed      public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // &lt;15&gt;        camera.startPreview();      }    }</code></pre><p>I've added a wake lock to prevent the phone from dimming, I feel this is a temporary solution though as there is still a force close when the device is forced to sleep via power button.</p>","393328","","393328","","2010-08-29 07:51:01","2010-09-02 18:51:56","Camera force close when returning from sleep. Android","<java><android>","1","0","","",""
"3592347","1","","","2010-08-28 20:34:34","0","819","<p>I have a georeferenced image that's really an image of a map.  I know the latitude and longitude of several points on the image and I'm trying to figure out how to display my location on the image.  Similar to how Google Maps works, but instead of using Google Maps I'd like to use the map I have a JPG of.</p><p>Any ideas on where to start?</p>","433923","","","","","2010-08-28 21:18:44","Showing GPS location on a JPG map?","<android>","2","0","","",""
"3592398","1","3592463","","2010-08-28 20:48:50","0","407","<p>i have a url for the video file. the format of that file is itunes M4V.</p><p>I applied the URL in Api demos example, which is playing for some time, after sometime song is breaking.</p><p>Is there any problem with this format or any way to play .M4V format.</p><p>Please let me know...</p><p>Thanks</p>","341443","","","","","2010-08-28 21:05:34","I need to Play .M4V foramt audio from url, Problem with playing .M4V format","<android>","1","0","","",""
"3592411","1","","","2010-08-28 20:51:24","0","129","<p>I have an app that has multiple databases. Not multiple tables in a single database file, but literally multiple databases. For the sake of clarity, lets say that Database #1 is a Car Database, and #2 is a Truck database. For the Truck database, I have an Activity that allows you to see various bits of information that is compiled from all the Trucks you've saved, so this code obviously accesses the Truck database to retrieve all of the Truck records.</p><p>I have a user who says that a few days ago he successfully saved a new Truck into the database. After saving the truck he was able to go to the above mentioned Activity and view all of the compiled information with no problems.</p><p>The user says that when he opened the app today, all information was gone. The Car information and the truck information. He says that he did not delete anything. He has a Droid Eris running Android 2.1.</p><p>Has anyone experienced any similar types of data loss, or have any ideas for what could possibly cause this behavior? </p><p>Unfortunately, this is all the information I have. He added a Truck record, viewed an Activity that accesses the Truck database, then a couple of days later all Trucks and Cars are gone. Could something as silly as forgetting to close a Database object or a Cursor cause such a problem? I wouldn't think so, but I'm grasping at straws here.</p><p>I have the app on my Droid running 2.2, and have not seen this, or at least haven't seen it yet, and I have no idea of how to go about trying to make this situation happen.</p>","449070","","","","","2010-08-28 20:51:24","Android Database information gone","<android><database>","0","2","","",""
"3592497","1","","","2010-08-28 21:16:38","2","5131","<p>I am trying to find the sqlite database used by the MediaStore. As far as I understand, the MediaStore contains amongst others the playlists defined in the default Music app. I actually would like to duplicate a playlist, but the app does not allow that. Somehow I thought I could fix this if I just could find the actual db file. But I got completely sidetracked now, because I just cannot find the db. Btw, I am running FroYo.</p>","115835","","","","","2014-01-16 07:17:26","Android MediaStore sqlite db location","<android><mediastore>","3","0","2","",""
"3592520","1","3592642","","2010-08-28 21:21:15","0","188","<p>I have an app that uses a database.  At startup I check to see if my tables are missing and if so I create them.  Works great.I've noticed that if I ""adb uninstall"" then the next time I run my app the tables are created again (this is what I need), but what about when updating through the marketplace?I'm in the process of releasing an update, and I've made major changes to the tables.  I'd like it if the tables were completely wiped and re-created, in fact my app needs this to happen.  If someone updates and has the old tables then there will be a force close.Does anyone know the specifics of this scenario?</p><p>My tables are only for lookup, I store no user data so I dont really care about losing data on the updates.Of course I know an option is to use some type of ""version"" table and check to see if I need to manually drop and create, but I was wondering if that was even needed.Thanks.</p>","81975","","","","","2010-08-28 21:56:51","Does an Android database get completely removed and recreated then updating an app?","<android>","1","0","1","",""
"3592699","1","3594209","","2010-08-28 22:13:31","1","172","<p>I'm attempting to make a simple homebrew game engine/framework in android. I have the ""engine"" as a library project that handles all of the graphics rendering, game activity, and whatnot. Essentially, the library project has a class GameMain which has a background image, an array of drawables, and a few functions (the most important is a run() function). The projects that use this library extend this class with their own unique run() function. The idea is that games that use the engine start with their own activity, launch the GameActivity from the library, and pass their unique GameMain child object into the library, which should run the unique run() method thanks to polymorphism.</p><p>Getting this to work, however, has been a struggle. I originally attempted to make the GameMain Serializable, which didn't appear to work. I'm now attempting to make it a Parcelable, but it does not appear to run the child objects run() function when called from the library. I'm wondering, are Parcelable objects actually capable of sending Object methods across activities? Am I going about this the wrong way, or am I just having some other weird bug I have not uncovered?</p>","408424","","","","","2010-08-29 09:25:04","Sending an Object to a library class in Android","<android><parcelable>","1","0","","",""
"3592717","1","3645048","","2010-08-28 22:20:32","69","64518","<p>Does anyone know of a complete choose file dialog? Maybe one where you can filter out all files except for ones with specific extensions? The internet needs such an example. I have not found anything lightweight enough to implement easily into on of my projects. The only other options seem to being using OI FileManger's open intents, but that requires the user already having the file manager installed. </p><p>I would be extremely grateful if someone could point out a Dialog that would allow the user to browse folders and select a file, and return the path.</p>","325081","","8002","","2011-06-29 03:16:17","2013-10-29 20:50:49","Choose File Dialog","<android><file><user-interface><dialog><code-snippets>","6","5","42","2013-10-29 21:19:17",""
"3592745","1","10895903","","2010-08-28 22:30:51","4","1153","<p>I am trying to programmatically open an individual email in the Gmail app on Android.</p><p>I know it can be done because the built-in notifications send you to a message when you click on them and there's an app on the market called Gmail Notifier which does it as well.</p><p>What I've tried so far:</p><p>-send an ACTION_VIEW intent with the message URI as data (failed - cannot resolve URI)</p><p>-send an intent to open HtmlConversationActivity in the Gmail package (failed - ""requires permission: null"")</p><p>Would it help to add flags or a category to the intent? If so, which one(s)?</p><p>I know that the Gmail app is not well-documented, but it drives me mad that there is definitely a way to do it and I just can't figure it out!</p><p>P.S.: This is the first time I'm posting on stackoverflow, so I apologise in advance if I have ignored any conventions.</p>","433878","","","","","2012-09-13 16:54:12","How to open a particular message/conversation in the Gmail app","<android>","2","0","2","",""
"3592780","1","5295522","","2010-08-28 22:40:41","50","31704","<p>I'm attempting to change the background color of an Android <code>TextView</code> widget when the user touches it. I've created a selector for that purpose, which is stored in <code>res/color/selector.xml</code> and roughly looks like that:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item        android:state_pressed=""true""        android:color=""@color/semitransparent_white""        /&gt;    &lt;item        android:color=""@color/transparent""        /&gt;&lt;/selector&gt;</code></pre><p>The <code>clickable</code> attribute of the <code>TextView</code> is <strong><code>true</code></strong>, in case that's of interest.</p><p>When I assign this selector to a <code>TextView</code> as <code>android:background=""@color/selector""</code>, I'm getting the following exception at runtime:</p><blockquote>  <p>ERROR/AndroidRuntime(13130): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #6:  tag requires a 'drawable' attribute or child tag defining a drawable</p></blockquote><p>When I change the attribute to drawable, it works, but the result is looking completely wrong because the IDs appear to be interpreted as image references instead of color references (as the ""drawable"" suggests).</p><p>What confuses me is that I can set a color reference, e.g. ""@color/black"", as the background attribute directly. This is working as expected. Using selectors doesn't work.</p><p>I can also use the selector as the <code>textColor</code> without problems.</p><p>What's the correct way to apply a background-color-selector to a <code>TextView</code> in Android?</p>","74890","","238722","","2013-05-01 17:01:50","2014-01-03 19:08:55","Selector on background color of TextView","<android>","4","3","23","",""
"3592836","1","3592898","","2010-08-28 23:00:47","5","7805","<p>My app has .txt files in subdirectories in the assets folder. It reads those .txt files and puts them in a textview. It's working great and no problems.</p><p>Should I be concerned about the files in the assets folder getting deleted by the user or missing. If this ever could happen, my app would get an error because the file would not be there when it tried to read it into the stream.</p><p>Is there a need for me to check the existence of an asset file before I read it or does the asset manager take care of it all? I also was wondering if there's a chance that a user would or could delete and asset file.</p><p>Like I say, everything works fine without me inserting code to check for file existence. I just wondered if people use the .exists() statement every time they go to read in a stream from assets.</p>","237863","","","","","2012-03-16 09:29:54","Check for file existence in androids assets folder?","<android>","4","0","1","",""
"3592853","1","5934890","","2010-08-28 23:07:35","4","3295","<p>I keep trying to use wildcards in a search in an android app, and keep running into errors. </p><p>I'm performing a search on my application using the string below:</p><pre><code>Cursor c_name = b.query(""namedrxns"", new String[] { ""_id"", ""name"" },              ""name LIKE %?%"", new String[] { query }, null, null, null);</code></pre><p>when I use <code>name LIKE %?%</code> or <code>name=%?%</code> I get a ""near ""%"": syntax error: , while compiling: SELECT _id, name FROM namedrxns WHERE name=%?%"" error.</p><p>but with <code>name LIKE '%?%'</code> or <code>name='%?%'</code> I get instead ""bind or column index out of range: handle 0x40cb70""</p><p>Could someone please tell me what I'm doing wrong?</p><p>Thanks!</p>","428665","","","","","2013-08-16 13:50:40","Wildcard not working in SQLite","<android><database><sqlite>","2","3","","",""
"3592941","1","3593008","","2010-08-28 23:42:07","0","101","<p>It's not an AlertDialog or a notification, but that gray message at the bottom that for instance appears when an application is granted super-user permissions.</p><p>I'd like to use it, but haven't got a clue what it's called. xD</p><p>Thanks.</p>","433979","","126562","","2010-08-29 00:01:58","2010-08-29 00:08:02","What's that message/notification called?","<android><notifications><messages>","1","0","","",""
"3593028","1","4093284","","2010-08-29 00:17:34","1","936","<p>Quick note: I'm using the SoundPool class</p><p><a href=""http://developer.android.com/reference/android/media/SoundPool.html"" rel=""nofollow"">http://developer.android.com/reference/android/media/SoundPool.html</a></p><p>What I have here is a simple button that plays a looped sound while it's pressed. It works great. However, <code>sounds.autoPause();</code> wasn't introduced until API 8 and I really need something that is cupcake compatible (API 3) So i was going through the dev reference site filtered by API 3 stuff and i saw pause so i figured i'd try <code>sounds.pause(sound);</code> but it doesn't stop the sound when i release it.(Maybe i'm just using it wrong?) Does anyone know of a cupcake friendly way to stop this sound? thanks!</p><p>edit: also tried <code>sounds.stop(sound);</code> that didn't work either.</p><p>The Code:</p><p>My onCreate:</p><pre><code>sounds = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);sound = sounds.load(this.getApplicationContext(), R.raw.red_long_one, 1);</code></pre><p>Then here's my touch event</p><pre><code>@Override public boolean onTouch(View arg0, MotionEvent event) {            switch (event.getAction() ) {             case MotionEvent.ACTION_DOWN:                 System.out.println(""touch"");                sounds.play(sound, 1, 1, 1, -1, 1);                break;            case MotionEvent.ACTION_UP:                System.out.println(""up"");                //autoPause does not work on anything lower than sdk8                sounds.autoPause();                break;             }            return false;        }</code></pre><p>I don't understand why <code>sounds.stop(sound);</code> doesn't seem to work, that seems to but what any article i read recommends to do</p><p>I think it's worth noting that if i use <code>sounds.stop(sound);</code> it works ONE time then after that it won't stop after i let go. but the first press and release it works as intended.</p><p>Now, I know on the andoird site it says streamID and not soundID but i have no idea how to get the streamID</p>","393373","","","","","2010-11-04 02:01:16","Cupcake(API3) friendly way to pause/stop sound loops in SoundPool? Any ideas?","<java><android><loops><android-1.5-cupcake><soundpool>","1","0","1","",""
"3593037","1","3593244","","2010-08-29 00:21:37","6","10131","<p>Any idea on implementing a multi-select (check boxes) ListPreference on Android?</p><p>Would I have to extend the ListPreference?<br>Is there any classes already documented to do this?</p><p>Thanks</p>","398148","","","","","2014-01-08 10:38:55","Multi select ListPreference on android","<android><android-preferences><listpreference>","5","0","4","",""
"3593120","1","","","2010-08-29 01:00:12","0","188","<p>I'm trying to customize my buttons in my view a bit and give them my own look. Whenever I set a picture as a background so that the button looks different though, I seem to lose my cursor. I can use my trackball to go through the items still but when I come to one of my custom buttons the cursor does not show. I have the same problem with some TextViews that I made clickable. Any ideas?</p><p>(this is a button which i am trying to give a custom look by giving it a background. when i give it a background though, the cursor does not show when it is over it.)</p>","288437","","","","","2010-08-29 01:41:42","Button with background, no cursor","<android><button>","1","0","","",""
"3593163","1","","","2010-08-29 01:20:26","0","168","<p>Alright, I would like to make a class that can kinda make working with Content Providers a little easier, especially while working with contacts. I have something of a base layout, but its erroring out when I try to initiate cr.  How would I be able to get something like this working?</p><p>Also, how does it look in general? From a design and efficiency perspective, as well as being an easy to use utility, would this be a good way to go about doing what I'd like to achieve?</p><pre><code>public class ContactUtils {    private Uri uri = ContactsContract.Contacts.CONTENT_URI;    private ContentResolver cr = new ContentResolver(this);    public String getDisplayName(int id) {        String name = null;        String[] projection = new String[] {ContactsContract.Contacts.DISPLAY_NAME};        String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "" = '"" + (""1"") + ""'"";        Cursor contact = cr.query(this.uri, projection, selection, null, null);        while (contact.moveToFirst()) {            name = contact.getString(contact.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));        }        return name;    }}</code></pre>","362857","","","","","2010-08-29 01:42:40","Help Creating a ContactsUtils class","<android>","1","2","","",""
"3593214","1","","","2010-08-29 01:42:51","0","957","<p>I'm using data to build elements of a <code>ViewGroup</code>.  The <code>ViewGroup</code> are <code>LinearLayouts</code>, except the leaves, which are <code>TextViews</code>.  Because Data draws the hierarchy, I inflate the <code>LinearLayouts</code> and <code>TextViews</code> from individual XML files programatically on the fly.</p><p><strong>My Problem:</strong>When I create a <code>LinearLayout</code> with the attribute <code>wrap_content</code>, then inflate a <code>TextView</code> or other <code>LinearLayout</code> into it, I can't get the parents (or enough of them, anyway) to redraw, respecting the new view.  These <code>LinearLayouts</code> always seem to come out at 0 size, because when they are first created (before their children are inflated), they wrap around nothing.</p><p>I've tried calling some stock methods of <code>ViewGroup</code> but nothing seems to work.</p>","430609","","119895","","2010-08-29 12:12:59","2010-08-29 15:05:12","Unable to Add a subview to a LinearLayout with ""Wrap_Content""","<android><android-layout><android-ui><android-linearlayout>","1","1","","",""
"3593269","1","3593373","","2010-08-29 02:06:02","1","465","<p>I wish to generate a QR image so people can scan to visit my Android market.</p><p>However, I need to specify a search param like:   market://search?q=MyStringHere</p>","172861","","","","","2010-08-29 08:21:33","Android Generate QR Scan image","<android>","3","0","1","",""
"3593374","1","3647037","","2010-08-29 03:05:53","5","1601","<p>I have a static library that contains some JNICALL functions, i.e. they are expected to be called from the JVM and are never referenced by the shared library that links the static library.</p><p>However, it seems like function stripping is exterminating the JNICALL function (it's not visible in arm-eabi-objdump -t). I'm working around it by adding a dummy function with an impossible condition that calls the JNICALL function, but that's dirty. I know that there is a link option to prevent certain modules from getting their unused data stripped, but what is it? And how do I specify that option in the .mk file? I didn't see anything immediately obvious in arm-eabi-ld.</p><p>Incidentally, the function stripping doesn't strip out JNICALL functions in the shared library itself, but it will remove those from the static library that the shared library is linking. What's the reason for that?</p>","345717","","","","","2010-09-05 17:37:27","How do I prevent certain functions from getting stripped?","<android><android-ndk>","2","2","1","",""
"3593420","1","6081365","","2010-08-29 03:40:13","321","233176","<p>The hard drive on my laptop just crashed and I lost all the source code for an app that I have been working on for the past two months.All I have is the APK file that is stored in my email from when I sent it to a friend. </p><p>Is there any way to extract my source code from this APK file?</p>","426041","","1864167","","2014-04-04 16:20:52","2014-04-04 16:20:52","Is there a way to get the source code from an APK file?","<android><android-resources><decompiling><apk>","11","4","330","2014-04-05 06:06:23",""
"3593504","1","","","2010-08-29 04:21:29","3","434","<p>I'm developing one of my first Android apps. I come from an ASP.NET world where it's trivial to have separate Web.config files for dev, test, and production. Does anyone have a good, automated way of doing this for Android via Eclipse?</p>","434057","","","","","2010-08-29 04:25:31","How do I maintain separate production settings for my Android apps?","<android><configuration>","1","2","","",""
"3593708","1","","","2010-08-29 05:52:22","0","321","<p>I have a ListView that I am populating with LinearLayouts that contain one CheckBox apiece.  The LinearLayout's are added dynamically for each object I am returning from a web service I have.I need for a user to be able to click a done button and for the application to go through the list of CheckBox's and update a database for each checked item.  The database and the done button were a piece of cake, but obtaining a reference to or making a copy, how ever you choose to look at it, of the CheckBox thus far has stumped me for days.</p><p>my code as of now for this process looks something like this:</p><p>private ListView List = (ListView)findViewById(R.id.list);</p><p>LinearLayout temp;CheckBox curr;</p><p>for ( int i = 0; i&lt; List.getChildCount(); i++) {   temp = (LinearLayout)List.getChildAt(i);   curr = (CheckBox)temp.getChildAt(1);   if ( curr.isChecked() ) {      //do stuff here   }}</p><p>as soon as I try and reference either the temp object or the curr object the program crashes.  So in the above code it crashes at curr.isChecked().  I discovered previously that if you forget that the CheckBox is wrapped in a LinearLayout and try to copy a LinearLayout object to a CheckBox object the program crashes, so I know the system sees the correct object to copy, even at the curr copy... however if i try to log the temp class type like thisLog.d(""temp Class type"", temp.getClass().toString());the system crashes</p><p>However the following works perfectly fine...Log.d(""List Class type"", List.getChildAt(i).getClass().toString());</p><p>The only thing I can come up with at this point is that I need to overload a copy construct somewhere, but I can not find anything that advises you on how to begin this or what the copy function might be called.  Even google code searches have proved fruitless for me...</p><p>I have a feeling this is just something I am looking at completely 180 degrees the wrong way and it is going to be ridiculously simple, but if there were a way to rip the emulator off the screen and throw it through the wall I would have done it by now, please help!</p><p>-David</p><p>...and thanks in advance.</p>","434086","","","","","2010-08-29 06:34:03","copying view objects","<android>","1","0","","",""
"3594083","1","","","2010-08-29 08:30:59","4","1184","<p>How do I get index of first/last visible group in an ExpandableListView?</p><p>getFirstVisiblePosition() and getLastVisiblePosition() are mostly useless for ExpandableListViews, because they return the index of the first/last visible <em>cell</em> in the list. Which makes a difference because expanded groups count as multiple cells.</p><p>What I do need is either some methods like getFirstVisibleGroupIndex(), getLastVisibleGroupIndex() or some method to convert the ""visible cell index"" value from the methods above to a real group(+child) index value.</p><p>Note: OnScrollListener.onScroll(..., int firstVisibleItem, int visibleItemCount, ...) suffers from the same problem if the listener is set on an ExpandableListView.</p>","364933","","","","","2014-02-04 11:14:12","How do I get index of first/last visible group in an ExpandableListView?","<android>","2","0","1","",""
"3594241","1","3594250","","2010-08-29 09:36:49","1","1766","<p>How would you fill in a form on a webpage (not under my control) in an Android program?</p><p>I want to write a little android program to automate interacting with a website that someone else has written and I can't change. It has no published API. So the process is:</p><ol><li>Fetch the web page with a form on it (eg a login page)</li><li>Parse it (eg find the username, password box on the page)</li><li>Do some processing (eg fetch a username and password from a database)</li><li>Submit the form back and get the result (eg simulate the user hitting login)</li><li>Repeat ...</li></ol><p>It is step 4 I'd like the help with. If I wasn't using Android I'd use a library library like libcurl (for python) or apache httpclient (for normal java), or I'd do some DOM interaction with a webbrowser. What would you recommend doing for android? Is there something built into the standard libraries you'd recommend?</p><p>I'm a pretty experienced Java programmer but all I've written in Android is hello world, if that affects your answer.</p>","5346","","5346","","2010-08-29 10:03:19","2010-08-29 10:03:19","How can I fill in a form on a web page in Android?","<android><form-submit>","1","2","3","",""
"3594331","1","3594562","","2010-08-29 10:14:56","2","2617","<p>I want to show multiple lines with different text styles for each item in a list using AlertDialog, but can't fine any example.</p><p>Does anyone know how to customize the items of an AlertDialog? Or do I really have to create an Activity with a ListView for this?</p>","424478","","","","","2013-06-21 13:30:11","How to customize the list items in an Android AlertDialog","<android><list><customization><alertdialog>","2","0","1","",""
"3594443","1","3594463","","2010-08-29 10:59:15","1","132","<p>I developed a android appli.It's a widget.and I wanna get information whether the display locked or not.How can I do?</p>","76509","","","","","2010-08-29 13:00:47","Can I get information when locked in a Android App","<android>","1","1","","",""
"3594499","1","","","2010-08-29 11:17:08","0","108","<p>I want to send a recorded audio file from an android phone to a website. No wires are to be used, this has to be  done in the phone. How can I achieve this? What APIs should I use?</p>","434183","","","","","2010-08-29 11:55:35","Transfering audio files from android phone to a website","<android>","1","0","","",""
"3594532","1","","","2010-08-29 11:28:59","11","21265","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4545079/lock-the-android-device-programatically"">Lock the android device programatically</a>  </p></blockquote><p>How can I programmatically lock the screen in Android?</p>","298368","","488657","","2012-10-13 21:31:13","2012-10-13 21:31:13","How to programmaticaly lock screen in Android?","<java><android><lockscreen>","2","0","7","2011-09-29 10:51:28",""
"3594659","1","3594700","","2010-08-29 12:11:53","2","305","<p>I made an application that uses a <code>ListAdapter</code> to display some items. In my <code>getView</code> method I use <code>LinearLayout#setPadding()</code> to define the indention of each view depending of some object specific states.</p><p>This worked fine in Android 1.5. Last week I decided to move to 1.6 since it's better suitable for different screen sizes. It all worked fine, but the <code>ListAdapter</code> looks really weird now. The padding isn't working correctly anymore.</p><p>Does anybody know if there is a difference in the <code>ListAdapter</code> or <code>setPadding</code> implementation between Android 1.5 and Android 1.6?</p><p>===EDIT: Code added===</p><pre><code>@Override        public View getView(int position, View convertView, ViewGroup parent) {            TextView text = (TextView) View.inflate(lexs, R.layout.law_list_book_view, null);            if (items.get(position) instanceof Chapter) {                LinearLayout chapterView = new LinearLayout(lexs);                chapterView.setOrientation(LinearLayout.HORIZONTAL);                chapterView.setGravity(Gravity.CENTER);                ImageView img = new ImageView(lexs);                img.setPadding(0, 0, 5, 0);                chapterView.addView(img);                chapterView.addView(text);                text.setTextColor(Color.BLACK);                text.setText((CharSequence) items.get(position).getName() + "": "" + ((Chapter) items.get(position)).getTitle());                text.setMinWidth(320);                switch (((Chapter) items.get(position)).getLevel()) {                    case 0:                        text.setTextColor(Color.rgb(0, 0, 0));                        break;                    case 1:                        text.setTextColor(Color.rgb(50, 50, 50));                        chapterView.setPadding(10, 0, 0, 0);                        break;                    case 2:                        text.setTextColor(Color.rgb(100, 100, 100));                        chapterView.setPadding(20, 0, 0, 0);                        break;                    case 3:                        text.setTextColor(Color.rgb(150, 150, 150));                        chapterView.setPadding(30, 0, 0, 0);                        break;                    case 4:                        text.setTextColor(Color.rgb(175, 175, 175));                        chapterView.setPadding(40, 0, 0, 0);                        break;                    default:                        text.setTextColor(Color.rgb(200, 200, 200));                        chapterView.setPadding(50, 0, 0, 0);                        break;                }                if (((Chapter) items.get(position)).isExpanded()) {                    img.setImageResource(R.drawable.minus);                } else {                    img.setImageResource(R.drawable.plus);                }                if (((Chapter) items.get(position)).isSearched()) {                    text.setBackgroundColor(Color.MAGENTA);                }                text.setTextSize(15);                return chapterView;            } else {                LinearLayout paragraphView = new LinearLayout(lexs);                paragraphView.setOrientation(LinearLayout.HORIZONTAL);                paragraphView.setGravity(Gravity.CENTER);                paragraphView.setPadding( (((Chapter) ((Paragraph) items.get(position)).getRoot()).getLevel() * 10) + 15 + 8 , 0, 0, 0);                DisplayMetrics metrics = new DisplayMetrics();                lexs.getWindowManager().getDefaultDisplay().getMetrics(metrics);                ImageView paragraphImg = new ImageView(lexs);                paragraphImg.setImageResource(R.drawable.paragraph);                paragraphView.addView(paragraphImg);                LinearLayout textLayer = new LinearLayout(lexs);                textLayer.setGravity(Gravity.LEFT);                textLayer.setMinimumWidth(metrics.widthPixels / 2);                text.setTextColor(Color.BLACK);                textLayer.addView(text);                textLayer.setOnClickListener(new BookViewOnClickListener(position));                paragraphView.addView(textLayer);                text.setText(""Artikel "" + (CharSequence) items.get(position).getName());                LinearLayout buttonLayer = new LinearLayout(lexs);                buttonLayer.setGravity(Gravity.RIGHT);                ImageButton mark = new ImageButton(lexs);                if (WorkspaceView.createView(lexs).isFavorite((Paragraph) items.get(position))) {                    mark.setBackgroundResource(R.drawable.article_not_favorite);                } else {                    mark.setBackgroundResource(R.drawable.article_favorit);                }                mark.setOnClickListener(new BookViewOnClickListener(position));                buttonLayer.addView(mark);                buttonLayer.setPadding(0, 0, 10, 0);                buttonLayer.setMinimumWidth(metrics.widthPixels / 2);                paragraphView.addView(buttonLayer);                text.setTextSize(15);                if (((Paragraph) items.elementAt(position)).isSearched()) {                    text.setBackgroundColor(Color.RED);                }                return paragraphView;            }         }</code></pre><p>===EDIT 2: Screenshot added===</p><p><img src=""http://i.stack.imgur.com/bTiPe.png"" alt=""alt text""></p><p>I know that this elements of the list are all level 0 elements and should therefore have no padding (I used logcat to verify the level of the elements. they are all 0). the level of the elements i use in the switch case to check the padding (see code)</p>","","anon","","anon","2010-08-29 17:25:19","2010-08-29 17:25:19","ListAdapter in Android 1.5 and 1.6: are there any differences?","<java><android>","2","1","","",""
"3594721","1","","","2010-08-29 12:29:20","1","1299","<p>Hii,</p><p>I want to make a simple live wallpaper using OpenGL in Android that will draw the textures.</p><p>I have develop a simple OpenGL Activity that can work exactly for live wallpaper. But some problems are there like IllegleArgumentException. </p><p>I am using GLWallpaperService from earth live wallpaper.</p><p>Thanks....</p>","434652","","19750","","2011-03-31 15:41:38","2013-03-18 19:31:21","drawing textures on live wallpaper using OpenGL in android","<android><opengl-es><live-wallpaper>","2","0","","",""
"3594779","1","5046612","","2010-08-29 12:44:42","1","408","<p>I need to synchronise two AnimationDrawables (using frame animations setup in xml). The developer article on AnimationDrawable speaks of no such thing, so I would like to know if it's even possible, and if not, how I could get the same effect using a different object perhaps? The two drawable objects are the same size and have the same number of frames, with the same duration between each frame.</p>","250286","","","","","2011-02-18 21:10:47","Possible to synchronise AnimationDrawables in Android?","<android><animation><synchronization>","1","1","","",""
"3594888","1","","","2010-08-29 13:17:12","1","832","<p>I'm trying to parse ugly HTML with TagSoup to extract value of a given tag.Here is the tag :</p><pre><code>&lt;input type=""hidden"" name=""hash_check"" value=""ffc39410ed8da309408a9382450ddc85"" /&gt;</code></pre><p>I want to retrieve value of attribute ""value"" (""ffc39410ed8da309408a9382450ddc85"")</p><p>And here is my code, in my SAX handler :</p><pre><code>public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException{    if (localName.equals(""input""))    {        Log.v(TAG, Integer.toString(atts.getLength()));        if (atts.getValue(""name"").equals(""hash_check"")        {            in_input = true;            Log.v(TAG, atts.getValue(""name""));            if (atts.getValue(""value"") != null)                Log.v(TAG,atts.getValue(""value"");        }    }}</code></pre><p>Logs are here for debugging purposes. Logcat correctly gives me ""hash_check"" for atts.getValue(""name""), but an empty string for atts.getValue(""value"") although the parser is positionned to the right ""input"" (the one and only of my html document).</p><p>What's wrong ? Bug in TagSoup ?</p><p>Thanks</p><p>edit @bkail : thank you for your comment. Here are more details and code.</p><p>First, the URL that I'm trying to parse : <a href=""http://forum.hardware.fr/hfr/Programmation/Divers-6/experts-puissant-internet-sujet_37483_1.htm"" rel=""nofollow"">http://forum.hardware.fr/hfr/Programmation/Divers-6/experts-puissant-internet-sujet_37483_1.htm</a></p><p>And the code used to instanciate the parser :</p><pre><code>private static final String FORUM_URI = ""http://forum.hardware.fr/hfr/Programmation/Divers-6/experts-puissant-internet-sujet_37483_1.htm"";URL hfrUrl = new URL(FORUM_URI);Parser parser = new Parser();HfrSAXHandler sh = new HfrSAXHandler();parser.setContentHandler(sh);parser.parse(new InputSource(hfrUrl.openStream()));</code></pre><p>And finally, the whole code for my SAX parser :</p><pre><code>public class HfrSAXHandler extends DefaultHandler{    private boolean in_input = false;    private static final String TAG = ""hfr4droid"";    @Override    public void startDocument() throws SAXException    {        Log.v(TAG, ""start of parsing"");    }    @Override    public void endDocument() throws SAXException    {    }    @Override    public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException    {        if (localName.equals(""input""))        {            Log.v(TAG, Integer.toString(atts.getLength()));            if (atts.getValue(""name"") != null)            {                in_input = true;                Log.v(TAG, atts.getValue(""name""));                if (atts.getValue(""value"") != null)                    Log.v(TAG, Integer.toString(atts.getValue(""value"")));            }        }    }    @Override    public void endElement(String namespaceURI, String localName, String qName) throws SAXException    {        if (localName.equals(""input""))            in_input = false;    }}</code></pre><p>Thanks for giving it a try.</p>","278060","","278060","","2010-08-30 08:04:43","2010-08-30 08:04:43","Parsing XML with TagSoup : bug with long attributes?","<java><android><tag-soup>","0","2","","",""
"3594914","1","4762518","","2010-08-29 13:24:24","1","761","<p>I'm trying to refresh a ListView onReceive of a BroadcastReceiver. Within my main activitiy, which contains the ListView I'm talking about, I'm registering a receiver:</p><pre><code>private final BroadcastReceiver smsIntentReceiver = new BroadcastReceiver() {      @Override      public void onReceive(Context context, Intent intent) {        String mAction = intent.getAction();        if(mAction.equals(INCOMING_SMS_ACTION)) {            Log.v(runtimeVars.getMyName(), ""reloading conversation list"");            curConversation = managedQuery(conversationURI, null, null, null, ""date DESC"");            conversationAdapter = null;            listConversations();        }    }};</code></pre><p>listConversations() looks like that</p><pre><code>private void listConversations() {    Uri smsURI;    Uri personURI;    Cursor curSms;    Cursor curPerson;    long personID;    curConversation = managedQuery(conversationURI, null, null, null, ""date DESC"");    conversationArrayList = new ArrayList&lt;ConversationListObj&gt;();    this.conversationAdapter = new ConversationListAdapter(this, R.layout.conversationlist_item, conversationArrayList);    setListAdapter(this.conversationAdapter);    Log.v(runtimeVars.getMyName(), ""listConversations"");    startManagingCursor(curConversation);    for(curConversation.moveToFirst(); !curConversation.isAfterLast(); curConversation.moveToNext()) {        smsURI = Uri.parse(""content://sms/conversations/"" + curConversation.getString(curConversation.getColumnIndexOrThrow(""thread_id"")).toString());        curSms = managedQuery(smsURI, null, null, null, null);        conversationArrayList = new ArrayList&lt;ConversationListObj&gt;();        ConversationListObj newListObj = new ConversationListObj();        newListObj.setThreadID(curConversation.getString(curConversation.getColumnIndexOrThrow(""thread_id"")).toString());        if (curSms.moveToFirst()) {            personURI = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(curSms.getString(curSms.getColumnIndex(""address""))));            curPerson = managedQuery(personURI, new String[] {ContactsContract.PhoneLookup.DISPLAY_NAME, ContactsContract.PhoneLookup._ID}, null, null, null);            startManagingCursor(curPerson);            if(curPerson.moveToFirst()) {                personID = Long.parseLong(curPerson.getString(curPerson.getColumnIndex(ContactsContract.PhoneLookup._ID)));                Bitmap contactPicture = generalMethods.loadContactPhoto(getContentResolver(), personID);                if (contactPicture != null)                    newListObj.setSenderPicture(contactPicture);                else {                          InputStream input = this.getResources().openRawResource(R.drawable.person_dummy);                    newListObj.setSenderPicture(BitmapFactory.decodeStream(input));                }                newListObj.setSenderName(curPerson.getString(curPerson.getColumnIndex(ContactsContract.PhoneLookup.DISPLAY_NAME)));            }            else {                newListObj.setSenderName(curSms.getString(curSms.getColumnIndex(""address"")));            }            newListObj.setMessagePart(curConversation.getString(curConversation.getColumnIndexOrThrow(""snippet"")).toString());            conversationArrayList.add(newListObj);            notifyConversationAdapter();        }    }    curConversation.close();}</code></pre><p>Now, whenever I receive an SMS it seems as if my BroadcastReceiver was too fast. The new text message won't show up until I restart my app. So I basically think I made a design mistake, but how would it be correct? Looking at the logfile tells me</p><pre><code>08-29 13:08:44.351: VERBOSE/SotapannaSMS(704): reloading conversation list08-29 13:08:45.091: VERBOSE/SotapannaSMS(704): listConversations08-29 13:08:45.921: VERBOSE/Telephony(171): getOrCreateThreadId uri: content://mms-sms/threadID?recipient=555608-29 13:08:46.081: INFO/NotificationService(59): enqueueToast pkg=info.SotapannaSMS.messaging callback=android.app.ITransientNotification$Stub$Proxy@43dbff88 duration=008-29 13:08:46.571: VERBOSE/Telephony(171): getOrCreateThreadId cursor cnt: 1</code></pre><p>The new text message seems not to be within this conversation until I restart the app. I even tried to let my app sleep for 3 seconds to see if just waiting a bit would work, but that ended up in the same result.</p><p>What am I missing?</p>","419501","","","Roger Pate","2010-08-30 06:57:46","2013-01-22 06:51:09","Refreshing ListView in Android after receipt of an SMS doesn't work","<android><listview>","1","2","","",""
"3594917","1","3595125","","2010-08-29 13:25:04","0","2096","<p>I'm still trying to implement a search function into my Android app. So far it's going ok, although currently the search can only query one table and display the results for this table (its a ListView using SimpleCursorAdapter).</p><p>What I want is to be able to search multiple tables, but I'm not sure how to get this all into one cursor or extend the SimpleCursorAdapter to implement multiple cursors. I see there is a class called CursorJoiner, but I'm not sure what I need to do with it.</p><p>Thanks!</p><p>I have tried to make a custom cursor[] adapter, but this doesn't return anything and my search results are blank- can anyone help?</p><pre><code>public class SearchCursorAdapter extends SimpleCursorAdapter {private int currentCursor;private int curPosition = 0;private int total = 0;private Cursor[] curs = null;private Context cont;public SearchCursorAdapter(Context context, int layout, Cursor c,        String[] from, int[] to) {    super(context, layout, c, from, to);    total = c.getCount();}public SearchCursorAdapter(Context context, int layout, Cursor[] c,        String[] from, int[] to) {    super(context, layout, null, from, to);    int l = c.length;    for (int i = 0; i &lt; l; i++) {        total += c[i].getCount();    }    curs = c;    currentCursor = 0;    cont = context;}@Overridepublic View getView(int position, View view, ViewGroup parent) {    if (currentCursor == curs.length)        return null;    if (curs == null) {        //normal shiz    }    else {        Cursor c = curs[currentCursor];        c.moveToPosition(curPosition);        if (c.isAfterLast()) {            currentCursor++;            c = curs[currentCursor];            curPosition = 0;            c.moveToPosition(curPosition);        }        if (view == null) {            LayoutInflater vi = (LayoutInflater)parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);            view = vi.inflate(R.layout.search_row, null);        }        TextView t1 = (TextView)view.findViewById(R.id.rowitem_text1);        TextView t2 = (TextView)view.findViewById(R.id.rowitem_text2);        t1.setText(c.getString(1));        t2.setText(""Testing"");        curPosition++;    }    return view;</code></pre><p>just noticed that it's not actually the adapter returning nothing, there's something wrong with my searchactivity...</p>","428665","","428665","","2010-08-29 14:49:55","2010-08-29 14:49:55","Search requires data from multiple cursors/tables","<android><sqlite><search><cursor>","1","0","1","",""
"3594982","1","","","2010-08-29 13:44:44","1","359","<p>if I write a new text message in the Android standard sms app and fill in a receiver and some body text and press the back button Android will save this as a draft. If the receiver is currently in my address book Android tells me also in the draft overview the name or, if the receiver is not in the address book, the number.So far, so good.</p><p>Now I tried to do exactly the same thing on my own and I'm not quite sure why my solution doesn't work.I've tried the following:</p><pre><code>// in a Activityfinal ContentResolver resolver = getContentResolver();Cursor cursor = resolver.query(Uri.parse(""content://sms/draft""),    String[] {""_id"", ""date"", ""body"", ""person""},    null, null, null);</code></pre><p>Later in my own cursor-Adapter I tried to get the person-id which links to the contacts table (I thought so). I do it this way:</p><pre><code>// in my own CursorAdapter (bindView-Method)Long receiverId = cursor.getLong(""person"");</code></pre><p>But what I get is always ""0"". So what do I do wrong? Thanks in advance.</p><p>Btw: Is there any official documentation about the ""content://sms""-thing? I only found some forum postings but nothing at developers.android.com!?</p>","434227","","","","","2010-08-29 13:44:44","Android: How to link sms draft with information about the receiver (like the name)?","<android>","0","2","","",""
"3595013","1","3595028","","2010-08-29 13:56:08","0","361","<p>this is driving me nuts and causing me to pull so much hair, I actually ran out of hair and started hurting random people.</p><p>I have a UI design in which the WebView is supposed to be to the north, vertically of course, and a bar or line of buttons at the south. So the majority of the design is the WebView, and at the bottom some of the buttons.</p><p>The webview is used to load some images from the world wide holy web, and it seems since the images are quite wide and long, the webview just completely swallows the buttons at the bottom, so the design only shows the Webview and none of the buttons at the bottom bar.</p><p>I have tried many many things, from nested LinearLayouts to TableLayouts and TableRows.</p><p>All suggestions are welcome!</p>","223876","","","","","2010-08-29 14:01:16","Android WebView completely disrespecting UI layout","<java><android><webkit><webview>","1","0","","",""
"3595041","1","","","2010-08-29 14:04:08","1","1005","<p>On my application I'm developing, the main.xml layout (the default layout of my app) has a few buttons that have been assigned onClickListeners (not the implementation way).</p><p>One of those buttons I want to have the ability to take you to another view. On the other view (preview.xml), there's another button that takes you back to the main.xml view.</p><p>I've used setContentView in the onClickListeners of those buttons and this works fine so far, but after you click the button that takes you back to main.xml, the buttons on main.xml have lost their onClick functionalities.</p><p>How can I get this to work right? I presume using setContentView isn't the right way to do this.</p>","427234","","496830","","2011-03-14 21:07:04","2011-03-14 21:07:04","Android Development: Switching between Views without losing onClickListeners","<android><function><layout><button><onclick>","2","1","","",""
"3595064","1","4024028","","2010-08-29 14:11:40","1","1807","<p>Im using ListView to to show some custom data, once data is updated in the adapter i call notifyDatasetChanged(), so the view will get updated, all of this works well, my issue though is i would like to run an animation once only on items that got changed when the adapter was updated. currently i keep a copy of all the changed objects and i tried to animate the correct items through the getView() call.</p><p>However if i do it only once for every getView call then i see no animation most of the time on items that changed. if i continue to do so in successive getView calls i see animation on items that don not change as well and also the ones that changed get animated again and again.</p><p>Im guessing sometimes android calls the getView() for other reasons than showing the generated view immediately, and thats the reason it doesnt work if i do it once.</p><p>What is the correct way to do this?</p><p>Thanks,   Totem.</p>","274180","","","","","2010-10-26 13:17:29","Android ListView animation of views inside the adapter that got updated","<android><animation><listviewitem>","1","0","1","",""
"3595171","1","3625930","","2010-08-29 14:45:00","3","1143","<p>Is it possible to use a hashmap in ArrayAdapter instanciation ?</p><p>my ""regions"" hashmap handles custom ID as keys : <code>Hashmap&lt;ID,Value&gt;</code>.</p><pre><code>vRegions.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, regions));</code></pre><p>the problem here is that <code>ArrayAdapter</code> will call my hashmap's <code>toString()</code> which will print <code>value</code> and discard <code>ID</code>! </p><p>I want to be able to use that ID , is there any way to set it as <code>simple_list_item_1</code>'s <code>ID</code> so i can retreive it later inside onclick event?</p>","311017","","119895","","2010-08-29 14:50:18","2010-09-02 09:52:22","associate custom ID to ListView items","<android><android-listview>","2","0","1","",""
"3595232","1","3595241","","2010-08-29 15:01:48","38","55919","<p>I have created an application and  with an event I manage to add notification in android notification bar.  Now  I need sample how to remove that notification from notification bar on an event ?? </p>","365860","","1109930","","2012-03-07 13:54:43","2014-02-25 05:54:10","Android: remove notification from notification bar","<android><notifications>","3","2","11","",""
"3595329","1","","","2010-08-29 15:27:22","0","238","<p>Installing a simple HelloWorld asks for permission to write to external storage, why? I have not added any request in my manifest? Looking in the logs I see ""I/PackageParser(15463): Implicit adding android.permission.WRITE_EXTERNAL_STORAGE to old pkg"". I am compiling for Android 1.6 and installing on an Sony Ericsson X10. How do I avoid the request since my HelloWorld does not need any of those permissions and any user might be scared away due to shady permissions?</p>","434270","","","","","2010-08-29 15:57:01","Why implicit adding permissions","<android>","1","2","","",""
"3595334","1","3595382","","2010-08-29 15:28:28","0","1333","<p>I've tried to search for similar problems, but can't seem to find it.</p><p>I run:</p><ul><li>Windows 7</li><li>Java SE Developement Kit x64</li><li>Eclipse Helios (downloaded here from Eclipses homepage --> Downloads --> Eclipse IDE for Java EE Developers --> 64 Bit)</li><li>""Android SDK Windows""</li></ul><p>I've been following the guide from the Android Developers homepage.</p><p>I can launch Eclipse just fine. Under Help --> Install New Software ... Here, I give it a name myself (Android Plugin Test), and under location, I've typed ""http://dl-ssl.google.com/android/eclipse"", as said in the link.Then it find Developement Kit, and I install it and all that &amp; restart Eclipse.</p><p>The following are now installed:- Android DDMS- Android Development Tools- Eclipse IDE for Java EE Developers</p><p>So everything seems fine.BUT ..When I go to Window --> Preferences, ""Android"" is missing.I have no problems seeing General, Ant, Data Management etc.</p><p>So my question is, what's the problem ?</p><p>As said, I downloaded Android SDK, but when I try to run the setup, I get this error, about missing Java:</p><p><img src=""http://img827.imageshack.us/img827/600/javaproblem.jpg"" /></p><p>And that's where I'm lost.Because, under installed programs, it says:- Java(TM) SE Developement Kit 6 Update 21 (64-bit)</p><p>And yes, I have restarted after installing Java.</p><p>For some odd reason, it's not possible for to run the SDK setup with any compatibility. It's greyed out(Yes, I'm admin, and I don't have any problems on other programs)</p><p>I checked the Requirements for Android SDK, and it says Windows XP &amp; Vista, but not 7 .. But as far as I know, other people got it to work.</p><p>So .. What am I doing wrong ?Do you have any solutions ?</p><p>If I need to download other Java versions (or anything else), please provide links.</p>","434271","","150771","","2010-08-29 15:31:17","2010-08-29 15:39:33","Can't add Android under Eclipse-plugin on Windows 7 - Not visible","<android><windows-7><eclipse-plugin>","2","1","","",""
"3595348","1","3597121","","2010-08-29 15:33:42","0","221","<p>I'm finding a great many people buy my Android app in the google market and immediately return it for a refund.   That works fine with physical goods, but for virtual goods, they have now acquired the app for free!</p><p>Has anyone else noticed this fatal flaw in the Google Android market for apps?  What other markets are there without this problem?</p><p>Peter</p>","253661","","","","","2010-08-30 00:11:55","Android google market returns","<android><return><google-play>","3","4","","2010-09-02 01:47:21",""
"3595389","1","3595780","","2010-08-29 15:40:18","1","1986","<p>I am using Eclipse to write the program.  I have gotten rid of the errors, and have completely compiled the code and when it launches in the emulator, it forces close. I have zipped the workspace so maybe someone can grab it and load it to see if they are able to see why its bombing out? deckertdesigns.com/Android/Todo_List.zip any help again, would be greatly appreciated. I feel once over this hump I will have some better knowledge in troubleshooting, just wish the debugger was catching this...</p><p>08-29 17:43:45.273: DEBUG/SntpClient(73): request time failed: java.net.SocketException: </p><p>Address family not supported by protocol</p><p>08-29 17:44:41.433: DEBUG/AndroidRuntime(357): >>>>>>>>>>>>>> AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</p><p>08-29 17:44:41.433: DEBUG/AndroidRuntime(357): CheckJNI is ON</p><p>08-29 17:44:41.852: DEBUG/AndroidRuntime(357): --- registering native functions ---</p><p>08-29 17:44:43.293: DEBUG/AndroidRuntime(357): Shutting down VM</p><p>08-29 17:44:43.313: INFO/AndroidRuntime(357): NOTE: attach of thread 'Binder Thread #3' failed</p><p>08-29 17:44:43.323: DEBUG/dalvikvm(357): Debugger has detached; object registry had 1 entries</p><p>08-29 17:44:44.083: DEBUG/AndroidRuntime(365): >>>>>>>>>>>>>> AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</p><p>08-29 17:44:44.083: DEBUG/AndroidRuntime(365): CheckJNI is ON</p><p>08-29 17:44:44.403: DEBUG/AndroidRuntime(365): --- registering native functions ---</p><p>08-29 17:44:45.573: INFO/ActivityManager(73): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.a8a.todolist/.ToDoList }</p><p>08-29 17:44:45.683: DEBUG/AndroidRuntime(365): Shutting down VM</p><p>08-29 17:44:45.713: DEBUG/dalvikvm(365): Debugger has detached; object registry had 1 entries</p><p>08-29 17:44:45.773: INFO/AndroidRuntime(365): NOTE: attach of thread 'Binder Thread #3' failed</p><p>08-29 17:44:45.843: INFO/ActivityManager(73): Start proc com.a8a.todolist for activity com.a8a.todolist/.ToDoList: pid=372 uid=10032 gids={1015}</p><p>08-29 17:44:47.013: DEBUG/AndroidRuntime(372): Shutting down VM</p><p>08-29 17:44:47.013: WARN/dalvikvm(372): threadid=1: thread exiting with uncaught exception (group=0x4001d800)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372): FATAL EXCEPTION: main</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372): android.app.SuperNotCalledException: Activity {com.a8a.todolist/com.a8a.todolist.ToDoList} did not call through to super.onCreate()</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2629)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at android.os.Handler.dispatchMessage(Handler.java:99)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at android.os.Looper.loop(Looper.java:123)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at android.app.ActivityThread.main(ActivityThread.java:4627)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at java.lang.reflect.Method.invokeNative(Native Method)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at java.lang.reflect.Method.invoke(Method.java:521)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)</p><p>08-29 17:44:47.043: ERROR/AndroidRuntime(372):     at dalvik.system.NativeStart.main(Native Method)</p><p>08-29 17:44:47.063: WARN/ActivityManager(73):   Force finishing activity com.a8a.todolist/.ToDoList</p><p>08-29 17:44:47.243: DEBUG/dalvikvm(73): GC_FOR_MALLOC freed 7176 objects / 434168 bytes in 169ms</p><p>08-29 17:44:47.633: WARN/ActivityManager(73): Activity pause timeout for HistoryRecord{43fc9668 com.a8a.todolist/.ToDoList}</p><p>08-29 17:44:53.253: INFO/Process(372): Sending signal. PID: 372 SIG: 9</p><p>08-29 17:44:53.285: INFO/ActivityManager(73): Process com.a8a.todolist (pid 372) has died.</p><p>08-29 17:44:53.323: WARN/InputManagerService(73): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@440687c8</p><p>08-29 17:44:58.383: WARN/ActivityManager(73): Activity destroy timeout for HistoryRecord{43fc9668 com.a8a.todolist/.ToDoList}</p>","433866","","433866","","2010-08-29 18:02:12","2010-08-29 18:09:02","Android - Looking for help with force close on application","<java><android><eclipse><sdk><jdk>","2","0","","",""
"3595401","1","3595587","","2010-08-29 15:43:45","1","252","<p>I finally got my image button to work within an ImageView, and after I press it, it works, but imnmediately after, it stops running and I get the error message to close it.I added the onClick and focused it in the XML so that it will work within an imageview, but that's all I got. The button in the /drawable folder is the imagebutton selector code:<a href=""http://developer.android.com/reference/android/widget/ImageButton.html"" rel=""nofollow"">http://developer.android.com/reference/android/widget/ImageButton.html</a></p><pre><code> &lt;ImageView android:onClick=""true"" android:src=""@drawable/button"" android:focusable=""true"" android:layout_height=""fill_parent""     android:layout_width=""fill_parent"" android:scaleType=""fitStart""</code></pre><p>I have a suspicion that I'm forgetting something....</p>","394842","","","","","2010-08-30 06:33:32","Android - Button Question","<android><eclipse><onclick><imageview><imagebutton>","2","1","","",""
"3595433","1","","","2010-08-29 15:54:22","5","8131","<p>yesterday I posted the question ‘How do I convert eclipse app for phone?’I have used eclipse to design an android app which runs fine on the emulator and I now want to transfer it to my phone. Sixten Otto kindly offered some advice regarding how to test/debug my app on my phone straight from Eclipse's Run menu. (See Developing on a Device from the Android developer site.)</p><ul><li>Step 1, declare application as ‘debuggable’ – done, no problem.</li><li>Step 2, turn on USB debugging on phone – done, no problem.</li><li>Step 3, Setup your system to detect your device – been at this forhours, still no closer to achieving. (And yes I do have the usbdriver in the Android sdk).</li></ul><p>All I want to do is move my very simple app from my computer to my phone, for my own use only. I have Samsung Kies on my PC for file transfer and I have a load of files generated by eclipse. Surely there is a simple way of getting an app from PC to phone. Any help appreciated while I still have some hair left. Thanks.</p>","433906","","194544","","2012-01-30 07:39:18","2012-01-30 07:39:18","Move app to phone","<android><eclipse>","1","0","4","",""
"3595474","1","","","2010-08-29 16:02:27","0","1154","<p>I just want to know how detect that the activity or service has been killed by the advanced task killer? I was expecting the onDestroy method to be called, but it doesnt! </p><p>My app starts the background service on boot. The activity is not started except from menu. But its name appears in the advanced task killer list. When I try to kill it, it doesnt call the onDestroy method neither the service's.</p><p>Any ideas?</p><p>Thanks in advance.</p>","434291","","","","","2010-08-29 16:48:51","Android: How to know activity/service killed by advanced task killer?","<android><service><activity>","1","0","","",""
"3595491","1","","","2010-08-29 16:06:29","10","22507","<p>The Stagefrigh media framework (Android 2.2) supports HTTP progressive streaming.<br>What's that means? I.e. is this an HTTP Live Streaming protocol realization?  </p><p>And how to use HTTP Live Streaming on Android, I mean what's the client - web browser, MediaPlayer or just ""in-SDK"" realization and I have to inherit from some class?  </p>","398233","","406355","","2012-04-05 00:26:56","2012-11-13 22:11:43","Is Android 2.2 HTTP progressive streaming = HTTP Live Streaming?","<android><audio><video-streaming><http-live-streaming>","2","0","19","",""
"3595496","1","3595519","","2010-08-29 16:07:41","3","897","<p>The AutoCompleteTextView drop-down has a large font size. I want to change it to something smaller. I think the way to do it is to overwrite the </p><p><code>android.R.layout.simple_dropdown_item_1line</code>. Please can someone let me know how to do it.</p><p>Thank you.Cheers.</p>","434260","","","","","2010-08-29 16:14:31","Android - Custom AutoCompleteTextView layout","<android><view><spinner>","1","0","1","",""
"3595501","1","","","2010-08-29 16:09:32","0","383","<p>How do I turn Bluetooth on/off in Android SDK 1.6?</p>","413881","","844882","","2012-03-17 21:34:33","2012-03-17 21:34:33","Bluetooth in Android SDK 1.6","<android>","1","4","","",""
"3595532","1","3595539","","2010-08-29 16:19:14","2","2182","<p>I do not see a means to put key words or meta tags on an app when publishing it to the android market. Is there a way to do this?  Such that if one builds an app for the physical therapy industry a PT an search PT. The current search only seems to search the app title. </p>","408112","","","","","2014-01-28 07:26:51","How to put key words or meta tags on app when publishing to android market","<android>","2","0","","",""
"3595556","1","3595947","","2010-08-29 16:27:43","2","345","<p>I am wanting to make a reusable 'landing page' activity similar to like the activity when you first launch the official twitter app, facebook, or google io app, etc.   Reusable is really the key here I would like for the activity to dynamically populate its gridview with the other activities in the application.</p><p>Is it possible to parse through the android manifest file to find my other activities?  If so is it also possible to add my own xml attributes to the manifest file to distinguish which activities should show up in the gridview? </p><p>Or, is there some other way to find all existing activity classes in the package?  Is there a way in java to look for any Class in a package that implements a particular interface?</p><p>edit: here is a screen shot as per request <img src=""http://i.stack.imgur.com/EacvK.png"" alt=""alt text""></p>","384306","","384306","","2010-08-29 16:58:56","2010-08-29 18:07:57","Creating a landing page similar to twitter app and others","<java><android><android-manifest>","3","2","","",""
"3595697","1","3595745","","2010-08-29 17:04:25","0","745","<p>I am having a List View, all the list items(Text) need be to updated from a web service. My application can query the web service to fetch all the list items at one go or can query to fetch one list item at a time.I having following queries1)If i query the web service to fetch all the list items at once, it takes around 15 secs to download and display it in List. User might think the app is not responding.2) If i query the web service for each list item, when the user scroll up or down multiple queries are sent. So i am downloading items which the user might not probably see. if the list is scrolled up.</p><p>Please suggest a good design pattern for such a scenario.</p>","393792","","","","","2010-08-29 17:14:20","List View Design Pattern","<android><listview>","1","0","","",""
"3595705","1","","","2010-08-29 17:05:11","4","2437","<p>I have created an application that sends an email with a recording, When the intent is fired and email is chosen as the app to send the attachment, you can see that there is an attachment but the attachment is not delivered.</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);//Mime type of the attachment (or) u can use sendIntent.setType(""*/*"")sendIntent.setType(""audio/3gp"");//Subject for the message or EmailsendIntent.putExtra(Intent.EXTRA_SUBJECT, ""My Recording"");//Full Path to the attachmentsendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(fileName));//Use a chooser to decide whether email or mmsstartActivity(Intent.createChooser(sendIntent, ""Send email...""));</code></pre><p>Any ideas?</p>","282475","","1765573","","2013-07-19 07:29:46","2013-07-19 07:29:46","Android Email Intent Not Sending Attached File","<android><email><android-intent><attachment>","1","2","1","",""
"3595774","1","","","2010-08-29 17:22:37","0","118","<p>I have a table in XML which has 6 columns and 9 rows. Each cell is filled with exactly one ImageView, forming a 6x9 grid. The images inserted into each ImageView are strictly 48x48 pixels, making the whole thing 288px wide and 432px tall.</p><p>I want to insert a new image which is 96x96 pixels (taking up 2x2 cells), and I want it to automatically fill the neighbouring cells (or look like it does) so the layout is preserved.</p><p>I have been trying to use a combination of ImageView.setVisibility(GONE) on the neighbouring cells to 'delete' them (including their layout) then put the image in the top-left cell which would then size correctly, but am having trouble implementing it. </p><p>I suspect the answer has some combination of fill parent or wrap content, but I can't for the life of me figure it out.</p><p>Any help would be very greatly appreciated.</p>","250286","","","","","2010-08-29 20:17:07","Forcing strict sizes for Android tables","<android><tableview>","1","0","","",""
"3595905","1","3596106","","2010-08-29 17:58:42","1","1166","<p>I want to show a Toast right after the user clicks on a CheckBoxPreference in my PreferenceActivity.</p><pre><code>myCheckBox.setOnPreferenceClickListener(new OnPreferenceClickListener() {            @Override            public boolean onPreferenceClick(Preference preference) {                Toast.makeText(Prefs.this,                        ""test"",                        Toast.LENGTH_SHORT).show();                doSomething();                return false;            }        });</code></pre><p>I also tried to put the Toast into the doSomething() method, but it's always shown <em>after</em> the whole method is processed. I tried <code>getBaseContext()</code> instead of <code>Prefs.this</code>, but it didn't help.Any idea why the Toast doesn't show up at once and how to make it do so?</p>","388826","","","","","2010-08-29 18:49:35","Toast in PreferenceActivity is shown late","<android><preferences><toast><preferenceactivity>","1","0","1","",""
"3595946","1","3596533","","2010-08-29 18:07:32","1","853","<p>I have a soundpool object and several sounds, but once created I can't change the sounds playback in anyway, such as number of loops, volume, stopping, etc.</p><p>Declaration code:</p><pre><code>public SoundPool sounds;public HashMap&lt;Integer, Integer&gt; soundmap = new HashMap&lt;Integer, Integer&gt;();static final public int UFO=3;static final public int PlayerDeath=3;static final public int InvaderDeath=2;static final public int PlayerFire=1;</code></pre><p>Sound assignment code:</p><pre><code>sounds = new SoundPool(10,AudioManager.STREAM_MUSIC,0);soundmap.put(PlayerDeath,sounds.load(getContext(), R.raw.explosion, 1));soundmap.put(InvaderDeath,sounds.load(getContext(), R.raw.invaderkilled, 1));soundmap.put(PlayerFire,sounds.load(getContext(),R.raw.shoot, 1));soundmap.put(UFO,sounds.load(getContext(),R.raw.ufo, 1));</code></pre><p>Start/stop code:</p><pre><code>public void PlayUFOMusic(){    sounds.play(soundmap.get(UFO),0.8F,0.8F,1,2000,1);      }public void StopUFOMusic(){     sounds.stop(soundmap.get(UFO));}</code></pre><p>I know these functions are being called but nothing will cause it change in anyway. I've also tried setLoop, setVolume, pause and unload, none of these worked either.</p><p>Any ideas?</p>","433825","","433825","","2010-08-29 18:35:39","2010-08-29 20:51:31","SoundPool sounds not changing","<android><soundpool>","1","0","","",""
"3595973","1","3596134","","2010-08-29 18:13:56","2","1182","<p>I was reading over at the Android development website about using reflections. But I'm really not grasping how to use it. I need this Java file to run on a 1.5 (SDK3) device but just ignore the new code and it works fine on a 2.0 (SDK5) or later phone. I have this Activity (posted below) and it's a simple webview. However, I want to have geolocation enabled (even if it is only for 2.0 and later phones), since these APIs weren't introduced until SDK 5, and I would like the webview to be able to, at the very least, to load on a 1.5 phone rather than just crashing. How do I take my code and set it up using reflections?</p><pre><code>    package com.my.app;    import com.facebook.android.R;    //NEEDS TO BE IGNORED**********************************************************    import android.webkit.GeolocationPermissions;    import android.webkit.GeolocationPermissions.Callback;    //END**************************************************************************    import android.app.Activity;    import android.app.ProgressDialog;    import android.content.Intent;    import android.net.Uri;    import android.os.Bundle;    import android.util.Log;    import android.view.KeyEvent;    import android.view.Menu;    import android.view.MenuInflater;    import android.view.MenuItem;    import android.webkit.CookieSyncManager;    import android.webkit.WebChromeClient;    import android.webkit.WebView;    import android.webkit.WebViewClient;    import android.widget.Toast;    //GeolocationPermissionsCallback NEEDS TO BE IGNORED**********************************************************    public class Places extends Activity implements GeolocationPermissions.Callback {        private ProgressDialog progressBar;        public WebView webview;        private static final String TAG = ""Main"";        String geoWebsiteURL = ""http://google.com"";        @Override        public void onStart()        {            super.onStart();            CookieSyncManager.getInstance().sync();        }        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            CookieSyncManager.createInstance(this);            CookieSyncManager.getInstance().startSync();            webview = (WebView) findViewById(R.id.webview);            webview.setWebViewClient(new testClient());            webview.getSettings().setJavaScriptEnabled(true);            webview.getSettings().setPluginsEnabled(true);            webview.loadUrl(""http://google.com"");            progressBar = ProgressDialog.show(Places.this, """", ""Loading Page..."");            //START GROUP OF CODE THAT NEEDS TO BE IGNORED************************************************************            webview.getSettings().setGeolocationEnabled(true);            GeoClient geo = new GeoClient();            webview.setWebChromeClient(geo);        }        public void invoke(String origin, boolean allow, boolean remember) {        }        final class GeoClient extends WebChromeClient {            @Override            public void onGeolocationPermissionsShowPrompt(String origin,            Callback callback) {                super.onGeolocationPermissionsShowPrompt(origin, callback);                callback.invoke(origin, true, false);            }    //END OF CODE THAT NEEDS TO BE IGNORED************************************************    }    private class testClient extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            Log.i(TAG, ""Processing webview url click..."");            view.loadUrl(url);            return true;        }        public void onPageFinished(WebView view, String url) {            Log.i(TAG, ""Finished loading URL: "" +url);            if (progressBar.isShowing()) {                progressBar.dismiss();            }            if (url.startsWith(""mailto:"") || url.startsWith(""geo:"") ||                url.startsWith(""tel:"")) {                Intent intent = new Intent                    (Intent.ACTION_VIEW, Uri.parse(url));                startActivity(intent);            }        }    }        //What's here????        public boolean onKeyDown(int keyCode, KeyEvent event) {            if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {                webview.goBack();                return true;            }            if (keyCode == KeyEvent.KEYCODE_SEARCH) {                Intent z = new Intent(this, Search.class);                startActivity(z);            }            return super.onKeyDown(keyCode, event);        }        public boolean onCreateOptionsMenu (Menu menu) {            super.onCreateOptionsMenu(menu);            MenuInflater inflater = getMenuInflater();            inflater.inflate(R.menu.menu, menu);            return true;        }        @Override        public boolean onOptionsItemSelected (MenuItem item) {            switch (item.getItemId()) {                case R.id.home:                    Intent m = new Intent(this, Home.class);                    startActivity(m);                    return true;                case R.id.refresh:                    webview.reload();                    Toast.makeText(this, ""Refreshing..."", Toast.LENGTH_SHORT).show();                    return true;            }            return false;        }        public void onStop()        {            super.onStop();            CookieSyncManager.getInstance().sync();        }    }</code></pre>","393373","","63550","","2011-05-03 11:42:35","2011-05-03 11:42:35","Using reflection in Android for backwards compatibility","<java><android><reflection><backwards-compatibility><android-1.5-cupcake>","1","0","1","",""
"3596023","1","","","2010-08-29 18:25:14","23","78037","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2808535/round-a-double-to-2-significant-figures-after-decimal-point"">Round a double to 2 significant figures after decimal point</a>  </p></blockquote><p>I have:</p><pre><code>mkm=((((amountdrug/fluidvol)*1000)/60)*infrate)/ptwt; </code></pre><p>in my Java code. The code works fine but returns to several decimal places. How do I limit it to just 2 or 3?</p>","433906","","168175","","2012-05-15 11:02:43","2013-11-21 09:32:25","Round to 2 decimal places","<java><android>","7","1","8","2012-09-06 12:41:55",""
"3596055","1","","","2010-08-29 18:34:00","1","275","<p>I've been reading for a couple hours now, trying to figure out how to maintain a reliable list of contacts in an Android application, but still cannot find one clear successful case.</p><p>My situation is this:  I let users create Groups in my application, and in each Group, the user can select, from their contact list on the phone, which users they'd like to add to that group.  I then need to be able to have a reliable way to compare a call from an incoming contact with my contacts database in my application, to see if they are in specific groups.</p><p>The easy parts are to add specific contacts to my database, and also to look up a contact based on their phone number.  Thanks to this forum they are easy anyway! :)  I'm storing the contacts in my database by Contact Name, Lookup Key, and Contact Id.  The hard part for me, and this is what I cannot find a clear answer on, is how do I know that a month down the road, Contact X is going to have the same Lookup Key or Contact Id as when they were added?  Couldn't they all change by then?  Obviously the name can easily change, but can't the lookup_key and Contact ID also change?  I've read about the lookup_key changing if contacts are manually aggregated.  In other words, I am looking for the identifiable information for a contact that CANNOT change once they are entered?</p><p>I have read about using a ContentObserver to register for changes to the Contacts database, but I don't see that this helps me at all, since if I have Contact X with Lookup Key Y and Contact ID of Z, even if I get updated that the Contacts have changed, I still need to match Contact X in my application with Contact X in the Contacts database to update my info, which I still cannot do if the identifying information has been changed.</p><p>For example, I have a contact with Name, Lookup_Key, ContactID of  Ted, 230ff392, 3209482.  A month later, could it happen that what used to be Ted is now T-bone, 458ee247, 5502981?  If this were the case, I cannot use these 3 identifiers as a means to look up the contact.</p><p>Thanks so much for the help on this!Paul</p>","299418","","299418","","2010-08-31 20:34:20","2014-03-19 09:30:00","Looking for a clear answer on how to reliably maintain a list of contacts in my application","<android>","1","0","1","",""
"3596102","1","3675048","","2010-08-29 18:48:38","7","5350","<p>I declared a WebView activity in the manifest like this:</p><pre><code>&lt;activity android:name="".MyWebView""    android:label=""@string/app_name""    android:configChanges=""orientation|keyboardHidden""    android:theme=""@android:style/Theme.Dialog""&gt;&lt;/activity&gt;</code></pre><p>The WebView looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:orientation=""vertical""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     &gt;    &lt;WebView android:id=""@+id/webview""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>When I start this activity within my main activity, only the title of the dialog, containing the apps name, is visible but not the WebView. If I add a TextView to the LinearLayout, it is shown as well, but still the WebView is missing.If I don't apply <code>android:theme=""@android:style/Theme.Dialog""</code> in the manifest, the WebView is displayed.</p><p>Why is that and how can I show a WebView in a dialog?</p>","388826","","388826","","2010-08-29 18:58:53","2012-05-26 02:38:37","How to show a WebView with Theme.Dialog style in Android","<android><dialog><themes><webview>","4","0","3","",""
"3596320","1","3596372","","2010-08-29 19:51:57","0","2003","<p>I wonder how I could make a scrollable table with static table header ? (with different elements in cells like buttons, images, etc.) </p><p>I have already made some of this, but i dont know how to make columns in different tables match each other by width.</p><pre><code>&lt;TableLayout&gt;    &lt;TableRow&gt;        Table headers...    &lt;/TableRow&gt;    &lt;ScrollView&gt;        &lt;TableLayout &gt; &lt;!-- Table content--&gt;&lt;/TableLayout &gt;    &lt;/ScrollView&gt;&lt;/TableLayout&gt;</code></pre><p>Thanks !</p>","71420","","","","","2010-12-17 02:02:50","Android: How to make scrollable table with frozen table headers?","<android>","1","0","","",""
"3596397","1","4976642","","2010-08-29 20:09:44","6","3690","<p>I am attempting to test simple UI with the following test case,The main idea is to set in the test some of the UI text (to mimic user input) and then actively click an event.</p><pre><code>public class StackTestCase extends ActivityInstrumentationTestCase2&lt;Stack&gt; {private StackDemo mActivity;private EditText eaten;    public StuckTestCase() {         super(""com.crocodil.software.stack"", Stack.class);    }    public StuckTestCase(Class&lt;Stack&gt; activityClass) {         super(""com.crocodil.software.stack"", activityClass);    }    protected void setUp() throws Exception {        super.setUp();        mActivity = this.getActivity();        mCount = (Button) mActivity.findViewById(com.crocodil.software.stack.R.id.action);        eaten = (EditText) mActivity.findViewById(com.crocodil.software.stack.R.id.eaten);    }    public void testPreconditions() {        assertNotNull(mStatus);      }    public void testSimpleDefaults(){        double status = Double.valueOf(mStatus.getText().toString());        eaten.setText(2);        mCount.performClick();        assertEquals((status-2),Double.valueOf(mStatus.getText().toString()));    }}</code></pre><p>the running result is the exception - </p><pre><code>android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.at android.view.ViewRoot.checkThread(ViewRoot.java:2802)at android.view.ViewRoot.playSoundEffect(ViewRoot.java:2581)at android.view.View.playSoundEffect(View.java:8516)at android.view.View.performClick(View.java:2407)at com.crocodil.software.stack.test.StackTestCase.testSimpleDefaults(StackTestCase.java:46)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</code></pre><p>This happens on each access to the UI elements and i was unable to avoid it by using handles or async task ? any suggestions?</p>","421189","","","","","2013-07-15 23:13:58","Testing with UI elements in Android view","<android><junit><edittext>","2","0","3","",""
"3596446","1","","","2010-08-29 20:21:34","1","191","<p>I have a slightly strange thing happening in my code atm, which I don't understand... I would much appreciate any input anyone may have.</p><p>So here's the issue:In my main Activity I fire a Service, using an Intent, when a button is pressed on screen. The Service instantiates 22 Runnable objects each of which read data constantly from 22 separate flat files. The data is fed into a matrix of objects (64 x 64). In my main Activity I have another button which starts a new Activity to visualises the data in the matrix. So when I press it it accesses the data stored in the objects at the same time as the 22 threads are feeding data into them. It is my understanding this kind of operation is the main reason to use threads! However, when I start the new activity it seams to interrupt and/or kill the threads as they no longer print their Log.d messages to logcat...</p><p>Is it a case that I need to bind my Activity to my Service to access data that it is processing or are the thread independent of the Service as my common sense would tell me??!</p><p>Thanks in advance for any advice!</p>","413872","","","","","2010-08-29 20:21:34","Threads interrupted when new activity is started. Android","<java><android><multithreading>","0","2","","",""
"3596478","1","3596914","","2010-08-29 20:32:49","0","1197","<p>Following an example from Professional Android 2 Application Development I set up a pref class as follows:</p><pre><code>//Preferences.javapublic class Preferences extends PreferenceActivity{    public static final String PREF_SPEED_UNIT =""PREF_SPEED_UNIT"";    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.userpreferences);    }  }</code></pre><p>In my activity class:</p><pre><code>// main.java private static final int SHOW_PREFERENCES = 1;@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    if (requestCode == SHOW_PREFERENCES)        updateFromPreferences();        if (resultCode == Activity.RESULT_OK) {        }   }private void updateFromPreferences() {    Log.d(TAG, ""updateFromPreferences()"");    Context context = getApplicationContext();    SharedPreferences prefs = PreferenceManager            .getDefaultSharedPreferences(context);    // Set the SpeedMode string using object reference to custom view    mSpeedMode = prefs.getString(Preferences.PREF_SPEED_UNIT, ""MPH"");    speedview.SpeedMode = mSpeedMode;  }// Using have a Button view that pops the options for testingprivate OnClickListener optionbuttonCL = new OnClickListener() {    public void onClick(View v) {        Context context = getApplicationContext();        Intent i = new Intent(context, Preferences.class);        startActivityForResult(i, SHOW_PREFERENCES);    }};</code></pre><p>The issue is here:</p><pre><code>    // SpeedView.java    if (SpeedMode == ""MPH""){        // set speed in miles/hour    }    if (SpeedMode == ""KPH""){        //set speed in kilometers/hour    }</code></pre><p>It works, however if I switch speed modes to KPH (default is MPH), the display no longer updates.</p><p>The bewildering thing is even if SpeedMode is shown to be ""MPH"" or ""KPH"" using the Eclipse debugger, the if statements will not execute. </p><p>Here is the rest of the code:</p><pre><code>//userpreferences.xml&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListPreference android:key=""PREF_SPEED_UNIT""    android:title=""Speed Unit""     android:summary=""Choose between MPH or KPH""    android:entries=""@array/speed_options""     android:entryValues=""@array/speed_values""    android:dialogTitle=""Speed Unitz""     android:defaultValue=""MPH"" /&gt;&lt;/PreferenceScreen&gt;// arrays.xml&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;string-array name=""speed_options""&gt;    &lt;item&gt;MPH&lt;/item&gt;    &lt;item&gt;KPH&lt;/item&gt;&lt;/string-array&gt;&lt;string-array name=""speed_values""&gt;    &lt;item&gt;MPH&lt;/item&gt;    &lt;item&gt;KPH&lt;/item&gt;&lt;/string-array&gt;</code></pre><p></p><p>Thanks</p>","434400","","","","","2010-08-30 02:37:13","Android: PreferenceActivity: Why is this 'simple' logic check on a stored preference value not evaluating?","<android><views><preference><preferenceactivity>","1","0","","",""
"3596490","1","3596499","","2010-08-29 20:37:46","1","314","<p>(I do not have any dev android phone and currently working on emulator only. As the emulator do not have voice input method,  these silly question came up in my mind.)</p><p>Does android process speech input on the device itsself (with limited computing power of 300-500MHz or 1 GHz) or it sends to Google Serves and gets text back?</p><ul><li>Does it work when off-line?</li><li>How long speech input can be processed at a time without any break?</li></ul>","229106","","","","","2010-08-29 20:40:31","Does speech to text happens on device?","<android><voice><speech-to-text>","1","0","","",""
"3596511","1","3597988","","2010-08-29 20:43:37","1","1015","<p>I am adding items to my data source and would like it to appear in my ListView. For some reason nothing is appearing:</p><p>Adapter:</p><pre><code>private class STCompanyAdapter extends ArrayAdapter&lt;STCompany&gt; {        private ArrayList&lt;STCompany&gt; items;        public STCompanyAdapter(Context context, int textViewResourceId,                ArrayList&lt;STCompany&gt; items) {            super(context, textViewResourceId, items);            this.items = items;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.addstocksrow, null);            }            STCompany q = items.get(position);            if (q != null) {                TextView symbolText = (TextView) v.findViewById(R.id.toptext);                TextView nameText = (TextView) v.findViewById(R.id.bottomtext);                if (nameText != null) {                    nameText.setText(q.getSymbol());                }                if (symbolText != null) {                    symbolText.setText(q.getName());                }            }            return v;        }    }</code></pre><p>Adding items in onCreate:</p><pre><code>listView = (ListView) findViewById(R.id.symbolsListView);            this.companiesAdapter = new STCompanyAdapter(this, R.layout.addstocksrow, companies);            listView.setAdapter(this.companiesAdapter);    STCompany myCompany = new STCompany();                    myCompany.setName(""La La"");                    myCompany.setSymbol(""BP"");                    companiesAdapter.add(myCompany);                    companiesAdapter.notifyDataSetChanged();</code></pre><p>Here is my layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/LinearLayout""&gt;&lt;EditText android:id=""@+id/addStocksEditText"" android:text=""Search company or stock"" android:layout_width=""200dp"" android:layout_height=""50dp""&gt;&lt;/EditText&gt;&lt;Button android:layout_height=""wrap_content"" android:text=""Search"" android:id=""@+id/searchButton"" android:layout_width=""fill_parent""&gt;&lt;/Button&gt;&lt;ListView android:id=""@+id/symbolsListView"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","19875","","","","","2013-12-07 21:07:06","Adding items to data source doesn't appear in ListView","<android><listview><arraylist><listadapter>","2","0","","",""
"3596546","1","3596599","","2010-08-29 20:55:34","0","648","<p>I am finding that my layouts tend to look great in one orientation but if I change the phone's orientation, things are a mess. For example on one screen I have 6 large buttons that look great in portrait orientation but if the user changes phone orientation, those buttons get cut off in portrait. </p><p>Do I need to code two layouts for every screen - one for portrait and one for landscape? That would be such a waste of time. </p>","268803","","","","","2010-08-30 00:08:04","How to design a layout that looks good in portrait and landscape orientations?","<android><layout><orientation>","1","1","","",""
"3596683","1","","","2010-08-29 21:30:05","1","566","<p>I need my app to be able to go to a specified URL and access a file, then insert text at a specific line of said file.  Is this at all possible?  I greatly appreciate your help and responses,  Thanks.</p>","434438","","","","","2010-12-03 05:23:42","How to edit remote files on an Apache server with Android application","<android><apache>","1","0","","",""
"3596722","1","3598172","","2010-08-29 21:43:30","15","19732","<p>how to get the android phone model, version, sdk details?</p>","368999","","","","","2013-11-08 02:53:58","how to get the android phone model, version, sdk details?","<android>","3","1","8","",""
"3596867","1","","","2010-08-29 22:24:11","0","667","<p>How can you scroll down in the Blocks Editor window?</p><p>It lets me scroll down a little, but not to the end of my (lengthy) code.</p>","2699","","404469","","2010-09-08 15:00:43","2011-04-13 03:47:47","How to Scroll Down in the App Inventor Blocks Editor Window?","<android><scrolling><app-inventor>","2","1","","",""
"3596884","1","6967939","","2010-08-29 22:31:57","2","1706","<p>Hi: I want to start a service which is situated in a connected library project. All concerning classes are in the library.</p><p>The service is called from an activity located in the library:</p><pre><code>Intent serviceIntent = new Intent();serviceIntent.setAction(""org.example.library.MY_ACTION"");startService(serviceIntent);</code></pre><p>In the manifest files -both at library and application- it is noted:</p><pre><code>    &lt;service android:name=""org.example.library.SomeLibraryClass""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""org.example.library.MY_ACTION"" /&gt;        &lt;/intent-filter&gt;    &lt;/service&gt;</code></pre><p><strong>Unable to start service Intent { act=org.example.android.SomeLibraryClass (has extras) }: not found</strong></p><p>It seems like Android is looking for a class in the application but not in the library. Anyone had this behavior before? </p>","281535","","","","","2012-09-10 20:03:32","Unable to start intent from application containing library","<android>","1","2","0","",""
"3596965","1","","","2010-08-29 23:07:22","1","596","<p>I have an app that has a widget. In the main app, I have an ad framework (cannot be edited due to licence) that is accumulatively leaking approx 1MB every time I exit the app. It appears one of its threads are running in the background (unnecessarily) that will keep its process and these threads will be created again when I launch the app.</p><p>Is it a good idea to call</p><pre><code>android.os.Process.killProcess(android.os.Process.myPid());</code></pre><p>in the onDestroy method of my main activity?</p><p>Also, would doing this kill my widget's service as well?</p>","398148","","398148","","2010-08-30 12:23:53","2011-05-28 16:11:52","Background process wont clear memory. Is it a good idea to kill my own process on Android?","<android><service><background><android-widget>","1","2","","",""
"3597034","1","3597182","","2010-08-29 23:33:43","1","403","<p>I have 6 images I want to display as 2 rows with 3 images in each. I'm using nested LinearLayouts to achieve this, and it works well except for one thing:</p><p>The height of the largest image dictates the size of the linear layout, meaning there is empty space a lot of the time. In other words, my problem is as follows:<img src=""http://i.stack.imgur.com/8GXd9.jpg"" alt=""alt text""></p><p>I keep getting the layout shown on the left, and I want the layout shown on the right.</p><p>I am aware that you can just use GridView, but that will still prevent the exact layout shown on the right, so I'm at a loss really. Many thanks.</p>","250286","","250286","","2010-08-29 23:59:29","2010-08-30 01:08:49","Relative stacking with Linear Layout in Android?","<android><android-linearlayout>","2","0","","",""
"3597128","1","3597161","","2010-08-30 00:14:55","1","307","<p>What does <a href=""http://mashable.com/2010/08/14/google-rebuts-oracle-lawsuit-invokes-open-source-defense/"" rel=""nofollow"">Oracle's lawsuit against Google</a> mean to Android developers? I know this is not a programming related question, but I can't think of another forum where I can ask this.</p>","203091","","","","","2010-08-30 00:24:29","What does Oracle's lawsuit against Google mean to Android developers?","<java><android>","2","5","","2010-08-30 00:24:34",""
"3597209","1","3661792","","2010-08-30 00:45:07","1","8772","<p>I'm getting an error in my Android app that says ""source not found"" and crashes the program. I've already read a number of posts saying that the solution is to download the android source code and load that up in Eclipse, but I tried to no avail.</p><p>Here is a bunch of information that may help with my problem, let me know if you need more!</p><p>Stack:</p><pre><code>Thread [&lt;1&gt; main] (Suspended (exception RuntimeException))ActivityThread.performLaunchActivity(ActivityThrea d$ActivityRecord, Intent) line: 2663ActivityThread.handleLaunchActivity(ActivityThread $ActivityRecord, Intent) line: 2679ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125ActivityThread$H.handleMessage(Message) line: 2033ActivityThread$H(Handler).dispatchMessage(Message) line: 99Looper.loop() line: 123ActivityThread.main(String[]) line: 4627Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]Method.invoke(Object, Object...) line: 521ZygoteInit$MethodAndArgsCaller.run() line: 868ZygoteInit.main(String[]) line: 626NativeStart.main(String[]) line: not available [native method]</code></pre><p>Is it weird that the first entry is 'ActivityThrea d' with the 'd' cut off? If this is the problem, what went wrong and how do I fix it?</p><p>The line of code the debug stops on:</p><pre><code>public void AddAnimationID(String index, Integer view){ animations.put(index, view);}</code></pre><p>'animations' is a Dictionary and is a member of class Alien. I am calling it like:</p><pre><code>Alien alien;alien.AddAnimationID(""idle"", R.drawable.idle);</code></pre><p>I am correct in thinking that R.drawable.idle is an int right? findViewByID takes an int for the argument... </p><p>Here is the logcat, I tried to pinpoint where in the log it started the application, sorry if its too much.</p><pre><code>I/ActivityManager(   59): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 21357 ms (total 21357 ms)I/Launcher.Model(  118): not binding apps: no Launcher activityD/dalvikvm(  118): GC_EXPLICIT freed 5222 objects / 297520 bytes in 114msD/dalvikvm(  118): GC_EXPLICIT freed 11360 objects / 562112 bytes in 94msD/PackageParser(   59): Scanning package: /data/app/vmdl45576.tmpI/PackageParser(   59): Game.Main: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATEI/PackageManager(   59): Removing non-system package:Game.MainI/ActivityManager(   59): Force stopping package Game.Main uid=10032D/dalvikvm(  118): GC_EXTERNAL_ALLOC freed 319 objects / 18064 bytes in 73msD/dalvikvm(   59): GC_FOR_MALLOC freed 6857 objects / 349752 bytes in 400msD/PackageManager(   59): Scanning package Game.MainI/PackageManager(   59): Package Game.Main codePath changed from /data/app/Game.Main-2.apk to /data/app/Game.Main-1.apk; Retaining data and using newI/PackageManager(   59): /data/app/Game.Main-1.apk changed; unpackingD/installd(   34): DexInv: --- BEGIN '/data/app/Game.Main-1.apk' ---I/ActivityManager(   59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=Game.Main/.Main }D/dalvikvm(  258): DexOpt: load 116ms, verify 200ms, opt 2msD/installd(   34): DexInv: --- END '/data/app/Game.Main-1.apk' (success) ---W/PackageManager(   59): Code path for pkg : Game.Main changing from /data/app/Game.Main-2.apk to /data/app/Game.Main-1.apkW/PackageManager(   59): Resource path for pkg : Game.Main changing from /data/app/Game.Main-2.apk to /data/app/Game.Main-1.apkD/PackageManager(   59):   Activities: Game.Main.MainI/ActivityManager(   59): Force stopping package Game.Main uid=10032E/Launcher(  118): Unable to launch. tag=ApplicationInfo(title=Alien Game) intent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=Game.Main/.Main }E/Launcher(  118): android.content.ActivityNotFoundException: Unable to find explicit activity class {Game.Main/Game.Main.Main}; have you declared this activity in your AndroidManifest.xml?E/Launcher(  118):      at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)E/Launcher(  118):      at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)E/Launcher(  118):      at android.app.Activity.startActivityForResult(Activity.java:2817)E/Launcher(  118):      at com.android.launcher2.Launcher.startActivityForResult(Launcher.java:1053)E/Launcher(  118):      at android.app.Activity.startActivity(Activity.java:2923)E/Launcher(  118):      at com.android.launcher2.Launcher.startActivitySafely(Launcher.java:1462)E/Launcher(  118):      at com.android.launcher2.AllApps2D.onItemClick(AllApps2D.java:178)E/Launcher(  118):      at android.widget.AdapterView.performItemClick(AdapterView.java:284)E/Launcher(  118):      at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)E/Launcher(  118):      at android.os.Handler.handleCallback(Handler.java:587)E/Launcher(  118):      at android.os.Handler.dispatchMessage(Handler.java:92)E/Launcher(  118):      at android.os.Looper.loop(Looper.java:123)E/Launcher(  118):      at android.app.ActivityThread.main(ActivityThread.java:4627)E/Launcher(  118):      at java.lang.reflect.Method.invokeNative(Native Method)E/Launcher(  118):      at java.lang.reflect.Method.invoke(Method.java:521)E/Launcher(  118):      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/Launcher(  118):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/Launcher(  118):      at dalvik.system.NativeStart.main(Native Method)I/installd(   34): move /data/dalvik-cache/data@app@Game.Main-1.apk@classes.dex-&gt; /data/dalvik-cache/data@app@Game.Main-1.apk@classes.dexD/PackageManager(   59): New package installed in /data/app/Game.Main-1.apkI/ActivityManager(   59): Force stopping package Game.Main uid=10032I/ActivityManager(   59): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=259 uid=10028 gids={}D/dalvikvm(  157): GC_EXPLICIT freed 4079 objects / 247824 bytes in 605msD/dalvikvm(   59): GC_EXPLICIT freed 6136 objects / 382312 bytes in 493msW/RecognitionManagerService(   59): no available voice recognition services foundI/installd(   34): unlink /data/dalvik-cache/data@app@Game.Main-2.apk@classes.dexD/AndroidRuntime(  191): Shutting down VMD/jdwp    (  191): adbd disconnectedI/AndroidRuntime(  191): NOTE: attach of thread 'Binder Thread #3' failedI/ActivityThread(  259): Publishing provider com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProviderD/AndroidRuntime(  269):D/AndroidRuntime(  269): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime(  269): CheckJNI is OND/AndroidRuntime(  269): --- registering native functions ---I/ActivityManager(   59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=Game.Main/.Main }I/ActivityManager(   59): Start proc Game.Main for activity Game.Main/.Main: pid=273 uid=10032 gids={1015}I/ARMAssembler(   59): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x322b68:0x322c74] in 4370882 nsW/Game.Main.Main(  273): SIS is nullD/AndroidRuntime(  273): Shutting down VMW/dalvikvm(  273): threadid=1: thread exiting with uncaught exception (group=0x4001d800)E/AndroidRuntime(  273): FATAL EXCEPTION: mainE/AndroidRuntime(  273): java.lang.RuntimeException: Unable to start activity ComponentInfo{Game.Main/Game.Main.Main}: java.lang.NullPointerExceptionE/AndroidRuntime(  273):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)E/AndroidRuntime(  273):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)E/AndroidRuntime(  273):        at android.app.ActivityThread.access$2300(ActivityThread.java:125)E/AndroidRuntime(  273):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)E/AndroidRuntime(  273):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  273):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  273):        at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(  273):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(  273):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  273):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  273):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(  273):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  273): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime(  273):        at Game.Main.Main.onCreate(Main.java:81)E/AndroidRuntime(  273):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(  273):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)E/AndroidRuntime(  273):        ... 11 moreW/ActivityManager(   59):   Force finishing activity Game.Main/.MainI/ActivityManager(   59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=Game.Main/.Main }D/AndroidRuntime(  269): Shutting down VMD/jdwp    (  269): adbd disconnectedI/AndroidRuntime(  269): NOTE: attach of thread 'Binder Thread #3' failedW/ActivityManager(   59): Activity pause timeout for HistoryRecord{43ed84f8 Game.Main/.Main}I/ARMAssembler(   59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x305640:0x3056fc] in 1148283 nsW/ActivityManager(   59): Launch timeout has expired, giving up wake lock!</code></pre><p>Here is the class Alien:</p><pre><code>package Game.Main;import java.util.Dictionary;import android.graphics.drawable.AnimationDrawable;import android.widget.ImageView;public class Alien {    private AlienState state;    private Dictionary&lt;String, Integer&gt; animations;    private ImageView imageView;    public Alien()    {    }    public void AddAnimationID(String index, Integer view)    {        animations.put(index, view);    }    public Integer GetAnimationID(String index)    {        return animations.get(index);    }    public void SetImageView(ImageView view)    {        imageView = view;        if(animations.get(""idle"") != null)        {            imageView.setBackgroundResource(R.drawable.idle);            state = AlienState.idle;        }    }    public ImageView GetImageView()    {        return imageView;    }    public void ChangeView(String index)    {        if(animations.get(index) != null)        {            imageView.setBackgroundResource(animations.get(index));            state = AlienState.valueOf(index);        }    }}</code></pre><p>Here is the onCreate function that this is called from and related information:</p><pre><code>package Game.Main;import java.util.ArrayList;import java.util.List;import Game.Main.MainView.MainThread;import android.app.Activity;import android.content.Intent;import android.content.pm.PackageManager;import android.content.pm.ResolveInfo;import android.graphics.drawable.AnimationDrawable;import android.os.Bundle;import android.speech.RecognizerIntent;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.view.animation.Animation.AnimationListener;import android.widget.Button;import android.widget.ImageView;import android.widget.TextView;public class Main extends Activity implements OnClickListener {    private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;    private ArrayList&lt;String&gt; dictionary;    private TextView txtText;    private MainThread thread;    private MainView view;    private AnimationDrawable anim;    private Alien alien;    @Override // called when Main is created.    public void onCreate(Bundle savedInstanceState) {        // reload from previous instance        super.onCreate(savedInstanceState);        // set default content view        setContentView(R.layout.main);        view = (MainView)findViewById(R.id.mainView);        thread = view.GetThread();        if (savedInstanceState == null) {            // we were just launched: set up a new game            thread.SetState(GameState.Active);            Log.w(this.getClass().getName(), ""SIS is null"");        } else {            // we are being restored: resume a previous game            thread.RestoreState(savedInstanceState);            Log.w(this.getClass().getName(), ""SIS is nonnull"");        }        // setup speak button        Button speakButton = (Button)findViewById(R.id.btn_speak);        // setup text box        txtText = (TextView)findViewById(R.id.txt_text);        // setup our dictionary        dictionary = new ArrayList&lt;String&gt;();        dictionary.add(""sit"");        dictionary.add(""eat"");        dictionary.add(""jump"");        dictionary.add(""think"");        alien.AddAnimationID(""idle"", R.drawable.idle);        alien.AddAnimationID(""eat"", R.drawable.eat);        alien.AddAnimationID(""jump"", R.drawable.jump);        alien.AddAnimationID(""think"", R.drawable.think);        alien.AddAnimationID(""run"", R.drawable.run);        alien.AddAnimationID(""sit"", R.drawable.sit);        alien.SetImageView((ImageView)findViewById(R.id.alien_image));        // check to see if a recognition activity is present        PackageManager pm = getPackageManager();        List&lt;ResolveInfo&gt; activities = pm.queryIntentActivities(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);        // if activities were found, cancel speech recognition        if (activities.size() != 0)            speakButton.setOnClickListener(this);        else         {            speakButton.setEnabled(false);            speakButton.setText(""Recognizer not present"");        }    }</code></pre><p>I am using Eclipse on Windows 7 x64. I have all of the newest updates to the android SDK and I downloaded the android source code and added it to the Eclipse patch because previous posts led me to try that. The code breaks for debug when the first time AddAnimationID is called. I hope this is all you need, thanks! Sorry if I'm doing this wrong by the way, I'm somewhat new at this.</p><p>Edit: Looks like I didn't have enough breakpoints, the culprit is not the AddAnimationID function but actually the SetImageView one. The if statement seems to not work, so I've commented it out for now. I'll post back once I've figured it out. It's probably something silly that works in another language but not Java...</p>","434512","","434512","","2010-08-31 03:38:53","2013-03-31 05:16:41","Android App, ""source not found"" debug error - tried downloading Android Source Code","<java><android>","1","1","1","",""
"3597250","1","","","2010-08-30 01:05:06","2","4173","<p>I am building a 2D game with Android SurfaceView. When I touch the screen the game animation runs slowly. Why, and how can I avoid this?</p><p>The touch events are stubs just like <code>onTouchEvents(MotionEvents ev){ empty };</code>. All of the game logic and graphics draw code are in <code>run()</code> in an <code>extends Thread</code> class.</p>","404112","","243245","","2010-08-30 01:29:33","2010-08-30 08:50:56","2D game on Android SurfaceView runs slowly on touch","<android><2d>","3","3","1","",""
"3597323","1","3607943","","2010-08-30 01:29:50","8","8232","<p>I am attempting to replace the Canvas-based rendering system that I already have with the faster opengl-es surface, however, I can't seem to get an openGL renderer to conform in such a way that it acts as 2d field, rather than a perspective view. </p><p>My current code for the renderer looks as follows:</p><pre><code>     @Override     public void onSurfaceChanged(GL10 gl, int width, int height) {        gl.glViewport(0, 0, width, height);        gl.glMatrixMode(GL10.GL_PROJECTION);        gl.glLoadIdentity();        gl.glOrthof(0.0f, width, 0.0f, height, 0.0f, 1.0f);        gl.glShadeModel(GL10.GL_FLAT);        gl.glEnable(GL10.GL_BLEND);        gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);        gl.glColor4x(0x10000, 0x10000, 0x10000, 0x10000);        gl.glEnable(GL10.GL_TEXTURE_2D);    }    @Override    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);        gl.glClearColor(0.5f, 0.5f, 0.5f, 1);        gl.glShadeModel(GL10.GL_FLAT);        gl.glDisable(GL10.GL_DEPTH_TEST);        gl.glEnable(GL10.GL_TEXTURE_2D);        gl.glDisable(GL10.GL_DITHER);        gl.glDisable(GL10.GL_LIGHTING);        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);        }</code></pre><p>How would I setup the renderer so that the translate transformation would match up with the pixels on the screen? (so translating 5 to the right would move it 5 pixels)</p>","118241","","44729","","2010-08-30 03:47:35","2013-07-16 05:47:25","Using OpenGL to replace Canvas - Android","<java><android><opengl-es><renderer>","1","4","3","",""
"3597325","1","3597834","","2010-08-30 01:31:01","3","2647","<p>I have some data I load into the database the first time a user enters my <code>Activity</code>, and want to show a <code>ProgressDialog</code> while this data is loaded for the first time. My Activity is an <code>ExpandableListActivity</code> and I don't create the <code>SimpleExpandableListAdapter</code> or call <code>setListAdapter</code> passing my adapter until I'm sure the data is actually there. My <code>onCreate</code> looks like this:</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mCategoryDbHelper = new CategoryDBHelper(this);        // Build default categories... if not there yet        CategoryDbBuilder builder = new CategoryDbBuilder(this);        if (!builder.hasCategoriesInTable()) {            showDialog(PROGRESS_DIALOG_ID);            builder.fillDbWithDefaultCategories();            removeDialog(PROGRESS_DIALOG_ID);        }        populate();    }</code></pre><p>I've overwritten <code>onCreateDialog</code> as such:</p><pre><code>@Override    protected Dialog onCreateDialog(int id) {        switch (id) {            case PROGRESS_DIALOG_ID: {                ProgressDialog dialog = new ProgressDialog(this);                dialog.setMessage(""Loading categories for the first time. Please wait..."");                dialog.setIndeterminate(true);                dialog.setCancelable(false);                return dialog;            }               }        return null;    }</code></pre><p>The <code>populate()</code> method reads the database and sets up my list adapter, then calls <code>setListAdapter</code>.</p><p>This seems like it should be simple, but it's turning out to be a huge pain. Any help would be appreciated. :-)</p>","413414","","","","","2010-08-30 04:16:58","Android: Progress Dialog Doesn't Show","<android><dialog><progress>","2","0","","",""
"3597395","1","","","2010-08-30 01:55:27","6","10556","<p>I have a byte array of RGB values, just like the contents(without header) of a *.bmp file. What I want to do is, draw the corresponding bitmap on Android, using OpenGL.</p><p>It seems that OpenGL ES doesn't have a single API that will do, it true?</p><p>If true, how can I do this?</p><p>PS: Actually, I can draw it in JAVA code, but it's too slow and costs too much CPU time. So I want to try drawing it with OpenGL. Is there any other advises? Or maybe OpenGL can't be the right answer?</p><p>Thank you all!</p>","429224","","","","","2011-11-07 13:25:12","How to draw a bitmap on Android using OpenGL","<android><opengl-es><bitmap>","2","0","","",""
"3597450","1","","","2010-08-30 02:16:35","4","2590","<p>I was hoping this was going to work for getting Android's MediaPlayer to stream from a URL using authentication, but now I'm not so sure. I have no problem getting it to stream from an open server (no authentication) but I don't see any way to tell MediaPlayer to use basic authentication unless perhaps using the FileDescriptor argument works? So I tried this but got the following error:</p><pre><code>IllegalArgumentException: Expected file scheme in URI http://www.myserver.com/music.mp3</code></pre><p>My code looks something like this:</p><pre><code>File f = new File(new URL(""http://www.myserver.com/music.mp3"").toURI());FileInputStream fis = new FileInputStream(f);mediaplayer.SetDataSource(fis.getFD());</code></pre><p>Is it correct to say that a FileDescriptor can only be used with local <code>file://</code> URLs and not normal <code>http://</code> URLs? If so, does anyone have any other ideas on how to stream from a server that requires authentication using Android's MediaPlayer?</p>","298511","","527702","","2012-08-08 07:32:00","2012-08-08 07:32:00","Using FileDescriptor with HTTP URLs in Android?","<java><android><file-descriptor><file-uri>","1","0","","",""
"3597704","1","3597822","","2010-08-30 03:37:34","4","4078","<p>I'm encountering a FileNotFoundException when I try to make a file using RandomAccessFile:</p><pre><code>RandomAccessFile file = new RandomAccessFile(""/test.jpg"", ""rw"");</code></pre><p>I don't now how to get around this. It's driving me nuts.</p><p>Thanks</p>","149166","","","","","2013-01-09 11:16:35","java.io.FileNotFoundException when using RandomAccessFile to create file","<java><android><filenotfoundexception><random-access>","3","2","1","",""
"3597750","1","","","2010-08-30 03:51:19","1","948","<p>I'm trying to read the status of the Proximity sensor (also I tryed to read the Light sensor...) using the following code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);    setContentView(R.layout.main);    txtStatus = (TextView)findViewById(R.id.txtStatus);    sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);    sensorManager.registerListener(this, SensorManager.SENSOR_PROXIMITY);}@Overrideprotected void onStart() {    super.onStart();    sensorManager.registerListener(this, SensorManager.SENSOR_LIGHT);}@Overridepublic void onResume(){    super.onResume();    sensorManager.registerListener(this, SensorManager.SENSOR_LIGHT);}@Overrideprotected void onPause() {  super.onPause();  sensorManager.unregisterListener(this, SensorManager.SENSOR_LIGHT);}</code></pre><p>The txtStatus change the default text when there is a changing in the sensor (when I try to read the Accelerometer, it works...), but when I block the light sensor nothing happens.</p><p>When I'm in a call, the sensor works (when I put my hand blocking the sensor the screen turn off).</p><p>I'm missing something here?</p><p>Regards,André</p>","434582","","","","","2014-02-18 12:24:30","Android SENSOR_PROXIMITY/SENSOR_LIGHT on Motorola Droid (Milestone)","<android>","2","0","","",""
"3597798","1","","","2010-08-30 04:05:26","1","195","<p>How can I measure the start,stop,duration and pause time of different video which is streaming from website?</p>","434599","","","","","2010-08-30 04:05:26","Measure start/pause/duration of video in android","<android>","0","1","","",""
"3597805","1","3598440","","2010-08-30 04:07:52","3","1505","<p>So I understand the service lifecycle and all that. But I'm confused what the <code>startId</code> parameter is for? </p><pre><code>public int onStartCommand (Intent intent, int flags, int startId)</code></pre><p>I get that it's used in conjunction with <code>stopSelf(int)</code>, but I don't see what the point is or where the startId is being generated. What use case would using stopSelf(int) fall under?</p>","375874","","","","","2010-08-30 06:55:09","Android service startId parameter","<android><service><lifecycle>","1","0","1","",""
"3597867","1","3597978","","2010-08-30 04:25:17","3","2626","<p>I want to make application in which i want to use camera as after the image is captured, i want to store that image in SDCard and display that image in Screen too.</p><p>Can anybody help me ...</p><p>Thanks</p>","1386533","","1386533","","2010-08-30 11:50:58","2010-08-30 11:50:58","Using Camera and storing captured result in SDCard in android","<android>","2","0","","",""
"3597919","1","3598328","","2010-08-30 04:44:34","1","1117","<p>Let's assume the following:</p><pre><code>Activity A calls Search ManagerUser searches, and search results are displayed in Activity BUser clicks on a list item in Activity B App switches back to Activity A</code></pre><p>I am unable to handle this callback from Activity B to Activity A because I don't have the Search Manager intent (i think?).</p><p><strong>Call Search Manager (in Activity A)</strong></p><pre><code>public boolean onOptionsItemSelected(MenuItem item) {        // Handle item selection        switch (item.getItemId()) {        case R.id.add_symbol:            onSearchRequested(); //result of search will show Activity B            return true;        default:            return super.onOptionsItemSelected(item);        }    }</code></pre><p><strong>Go back to Activity A after user has selected a list item</strong></p><pre><code>listView.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                Quote myQuote = new Quote();                myQuote.name = (companies.get(position).name);                myQuote.symbol = (companies.get(position).symbol);                //TODO: add new quote to master quote list in Main                //TODO: serialize in Main                //TODO: go back to last activity                Intent myIntent = new Intent(getApplicationContext(), Main.class);                startActivityForResult(myIntent, PICK_COMPANY_REQUEST);            }        });</code></pre><p><strong>In Activity A handle the call back:</strong></p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if (requestCode == PICK_COMPANY_REQUEST) {            if (resultCode == RESULT_OK) {                Toast toast = Toast.makeText(getApplicationContext(), ""Stock added"", Toast.LENGTH_SHORT);                toast.show();            }        }    }</code></pre><p>The <code>PICK_COMPANY_REQUEST</code> is never sent to the call back. Why is this? I am assuming because the Search Manager has the intent, and not Activity B. How can I make sure this gets invoked?</p><p><strong>onActivityResult() is never called. Why?</strong></p>","19875","","19875","","2010-08-30 17:35:20","2011-05-11 18:16:57","How to handle callback from Search Manager?","<android><activity><android-intent><android-searchmanager>","3","0","1","",""
"3597974","1","3598065","","2010-08-30 04:59:41","3","8179","<p>So I've always been under the assumption that you can't pass arrays between activities with extras. But I was just going through the Bundle class docs and saw <code>putStringArray(String key, String[] value)</code> and <code>public String[] getStringArray (String key)</code>. Are these new? They both say since API lvl 1, but I don't remember being able to pass arrays. Am I going crazy here?</p>","375874","","","","","2011-03-04 10:44:05","passing an array in intent android","<android><arrays><android-intent><bundle>","2","0","1","",""
"3597999","1","","","2010-08-30 05:06:26","2","319","<p>Having a video file, there is any way to access single pixel values? </p><p>I have two cases where I would like to access the pixels: </p><ol><li>From the video camera </li><li>From a video file What I need is geting a pixel information for a certain place with something like getPixel(posX, posY) and returning the RGB information </li></ol><p>I have an algorithm that detects blobs (homogeneous parts) of an image and I would like to implement it in real time using the android video camera and offline processing analyzing a video file. </p>","217527","","2961","","2011-03-07 10:52:19","2011-04-01 05:09:29","is there a way to access the pixels of a video?","<android><video><pixel>","1","2","","",""
"3598080","1","3598217","","2010-08-30 05:30:15","2","1878","<p>I want to pass an object from Activity B to Activity A.</p><p>Scenario:- Activity A calls Activity B- User selects item in Activity B- Activity B passes an object to Activity A</p><p>How do I accomplish this? And in which method do I read in the passed object in Activity A?</p>","19875","","","","","2012-05-21 04:23:38","How to pass objects between two activities?","<android><activity><android-intent>","2","2","2","",""
"3598210","1","","","2010-08-30 06:04:43","0","117","<p>is there a way to implement rotation in both direction in my app? I already know that Froyo support this, but I'm using sdk 1.6. Thank You for help  </p>","372021","","","","","2010-08-30 06:04:43","switch screen orientation in both direction","<android>","0","2","","",""
"3598231","1","3598924","","2010-08-30 06:09:24","1","1634","<p>I am trying to implement time zone change in broadcast receiver but its not working .my requirment is if i change the time zone it will go to another activity using broad cast receiver can anybody give example</p><p>Thanks</p>","426344","","550966","","2013-10-17 08:41:12","2013-10-17 08:41:12","Timezone example in broadcast receiver","<android>","2","1","","2012-08-22 12:18:21",""
"3598311","1","","","2010-08-30 06:23:31","0","212","<p>I have 2 Activities - A and B</p><p>In Activity A containing a list view spawns a new Sub-Activity B. In Acitivty B there is a button that launches Activity A so as to select another Sub-Activity B. </p><p>This seem to create an infinite loop scenario where</p><p>A->B->A->B->A->B->A->B->..............</p><p>So if i quit the program halfway, and the go back again will i get an issue?</p><p>because my programs has a exception thrown randomly that i have no solution to.</p>","394387","","114066","","2010-08-30 10:00:08","2010-08-30 22:44:00","Android: Infinite Sub-Activity. Will it be a memory issue?","<android><activity>","2","0","","",""
"3598445","1","3598483","","2010-08-30 06:56:15","2","8078","<p>This is for the first time i am using external storage in android.I need some help how can i perform different operations such as how to check whether External Storage is available or not?, How to write files or pictures into storage .</p>","1386533","","1225413","","2013-01-24 05:35:47","2013-01-24 05:35:47","How can i Use External Storage in android","<android><android-manifest><android-permissions>","2","0","","",""
"3598452","1","3598490","","2010-08-30 06:57:21","5","4821","<p>android code to delete the database from the application?</p>","339116","","302328","","2010-08-30 07:05:25","2010-08-30 09:40:33","Database Delete Android","<android><database><sqlite>","4","0","1","",""
"3598536","1","","","2010-08-30 07:12:12","1","345","<p>I have two different activities in my project.I intend to pass data from one activity to another. (As per user interface, I select an item from The spinner in one activity and send it as text msg.) The coding for text msg is done in another activity i.e the second activity.</p><p>I m successfully able to select the desired item from the Spinner but am not able to pass it as text message . I have tried using </p><pre><code> Bundle b=new Bundle(); b.putString(""Message"",message ); intent.putExtras(b); startActivity(intent);</code></pre><p>to select the item from first activity. It functions well BUT HOW DO I CAPTURE/RECEIVE THIS In the second activity that will send it as a text message.</p><pre><code>b = getIntent().getExtras();String s=b.getString(""Message"");</code></pre><p>The above mentioned code does not function and force closes the application.</p>","335984","","17174","","2010-08-30 07:28:08","2010-12-08 20:29:59","Selecting from Spinner & sending as text sms","<android><android-intent>","1","1","","",""
"3598551","1","","","2010-08-30 07:16:06","0","63","<p>We are developing an application for android 2.2.We do not have a developer phone.Can we load android 2.2 image on Zoom 1 Arm platform?</p><p>Thanks,Dheepak</p>","434708","","","","","2010-08-30 07:30:26","Android 2.2 App on Zoom1?","<android><arm><zoom>","2","0","","",""
"3598553","1","","","2010-08-30 07:16:27","0","1024","<p>In my app I am using Google Maps. On clicking a pin on Google Map we have to get an popup at that position. But I am using custom dialog it display the message at center of the mapview. How do I display a popup instead of dialog at the position we have clicked? Please give me a complete example in Android.</p>","429152","","834176","","2012-03-07 14:30:09","2012-03-16 04:55:40","How to put popups on clicking a pin present at google map","<android><google-maps>","2","0","","",""
"3598603","1","3598750","","2010-08-30 07:28:32","5","3337","<p>In my Android application I am using a header and a footer. In between I have a table inside a scrollview.<br>The problem is that I am not able to see the footer even if I am adding it the same as header, using <code>include</code> tag.<br>If I set the height and width of the scrollview to some specified length it works fine, but again, when it changes the orientation it doesn't.</p><p>Could any one let me know how I can make my footer visible at the bottom of the screen without changing the scrollview height?</p>","420261","","469983","","2012-10-26 07:47:19","2012-10-26 07:48:34","scrollView and footer issue in android","<android><scrollview>","2","0","1","",""
"3598662","1","3656925","","2010-08-30 07:39:36","12","21126","<p>I need to compile an application with system permissions in order to use target application com.android.settings. For now while I try to run my apk I get the error message</p><blockquote>  <p>Test run failed: Permission Denial:  starting instrumentation  ComponentInfo{com.jayway.test/android.test.InstrumentationTestRunner}  from pid=354, uid=354 not allowed  because package com.jayway.test does  not have a signature matching the  target com.android.settings</p></blockquote><p>How can I compile my application with system permissions? </p>","342863","","302328","","2010-08-30 07:43:03","2013-12-10 02:44:22","How to compile Android Application with system permissions","<android><permissions>","2","3","22","",""
"3598729","1","3598765","","2010-08-30 07:53:39","1","1104","<p>I'm developing on Android. I have to restart home and all its components (widgets, shortcuts, etc..). For example, when we have a Force Close, the home screen restart and reload all its components.</p>","353030","","114066","","2010-08-30 09:57:41","2010-08-30 09:57:41","Restart Home programmatically","<android><widget><restart><home>","2","0","","",""
"3598752","1","","","2010-08-30 07:58:28","2","1067","<p>I'm trying to implement an infowindow like the web version of google maps.I have created a custom layout extending a linear layout and populated it with a TextView and a button.</p><p>I have overrided the dispatchDraw method of the balloonLayout (wich extends LinearLayout) to draw a container with rounded corners and the balloon tip.</p><p>On my custom overlay class I save the tap coordinates to a variable and I draw the infowindow on the overrided draw method at the coordinates previously saved. The Info window draws OK but the button loses focus and never call it's onClick listener, It can be clicked (it doesn't get the pressed yellow state) and I can't figure why...</p><p>Thank you in advance.</p><p>This is my balloonlayout.class dispatchdraw method:</p><pre><code>@Overrideprotected void dispatchDraw(Canvas canvas){    Paint panelPaint  = new Paint();    panelPaint.setARGB(0, 0, 0, 0);    RectF panelRect = new RectF();    panelRect.set(0,0, getMeasuredWidth(), getMeasuredHeight());    canvas.drawRoundRect(panelRect, 5, 5, panelPaint);    RectF baloonRect = new RectF();    baloonRect.set(0,0, getMeasuredWidth(), 2*(getMeasuredHeight()/3));    panelPaint.setARGB(230, 255, 255, 255);            canvas.drawRoundRect(baloonRect, 10, 10, panelPaint);    Path baloonTip = new Path();    baloonTip.moveTo(5*(getMeasuredWidth()/8), 2*(getMeasuredHeight()/3));    baloonTip.lineTo(getMeasuredWidth()/2, getMeasuredHeight());    baloonTip.lineTo(3*(getMeasuredWidth()/4), 2*(getMeasuredHeight()/3));    canvas.drawPath(baloonTip, panelPaint);    super.dispatchDraw(canvas);}   </code></pre><p>This is the ballonlayout.xml</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.forgottenprojects.preciotaxi.balloonLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/transparent_panel""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:paddingLeft=""5px""    android:paddingTop=""5px""    android:paddingRight=""5px""    android:paddingBottom=""5px""    android:orientation=""vertical""    &gt;  &lt;TextView  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:id=""@+id/ballonLabel""  android:text=""coordenadas""  /&gt;    &lt;Button   xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:id=""@+id/ballonButton""  android:text=""Ir aquí""  android:clickable=""true""  /&gt;  &lt;/com.forgottenprojects.preciotaxi.balloonLayout&gt;</code></pre><p>And the tapOverlay.class</p><pre><code>class tapOverlay extends Overlay{public GeoPoint lastTap=null;private Context context;LayoutInflater inflater;balloonLayout noteBaloon;public tapOverlay(Context c){    this.context=c;    inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    noteBaloon = (balloonLayout) inflater.inflate(R.layout.balloonlayout, null);    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(200,100);     layoutParams.addRule(RelativeLayout.CENTER_VERTICAL);    layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);    noteBaloon.setLayoutParams(layoutParams); }@Overridepublic boolean onTap(GeoPoint p, MapView mapView) {    lastTap = p;    mapView.getController().animateTo(p);    return true;        }@Overridepublic void draw(Canvas canvas, MapView mapView, boolean shadow) {    Projection p = mapView.getProjection();    Paint paint = new Paint();    paint.setColor(0xFFFFFF00);    paint.setStrokeWidth(5);    paint.setAntiAlias(true);    if(lastTap!=null)    {                   drawInfoWindow(canvas, p, shadow, mapView);    }   super.draw(canvas, mapView, shadow);}private void drawInfoWindow(Canvas canvas, Projection myprojection,        boolean shadow, MapView mapView) {    try{        mapView.removeView(noteBaloon);        noteBaloon.setVisibility(View.VISIBLE);        TextView textmsg = (TextView) noteBaloon.findViewById(R.id.ballonLabel);        textmsg.setText(lastTap.getLatitudeE6()+"",""+lastTap.getLongitudeE6());        Button btn = (Button) noteBaloon.findViewById(R.id.ballonButton);        btn.setFocusable(true);        btn.setOnClickListener(btn_onclick);        mapView.addView(noteBaloon, new MapView.LayoutParams(200,200,lastTap,MapView.LayoutParams.BOTTOM_CENTER));        mapView.setEnabled(true);        mapView.invalidate();    } catch (Exception e)    {        Toast.makeText(context, e.getMessage(), Toast.LENGTH_LONG).show();    }}private OnClickListener btn_onclick = new OnClickListener() {    //This never shows...    @Override    public void onClick(View v) {        Toast.makeText(context, ""Se hizo clic... y ahora?"", Toast.LENGTH_LONG).show();    }};</code></pre><p>}</p>","366253","","366253","","2010-08-30 12:36:18","2010-08-30 12:36:18","MapView overlay popup with layout loses focus","<android><overlay><android-mapview>","0","0","1","",""
"3598908","1","3599184","","2010-08-30 08:26:56","0","1758","<p>I want to display a multichoice list in an alert dialog box. If I'm using an array to store the list of items, then it is working fine : </p><pre><code>d.setMultiChoiceItems(R.array.items,                    new boolean[]{false, true, false, true, false, false, false},                    new DialogInterface.OnMultiChoiceClickListener() {                        public void onClick(DialogInterface dialog, int whichButton,                                boolean isChecked) {                            /* User clicked on a check box do some stuff */                        }                    })</code></pre><p>But in my case, the item list is dynamic, which I'm geting from a database. The database keeps on updating its contents and hence the list is also updating at a fixed interval of time.So, instead of using an array I would like to use a cursor in the argument of setMultiChoiceItems.Can anyone please tell me how to do it....?</p>","395028","","","","","2010-08-30 09:19:46","Using Cursor with setMultiChoiceItems in Alert dialog","<android>","1","0","","",""
"3599119","1","","","2010-08-30 09:04:03","1","1280","<p>I create Scrollview with 10 layout.I want to change the layout position by dragging.</p><pre><code>layout_view.setOnTouchListener(new View.OnTouchListener() { @Overridepublic boolean onTouch(View v, MotionEvent ev) {final int action = ev.getAction();  switch (action) {   case MotionEvent.ACTION_DOWN: {...</code></pre><p>The problem is when i dragging DOWN/UP (When I dragging right/left it's work perfect):</p><p>1) MotionEvent.ACTION_CANCEL happen</p><p>2) the Scrollview is moving</p><p>1)How Can I disable Scrollview scrolling when I dragging my layout?</p><p>2) Do you have any idea how to stay in layout without getting MotionEvent.ACTION_CANCEL?</p><p>Thanks</p>","434779","","234976","","2011-12-07 01:10:36","2012-12-07 07:44:03","Android- Scrollview : change layout position by dragging","<android><scrollview>","1","1","1","",""
"3599206","1","","","2010-08-30 09:25:58","6","8160","<p>I used onKeyDown function in the activity.....but when back buttonbutton is clicked it first cancels the dialog box and goes to ouractivity...I want both either both activity and dialog box closed whenclicking the back button or disable the back button when the dialogbox is shown...</p><p>can any one suggest any solutions for this....</p><p>Thanks in advance,</p><hr><p><strong>Update</strong></p><p>Hello Thanks for your answer.The <code>progressDialog</code> with <code>.setCancelable(false);</code> is working fine.</p><p>But here I want different thing. When the progress dialog is running then i will press the BACK key and i want to show an alert dialog so that the user can notify that the progress is running.</p><p>Is there any solution about it?</p><p>Please help me.</p><p>Thanks in advance.</p>","433544","","53114","","2011-03-16 09:25:33","2013-08-11 19:44:54","How to disable the back button when the alert box is on the screen","<android><dialogbox>","4","0","4","",""
"3599210","1","3599219","","2010-08-30 09:27:06","30","23404","<p>Is there a way to extract and view the content of an .apk file?</p>","434805","","434805","","2010-09-01 12:23:55","2014-01-25 01:43:28","view content of apk file","<android><apk>","3","1","9","",""
"3599227","1","","","2010-08-30 09:30:15","0","1146","<pre><code>        Button showmapButton = (Button)findViewById(R.id.showmap);    showmapButton.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {    Intent intent = new Intent(HomePage.this,      ShowMap.class);    intent.putExtra(""username"", value);    startActivity(intent);   }        });</code></pre><p>In my main menu i have a button 'ShowMap'Everytime i click on showmap my map will hit a null pointer exception causing the program to crash.'ShowMap' works fine if i launch straight to that page without having a need to click button to call that activity.</p><p>I tried changing all my files to ""extends MapActivity"" instead of regular activitiy but the program will still crash whenever i click on show map</p><hr><pre><code>D/AndroidRuntime(  347): Shutting down VMW/dalvikvm(  347): threadid=1: thread exiting with uncaught exception (group=0x4001d800)E/AndroidRuntime(  347): FATAL EXCEPTION: mainE/AndroidRuntime(  347): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mp/com.mp.ShowMap}: java.lang.NullPointerExceptionE/AndroidRuntime(  347):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)E/AndroidRuntime(  347):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)E/AndroidRuntime(  347):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)E/AndroidRuntime(  347):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)E/AndroidRuntime(  347):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  347):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  347):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(  347):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  347):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  347):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(  347):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(  347):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  347): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime(  347):    at com.mp.ShowMap.onCreate(ShowMap.java:46)E/AndroidRuntime(  347):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)E/AndroidRuntime(  347):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)E/AndroidRuntime(  347):    ... 11 more</code></pre>","409557","","426671","","2014-02-26 18:59:02","2014-02-26 18:59:02","Switching from activity to MapActivity","<java><android><google-maps><map><activity>","2","2","","",""
"3599234","1","3599446","","2010-08-30 09:33:27","1","1126","<p>I'm looking for suggestions on how to go about adding a <code>ListView</code> selector that is 'permanent'.  By this, I mean a single row in the <code>ListView</code> is always highlighted; it should move up or down in reponse to any D-pad presses (i.e. like the default selector) but also remain set/highlighted if the user were to scroll the <code>ListView</code> in either direction (i.e. it's still highlighted even when it's off-screen).</p><p>I've looked at using the standard selector mechanism, but am unable to get the selector to remain in place if the <code>ListView</code> is touched (and thus scrolled), so it makes me think that this isn't the best option?  Perhaps there's a <code>&lt;selector&gt;</code> ""<code>state_*</code>"" that I've ignored?</p><p>The other option would be to use the <code>onItemSelected()</code> callback, but at first look this appears more convoluted?</p><p>Any suggestions/recommendations/experiences gratefully receieved.</p><p>Cheers</p><p>James</p>","286160","","","","","2010-08-30 10:10:59","Recommendations for a 'permanent' Selector in ListView","<android><listview><selector>","1","0","","",""
"3599270","1","18841858","","2010-08-30 09:41:22","0","969","<pre><code>I have parse the url and i get the html contents i want to show that content as a web page then what can i do to show that html contents. I am using textView then it shows same html content with tags. I have following html content which i want to display in webView. It displays only**//  Please** but its original output is not this.&lt;br /&gt;&lt;br /&gt;Read the handouts please for tomorrow.&lt;br /&gt;&lt;br /&gt;&lt;!--homework helphomework helphelp with homeworkhomework assignmentselementary schoolhigh schoolmiddle school// --&gt;&lt;font color=""#60c000"" size=""4""&gt;&lt;strong&gt;Please!&lt;/strong&gt;&lt;/font&gt;its original output is </code></pre><p>Read the handouts please for tomorrow.</p><p>Please! </p><p>I have other html also where there is a tag of img but this shows nothing</p><p>Please Suggest me how to solve this problem</p>","339116","","339116","","2010-09-01 13:36:57","2013-09-17 05:25:18","where i put html content in android to view","<android><textview>","2","0","","",""
"3599351","1","3599696","","2010-08-30 09:54:33","10","4902","<p>I am new to android. I what to know the difference between <code>Intent</code> and <code>BroadcastReceiver</code>. I am more confused with <code>BroadcastReceiver</code> than <code>Intent</code>.</p><p>Please help me out. Simple code will be helpful.</p>","366916","","844882","","2012-03-19 03:30:37","2012-03-19 03:30:41","Android-Broadcast Receiver","<android>","2","0","5","",""
"3599410","1","3600420","","2010-08-30 10:05:39","1","1351","<p>I have an activity that has a button which opens a new MapActivity to select a location by tapping on the map.</p><p>The map has an overlay that overrides the onTap method to get the location but I want to return that location to the previous activity but, I don't know how to return the geopoint to the mapactivity in order to call the setResult() and finish() methods, because I can't call them from the Overlay.onTap method.</p><p>Any ideas?</p>","366253","","","","","2010-08-30 12:45:14","How can I return the location pressed to the MapActivity from an Overlay onTap method","<android><overlay><android-mapview>","2","0","2","",""
"3599439","1","3600895","","2010-08-30 10:10:17","2","4857","<p>I would like to have the following screen in my application: button at the bottom of the screen; when user presses the button, a list with a number of items will appear and user should be able to click one of those to start another activity. The number of items can be different (depending on some other conditions);  the popup is to be adjusted to the button. How would you suggest implementing this?</p><p>Thanks a lot.</p><p>EDIT: One of the options is PopupWindow. Is there anything better than that?</p>","367677","","367677","","2010-08-30 10:18:56","2013-01-24 00:13:21","Floating popup window - how to implement","<android><gui>","4","2","1","",""
"3599471","1","","","2010-08-30 10:16:03","3","1369","<p>So I'm working on a <code>service</code> that will handle requests to send data to a socket.</p><p>I've done socket programming in a <code>service</code> before, but only within the same application. I'd like this to just sit and do nothing until any application wants to give it data to send. That's all well and good.</p><p>I have register an <code>intent filter</code> and the usual stuff and can process the data. But I want to process the data coming from different activities in different threads (subsequent calls from the same application will be computed on the same thread).</p><p>Is there a way to get the calling package or app or whatever? I'd prefer not to require passing in an identifier as an extra to prevent spoofing. (It's not a serious security concern, it's just each application needs its data processed in the order that it's received.)</p>","375874","","119895","","2010-08-30 10:56:24","2010-08-30 11:02:14","Get calling context in a service","<android><multithreading><service><context>","1","0","","",""
"3599508","1","","","2010-08-30 10:21:38","2","3624","<p>In my application, I need to display strings according to user locale selection. So, I put my <code>strings.xml</code> in <code>values-en</code>, <code>values-ko</code>, etc. How can I set locale us, australia i.e; <code>values-en_US</code>, <code>values-en_AU</code>? But it's throwing an error? Can any one tell me how to set these locales in my code?</p>","414777","","139010","","2010-10-18 16:23:10","2011-12-03 19:35:54","How to set different locales in android?","<android><localization><internationalization>","3","0","1","",""
"3599563","1","3599764","","2010-08-30 10:31:54","7","15970","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3521439/dialog-from-service-android"">Dialog from Service android</a>  </p></blockquote><p>How do i display dialog from a service ?</p>","216431","","114066","","2010-08-30 10:41:24","2011-12-28 04:47:26","android alert dialog from service","<android><service>","3","0","2","2012-09-11 20:14:59",""
"3599607","1","3599812","","2010-08-30 10:39:10","1","147","<p>I have to create a multiple directory like this path(""images/wallpaper/flower""). It should be stored in the External Memory of the phone.</p><p>How to do it? Any Idea?</p>","267269","","119895","","2010-08-30 11:12:12","2010-08-30 11:15:00","Creating Directories to categorize the images based on its type in Java/Android?","<java><android><file><directory>","1","0","","",""
"3599678","1","3631197","","2010-08-30 10:51:44","2","1573","<p>I'm using the following code which only zooms the loadData. How is it possible to zoom the image inside? Thank you in advance!</p><pre><code>WebView web = (WebView) findViewById(R.id.myid);    web.loadUrl(""file:///android_asset/image.jpg"");web.getSettings().setBuiltInZoomControls(true);web.setBackgroundColor(0);web.setVisibility(ImageView.VISIBLE);web.setBackgroundResource(R.drawable.myimage);</code></pre>","383576","","383576","","2010-08-30 16:12:12","2011-09-03 17:36:21","How to properly zoom a WebView together with it's background image?","<android><webview><zoom><imageview>","1","0","1","",""
"3599810","1","","","2010-08-30 11:14:24","0","220","<p>HI,I am writing a simple service application, below is the code of Activity and Service..,when i am calling startService(),and stopService() its working fine for the one time,in my case it has to give notification..from  next time onwards if call again startService(),and stopService() its not giving desired results...</p><p>Please  help me in that if I am missing something....ThanQ.</p><p>----------  this is my activity class  -------------package com.mypack.serviceex;</p><p>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;</p><p>public class serviceex extends Activity implements Button.OnClickListener{    /** Called when the activity is first created. */    Button bt1,bt2;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    bt1 = (Button) findViewById(R.id.Button01);    bt2 = (Button) findViewById(R.id.Button02);    bt1.setOnClickListener(this);    bt2.setOnClickListener(this);}@Overridepublic void onClick(View v) {    if( v == bt1)    {        Intent i = new Intent(serviceex.this,myservice.class);        Log.i(""err"",""onClick(View v...."");        startService(i);    }    else if(v == bt2)    {        Intent i = new Intent(serviceex.this,myservice.class);        Log.i(""err"",""else if(v == bt2)........"");        stopService(i);    }}</code></pre><p>}</p><pre><code>     ---------  this is my service   -------------</code></pre><p>package com.mypack.serviceex;</p><p>import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.util.Log;</p><p>public class myservice extends Service{</p><pre><code>private NotificationManager nmgr;public void onCreate(){    super.onCreate();    nmgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);    Log.i(""err"",""onCreate.........."");    Thread th = new Thread(null,new incls(),""service..."");}public void onStart(Intent intent,int sid){    super.onStart(intent, sid);    Log.i(""err"",""onStart........"");}public void onDestroy(){    super.onDestroy();    Log.i(""err"",""onDestroy.........."");    displayMessage(""Stopping Service"");}public void displayMessage(String str){    Log.i(""err."",""displayMessage....."");    Notification nf = new Notification(R.drawable.icon,str,System.currentTimeMillis());    PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this,myservice.class), 0);    nf.setLatestEventInfo(this, ""Service..."", str, pi);    nmgr.notify(R.string.uid, nf);}private class incls implements Runnable{    public void run()    {        Log.i(""err"",""public void run().........."");        System.out.println(""In Runnn"");    }}@Overridepublic IBinder onBind(Intent arg0) {    // TODO Auto-generated method stub    return null;}</code></pre><p>}</p>","431505","","","","","2011-03-22 06:18:31","problem with service","<android>","2","2","","",""
"3599821","1","3599842","","2010-08-30 11:16:22","0","317","<p>I am creating an application for android OS. The problem im facing is that running the application on different devices with different resolutions, the layout eitehr become too small, on hi res screens, or too chunky on low res screens. How do i make it so that my layouts adapt to the screen on the device??Do i use relative layout Or is there a way i can just find out the max screen length and width...?</p>","434885","","","","","2010-08-30 11:40:03","Android Dev: max screen length","<android>","1","0","1","",""
"3599827","1","","","2010-08-30 11:17:50","1","132","<p>I'm developing an Android game and I've got the garbage collection tothe point where it GC's only about once every 5 minutes or so, which Ithink is acceptable, for now.</p><p>The problem is that, every once in a while, I'll see this message inthe logs:</p><pre><code>08-29 09:58:46.410 W/copybit ( 1912): stretch_copybit::run_render fail08-29 09:59:09.000 E/libs3c2drender( 1912): intS3c2DRender::DoG2D(unsigned int, s3c_img*, s3c_rect*, unsigned int,s3c_img*, s3c_rect*, int, int)::S3C_G2D_ROTATOR_18176 fail</code></pre><p>And when this message comes up, my game seems to pause for about100-200 milliseconds..</p><p>I'm currently using a Canvas to draw with, although if my memory isaccurate, I've seen this same error message using Open GL as well.</p><p>Here's my code to draw the image object:</p><pre><code>cachedMatrix.reset();cachedMatrix.postTranslate(-halfImageWidth, -halfImageHeight);cachedMatrix.postScale(localScaleX, localScaleY);cachedMatrix.postTranslate(localOffset.x, localOffset.y);float degrees = (radiansToDegrees(-rotation) + 360f) % 360f;cachedMatrix.postRotate(degrees);cachedMatrix.postTranslate(screenPos.x, screenPos.y);canvas.drawBitmap(image, cachedMatrix, null);</code></pre><p>Frankly, I am at a loss as to how to get around this.  This is happening on my Samsung Moment phone.</p><p>Has anyone else encountered this issue ?  And found a workaround orinsights into why this is happening ?</p>","434888","","","","","2010-08-30 11:17:50","android render issue causing delays?","<android><matrix><rendering><delay>","0","0","","",""
"3599857","1","3599887","","2010-08-30 11:21:14","2","357","<p>I am writing an app where I get all the data from the rest call and display all the data in a custom component list(based on Linear Layout) which is added to a <code>LinearLayout</code>. I write this code in <code>onCreate</code> of the activity.</p><p>The problem is when I switch activity using <code>startActivity</code>, and come back to the calling activity (using <code>startActivity</code>) then <code>onCreate</code> is called again. I see <code>onPause</code>, <code>onStop</code> called when I call other activity.</p><p>Is there any way that I can save the application's state?</p>","215399","","491044","","2011-03-11 12:56:13","2011-03-11 12:56:13","Saving Application State in Android","<java><android>","1","0","1","",""
"3599871","1","","","2010-08-30 11:23:10","1","2038","<p>I am getting error like this ""</p><blockquote>  <p>error:parent Directory of a file not  writable""</p></blockquote><p>in android.</p><p>I've included <code>WRITE_EXTERNAL_STORAGE</code> permission, but it's not working.</p>","405452","","119895","","2010-08-30 11:29:37","2011-11-27 06:29:38","parent directory of file not writable","<android>","3","1","","",""
"3599937","1","3630545","","2010-08-30 11:34:20","2","626","<p><strong>Problem :</strong></p><p>I have to create a number of tables for caching some amount of textual data, obtained by reading XMLs. These tables need to be created only once - on the initial run of the application. The data in the tables should be cleared after fixed time period. There should be a class exposed to other classes that would allow CRUD operations on this database.</p><p>Googling found me some links to tutorials for creating databases and Data Access logic.</p><p>I have some questions, please help:</p><ol><li>How many DataBaseHelper(DBAdapter) classes should I have, I am guessing only one? Is it okay to have all the SQL DDL and DML statements, DB name, Table Names as static strings of this class?</li><li>How do I ensure that the tables are created only once?</li><li>Is it possible to clear the DataBase after a fixed time interval? </li><li>Are there any best practices to be followed when designing the database?</li><li>The data in the database is to be displayed in Lists. I have data in ArrayLists(created when parsing XML) as well as Database(after these lists are persisted). What adapter should I use to back the list up? Should I use ListAdapter or CursorAdapter?</li></ol><p>Thanks.</p>","236128","","","","","2010-09-02 19:33:47","SQLite Database and Data Access Logic","<android><sqlite3>","2","0","2","",""
"3600017","1","","","2010-08-30 11:47:14","0","3757","<p>I have Android LisView that was contain  TextView to display the data in the list,</p><p>I add to change it to Webview, after doing that everything look good except the setOnClickListener that not responding anymore..</p><p>I have read about the Webview and found that setOnClickListener is not supported, instead setOnTouchListener is supported is there</p><p>a way to use the same functionality as setOnClickListener in Android WebView ?</p><p>Like this:</p><pre><code>  myWebView.setOnClickListener(new OnClickListener(){                           @Override                           public void onClick(View v) {                          //do it ..                          }                         }); </code></pre><p>Thanks (:</p>","1514062","","","","","2012-12-31 11:30:18","setOnClickListener not response on Android WebView","<android><webview>","1","0","","",""
"3600027","1","3600098","","2010-08-30 11:48:54","13","11038","<p>Using the MapView in android, how can I set a default location, so that everytime I load up this application, it automatically centers/zooms location in on London?</p>","155695","","210807","","2010-08-30 12:33:03","2011-05-22 02:03:40","Android; MapView, how can I set default location?","<android><android-mapview><android-2.2-froyo>","1","0","3","",""
"3600042","1","3600368","","2010-08-30 11:51:31","2","454","<p>I want to put a background image in may java file from an image stored on the sdcard.I use the code below but with no success :/</p><pre><code>       TableLayout tl=new TableLayout(this);       int tmp = this.getResources().getIdentifier(""sdcard/pic.png"", ""drawable"", getPackageName());       tl.setBackgroundResource(tmp);</code></pre><p>an idea ?</p>","431652","","218196","","2010-08-30 11:53:28","2010-08-30 12:39:59","TableLayout background from sdcard","<android><background><tablelayout><identifier><sd-card>","1","0","","",""
"3600069","1","","","2010-08-30 11:56:19","1","1683","<p>I am using below code to  get the photo from my contacts..but this is throwing exception..</p><pre><code>android.database.sqlite.SQLiteException: unknown error: INTEGER data in getBlob_native.</code></pre><p>please help  me if I miss something. </p><pre><code>int idx = cursor.getColumnIndex(ContactsContract.Contacts.PHOTO_ID);byte[] img = cursor.getBlob(idx);ImageView i = (ImageView)findViewById(R.id.ImageView); Bitmap b = BitmapFactory.decodeByteArray(img, 0, img.length); </code></pre>","431505","","2485196","","2013-09-05 06:53:12","2013-09-05 06:53:12","Exception when getting photo content of contacts..","<android>","2","0","","",""
"3600100","1","","","2010-08-30 12:01:11","1","1241","<p>I am a newbie to android and trying to implement Quick Search Dialog for my application.</p><p>Actually, in my application I have an activity 1. where I have a Edit text and Search Button next to it2. Add Button and a Employee Table below it.</p><p>Whenever the user enters the search string in the EditText and clicks the Search button , I am calling the Quick Search Box and luckily it opens with the Search and here the user can see the given search query.Till this, every thing works perfectly as I want. </p><p>But what I want is:On-Clicking the Search button,the search query is displayed in the QSB and what I want is to display custom suggestions based on the search query and selecting the valid data , it should be saved in the Employee table.</p><p>Now I want Custom Suggestions to be displayed in a list view based on the search query.How do I proceed to achieve this. </p><p>Please provide links for Quick search Box custom suggestions also.</p><p>Thanks and Regards,Fazal Ahamed B</p>","434904","","776010","","2011-06-06 05:15:29","2011-06-06 05:15:29","Android:Quick Search Box - Adding Custom Suggestions","<android>","1","0","","",""
"3600149","1","","","2010-08-30 12:08:20","4","2889","<p>I am launching a mail activity by </p><p>//Sending mail</p><blockquote>  <p>final int SENT_MAIL = 1;</p>    <p>startActivityForResult(Intent.createChooser(i,  ""Send mail""),SENT_MAIL);</p></blockquote><p>and in </p><blockquote>  <p>onActivityResult(int req, int res,Intent data)</p></blockquote><p>i am trying to find the result of email sending, so as to confirm if my mail was sent or was discarded by the user.I am recieving null for Intent data</p><blockquote>  <p>i.e data =null</p></blockquote><p>parameter in onActivityResult(int req, int res, Intent data), res is always 0.</p><blockquote>  <p>ie. res = 0;</p></blockquote><p>Please let me know what can be done in this case?</p><p>Thanks in advance!</p>","434912","","","","","2010-08-30 12:58:39","Get Mail Sent Notification in onActivityResult ""Android""","<android><email><android-manifest><android-intent>","1","0","1","",""
"3600167","1","3600378","","2010-08-30 12:11:32","4","8515","<p>I would like to show the phone's photo gallery and when the user selects an image then notify my application on the image selected so I can get that images informations.</p><p>is that possible and how?</p>","234898","","142162","","2011-09-24 13:31:35","2011-09-24 13:31:35","android how to get phones photo gallery?","<android>","2","0","","",""
"3600326","1","3608117","","2010-08-30 12:34:57","4","4100","<p>Using the <code>smsManager</code> class can I send the same SMS to multiple numbers at the same time? Or would I need to do some sort of loop?</p><p>I want to send the sms from within my app not through the messaging program.</p>","329034","","119895","","2010-08-30 12:45:23","2014-03-20 13:01:04","In Android is it possible to send sms message to more than one recipient in code?","<android><sms>","1","4","2","",""
"3600329","1","","","2010-08-30 12:35:17","2","525","<p>Seems that a Service on Android is not the most popular method for implementing a persistent process for performing some background activity in Android.The suggestion is to use something like the alarm manager - however I am not sure if it is applicable to my situation.Advice welcomed.</p><p>What I am trying to implement is some background process that receives selected broadcasts.This process does some processing on the broadcast, and for example logs the results to a file.I can work out how to do this with a Service OK, but in earlier Android versions, the service seems to be killed relatively easily.</p><p>Are there alternatives to a service in this kind of application ??</p><p>Thanks</p>","434950","","","","","2010-08-30 12:44:39","Alternatives to using a Service for BroadcastReceiver Logging","<android>","2","0","","",""
"3600335","1","","","2010-08-30 12:35:37","3","1029","<p>I am hoping to create a program on my android (and/or more likely back at the server) to use the camera on the phone to capture an image of the card and break it into the corresponding parts and use them to identify the card to use in a database of my own creation.  The pattern recognition is where I could use help.  Ok, a card has a black border, a ""box"" at the top with the name of the card, an image, a box with the type of the card and a symbol that represents the set it was from, and a final box with some more descriptive text.  To start with, I will assume all cards follow that format.  Ok, at the least to identify that card, I need to identify the top box and OCR the typed text. If I could match the symbol in the middle box that would be great, but ..</p><p>Can anyone point me to either an API or article/book on the theory I would need to code it myself?</p>","434952","","","","","2013-09-19 13:06:40","Pattern recogntion - Magic the Gathering Card","<android><pattern-matching>","3","0","2","",""
"3600419","1","3600457","","2010-08-30 12:45:05","2","2390","<p>Hi i'm using Rotating Progress Bar in my Android Music Plyer Application....I'm not able to stop it. While working with horizontal Progress bar i used handler to stop and start it.  But while working with Rotating One, The progress bar goes into Infinite Loop.....</p><p>Can you please suggest method to stop the indefinite loop. Thanks in advance. </p>","396437","","","","","2012-05-20 15:37:26","How to use Rotating Progress Bar?","<java><android>","3","0","","",""
"3600713","1","3601373","","2010-08-30 13:21:16","17","22814","<p>Is there a way to obtain the size of the notification bar and title bar in android? At the moment I obtain display width and height with:</p><pre><code>Display display = getWindowManager().getDefaultDisplay();int width = display.getWidth();int height = display.getHeight();</code></pre><p>After that I want to subtract the sizes of the bars so that I can stretch a video without loosing ratio. Currently I hide the bars because I can't see a better way.</p>","352097","","","","","2013-05-29 15:00:14","Size of android notification bar and title bar?","<android>","6","0","6","",""
"3600763","1","","","2010-08-30 13:27:20","1","307","<p>i got this wired issue with the SearchDialog.</p><p>I followed the tutorial on <a href=""http://developer.android.com/guide/topics/search/search-dialog.html"" rel=""nofollow"">Using the Android Search Dialog</a></p><p>Everything works fine the search is available from any activity and does his job.</p><p>So my problem is that when i invoke the searchactivity with the SearchDialog, my imageorder in the listview, i use, is confused. that means one or more elements in the list have the same image. After a short scroll the listelements have the right image.</p><p>When i start the SearchActivity manually by setting the query to a fix value the images have the right order and no element has the same image.(Wihtout using the SearchDialog)</p><p>So i think the disorder of my imageviews has to do with the SearchDialog but i don have any idea why this is happening.</p><p>Below u find my Adapter and the xml-strukture, which i think are the important parts.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:gravity=""center_vertical""&gt;    &lt;LinearLayout android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;ImageView android:id=""@+id/thumbnail_preview""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:tag=""thumb_preview""            android:minWidth=""70dip""            android:minHeight=""70dip""            android:scaleType=""center""            android:src=""@drawable/loading"" /&gt;        &lt;LinearLayout android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:layout_weight=""1""            android:orientation=""vertical"" android:layout_gravity=""center_vertical""            android:paddingTop=""22dip""&gt;            &lt;TextView android:id=""@+id/name""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:layout_weight=""1"" android:singleLine=""true"" android:gravity=""left""                android:paddingLeft=""5dip"" android:textStyle=""bold""                android:textAppearance=""?android:attr/textAppearanceSmall""                android:textColor=""#FF000000"" /&gt;            &lt;TextView android:id=""@+id/type""                android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                android:layout_weight=""1"" android:singleLine=""true"" android:gravity=""left""                android:textAppearance=""?android:attr/textAppearanceSmall""                android:textStyle=""normal"" android:paddingLeft=""5dip"" /&gt;        &lt;/LinearLayout&gt;        &lt;ImageView android:id=""@+id/button_view""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:src=""@drawable/ic_btn_round_more_normal"" android:adjustViewBounds=""true""            android:layout_gravity=""center_vertical""            android:paddingRight=""10dip"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>And the Adapter.</p><pre><code>@Override    public View getView(int position, View convertView, ViewGroup parent)    {        final Record record = getItem(position);        ViewHolder holder;        if (convertView == null)        {            convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_view_search, parent, false);            holder = new ViewHolder();            holder.imageThumb = (ImageView) convertView.findViewById(R.id.thumbnail_preview);            holder.imageButton = (ImageView) convertView.findViewById(R.id.button_view);            holder.text = (TextView) convertView.findViewById(R.id.name);            holder.type = (TextView) convertView.findViewById(R.id.type);            convertView.setTag(holder);        }        else        {            holder = (ViewHolder) convertView.getTag();        }        if (record.isFlag())        {            holder.imageButton.setVisibility(ImageView.GONE);            holder.text.setText(record.hasFirstField().getText());            holder.text.setVisibility(ImageView.VISIBLE);            holder.type.setText(record.hasSecondField().getText());            holder.type.setVisibility(ImageView.VISIBLE);        }        else if (!record.isFlag())        {            holder.imageButton.setOnClickListener(new OnClickListener()            {                public void onClick(View v)                {                    Intent intent = new Intent().setClass(getContext(), DetailActivity.class);                    intent.putExtra(""com.objects.record"", record); //$NON-NLS-1$                    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                    getContext().startActivity(intent);                }            });            holder.imageButton.setVisibility(ImageView.VISIBLE);            holder.text.setText(record.hasFirstField().getText());            holder.type.setVisibility(ImageView.INVISIBLE);            holder.imageThumb.setImageResource(R.drawable.loading);            holder.imageThumb.setScaleType(ImageView.ScaleType.CENTER);            if (!mBusy &amp;&amp; !record.isFlag())            {                AsyncTask&lt;Record, Void, Drawable&gt; asyncTask = new AsyncDrawableDownloader(getContext(),                        holder.imageThumb, true, null).execute(record);                holder.imageThumb.setVisibility(ImageView.VISIBLE);                holder.imageThumb.setEnabled(false);            }            else            {                holder.imageThumb.setImageResource(R.drawable.loading);                holder.imageThumb.setScaleType(ImageView.ScaleType.CENTER);                holder.imageThumb.setVisibility(ImageView.VISIBLE);            }        }        return convertView;    }</code></pre><p>Hope someone can help me with this.</p><p>Here an additional Info the ImageView changes its content.u can watch the imageView change its content, first load is the right image, which is overriden by some other image from the list</p><p>Greetingspadde83</p>","432805","","432805","","2010-08-30 14:05:24","2010-08-30 14:05:24","SearchDialog & ListView","<android>","0","0","","",""
"3600990","1","3601058","","2010-08-30 13:56:20","2","238","<p>I hope this isn't too off topic for this forum, but I have been developing Android apps using an unlocked N1 with 2.2 and would like to continue with two additional unlocked Android phones. <a href=""http://stackoverflow.com/questions/2133296/best-phone-for-doing-android-sw-development"">A similar question was asked in January</a>, but much has changed since then, eg: Brightstar is out of N1 stock and there are a lot of new devices on the market. Also, I plan to target 2.2 and up since apps are not MicroSD loadable (as far as I know) on earlier OS versions.</p>","398460","","","","","2010-08-30 14:04:43","Which unlocked Android 2.2 phones are close to or better than the N1 for development?","<android>","2","0","","",""
"3601014","1","3601610","","2010-08-30 13:59:33","0","2938","<p>I see that multiple broadcasts (<a href=""http://developer.android.com/reference/android/content/Intent.html#ACTION_TIME_TICK"" rel=""nofollow"">ACTION_TIME_TICK</a>, for example) cannot be registered in the manifest, the must be explicitly registered via <code>Context.registerReceiver()</code>. I am having trouble with the <a href=""http://developer.android.com/reference/android/content/Intent.html#ACTION_USER_PRESENT"" rel=""nofollow"">ACTION_USER_PRESENT</a> broadcast intent. Specifically, I test on the emulator and my application keeps force closing with the error: </p><pre><code>08-30 09:44:23.397: ERROR/AndroidRuntime(290): java.lang.RuntimeException: Unable to start receiver me.turnerha.RegisterListeners: java.lang.IllegalArgumentException: Receiver not registered: me.turnerha.RegisterListeners@43d05690</code></pre><p>This is caused by </p><pre><code>08-30 09:44:23.397: ERROR/AndroidRuntime(290): Caused by: java.lang.IllegalArgumentException: Receiver not registered: me.turnerha.RegisterListeners@43d05690</code></pre><p>My manifest is fairly simple:</p><pre><code>    &lt;receiver android:name="".RegisterListeners""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.SCREEN_ON"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>Any thoughts? I am essentially attempting to create a Receiver that is awakened as soon as possible after my application is installed. The first time it is awakened, it registers a few listeners, and then it unregisters itself so it is never called again. (I really wish there was an intent fired immediately after your app had been installed, to allow a small bit of setup :) )</p>","119592","","114066","","2011-11-14 09:54:53","2013-09-26 06:12:36","Can an ACTION_USER_PRESENT BroadcastReceiver not be registered in the manifest?","<android><android-manifest><broadcastreceiver>","3","0","","",""
"3601114","1","3601174","","2010-08-30 14:11:16","2","1810","<p>How to add items to a ListView in Android during runtime?</p>","421372","","","","","2012-02-15 19:25:04","How to add items to a ListView during runtime?","<android>","2","1","","",""
"3601143","1","","","2010-08-30 14:14:17","1","604","<p>I have a RelativeLayout whose layout_height is set to ""wrap_content"" and inside that I have a TextView whose text is set at runtime. I have set android:layout_height=""wrap_content"" to my TextView, but it doesn't seems to change the height of the Textview even if the content is larger than 1 line. </p><p>It only takes the height of single line and displays 1 line, and all the remaining lines appears to be marquee vertically which is seen when I drag it manually...</p><p>So plz anyone can help me out.</p>","435025","","435025","","2010-08-31 13:13:51","2012-09-28 10:53:09","Android - TextView height issue according to content (text)","<android>","1","2","","",""
"3601145","1","3601195","","2010-08-30 14:14:20","0","330","<p>Is it posible to load a class from the internet in Android? My app would download a class with some data, save it on sdcard, and then load the class. I want this because loading data via classloader is much faster then from a file.</p>","243225","","","","","2010-08-30 15:08:57","Load class from the internet/filesystem in Android","<java><android>","2","2","","",""
"3601184","1","","","2010-08-30 14:18:41","5","4134","<p>I am having strange behaviour on my Android emulator. window.open() always returns undefined when called from setTimeout or callback function e.g. AJAX callback. However window.open() successfully opens a popup when called from an event handler e.g. onclickhere is sample code:</p><pre><code>&lt;html&gt;&lt;head&gt;&lt;/head&gt;    &lt;body&gt;    &lt;script type=""text/javascript""&gt;    function fnc()    {      setTimeout(function() { alert(window.open('about:blank')) }, 100);    }    &lt;/script&gt;    &lt;input type=""button"" onclick=""fnc()"" value=""push me""&gt;    &lt;/body&gt;&lt;/html&gt;</code></pre><p>In the example alert(window.open('about:blank')) shows 'undefined' and the popup is not createdThe same function works when called straight from fnc()</p><p>Any ideas?</p><p>Thanks</p>","435039","","","","","2010-09-19 11:47:38","window.open() returns undefined when called from setTimeout on Android","<javascript><android>","1","7","1","",""
"3601419","1","3602015","","2010-08-30 14:45:28","1","1621","<p>I am writting my application using api 1.6. The code runs just fine on the emulators 1.6-2.2. </p><p>But when I try to debugging it on my device which runs 2.1 <code>data.getData()</code> returns null. I have this in the AndroidManifest.xml <code>&lt;uses-permission android:name=""android.permission.READ_CONTACTS""/&gt;</code></p><p>Any one have any thoughts. I am new to android, thanks.</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button btnTest = (Button) findViewById(R.id.btnTest);        btnTest.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);                startActivityForResult(intent, ACTIVITY_PICK_CONTACT);            }        });    }@Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        switch (requestCode) {        case (ACTIVITY_PICK_CONTACT):            if (resultCode == Activity.RESULT_OK) {                // This is where it is broke                            Uri uri = data.getData();                Intent intent = new Intent(this, PickContactInfo.class);                intent.putExtra(Keys.CONTACT_URI, uri.toString());                startActivity(intent);            }            break;        }    };</code></pre>","86452","","","","","2010-08-30 15:53:20","Intent.getData() is null when trying to read contact data on device","<android><debugging>","1","0","","",""
"3601454","1","3601608","","2010-08-30 14:49:11","0","284","<p>How can I improve the performance of simultaneous processes with regard to execution time and memory consumption in Android?</p>","730776","","63550","","2011-02-02 21:10:46","2011-02-02 21:16:13","How can I manage simultaneous activities in Android?","<android>","1","1","0","",""
"3601535","1","","","2010-08-30 14:56:14","4","1530","<p>I have a general Android design question around data access. I have a number of activities in my application that need to access a SQLite database. In order to wrap up all data access logic in one place I have created a DatbaseHandler class that takes care of all data access logic. This class takes care of building up where clauses, calling the database and interrogating the resulting cursor to retrieve the query results and return them to the caller. The purpose of this class is to wrap all data access code in one place so that it can be easily managed and maintained as opposed to having data access logic scattered across all activities. Each activity that needs access to the database creates an instance of this DatabaseHandler class and passes it a reference of android.content.Context. The DatabaseHandler class then uses this Context object to call an underlying content provider as follows context_i.getContentResolver().query(...).</p><p>My data access logic (cursor handling logic to be specific) is not in the activity and so I cannot manage the cursors life cycle, therefore there is likely to be memory leaks. </p><p>My questions are as follows - </p><ol><li>How can I (if its even possible) manage the cursors life cycle from outside an Activity? </li><li>Should each activity even be creating an instance of this data handler class and passing an instance of Context to it? Perhaps my design approach is wrong and I should expose these data access functions as static methods that take an instance of the calling activity as a parameter. That way I could perform managed queries and let the activity take care of managing the cursors life cycle?</li></ol><p>I'd really like to get an understanding of the best approach. Any advice would be greatly appreciated</p>","435075","","","","","2010-08-30 16:32:04","Android Database Access Design Approach","<android>","1","0","1","",""
"3601578","1","3603039","","2010-08-30 14:59:52","3","1085","<p>I am generating a custom View that contains a number of drawables that are added to the View dynamically. This means the View's size could be anything, and is likely to stretch off the screen. Where it does stretch off the screen I want scrolling to be enabled.</p><p>So far I have tried:</p><ul><li>adding the custom view directly to my <code>Activity</code> - this displays the drawables ok, but with no scrolling</li><li>adding the custom view as a child to a <code>ScrollView</code> and setting the <code>ScrollView</code> as the content in the <code>Activity</code> - this doesn't display anything.</li></ul><p>How do I generate a custom view of arbitrary size, display it and have scrolling where it is too big for the screen?</p>","27805","","119895","","2010-08-30 18:11:01","2010-08-30 18:14:32","How to display a custom view in Android?","<android>","1","0","1","",""
"3601581","1","","","2010-08-30 15:00:13","0","858","<p>Can anyone provide me with the info to parse an XML file in an Android application.Any link on this will be helpful.</p>","323101","","1303417","","2012-05-02 17:40:18","2012-05-02 17:40:18","Parsing a XML file in Android","<android><xml>","3","0","","",""
"3601668","1","","","2010-08-30 15:09:55","0","241","<p>I have a simple problem:i have a listview with 2 TextViews one shows a number and the other shows the diff from last time the number has chnaged.</p><p>What im trying to do is every time the getView is called on my adapter show an animation on the second TextView based on the change in the first Textview number. im trying to do this for all of the items inside the listview and it doesnt work.</p><p>What is the best way to achieve this?</p><p>Thanks,   Totem</p>","274180","","","","","2011-04-15 03:01:52","Animate Textview inside a listview row","<android><listview>","1","1","","",""
"3601687","1","","","2010-08-30 15:12:01","0","485","<p>I am using the default Android Media Player in an Activity, trying to play back a couple of video files. However I have a problem with programming what I want. The desired program outcome would be the following:</p><ul><li>A video file is played back</li><li>After that, a dialog is shown, asking the user something</li><li>A pause of 5 seconds occurs</li><li>The next video is shown</li><li>and so forth</li></ul><p>How am I to program this? Currently, I use a paradigm like the following:</p><ul><li>I have a method that sets up the player for the a file, e.g. <code>playVideo(int)</code> So I pass it the first file.</li><li>When the player is prepared, it will be started in <code>onPrepared(MediaPlayer)</code>.</li><li>When the video is finished, the <code>onCompletion(MediaPlayer)</code> listener of the media player shows the dialog to the user by calling <code>showDialog()</code>.</li><li>The user accepts the dialog. Before calling <code>dismiss()</code> on the dialog, the player object is started for the next file by calling <code>playVideo(int)</code>.</li></ul><p>This works, but it feels a bit quirky and not clean. And it's of course very procedural. The problems are:</p><ul><li>that I can't figure out how to insert a pause after the dialog is dismissed.</li><li>that I maybe want to change the presentation order of dialogs and videos and this ain't too easy now</li></ul><p>Has anyone got an idea?</p>","435093","","","","","2010-08-31 06:15:11","Android Media Player Threading/Concurrency","<java><android><media-player>","1","0","","",""
"3601775","1","3602510","","2010-08-30 15:22:12","5","22689","<p>I am trying to display an image from a URL, which may be larger than the screen dimensions.  I have it kind of working, but I would like it to scale to fit the screen, and I also have problems when the screen orientation changes.  The image is tiny, and I would like it to scale its width to the screen as well.  (In both cases, I would like the image to fill the screen width with scrollbars (if necessary for height).</p><p>Here is my ImageView:</p><pre><code>&lt;ImageView android:id=""@+id/ImageView01""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:scaleType=""fitCenter""    android:adjustViewBounds=""true""&gt;&lt;/ImageView&gt;</code></pre><p>Here is the java code which loads the image: (some error handling code removed for simplicity)</p><pre><code>    Object content = null;    try{      URL url = new URL(""http://farm1.static.flickr.com/150/399390737_7a3d508730_b.jpg"");      content = url.getContent();    }      catch(Exception ex)    {        ex.printStackTrace();    }    InputStream is = (InputStream)content;    Drawable image = Drawable.createFromStream(is, ""src"");    Image01.setImageDrawable(image);</code></pre><p>I have tried different settings for android:scaleType.  I'm sorry if this question has been asked before.  I've gone through a number of tutorials on the subject, but they don't seem to work for me.  Not sure if it has anything to do with the way the image is loaded. (from the web instead of a local resource)</p><p>Another issue is that sometimes the image doesn't even load.  There are no runtime errors, I just get nothing in the ImageView.</p><p>Please let me know if you need more information or clarification.</p>","434574","","","","","2010-08-30 22:49:31","Display image from URL - sizing and screen orientation problems","<android><imageview><screen-orientation>","1","0","5","",""
"3601820","1","3602134","","2010-08-30 15:27:20","3","2018","<p>I'm building an android app and I'm currently having trouble retrieving a bitmap from an URL. Here is the code I'm using :</p><pre><code>public static Bitmap bmpFromURL(URL imageURL){    Bitmap result = null;    try {        HttpURLConnection connection = (HttpURLConnection)imageURL .openConnection();        connection.setDoInput(true);        connection.connect();        InputStream input = connection.getInputStream();        result = BitmapFactory.decodeStream(input);    } catch (IOException e) {        e.printStackTrace();    }    return result;}</code></pre><p>Everything works fine when the picture's write but when some bytes are wrong, result gets null. I think it's basically expectable as it's written this in the doc of <code>BitmapFactory.decodeStream</code> :</p><blockquote>  <p>If the input stream is null, or cannot be used to decode a bitmap, the function returns null. The stream's position will be where ever it was after the encoded data was read.</p></blockquote><p>The problem is, my wrong picture is well interpreted by my web browser and I can do so on iPhone platform.</p><p>Is there a way to sort of ignore those wrong pixels? maybe with the option parameter?</p><p>Any help appreciated</p><p>Romain </p>","334209","","","","","2012-05-17 22:22:21","BitmapFactory.decodeStream(inputStream) always return null when some bytes are wrong","<java><android><bitmap><byte><inputstream>","2","0","1","",""
"3601867","1","3602906","","2010-08-30 15:33:46","2","2018","<p>Been stuck on this for days, things just aren't working with how I'm setting this up. I have a large grid of ImageViews which are all the same size. It's made up of a Horizontal LinearLayout and within that, 5 Vertical LinearLayouts (first picture). </p><p>What I want (and I don't care how, be it using RelativeLayout, Linear or Tables) is if I were to set say Image #2 to a larger image (specifically 3x3 of the smaller ones) I want it to effectively 'overwrite' those images (as shown in picture 2).</p><p>I've tried doing this by setting the 'overwritten' images (3,4,7,8,9,12,13,14) to setVisibility(GONE) which works fine but then the second vertical LinearLayout has expanded to fit the size of the new image which I don't want. If I try setting it to fill_parent though it squashes the size of the image. As a result, what I get is the third picture.</p><p>All associated XML code (id codes match those on the image):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt; &lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;     &lt;ImageView android:id=""@+id/gs01""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs06""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs11""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs16""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;     &lt;ImageView android:id=""@+id/gs02""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs07""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs12""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs17""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;     &lt;ImageView android:id=""@+id/gs03""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs08""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs13""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs18""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;     &lt;ImageView android:id=""@+id/gs04""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs09""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs14""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs19""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;     &lt;ImageView android:id=""@+id/gs05""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs10""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs15""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;    &lt;ImageView android:id=""@+id/gs20""        android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""top""        /&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>If I were to do this using RelativeLayouts, I run into problems when I setVisibility(GONE) since the position may very well be referenced using a missing View. Setting it to INVISIBLE just leaves a blank space, when what I really want is effectively it to be of 0px by 0px in size.</p><p>Any help at all would be appreciated; it seems no matter what I try something always goes slightly wrong with it, and it's driving me insane.</p><p><img src=""http://i.stack.imgur.com/Vjs6h.jpg"" alt=""alt text""></p>","250286","","","","","2010-08-30 17:52:53","Android Linear/RelativeLayout sizing with ImageViews","<android><imageview><android-linearlayout>","2","0","1","",""
"3601869","1","","","2010-08-30 15:34:10","0","1115","<p>Is it possible to get a multiple contact selection activity in Android?</p>","385352","","","","","2010-08-30 15:40:31","Multiple contact selection in Android","<android><selection><contacts>","1","0","","",""
"3601928","1","","","2010-08-30 15:41:45","4","3980","<p>I have a requirement to Capture the image without showing the Preview..And i want to do it in the Background as a Service.</p><p>Is it possible to do that?? </p>","419389","","","","","2011-05-08 17:40:41","Camera Capture Without Preview in Android 2.2","<android>","1","0","3","",""
"3602026","1","","","2010-08-30 15:54:34","9","3619","<p>I'm trying to dynamically adjust the height of my rows depending on the (screen height - my layout height) / list.size.</p><p>Unfortunately in the <code>onCreate</code> method the layout height returns null (not so when i call it in an on click listener).</p><p>Is there another method I can call it in?</p>","435128","","119895","","2011-04-11 03:24:03","2013-03-26 05:43:15","LinearLayout height in onCreate is 0","<android>","1","0","10","",""
"3602092","1","","","2010-08-30 16:04:22","0","3942","<p>[First, sorry, I couldn't come up with a more intelligent question title.]</p><p>Okay, hang with me while you read this long post.</p><p>I am new to Android, this is my very first dummy Pizza Order application.  I am playing with XML layouts and have got some questions.</p><ul><li>The editText_CardNo goes out of screen, its column isn't stretching, why? (<a href=""http://imagebin.org/112036"" rel=""nofollow"">Image</a>)</li></ul><p>[EDIT]</p><ul><li>Can I specify a global layout_marginRight for all TableRow?</li></ul><p><strong>Resolved</strong></p><ul><li>I have aligned elements using alignBaseline but I don't see it working.</li><li>In the Crust section i have done layout_span=""2"" but no use, the second radio button's text still wraps. (<a href=""http://imagebin.org/112034"" rel=""nofollow"">Image</a>)</li><li><p>Inner Tables e.g. TableLayout inside TableRow appear really ugly, only left half is visible, also tried with adding layout_span inside TableLayout or the TableRow containing it but no use. (<a href=""http://imagebin.org/112035"" rel=""nofollow"">Image</a>)</p></li><li><p>How can I collapse the subsections e.g. TableLayout inside TableRow using properties?</p></li></ul><p><strong>main.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView android:id=""@+id/scrollView_PizzaOrder""xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TableLayout android:id=""@+id/tableLayout_PizzaOrder""android:shrinkColumns=""0""android:stretchColumns=""1""android:layout_gravity=""left""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;TableRow android:id=""@+id/tableRow_PizzaType""android:layout_marginTop=""10px"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""Type"" android:id=""@+id/textView_Type""android:textStyle=""bold""android:layout_alignBaseline=""@+id/spinner_Type""     android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;Spinner android:id=""@+id/spinner_Type""android:drawSelectorOnTop=""true"" android:layout_width=""200px"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;  &lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_PizzaSize"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""Size"" android:id=""@+id/textView_Size""  android:textStyle=""bold""android:layout_alignBaseline=""@+id/spinner_Size"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;Spinner android:id=""@+id/spinner_Size""android:drawSelectorOnTop=""true""android:layout_marginBottom=""20px""   android:layout_width=""200px"" android:layout_height=""wrap_content""&gt;&lt;/Spinner&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_Crust"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;RadioGroup android:id=""@+id/radioGroup_Crust"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;RadioButton android:text=""Single Crust"" android:id=""@+id/radioButton_SingleCrust""android:checked=""true"" android:layout_span=""2""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/RadioButton&gt;&lt;RadioButton android:text=""Double Crust"" android:id=""@+id/radiobutton_DoubleCrust""android:layout_span=""2""android:layout_marginBottom=""20px"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/RadioButton&gt;&lt;/RadioGroup&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_Toppings""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""Extra Toppings?"" android:id=""@+id/checkbox_ExtraToppings""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_ToppingsTable""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TableLayout android:id=""@+id/tableLayout_Toppings""android:layout_marginLeft=""20px""      android:layout_gravity=""left""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TableRow android:id=""@+id/tableRow_SelectToppings""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""Olives""android:id=""@+id/checkbox_Olives""android:checked=""true""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;CheckBox android:text=""Cheese""android:id=""@+id/checkbox_Cheese""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_SelectCustomToppings""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""Custom""android:id=""@+id/checkbox_Custom""android:layout_marginRight=""10px""android:layout_alignBaseline=""@+id/editText_Custom""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;EditText android:text=""""android:id=""@+id/editText_Custom""android:singleLine=""true""    android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt; &lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_SeparaterDrinks"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;View android:layout_height=""2px""android:background=""#884400""android:layout_span=""2""android:layout_margin=""25px"" /&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_Drinks""android:layout_span=""2"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""Drinks?"" android:id=""@+id/checkbox_Drinks""android:checked=""true""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;/TableRow&gt; &lt;TableRow android:id=""@+id/tableRow_DrinksTable"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TableLayout android:id=""@+id/tableLayout_Drinks""android:layout_marginLeft=""20px""android:layout_gravity=""left""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TableRow android:id=""@+id/tableRow_SelectDrinksPepsi""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;!-- Drinks links, for now static generation, later use XML and Dynamic Generation --&gt;&lt;CheckBox android:text=""Pepsi""android:id=""@+id/checkbox_Pepsi""android:checked=""true""android:layout_alignBaseline=""@+id/textView_QuantityPepsi""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;TextView android:text=""Quantity:""android:id=""@+id/textView_QuanityPepsi""android:textStyle=""bold""android:layout_alignBaseline=""@+id/editText_QuantityPepsi""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;EditText android:text=""1""android:id=""@+id/editText_QuantityPepsi""android:singleLine=""true""android:maxLength=""3""android:numeric=""integer""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt; &lt;TableRow android:id=""@+id/tableRow_SelectDrinksCoke""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""Coke""android:id=""@+id/checkbox_Coke""android:layout_alignBaseline=""@+id/textView_QuantityCoke""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;     &lt;/CheckBox&gt;&lt;TextView android:text=""Quantity:""android:id=""@+id/textView_QuantityCoke""android:textStyle=""bold""android:layout_alignBaseline=""@+id/editText_QuantityCoke""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;EditText android:text=""0""android:id=""@+id/editText_QuantityCoke""android:singleLine=""true""android:maxLength=""3""android:numeric=""integer""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_SelectDrinksSprite""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""Sprite""android:id=""@+id/checkbox_Sprite""android:layout_alignBaseline=""@+id/textView_QuantitySprite""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;TextView android:text=""Quantity:""android:id=""@+id/textView_QuantitySprite""android:layout_alignBaseline=""@+id/editText_QuanitySprite""android:textStyle=""bold""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;     &lt;/TextView&gt;&lt;EditText android:text=""0""android:id=""@+id/editText_QuantitySprite""android:singleLine=""true""android:maxLength=""3""android:numeric=""integer""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_SelectDrinksMountainDew""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""Mirinda""android:id=""@+id/checkbox_Mirinda""android:layout_alignBaseline=""@+id/textView_QuantityMirinda""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;TextView android:text=""Quantity:""android:id=""@+id/textView_QuantityMirinda""android:layout_alignBaseline=""@+id/editText_QuantityMirinda""android:textStyle=""bold""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;EditText android:text=""0""android:id=""@+id/editText_QuantityMirinda""android:singleLine=""true""android:maxLength=""3""android:numeric=""integer""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_SelectDrinks7up""     android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""7up""android:id=""@+id/checkbox_7up""android:layout_alignBaseline=""@+id/textView_Quantity7up""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;TextView android:text=""Quantity: ""android:id=""@+id/textView_Quantity7up""android:layout_alignBaseline=""@+id/editText_Quantity7up""android:textStyle=""bold""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;EditText android:text=""0""android:id=""@+id/editText_Quantity7up""android:singleLine=""true""android:maxLength=""3""android:numeric=""integer""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_SeparaterMember"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;View android:layout_height=""2px""android:background=""#884400"" android:layout_span=""2""android:layout_margin=""25px"" /&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_Member"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;CheckBox android:text=""Are you a Member?"" android:id=""@+id/checkbox_Member""android:layout_span=""2"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_MemberData""android:layout_marginLeft=""20px"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""Card #:"" android:id=""@+id/textView_CardNo"" android:textStyle=""bold""android:layout_alignBaseline=""@+id/editText_CardNo""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;EditText android:text="""" android:id=""@+id/editText_CardNo""android:singleLine=""true""android:maxLength=""8""  android:numeric=""integer"" android:layout_width=""200px"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_SeparaterMemberData"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;View android:layout_height=""2px""android:background=""#884400""android:layout_span=""2""android:layout_margin=""25px"" /&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_Name"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""Name:"" android:id=""@+id/textView_Name""android:layout_alignBaseline=""@+id/editText_Name""android:textStyle=""bold""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;EditText android:text="""" android:id=""@+id/editText_Name""android:singleLine=""true""android:maxLength=""35""android:layout_width=""200px"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_CellNumber"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""Cell:"" android:id=""@+id/textView_Cell""android:textStyle=""bold""android:layout_alignBaseline=""@+id/editText_Cell""    android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;EditText android:text="""" android:id=""@+id/editText_Cell""android:singleLine=""true""android:phoneNumber=""true""android:maxLength=""15""android:layout_width=""200px"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_Address"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;TextView android:text=""Address:"" android:id=""@+id/textView_Address""android:textStyle=""bold""android:layout_alignBaseline=""@+id/editText_Address""android:layout_width=""wrap_content""android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;EditText android:text="""" android:id=""@+id/editText_Address""android:singleLine=""true""android:maxLength =""200""android:layout_width=""200px"" android:layout_height=""wrap_content""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRow android:id=""@+id/tableRow_PlaceOrder"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;&lt;Button android:text=""Place Order!"" android:id=""@+id/button_PlaceOrder""  android:onClick=""placeOrder""android:layout_column=""1""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/ScrollView&gt;</code></pre>","92796","","105170","","2010-08-30 21:26:30","2010-08-30 21:26:30","Android, layout_width and width, alignBaseline, TableLayout and layout_span related questions","<android><tablelayout>","1","0","","",""
"3602321","1","","","2010-08-30 16:33:42","1","3623","<p>I'm creating an app that I want to seed with a data file the app will use as its initial state.  In the Eclipse project structure, where do I add the data file so that when the app is deployed to the device (and emulator) the data file is deployed with it?</p>","100518","","","","","2010-08-30 18:16:10","Include a data file with my Android app","<android><eclipse><file><data>","1","0","0","",""
"3602385","1","3602583","","2010-08-30 16:41:50","0","293","<p>I am a newbie to Android and playing around with the UI and SQLLite for a while and it looks pretty good to me . We have a requirement that for the App that all the questions would be coming from the server through REST / Web service which would be displayed on the App..</p><p>say for e.g  if there are 4 questions 1) Enter your Name -- Text Box2) Did you sleep well last night -- YES / NO3) How many hours did you sleep - Text Box4) How did you hear about us -- Drop down</p><p>So the requirement is that the Questions would be displayed on the App after doing a SYNC with the server during the SYNC with the server the Questions would be downloaded from the SERVER through REST / Web service..if the phone is not connected then pull the questions from the Database...</p><p>These questions are simple questions and they change quite often and we have a similar app which is there for iphone which does this ....</p><p>Has any one worked on this before please advice me so that I can get it started</p>","435170","","","","","2010-08-30 17:07:37","Android: I need to prepare the UI from the webservice","<android><web-services><user-interface><rest><pull>","1","0","","",""
"3602393","1","","","2010-08-30 16:42:59","1","1066","<p>In my application, I have problem with activity history stack. Indeed, consider I have 5 activities : </p><ol><li>Splashscreen </li><li>SignUp</li><li>SignIn</li><li>ForgottenPassword </li><li>Home</li></ol><p>I would see :</p><ul><li>First launch (user not logged) : 3 differents wireframes possible<ul><li>Splashscreen -> SignUp -> Home</li><li>Splashscreen -> SignUp (already member) -> SignIn (valid log) -> Home</li><li>Splashscreen -> SignUp (already member) -> SignIn -> ForgottenPassword (login/password receive by mail)-> SignIn (valid log) -> Home</li></ul></li><li>Other launch (user registered) : Splashscreen -> Home (auto log)</li></ul><p>The problem is : I would like 2 tasks, one with Splashscreen, SignUp, SignIn and ForgottenPassword and an other with Splashscreen and Home.Why ? Because back from Home should close the application but go back to previous activity (SignUp or SignIn according wireframe).Define activity with <code>history=true</code> on SignUp and SignIn do that but does not allow ForgottenPassword -> SignIn and SignIn -> SignUp :(</p><p>Thanks for your help</p>","432753","","","","","2010-08-30 19:16:31","Android activity history stack problem","<android><activity><history><task>","1","2","","",""
"3602412","1","7527097","","2010-08-30 16:45:09","2","3082","<p>Would it be possible to control/interface with an Android phone through USB in a WinForm application? Is there any library for that, without using any original Android tool (ADB, fastboot)?</p>","294814","","294814","","2010-08-30 17:40:09","2011-11-15 11:48:42","C#: Android phone control","<c#><android><interface><usb>","2","4","1","",""
"3602441","1","","","2010-08-30 16:47:54","1","1063","<p>I have a <code>ListView</code> with few items. Is it possible to change size of the selected item in the <code>ListView</code>. For example, I want to expand selected item to show some buttons.</p><p>I appreciate you for help in advance. </p>","331565","","119895","","2010-08-30 18:05:37","2010-09-01 06:16:11","Is it possible to change size of the item in ListView?","<android><listview><listviewitem>","1","1","","",""
"3602597","1","3603592","","2010-08-30 17:09:18","3","1403","<p>I want to develop such an app. on installation of which I would have two choices while sending sms either through my app or default sms app.</p><p>Is there any way through which we can capture an outgoing SMS?</p>","218665","","119895","","2010-08-30 18:03:09","2010-08-30 19:33:44","Android SMS Capturing","<android><sdk>","2","0","","",""
"3602784","1","3602851","","2010-08-30 17:35:42","1","3148","<p>I want to create new class MapActivity from Eclipse.</p><p>I go File-> New -> Class on Superclass-> Browse, and when I type MapActivity  there is no results.</p><p>In Windows-> Android SDK and AVD Manager there is no new updates, I have installed SDK from version 1.5 to 2.2</p><p>Can some one help me with this?</p><p>Thanks</p>","432848","","","","","2011-12-07 07:23:53","Eclipse New class , MapActivity not found !","<android><eclipse>","5","0","","",""
"3602931","1","","","2010-08-30 17:56:38","2","2714","<p>So, basically I have a custom View that contains a ListView with a custom Adapter that has the ability to read in information from the network (dumbed down HTML) and display it on a row by row basis.</p><p>All of this works, but I need the text that is read in to be parsed as HTML which contains links that can be tapped on and launched in browser.</p><p>I managed to do this by:</p><pre><code>text.setText(Html.fromHtml(textBuffer), TextView.BufferType.SPANNABLE);text.setMovementMethod(LinkMovementMethod.getInstance());</code></pre><p>Works great, any <code>&lt;a href=""""&gt;&lt;/a&gt;</code> links in the text are displayed as links and can be tapped.</p><p>This is a side effect of now making it so the rest of the rows in the ListView cannot be tapped (or tapped and held).  Basically, all the rows are non-selectable now.</p><p>Is there any way to achieve both of what I need?</p><p>thanks!</p>","435210","","","","","2010-08-30 18:27:36","EditText.setMovementMethod with LinkMovement Method in ListView - loses ability to ""Click"" on rows in the list","<android><listview>","2","0","","",""
"3603163","1","3603172","","2010-08-30 18:31:42","3","370","<p>What is the easiest way to change the appearance of standard widgets like <code>Button</code>, <code>Spinners</code>, <code>ListView</code>, etc?</p>","421372","","119895","","2010-08-30 18:33:30","2010-08-30 18:33:30","Change appearance of standard widgets","<java><android><user-interface><android-widget>","1","0","","",""
"3603367","1","3603455","","2010-08-30 19:02:41","1","1370","<p>I want to clear cache memory when I close my application in Android.  A code example would be helpful. </p><p>Thanks</p>","410757","","1349159","","2013-09-13 08:09:02","2013-09-13 08:09:02","How can I clear cache memory in Android?","<android>","2","2","0","",""
"3603646","1","","","2010-08-30 19:41:41","1","381","<p>I'm rotating a view containing an arrow in my app using the Matrix class. However, the arrow doesn't rotate around its center but moves a bit horizontally and vertically when rotating. I've experimented with margins and padding but without success.Any hints much appreciated.</p>","360674","","","","","2010-12-06 13:48:48","Rotating android view without affecting adjacent views","<android>","2","0","","",""
"3603657","1","3604489","","2010-08-30 19:42:36","49","12796","<p>I am writing an Android Library Project basing on Android Bitmap class (call it AndroindLib) which contains only utility class (no activity). I tried to test it using Android JUnit, but it keeps complaining that can't find the AnroidLib.apk</p><p>What's the right way to Unit test Android Library Project?</p>","90765","","114066","","2012-10-29 11:32:33","2013-09-27 15:42:32","How to test an Android Library Project","<android><junit><apk>","5","1","11","",""
"3603664","1","","","2010-08-30 19:43:41","2","2072","<p>Hi I'm a bit of a novice developer looking for help from someone who has more of a clue then me lol. So I'm working on a project which you can download here, <a href=""http://droidspot.net/lwprojectnosettings.zip"" rel=""nofollow"">Eclipse Project Link</a></p><p>Sorry for the suspicious link but it's on my site and you can check it for viruses. Ok well I need help adding settings to choose which texture to show you should be able to tell what I mean because there are already two set up. i have the gui for the settings set up along with the activity I just can't figure out how to implement it. If you can help me I'll credit you in the app in the settings and the market post. Along with your name, website or, whatever on  my youtube channel in a video. Which can be found here, youtube.com/motodroidhelpandinfo. I have over 1,200 subscribers. Thanks in advance.</p>","435285","","","","","2010-08-30 23:06:13","Help adding Settings To Android Live Wallpaper","<android><wallpaper>","1","2","2","",""
"3603774","1","3615744","","2010-08-30 19:57:36","0","890","<p>I am currently working on an app that uses a <code>broadcastreceiver</code> to check for incoming text messages, but all of the sudden it seems to have stopped working, I even wrote a small test application that, to me at least, seems syntactically correct, but also is not functioning.</p><p>Here is the code from the test project:</p><p>The manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.AGApplications.test""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".test""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;receiver android:name="".MsgMon""&gt;             &lt;intent-filter&gt;                 &lt;action android:name=                    ""android.provider.Telephony.SMS_RECEIVED"" /&gt;             &lt;/intent-filter&gt;         &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;    &lt;/uses-permission&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>The BroadcastReceiver:</p><pre><code>package com.AGApplications.test;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.util.Log;public class MsgMon extends BroadcastReceiver{   @Override   //Called when new message is received   public void onReceive(Context context, Intent intent) {      Log.d(""PHONE"", ""Message Received"");   }}</code></pre><p>And the main activity:</p><pre><code>package com.AGApplications.test;import android.app.Activity;import android.os.Bundle;public class test extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}</code></pre><p>As far as I can tell I'm not doing anything wrong, but obviously I am!</p>","420377","","","","","2010-09-01 07:10:33","Android broadcastreceiver seems to have stopped working","<android><broadcastreceiver>","2","6","","",""
"3603928","1","3604527","","2010-08-30 20:18:22","1","852","<p>My company is attempting to publish its first Android app on the market, and we have gotten to the code signing step. We have keys that we use for our other products and use the windows codesign tools to sign our products. We would like to use the same key to sign the Android app, but (obviously) cannot use the windows signing tool (because it only signs .dll's and .exe's)</p><p>Does anyone know how to sign an android app using existing keys? (.spc and .pvk files)</p><p>Thanks in advance.</p>","339428","","339428","","2010-08-30 21:50:40","2010-08-30 21:53:55","android: how do i sign my app using an existing key?","<android><code-signing>","1","0","0","",""
"3603980","1","3604061","","2010-08-30 20:27:05","0","1283","<p>I have 2 questions that I was hoping someone could help me with. Is there a way to create a class on the fly with android/java and also add variables to the class? For example I would like to do something like this:</p><pre><code>Class c = new Class();c.name = 'testing';c.count = 0;c.getName = new function(){  return c.name;}</code></pre><p>Just wondering if this is possible or if there is another way to do this. Basically I want to build an object that I can use the data from as an object.</p>","160463","","243782","","2010-08-30 20:29:28","2010-08-30 20:37:56","Java create dynamic class","<java><android><class><dynamic>","2","0","","",""
"3604048","1","3605984","","2010-08-30 20:36:41","2","5364","<p>I have a strange issue - from time to time the animation that should fade out my control (ImageButton) does not kick in immediately. I am using the fadeout animation to hide it and then in myListener on its end (onAnimationEnd) I put new resource as the image on the button. </p><p>Somewhere in my app code:</p><pre><code>Animation a = AnimationUtils.loadAnimation(this,R.anim.fadeout); a.setAnimationListener(new myListener(location));buttons[location].setAnimation(a);a.startNow(); // regardless if its start() or startnNow()               // it will work in most of the cases but not 100% reliable              // I actually can see in debug Log when its late, happens after few more clicks</code></pre><p>Then in myListener.onAnimationEnd(Animation a):</p><pre><code>buttons[location].setImageResource(R.drawable.standard_button);</code></pre><p>Seems there is a rule that the every 4th or 5th animation does not start ... </p><p>Thanks for help! </p>","206885","","2157438","","2013-09-22 12:27:27","2013-09-22 12:27:27","animation.start() or animation.startNow() does not start the animation immediately","<android><animation><android-animation>","2","0","1","",""
"3604089","1","3604169","","2010-08-30 20:42:30","0","910","<p>I try to establisch a HttpsURLConnection with:</p><pre><code>HttpsURLConnection conn = (HttpsURLConnection) new URL(url).openConnection()</code></pre><p>but I get an Exception:</p><pre><code>E/JavaBinder(  901): java.lang.ClassCastException: org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection</code></pre><p>But I can't find out, why. The same example is everywhere across the web.</p>","414075","","","","","2010-08-30 20:57:02","ClassCastException with HttpsURLConnection","<android><ssl>","2","0","","",""
"3604093","1","4106186","","2010-08-30 20:43:11","5","15412","<p>I want to use Admob in my app. I've downloaded the SDK and followed the steps. Sometimes, I get an ad in return, but most of the time, I get an entry in LogCat that says ""Server did not find any ads"" or something to that effect. Test mode is enabled, says the Admob site. I think I might be doing something wrong. Where can I get a step-by-step guide to insert admob ads in Android apps? The Admob developer site is rather lacking.</p><p>Also, let's assume that everything's gone well and that I'd now like to deploy the app. How do I turn off test mode for Admob ads?</p><p>Thank you.</p>","293847","","","","","2014-02-24 09:56:29","How to implement Admob AdView in Android app","<android><admob><logcat><advertisement>","5","1","2","",""
"3604124","1","","","2010-08-30 20:49:40","0","778","<p>I'm trying to create the simplest 2D drawing program possible to isolate what exactly I can't figure out about drawing. This program should literally just draw a 20x20 rectangle. Here's what I have:</p><p>layout: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;com.example.drawing     android:id=""@+id/DrawView""     android:layout_width=""match_parent""     android:layout_height=""match_parent""     /&gt;   &lt;/FrameLayout&gt;</code></pre><p>DrawView:</p><pre><code>package com.example.drawing;import android.content.Context;import android.graphics.Canvas;import android.graphics.Paint;import android.util.AttributeSet;import android.view.View;public class DrawView extends View{    Paint mPaint;    public DrawView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        setFocusable(true);        initDrawView();    }    public DrawView(Context context, AttributeSet attrs) {        super(context, attrs);        setFocusable(true);        initDrawView();    }    public void initDrawView(){        mPaint = new Paint();        mPaint.setColor(0xFF000000);    }    public void onDraw(Canvas canvas) {        super.onDraw(canvas);        canvas.drawRect(0,0,20,20, mPaint);    }}</code></pre><p>Activity:</p><pre><code>package com.example.drawing;import android.app.Activity;import android.os.Bundle;public class HelloDraw extends Activity {    private DrawView dr;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}</code></pre><p>This program won't run. What is it that i am missing? I am sure it is something absurdly obvious, but I just can't seem to find it.</p>","426554","","","","","2010-08-31 01:43:58","help: simple drawing view/program","<android>","1","2","","",""
"3604163","1","","","2010-08-30 20:56:03","0","576","<p>I want that my prog wait 1000 ms and change the title of the button... but the prog appears with the changed name</p><pre><code>package com.catchthebutton;import android.app.Activity;import android.os.Bundle;import android.os.SystemClock;import android.widget.Button;public class test extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);        Button bt = new Button(this);        setContentView(bt);        bt.setText(""Wait"");        SystemClock.sleep(10000);        bt.setText(""OK"");    }}</code></pre>","435346","","1280410","","2012-05-11 11:55:50","2012-05-11 11:55:50","Whats Wrong with SystemClock.wait()?","<android>","1","0","","",""
"3604172","1","3610389","","2010-08-30 20:57:24","2","748","<p>I'm developing a game for Android, and I made it using OpenGL ES 2.0.  Now I want to add support for devices that do not have OpenGL ES 2.0 support, and use OpenGL ES 1.0 instead.</p><p>My problem is that I can't seem to detect the right OpenGL ES version. I used the example in the SDK, but it simply returns 0 on my Legend.</p><p>This is what I've tried:</p><pre><code>    ActivityManager am = (ActivityManager) getSystemService(getApplication().ACTIVITY_SERVICE);    ConfigurationInfo info = am.getDeviceConfigurationInfo();    String eglVersion = info.getGlEsVersion();    if (eglVersion == ""2.0"") GameLibrary.load_gl20();    else GameLibrary.load_gl10();</code></pre><p>(GameLibrary is a class containing some native methods, and load_glxx are static methods calling System.loadLibrary() with the specific library for the right opengl ES version)The problem is as i said before, info.getGlEsVersion() returns ""0.0""</p>","69587","","105170","","2010-08-30 21:09:15","2010-12-02 19:25:59","Detect available OpenGL ES versions","<java><android><opengl-es>","2","1","","",""
"3604244","1","3604282","","2010-08-30 21:08:02","1","2563","<p>I am trying to determine how to structure the code of a simple android game I am writing.  I am focused on the UI portion.  The behind the scenes portion (like a pause/restart/switching/etc) does not concern me.  The Android demo games source code already do a great job with this.</p><p>Essentially my game will need a UI with a series of objects on the screen (roughly 100 or 10x10) that the user can interact with.  I need to supply an image for each object as well as implement the touch events and animation events for each object.  What I am wondering is what type of class do I use for each object so that I can successfully implement these methods and how do I implement that particular class.  Note that this game only executes on a user interaction with one of these objects, meaning I don't need a ""real-time"" implementation.</p><p>My research seems to point in the direction that each screen object needs to be a view object and that I need to place add each view object inside a viewgroup container.  I then need to decide on a layout for the viewgroup, but I’m really not sure.  Is this a viable approach or are there better alternatives?</p><p>I guess I am looking for design methodology more than anything.  Thanks for the advice.</p>","432209","","","","","2010-08-31 09:52:32","Android - What classes to use for UI game development","<java><android><eclipse>","2","0","1","",""
"3604263","1","3604307","","2010-08-30 21:11:32","0","583","<p>I have an application that uses sockets to connect to my server.  A lot of times the application lies ""dormant"" when it doesn't need to send info back and forth to the server.  When that happens, occasionally it will disconnect.</p><p>How can I determine when the socket has disconnected and then try to re-establish a connection?</p><p>I've used some applications that do exactly this and will pop up a dialog box that indicates ""reconnecting"".  I'm sure I could code this in with some kind of ""ping"" method that fires every X number of seconds, but I'm wondering if the socket class has something built in that these other apps are using?</p>","233971","","","","","2010-08-30 21:20:36","determine socket connection state - android","<android><sockets>","1","0","","",""
"3604419","1","3612752","","2010-08-30 21:37:22","6","3319","<p>I am trying to record a pcm sound file and play it back.  When I play it back, it sounds slow and takes longer than it did to record.  I'm not sure if the error is in the record or play code.  Any ideas what the problem is?</p><p>I largely copied code from this example: <a href=""http://emeadev.blogspot.com/2009/09/raw-audio-manipulation-in-android.html"" rel=""nofollow"">http://emeadev.blogspot.com/2009/09/raw-audio-manipulation-in-android.html</a></p><p>Here is the record code (isRecording flag is set by stop button in gui thread).</p><pre><code>        android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);        int sampleRateInHz = 8000;//8000 44100, 22050 and 11025        int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO;        int audioFormat = AudioFormat.ENCODING_PCM_16BIT;        File sd = Environment.getExternalStorageDirectory();        File file = new  File(sd, ""msg.wav"");        if (file.exists())            file.delete();        try {            file.createNewFile();        } catch (IOException e) {            Log.e(""create file:"", e.toString());        }        try {            OutputStream os = new FileOutputStream(file);            BufferedOutputStream bos = new BufferedOutputStream(os);            DataOutputStream dos = new DataOutputStream(bos);            int bufferSize = AudioRecord.getMinBufferSize(sampleRateInHz,channelConfig, audioFormat);            short[] buffer = new short[bufferSize];            audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,                     sampleRateInHz,channelConfig, audioFormat,bufferSize);            audioRecord.startRecording();            isRecording = true;            while (isRecording) {                int bufferReadResult = audioRecord.read(buffer, 0, bufferSize);                for (int i = 0; i &lt; bufferReadResult; i++)                 {                    dos.writeShort(buffer[i]);                }            }            dos.close();</code></pre><p>This is the play code.</p><pre><code>          File file = new File(SendAlert.voiceFile);          // Get the length of the audio stored in the file (16 bit so 2 bytes per short)          // and create a short array to store the recorded audio.          int musicLength = (int)(file.length()/2);          short[] music = new short[musicLength];          try {            // Create a DataInputStream to read the audio data back from the saved file.            InputStream is = new FileInputStream(file);            BufferedInputStream bis = new BufferedInputStream(is);            DataInputStream dis = new DataInputStream(bis);            // Read the file into the music array.            int i = 0;            while (dis.available() &gt; 0) {              music[i] = dis.readShort();              i++;            }            // Close the input streams.            dis.close();                 // Create a new AudioTrack object using the same parameters as the AudioRecord            // object used to create the file.            AudioTrack audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC,                                                    8000,                                                    AudioFormat.CHANNEL_CONFIGURATION_MONO,                                                   AudioFormat.ENCODING_PCM_16BIT,                                                    musicLength,                                                    AudioTrack.MODE_STREAM);            // Start playback            audioTrack.play();            // Write the music buffer to the AudioTrack object            audioTrack.write(music, 0, musicLength);</code></pre>","400648","","319931","","2012-09-28 09:01:46","2012-09-28 09:01:46","Android Audio record and playback is corrupt","<java><android>","2","0","3","",""
"3604477","1","3649656","","2010-08-30 21:45:59","0","422","<p>I want to move avd file to another location:</p><pre><code>android move avd -n titanium_6_HVGA1 -p c:\avd</code></pre><p>but I get as a result help for java:</p><pre><code>Usage: java [-options] class [args...]       (to execute a class)</code></pre><p>etc...<br>Oh, I just checked, I could run </p><pre><code>android list</code></pre><p>without any problem, but now I am getting the same as for ""android move.."" command</p><p>Can someone please help me?</p><p>Deveti</p>","292465","","","","","2010-09-06 07:10:23","Problem while moving avd to another location","<android><move><avd>","1","1","","",""
"3604574","1","","","2010-08-30 22:02:55","1","1974","<p>hey Guys, I'm still an Android &amp; Java noob, but everything I've seen is telling me this should totally work, but it doesn't!  not in the emulator, not on the phone..  I'm trying to use the vibrator using vibrate(500);  ..I get an "" application stopped unexpectedly "" error</p><p>what am I missing?</p><p>code below:</p><pre><code>package com.phys;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.os.Vibrator;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;public class phys extends Activity { Vibrator vibr; Button but; TextView txt; int counter = 0;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        vibr = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);        but = (Button)findViewById(R.id.Button01);        txt = (TextView)findViewById(R.id.txt);        but.setOnClickListener(clk);    }    OnClickListener clk = new OnClickListener(){  @Override  public void onClick(View v) {   // TODO Auto-generated method stub   txt.setText(Integer.toString(counter));   //do something else   vibr.vibrate(500);   counter++;  }    };}</code></pre>","420775","","","","","2010-08-30 22:16:55","Android: Vibrator doesn't work. Foce Close emulator","<android><crash><vibrate>","1","0","","",""
"3604640","1","3604671","","2010-08-30 22:15:29","3","299","<p>Is there a limit on number of apps you are allowed to upload to android market after you pay the 25 dollar registration fee? Or is it 25 dollars for each different app?</p>","167698","","","","","2010-08-30 22:23:52","Android app limit question?","<android>","3","0","","",""
"3604651","1","3604701","","2010-08-30 22:17:24","2","1966","<p>I  have a project which I  created  a few days ago as a test project  and  now  after I've done some very nice stuff with it I need to change some basic information.</p><p>I am using Eclipse IDE and I was able to change some things, such as class names. The problem is I can't figure out where to change the project name.</p><p>For the installed application on my android emulator, the text below the app icon is showing the test name. How do I change that?</p>","365860","","330204","","2011-12-04 18:03:00","2013-04-17 13:00:41","Android: Edit project properties","<android><properties><project><edit>","2","0","","",""
"3604657","1","","","2010-08-30 22:18:12","3","1469","<p>In ProgressDialog's documentation it says:</p><p>""A dialog showing a progress indicator and an optional text message or view. Only a text message or a view can be used at the same time.""</p><p>I've gotten it working beautifully with a message, but I want to use a custom view instead - a message with a cancel button.  But calling setView() on the ProgressDialog seemingly has no effect - it shows the progress bar in the dialog but nothing else.  I've tried it with just a TextView with the text ""hello"", but it doesn't show up.</p><p>Does anyone know how to get this feature to work?  Is it a real feature?</p>","340733","","","","","2011-02-24 22:41:55","android ProgressDialog: setting custom view instead of message - does this work?","<android><view><progressdialog>","1","0","","",""
"3604697","1","","","2010-08-30 22:27:27","3","247","<p>I want to refund a customer's money without restricting their use of the app. Basically I want to give the app to some people for free by refunding their money.</p><p>Prior to funds being transfered I can ""Cancel entire order.""</p><p>After funds have been transfered I can ""Refund Some Money.""</p><p>In either, or both, of these scenarios does the customer retain ownership of the app so they can still receive all future updates?</p><p>Thanks!</p>","435404","","","","","2010-08-30 22:49:07","Android Seller Refunds and Cancelations - Can users still upgrade their apps?","<android><google-play><marketplace>","1","0","2","",""
"3604707","1","","","2010-08-30 22:29:32","0","1496","<pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if (resultCode == RESULT_OK) {            deserializeQuotes();            quotesAdapter.notifyDataSetChanged();        }    }</code></pre><p>My array clearly has been updated, and I can see the change when my app starts, but why doesn't it update in this method? The code enters this method.</p>","19875","","","","","2010-08-30 22:47:57","notifyDataSetChanged() doesn't update ListView","<android><listview><datasource><listviewitem><listadapter>","1","0","","",""
"3604759","1","3632688","","2010-08-30 22:38:41","0","194","<p>I'm very new to Android. </p><p>I'm thinking about creating an application that uses multiple databases. The user would be able to specify the name of the database to be created, and select which database to use from those existing in the /databases/ directory.</p><p>Is this possible in android?</p>","416619","","","","","2010-09-03 02:24:02","New to Android. Is it possible for the user to specify the name of a Database to be created? Also on using multiple databases","<android><database><dataadapter><android-contentprovider>","1","2","","",""
"3604802","1","3605702","","2010-08-30 22:47:16","2","1350","<p>I have an imageview that's included inside a RelativeLayout.  When the imageview is clicked, I animate the entire RelativeLayout with a translate animation to move it down.</p><p>when I click the imageview again (in it's new location) it's supposed to move it back up, but it does not.  However, if I click where the imageview started, it does move the entire ""panel"" back up.  Why is the imageview not moving with the relativelayout...at least insofar as the clickability of it.  The actual image is moving, but the spot where it's clickable is not.</p><p>here is my xml for the layout:</p><pre><code>&lt;RelativeLayout    android:layout_alignParentTop=""true""    android:layout_alignParentLeft=""true""    android:layout_width=""fill_parent""    android:layout_height=""120px""           android:layout_marginTop=""-106px""    android:id=""@+id/chatbox""    android:visibility=""invisible""&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""106px""        android:background=""#000000""        android:id=""@+id/chattext"" /&gt;    &lt;ImageView        android:layout_width=""20px""        android:layout_height=""14px""        android:id=""@+id/chatbubble""        android:layout_below=""@id/chattext""        android:src=""@drawable/chatbubble"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Edit: I should add that I'm using Animation.setFillAfter(true) to hold the panel in place after the animation completes.</p>","233971","","233971","","2010-08-30 23:10:13","2013-02-18 16:31:14","clickable imageview location change with animation - android","<android><animation><imageview><relativelayout>","2","0","1","",""
"3604849","1","10684596","","2010-08-30 22:58:10","6","8886","<p>On onLocationChanged event I want to save my  GPS route (Latitude , Longitude). Later I want to load this data and draw the route.</p><p>Who is the best way to do this, by using some array type (and save or load by using database) or XML files or something else?</p><p>Thanks.</p>","432848","","","","","2013-07-09 17:42:01","Where to save Android GPS (Latitude , Longitude) points?","<android><gps>","4","0","2","",""
"3604873","1","","","2010-08-30 23:04:29","1","969","<p>I have a login page which has a Advanced button.The button sets a view where a user can add some information.When I click save, it goes back to my main view (loginpage) and all info is cleared?</p><p>How can I save the state of the first view when navigating away and then back to it?</p><p>Thanks</p>","423084","","","","","2010-08-31 04:49:37","How to navigate between views? without losing data of the initial view","<android>","2","0","","",""
"3604886","1","7477327","","2010-08-30 23:08:23","3","4382","<p>I created a sample script to add and remove metatags from the head. But Android 2.2 doesn't seem to respect it's removal. However it does respect the addition of the metatag on click for example.. How do I get it to respect the removal of the tag and revert to the default viewport through javascript?</p><pre><code>&lt;script type=""text/javascript""&gt;$(document).ready(function(){function initMeta(){var headID = document.getElementsByTagName(""head"")[0];         var metaNode = document.createElement('meta');metaNode.name = 'viewport';metaNode.content = 'width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0';metaNode.id = 'metatag';headID.appendChild(metaNode);}function closeMeta(){$(""#metatag"").remove();}$(""#add"").click(function(){initMeta();alert(""meta opened"");});$(""#del"").click(function(){closeMeta();alert(""meta closed"");});});&lt;/script&gt;&lt;input name=""add"" type=""button"" value=""add metatag"" id=""add""/&gt;&lt;input name=""del"" type=""button"" value=""delete metatag"" id=""del""/&gt;</code></pre>","339768","","339768","","2010-08-31 00:07:07","2011-09-19 21:09:58","Android not respecting metatag removal?","<android><viewport><metatag>","1","1","4","",""
"3605043","1","","","2010-08-30 23:40:50","0","1237","<p>I am trying to use an XMLPullParser to parse some XML for an android app.  I am classpathing in android.jar from the android-8 SDK.</p><p>Alas, this code:</p><pre><code>import android.util.Xml;import org.xmlpull.v1.XmlPullParser;class InstantiateXMLPullParser {  public static void main( String args[] ){    XmlPullParser xpp = Xml.newPullParser();  }}</code></pre><p>fails with this error:</p><pre><code>Exception in thread ""main"" java.lang.RuntimeException: Stub!        at android.util.Xml.newPullParser(Xml.java:15)        at InstantiateXMLPullParser.main(InstantiateXMLPullParser.java:6)</code></pre><p>I suspect I need to specify an implementation somewhere -- it looks like once upon a time Android used org.apache.harmony.xml.ExpatPullParser as its default pull parser, but that no longer seems to be the case.</p>","435437","","995926","","2012-05-05 13:47:52","2012-05-05 13:47:52","how to instantiate an XmlPullParser in android-8?","<android><xmlpullparser><android-2.2-froyo>","2","0","1","",""
"3605077","1","3605169","","2010-08-30 23:50:08","0","936","<p>I want to pull out the user block. The JSON result will always change, sometimes 4 users will be returned, sometimes 10 etc.</p><pre><code> {      ""results"": [        {          ""user"": {            ""avatar_url_thumb"": ""http://avatars.stocktwits.com/production/9998/thumb-1270014645.png?1270014645"",            ""avatar_url_medium"": ""http://avatars.stocktwits.com/production/9998/medium-1270014645.png?1270014645"",            ""created_at"": ""2010-03-15T05:44:51Z"",            ""following_count"": 14,            ""updated_at"": ""2010-08-30T18:22:15Z"",            ""id"": 9998,            ""updates_count"": 31,            ""avatar_url_large"": ""http://avatars.stocktwits.com/production/9998/large-1270014645.png?1270014645"",            ""investor_relations"": false,            ""last_name"": ""Reporter"",            ""followers_count"": 25,            ""recommended"": false,            ""bio"": ""Apple News &amp; AAPL Stock Analysis, visit Apple Digest blog link above"",            ""login"": ""AppleReporter"",            ""first_name"": ""Apple""          }        },        {          ""user"": {            ""avatar_url_thumb"": ""http://api.stocktwits.com/images/default_avatar_thumb.jpg"",            ""avatar_url_medium"": ""http://api.stocktwits.com/images/default_avatar_medium.jpg"",            ""created_at"": ""2010-04-14T01:02:05Z"",            ""following_count"": 0,            ""updated_at"": ""2010-08-30T18:29:56Z"",            ""id"": 12924,            ""updates_count"": 1,            ""avatar_url_large"": ""http://api.stocktwits.com/images/default_avatar_large.jpg"",            ""investor_relations"": false,            ""last_name"": ""Shareholder"",            ""followers_count"": 0,            ""recommended"": false,            ""bio"": null,            ""login"": ""Imurphit"",            ""first_name"": ""Apple""          }        },        {          ""user"": {            ""avatar_url_thumb"": ""http://api.stocktwits.com/images/default_avatar_thumb.jpg"",            ""avatar_url_medium"": ""http://api.stocktwits.com/images/default_avatar_medium.jpg"",            ""created_at"": ""2010-04-17T20:52:09Z"",            ""following_count"": 0,            ""updated_at"": ""2010-08-30T18:31:23Z"",            ""id"": 13234,            ""updates_count"": 0,            ""avatar_url_large"": ""http://api.stocktwits.com/images/default_avatar_large.jpg"",            ""investor_relations"": false,            ""last_name"": ""Apple"",            ""followers_count"": 0,            ""recommended"": false,            ""bio"": null,            ""login"": ""apple11"",            ""first_name"": ""John""          }        },        {          ""user"": {            ""avatar_url_thumb"": ""http://api.stocktwits.com/images/default_avatar_thumb.jpg"",            ""avatar_url_medium"": ""http://api.stocktwits.com/images/default_avatar_medium.jpg"",            ""created_at"": ""2010-07-12T19:04:51Z"",            ""following_count"": 0,            ""updated_at"": ""2010-08-30T20:12:15Z"",            ""id"": 18691,            ""updates_count"": 0,            ""avatar_url_large"": ""http://api.stocktwits.com/images/default_avatar_large.jpg"",            ""investor_relations"": false,            ""last_name"": ""Smith"",            ""followers_count"": 0,            ""recommended"": false,            ""bio"": null,            ""login"": ""apple"",            ""first_name"": ""Jacob""          }        },        {          ""user"": {            ""avatar_url_thumb"": ""http://api.stocktwits.com/images/default_avatar_thumb.jpg"",            ""avatar_url_medium"": ""http://api.stocktwits.com/images/default_avatar_medium.jpg"",            ""created_at"": ""2010-07-13T17:06:27Z"",            ""following_count"": 0,            ""updated_at"": ""2010-08-30T20:12:30Z"",            ""id"": 18808,            ""updates_count"": 3,            ""avatar_url_large"": ""http://api.stocktwits.com/images/default_avatar_large.jpg"",            ""investor_relations"": false,            ""last_name"": ""apple"",            ""followers_count"": 0,            ""recommended"": false,            ""bio"": null,            ""login"": ""applejames"",            ""first_name"": ""James""          }        }      ],      ""page"": 1,      ""symbol"": false,      ""per_page"": 20,      ""response"": {        ""status"": 200      },      ""total_pages"": 1,      ""total_entries"": 6    }</code></pre>","19875","","","","","2010-08-31 01:03:49","How can I parse this JSON in Android?","<java><android><json><parsing>","1","0","2","",""
"3605087","1","3605117","","2010-08-30 23:54:05","7","4403","<p>I am taking my first steps in Android and am starting with a very simple app which keeps track of progress through a knitting pattern and shows the instructions for the relevant row.</p><p>I want to update a couple of TextView objects programmatically. However, using getViewById() does not seem to identify them properly and the app crashes.</p><p>Having searched on Google it seems there are sometimes problems with the XML namespace in the layout XML but mine looks OK. Is it something to do with scope, perhaps?</p><p><strong>instructions.java</strong> (this is the only activity)</p><pre><code>package uk.co.oketchup.blanketsquare;import android.app.Activity;import android.os.Bundle;import android.content.SharedPreferences;import android.widget.Button;import android.widget.TextView;import android.view.View.OnClickListener;import android.view.View;public class instructions extends Activity{    private int mRow;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        /* retrieve row from shared preferences, or start from zero if nothing there */        SharedPreferences settings = getPreferences(MODE_PRIVATE);        mRow = settings.getInt(""row"",0);        setContentView(R.layout.main);        /* associate onClick listeners with the two buttons */        final Button btnIncrement = (Button) findViewById(R.id.increment);        btnIncrement.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Increment row                ++mRow;                calcAndUpdate();            }        });        final Button btnDecrement = (Button) findViewById(R.id.decrement);        btnDecrement.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Decrement row                --mRow;                calcAndUpdate();            }        });    }  private void calcAndUpdate() {    String Instructions;    int knit1;    int knit2;    int remaining;    if (mRow%2 == 1 )      {        /* Odd row */        knit1 = 40 - mRow;        Instructions = ""K"" + knit1;        remaining = knit1;      }      else      {        /* Even row */        knit1 = 18 - mRow/2;        knit2 = knit1 + 1;        Instructions = ""Sl 1, k"" + knit1 + "", [sl 1 kwise] 2 times, k1, p2sso, k"" + knit2;        remaining = knit1 + knit2 + 2;      }    /* Update the display */    TextView tRow = (TextView) findViewById(R.id.row);    TextView tInstr = (TextView) findViewById(R.id.instr);    TextView tStRem = (TextView) findViewById(R.id.stitchremain);    /* Set the text */    tRow.setText(mRow);    tInstr.setText(Instructions);    tStRem.setText(remaining);  }}</code></pre><p>/res/layout/<strong>main.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;  &lt;TextView        android:id=""@+id/row""      android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:text=""Row""      /&gt;  &lt;TextView        android:id=""@+id/instr""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:text=""Instructions""      android:layout_below=""@id/row""      /&gt;  &lt;Button      android:id=""@+id/increment""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""+""      android:layout_alignParentBottom=""true"" /&gt;  &lt;Button      android:id=""@+id/decrement""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:text=""-""      android:layout_toRightOf=""@id/increment""      android:layout_alignParentBottom=""true"" /&gt;  &lt;TextView        android:id=""@+id/stitchremain""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:text=""stitches remaining""      android:layout_above=""@id/increment""      /&gt;&lt;/RelativeLayout&gt;</code></pre><p>The TextView objects seem to have been registered ok as they appear in <strong>R.java</strong></p><pre><code>public static final class id {    public static final int decrement=0x7f050003;    public static final int increment=0x7f050002;    public static final int instr=0x7f050001;    public static final int row=0x7f050000;    public static final int stitchremain=0x7f050004;}</code></pre><p>Here is the error message shown in ddms.</p><pre><code>Uncaught handler: thread main exiting due to uncaught exceptionandroid.content.res.Resources$NotFoundException: String resource ID #0x1    at android.content.res.Resources.getText(Resources.java:200)    at android.widget.TextView.setText(TextView.java:2813)    at uk.co.oketchup.blanketsquare.instructions.calcAndUpdate(instructions.java:75)    at uk.co.oketchup.blanketsquare.instructions.access$100(instructions.java:11)    at uk.co.oketchup.blanketsquare.instructions$1.onClick(instructions.java:33)[etc]</code></pre><p>Many thanks for your help.</p>","435442","","","","","2013-12-05 17:07:42","Resource not found TextView","<android><textview>","2","0","1","",""
"3605155","1","5221041","","2010-08-31 00:14:36","5","2850","<p>I have a textview which displays a lot of text.</p><p>My users want to highlight and copy a snip of code to the clipboard.</p><p>Any pointers on how to do that?</p>","172861","","","","","2011-03-07 14:44:46","Android Copy and Paste with TextView","<android><clipboard>","1","0","1","",""
"3605164","1","3605256","","2010-08-31 00:15:50","0","491","<p>I specified an activity to be portrait-only in menifest file:</p><pre><code>&lt;activity android:name=""mytest""              android:alwaysRetainTaskState=""true""              android:windowSoftInputMode=""adjustResize|stateAlwaysHidden""              android:screenOrientation=""portrait""&gt;</code></pre><p>But it won't work on Droid when its hard keyboard is popped out.</p><p>When hard keyboard is popped out, the device always renders the layout of the activity in landscape orientation first, then it switches it back to portrait orientation. How can I let the app only render the activity in portrait orientation?</p><p>Can anyone help? Thanks.</p>","256239","","","","","2010-08-31 00:40:59","Is there any way to force the portrait screen even the hard keyboard is popped?","<android>","1","1","","",""
"3605219","1","3605262","","2010-08-31 00:30:01","6","9849","<p>Just wondering if there is a standard/default overlay/marker that I can use in the MAPVIEW?</p><p>I have been searching on the web and all tutorials talk about extending the Overlay and put your custom image on it.</p><p>Is there a easier way? I just want to have a marker, nothing fancy.</p><p>Regards</p><p>James</p>","342553","","342553","","2012-08-03 02:49:22","2012-08-03 02:49:22","Default marker for android google MAPVIEW?","<android><android-mapview>","1","0","2","",""
"3605260","1","3605327","","2010-08-31 00:42:28","2","2480","<p>Perhaps I'm missing something obvious here, but I'm having a hard time setting a custom view for the body of an AlertDialog. Here's what I'm doing to set the custom view:</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    this.setContentView(View.inflate(getContext(), R.layout.dialog_body, null));}</code></pre><p>Instead of setting the content of the body of the AlertDialog, the view is placed over the entire screen. How do I get the view just to replace the AlertDialog message body?</p>","435463","","","","","2010-08-31 00:55:36","AlertDialog setContentView taking over screen","<android><view><alertdialog>","1","3","","",""
"3605273","1","3605284","","2010-08-31 00:44:51","0","1342","<p>So I'm trying to follow this tutorial... to learn android, and I'm having a hard time because I feel like the tutorial was written with errors, and its  hard to try and learn when you are teaching yourself errors..</p><p>Here is what the tutorial says:</p><p>Start by creating a new todolist_item.xml resource in the res/layout folder. It will specify how each of the to-do list items is displayed. For this example, your layout need only consist of the new TodoListItemView, set to fi ll the entire available area.</p><pre><code>&lt;?xml version=”1.0” encoding=”utf-8”?&gt;&lt;com.paad.todolist.TodoListItemViewxmlns:android=”http://schemas.android.com/apk/res/android”android:layout_width=”fill_parent”android:layout_height=”fill_parent”android:padding=”10dp”android:scrollbars=”vertical”android:textColor=”@color/notepad_text”android:fadingEdge=”vertical”/&gt;</code></pre><p>So i created a file in the res/layout folder, called todolist_item.xml and the file contains the following:</p><pre><code>&lt;?xml version=”1.0” encoding=”utf-8”?&gt;&lt;com.paad.todolist.TodoListItemView    xmlns:android=”http://schemas.android.com/apk/res/android”    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:scrollbars=""vertical""    android:textColor=""@color/notepad_text""    android:fadingEdge=""vertical""/&gt;</code></pre><p>and i get the following error: </p><p>""Multiple annotations found at this line:    - error: Error parsing XML: XML declaration not well-formed    - The value following ""version"" in the XML declaration must be a ""</p><p>I am also getting this on another xml file... anyone able to see what i've done wrong?</p>","433866","","","","","2010-08-31 04:24:28","Android Application, xml file errors :(","<java><android><xml><eclipse><layout>","2","0","","",""
"3605340","1","","","2010-08-31 01:00:11","0","552","<p>I need to post message to a wall using FBConnect library for Android. How to do this?</p>","432137","","","","","2010-08-31 01:24:13","How to post message to wall (Android + FBConnect)","<android><facebook>","1","0","","",""
"3605341","1","","","2010-08-31 01:00:28","1","1290","<p>I have a question having to do with Bluetooth programming in C. I'm working on the Android platform, but anyone skilled with the Bluez stack should be able to lend some insight...</p><p>I am trying to write an application to capture Bluetooth packets from within an Android application, which is written in Java and runs in the Dalvik Virtual Machine. The code that interfaces with Bluetooth HCI is written in C in a JNI shared library.</p><p>My method is based on some code I borrowed from the ""hcidump"" utility, a packet sniffer:</p><pre><code>dd = hci_open_dev(0);if (dd &lt; 0) {    LOGE(""Can't open device""); return -1;}if (hci_devinfo(dev, &amp;di) &lt; 0) {    LOGE(""Can't get device info""); return -1;}</code></pre><p>This section of the code works fine. Next:</p><pre><code>opt = hci_test_bit(HCI_RAW, &amp;di.flags);if (ioctl(dd, HCISETRAW, opt) &lt; 0) {    if (errno == EACCES) {        LOGE(""Can't access device"");        LOGE(""ERRNO == EACCES !!! "");        ////return -1;    }}</code></pre><p>The problem is, the call to ioctl fails and errno is set to EACCES, which means ""Permission denied."" I have root access on this device and I could presumably set permissions so it would work (if I knew how). BUT, at least part of it appears to work if I let the code continue:</p><pre><code>hci_close_dev(dd);LOGE(""CONTINUING!"");/* Create HCI socket */sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);if (sk &lt; 0) {    LOGE(""Can't create raw socket""); return -1;}opt = 1;if (setsockopt(sk, SOL_HCI, HCI_DATA_DIR, &amp;opt, sizeof(opt)) &lt; 0) {    LOGE(""Can't enable data direction info""); return -1;}opt = 1;if (setsockopt(sk, SOL_HCI, HCI_TIME_STAMP, &amp;opt, sizeof(opt)) &lt; 0) {    LOGE(""Can't enable time stamp""); return -1;}/* Setup filter */hci_filter_clear(&amp;flt);hci_filter_all_ptypes(&amp;flt);hci_filter_all_events(&amp;flt);if (setsockopt(sk, SOL_HCI, HCI_FILTER, &amp;flt, sizeof(flt)) &lt; 0) {    LOGE(""Can't set filter""); return -1;}LOGE(""About to try to bind socket!"");/* Bind socket to the HCI device */addr.hci_family = AF_BLUETOOTH;addr.hci_dev = dev;if (bind(sk, (struct sockaddr *) &amp;addr, sizeof(addr)) &lt; 0) {  char buf[100];  sprintf(buf, ""Can't attach to device hci%d. %s(%d)\n"", dev, strerror(errno), errno);  LOGE(buf);  return -1;}LOGE(""SUCCESFULLY BOUND SOCKET!"");return sk;</code></pre><p>All of this code runs without any of the errors happening. Next, I get into my main loop which calls ""poll"" to receive data.</p><pre><code>while (1) {    LOGE(""Polling!"");    int i, n = poll(fds, nfds, -1);    LOGE(""Finished poll!"");    if (n &lt;= 0) {        LOGE(""Poll returned nothing -- continuing"");        continue;    }    // Process the data}</code></pre><p>Now (finally) I come to the weird thing: the call to ""poll"" NEVER prints out ""Poll returned nothing -- continuing"". Instead, it blocks until I press the button on my Bluetooth device and send some packets. Then, it says ""Finished poll!"", 7 bytes are printed by my loop, and then it returns to blocking at the ""poll"" call. This happens even if I hold down the button on the Bluetooth device, so a constant stream of packets are transmitted. Only the first 7 bytes appear, and then it blocks again. If I hold the button down for longer, poll will return (and the same packets will be printed) every 5 seconds, for as long as I hold the button down. If I leave the button up for more than 5 seconds and then press it, the same 7 bytes appear immediately, but then, as before, poll will block for either five seconds/until the next button press.</p><p>This behavior seems to me to mean that despite the ""Permission denied"" error, my program is managing to receive data from the device--but it isn't managing to print a continuous stream of all the raw data. (If I take the hcidump executable from which this code is derived and run it from a terminal, it prints the whole stream of many data packets for as long as the button is held down.)</p><p>Is this problem related to the permission denied problem, or is it separate? I could really use some help from an expert in low-level Bluetooth programming. Sorry for the long message, and many thanks for any help.</p><p>-- Tom</p>","435470","","","","","2010-08-31 01:00:28","Strange issue with capturing Bluetooth packets from Android JNI shared library","<android><bluetooth><android-ndk><hci>","0","1","1","",""
"3605387","1","3607212","","2010-08-31 01:10:50","0","851","<p>Some apps clog up the select widget activity by adding different configuration activities. like the screenshot here: <a href=""http://i.stack.imgur.com/DBKvP.png"" rel=""nofollow"">Multi Configuration activities</a></p><p>Is there a way to have one icon in the select widget (like Mini Info) and one configuration activity and set different layouts for widgets there?</p><p>Thank you</p>","398148","","","","","2010-08-31 08:14:57","Different widgets one configuration activity android","<android><configuration><layout><activity><android-widget>","1","0","","",""
"3605459","1","3606144","","2010-08-31 01:29:51","2","412","<p>The iPhone has the method adjustsFontSizeToFitWidth for the UILabel.</p><p>Is there a way to automatically adjust the width of the text to match the width TextView or Button in android?  </p>","424124","","302328","","2010-08-31 05:03:14","2010-08-31 05:03:14","adjustsFontSizeToFitWidth for Android","<android><textview>","1","0","1","",""
"3605584","1","3605683","","2010-08-31 02:12:57","2","4211","<p>Is it possible to change a drawable on a button via java?</p><p>Example; I have a button like this.</p><pre><code>&lt;Button style=""@style/Buttons"" android:id=""@+id/butFavTeam""android:drawableBottom=""@drawable/venue""/&gt;</code></pre><p>I want to change the current drawableBottom image with another from my drawable directory.</p>","401183","","","","","2012-12-31 20:24:01","Changing drawableBottom with java","<java><android><drawable>","3","1","","",""
"3605678","1","","","2010-08-31 02:36:20","0","1802","<p>I'm developing a headset/handsfree app and run it in a demoboard.After connecting to a phone successfully and when the app is reading data from the phone,I call or play music with the phone.The phone doesn't make sounds,and so does the demoboard.Now the system log shows ""Rejecting incoming SCO connection"",why?How to route audio for incoming SCO connection?How can I hear the demoboard?</p><p>The code,</p><pre><code>private boolean connected = false;private BluetoothSocket sock;private InputStream in;private boolean running = true;public void test() throws Exception {    if (connected) {        return;    }    BluetoothDevice zee = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(""00:1C:D4:F7:7F:FD"");//The phone's address    UUID myUuid = UUID.fromString(""00001112-0000-1000-8000-00805f9b34fb"");//headset uuid    sock = zee.createRfcommSocketToServiceRecord(myUuid);    Log.d(TAG, ""++++ Connecting "" + zee.getName());    sock.connect();    Log.d(TAG, ""++++ Connected "" + sock.toString());    in = sock.getInputStream();    byte[] buffer = new byte[50];    int read = 0;    Log.d(TAG, ""++++ Listening..."");    running = true;    try {        while (running) {            read = in.read(buffer);            connected = true;            StringBuilder buf = new StringBuilder();            for (int i = 0; i &lt; read; i++) {                int b = buffer[i] &amp; 0xff;                if (b &lt; 0x10) {                    buf.append(""0"");                }                buf.append(Integer.toHexString(b)).append("" "");            }            Log.d(TAG, ""++++ Read ""+ read +"" bytes: ""+ buf.toString());        }    } catch (IOException e) {     Log.e(TAG, ""++++ IOException e:"" + e.toString());    }    connected = false;    Log.d(TAG, ""++++ Done: test()"");}</code></pre>","435503","","21234","","2011-01-17 15:29:36","2012-04-05 12:12:27","How to route audio for incoming SCO connection?","<android><headset>","2","0","","",""
"3605722","1","4957117","","2010-08-31 02:52:52","1","3883","<p>I created a new <code>MapActivity</code> class <code>MapProba</code>.</p><p>From main <code>Activity</code> I want to show <code>MapActivity</code>: on button click event I put this code:</p><pre><code>    Intent myIntent = new Intent(this, com.art.mode.MapProba.class);            startActivity(myIntent); </code></pre><p>But I receive force close error.</p><p>In my xml file I use this code:</p><pre><code>&lt;LinearLayout      xmlns:android=""http://schemas.android.com/apk/res/android""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""&gt;      &lt;com.google.android.maps.MapView        android:id=""@+id/map_view""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:apiKey=""SomeGoogleMapAPIKeyHere"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>In log I receive this error : </p><pre><code>08-31 04:47:10.218: ERROR/AndroidRuntime(593): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.art.mode/com.art.mode.MapProba}: android.view.InflateException: Binary XML file line #7: Error inflating class com.google.android.maps.MapView</code></pre><p>Line 7 is: <code>com.google.android.maps.MapView</code></p><p>When I remove this code form xml file:</p><pre><code>   &lt;com.google.android.maps.MapView    android:id=""@+id/map_view""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:apiKey=""SomeGoogleMapAPIKeyHere"" /&gt;</code></pre><p>Blank black screen appears (there is no error)</p><p>In manifest file I have:</p><pre><code>uses-permission android:name=""android.permission.INTERNET""uses-permission android:name=""android.permission.ACCESS_LOCATION"" &lt;uses-library android:name=""com.google.android.maps"" /&gt;</code></pre><p>Any idea?</p><p>Thanks</p><hr><p><strong>UPDATE</strong></p><pre><code>08-31 12:22:00.648: ERROR/AndroidRuntime(656): FATAL EXCEPTION: main08-31 12:22:00.648: ERROR/AndroidRuntime(656): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.art.mode/com.art.mode.MapProba}: android.view.InflateException: Binary XML file line #7: Error inflating class com.google.android.maps.MapView08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.os.Handler.dispatchMessage(Handler.java:99)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.os.Looper.loop(Looper.java:123)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at java.lang.reflect.Method.invokeNative(Native Method)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at java.lang.reflect.Method.invoke(Method.java:521)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at dalvik.system.NativeStart.main(Native Method)08-31 12:22:00.648: ERROR/AndroidRuntime(656): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class com.google.android.maps.MapView08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.app.Activity.setContentView(Activity.java:1647)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at com.art.mode.MapProba.onCreate(MapProba.java:12)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     ... 11 more08-31 12:22:00.648: ERROR/AndroidRuntime(656): Caused by: java.lang.reflect.InvocationTargetException08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:238)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at java.lang.reflect.Constructor.constructNative(Native Method)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     ... 21 more08-31 12:22:00.648: ERROR/AndroidRuntime(656): Caused by: java.lang.NullPointerException08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at com.google.android.maps.MapActivity.setupMapView(MapActivity.java:382)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:280)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     at com.google.android.maps.MapView.&lt;init&gt;(MapView.java:255)08-31 12:22:00.648: ERROR/AndroidRuntime(656):     ... 25 more</code></pre>","432848","","935627","","2012-09-06 15:30:37","2012-11-30 18:18:30","MapActivity error: force close","<android><android-mapview><android-manifest>","4","1","0","",""
"3605808","1","","","2010-08-31 03:21:56","1","2176","<p>ContentResolver cr = getContentResolver();Uri pic = Uri.parse(""content://media/external/images/media/3"");Bitmap bm = Media.getBitmap(cr,pic);</p><p>The above code is written in onCreate method of my Activity class. It throws the following error:</p><p>08-30 12:27:22.352: WARN/System.err(245): java.io.FileNotFoundException: No content provider: [content://media/external/images/media/3]</p><p>What could be wrong? The file in question is there because I launched Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI) in another method and got back the Uri of the picked image from the returned intent.</p>","296454","","","","","2013-01-30 13:45:24","Android MediaStore.Images.Media.getBitmap returns error","<android><mediastore>","2","0","","",""
"3605823","1","","","2010-08-31 03:27:05","1","359","<p>There is ""android:inputMethod"" atrr in EditText, but I can't find any way to catch it.</p>","398646","","49246","","2010-11-13 10:43:32","2010-11-13 10:43:32","How to disable Chinese Input Method when sign in or sign up?","<android><edittext><ime><android-input-method>","0","0","","",""
"3605982","1","","","2010-08-31 04:13:17","3","1532","<p>i want to use animated gif in android. hows this possible? is it compatible in 1.6,2.0?</p>","304961","","","","","2011-08-16 01:35:32","Animated gif in android","<android>","2","0","","",""
"3606001","1","","","2010-08-31 04:16:25","0","237","<p>I have an application developed using Android 2.2 SDK. Can i port it on HTC Hero running Android 1.5?</p><p>ThanksDheepak</p>","434708","","","","","2010-08-31 04:20:46","Android 2.2 app on HTC Hero running Android 1.5","<android>","1","0","","",""
"3606023","1","3606155","","2010-08-31 04:26:44","1","913","<p>Can we align our text line by line(I mean whatever the text we have selected that should be aligned instead of the whole text) in android text-view dynamically!!</p><p>Regards,</p><p>vani.</p>","434921","","302328","","2010-08-31 04:54:46","2010-08-31 05:21:17","Text alignment line by line in android Text-view using Gravity","<android><textview>","1","0","","",""
"3606031","1","3606129","","2010-08-31 04:28:50","1","1781","<p>First of all, Android phone is connected both 3G network and wifi.At this time I'd like to send http request through 3G network without using wifi.How can I do it?</p>","368916","","688830","","2013-07-14 05:26:10","2013-07-14 05:26:10","Send HTTP request through 3G network without using WiFi?","<android><http>","1","1","4","",""
"3606059","1","3606104","","2010-08-31 04:36:55","1","971","<p>I want to display a list item that says ""More"" at the end of my ListView. Clicking on this list-item will perform some action. How can I create this ""more"" list item?</p>","19875","","","","","2010-08-31 08:12:46","How to display ""More"" list item in ListView?","<android><listview><listitem><listadapter>","3","0","2","",""
"3606068","1","","","2010-08-31 04:38:32","1","1570","<p>I have a ListActivity whose ArrayAdapter-subclass creates a (droid-fu) WebImageView. The problem is that whenever the list grows longer than can be displayed on a single page, whatever it is that calls getView() always starts from 0 and counts to 4 or 5 (depending on whether or not partial rows are visible), even when it's actually displaying an item like #12 or 14 at the top of the screen... but onClick() registers properly.</p><p>Put another way, suppose the list has 27 rows in it, and I have the app littered with Log.d statements to document everything it's doing. When the ListActivity begins, I can see it call getView with position = 0, 1, 2, 3, 4, and 5. If I touch one of the rows, onClick() fires with the correct position 0..4 (5 is offscreen) as well. So far, so good.</p><p>Now, flick the list upward by a few rows and watch the log output. Once again, getView() gets called for position=0, 1, 2, 3, 4, and 5. But if I touch one of the rows, onClick() fires for a position like 9 or 14 (which, in fact, is correct).</p><p>In other words, somewhere along the way, whatever is responsible for making the call to the ListAdapter's getView() method to render the list is forgetting about its current offset, and is always counting from 0 instead of from whatever row is, in fact, at the top of the screen.</p><p>Does anybody have any idea where to even begin looking for what might be going wrong here? Perhaps a clue about where those calls to getView() are coming from, and how the value of the position arg used for that call is determined? God forbid, is it possible to put a breakpoint at the start of getView(), then step BACKWARDS with Eclipse to see where the call to the ArrayAdapter's getView() method came from?</p><p>Update: forgot about github &amp; managed to get a copy of my program now:</p><pre><code>private class ChatInfoAdapter extends ArrayAdapter&lt;ChatInfo&gt; {    private ArrayList&lt;ChatInfo&gt; items;    public ChatInfoAdapter(Context context, int resourceID, ArrayList&lt;ChatInfo&gt; items) {        super(context, resourceID, items);        this.items = items;         // ^^^hmmm... could THIS be the problem somehow?    }       public View getView(int position, View convertView, ViewGroup parent) {        Log.d(""getView"", ""postion="" + position);        View v = convertView;        if (v==null) {            LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.row, null);        }        ChatInfo info = items.get(position);         // ^^^ grabbing from local ""items"", not superclass' ArrayList. Hmmm...        if (info != null) {            TextView x = (TextView) v.findViewById(R.id.x);            TextView y = (TextView) v.findViewById(R.id.y);            //...            String url = info.getUrl();            //...            WebImageView wiv = new WebImageView(getBaseContext(), iconUrl, true, arg, arg2);            // ^^^ my slightly-hacked droid-fu WebImageView that takes some extra args            // Even if I completely screwed it up, this class should have no effect on            // the value of ""position"" when getView gets called at runtime, right?            // Or is there a method of ImageView that might be getting mangled somewhere            // along the line that SHOULD be reporting its position, but instead might            // be returning 0 (which might explain why position always starts from 0).            LinearLayout placeholder = (LinearLayout) v.findViewById(R.id.placeholder);            placeholder.addView(wiv);            v.setTag(info);        }    }    protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        Log.d(""onListItemClick"", ""position="" + position);        //...    }}</code></pre><p>So... going back to the example list with ~20+ items... when it first appears, I see a flurry of activity like this in the log:</p><p>getView: position=0getView: position=1getView: position=2getView: position=3getView: position=4getView: position=5(possibly in a different order, or repeated a few times)</p><p>At that point, if I click on the last row, I'll see a message in the log like:onListItemClick: position=4</p><p>So far, so good. But if I scroll the list a bit, so an item ~2/3 of the way down is shown at the top of the screen, and I click the row at the bottom of the screen, I'll see a flurry of activity like THIS in the log:</p><p>getView: position=0getView: position=1getView: position=2getView: position=3getView: position=4getView: position=5(possibly in a different order, or repeated a few times)...onListItemClick: position=20</p><p>In other words, it knows I clicked row 20, but the positions shown by the calls to getView never make it above position=6 or position=7, and they always begin from position=0.</p><p>(added other comments below, and made video illustrating problem)</p>","388603","","388603","","2010-09-01 05:01:07","2011-03-06 12:57:58","ListActivity registers correct position in onClick, but calls to its ListAdapter's getView() always count from 0","<android><listactivity>","2","5","2","",""
"3606101","1","3606283","","2010-08-31 04:48:03","-1","6086","<p>I am doing lots of Research on push notification but i don't understand how to implement in android 1.6. I want to ask what is the requirements for this? which type of information we get from the server end either in tags form or just information? what will be the input or output regarding this.Which input i give to the server and which output comes from the server.is there any device id to be require for this? Please suggest me Thanks . </p>","339116","","","","","2012-03-04 00:26:49","how to implement the push notification in android","<android><push-notification>","2","1","","",""
"3606159","1","3751729","","2010-08-31 05:02:45","1","196","<p>I'm developing a media player application in Android. I've an animation(Open Gl Surface View) which should run in background to my Activity when song is being played. Like the animation which we see when we are playing Windows Media Player.          How can i achieve the above scenario???  </p>","396437","","44729","","2010-08-31 14:22:56","2010-10-28 01:48:15","Can i set the GLSurface view(Animation) as my backgroud.?","<java><android><opengl-es>","2","0","","",""
"3606205","1","","","2010-08-31 05:16:48","0","139","<p>I have a form and and a camera button in an application. First, one fills the form then launches camera. In case, camera crashes then the details entered in form is gone. Any way to store and restore the details before and after crash ? Storing and restoring using XML or SQL DB is very heavy.  Since there are many places it is used. </p>","368084","","","","","2010-08-31 07:05:08","How to persist before application crash in android?","<android>","1","0","","",""
"3606228","1","","","2010-08-31 05:20:40","1","565","<p>Is there any differences between M100S and M110S?</p><p>My app uses camera component. codes are as follows</p><p>{<br>ComponentName compName = new ComponentName<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(""com.android.camera"", ""com.android.camera.Camera"");  </p><p>Intent camIntent = new Intent(Intent.ACTION_MAIN);<br>actIntent.addCategory(Intent.CATEGORY_LAUNCHER);<br>actIntent.setComponent(compName);<br>StartActivity(actIntent);<br>}</p><p>it works in M100S but not in M110S.<br>In M110S, app is crashed.</p><p>So I wonder if app is crashed because of the difference between the devices<br>or my codes are wrong.  </p><p>Any idea?</p>","263207","","","","","2010-08-31 09:38:41","Crash happened when the camera in my android app is launched (SHW-M110S)","<android><camera><android-intent>","1","0","","",""
"3606397","1","","","2010-08-31 06:01:49","0","498","<p>Can you give an example, how to display video from the url?</p>","430280","","12707","","2011-03-14 03:49:05","2011-03-14 03:49:05","display video from url","<android><video>","1","1","","",""
"3606415","1","3610388","","2010-08-31 06:05:00","1","785","<p>I have a music player app on the Market and my users starting reporting problems with music showing up as ""Unknown Artist"" and ""Unknown Title"" after the Froyo update. I have noticed the same behavior on my Motorola Droid 2 running Froyo. Doing some googling, I find other users (and even Last.fm confirmed the issue) that ""Android"" is not reading/storing tags correctly. I can't find any technical/developer feedback on this issue.</p><p>Here's the code that has been working for 6 months prior to Froyo:</p><pre><code>String whereclause = MediaStore.Audio.Media.DATA + "" = \"""" + path        + ""\"""";curSong = CR.query(MediaStore.Audio.Media        .getContentUri(""external""), new String[] {        MediaStore.Audio.Media.TITLE, MediaStore.Audio.Media.ALBUM,        MediaStore.Audio.Media.ARTIST }, whereclause, null, null);if (curSong != null) {    curSong.moveToFirst();    title = curSong.getString(0);    album = curSong.getString(1);    artist = curSong.getString(2);}</code></pre><p>After the query, curSong is not null, so the ""if"" block continues, but then I get CursorIndexOutOfBounds when trying to read <code>curSong.getString(0)</code>. Is there some new way that Froyo stores the tags in MediaStore?</p><p>After some debugging, I find that the ID3 tags are just fine and still in the same place.  The problem is with my whereclause. I am looking the song up by its path, which was previously stored in <code>MediaStore.Audi.Media.DATA</code>, but is apparently no longer there, so I'm actually getting an empty set form this query. Now I need to find where that path is stored.</p>","434574","","995926","","2012-05-05 13:49:41","2012-05-05 13:49:41","Can't read ID3 tags after Froyo update?","<android><music><android-2.2-froyo><id3-tag>","1","1","1","",""
"3606455","1","3607703","","2010-08-31 06:13:27","4","1464","<p>I have an app that uses quite a few graphics in it.</p><p>When I open and close my app repeatedly on my emulator (1.5 - 2.2) it runs fine and by checking the heap I can see everything is being cleaned and gc'd properly.</p><p>However, when I run my app on an HTC Aria phone (2.1) the app crashes every time I try to re-open it.  When I look at the heap I can see that objects are NOT being cleaned up like they are in the emulator.</p><p>Does anyone know why this behavior could be happening?  I did try it on another HTC Aria (a friends) and it crashed the same way as on my phone so I think it's not just isolated to my particular phone.</p><p>Any thoughts or ideas would be really appreciated on why things are cleaning up properly on the emulator, but not on my phone.  One thing to note, is that I DID have it working and gc'ing fine on my phone a few days ago and I didn't change much and now it's not working on my phone so it's a bit of a mystery to me.</p><p>Thanks!</p><p>Note:<br>The crash is caused by an OutOfMemory Exception.  I'm pre-loading a handful of graphics, and there's not enough memory for two instances of the application to be running at the same time so it's crashing because the 1st instance of the application was not cleaned up properly.</p>","107459","","107459","","2010-08-31 08:01:11","2010-08-31 09:25:34","Reasons why my Android App would crash on my phone consistently, but not on my emulator","<android><memory><garbage-collection><crash><heap>","1","3","1","",""
"3606471","1","3606954","","2010-08-31 06:17:24","1","942","<p>Suppose I'm working on an Android application. Suddenly I connect my Android phone to my computer. Does Android have a mechanism to detect such hardware interrupts?</p>","396437","","496830","","2011-03-29 22:02:30","2011-05-19 17:50:22","Does Android support the detection of hardware interrupts?","<android><hardware>","4","0","","",""
"3606505","1","3606556","","2010-08-31 06:23:07","16","12733","<p>For some reason my <code>onPostExecute()</code> is not called after my <code>AsyncTask</code> finishes.</p><p>My class decleration:</p><p><code>public class setWallpaperForeground extends AsyncTask&lt;String, Integer, Boolean&gt;</code></p><p>My onPostExecute():</p><p><code>protected void onPostExecute(Boolean result)</code></p><p>Everything works fine, my <code>doInBackground()</code> completes successfully and returns a Boolean but then it just finishes.</p><p>Thanks</p>","149166","","","","","2012-06-20 20:50:46","onPostExecute not called after completion AsyncTask","<java><android><android-asynctask>","3","0","1","",""
"3606530","1","7032341","","2010-08-31 06:29:54","83","49172","<p>I would like to make sure that the list is scrolled all the way to the bottom, after I have updated the listview by using listAdapter, so that it displays the last element entered in the list.  How can I do this ?</p><p>I tried this but no luck:</p><pre><code>lv.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);</code></pre><p>thank you</p>","222421","","222421","","2014-02-26 00:55:13","2014-02-26 00:55:13","Listview Scroll to the end of the list after updating the list","<android><listview><scrolling>","6","0","28","",""
"3606596","1","3607934","","2010-08-31 06:44:26","42","59042","<p>Android: </p><pre><code>public class LocationService extends Service {@Override    public void onStart(Intent intent, int startId) {        super.onStart(intent, startId);                startActivity(new Intent(this, activity.class));        }}</code></pre><p>I launched this service from <code>Activity</code></p><p>In <code>Activity</code> if condition satisfies start </p><pre><code>startService(new Intent(WozzonActivity.this, LocationService.class));</code></pre><p>from my <code>LocationService</code> mentioned above could not launch <code>Activity</code>, how can I get context of current running <code>Activity</code> in service class?</p>","216431","","2360535","","2014-01-13 02:58:32","2014-01-13 02:58:32","android start activity from service","<android><service><activity>","3","0","19","",""
"3606646","1","3606675","","2010-08-31 06:55:11","4","14037","<p>I'm at the very early stage of learning Android. Can anyone tell me how I can use the text written in a Text box by user?</p><p>I'm trying to use getText() method but finding it confusing.</p><p>Thanks in advance.</p>","400859","","1043882","","2012-06-10 13:20:59","2012-07-12 11:48:47","How to Retrieve Text from Textbox in Android widget?","<android><android-widget>","5","0","1","",""
"3606834","1","3607140","","2010-08-31 07:19:11","0","805","<p>I want a 3*3 grid with an ImageButton centered in each cellI've done the code below</p><pre><code>TableLayout tl=new TableLayout(this);int intNbRows=3;int intNbCols=3;for (int i = 0 ; i &lt; intNbRows;i++){   TableRow tr=new TableRow(this);   tr.setMinimumHeight(hauteur/intNbRows);//TODO : a voir    tr.setMinimumWidth(largeur/intNbCols); //TODO : a voir   tr.setId(100+i);   for (int j = 0 ; j &lt; intNbCols;j++)   {      int numImage=((i*intNbCols)+j+1);      final ImageButton myButton=new ImageButton(this);      Drawable d=Drawable.createFromPath(""/sdcard/b"" + numImage  + "".png"");      myButton.setBackgroundDrawable(d);      myButton.setId(200+numImage);      myButton.setOnClickListener(this);      myButton.setPadding(0, 0, 0, 0);      myButton.setScaleType(ScaleType.CENTER_INSIDE);      tr.addView(myButton);   }   tr.setLayoutParams(new TableRow.LayoutParams(largeur,hauteur/intNbRows));   tl.addView(tr);}tl.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.FILL_PARENT,TableLayout.LayoutParams.WRAP_CONTENT));           this.setContentView(tl);</code></pre><p>With this code, rows have the good height, but not width, and ImageButtons are not centered in cells....</p><p>Any idea ?</p>","431652","","126562","","2010-08-31 07:28:03","2012-03-17 21:54:33","Grid 3*3 with tableLayout","<android><grid><tablelayout>","1","0","0","",""
"3606844","1","3606979","","2010-08-31 07:20:03","5","1250","<p>I have an external jar that I can use in my Android application, I just reference it as an external jar from my application. Is there any benefit in creating an Android library project with this external jar for Android applications to use, or is this pretty much the same as referencing the external jar?</p>","431013","","","","","2010-08-31 07:56:35","Android library vs. external jar","<android>","2","1","2","",""
"3606846","1","3618371","","2010-08-31 07:20:34","5","1321","<p>Is there any way to get the details of media files that is executed in android(default) media player? </p>","401004","","1626878","","2014-03-14 06:57:52","2014-03-14 06:57:52","Get details of currect media file playing in android media player","<android><android-sdk-2.1>","3","0","3","",""
"3606853","1","","","2010-08-31 07:21:53","1","1388","<p>Please help me out here. I need to make a <strong>list view</strong> as shown in the sample pic for my <strong>android app</strong>. How to do it? Also I need to add <strong>image</strong> along it as seen in the sample pic. and link it to another view to show some more details.please check links shown below.</p><p><img src=""http://i.stack.imgur.com/VAeGs.jpg"" alt=""alt text""></p><p><a href=""http://www.cellnxt.in/temp/smp.jpg"" rel=""nofollow"">pic1</a></p>","436765","","24054","","2010-08-31 07:28:52","2010-08-31 07:33:40","How to make List view for items in Android?","<android>","2","0","","",""
"3607141","1","","","2010-08-31 08:02:02","2","1214","<pre><code>&lt;TextView            android:id=""@+id/msg""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:textSize=""16sp""            android:textColor=""#000000""            android:layout_weight=""2""            android:ellipsize=""end""            android:layout_marginLeft=""8dip""            android:layout_below=""@id/reply_createdAt""            android:layout_toRightOf=""@id/reply_profileImage""/&gt;</code></pre><p>i have a message,its content is not fixed. users message should be displayed in this textview. when i give a static message it displays in multiline, but when i use this through my code it shows only online.It do not get wrapped.</p><p>i use inflater in code, used getter/setter to set its text</p><p>pls help,thanks</p>","432901","","","","","2010-08-31 08:59:01","how to set height of textview according to its content -[android]","<android>","1","0","","",""
"3607171","1","","","2010-08-31 08:07:27","0","317","<p>I am creating an android app, part of which utilises the twitter4j library to retrieve information from twitter, however, the app runs very slowly on the twitter activities.</p><p>I have not implemented caching yet, and am hoping that should improve the performance, does anyone have any advice for caching twitter4j calls on android?</p><p>alternatively, has anyone else performance tuned twitter4j on android?</p>","258813","","114066","","2010-08-31 09:08:20","2010-08-31 09:08:20","twitter4j on android performance tuning","<android><caching><performance><twitter4j>","0","3","","",""
"3607176","1","3607477","","2010-08-31 08:08:16","0","490","<p>Im using some time expiring url to watch a video from internet and so, when the expiration time come out, the video is not working anymore. In this case, im getting an error dialog box from the videoplayer saying the video is unreadable. that is quite fine, but i would like to display my own dialog box text. how can i do ? is there any way i can know my video didnt work ? Any ideas ?</p>","429222","","","","","2011-01-22 20:53:15","android videoview - managing bad urls error?","<android><video><error-handling><videoview>","1","0","","",""
"3607274","1","","","2010-08-31 08:24:43","0","517","<p>When I view the following xml file in the layout view (eclispse), I got NullPointerException:null message, but when I run the code, it works, can anyone explain this to me why?</p><pre><code>&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@android:id/tabhost""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;LinearLayout                     android:orientation=""vertical""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:padding=""5dp""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp""/&gt;        &lt;/LinearLayout&gt;     &lt;/TabHost&gt;</code></pre>","435707","","435707","","2010-08-31 13:06:22","2011-05-29 19:13:14","Tutorial from google android ""HelloTabWidget"" has a null pointer error","<android><android-tabhost>","1","0","","",""
"3607322","1","","","2010-08-31 08:31:36","1","870","<p>HelloIn my android application,i want to apply OnPause,OnPlay,Next and previous,volume increase and decrease events on mediaplayer.<img src=""http://i.stack.imgur.com/CMkyq.png"" alt=""alt text"">In the above image i just want to know how can i perform next,previous,play,pause events.Could anyone please let me know where i can find these?</p><p>Please send me your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","420261","","2010-09-01 05:31:58","2010-12-13 15:18:52","Access next,previous,play and pause of mediaplayer in android","<android>","1","3","","",""
"3607324","1","","","2010-08-31 08:31:52","0","1446","<p>I'm developing application (Android). This aplication is connected to OBD2 compliant vehicle /CAN BUS and  read data from it. I've done succesfully connection using OBDKey and read data using OBD message format. This message format is mode + pin </p><p>But now I have problems with CAN BUS How should I send command called message_id? What kind of  AT commands I must send?</p>","435698","","379445","","2011-03-22 16:42:48","2011-03-22 16:42:48","OBD2/CAN BUS problems with send commands","<android><bluetooth><can-bus>","1","1","1","",""
"3607351","1","","","2010-08-31 08:36:00","2","4105","<p>I working on the app where I get the data from the server using rest call and add it to the view. I get all the initial data correctly. I use AsyncTask for doing it.</p><p>Now I want to periodically (say 2 mins) fetch the new data from the server and add it to view.Periodically fetching data (polling) from the server in Android.</p>","215399","","1023248","","2012-07-19 11:02:33","2013-07-24 16:25:34","Periodically fetching data (polling) from the server in Android","<java><android><android-asynctask>","3","1","2","",""
"3607426","1","","","2010-08-31 08:46:29","1","458","<p>I need to create custom broadcast receiver which will show me about any PHONE_STATE event occurred.</p>","1386533","","759866","","2013-12-27 14:52:20","2013-12-27 14:52:20","How to create Custom Broadcast Receiver","<android>","1","3","","",""
"3607466","1","3619089","","2010-08-31 08:54:02","3","355","<p>I'm having a hard time parsing multiple different XML files on Android using the built-in SAX parser.</p><p>Nate and Aron Saunders have helped me with the right approach to this problem but I struggle with implementing it. You can read about it <a href=""http://stackoverflow.com/questions/3583876/how-to-parse-different-xml-files-using-sax-on-android"">here</a>.</p><p>I have ten different XML files.</p><p>Example <code>ResponseOne</code>.</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;ResponseOne&gt;  &lt;InnerTag Id=""1""&gt;  &lt;/InnerTag&gt;&lt;/ResponseOne&gt;</code></pre><p>Example <code>ResponseTwo</code>.</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;ResponseTwo&gt;  &lt;AnotherInnerTag State=""2""&gt;  &lt;/AnotherInnerTag&gt;&lt;/ResponseTwo&gt;</code></pre><p>And so on. Every root tag is different. Now I know that I could branch the parser to trigger a different event on every root tag but I'm not quite sure I know how exactly do achieve this.</p><p>How would I tell my SAX handler that he should parse for <code>AnotherInnerTag</code> with its attributes based on the root tag?</p>","418183","","418183","","2011-07-04 21:28:47","2011-07-04 21:28:47","How to branch a SAX parser depending on the first known tag?","<java><android><xml><parsing>","1","1","","",""
"3607558","1","3607639","","2010-08-31 09:07:45","2","1713","<p>how can I show pictures in <code>WebView</code> without saving images into file system?</p><p>I have tried to implement my custom <code>ContentProvider</code>, but method <code>openFile</code> returns <code>ParcelFileDescriptor</code> that points into filesystem (or socket). My pictures are in filesystem, but in encrypted form.</p><p>I have tried also <code>URL.setURLStreamHandlerFactory</code>, but in android java it is useless (because custom streamHandler can be register in jvm that is not allowed).</p><p>I also try html code ""img src=\""data:image.gif;base64,R0lGODlhiAAkAMQAANOOk..."", but in embedded chrome it's not working :(</p><p>pls help</p>","412894","","263521","","2010-08-31 09:10:27","2012-03-27 10:09:19","android - show pictures in webView that are'nt in filesystem","<android><encryption><filesystems><webview><image>","2","0","1","",""
"3607692","1","3607881","","2010-08-31 09:24:23","1","120","<p>What are C based services and Java based services in Android? What is similarity and dissimilarity between them ? Are C based services available in Android?</p>","396437","","302328","","2010-08-31 09:42:34","2010-08-31 09:51:34","What are C based Services and Java based Services?","<java><c><android>","1","0","","",""
"3607861","1","3607914","","2010-08-31 09:48:04","1","2370","<p>I have an Android application with a background running Service.</p><p>When the Service crashes or gets killed by Android I can see that Android tries to restart it again.</p><p>However the Service never actually restarts, I can see Android scheduling the restart but it new actually happens.</p><p>My code is as follows:</p><hr><pre><code>@Overridepublic void onCreate() {    String ns = Context.NOTIFICATION_SERVICE;    mNotificationManager = (NotificationManager) getSystemService(ns);    mTelephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);    audio_service = (AudioManager) getSystemService(Context.AUDIO_SERVICE);}// This is the old onStart method that will be called on the pre-2.0// platform.  On 2.0 or later we override onStartCommand() so this// method will not be called.@Overridepublic void onStart(Intent intent, int startId) {    handleCommand(intent);}@Overridepublic int onStartCommand(Intent intent, int flags, int startId) {    handleCommand(intent);    // We want this service to continue running until it is explicitly    // stopped, so return sticky.    return START_STICKY;} void handleCommand(Intent intent) {        running = true;        mTelephonyManager.listen(new IncomingListener(), PhoneStateListener.LISTEN_CALL_STATE);    }</code></pre><hr><p>Is there something missing in my code to allow the Service be restarted?</p>","243999","","","","","2010-08-31 09:55:08","Android - how to make sure my Service is restarted?","<android><service><crash><restart>","1","0","1","",""
"3607866","1","","","2010-08-31 09:48:43","0","271","<p>Hi I have a android widget, that show info from one service application that I have. I update the info from the service and this is running good. But I have a problem. My service works in second plane when the application is close, if I create the widget when the app is second plane the service is running and how my service is running when my widget try to start the services dont make (This is good) but this makes it that my service dont update the widget. I try to bind the service to the widget for call to method that refresh my widget, but I cant because I recive an error.</p><p>How can I call to service from my widget without a button? I need make another service inside the widget that call the other service? Can have any way to send a message to the service?</p><p>Thanks,</p>","345772","","","","","2011-01-16 12:34:37","Calling service method to wigdet","<android>","1","2","","",""
"3607879","1","","","2010-08-31 09:51:30","2","76","<p>I've a application where a service is running in background and when a Serial port is connected this service will tell the activity that serial port is connected.    Now ,If service is inactive or it is killed by Android for space allocation and some data comes from UART , who will serve this data?</p><p>Please answer urgently. Thank you.</p>","396437","","536148","","2011-03-03 04:32:07","2011-03-03 04:32:07","Android Services Problem?","<android><service>","1","2","","",""
"3607920","1","","","2010-08-31 09:55:51","12","4993","<p>I've just knocked together my first app, have released and signed it and transferred to my phone, but cannot get it to install on my phone - after going through the screen saying 'Do you want to install this application' and clicking install, I just get a message saying 'Application not installed' with no further explanation. I had checked the signing using <code>jarsigner -verify</code>.</p><p>I have uploaded the .apk to <a href=""http://ubuntuone.com/p/ESB/"">http://ubuntuone.com/p/ESB/</a> and obtained the log using the LogCollector app on my phone. The relevant extract is reproduced below.</p><pre><code>Log Collector version: 1.1.0Device model: HTC DesireFirmware version: 2.2Kernel version: 2.6.32.15-gf9c0527htc-kernel@and18-2 )#1 PREEMPT Fri Jul 23 17:26:53 CST 2010Build number: FRF9108-31 10:18:21.289 I/ActivityManager(   93): Starting activity: Intent { act=android.intent.action.VIEW dat=file:///sdcard/blanket.apk typ=application/vnd.android.package-archive cmp=com.android.packageinstaller/.PackageInstallerActivity }08-31 10:18:21.359 I/PackageParser(20453): uk.co.oketchup.blanketsquare: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE08-31 10:18:21.379 D/skia    (20453): --- decoder-&gt;decode returned false08-31 10:18:21.669 I/ActivityManager(   93): Displayed activity com.android.packageinstaller/.PackageInstallerActivity: 331 ms (total 331 ms)08-31 10:18:22.059 D/PowerManagerService(   93): New lightsensor value:640, lcdValue:19208-31 10:18:22.390 D/SynchronizationService(20285): Checking preferences08-31 10:18:22.769 I/ActivityManager(   93): Starting activity: Intent { dat=file:///sdcard/blanket.apk cmp=com.android.packageinstaller/.InstallAppProgress (has extras) }08-31 10:18:22.849 D/skia    (20453): --- decoder-&gt;decode returned false08-31 10:18:22.999 D/dalvikvm(20459): GC_EXPLICIT freed 419 objects / 23968 bytes in 74ms08-31 10:18:23.089 D/PackageParser(   93): Scanning package: /data/app/vmdl73677.tmp08-31 10:18:23.099 I/PackageParser(   93): uk.co.oketchup.blanketsquare: compat added android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_PHONE_STATE08-31 10:18:23.129 I/ActivityManager(   93): Displayed activity com.android.packageinstaller/.InstallAppProgress: 320 ms (total 320 ms)08-31 10:18:23.139 W/PackageParser(   93): Exception reading res/layout/main.xml in /data/app/vmdl73677.tmp08-31 10:18:23.139 W/PackageParser(   93): java.io.IOException08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:207)08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.ZipFile$ZipInflaterInputStream.read(ZipFile.java:432)08-31 10:18:23.139 W/PackageParser(   93): at java.io.FilterInputStream.read(FilterInputStream.java:130)08-31 10:18:23.139 W/PackageParser(   93): at org.apache.harmony.luni.util.InputStreamHelper.readFullyAndClose(InputStreamHelper.java:174)08-31 10:18:23.139 W/PackageParser(   93): at java.util.jar.JarFile.getManifest(JarFile.java:307)08-31 10:18:23.139 W/PackageParser(   93): at java.util.jar.JarFile.getInputStream(JarFile.java:385)08-31 10:18:23.139 W/PackageParser(   93): at android.content.pm.PackageParser.loadCertificates(PackageParser.java:338)08-31 10:18:23.139 W/PackageParser(   93): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:509)08-31 10:18:23.139 W/PackageParser(   93): at com.android.server.PackageManagerService.installPackageLI(PackageManagerService.java:5961)08-31 10:18:23.139 W/PackageParser(   93): at com.android.server.PackageManagerService.access$2100(PackageManagerService.java:138)08-31 10:18:23.139 W/PackageParser(   93): at com.android.server.PackageManagerService$5.run(PackageManagerService.java:4819)08-31 10:18:23.139 W/PackageParser(   93): at android.os.Handler.handleCallback(Handler.java:587)08-31 10:18:23.139 W/PackageParser(   93): at android.os.Handler.dispatchMessage(Handler.java:92)08-31 10:18:23.139 W/PackageParser(   93): at android.os.Looper.loop(Looper.java:144)08-31 10:18:23.139 W/PackageParser(   93): at android.os.HandlerThread.run(HandlerThread.java:60)08-31 10:18:23.139 W/PackageParser(   93): Caused by: java.util.zip.DataFormatException: data error08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.Inflater.inflateImpl(Native Method)08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.Inflater.inflate(Inflater.java:255)08-31 10:18:23.139 W/PackageParser(   93): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:188)08-31 10:18:23.139 W/PackageParser(   93): ... 14 more08-31 10:18:23.149 E/PackageParser(   93): Package uk.co.oketchup.blanketsquare has no certificates at entry res/layout/main.xml; ignoring!08-31 10:18:23.269 D/dalvikvm(   93): GC_EXPLICIT freed 5970 objects / 337960 bytes in 107ms08-31 10:18:24.729 I/InstallAppProgress(20453): Finished installing uk.co.oketchup.blanketsquare</code></pre><p>Many thanks for your help.</p><hr><p><em>Edit 02/09/2010</em>I have modified the main.xml file again by removing pretty much all the whitespace. It still does not install but is not quite the same error: it's claiming there is a zip file error although I notice that certificates do appear further down the list. If this is not something I'm obviously doing wrong, would it be better if I raised on android developers mailing list?</p><pre><code>09-02 17:33:32.819 W/PackageParser(   93): Exception reading /data/app/vmdl73692.tmp09-02 17:33:32.819 W/PackageParser(   93): java.io.IOException09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:207)09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.ZipFile$ZipInflaterInputStream.read(ZipFile.java:432)09-02 17:33:32.819 W/PackageParser(   93): at java.io.FilterInputStream.read(FilterInputStream.java:130)09-02 17:33:32.819 W/PackageParser(   93): at org.apache.harmony.luni.util.InputStreamHelper.readFullyAndClose(InputStreamHelper.java:174)09-02 17:33:32.819 W/PackageParser(   93): at java.util.jar.JarFile.readMetaEntries(JarFile.java:360)09-02 17:33:32.819 W/PackageParser(   93): at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:237)09-02 17:33:32.819 W/PackageParser(   93): at java.util.jar.JarFile.&lt;init&gt;(JarFile.java:218)09-02 17:33:32.819 W/PackageParser(   93): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:471)09-02 17:33:32.819 W/PackageParser(   93): at com.android.server.PackageManagerService.installPackageLI(PackageManagerService.java:5961)09-02 17:33:32.819 W/PackageParser(   93): at com.android.server.PackageManagerService.access$2100(PackageManagerService.java:138)09-02 17:33:32.819 W/PackageParser(   93): at com.android.server.PackageManagerService$5.run(PackageManagerService.java:4819)09-02 17:33:32.819 W/PackageParser(   93): at android.os.Handler.handleCallback(Handler.java:587)09-02 17:33:32.819 W/PackageParser(   93): at android.os.Handler.dispatchMessage(Handler.java:92)09-02 17:33:32.819 W/PackageParser(   93): at android.os.Looper.loop(Looper.java:144)09-02 17:33:32.819 W/PackageParser(   93): at android.os.HandlerThread.run(HandlerThread.java:60)09-02 17:33:32.819 W/PackageParser(   93): Caused by: java.util.zip.DataFormatException: data error09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.Inflater.inflateImpl(Native Method)09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.Inflater.inflate(Inflater.java:255)09-02 17:33:32.819 W/PackageParser(   93): at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:188)09-02 17:33:32.819 W/PackageParser(   93): ... 14 more</code></pre>","435442","","435442","","2010-09-02 17:45:10","2013-08-15 15:47:04","Cannot install .apk on phone","<android><install>","2","0","","",""
"3607947","1","3608056","","2010-08-31 10:00:29","1","1091","<p>Is someone intelligent there who can answer this question?           </p><p>I m doing some task with following code,I want to access inner class variable from outer class method.</p><pre><code>class Outer extends Activity{ private Handler mHandler = new Handler();  StopTheThread()  {     mHandler.removeCallbacks(mUpdateTimeTask);// this is the wat i want to do  }  class Inner   {     final Runnable mUpdateTask = new = new Runnable() {           public void run() {           //Some Code Goes Here       }     };     InnerClassMethod()     {       mHandler.removeCallbacks(mUpdateTimeTask);// This statement working fine here      }   }</code></pre><p>}</p><p>Here mUpdateTask is inner class variable which is not accessible from outer classPleas Tell me how can i write that line </p>","395661","","395661","","2010-08-31 10:10:39","2010-08-31 10:51:21","I want to access inner class variable from my Outer class method in Android Activity","<java><android>","2","0","1","",""
"3608017","1","","","2010-08-31 10:10:46","22","12921","<p>Is it required to start activity name with dot ('.')  in manifest file.? for example activity  ContactManager starts with '.'</p><pre><code>&lt;activity android:name="".ContactManager"" android:label=""@string/app_name""&gt;</code></pre><p>where as the activity ContactAdder is without dot</p><pre><code>&lt;activity android:name=""ContactAdder"" android:label=""@string/addContactTitle""&gt;</code></pre><p>in the manifest file of ContactManager sample <a href=""http://developer.android.com/resources/samples/ContactManager/AndroidManifest.html"">http://developer.android.com/resources/samples/ContactManager/AndroidManifest.html</a> </p><p>UPDATE: If activity name starts with . it is appended to package name to become fully qualified name, but what happens if it doesn't start with '.'</p>","110024","","110024","","2010-08-31 10:22:18","2011-12-20 00:47:46","Activity name in AndroidManifest.xml","<android>","3","0","5","",""
"3608018","1","3911498","","2010-08-31 10:10:53","7","10959","<blockquote>  <p>Hi,</p>    <p>I have created the <strong>MultiChoice  AlertDialog</strong> The AlertDialog has five  list items with checkboxes. Here when I  check First checkbox, w.r.t this the  if the other checkboxes in the list  are checked they shud be unchecked  automatically and vice versa.</p>    <p>I am checking the <strong>isChecked</strong> status  in the <strong>onClick</strong> method of  <strong>OnMultiChoiceClickListener()</strong> and calling the  <strong>showDialog(DIALOG_MULTIPLE_CHOICE);</strong> by updating <strong>boolean[]  checkedItems;</strong>  to recreate the  Dialog, But I am unable to achieve it.  If you any suggestions please direct  me to right way.</p></blockquote><p><strong>Is there any way to recreate the AleartDialog onClick event of the radio button click.</strong></p><p>Some Sample Code below:</p><pre><code>case DIALOG_MULTIPLE_CHOICE:final String[] lJobTypes = { ""Item1"", ""Item2"", ""Item3"",""Item4"", ""Item5"" };    return new AlertDialog.Builder(JoblistPage.this)    // .setIcon(R.drawable.logo)    .setTitle(""Title Here"")    // .setCustomTitle(m_Title)    .setMultiChoiceItems(lTypes, m_Selections,        new DialogInterface.OnMultiChoiceClickListener() {            public void onClick(DialogInterface dialog,int whichButton, boolean isChecked) {                /* User clicked on a check box do some stuff */                if (isChecked) {                    m_CheckCount++;                    //Toggle the Radio button Check status                } else {                    m_CheckCount--;                }                                                }        }).setPositiveButton(""Ok"",        new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog,                    int whichButton) {                    }                }).create();</code></pre><p>RegardsVinayak</p>","28557","","28557","","2010-08-31 12:37:27","2010-10-12 03:32:28","Toggling check boxes in MultiChoice AlertDialog in android","<android>","3","2","2","",""
"3608020","1","","","2010-08-31 10:11:02","1","240","<pre><code>hi i am implementing gallery application  implementing two activites one is clicking activity long k=((Gallery) findViewById(R.id.gallery)).getItemIdAtPosition(position);        ((ImageView)findViewById(R.id.ImageViewlarge)).setImageResource( imagesList.get((int)k).imgId);second one is endless gallery rotating every 5 sec((Gallery) findViewById(R.id.gallery)).setSelection((Integer.MAX_VALUE / 2) - imageid % imagesList.size());    long k=((Gallery) findViewById(R.id.gallery)).getItemIdAtPosition((Integer.MAX_VALUE / 2) - imageid%imagesList.size());   ((ImageView)findViewById(R.id.ImageViewlarge)).setImageResource(imagesList.get((int)k).imgId);</code></pre><p>gallery image clicking  display image continue run the clicking image next position  how can implemented   please forward some solution its urgent </p>","254790","","199972","","2012-06-12 22:03:18","2012-06-12 22:03:18","in clicking image id in gallery pass into ui handler running gallery how can possible","<android><android-widget>","0","1","2","",""
"3608055","1","3608111","","2010-08-31 10:17:55","0","2093","<pre><code>Notification notifyDetails = new Notification(R.drawable.msg,""message received"",System.currentTimeMillis());                    PendingIntent myIntent = PendingIntent.getActivity(context, 0, new Intent(Intent.ACTION_VIEW), 0);</code></pre><p>I am using broadcast receiver to notify for incoming message. i am able to display my own notification in notification bar when message is received. i need when user clicks it it go to Inbox or currently received message.</p><pre><code>PendingIntent myIntent = PendingIntent.getActivity(context, 0, new Intent(Intent.ACTION_VIEW, People.CONTENT_URI), 0);//          notifyDetails.setLatestEventInfo(context, ""Time has been Reset"", ""Click on me to view Contacts"", myIntent);</code></pre><p>like here when user click it goes to contacts in android. so what i pass in intent that when user clicks it goes to inbox. </p>","430556","","","","","2012-02-15 14:59:36","How to display android sms inbox","<android><sms>","1","0","","",""
"3608092","1","","","2010-08-31 10:23:41","1","712","<p>I want to program for clear cache memory when will i start my application in android,Anybody knows coding please give me.</p><p>Thanks All</p>","410757","","","","","2010-09-01 04:17:50","clear cache mwmory when will i start my application in android","<android>","1","2","1","",""
"3608119","1","3610387","","2010-08-31 10:28:23","3","1829","<p>I am currently porting a framework for building applications on J2ME to Android. This framework consists of several projects that compile to libraries (jars). Each individual JAR can contain graphical data (resources, J4ME screens, etc.). Every project generally has a well defined entry point (module). When someone wants to build an application using the framework he must only create a Midlet project and add library dependencies and use the imported classes.</p><p>We have been using the same approach to develop the Android framework. In this case we have only used normal Java Projects inside Eclipse that compile to jar libraries. These projects have dependencies with the Android Framework (android.jar). When building a new application we create an Android Project inside Eclipse and add the dependencies. </p><p>Our next step is to build more advanced modules for Android that can also contain graphical information (Activities, Dialogs, Literals, Drawables, etc.). So far only an Android Eclipse project was needed (the end application), that contained all the graphical-related classes and resources. It seems that when using resources (literals, drawables, etc.) the only approach is to create an Android Application, since the resources are only referenceable by means of an integer handler automatically created by ADT plugin (R.XXX). So building graphical modules may not be built by means of plain Java jar projects.</p><p>Android developer information explains that modular applications are feasible, but I have not found a concise tutorial explaining the process, but some tips such as how to prevent an error to ocurr when an <a href=""http://developer.android.com/resources/articles/can-i-use-this-intent.html"" rel=""nofollow"">application invokes an intent made available by other application</a>. This is valid when building applications that use resources from other applications. I do not need several installed applications on the system, but one built from several components.</p><p>Has anyone experience developing with similar requierements? Any good tutorial or tips to start out? </p>","34880","","","","","2010-08-31 15:12:34","Creating Android Modular Applications on Eclipse","<java><android><eclipse><modularity>","1","0","2","",""
"3608158","1","3608277","","2010-08-31 10:33:53","0","1321","<p>I am new to Android Programming. I need to display a Pop-Up message in my application which I have no clue about. I got to hear from somewhere that it can be done using alertdialog.builder, but I have no idea how to do that?</p><p>I just want to display a simple Text Message.</p><p>Can anybody please help me out regarding this with an example if possible.</p>","422859","","1921273","","2013-02-02 21:16:45","2013-02-02 21:16:45","Pop-Up display in Android using alertdialog.builder","<android>","2","0","","",""
"3608234","1","","","2010-08-31 10:46:44","29","7721","<p>My EditText configured as follows won't show the hint: </p><pre><code>    &lt;EditText    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""right""    android:hint=""The hint...""    android:scrollHorizontally=""true""    android:singleLine=""true"" /&gt;</code></pre><p>It works if I set android:gravity=""left"" or if I remove android:scrollHorizontally and android:singleLine attributes, which is not desirable. Any suggestions?</p>","435830","","1921273","","2013-02-02 21:09:03","2013-12-11 07:19:58","EditText hint doesn't show","<android><android-widget><edittext><hint>","6","2","6","",""
"3608330","1","3608527","","2010-08-31 10:59:51","1","1109","<p>Is it possible to organize the homescreen icons programatically so that i can arrange each icon's position?thanks</p>","445548","","","","","2010-08-31 11:27:55","position of homescreen icons","<android><icons><position><homescreen>","1","1","","",""
"3608347","1","3608378","","2010-08-31 11:03:12","1","774","<p>Is there any design guideline on the number of Activities an application could have? If there is a limit, what would be the ideal number of Activities that can be bundled in an Android application.</p>","421372","","","","","2010-08-31 11:07:58","Max number of Activities!","<android><performance><optimization><user-interface><design-principles>","1","0","","",""
"3608358","1","","","2010-08-31 11:04:52","1","743","<p>Im looking for some sample codes to start with thanks, although i can read the api ,this will be a big help for others to help with a simple code.</p>","279560","","","","","2010-08-31 11:24:38","Sample DevicePolicyManager codes from Android 2.2 work?","<java><android>","1","0","","",""
"3608404","1","","","2010-08-31 11:12:13","0","476","<p>I tried invoking an android apk (AA1) from another apk (BB1) by raising intent. But BB1 starts starts AA1 in its own process space and it does not use the existing running process of AA1. How can I achievea. I want BB1 to use existing AA1 if it is already running. b. If it is not already there, it should invoke AA1 as an independent application. </p>","435841","","","","","2011-09-07 12:21:02","Invoking android apk from another apk","<android><process><invoke><apk>","2","0","","",""
"3608455","1","","","2010-08-31 11:17:36","0","1194","<p>Hy!!I want to make a Whiteboard app, but i don't know how to make only some pixels black and let the others white.</p>","435346","","","","","2010-08-31 12:12:42","Whiteboard Making","<android>","2","3","","",""
"3608483","1","3610284","","2010-08-31 11:22:24","6","3453","<p>Can anybody please clear me about the SharedPreferences in Android.How can I set a condition of displaying a ""Alert Message"" only once when the Activity gets loaded initially in the Application?</p><p>How it is done by using SharedPreferences?</p><p>Thsnks,John</p>","422859","","","","","2012-11-04 17:34:50","What is SharedPreferences in Android?","<android>","3","0","3","",""
"3608491","1","","","2010-08-31 11:23:58","21","4372","<p>I have been watching the Google I/O presentation by Virgil Dobjanschi on the correct way to implement REST on Android with services and content providers.  <a href=""http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html"">http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html</a></p><p>Based on the video I'm doing things the wrong way, which is not surprising given how hard the right way is. Anyway, having been shown the promised land in the video I'm having a bit of a problem figuring out how to get there.</p><p>I have most of it nailed but the one thing that's defeating me is the Binder Callback that Virgil references in the slides (see link above), on page 43 it shows step 2 as starting the service with startService( intent ) and step 10 as returning status information using a Binder Callback. There is no example code anywhere in the presentation which is rather frustrating. There is talk of open sourcing the Twitter client which apparently uses this approach but nothing yet and the announcement was in April.</p><p>In the video he states: ""What is a binder callback? A binder callback, think of it as an interface that was passed in the request intent.""</p><p>I have searched all over the place but have not been able to find any doc or examples that show how to pass a callback as part of an intent. Nor can I figure out any other way of passing in a callback.</p><p>I thought he may be referring to binding to the service and implementing the callback that way. However, he is specifically referring to a local service and using strarSerice() and not bindService(). Also with bindService() the service will be destroyed if the activity is destroyed which defeats the idea. The workaround is to use startService() and then bindService() and leave the service running for the duration. The other problem with bindService() is that the callback can not be use until onServiceConnected() completes which complicates the code even further as the action instructions can not be passed in the intent because the return callback may not be in place in time to return the results.</p><p>I'm only interested in implementing this using the recommended approach. Can anyone shed an light on what a Binder Callback is and how to code it up. Also related to this, does anyone know what a Service Helper would look like apart from binge a singleton?</p><p>Any help here would be much appreciated.ThanksClive</p>","435862","","","","","2011-10-24 12:42:09","What is a binder callback on Android?","<android><callback><android-intent>","1","0","7","",""
"3608532","1","","","2010-08-31 11:28:29","2","513","<p>Typically after some network operation my android emulator starts emitting following logs continuously.  It's making difficult to see logs of other programs in logcat. what could be issue. I'm performing some network operation in my application using AndroidHttpClient. But my program does not do anything related to image download. </p><p>What could be issue ?  </p><p>08-31 11:23:44.504: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:44.584: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:44.614: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:44.644: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:44.684: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:44.824: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:44.924: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:44.964: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.004: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.054: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.094: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.134: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.174: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.224: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.254: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.324: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.354: DEBUG/skia(180): --- SkImageDecoder::Factory returned null08-31 11:23:45.444: DEBUG/skia(180): --- SkImageDecoder::Factory returned null</p>","255507","","","","","2011-11-24 07:15:31","Android emulator with 2.2 AVD continuously generates skia logs","<android><android-emulator>","0","0","","",""
"3608602","1","","","2010-08-31 11:36:56","1","261","<p>i have aplication with a very short lifespan.in most cases a services pops a activity and the user reacts within a few seconds and dismisses the poped activity.</p><p>In this activity i show a mobclix advertisment.But loading of this takes about 5 seconds, this is to long for my use.</p><p>So can i preload this ad in the service , and display it directly as i display my activity?</p><p>thanks</p>","368598","","","","","2010-08-31 11:36:56","preloading ad view","<android><views><mobclix>","0","2","","",""
"3608626","1","","","2010-08-31 11:41:54","0","700","<p>I have created an animation drawable and image view in my main game thread which is configured from the activity that handles the game thread (starting it etc.). My code in this handling activity looks like this:</p><pre><code>            mDistractionsThread.animation.addFrame(getResources().getDrawable(R.drawable.one), 1000);    mDistractionsThread.animation.addFrame(getResources().getDrawable(R.drawable.two), 1000);    mDistractionsThread.animation.addFrame(getResources().getDrawable(R.drawable.three), 1000);    mDistractionsThread.animation.setOneShot(false);    mDistractionsThread.imageAnim =(ImageView) findViewById(R.id.img);    mDistractionsThread.imageAnim.setBackgroundDrawable(mDistractionsThread.animation);    mDistractionsThread.animation.start();</code></pre><p>And as you can see the variable mDistractionsThread is a handle to the thread itself. This compiles fine but only displays the first frame (R.drawable.one) and does not animate at all. What is it I have missed?</p><p>I tried to set animation.start() from run() within mDistractionsThread but that just gave me an fatal exception because the View can only be altered from the class that alters its fields - which in this case is not the game thread.</p><p>How can I resolve this and get it animating through the frames, and for bonus points, moving across the x-axis?!</p><p>Many thanks</p>","300037","","","","","2011-05-10 17:14:29","Animation Drawable does not animate in android?","<android><animation>","1","0","","",""
"3608646","1","3608760","","2010-08-31 11:44:56","2","132","<p>I am planning to write a free version and a full version of a software. I want the information stored by the free version of the software to be accessible by the full version also (I don't want to use Content Providers). And I also want to make sure this data is not lost when the software is updated. How do I achieve this?</p>","421372","","","","","2010-08-31 12:05:50","Retaining persistent information on different versions of the software","<android><design>","1","0","","",""
"3608669","1","3647530","","2010-08-31 11:48:05","6","9536","<p>Is there a way by which we can capture the click of HOME and BACK button in the html file in android application using phonegap/jqtouch/javascript?</p><p>I have an application for Android using phonegap. I want to capture the click of native HOME and BACK button of the Android phone in the html page to exit / go back gracefully.</p>","435813","","236247","","2011-06-22 16:30:59","2011-07-26 07:29:42","Capturing native button clicks in Android phone in javascript","<javascript><android><phonegap><jqtouch>","3","2","4","",""
"3608680","1","3609052","","2010-08-31 11:49:52","1","733","<p>This question is related to <a href=""http://stackoverflow.com/questions/3608119/creating-android-modular-applications-on-eclipse"">this one</a>. I have two Android projects inside Eclipse. One activity of one project calls an activity of the other project. This results in two independent applications being deployed on Android phone.</p><p>Is there any way to merge at build time (inside or outside Eclipse) both applications in only one so only an APK is generated?</p>","34880","","","","","2010-08-31 12:33:41","Is is possible at build time to merge Android applications?","<android><build><module>","1","0","","",""
"3608684","1","","","2010-08-31 11:50:39","9","2625","<p>I am developing an application with a service which show the progress of a timer in the notification area (with a progress bar and a text). I have extracted below a simpler example with the same problem. </p><p>The code of the Service:</p><pre><code>public class TNService extends Service {    private NotificationManager nm;    private Notification notification;    private RemoteViews remoteView;    @Override    public void onCreate () {        nm = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);        notification = new Notification(android.R.drawable.stat_sys_download,                 ""My notification"",                 System.currentTimeMillis());        remoteView = new RemoteViews(this.getPackageName(),                R.layout.notification);        remoteView.setImageViewResource(R.id.icon, android.R.drawable.stat_sys_download);        remoteView.setTextViewText(R.id.text, """");        remoteView.setProgressBar(R.id.progress, 100, 0, false);        notification.flags = Notification.FLAG_NO_CLEAR;        notification.contentView = remoteView;        notification.contentIntent = PendingIntent.getActivity(this, 0, new Intent(this,                TNActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);        Timer timer = new Timer ();        timer.schedule(new TNTask(this), 0, 200);    }    @Override    public IBinder onBind(Intent arg0) {        return null;    }    public void updateNotification(int progress) {        remoteView.setProgressBar(R.id.progress, 1000, progress, false);        remoteView.setTextViewText(R.id.text, ""Progress: "" + progress);        nm.notify(0, notification);    }}</code></pre><p>The code of the TimerTask:</p><pre><code>public class TNTask extends TimerTask {    private TNService service;    private int progress;    public TNTask(TNService s) {        this.service = s;        this.progress = 0;    }    @Override    public void run() {            progress = (progress + 1) % 1000;        this.service.updateNotification (progress);    }}</code></pre><p>The problem is the huge memory usage. Here is the logcat output:</p><pre><code>D/dalvikvm(11985): GC_EXPLICIT freed 1258 objects / 84016 bytes in 1157msD/dalvikvm(   85): GC_FOR_MALLOC freed 52216 objects / 1900968 bytes in 130msD/dalvikvm(   85): GC_FOR_MALLOC freed 49465 objects / 1805248 bytes in 125msD/dalvikvm(   85): GC_FOR_MALLOC freed 53106 objects / 1909992 bytes in 134msD/dalvikvm(12008): GC_EXPLICIT freed 1604 objects / 100944 bytes in 90msD/dalvikvm(   85): GC_FOR_MALLOC freed 53011 objects / 1937160 bytes in 135msD/dalvikvm(   85): GC_FOR_MALLOC freed 49806 objects / 1817992 bytes in 143msD/dalvikvm(   85): GC_FOR_MALLOC freed 49016 objects / 1769536 bytes in 135msD/dalvikvm(   85): GC_FOR_MALLOC freed 53509 objects / 1941064 bytes in 145msD/dalvikvm(   85): GC_FOR_MALLOC freed 49895 objects / 1842312 bytes in 146msD/dalvikvm(   85): GC_FOR_MALLOC freed 48728 objects / 1774496 bytes in 150msD/dalvikvm(   85): GC_FOR_MALLOC freed 47557 objects / 1701976 bytes in 146msD/dalvikvm(   85): GC_FOR_MALLOC freed 53540 objects / 1903808 bytes in 156msD/dalvikvm(   85): GC_FOR_MALLOC freed 48997 objects / 1784048 bytes in 158msD/dalvikvm(   85): GC_FOR_MALLOC freed 48326 objects / 1776864 bytes in 158msD/dalvikvm(   85): GC_FOR_MALLOC freed 47566 objects / 1742488 bytes in 169msD/dalvikvm(   85): GC_FOR_MALLOC freed 47606 objects / 1703416 bytes in 170msD/dalvikvm(  162): GC_EXPLICIT freed 11238 objects / 641368 bytes in 1064ms</code></pre><p>I think it is too much memory and after a while the phone hangs with this output:</p><pre><code>D/dalvikvm(   85): GC_FOR_MALLOC freed 0 objects / 0 bytes in 241msI/dalvikvm-heap(   85): Clamp target GC heap from 24.008MB to 24.000MBI/dalvikvm-heap(   85): Grow heap (frag case) to 24.000MB for 52-byte allocationI/dalvikvm-heap(   85): Clamp target GC heap from 26.008MB to 24.000MBD/dalvikvm(   85): GC_FOR_MALLOC freed 0 objects / 0 bytes in 241msI/dalvikvm-heap(   85): Clamp target GC heap from 24.008MB to 24.000MBI/dalvikvm-heap(   85): Grow heap (frag case) to 24.000MB for 24-byte allocationI/dalvikvm-heap(   85): Clamp target GC heap from 26.008MB to 24.000MBD/dalvikvm(   85): GC_FOR_MALLOC freed 0 objects / 0 bytes in 247msI/dalvikvm-heap(   85): Clamp target GC heap from 24.009MB to 24.000MBI/dalvikvm-heap(   85): Grow heap (frag case) to 24.000MB for 28-byte allocationI/dalvikvm-heap(   85): Clamp target GC heap from 26.009MB to 24.000MBD/dalvikvm(   85): GC_FOR_MALLOC freed 0 objects / 0 bytes in 247msI/dalvikvm-heap(   85): Clamp target GC heap from 24.009MB to 24.000MB</code></pre><p>Anyone knows how can I do it without using so many memory?</p><p>Thanks!</p>","435855","","435855","","2011-02-22 16:44:36","2011-02-22 16:44:36","Huge memory usage in notifications","<java><android><service><notifications>","3","1","8","",""
"3608814","1","3611512","","2010-08-31 12:05:45","0","2144","<p>Can someone help me with my Syntax/Methodology?  I would like to set up a bunch of different views in a viewgroup.  My code fails at the addView method.</p><p>Unfortunately, I can’t find jack for examples (which is how I learn) using the ViewGroup class online.</p><p>Thanks all.</p><pre><code>public class TileView extends ViewGroup {private TestClass mTestClass;    public TileView(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        initViews();    }    public TileView(Context context, AttributeSet attrs) {        super(context, attrs);        initViews();        }    public void initViews() {        addView(mTestClass);            }    @Override     protected void onLayout(boolean changed, int l, int t, int r, int b)     {     }}public class TestClass extends View{public TestClass(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);}public TestClass(Context context, AttributeSet attrs) {    super(context, attrs);}public TestClass(Context context) {    super(context);}</code></pre><p>}</p>","432209","","","","","2011-02-23 07:39:31","Android - How to setup child views inside a viewgroup","<java><android><eclipse>","1","2","0","",""
"3608817","1","","","2010-08-31 12:06:03","2","1098","<p>I am stuck in an peculiar scenario, while developin an app in android.</p><p>My app, downloads image from internet and populates the same in a thumbnail format in the application.</p><p>As i am not aware of the number of picture's/thumbnails at design time, i am creating image view controls dynamically by using the below mentioned code.</p><pre><code>ArrayList&lt;String&gt; parsedPhoto=oPhotoList.getPhoto();RelativeLayout media = (RelativeLayout)findViewById(R.id.media);RelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams(    RelativeLayout.LayoutParams.MATCH_PARENT,    RelativeLayout.LayoutParams.WRAP_CONTENT);for(int iCounter=0;iCounter&lt;parsedPhoto.size();iCounter++){    bitmap=oParser.DownloadImage(parsedPhoto.get(iCounter));    ImageView img = new ImageView(this);    img.setImageBitmap(bitmap);     media.addView(img,p);}</code></pre><p>But in this scenario, all my images gets overlapped with each other.Wherein i want 3 images to be displayed on each row, which i am able to achieve through xml.</p><p>Can somebody help me out.</p>","419685","","512958","","2013-01-28 16:49:36","2013-01-28 16:49:36","Dynamically loading images","<android>","2","0","","",""
"3608883","1","3609268","","2010-08-31 12:14:34","22","5876","<p>First, a bit of my background. I have been working on large web systems for over a decade, Android is something I have been looking at for the past two months; as you can imagine, the gap is quite wide :)</p><p>Looking at Android's <a href=""http://developer.android.com/guide/topics/security/security.html"">Security and Permissions</a> and <a href=""http://developer.android.com/guide/topics/data/data-storage.html"">Data Storage</a> part of documentation, talking directly to developers, reading books and tutorials, it is pretty clear how entire model works. However, I was unable to find an answer whether SQLite and SharedPreferences files are secure enough to store delicate non-encrypted information (for example, OAuth tokens). Is it possible for someone to grab them in any way? Quoting Android's documentation: </p><blockquote>  <p>Any data stored by an application will be assigned that application's user ID, and not normally accessible to other packages.</p></blockquote><p>It's the <em>not normally accessible</em> part giving me additional grey hair :)</p><p>Thank you, helpful answers are appreciated :)</p>","172609","","","","","2011-09-09 14:42:09","How secure are SQLite and SharedPreferences files on Android?","<android><security><sqlite><sharedpreferences>","2","2","5","",""
"3608955","1","","","2010-08-31 12:23:32","8","5510","<p>I am having an inner class which extends BroadcastReceiver.</p><p>And I have added following line to AndroidManifest.xml:</p><pre><code>&lt;receiver android:name=""OuterClass$InnerClass android:enabled=""true""/&gt;</code></pre><p>But I am getting error Unable to instantiate receiver org.example.test.OuterClass$InnerClass:</p><p>Whats the issue?</p>","215399","","215399","","2010-08-31 12:33:27","2012-06-01 14:25:20","Receiver as inner class in Android","<java><android>","3","2","1","",""
"3609026","1","3609100","","2010-08-31 12:31:11","4","10825","<p>In my  Android project,  I've a image button whose background is set to some image. I want so set some text on the image button. How do i do that/</p><p>I want to set the text because localization would be used in the project....</p>","396437","","","","","2013-04-18 23:05:09","How to set text of Image Button (Android)?","<java><android>","3","1","0","",""
"3609113","1","3609133","","2010-08-31 12:40:58","1","349","<p>Can anyone tell me what are the packages available in Android, and which package is frequently used and for what purpose they are used. Anybody please help me regarding in this.</p><p>Thanks in Advance,Tilsan.</p>","424413","","139010","","2010-08-31 13:36:35","2010-08-31 13:36:35","what are the packages in Android?","<android>","2","2","","",""
"3609126","1","4774370","","2010-08-31 12:43:06","19","8765","<p>I have database table with the columns {Name, Time (UTC format) , Latitude, Longitude}</p><p>I display the table using a ListActivity with a SimpleCursorAdapter.</p><p>I would like that the column Time show the time in a human readable format (13-07-2010 10:40) rather than in UTC format (18190109089).</p><p>How can I specify that the values from column Time need some filtering/adaptation?</p><p>POSSIBLE SOLUTION (with a problem):</p><p>SimpleCursorAdapter offers the method:</p><pre><code>setCursorToStringConverter(SimpleCursorAdapter.CursorToStringConverter cursorToStringConverter);</code></pre><p>to specify how a class that is able to convert a Cursor to CharSequence (convertToString(Cursor cursor).Anyway I don't know in which format should be the return CharSequence paramater!</p>","373542","","243999","","2013-02-11 12:22:13","2013-11-26 09:02:36","Changing values from Cursor using SimpleCursorAdapter","<android><sqlite><cursor><filtering>","4","0","7","",""
"3609174","1","3610602","","2010-08-31 12:49:33","20","13940","<p>I want to insert a constant string into an EditText by the press of a button. The string should be inserted at the current position in the EditText.If I use <code>EditText.append</code> the text gets inserted at the end of the EditText.</p><p>How can I do that? I couldn't find a suitable method.</p>","388826","","","","","2013-08-04 11:25:32","Android: Insert text into EditText at current position","<android><insert><edittext>","2","0","2","",""
"3609219","1","4137706","","2010-08-31 12:54:30","10","12459","<p>I can play a video from the Internet by inserting the URL like below:</p><pre><code>mPath   = Uri.parse(""http://commonsware.com/misc/test2.3gp"");mVid.setVideoURI(mPath);mVid.requestFocus();mVid.start();</code></pre><p>But now I have a video in my raw folder so the path is res/raw/testing.3gp.  The code below doesn't work, and I've tried some other ways too to no avail.</p><pre><code>mPath   = Uri.parse(""../../res/raw/testing.3gp"");</code></pre><p>Any suggestions?</p>","2186261","","","","","2013-11-26 08:29:07","Trying to play video from raw folder (VideoView)","<android>","3","1","6","",""
"3609231","1","5114475","","2010-08-31 12:56:17","9","9806","<p>Given the code bellow, is it possible to have images instead of text in the array planets?</p><pre><code>    Spinner s = (Spinner) findViewById(R.id.spinner);        ArrayAdapter adapter = ArrayAdapter.createFromResource(                        this, R.array.planets, android.R.layout.simple_spinner_item);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        s.setAdapter(adapter);</code></pre><p>and</p><pre><code>    &lt;string name=""planet_prompt""&gt;Choose a planet&lt;/string&gt;    &lt;string-array name=""planets""&gt;                &lt;item&gt;Mercury&lt;/item&gt;        &lt;item&gt;Venus&lt;/item&gt;        &lt;item&gt;Earth&lt;/item&gt;                &lt;item&gt;Mars&lt;/item&gt;                &lt;item&gt;Jupiter&lt;/item&gt;                &lt;item&gt;Saturn&lt;/item&gt;                &lt;item&gt;Uranus&lt;/item&gt;                &lt;item&gt;Neptune&lt;/item&gt;        &lt;/string-array&gt;    </code></pre>","383576","","","","","2014-03-06 06:06:13","How is it possible to create a spinner with images instead of text?","<android><spinner>","3","0","7","",""
"3609297","1","4989894","","2010-08-31 13:05:54","13","8328","<p>I have a custom ScrollView (extended android.widget.ScrollView) which I use in my layout. I want to measure the total height of the contents of this scrollview. getHeight() and getMeasuredHeight() don't give me correct values (too high numbers).</p><p>Background information: I want to determine how far the user has scrolled. I use onScrollChanged to get the X value, but I need to know a percentage so I'll need the total scrollbar height.</p><p>Thanks a lot!Erik</p>","419625","","","","","2011-02-14 07:53:12","Android: Total height of ScrollView","<android><scrolling><scrollview>","1","1","3","",""
"3609368","1","3609470","","2010-08-31 13:15:26","11","5344","<p>How do I find the make and model of an Android device?</p>","421372","","","","","2010-08-31 13:35:05","Finding the device model and make","<java><android>","2","0","1","",""
"3609547","1","","","2010-08-31 13:41:31","0","1874","<p>friend's, I have set of images fetched from internet and set it on gridview,here i have option to click here to view more,below the grid view and it fetches images and set it on grid with prevoius set of images,when i exit the application and run it again,the previous set of images remain in cache and grid shows images from cache,here i need to clear my application cache memory,when i exited my application.how can i get it.</p><p>Thanks in advance.</p>","407506","","","","","2010-08-31 13:51:33","how to clear cache memory when the application exits by programatically","<android>","1","3","","",""
"3609620","1","3609844","","2010-08-31 13:48:57","0","917","<p>I have a widget with a button and a text field. when the user clicks on the button I'd like to copy the text from the textfield to the cliboard.As this is a widget I have to used remoteviews and pending intent. Does anybody has a simple way to do it ?</p>","435981","","","","","2010-08-31 14:12:20","How to copy text to clipboard using an intent on Android?","<android><widget><android-widget><android-intent>","1","0","","",""
"3609633","1","3609729","","2010-08-31 13:50:16","0","264","<p>I'm new to android development... while making my application layout i want a button to remain at the very bottom of the screen while a scroll view is placed above it. I am unable to do this i was using the size of the scroll view as 430dp so that it works but when i change the orientation of the screen this does not work as 400dp is bigger than the screen.how do i make it so that the button stays at the bottom irresepective of the screen orientation ?:/</p>","434885","","","","","2010-08-31 14:09:24","Android Dev: Placing layouts","<android>","3","0","","",""
"3609698","1","","","2010-08-31 13:57:14","0","732","<p>I have a RelativeLayout whose layout_height is set to ""wrap_content"" and inside that I have a TextView whose <strong>text</strong> is set at <strong>runtime</strong>. I have set android:layout_height=""wrap_content"" to my TextView, but it doesn't seems to change the height of the Textview even if the content is larger than 1 line.</p><p>It only takes the height of single line and displays 1 line, and all the remaining lines appears to be marquee vertically which is seen when I drag it manually...</p><p>so what will be the issue?</p>","435025","","","","","2012-11-28 22:04:08","Android - TextView dynamic height issue","<android>","1","1","","",""
"3609700","1","","","2010-08-31 13:57:18","1","2714","<p>I am using ContactsContract api intent for showing all contacts from an activity. This intent returns an id of the contact. I need to get the postal address of this contact. </p><p>Here is the code which i am using for showing contacts:</p><p><code>Intent intent = new Intent(Intent.ACTION_PICK);intent.setType(ContactsContract.Contacts.CONTENT_TYPE);startActivityForResult(intent, PICK_CONTACT);</code></p><p>I am getting the result in the <code>onActivityResult</code> function.</p><p>Please help, how do i do this.</p>","152867","","","","","2012-11-20 10:18:00","Get Postal address from a contact using ContactsContract api on android","<android><sdk><contacts><contactscontract>","4","0","3","",""
"3609738","1","3610036","","2010-08-31 14:00:53","3","1301","<p>in my android application i want to add the functionality the user to buy song from amazon. The easiest way to do is i think to use amazon mp3 application to communicate with amazon store. I found this piece of code from default music player</p><pre><code>Intent i = new Intent();i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);i.setAction(MediaStore.INTENT_ACTION_MEDIA_SEARCH);i.putExtra(SearchManager.QUERY, mSong.getArtits() + "" "" + mSong.getName());i.putExtra(MediaStore.EXTRA_MEDIA_ARTIST, ""artist"");i.putExtra(MediaStore.EXTRA_MEDIA_ALBUM, ""album"");i.putExtra(MediaStore.EXTRA_MEDIA_TITLE, mSong.getName());i.putExtra(MediaStore.EXTRA_MEDIA_FOCUS, ""audio/*"");startActivity(Intent.createChooser(i, ""Search for "" + mSong.getName()));</code></pre><p>which shows menu to select where to search for your song (browser, youtube, amazon mp3). But here are some things i want to do - </p><ol><li>I don't want to show the whole pop up screen but only amazon search, what intent i should use to search directly in amazon mp3.</li><li>How can i send my affiliate partner key to amazon mp3 so it can included it when querying amazon.</li></ol><p>Shazam is using directly amazon mp3 but i couldn't find any information what intent i should use. Thanks in advance any help will be very helpful. </p>","184601","","","","","2010-08-31 15:33:49","integrating amazon mp3 in my android application","<android><key><amazon><affiliate>","2","0","4","",""
"3609786","1","","","2010-08-31 14:05:58","0","483","<p>in my android application,I want to save some photos uploaded from a server on my database and then reuse them later. I think I should save them in a binary format and save their links into the database. Is it the better solution? Can you give some code or an example? Thanks.   </p><p>PS: now I only uploaded the image and display it directly using an ImageView but I want to make it available in my application when the user is offline.</p>","435979","","","","","2010-08-31 16:39:55","How to save a photo uploaded from internet on a database?","<android><photos>","1","0","","",""
"3609822","1","3610381","","2010-08-31 14:09:45","3","533","<p>As you know android today is many versions many  constructors, many screen sizes,...</p><p>it's quite difficult for developers today to write programs that targets a big part of devices.</p><p>What would be THE developer must-know practices for this ?</p><ul><li>tips for fluid layouts.</li><li>""standards"" for developing on any android version.</li><li>...</li></ul><p>Any other ideas ?</p>","311017","","","","","2010-09-01 15:22:36","Best practices for targetting a wide range of devices and screen sizes","<android><devices>","4","0","3","",""
"3609888","1","3636931","","2010-08-31 14:17:51","1","797","<p>I have an Android application which handles a particular type of file. It registers intent filters for both the MIME type and the filename pattern. This all works fine from file managers; I select a file, I get prompted with a list of actions applicable to the file, my application is on the list, I select it and it works.</p><p>However, this doesn't work when I beam a file to the device via Bluetooth. The file gets received and is correctly downloaded, but selecting the file from the transfer page does nothing (although I can still use a file manager to find the downloaded file in /sdcard/downloads/bluetooth and run it from there). The log contains:</p><pre><code>V/BluetoothOppUtility(  565): Get data from db:/mnt/sdcard/downloads/bluetooth/foo.appnull00:11:22:33:44:55E/BluetoothOppUtility(  565): ERROR: Para fileName ==null, or mimetype == null</code></pre><p>(The name of the file here is foo.app.)</p><p>It looks like it's deciding that the file has no MIME type and is giving up, rather than broadcasting an intent asking for a filename-based match.</p><p>This is on Froyo on an HTC Desire, and I know that HTC have been tinkering with the Bluetooth stack (as stock Android doesn't allow arbitrary files to be beamed to the device). Does anyone know how I can make this work? Beaming .jpg and .png files works fine...</p>","404568","","","","","2013-02-03 21:47:18","Android: Handling files received by Bluetooth correctly","<android><bluetooth><mime>","1","0","1","",""
"3609902","1","3609942","","2010-08-31 14:18:44","1","305","<p>I want to upload the same application twice to the Android Market. One version will have AdMob messages and the other version of the same app will cost a pair of bucks.</p><p>Should I make two applications with differents packages names in order to upload them or is there any trick to do it with the same project.</p><p>Thanks in advance.</p>","446507","","","","","2010-08-31 15:18:48","Upload two similar applications to Android Market","<android>","3","0","","",""
"3609955","1","3610026","","2010-08-31 14:25:47","1","441","<p>How could I kill all the Activiies of my application ?</p><p>I try using this.finish() but it just kill one activities.</p><p>In fact, I would like when the user touch the button BACk (in only one of the activities), the application do the same as he touch HOME Button</p>","335500","","","","","2010-08-31 14:34:20","Kill many activities","<android><activity><home>","2","2","","",""
"3610075","1","3610126","","2010-08-31 14:39:58","6","837","<p>In Android, how to implement the following effect?</p><p>Install just one application, but in the launcher, there are two entries, and entering each will go to different ui.</p><p>Just like google map, you can see only one application, but there are map and navigation entries.</p><p>Thanks.</p>","436042","","229106","","2010-08-31 14:51:05","2011-02-21 16:40:50","One application installed, show two entries in launcher","<android><android-intent><launcher>","1","1","1","",""
"3610147","1","3610555","","2010-08-31 14:46:29","11","4098","<p>Sqlite on android lets you access the database from multiple procs for reads, but if you're currently writing from one process, reads and writes from other procs will throw an exception because the first write has a lock on the db.</p><p>By ""procs"" I mean other threads in the same app.</p><p>Is there a standard way to have the other threads simply wait until the database is available again, possibly with a specified timeout, rather than throwing an exception?</p><p>Anticipating the ""why are you doing it that way?"" answers, its just the way we're doing it, and that's it.  We're also not going to use a content provider.  Just want a way to synchronize db access.</p><p>Assuming there's no standard way to do it, we'll probably wind up writing a wrapper around the db calls to do some thread synchronization.</p>","227313","","","","","2010-08-31 15:38:40","Android sqlite concurrency without exceptions","<android><sqlite><sqlite3>","2","0","1","",""
"3610368","1","3610725","","2010-08-31 15:10:33","1","123","<p>I have a table in a database where the _id column is the primary key.  If I try to do an insert into this table using an _id that already exists, my application crashes.  How can I do this?  Is there a specific kind of Exception I can eat?  I've tried SQLiteException to no avail.</p>","406790","","","","","2010-08-31 15:45:07","app explosion with conflicting sql primary key","<android><exception><sqlite><insert><sqlite3>","2","2","","",""
"3610534","1","","","2010-08-31 15:25:46","0","4082","<p>I need to load several ImageViews into a layout. The ImageViews are used to show a rating using  'star' icons. The number of stars (i.e. the rating is determined during loading by reading a configuration file.</p><p>The ImageViews are sitting inside a RelativeLayout layout.</p><p>Currently I am using something like this:</p><pre><code>RelativeLayout l = ((RelativeLayout)(findViewById(R.id.RelativeLayout01)));for (int nStarCount = 0; nStarCount &lt; config.getAsInt(""stars"", 1); nStarCount ++) {    ImageView image = new ImageView(this);    image .setImageResource(R.drawable.star);    image .setAdjustViewBounds(true);     l.addView(i); }</code></pre><p>My quesions are:</p><p>1) Is doing the loading dynamically (not using an xml) is the 'right' way of doing this ?</p><p>2) If it is, how do I make the stars display in a line, currently they get placed one on top of the other.</p><p>Any help would be appreciated.</p><p>RM</p>","14587","","","","","2010-09-02 19:58:05","Adding multiple ImageViews to a layout","<android>","3","1","","",""
"3610808","1","5539748","","2010-08-31 15:53:52","3","854","<p>I've seen a few questions about this but no solid answers.</p><p>I have a MapView that can generate up to 1600 locations on the map, based on how far the user zooms in or out. As of now, I have my marker simply set to a drawable within my application. How can I detect if a user has zoomed in/out, then scale the marker accordingly. I'm not concerned with the scaling part, but with the zoom listening part. Has anyone developed a solution to this little issue, or can point me in the correct direction to create my own?</p><p>Also, as far as I know, there is not a default marker that Android supplies. Am I correct about this? It would be nice if Android had a built in marker that handles the scaling based on zoom levels for you.</p>","356615","","","","","2013-12-12 21:51:22","Scaling Android MapView markers when a user zooms in/out","<android><android-mapview>","2","0","1","",""
"3610837","1","","","2010-08-31 15:57:44","0","98","<p>Look at the Title</p><p>I don't wont to make anything in the main.xml</p>","435346","","","","","2010-08-31 17:18:20","Who to find out the Id of TimePickerDialog?","<android>","1","1","","",""
"3610940","1","3611020","","2010-08-31 16:09:11","1","2679","<p>I have recently written a socket server in PHP that will be handling communication between an Android phone application and my PHP webserver.  Due to the fact that Android doesn't natively support push style notifications we are going to be using our webserver as the middleware layer to handle our 'pushes'.  </p><p>The socket server is stable, runs well, and seems to scale nicely.  While I would eventually like to re-write this in C I don't have the skill necessary to do that right now so I am going to be staying in PHP for at least a short while.  As of this moment our Android emulator is able to communicate through the server, get pushes, etc. so that part is all covered.</p><p>My concern is that, right now, anyone can open a socket to my server and will be given a client connection.  While we won't be passing sensitive data back and forth I don't want to allow just anyone to connect over and receive broadcast information, eat up my resources, and clog my server in general.  </p><p>The question is, how do I secure a server like this?  Let's assume that I am running on port 25,000--can I set up some sort of SSL layer on that port and expect devices like the Android to be able to communicate over that port without any special protocols or jumping through hoops?</p><p>I have considered asking the connecting clients to authenticate their user against our user database before being given a client connection, but that would require the passing of credentials in plain text over the network which I am NOT about to do.</p><p>Any suggestions on this would be very helpful--I am rather new to straight TCP communication from PHP and feel like I might just be missing something simple that allows for authentication on this level.</p><p>Additional information: If I am able to get a valid username and password securely I would be using MySQL to validate the user and then accept/reject their connection based on the results of the query.</p><p>Thanks in advance..</p>","258497","","258497","","2010-08-31 16:30:11","2010-08-31 20:28:06","PHP Socket Server (for Android Push Notifications) - Security / Authentication Issue","<php><android><sockets><ssl><tcp>","4","0","","",""
"3610975","1","3613334","","2010-08-31 16:12:56","3","700","<p>I've run into an organizational problem with an application I am working on, on the Android platform. The application uses sensors as input and OpenGL as output. </p><ul><li>The traditional method is somethinglike organizing the project into anMVC where I have the main activityclass load an OpenGL view and asensor handling class and will thenprobably register some callbacks orpossibly do it on a clock. </li><li>The sloppy alternative is having a single class that implements GLSurfaceView and SensorEventListener and then offload the logic into other classes.</li></ul><p>Assume very simple drawing code and somewhat complex control system code that will attempt to refresh at 60ish Hz. I am looking for performance, maintainability and easy of development implications, so any and all input is valuable. Also I am a complete novice when it comes to Android or mobile development so if you can show me the light with a third alternative that'd be great too.</p>","407254","","","","","2010-08-31 21:22:44","How to structure simple Android apps","<java><android><oop><opengl-es><object>","1","2","","",""
"3611059","1","3611122","","2010-08-31 16:23:13","1","11605","<p>How to get the current time in Android?</p><p>When i use </p><pre><code>int hours = java.sql.Time.this.getHours();</code></pre><p>i get the error:</p><pre><code>No enclosing instance of the type Time is accessible in scope</code></pre>","435346","","","","","2014-04-04 12:39:03","How to get the current Time","<android>","6","1","1","",""
"3611148","1","3611172","","2010-08-31 16:34:40","2","225","<p>I am trying to reproduce the behaviour of this simple layout :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:background=""#0000ff""/&gt;</code></pre><p><br/>a linearlayout with blue background taking all the available space.</p><p><br/><br/>I can't understand why this java code doesn't work ? the screen stays black. can somebody advise ?</p><pre><code>LinearLayout layout = new LinearLayout(this, null);layout.setBackgroundColor(0xff);layout.setOrientation(LinearLayout.VERTICAL);layout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT));setContentView(layout);</code></pre><p>thanks.</p>","436139","","","","","2010-08-31 16:46:31","different behaviour creating layout using xml / java","<android><android-linearlayout>","2","0","","",""
"3611239","1","","","2010-08-31 16:47:29","1","310","<p>I'm trying to architect a REST-heavy application.</p><p>Following one of the models proposed by Virgil in his Google I/O presentation, I've set up my application like so:</p><p>My Activity calls upon a ""Service Helper"" which is a singleton.  This singleton instantiates a Service which, upon start, uses a ContentProvider to hit my application's database and spins a thread to hit a web service for any pertinent syncing.  The last piece I now need is having the Service callback to the singleton, which calls back to any listening Activities.</p><p>This is the part I'm confused about.</p><p>Right now, I'm looking at the Android SDK's provided RemoteService ApiDemo.  In RemoteServiceBinding.java, an IRemoveService member var is declared called mService.  mService is used in various handlers to handle the callbacks.</p><p>However, this code will go in my Service Helper (remember this is a singleton).  There could be N number of calls to this class to start up Services for database and web service functions.  I can't just declare 1 variable called mService, right?  The RemoteService declares an ISecondaryService, but I could have N number of pieces of code calling this singleton.  It needs to be dynamic.</p><p>Ex:</p><ul><li>User is on Activity A and wants to show <em>things</em> in a list.  The Service Helper singleton is hit, returns a Cursor and starts a Service which is querying a web service for new <em>things</em>.  mService is instantiated to handle callbacks for this Service instance.</li><li>Before this Service is finished, the user switches to Activity B and does the same thing for the <em>things</em> in that Activity's list.  mService is already instantiated for the previous Service instance.  What do I do now?</li><li>Suppose the connection was slow and the user could do this for 20 Activities before the first one finished getting new <em>things</em>.  mService is already instantiated for the previous Service instance.  What do I do <em>now</em>?????</li></ul><p>What do I do here?  I'm at a loss.</p><p>It would be really really nice if the Twitter app was open sourced already...</p>","406790","","","","","2011-05-15 19:49:07","API RemoteService confusions","<android><service><callback>","1","1","1","",""
"3611267","1","3619476","","2010-08-31 16:50:24","0","4636","<p>Rather than do this by just creating a lot of strings (which I've already managed), I want to add an integer and then print those list to the screen. At the moment, I'm just trying to get one integer on the screen without even adding it, but the app is ""force closed"" in the emulator. Why doesn't this work? </p><p>Code:</p><pre><code>package com.monkeez.count;import android.app.Activity;import android.os.Bundle;import android.app.Activity;import android.view.View;import android.widget.TextView;public class Count extends Activity {    /** Called when the activity is first created. */        TextView countDisplay;    @Override    public void onCreate (Bundle savedInstanceState) {        int counter = 1;        countDisplay = new TextView(this);        this.setContentView(countDisplay);        countDisplay.setText(""counter here"");    }}</code></pre><p>The log cat is thus: </p><pre><code>09-01 09:54:07.051: DEBUG/AndroidRuntime(279): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;09-01 09:54:07.051: DEBUG/AndroidRuntime(279): CheckJNI is ON09-01 09:54:07.401: DEBUG/AndroidRuntime(279): --- registering native functions ---09-01 09:54:08.891: DEBUG/dalvikvm(193): GC_EXPLICIT freed 320 objects / 19376 bytes in 109ms09-01 09:54:09.041: DEBUG/PackageParser(65): Scanning package: /data/app/vmdl48927.tmp09-01 09:54:09.251: INFO/PackageManager(65): Removing non-system package:com.monkeez.count09-01 09:54:09.251: INFO/ActivityManager(65): Force stopping package com.monkeez.count uid=1003709-01 09:54:09.991: DEBUG/PackageManager(65): Scanning package com.monkeez.count09-01 09:54:09.991: INFO/PackageManager(65): Package com.monkeez.count codePath changed from /data/app/com.monkeez.count-2.apk to /data/app/com.monkeez.count-1.apk; Retaining data and using new09-01 09:54:10.011: INFO/PackageManager(65): /data/app/com.monkeez.count-1.apk changed; unpacking09-01 09:54:10.054: DEBUG/installd(34): DexInv: --- BEGIN '/data/app/com.monkeez.count-1.apk' ---09-01 09:54:10.511: DEBUG/dalvikvm(286): DexOpt: load 169ms, verify 64ms, opt 4ms09-01 09:54:10.591: DEBUG/installd(34): DexInv: --- END '/data/app/com.monkeez.count-1.apk' (success) ---09-01 09:54:10.602: WARN/PackageManager(65): Code path for pkg : com.monkeez.count changing from /data/app/com.monkeez.count-2.apk to /data/app/com.monkeez.count-1.apk09-01 09:54:10.602: WARN/PackageManager(65): Resource path for pkg : com.monkeez.count changing from /data/app/com.monkeez.count-2.apk to /data/app/com.monkeez.count-1.apk09-01 09:54:10.611: DEBUG/PackageManager(65):   Activities: com.monkeez.count.Count09-01 09:54:10.650: INFO/ActivityManager(65): Force stopping package com.monkeez.count uid=1003709-01 09:54:11.631: INFO/installd(34): move /data/dalvik-cache/data@app@com.monkeez.count-1.apk@classes.dex -&gt; /data/dalvik-cache/data@app@com.monkeez.count-1.apk@classes.dex09-01 09:54:11.641: DEBUG/PackageManager(65): New package installed in /data/app/com.monkeez.count-1.apk09-01 09:54:11.821: DEBUG/dalvikvm(65): GC_FOR_MALLOC freed 6733 objects / 446400 bytes in 140ms09-01 09:54:12.561: INFO/ActivityManager(65): Force stopping package com.monkeez.count uid=1003709-01 09:54:12.711: DEBUG/dalvikvm(126): GC_EXPLICIT freed 1940 objects / 106408 bytes in 121ms09-01 09:54:13.351: WARN/RecognitionManagerService(65): no available voice recognition services found09-01 09:54:13.831: DEBUG/dalvikvm(65): GC_EXPLICIT freed 4667 objects / 280056 bytes in 173ms09-01 09:54:13.901: DEBUG/dalvikvm(165): GC_EXPLICIT freed 2326 objects / 125088 bytes in 1059ms09-01 09:54:14.180: INFO/installd(34): unlink /data/dalvik-cache/data@app@com.monkeez.count-2.apk@classes.dex09-01 09:54:14.271: DEBUG/AndroidRuntime(279): Shutting down VM09-01 09:54:14.290: DEBUG/dalvikvm(279): Debugger has detached; object registry had 1 entries09-01 09:54:14.340: INFO/AndroidRuntime(279): NOTE: attach of thread 'Binder Thread #3' failed09-01 09:54:15.350: DEBUG/AndroidRuntime(291): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;09-01 09:54:15.350: DEBUG/AndroidRuntime(291): CheckJNI is ON09-01 09:54:15.740: DEBUG/AndroidRuntime(291): --- registering native functions ---09-01 09:54:16.960: INFO/ActivityManager(65): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.monkeez.count/.Count }09-01 09:54:17.120: DEBUG/AndroidRuntime(291): Shutting down VM09-01 09:54:17.170: DEBUG/dalvikvm(291): Debugger has detached; object registry had 1 entries09-01 09:54:17.250: INFO/AndroidRuntime(291): NOTE: attach of thread 'Binder Thread #3' failed09-01 09:54:17.301: INFO/ActivityManager(65): Start proc com.monkeez.count for activity com.monkeez.count/.Count: pid=298 uid=10037 gids={}09-01 09:54:18.611: WARN/ResourceType(298): No package identifier when getting value for resource number 0x0000000109-01 09:54:18.620: DEBUG/AndroidRuntime(298): Shutting down VM09-01 09:54:18.620: WARN/dalvikvm(298): threadid=1: thread exiting with uncaught exception (group=0x4001d800)09-01 09:54:18.680: ERROR/AndroidRuntime(298): FATAL EXCEPTION: main09-01 09:54:18.680: ERROR/AndroidRuntime(298): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.monkeez.count/com.monkeez.count.Count}: android.content.res.Resources$NotFoundException: String resource ID #0x109-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.os.Handler.dispatchMessage(Handler.java:99)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.os.Looper.loop(Looper.java:123)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at java.lang.reflect.Method.invokeNative(Native Method)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at java.lang.reflect.Method.invoke(Method.java:521)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at dalvik.system.NativeStart.main(Native Method)09-01 09:54:18.680: ERROR/AndroidRuntime(298): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x109-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.content.res.Resources.getText(Resources.java:201)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.widget.TextView.setText(TextView.java:2817)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at com.monkeez.count.Count.onCreate(Count.java:19)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)09-01 09:54:18.680: ERROR/AndroidRuntime(298):     ... 11 more09-01 09:54:18.940: WARN/ActivityManager(65):   Force finishing activity com.monkeez.count/.Count09-01 09:54:19.470: WARN/ActivityManager(65): Activity pause timeout for HistoryRecord{43fb6718 com.monkeez.count/.Count}09-01 09:54:19.550: INFO/ARMAssembler(65): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x2de138:0x2de1f4] in 602730 ns09-01 09:54:22.523: WARN/InputManagerService(65): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43f9297809-01 09:54:22.681: INFO/Process(298): Sending signal. PID: 298 SIG: 909-01 09:54:22.826: INFO/ActivityManager(65): Process com.monkeez.count (pid 298) has died.</code></pre><p>And the Count Manifest.xml is thus: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.monkeez.count""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Count""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt;</code></pre><p>Thanks </p><p>ps. it seems that the parser on this site doesn't like to render my xml file - you can see it at <a href=""http://pastebin.com/raw.php?i=W75ak3E9"" rel=""nofollow"">http://pastebin.com/raw.php?i=W75ak3E9</a></p>","436153","","234938","","2010-09-01 12:11:02","2010-09-01 15:02:53","I want to print an integer to the screen, add one to it and then print the answer to this for a given loop (say up until 10)","<android>","2","2","1","",""
"3611270","1","3611299","","2010-08-31 16:50:58","1","1540","<p>I see some apps which place an icon in the notification bar on my device. how do i do that with my app ?</p>","434885","","","","","2011-06-13 19:30:03","Android Dev: icon in notification bar","<android>","2","0","1","",""
"3611338","1","","","2010-08-31 16:58:10","1","656","<p>I'm developing an android app similar to piano. I am unable to play sounds as the user moves his finger over various piano bars without lifting the finger. I looked at gestures but couldn't do it. Can anyone pls. help me. </p><p>Thanks,</p>","436163","","","","","2011-06-20 20:27:35","android - how to detect a particular view has focus when user swipes finger on screen","<android>","1","1","","",""
"3611340","1","","","2010-08-31 16:58:14","0","750","<p>I launch an activity from another activity with a startActivityForResult. This activity gets a LOCATION_SERVICE. All works very well up to the point where I upload the app to my hardware.It works ok there, as well until I shut the app down. The LOCATION_SERVICE appears to continue runningand even continues to give me Toast updates until I turn the droid off.Is there an explicit 'release' call for the GPS or is one my 'finish' calls in error?Thanks in advance...</p>","436152","","349130","","2010-08-31 17:25:54","2010-08-31 17:51:54","How to release GPS service when activity is done?","<android><gps>","1","0","","",""
"3611367","1","3611405","","2010-08-31 17:00:50","0","6990","<p>Two parts to this question</p><p>1) I am working with a group of six others in a computer science class and will be creating an Android application over the next 3 or 4 months. I am looking for suggestions as to how we can come up with an idea that is not only practical but also possible to complete in the time given. I am the only one in the group that has experience with the SDK but the whole group is proficient in Java. </p><p>My main concern is taking on too much and taking too long to decide. </p><p>Summary: How should we go about deciding what we want to do?</p><p>2) Any one have any ideas? Is there anything anyone would like to see implemented on Android? I find projects like this are way easier to get motivated for when it isn't just for the class so if anyone has any ideas I am all ears. </p>","289153","","","","","2010-09-01 04:39:24","College group project, brainstorming ideas","<android><project>","4","2","2","",""
"3611427","1","3611785","","2010-08-31 17:07:55","1","837","<p>Sharing an Options Menu between Activity and MapActivity.Is this possible?</p><p>I have an Options Menu shared between multiple Activities but now I need that menu in a MapActivity.</p>","436166","","","","","2010-08-31 17:55:39","Sharing an Options Menu between Activity and MapActivity","<android>","1","0","3","",""
"3611457","1","3614089","","2010-08-31 17:11:27","32","27099","<p>My main activity has some code that makes some database changes that should not be interrupted. I'm doing the heavy lifting in another thread, and using a progress dialog which I set as non-cancellable. However, I noticed that if I rotate my phone it restarts the activity which is REALLY bad for the process that was running, and I get a Force Close. </p><p>What I want to do is programatically disable screen orientation changes until my process completes, at which time orientation changes are enabled.</p>","413414","","1765573","","2013-07-23 12:51:28","2013-11-16 11:29:37","Android: Temporarily disable orientation changes in an Activity","<android><screen-orientation><android-orientation>","8","2","21","",""
"3611476","1","6884082","","2010-08-31 17:14:02","8","1368","<p>How can I make it so that my application is seen on the Android Market only by devices with mdpi and hdpi densities. </p><p>There is the <code>&lt;supports-screens&gt;</code> tag and there is the <code>anyDensity</code> parameter but I don't see how I can say what I want. If I set anyDensity to false, what does that mean? Where do I specify which densities I do support?</p>","292263","","","","","2012-05-22 06:54:17","How to explicitly say that the application doesn't support LDPI devices","<android>","3","0","1","",""
"3611500","1","","","2010-08-31 17:17:43","0","1000","<p>I am try to use reflection to invoke the ""List Camera.Parameters.getSupportedFocusModes()"" function with the following codes:</p><pre><code>Camera.Parameters params = mCamera.getParameters();Method method = params.getClass().getDeclaredMethod(""getSupportedFocusModes"", (Class[]) null);Object o = method.invoke(params, (Object[]) null);</code></pre><p>the log shows it does find the function, however, the result o is always null, why is that? Please help me out!</p>","436186","","234039","","2010-08-31 17:36:23","2013-06-11 09:01:39","android, Method invoke problem when getting result","<android><methods>","2","0","","",""
"3611527","1","","","2010-08-31 17:21:11","0","407","<p>I want to play a alarm on my app so i need to know how to include it and to access</p>","435346","","","","","2010-08-31 21:02:43","How to include a file to my app","<android>","2","0","","",""
"3611551","1","3611641","","2010-08-31 17:24:47","10","5635","<p>I have a ListView with some elements on it. Each row has a TextView and a Button. It looks like this:</p><p><strong>| Some text in a row (Button) |</strong></p><p>Now, when I click on this text nothing happens. Simply no one function is called. But when I click on the button I can handle the event. I use onListItemClick()</p><p>So what should I use instead of this TextView to be able to handle an event (when I click on the text)?</p><p>Before this I had only one TextView in each row and when I was clicking on a row everything worked fine (onListItemClick() was called).</p><p>Thank you in advance!</p>","436172","","","","","2010-08-31 18:09:04","TextView and Button in each row and onListItemClick()","<android>","2","0","4","",""
"3611560","1","3611572","","2010-08-31 17:25:37","2","2677","<p>I am getting an exception when I try to do a replaceAll:</p><p>Symbols is a valid string.</p><pre><code>private String buildQuery(){        String query = ""http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(**QUERY**)&amp;format=json&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&amp;callback="";        deserializeQuotes();        StringBuffer symbols = new StringBuffer();        for(int i = 0; i &lt; quotes.size();i++){            if(i == (quotes.size()-1))                symbols.append(""%22"" + quotes.get(i).getSymbol() + ""%22%""); //end with a quote            else                symbols.append(""%22"" + quotes.get(i).getSymbol() + ""%22%2C"");        }        query.replaceAll(""**QUERY**"", symbols.toString());        return query;    }</code></pre><p>I get the following exception:</p><pre><code>08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.os.Handler.dispatchMessage(Handler.java:99)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.os.Looper.loop(Looper.java:123)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.app.ActivityThread.main(ActivityThread.java:4627)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at java.lang.reflect.Method.invokeNative(Native Method)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at java.lang.reflect.Method.invoke(Method.java:521)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at dalvik.system.NativeStart.main(Native Method)08-31 10:20:58.307: ERROR/AndroidRuntime(2104): Caused by: java.util.regex.PatternSyntaxException: Syntax error U_REGEX_RULE_SYNTAX near index 1:08-31 10:20:58.307: ERROR/AndroidRuntime(2104): **QUERY**08-31 10:20:58.307: ERROR/AndroidRuntime(2104):  ^08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at com.ibm.icu4jni.regex.NativeRegEx.open(Native Method)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at java.util.regex.Pattern.compileImpl(Pattern.java:383)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at java.util.regex.Pattern.&lt;init&gt;(Pattern.java:341)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at java.util.regex.Pattern.compile(Pattern.java:358)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at java.lang.String.replaceAll(String.java:2004)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at org.stocktwits.activity.Main.buildQuery(Main.java:193)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at org.stocktwits.activity.Main.createDataModel(Main.java:198)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at org.stocktwits.activity.Main.onCreate(Main.java:73)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-31 10:20:58.307: ERROR/AndroidRuntime(2104):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)</code></pre>","19875","","","","","2010-08-31 17:26:51","Java Regex Problem Replacing a String","<java><android><regex><string>","1","0","","",""
"3611608","1","3612446","","2010-08-31 17:33:31","0","196","<p>Working through the Notepad tutorial and have a question. When it builds the database with the fields rowid, title, and body - all three are private static final strings. But when a method like fetchnote() runs, it uses a long id to get the note. How does the method get that id if rowid is a string? I would like to modify the tutorial a bit and have an activity call a listactivity. The listactivity will display everything in the database, then, when a user clicks an item, I would like to copy just that entry into a new database and send the row id back to the calling activity. But I can't figure out how to get it to copy the entry into the new database because the tutorial uses a row id to make adjustments and my new database would be blank. Does that make sense? I'm new to this.  </p>","436204","","","","","2010-09-03 17:52:44","Questions about Notepad Tutorial","<android>","2","0","","",""
"3611635","1","3611652","","2010-08-31 17:36:27","4","4210","<p>I want the text ""REPLACEME"" to be replaced with my StringBuffer symbols. When I print symbols, it is a valid string. When I print my query, it still has the text REPLACEME instead of symbols. Why?</p><pre><code>private String buildQuery(){            String query = ""http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(REPLACEME)&amp;format=json&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&amp;callback="";            deserializeQuotes();            StringBuffer symbols = new StringBuffer();            for(int i = 0; i &lt; quotes.size();i++){                if(i == (quotes.size()-1))                    symbols.append(""%22"" + quotes.get(i).getSymbol() + ""%22%""); //end with a quote                else                    symbols.append(""%22"" + quotes.get(i).getSymbol() + ""%22%2C"");            }            System.out.println(""***SYMBOLS***"" + symbols.toString());            query.replaceAll(""REPLACEME"", symbols.toString());            return query;        }</code></pre>","19875","","","","","2010-08-31 17:38:59","Java regex replaceAll does not replace string","<java><android><regex><string><stringbuffer>","3","0","","",""
"3611769","1","3899702","","2010-08-31 17:53:23","14","6431","<p>I have a simple LinearLayout in Android with two images vertically:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""xmlns:app=""http://schemas.android.com/apk/res/com.eataly.android""     android:orientation=""vertical""    android:background=""@android:color/white""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;ImageView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:src=""@drawable/img_header1""        /&gt;    &lt;ImageView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:src=""@drawable/img_header2""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>As you can see at the following link, I can't get rid of a a gap at the top and at the bottom of the images:<a href=""http://img185.imageshack.us/img185/8484/senzanomev.png"">http://img185.imageshack.us/img185/8484/senzanomev.png</a></p><p>I've tried everything imaginable on the LinearLayout and the ImageViews, i.e.:</p><pre><code>android:padding=""0px""android:top=""0px""android:bottom=""0px""android:top=""0px""android:layout_margin=""0px""</code></pre><p>with no success.What can I do to remove these empty borders?</p>","19808","","","","","2014-04-15 07:03:20","Android: can't remove vertical gap between images in LinearLayout","<android><imageview><android-linearlayout>","3","3","5","",""
"3611809","1","3612019","","2010-08-31 17:57:52","2","3073","<p>I have xml file that defines some preference screens like the following example</p><pre><code>&lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""             android:key=""root_preferencescreen""&gt;    &lt;PreferenceScreen  android:key=""general_sett"" android:title=""general settings"" /&gt;     ....    &lt;PreferenceScreen  android:key=""extras_sett"" android:title=""extras settings"" /&gt;&lt;/PreferenceScreen&gt; </code></pre><p>I would like to be able to increase the font size for the text of the preference screen , but because the within a  preference screen  there is no android:textsize tag , i have no idea how to accomplish that !</p>","284609","","","","","2011-10-14 11:31:51","Text size within an PreferenceScreen","<android>","1","0","2","",""
"3611843","1","3612364","","2010-08-31 18:01:37","17","5099","<p>I've been reading a lot of posts and articles extolling the speed of Parcelable over Serializable. I've been using both for a while to pass data between Activities through Intents, and have yet to notice any speed difference when switching between the two. The typical amount of data I have to transfer is 5 to 15 nested objects with 2 to 5 fields each.</p><p>Since I have about 30 classes which must be transferable, implementing Parcelable requires a lot of boilerplate code that adds maintenance time. One of my current requirements is also that the compiled code should be as small as possible; I expect that I could spare some space by using Serializable over Parcelable.</p><p>Should I use Parcelable or is there no reason to use it over Serializable for such small amounts of data? Or is there another reason why I shouldn't use Serializable?</p>","249893","","","","","2013-02-02 22:29:26","Is using Serializable in Android bad?","<android><serializable><parcelable>","2","1","12","",""
"3611923","1","3612014","","2010-08-31 18:12:32","2","1014","<p>I have a ListActivity working as expected.  When a list item is clicked the app responds properly.  I want to add a checkbox on the far right side of the screen, next to each list item.  When I attempted to do that by updating the XML (see below) I lost the onListItemClick functionality.  When I clicked on a list item nothing happened.</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical"">    &lt;TableLayout        android:id=""@+id/table1""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:stretchColumns=""1"">        &lt;TableRow>            &lt;TextView android:id=""@+id/tvProduct""                 android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textSize=""20sp""                android:paddingLeft=""10sp""                android:paddingRight=""10sp"" />        &lt;/TableRow>    &lt;/TableLayout>    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal"">        &lt;TextView android:id=""@+id/tvPrice""             android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:paddingLeft=""10sp""            android:paddingRight=""10sp""            android:textColor=""#606060"" />    &lt;/LinearLayout>&lt;/LinearLayout></code></pre><p>I am trying to add the checkbox next to the tvProduct object.</p><p>Any help is appreciated.</p>","422967","","","","","2012-10-11 13:52:49","How can I add a checkbox to a ListActivity and not lose onListItemClick functionality?","<android>","2","0","","",""
"3611962","1","3630446","","2010-08-31 18:18:40","1","487","<p>Salam</p><p>i just started working on android(beginner). Im stuck in the activity state complexity. I created two activitys(activity1 and activity2). wen i move from the activity1 to 2  and then back to activity1 using a button(back of activity)the values(states) of the views are not restored. here is the code..</p><h2>ACTIVITY1</h2><pre><code>public class activity1 extends Activity implements OnClickListener {    String txt;    EditText etxt;    TextView tv;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        if (savedInstanceState != null) {            Toast.makeText(this, ""onCreate() : "" , Toast.LENGTH_LONG).show();        }        setContentView(R.layout.main);        Button btn_cont = (Button)findViewById(R.id.btn);        etxt = (EditText)findViewById(R.id.etxt);        tv = (TextView) findViewById(R.id.tv);        btn_cont.setOnClickListener(this);        tv = (TextView) findViewById(R.id.tv);    }    @Override    public void onClick(View click) {        txt = etxt.getText().toString();        Intent intent = new Intent(this, Activity2.class);        startActivity(intent);        tv.setText(txt);    }    public void onSaveInstanceState(Bundle sis){        sis.putString(""ist arg"", ""sec arg"");        Toast.makeText(this, ""ActivitySaveIns"", Toast.LENGTH_LONG).show();        super.onSaveInstanceState(sis);    }}</code></pre><h2>ACTIVITY2</h2><pre><code>public class Activity2 extends Activity implements OnClickListener{    Button btn_back;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.act2);        btn_back = (Button)findViewById(R.id.btn_back);        btn_back.setOnClickListener(this);    }    public void onClick(View v) {        Intent intent2 = new Intent(this,activity1.class);        startActivity(intent2);    }}</code></pre>","436244","","6391","","2010-08-31 18:50:25","2010-09-02 19:21:09","Activity switching wont keep the state of the view alive even using saveinstancestate() why?","<android>","1","0","","",""
"3612030","1","3612071","","2010-08-31 18:27:19","2","1645","<p>Here is the JSON result:</p><pre><code>{  ""query"": {    ""count"": ""4"",    ""created"": ""2010-08-31T05:53:39Z"",    ""lang"": ""en-US"",    ""results"": {      ""quote"": [        {          ""symbol"": ""AAPL"",          ""Ask"": ""244.17"",          ""AverageDailyVolume"": ""23152200"",          ""Bid"": ""244.12"",          ""AskRealtime"": ""244.17"",          ""BidRealtime"": ""244.12"",          ""BookValue"": ""47.194"",          ""Change_PercentChange"": ""+1.67 - +0.69%"",          ""Change"": ""+1.67"",          ""Commission"": null,          ""ChangeRealtime"": ""+1.67"",          ""AfterHoursChangeRealtime"": ""N/A - N/A"",          ""DividendShare"": ""0.00"",          ""LastTradeDate"": ""8/31/2010"",          ""TradeDate"": null,          ""EarningsShare"": ""13.285"",          ""ErrorIndicationreturnedforsymbolchangedinvalid"": ""N/A"",          ""EPSEstimateCurrentYear"": ""14.43"",          ""EPSEstimateNextYear"": ""17.48"",          ""EPSEstimateNextQuarter"": ""4.89"",          ""DaysLow"": ""240.35"",          ""DaysHigh"": ""244.56"",          ""YearLow"": ""164.11"",          ""YearHigh"": ""279.01"",          ""HoldingsGainPercent"": ""- - -"",          ""AnnualizedGain"": ""-"",          ""HoldingsGain"": null,          ""HoldingsGainPercentRealtime"": ""N/A - N/A"",          ""HoldingsGainRealtime"": null,          ""MoreInfo"": ""cnsprmiIed"",          ""OrderBookRealtime"": ""N/A"",          ""MarketCapitalization"": ""223.1B"",          ""MarketCapRealtime"": null,          ""EBITDA"": ""17.498B"",          ""ChangeFromYearLow"": ""+80.06"",          ""PercentChangeFromYearLow"": ""+48.78%"",          ""LastTradeRealtimeWithTime"": ""N/A - &lt;b&gt;244.17&lt;/b&gt;"",          ""ChangePercentRealtime"": ""N/A - +0.69%"",          ""ChangeFromYearHigh"": ""-34.84"",          ""PercebtChangeFromYearHigh"": ""-12.49%"",          ""LastTradeWithTime"": ""1:38pm - &lt;b&gt;244.17&lt;/b&gt;"",          ""LastTradePriceOnly"": ""244.17"",          ""HighLimit"": null,          ""LowLimit"": null,          ""DaysRange"": ""240.35 - 244.56"",          ""DaysRangeRealtime"": ""N/A - N/A"",          ""FiftydayMovingAverage"": ""253.32"",          ""TwoHundreddayMovingAverage"": ""244.902"",          ""ChangeFromTwoHundreddayMovingAverage"": ""-0.732"",          ""PercentChangeFromTwoHundreddayMovingAverage"": ""-0.30%"",          ""ChangeFromFiftydayMovingAverage"": ""-9.15"",          ""PercentChangeFromFiftydayMovingAverage"": ""-3.61%"",          ""Name"": ""Apple Inc."",          ""Notes"": ""-"",          ""Open"": ""241.79"",          ""PreviousClose"": ""242.50"",          ""PricePaid"": null,          ""ChangeinPercent"": ""+0.69%"",          ""PriceSales"": ""3.88"",          ""PriceBook"": ""5.14"",          ""ExDividendDate"": ""21-Nov-95"",          ""PERatio"": ""18.25"",          ""DividendPayDate"": ""N/A"",          ""PERatioRealtime"": null,          ""PEGRatio"": ""0.88"",          ""PriceEPSEstimateCurrentYear"": ""16.81"",          ""PriceEPSEstimateNextYear"": ""13.87"",          ""Symbol"": ""AAPL"",          ""SharesOwned"": null,          ""ShortRatio"": ""0.40"",          ""LastTradeTime"": ""1:38pm"",          ""TickerTrend"": ""&amp;nbsp;--+-++&amp;nbsp;"",          ""OneyrTargetPrice"": ""332.00"",          ""Volume"": ""7916913"",          ""HoldingsValue"": null,          ""HoldingsValueRealtime"": null,          ""YearRange"": ""164.11 - 279.01"",          ""DaysValueChange"": ""- - +0.69%"",          ""DaysValueChangeRealtime"": ""N/A - N/A"",          ""StockExchange"": ""NasdaqNM"",          ""DividendYield"": null,          ""PercentChange"": ""+0.69%""        },        {          ""symbol"": ""MSFT"",          ""Ask"": ""23.60"",          ""AverageDailyVolume"": ""67088400"",          ""Bid"": ""23.59"",          ""AskRealtime"": ""23.60"",          ""BidRealtime"": ""23.59"",          ""BookValue"": ""5.327"",          ""Change_PercentChange"": ""-0.045 - -0.19%"",          ""Change"": ""-0.045"",          ""Commission"": null,          ""ChangeRealtime"": ""-0.045"",          ""AfterHoursChangeRealtime"": ""N/A - N/A"",          ""DividendShare"": ""0.52"",          ""LastTradeDate"": ""8/31/2010"",          ""TradeDate"": null,          ""EarningsShare"": ""2.101"",          ""ErrorIndicationreturnedforsymbolchangedinvalid"": ""N/A"",          ""EPSEstimateCurrentYear"": ""2.36"",          ""EPSEstimateNextYear"": ""2.64"",          ""EPSEstimateNextQuarter"": ""0.69"",          ""DaysLow"": ""23.52"",          ""DaysHigh"": ""23.73"",          ""YearLow"": ""22.73"",          ""YearHigh"": ""31.58"",          ""HoldingsGainPercent"": ""- - -"",          ""AnnualizedGain"": ""-"",          ""HoldingsGain"": null,          ""HoldingsGainPercentRealtime"": ""N/A - N/A"",          ""HoldingsGainRealtime"": null,          ""MoreInfo"": ""cnsprmiIed"",          ""OrderBookRealtime"": ""N/A"",          ""MarketCapitalization"": ""204.2B"",          ""MarketCapRealtime"": null,          ""EBITDA"": ""27.197B"",          ""ChangeFromYearLow"": ""+0.865"",          ""PercentChangeFromYearLow"": ""+3.81%"",          ""LastTradeRealtimeWithTime"": ""N/A - &lt;b&gt;23.595&lt;/b&gt;"",          ""ChangePercentRealtime"": ""N/A - -0.19%"",          ""ChangeFromYearHigh"": ""-7.985"",          ""PercebtChangeFromYearHigh"": ""-25.28%"",          ""LastTradeWithTime"": ""1:38pm - &lt;b&gt;23.595&lt;/b&gt;"",          ""LastTradePriceOnly"": ""23.595"",          ""HighLimit"": null,          ""LowLimit"": null,          ""DaysRange"": ""23.52 - 23.73"",          ""DaysRangeRealtime"": ""N/A - N/A"",          ""FiftydayMovingAverage"": ""25.0947"",          ""TwoHundreddayMovingAverage"": ""27.3083"",          ""ChangeFromTwoHundreddayMovingAverage"": ""-3.7133"",          ""PercentChangeFromTwoHundreddayMovingAverage"": ""-13.60%"",          ""ChangeFromFiftydayMovingAverage"": ""-1.4997"",          ""PercentChangeFromFiftydayMovingAverage"": ""-5.98%"",          ""Name"": ""Microsoft Corpora"",          ""Notes"": ""-"",          ""Open"": ""23.58"",          ""PreviousClose"": ""23.64"",          ""PricePaid"": null,          ""ChangeinPercent"": ""-0.19%"",          ""PriceSales"": ""3.27"",          ""PriceBook"": ""4.44"",          ""ExDividendDate"": ""Aug 17"",          ""PERatio"": ""11.25"",          ""DividendPayDate"": ""Sep  9"",          ""PERatioRealtime"": null,          ""PEGRatio"": ""0.97"",          ""PriceEPSEstimateCurrentYear"": ""10.02"",          ""PriceEPSEstimateNextYear"": ""8.95"",          ""Symbol"": ""MSFT"",          ""SharesOwned"": null,          ""ShortRatio"": ""1.20"",          ""LastTradeTime"": ""1:38pm"",          ""TickerTrend"": ""&amp;nbsp;-=+-+-&amp;nbsp;"",          ""OneyrTargetPrice"": ""33.03"",          ""Volume"": ""25999320"",          ""HoldingsValue"": null,          ""HoldingsValueRealtime"": null,          ""YearRange"": ""22.73 - 31.58"",          ""DaysValueChange"": ""- - -0.19%"",          ""DaysValueChangeRealtime"": ""N/A - N/A"",          ""StockExchange"": ""NasdaqNM"",          ""DividendYield"": ""2.20"",          ""PercentChange"": ""-0.19%""        },        {          ""symbol"": ""GOOG"",          ""Ask"": ""451.95"",          ""AverageDailyVolume"": ""2813780"",          ""Bid"": ""451.68"",          ""AskRealtime"": ""451.95"",          ""BidRealtime"": ""451.68"",          ""BookValue"": ""127.468"",          ""Change_PercentChange"": ""-0.89 - -0.20%"",          ""Change"": ""-0.89"",          ""Commission"": null,          ""ChangeRealtime"": ""-0.89"",          ""AfterHoursChangeRealtime"": ""N/A - N/A"",          ""DividendShare"": ""0.00"",          ""LastTradeDate"": ""8/31/2010"",          ""TradeDate"": null,          ""EarningsShare"": ""23.025"",          ""ErrorIndicationreturnedforsymbolchangedinvalid"": ""N/A"",          ""EPSEstimateCurrentYear"": ""27.27"",          ""EPSEstimateNextYear"": ""31.26"",          ""EPSEstimateNextQuarter"": ""7.50"",          ""DaysLow"": ""448.00"",          ""DaysHigh"": ""454.87"",          ""YearLow"": ""433.63"",          ""YearHigh"": ""629.51"",          ""HoldingsGainPercent"": ""- - -"",          ""AnnualizedGain"": ""-"",          ""HoldingsGain"": null,          ""HoldingsGainPercentRealtime"": ""N/A - N/A"",          ""HoldingsGainRealtime"": null,          ""MoreInfo"": ""cnprmiIed"",          ""OrderBookRealtime"": ""N/A"",          ""MarketCapitalization"": ""144.0B"",          ""MarketCapRealtime"": null,          ""EBITDA"": ""10.825B"",          ""ChangeFromYearLow"": ""+18.17"",          ""PercentChangeFromYearLow"": ""+4.19%"",          ""LastTradeRealtimeWithTime"": ""N/A - &lt;b&gt;451.80&lt;/b&gt;"",          ""ChangePercentRealtime"": ""N/A - -0.20%"",          ""ChangeFromYearHigh"": ""-177.71"",          ""PercebtChangeFromYearHigh"": ""-28.23%"",          ""LastTradeWithTime"": ""1:38pm - &lt;b&gt;451.80&lt;/b&gt;"",          ""LastTradePriceOnly"": ""451.80"",          ""HighLimit"": null,          ""LowLimit"": null,          ""DaysRange"": ""448.00 - 454.87"",          ""DaysRangeRealtime"": ""N/A - N/A"",          ""FiftydayMovingAverage"": ""481.689"",          ""TwoHundreddayMovingAverage"": ""511.725"",          ""ChangeFromTwoHundreddayMovingAverage"": ""-59.925"",          ""PercentChangeFromTwoHundreddayMovingAverage"": ""-11.71%"",          ""ChangeFromFiftydayMovingAverage"": ""-29.889"",          ""PercentChangeFromFiftydayMovingAverage"": ""-6.21%"",          ""Name"": ""Google Inc."",          ""Notes"": ""-"",          ""Open"": ""450.11"",          ""PreviousClose"": ""452.69"",          ""PricePaid"": null,          ""ChangeinPercent"": ""-0.20%"",          ""PriceSales"": ""5.50"",          ""PriceBook"": ""3.55"",          ""ExDividendDate"": ""N/A"",          ""PERatio"": ""19.66"",          ""DividendPayDate"": ""N/A"",          ""PERatioRealtime"": null,          ""PEGRatio"": ""1.03"",          ""PriceEPSEstimateCurrentYear"": ""16.60"",          ""PriceEPSEstimateNextYear"": ""14.48"",          ""Symbol"": ""GOOG"",          ""SharesOwned"": null,          ""ShortRatio"": ""1.40"",          ""LastTradeTime"": ""1:38pm"",          ""TickerTrend"": ""&amp;nbsp;=+=-=-&amp;nbsp;"",          ""OneyrTargetPrice"": ""619.52"",          ""Volume"": ""874781"",          ""HoldingsValue"": null,          ""HoldingsValueRealtime"": null,          ""YearRange"": ""433.63 - 629.51"",          ""DaysValueChange"": ""- - -0.20%"",          ""DaysValueChangeRealtime"": ""N/A - N/A"",          ""StockExchange"": ""NasdaqNM"",          ""DividendYield"": null,          ""PercentChange"": ""-0.20%""        },        {          ""symbol"": ""YHOO"",          ""Ask"": ""13.06"",          ""AverageDailyVolume"": ""18903300"",          ""Bid"": ""13.05"",          ""AskRealtime"": ""13.06"",          ""BidRealtime"": ""13.05"",          ""BookValue"": ""8.912"",          ""Change_PercentChange"": ""-0.12 - -0.91%"",          ""Change"": ""-0.12"",          ""Commission"": null,          ""ChangeRealtime"": ""-0.12"",          ""AfterHoursChangeRealtime"": ""N/A - N/A"",          ""DividendShare"": ""0.00"",          ""LastTradeDate"": ""8/31/2010"",          ""TradeDate"": null,          ""EarningsShare"": ""0.61"",          ""ErrorIndicationreturnedforsymbolchangedinvalid"": ""N/A"",          ""EPSEstimateCurrentYear"": ""0.69"",          ""EPSEstimateNextYear"": ""0.74"",          ""EPSEstimateNextQuarter"": ""0.19"",          ""DaysLow"": ""12.97"",          ""DaysHigh"": ""13.135"",          ""YearLow"": ""13.03"",          ""YearHigh"": ""19.12"",          ""HoldingsGainPercent"": ""- - -"",          ""AnnualizedGain"": ""-"",          ""HoldingsGain"": null,          ""HoldingsGainPercentRealtime"": ""N/A - N/A"",          ""HoldingsGainRealtime"": null,          ""MoreInfo"": ""cnsprmiIed"",          ""OrderBookRealtime"": ""N/A"",          ""MarketCapitalization"": ""17.609B"",          ""MarketCapRealtime"": null,          ""EBITDA"": ""1.328B"",          ""ChangeFromYearLow"": ""+0.03"",          ""PercentChangeFromYearLow"": ""+0.23%"",          ""LastTradeRealtimeWithTime"": ""N/A - &lt;b&gt;13.06&lt;/b&gt;"",          ""ChangePercentRealtime"": ""N/A - -0.91%"",          ""ChangeFromYearHigh"": ""-6.06"",          ""PercebtChangeFromYearHigh"": ""-31.69%"",          ""LastTradeWithTime"": ""1:38pm - &lt;b&gt;13.06&lt;/b&gt;"",          ""LastTradePriceOnly"": ""13.06"",          ""HighLimit"": null,          ""LowLimit"": null,          ""DaysRange"": ""12.97 - 13.135"",          ""DaysRangeRealtime"": ""N/A - N/A"",          ""FiftydayMovingAverage"": ""14.1167"",          ""TwoHundreddayMovingAverage"": ""15.504"",          ""ChangeFromTwoHundreddayMovingAverage"": ""-2.444"",          ""PercentChangeFromTwoHundreddayMovingAverage"": ""-15.76%"",          ""ChangeFromFiftydayMovingAverage"": ""-1.0567"",          ""PercentChangeFromFiftydayMovingAverage"": ""-7.49%"",          ""Name"": ""Yahoo! Inc."",          ""Notes"": ""-"",          ""Open"": ""13.09"",          ""PreviousClose"": ""13.18"",          ""PricePaid"": null,          ""ChangeinPercent"": ""-0.91%"",          ""PriceSales"": ""2.73"",          ""PriceBook"": ""1.48"",          ""ExDividendDate"": ""12-May-04"",          ""PERatio"": ""21.61"",          ""DividendPayDate"": ""N/A"",          ""PERatioRealtime"": null,          ""PEGRatio"": ""1.73"",          ""PriceEPSEstimateCurrentYear"": ""19.10"",          ""PriceEPSEstimateNextYear"": ""17.81"",          ""Symbol"": ""YHOO"",          ""SharesOwned"": null,          ""ShortRatio"": ""1.40"",          ""LastTradeTime"": ""1:38pm"",          ""TickerTrend"": ""&amp;nbsp;===-=+&amp;nbsp;"",          ""OneyrTargetPrice"": ""18.16"",          ""Volume"": ""7561435"",          ""HoldingsValue"": null,          ""HoldingsValueRealtime"": null,          ""YearRange"": ""13.03 - 19.12"",          ""DaysValueChange"": ""- - -0.91%"",          ""DaysValueChangeRealtime"": ""N/A - N/A"",          ""StockExchange"": ""NasdaqNM"",          ""DividendYield"": null,          ""PercentChange"": ""-0.91%""        }      ]    }  }}</code></pre><p><strong>UPDATE:</strong> And here is my code (assume buildQuery and RestClient are valid):</p><pre><code>private void getQuotesFromYQL(){    JSONObject json = RestClient    .connect(buildQuery());    try {        JSONObject query = json.getJSONObject(""query"");        JSONArray quotes = query.getJSONArray(""results"");        for (int i = 0; i &lt; quotes.length(); i++) {            JSONObject quote = quotes.getJSONObject(i)            .getJSONObject(""quote"");            // Do something with the user            Quote myQuote = new Quote();            myQuote.setName(quote.getString(""Name""));            myQuote.setSymbol(quote.getString(""Symbol""));            myQuote.setLastTradePriceOnly(quote.getString(""LastTradePriceOnly""));            quotesAdapter.add(myQuote);        }    } catch (JSONException e) {        System.out.println(e);    }}   </code></pre><p>I get the following Exception on <code>JSONArray quotes = query.getJSONArray(""results"");</code>:</p><pre><code>org.json.JSONException: Value {""quote"": ... </code></pre><p>The value of ""quote"" is printed in the debugger.</p><p>How can I parse this correctly?</p>","19875","","19875","","2010-08-31 19:01:56","2010-08-31 19:07:56","Problem parsing this YQL JSON in Java/Android","<java><android><json><parsing><yql>","1","0","1","",""
"3612062","1","4738314","","2010-08-31 18:31:42","13","4072","<p>I want to have a ""change theme"" feature in my app. If I call setTheme() in onCreate(), there is one problem.</p><p>The moment after I launch my app, a plain white background appears for a second (because I have set light theme in the manifest). After that, the complete layout of my Activity is displayed - it is either with white or black background, according to user's theme preference.</p><p>Is there any way I can change whether white or black background appears after launch?</p>","243225","","84021","","2011-10-19 21:52:03","2011-10-19 21:52:03","Implement change black/light theme feature in Android app","<android>","4","2","3","",""
"3612069","1","","","2010-08-31 18:32:45","0","1723","<p>Is there a way to find the IP address of the desktop machine connected the android phone after USB tethering is turned on?</p><p>Does android assign a fixed IP address to the desktop? Or does it assign a dynamic address (dhcp)? Is there a PPP connection created between the phone and machine?</p>","436261","","496830","","2011-03-22 23:00:19","2012-01-30 04:59:58","Programmatically find the IP address of the desktop over USB tethering","<android><usb>","2","0","1","",""
"3612558","1","","","2010-08-31 19:38:40","0","822","<p>Hy!</p><p>I have a service from which a start a new thread. This new thread will communicate with a TCP server using socket. What is the best way to send the data received from TCP server back to the service? Handlers or something else?</p><p>Thanks in advance,kukukk</p>","436312","","","","","2012-01-26 06:55:22","Android: How to send back data from thread to service?","<android><multithreading><service>","2","0","","",""
"3612561","1","3612968","","2010-08-31 19:38:48","3","2057","<p>I have a WCF REST service built with C# and it returns an image as part of a CPU intensive operation. The client is running on Android (Java) By default, it will return a text JSON object that looks something like this:</p><p>{""d"",[9,0,77,12,11,...]}</p><p>Those are they bytes of the image.  Fine.  However, all the solutions for decoding this JSON are intolerably slow.  I've tried Gson, Jackson, and the built-in Android JSONObject class.  I have no idea why they are so slow.</p><p>As an alternative solution, I have my REST service return a GUID, and then that GUID can be used by the Android client to go to a regular URL that serves up the image as a regular binary stream, via an MVC controller.  </p><p>This works well, and it fast, and is pretty easy to handle on the Android side.  However, it does feel like a bit of kludge and kind of a violation of the REST design principles.</p><p>Am I missing something here?  Is there a better way to do this?</p>","202259","","727208","","2013-04-06 17:04:02","2013-04-06 17:04:02","Consuming a WCF REST service from Android is very slow","<android><asp.net-mvc><rest><binary>","4","0","2","",""
"3612641","1","","","2010-08-31 19:47:44","0","477","<p>the code in the main class works perfekt but i need a other thread but there the code won't work</p><pre><code>public class Alarm implements Runnable {@Overridepublic void run() {    MediaPlayer mp = new MediaPlayer().create(this, R.raw.alarm);    mp.start();    Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);     long milliseconds = 1000;    v.vibrate(milliseconds);}</code></pre><p>}</p><p>Errors:</p><pre><code>The method create(Context, int) in the type MediaPlayer is not applicable for the arguments (Alarm, int)</code></pre><p>and</p><pre><code>The method getSystemService(String) is undefined for the type Alarm</code></pre>","435346","","","","","2014-01-06 12:26:50","Code won't work in new Class","<android><exception-handling>","1","0","","",""
"3612643","1","3614605","","2010-08-31 19:48:27","0","2910","<p>I have a table that I am trying to dynamically delete rows from.  Each row has a delete button, which opens a confirmation dialog.  I would like to remove this table row when confirmation gives a positive result.  </p><p>I got this working, rather sloppily, and was wondering if there was a simpler way to accomplish my goal.  To clarify things in the code sample, my table needs to be created dynamically, so I gave the delete buttons an id of the row id + 2000.  I also destroy and recreate the dialog in each onPrepareDialog().  Is there a cleaner way to do this, specifically without destroying and recreating the dialog each time it is opened?  Thank you very much!</p><p>Some code from my main Activity class:</p><pre><code>    private OnClickListener deleteRowListener = new OnClickListener() {                public void onClick(View v) {                    Bundle args = new Bundle();                            args.putInt(DELETE_ID_KEY, v.getId());                    showDialog(DIALOG_DELETE,args);                }        };        @Override        protected void onPrepareDialog(int id, Dialog dialog, Bundle args) {            switch (id) {                case DIALOG_DELETE : {                    removeDialog(id);                    dialog = createDeleteDialog(args);                }            }        }        @Override        protected Dialog onCreateDialog(int id, Bundle args) {            switch (id) {                case DIALOG_DELETE : {                    return createDeleteDialog(args);                }            }            return null;        }private Dialog createDeleteDialog(Bundle args) {        final int toDeleteId = args.getInt(DELETE_ID_KEY) - 2000;  //FSP!!        return new AlertDialog.Builder(this)        .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton) {             TableRow row = rowsMap.get(toDeleteId);                   myTable.removeView(row);            }        })        .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int whichButton) {                dialog.cancel();            }        })        .create();    }</code></pre>","436319","","436319","","2010-08-31 20:26:04","2010-09-01 02:16:42","Android Dialogs: Confirmation for deleting a table row","<android>","1","0","","",""
"3612657","1","3613208","","2010-08-31 19:50:25","1","510","<p>I am implementing the client side of some java application for Android devices which requires a lot of user interaction, image loadings and JSON object parsing. I'm trying to decide whether to implement it with html5, flash or Android native code. </p><p>Frame#/sec is crucial for this application. Does anyone have any idea of what other important metrics to evaluate against for applications like this? Is there any sample android app (in native code) that's similar to Card Flip demo app in apple's html5 showcase (<a href=""http://www.apple.com/html5/showcase/gallery/"" rel=""nofollow"">http://www.apple.com/html5/showcase/gallery/</a>)?</p>","436323","","436323","","2010-09-01 17:15:04","2010-09-01 17:15:04","Good way to evaluate application performance on Android devices","<android>","1","0","","",""
"3612666","1","3612834","","2010-08-31 19:51:40","3","444","<p>Just checking out Android development very superficially, and it seems that most everyone is working in Java. Yet</p><blockquote>  <p>Android includes a set of C/C++  libraries used by various components  of the Android system. These  capabilities are exposed to developers  through the Android application  framework.</p></blockquote><p>does this mean that, in Android applications, Java is used and C++ is used:</p><ul><li>sometimes?</li><li>a lot?</li><li>almost never?</li><li>Never: you cannot use it for applications?</li></ul>","8047","","","","","2010-09-01 14:09:22","Android and C++: Necessary?","<java><c++><android>","6","2","","",""
"3612695","1","3612728","","2010-08-31 19:55:22","4","1271","<p>I've been doing some usability testing on a website I'm developing, using an Android phone and an iPod touch.  In both cases, when entering a numeric field (time, distance in metres, etc) I have to take a manual step to change the keyboard layout to show digits.  As the app will only accept numeric values in the textbox, I'd like to save the user the inconvenience and tell the device <em>""switch to the number pad for this input""</em>.</p><p>Is this possible?</p>","24874","","","","","2012-01-20 16:17:25","Can you provide a hint to a mobile device that an HTML input field is numeric-only?","<iphone><html><android><mobile><usability>","1","0","2","",""
"3612772","1","3612802","","2010-08-31 20:04:36","2","1078","<p>Is there a way to set a WebView as a Live Wallpaper?Any links/hints greatly appreciated! </p><p>Thanks!</p>","203111","","19750","","2011-03-30 21:53:00","2011-03-30 21:53:00","WebView as a Live Wallpaper?","<android><live-wallpaper>","1","0","2","",""
"3612823","1","","","2010-08-31 20:11:18","1","46","<p>I am a Android developer need quick help on a strange issue with Samsung Captivate. I use <code>android:windowSoftInputMode=""adjustPan""</code> for an activity which has a list of EditText in it. The page can expand by adding more EditText views, when it grows long and onFocus of last field soft keyboard pops up and the activity doesn't completely push up. So the EditText view falls behind the soft keyboard.</p><p>The strange thing is same the activity and same code moves up without any issues for all other Android devices like HTC Aria, Xeperia, etc. Only Samsung Captivate doesn't move up completely, not sure why its device specific. Is it a framework issue?</p><p>With regards,Visva</p>","436338","","225647","","2010-08-31 20:29:17","2010-08-31 20:29:17","Captivate - framework issue","<android>","0","0","","",""
"3612831","1","3612947","","2010-08-31 20:11:57","2","1106","<p>I'm using OpenGL ES on Android to draw some shapes, so I have some Model classes to load the vertices etc from an .obj file.</p><p>Each model then has a onDrawFrame() method which is called by the Renderer to place it in the scene.</p><pre><code>public void onDrawFrame(GL10 gl) {    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glEnable(GL10.GL_CULL_FACE);    gl.glFrontFace(GL10.GL_CCW);    gl.glCullFace(GL10.GL_BACK);    gl.glVertexPointer(0, GL10.GL_FLOAT, 0, mVerts);    gl.glDrawElements(GL10.GL_TRIANGLES, mFaces.capacity(), GL10.GL_UNSIGNED_BYTE, mFaces);    gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);}</code></pre><p>My confusion now is where to ""reset"" the vertex pointer (I think), because if I try to create an arbitrary line from a new glVertexPointer using 2 new verts, and a call to glDrawElements(GL_LINES) using those id's, the line always seems to use verts 0 and 1 from the original data.</p><p>Do I need to pre-define all my scene's verts in one master glVertexPointer tracked by the master scene somehow, and have each model just call glDrawElements with a suitable offset?  Or do I clear the pointer somehow?</p>","138033","","","","","2010-08-31 20:27:23","Repeated calls to glVertexPointer and glDraw","<android><opengl-es>","1","0","","",""
"3612895","1","3612943","","2010-08-31 20:19:40","5","11487","<p>How can I make columns in Android ListView? I have this list item layout xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:orientation=""horizontal""&gt;    &lt;TextView android:layout_weight="".3"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:id=""@+id/hour""        android:gravity=""center"" /&gt;    &lt;ImageView android:id=""@+id/symbol"" android:scaleType=""fitCenter""        android:layout_gravity=""center_horizontal"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:layout_weight="".5"" /&gt;    &lt;TextView android:layout_weight="".8"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:id=""@+id/temperature""        android:gravity=""center"" /&gt;    &lt;TextView android:layout_weight=""1"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:id=""@+id/percipitation""        android:gravity=""center"" /&gt;    &lt;TextView android:layout_weight=""1"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:id=""@+id/wind_speed""        android:gravity=""center"" /&gt;    &lt;TextView android:layout_weight=""1"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:id=""@+id/wind_direction""        android:gravity=""center"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The problem is when the f.ex. wind_direction change from ""4"" to ""300"", then the columns are not aligned. </p><p><img src=""http://img185.imageshack.us/img185/2812/deviceo.png"" alt=""The problem""></p><p>Who can this be made with fixed width of columns and using the whole width independent of devices?</p>","382023","","","","","2013-01-25 16:56:04","Columns in ListView Android","<android><listview>","6","0","1","",""
"3612897","1","4006728","","2010-08-31 20:20:05","0","559","<p>^Question^</p><p>I think that it would be too complex to open a database. Does using shared preferences make my app's data size become big. Is there a temporary storage place for my data or should I delete the data in the shared preferences for that widget.</p><p>Short code samples are very appreciated :)</p><p>Thank you</p>","398148","","","","","2010-10-24 00:42:15","Where should I store my widget's preferences on the Configuration page on Android?","<android><database><configuration><android-widget><sharedpreferences>","1","2","","",""
"3612978","1","3613040","","2010-08-31 20:32:04","1","1900","<p>I´d like to show a simple information dialog with an Ok-Button, about whats new in this version, but it should show only at the first start. Whats the best way to implement this ?</p>","343482","","","","","2010-08-31 20:39:37","Show version info only once on application start in Android App","<android><dialog><startup>","3","0","2","",""
"3613001","1","","","2010-08-31 20:35:06","1","177","<p>How to find out line of code where application failed in Android? (without debugging just to see crash dump)</p>","432137","","289171","","2010-08-31 22:06:46","2013-04-29 14:02:17","Find the place where application crashed","<java><android><error-handling>","3","2","","",""
"3613150","1","3613240","","2010-08-31 20:53:34","2","1384","<p>I am creating an Android app that uses Twitter4J to read some user info.</p><p>This was all working fine, but this evening when I start the app and the user logs on to Twitter I get an exception:</p><pre><code>    Twitter twitter = new TwitterFactory().getInstance(twitterID,twitterPassword);    u = twitter.verifyCredentials();</code></pre><p>This throws the following exception on the verifyCredentials() call:</p><pre><code>08-31 20:36:59.084: WARN/System.err(454): twitter4j.TwitterException: https://api.twitter.com/1/account/verify_credentials.json08-31 20:36:59.094: WARN/System.err(454):     at twitter4j.http.HttpClient.request(HttpClient.java:333)08-31 20:36:59.094: WARN/System.err(454):     at twitter4j.http.HttpClientWrapper.request(HttpClientWrapper.java:66)08-31 20:36:59.094: WARN/System.err(454):     at twitter4j.http.HttpClientWrapper.get(HttpClientWrapper.java:88)08-31 20:36:59.094: WARN/System.err(454):     at twitter4j.Twitter.verifyCredentials(Twitter.java:1025)08-31 20:36:59.104: WARN/System.err(454):     at com.tmm.android.soundbiter.TwitterInterface.&lt;init&gt;(TwitterInterface.java:65)08-31 20:36:59.104: WARN/System.err(454):     at com.tmm.android.soundbiter.LogOnActivity.initTwitterUser(LogOnActivity.java:138)08-31 20:36:59.104: WARN/System.err(454):     at com.tmm.android.soundbiter.LogOnActivity.startApplicationActivity(LogOnActivity.java:102)08-31 20:36:59.104: WARN/System.err(454):     at com.tmm.android.soundbiter.LogOnActivity.onCreate(LogOnActivity.java:47)08-31 20:36:59.104: WARN/System.err(454):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-31 20:36:59.104: WARN/System.err(454):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)08-31 20:36:59.104: WARN/System.err(454):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)08-31 20:36:59.104: WARN/System.err(454):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)08-31 20:36:59.115: WARN/System.err(454):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)08-31 20:36:59.115: WARN/System.err(454):     at android.os.Handler.dispatchMessage(Handler.java:99)08-31 20:36:59.115: WARN/System.err(454):     at android.os.Looper.loop(Looper.java:123)08-31 20:36:59.115: WARN/System.err(454):     at android.app.ActivityThread.main(ActivityThread.java:4363)08-31 20:36:59.124: WARN/System.err(454):     at java.lang.reflect.Method.invokeNative(Native Method)08-31 20:36:59.124: WARN/System.err(454):     at java.lang.reflect.Method.invoke(Method.java:521)08-31 20:36:59.124: WARN/System.err(454):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)08-31 20:36:59.124: WARN/System.err(454):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)08-31 20:36:59.134: WARN/System.err(454):     at dalvik.system.NativeStart.main(Native Method)08-31 20:36:59.134: WARN/System.err(454): Caused by: java.io.FileNotFoundException: https://api.twitter.com/1/account/verify_credentials.json08-31 20:36:59.134: WARN/System.err(454):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1061)08-31 20:36:59.134: WARN/System.err(454):     at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection.getInputStream(HttpsURLConnection.java:252)08-31 20:36:59.134: WARN/System.err(454):     at twitter4j.http.HttpResponse.&lt;init&gt;(HttpResponse.java:83)08-31 20:36:59.134: WARN/System.err(454):     at twitter4j.http.HttpClient.request(HttpClient.java:288)08-31 20:36:59.134: WARN/System.err(454):     ... 20 more</code></pre><p>As I mentioned, this has not changed for weeks, but has just suddenly stopped working.. I have also noticed that if I instantiate my Twitter object annonymously (dont pass username and password) then it still allows me to retrieve information/users/statuses from twitter (obviously verifyCredentials() does not work here though as it is an anonymous user)</p><p>Has anyone experienced this issue or similar?</p><p>Thanks in advance!</p>","258813","","","","","2010-08-31 21:07:33","Twitter4J exception on verifyCredentials","<android><twitter><twitter4j>","1","2","1","",""
"3613152","1","","","2010-08-31 20:54:01","13","1856","<p>I'm currently implementing an autocomplete field by using the <code>AutocompleteTextView</code> component.</p><p>I'm trying to add a completion hint with the number of results, and just want to style it differently from the dropdown list element.There is an attribute named <code>completionHintView</code> on the component, but every time I give it a layout I previously defined it throws a <code>NullPointerException</code>.</p><p>Does anyone have a working example on how to style the completion hint?</p>","436371","","418183","","2011-10-20 09:19:07","2012-07-11 16:50:34","AutocompleteTextview and CompletionHintView","<android><autocompletetextview>","1","1","6","",""
"3613155","1","3613229","","2010-08-31 20:54:26","1","313","<p>Do I need to create a new activity to view text written in a text box?</p><p>For example,</p><p>I want to see - ""Hello""+ text written in a text box.</p><p>Thanks.</p>","400859","","","","","2010-08-31 21:05:32","ViewText in Android","<android><android-widget>","2","1","","",""
"3613267","1","3613378","","2010-08-31 21:12:09","0","128","<p>When my Activity resumes, I query for a Cursor (by calling managedQuery to retrieve a Cursor pointing at my database using a ContentProvider), call startManagingCursor, instantiate a new CursorAdapter, and setListAdapter to my new CursorAdapter.</p><p>Suppose, at some later point, I launch some thread that hits a web service to query for new data to add to that table.  Do I need to repeat everything I've listed above again?</p><p>This is what I'm currently doing, but I'm wondering if there isn't a more efficient way of doing it. </p>","406790","","","","","2010-08-31 21:28:48","Updating CursorAdapters","<android><listview>","1","0","","",""
"3613306","1","3614235","","2010-08-31 21:19:31","1","1069","<p>I am developing an app that requires the voice recognition to stay active for an entire minute. Upon reviewing the docs, I discovered ""SPEECH_INPUT_MINIMUM_LENGTH_MILLIS"" added to 2.2. However Google's default voice recognition service doesn't seem to support it. Does anybody know a way that I could force voice recognition to last a minute?</p>","266255","","881229","","2013-09-09 19:19:38","2013-09-09 19:19:38","Android Voice Recognition API","<java><android><speech-recognition>","1","0","","",""
"3613331","1","3688824","","2010-08-31 21:22:34","3","2151","<p>How can I create a custom activity that can be chosen by the user via the share option when viewing the photo gallery? I have options like ""Share with Facebook, Twitter, FlickR"" etc. But I want to add my own option in there.</p><p>i.e. Go to ""Photos"", then click the ""Share"" button. You will be presented with a bunch of share providers. What do I need to do to get my activity in there?</p>","986","","986","","2010-09-07 14:08:30","2010-09-10 22:27:48","How to create a photo sharing activity?","<android>","2","0","5","",""
"3613472","1","3613710","","2010-08-31 21:46:33","3","2535","<p>To make my explanation shorter, I've made this ""mockup"" of what I'm trying to achieve.I'd like to create a reusable header, footer and a generic viewgroup that I can fill with whatever content is required. A ListActivity, GridView... etc.</p><p><img src=""http://i.stack.imgur.com/loehn.png"" alt=""alt text""></p><p>I've tried a few different approaches thus far with out any luck whatsoever. My first attempt was to write three basic views. A RelativeLayout that would act as a container. I used  to add the header (worked), wrote the GridView (worked) and when trying to attach the footer with include it would never anchor at the bottom of the screen no matter which gravity I was using.</p><p>I'm currently attempting to go quite simple to learn android's view system. So, my first baby step. Get a GridView working with images pulled from an Adapter. (Essentially the 'Hello GridViews' demo from the android site - done, works)</p><p><img src=""http://i.stack.imgur.com/wAVCE.png"" alt=""alt text""></p><p>Next baby step. Try and add a static header above the GridView... catastrophe. I feel like I'm missing an important stepping stone to get this working, any hints in the right direction would be appreciated. I don't quite understand why the LinearLayout containing the Button is pushing the GridView off the screen (it's in the HiearchyViewer) when the height is only ""wrap_content"" which should be ""44dip"".</p><p><img src=""http://i.stack.imgur.com/lXID5.png"" alt=""alt text""></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""    &gt;        &lt;Button            android:layout_width=""fill_parent""            android:layout_height=""44dip""            android:text=""test""        /&gt;    &lt;/LinearLayout&gt;    &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""          android:id=""@+id/gridview""         android:layout_width=""fill_parent""          android:layout_height=""fill_parent""         android:columnWidth=""112dip""         android:numColumns=""auto_fit""         android:verticalSpacing=""0dp""         android:horizontalSpacing=""0dp""         android:stretchMode=""columnWidth""         android:gravity=""center""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>// edit, fixed xml.</p><p><strong>EDIT October 25, 2010</strong>: Here's the solution I'm using now. Each activity gets its own view which the activity inflates. The ""reusable"" views are included with <pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;include layout=""@layout/titlebar"" /&gt;&lt;ListView    android:id=""@+id/standingsListView""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1.0""    android:background=""#FFF""/&gt;&lt;include layout=""@layout/ad"" /&gt;&lt;/LinearLayout&gt;</code></pre>","338382","","338382","","2010-10-25 20:15:29","2011-09-30 06:54:04","Nested Android Views, static header view","<android>","1","0","1","",""
"3613484","1","3613610","","2010-08-31 21:48:53","0","375","<p>Just like the title says, Is there a simple line of code I could add to <code>onStop()</code>that will simply stop any gps activity currently going on with my application?</p>","393373","","","","","2010-08-31 22:12:52","Simple code I can add to onStop, to stop GPS activity?","<java><android><gps>","1","0","","",""
"3613722","1","","","2010-08-31 22:38:23","6","2800","<p>Android allows to create aliases of resource strings like:</p><pre><code>&lt;resources&gt; &lt;string name=""foo""&gt;somestring&lt;/string&gt; &lt;string name=""bar""&gt;@string/foo&lt;/string&gt;&lt;/resources&gt;</code></pre><p>by which the resource ""bar"" becomes an alias for the resource named ""foo"".</p><p>What I would for my app is a possibility to combine an existing resource prefix with different suffixes, i.e. to extend it like:</p><pre><code>&lt;resources&gt; &lt;string name=""foo""&gt;foo&lt;/string&gt; &lt;string name=""bar""&gt;@string/foo+bar&lt;/string&gt;  &lt;string name=""else""&gt;@string/foo+else&lt;/string&gt; &lt;/resources&gt;</code></pre><p>where the resource ""bar"" would yield the string ""foobar"". Its clear that '+' doesn't work here but is there some other option to achieve such a string concatenation, so that one could define a bunch of string resources that have a common prefix?</p><p>I realize of course that I could do such resource string concatenation at runtime but defining them statically in the resources would seem so much more elegant and simpler.</p><p>Michael</p>","423411","","","","","2011-06-16 23:34:29","Can one combine android resource strings into new strings?","<android>","1","0","","",""
"3613760","1","","","2010-08-31 22:46:16","0","31","<p>When i press bt on the Player plays the song in a loop like normal. But when i pressed bt2 (Stop Button) the System Freez!</p><p>Main Class:</p><pre><code>        final Alarm alarm = new Alarm();    bt.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {             Alarm alarm = new Alarm();                new MediaPlayer();                MediaPlayer mp = MediaPlayer.create(ParkTicketAlarm.this, R.raw.alarm);                 Vibrator vi = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);                  alarm.execute(mp);        }    });  bt2.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {        alarm.turnoff();    }})</code></pre><p>AsyncTask Class:</p><pre><code>    MediaPlayer mp;@Overrideprotected String doInBackground(MediaPlayer... params) {    mp = (MediaPlayer)params[0];        mp.setLooping(true);        mp.start();        return null;}void turnoff(){    mp.reset();    Toast toast = new Toast(null);    toast.setText(""go"");    toast.show();}</code></pre>","435346","","","","","2011-01-08 20:13:30","When i pressed the bt2 the system freez","<android>","1","0","","",""
"3613766","1","","","2010-08-31 22:48:09","0","366","<pre><code>@Override   public boolean onContextItemSelected(MenuItem item) {    if(item.getTitle()==""Remove""){   AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();   quotesAdapter.remove(quotes.get((int)info.id));   quotesAdapter.notifyDataSetChanged();   listView.setAdapter(quotesAdapter);   serializeQuotes();  }    else {   return false;  }    return true;   }  </code></pre><p>Doesn't do anything. If I add </p><p><code>this.quotesAdapter = new QuoteAdapter(this, R.layout.mainrow, quotes);</code></p><p>Removal works, but I don't think is the right way of doing things. I'm not sure what is wrong?</p>","19875","","19875","","2010-09-01 02:47:39","2010-09-01 02:47:39","Removing items from a ListAdapter not working","<java><android><listview><android-arrayadapter><listadapter>","1","0","","",""
"3613767","1","3613824","","2010-08-31 22:48:28","1","3687","<p>So I'm trying to just add a simple ad to my app using admob. I've followed the tutorial with the SDK but am getting stuck at one error.</p><p>Here's the error:</p><pre><code>Multiple annotations found at this line:- ERROR No resource identifier found for attribute 'secondaryTextColor' in package  'man.utd.headlines.man.utd'- ERROR No resource identifier found for attribute 'primaryTextColor' in package 'man.utd.headlines.man.utd'- ERROR No resource identifier found for attribute 'backgroundColor' in package 'man.utd.headlines.man.utd'</code></pre><p>so I figure it must be a problem with my package name but as far as I can see everything is OK. </p><p>In my layout file I have the following:</p><pre><code>&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""xmlns:myapp=""http://schemas.android.com/apk/res/man.utd.headlines.man.utd""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" &gt;</code></pre><p>But the package name seems correct:</p><pre><code>package man.utd.headlines.man.utd;</code></pre><p>Any ideas? It's very frustrating!</p><p>I have also checked my manifest and have tried with this package name but it still doesn't work:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""man.utd.headlines""</code></pre><p>Any help is greatly appreciated.</p><p>UPDATE: Solved by changing package names to make them more consistant - they mnust be exactly the same in main class and manifest!</p><p>New Problem: Ads won't display!</p><p>Heres my layout file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;WebView    android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt; &lt;com.admob.android.ads.AdView     android:id=""@+id/ad""    android:layout_width=""fill_parent""    android:layout_height=""100px""    myapp:backgroundColor=""#000000""    myapp:primaryTextColor=""#FFFFFF""    myapp:secondaryTextColor=""#CCCCCC"" /&gt;</code></pre><p></p><p>Any ideas? Any help greatly appreciated :).</p>","319940","","319940","","2010-08-31 23:11:48","2011-05-05 18:03:24","Android - Admob issues!","<android><admob>","2","0","","",""
"3613798","1","","","2010-08-31 22:56:07","9","4545","<p>I've started to write an app which provides the user with an HTML form via a WebView. As the form is not under my control, the data filled in may be sent as either GET or POST request. My app is required to capture the transported form data, that is, get a hold on what was entered into the form fields.</p><p>Using an adequate callback from WebViewClient such as <code>onPageLoaded()</code>, it is easy to capture form data from a GET request. However, I cannot find any appropriate method to allow the same for POSTed data, i.e., be able to access the HTTP POST message body containing the form data. Am I missing a relevant callback here or is there simply no way to accomplish the specified goal with the given API (even the latest level 8)?</p><p>Assuming it wasn't possible, I considered overriding and extending parts of android.webkit in order to introduce a new callback hook that is passed the POST body somehow. That way, my app could be shipped with a customized browser/WebViewClient that fulfills the desired feature. However, I couldn't find any good spot to start with in the code and would be glad for any hints in this regards (in case the approach looks promising at all).</p><p>Thanks in advance!</p>","420061","","420061","","2010-09-01 01:26:10","2013-10-14 00:27:48","is it possible to access HTML form data POSTed through a WebView?","<android>","1","1","4","",""
"3613800","1","","","2010-08-31 22:56:22","2","1377","<p>so im trying to create an interface where the user can drag their finger from the right to the left to get to the second view, and the first view being dragged will move from right to left. very similar to an android device home screen, where the user can drag a screen to the left or right and another screen will emerge from there. I have so far a View switcher where flipper will store two xml files. But i do not know how to use the drag gesture? any examples would be greatly appreciated.</p><p>Thank you</p>","423305","","","","","2011-10-21 15:20:52","How do you switch 2 different Views by using Drag Gesture in Android?","<android><gesture-recognition><gesture>","2","0","1","",""
"3613940","1","3618679","","2010-08-31 23:27:23","6","2030","<p>I'm researching the development of an Android (2.2) app/service that will enable users to record short (I do emphasize short, &lt; 30seconds) video on their phones and then upload that video (HTTP) to a server that will then transcode the video to other formats.  That same user can download videos from other Android users and play them.</p><p>Now, I get a bit lost with everyones recommended approaches to all the issues in doing something like this because I haven't seen any ask this in a cohesive context.  Ideally I would like a non commercial solution to this (as in no vendor/service being needed for the the video hosting/transcoding), but, feel free to include those as a recommendation (I've marked this as a wiki) as I know many like to use youtube and vimeo for the middle layer in all this.</p><p><strong>The questions are</strong></p><p><li>What server technologies do you   recommend for hosting and   transcoding? <li>What technology do you   recommend for streaming the video (it   would be nice to offer a <a href=""http://developer.android.com/guide/appendix/media-formats.html"">high and   low quality encoding</a> depending on   the users network connection)<li>What video format and software do you recommend for converting the uploaded video on the server to be viewable later by other Android owners.<li>Im assuming it's bad to do any transcoding on the phone prior to upload (battery/proc issues), but, if I'm wrong with that assumption what do you recommend?</p><p><strong>Some things that may help you...</strong></p><p><li>The video will only need to render on an Android device, and in the future in a webkit html5 browser.<li>Bandwidth isnt cheap (even with numerous 30 second videos), so a good mix of video quality and video file size is important (streaming if needed to ensure quality vs. download).<li>This is for android 2.2 devices with a video camera of course and <a href=""http://developer.android.com/guide/practices/screens_support.html"">medium to high density</a> screen of 800x400 min.<li>Open source solutions (server to receive the uploads, code to do the transcoding, server to do the streaming) are preferred, but not required.<li>CDN's are an option, but I don't think that really figures in to the picture right now.</p>","110897","","","","","2010-09-01 13:41:49","Android how to video record, upload, transcode, download, play","<android><video><video-streaming><video-encoding>","1","0","3","","2010-08-31 23:27:23"
"3614141","1","","","2010-09-01 00:13:12","0","30","<p>When the Compiler enter doInBackground the App freez</p><p>Main Class (ParkTicketAlarm):</p><pre><code>Timer timer = new Timer();  timer.doInBackground(ParkTicketAlarm.this);</code></pre><p>AsyncClass (Timer)</p><pre><code>protected String doInBackground(ParkTicketAlarm... params) {    java.sql.Time   time = new java.sql.Time(System.currentTimeMillis());    while(time.getMinutes()!=28){        try {                wait(2000);            } catch (InterruptedException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }            time = new java.sql.Time(System.currentTimeMillis());        }    params[0].expired();    return null;        }}</code></pre>","435346","","435346","","2010-09-01 00:27:52","2010-09-01 00:27:52","Appfreez by Enter other Thread","<android>","0","2","","",""
"3614177","1","3614215","","2010-09-01 00:19:47","0","953","<p>I have just decided to try out the Android SDK, so I installed it and now I'm trying to make a simple interface using an XML file for a calculator I've made and that I might port to Android.</p><p>Here a first draft of the XML file I want to use:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;  &lt;TextView      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:lines=""3""      android:text=""To evaluate an expression, type it below.""      /&gt;  &lt;EditText      android:id=""@+id/entry""      android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:text=""""      /&gt;  &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;    &lt;Button    android:id=""@+id/btnFunctions""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Functions""    /&gt;    &lt;Button    android:id=""@+id/btnConversions""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Conversions""    /&gt;    &lt;Button    android:id=""@+id/btnConstants""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Constants""    /&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;    &lt;Button    android:id=""@+id/btnGraphs""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Graphs""    /&gt;    &lt;Button    android:id=""@+id/btnStats""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""Stats""    /&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>However, when I run <code>ant install</code> and try out the app on the emulator, the last two buttons in the last (nested) LinearLayout, btnGraphs and btnStats, do not show up at all (the rest is fine).</p><p>What am I doing wrong?</p>","363078","","","","","2010-09-01 13:30:29","Why is my second LinearLayout not showing?","<android><xml><user-interface>","3","0","","",""
"3614190","1","","","2010-09-01 00:22:37","30","71430","<p>I developed an Android aplication against 2.1 SDK. Since then I have re-installed Eclipse/Android SDK; with the new install, I want to 'upgrade' the dependancy of the Android application to 2.2 SDK (because I dont want 2.1 installed on my machine). Is this possible? I am getting the following error from eclipse:</p><pre><code>[2010-08-31 18:18:32 - AndroidApplication] Unable to resolve target 'android-7'</code></pre>","291059","","","","","2014-01-18 11:20:53","Android change SDK version in Eclipse? Unable to resolve target android-x","<eclipse><android>","6","0","5","",""
"3614421","1","","","2010-09-01 01:22:11","0","1350","<p>I'm trying to use the JJIL libraries with my Android project:<a href=""http://code.google.com/p/jjil/"" rel=""nofollow"">http://code.google.com/p/jjil/</a></p><p>I followed all the instructions on importing libraries into eclipse on the android guides, and have had no successes. It just fails to import.</p><p>Can some one point me in the right direction with this?</p><p>Cheers,</p><p>Nick D</p>","436510","","","","","2010-12-05 21:26:18","How do I add the JJIL libraries to my Android Eclipse project?","<android><eclipse>","1","0","1","",""
"3614535","1","","","2010-09-01 01:55:34","1","981","<p>I'm an Android newbie just getting past ""hello world"" in Eclipse.   I was at the Verizon store today trying out 4 different Android phones for my next upgrade and I realized how DIFFERENT they all are even though they're all 2.1 or 2.2.</p><p>Short of buying an expensive collection of Android phones from different vendors, is there a way to EMULATE some of the major phones like HTC Incredible or Droid X in my Eclipse IDE?</p><p>How bad is the Android fragmentation problem I read about on blogs?  When I write an app for a PC I don't have to worry about whether it's a Toshiba PC or an Acer or a Dell.   How much do I need to worry about Droid 2 -vs- Droid X - vs HTC Incredible?</p><p>Thanks in advance!</p>","424690","","","","","2010-09-01 05:52:04","Target-specific emulators for Eclipse in Android?","<android><emulation>","1","1","","",""
"3614659","1","","","2010-09-01 02:31:24","1","1264","<blockquote>  <p>08-31 21:29:15.263: ERROR/dalvikvm(11799): could not disable core file generation for pid 11799, errno=1</p></blockquote><p>Can anyone shed some light on this for me?</p><p>Thanks!</p><hr><p>I'm using a non OTA push of Froyo on this phone currently.  I did some checking and apparently there is a bug in early releases of Froyo - Which has already been fixed, but because I'm using a pre-release, I think this is still apparent in the ROM running on the phone.</p><p>Below is a boot up error report on my phone from LogCat - my app was uninstalled and not even re-pushed to the phone.  Until I get the official OTA update, this is nothing I can worry about now.</p><p>Thank You!</p><pre><code>09-01 09:57:04.325: ERROR/PackageManager(1262): Package com.motorola.android.FirewallService requires unavailable shared library com.motorola.android.Firewall; failing!09-01 09:57:23.933: ERROR/MotWifiScan(1262): disableMlbs: NOT disabling because not ON!09-01 09:57:24.012: ERROR/GlobalUnplugService(1552): plugged = true,mBatteryPlugged=false09-01 09:57:27.301: ERROR/NetworkStateTracker(1262): net.tcp.buffersize.evdo not found in system properties. Using defaults09-01 09:57:27.355: ERROR/BluetoothPanService(1262): Received CONNECTIVITY_ACTION09-01 09:57:27.355: ERROR/BluetoothPanService(1262): Received,CONNECTIVITY_ACTION, TYPE_MOBILE09-01 09:57:27.355: ERROR/BluetoothPanService(1262): Received, CONNECTIVITY_ACTION, TYPE_MOBILE, isConnected09-01 09:57:27.355: ERROR/HierarchicalStateMachine(1262): TetherMaster - unhandledMessage: msg.what=309-01 09:57:27.355: ERROR/dalvikvm(1613): could not disable core file generation for pid 1613, errno=109-01 09:57:28.027: ERROR/extdisp(1622): tvout_init: dlopen error09-01 09:57:28.027: ERROR/extdisp(1622): nativeInit: tvout_init error!09-01 09:57:31.449: ERROR/DSP(1675): fResult.getData() : null09-01 09:57:32.129: ERROR/dalvikvm(1730): could not disable core file generation for pid 1730, errno=109-01 09:57:33.512: ERROR/NetworkStateTracker(1262): net.tcp.buffersize.evdo not found in system properties. Using defaults09-01 09:57:33.597: ERROR/BluetoothPanService(1262): Received CONNECTIVITY_ACTION09-01 09:57:33.605: ERROR/HierarchicalStateMachine(1262): TetherMaster - unhandledMessage: msg.what=309-01 09:57:33.980: ERROR/GlobalUnplugService(1552): plugged = true,mBatteryPlugged=true09-01 09:57:34.465: ERROR/dalvikvm(1793): could not disable core file generation for pid 1793, errno=109-01 09:57:34.512: ERROR/GlobalUnplugService(1552): plugged = true,mBatteryPlugged=true09-01 09:57:38.457: ERROR/dalvikvm(1793): Could not find class 'android.net.NetworkConnectivityListener', referenced from method com.handcent.sms.transaction.TransactionService.onCreate09-01 09:57:38.457: ERROR/dalvikvm(1793): Could not find class 'android.net.NetworkConnectivityListener', referenced from method com.handcent.sms.transaction.TransactionService.onDestroy09-01 09:57:38.465: ERROR/dalvikvm(1793): Could not find class 'android.net.NetworkConnectivityListener', referenced from method com.handcent.sms.transaction.ah.handleMessage09-01 09:57:39.137: ERROR/WeatherUtil(1419): No location provider09-01 09:57:44.738: ERROR/GlobalUnplugService(1552): plugged = true,mBatteryPlugged=true09-01 09:57:46.418: ERROR/Preferences(1893):   recovered user &amp; security token 09-01 09:57:47.090: ERROR/GlobalUnplugService(1552): plugged = true,mBatteryPlugged=true09-01 09:57:47.379: ERROR/dalvikvm(1906): could not disable core file generation for pid 1906, errno=109-01 09:57:49.785: ERROR/BitmapUtil(1534): Unable to decode bitmap 09-01 09:57:49.785: ERROR/BitmapUtil(1534): java.io.FileNotFoundException: No icons fit this description09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:143)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:608)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:469)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at android.content.ContentResolver.openInputStream(ContentResolver.java:304)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at com.motorola.blur.util.ui.BitmapUtil.fetchBitmapWithAdjustedDimensions(BitmapUtil.java:50)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache.getSourceIcon(SourceCache.java:793)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache.access$000(SourceCache.java:41)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache$2.run(SourceCache.java:744)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at android.os.Handler.handleCallback(Handler.java:587)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at android.os.Handler.dispatchMessage(Handler.java:92)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at android.os.Looper.loop(Looper.java:143)09-01 09:57:49.785: ERROR/BitmapUtil(1534):     at android.os.HandlerThread.run(HandlerThread.java:60)09-01 09:58:02.113: ERROR/TwitterDataSync(1860): Token not found.09-01 09:58:17.074: ERROR/TalkProvider(1429): replaceContactWithContactId: contactId==0!!! jeff@trystfall.com, acct=109-01 09:58:17.098: ERROR/TalkProvider(1429): insert presence failed for account=1 username=jeff@trystfall.com client_type=0 status= priority=0 mode=509-01 09:58:17.199: ERROR/TalkProvider(1429): replaceContactWithContactId: contactId==0!!! jeff@trystfall.com, acct=109-01 09:58:17.238: ERROR/TalkProvider(1429): insert presence failed for account=1 username=jeff@trystfall.com client_type=0 status= priority=0 mode=509-01 09:58:22.472: ERROR/BitmapUtil(1534): Unable to decode bitmap 09-01 09:58:22.472: ERROR/BitmapUtil(1534): java.io.FileNotFoundException: No icons fit this description09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:143)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:608)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:469)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at android.content.ContentResolver.openInputStream(ContentResolver.java:304)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at com.motorola.blur.util.ui.BitmapUtil.fetchBitmapWithAdjustedDimensions(BitmapUtil.java:50)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache.getSourceIcon(SourceCache.java:793)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache.access$000(SourceCache.java:41)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache$2.run(SourceCache.java:744)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at android.os.Handler.handleCallback(Handler.java:587)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at android.os.Handler.dispatchMessage(Handler.java:92)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at android.os.Looper.loop(Looper.java:143)09-01 09:58:22.472: ERROR/BitmapUtil(1534):     at android.os.HandlerThread.run(HandlerThread.java:60)09-01 09:58:30.613: ERROR/BitmapUtil(1534): Unable to decode bitmap 09-01 09:58:30.613: ERROR/BitmapUtil(1534): java.io.FileNotFoundException: No icons fit this description09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:143)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:608)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:469)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at android.content.ContentResolver.openInputStream(ContentResolver.java:304)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at com.motorola.blur.util.ui.BitmapUtil.fetchBitmapWithAdjustedDimensions(BitmapUtil.java:50)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache.getSourceIcon(SourceCache.java:793)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache.access$000(SourceCache.java:41)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at com.motorola.blur.contacts.cache.SourceCache$2.run(SourceCache.java:744)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at android.os.Handler.handleCallback(Handler.java:587)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at android.os.Handler.dispatchMessage(Handler.java:92)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at android.os.Looper.loop(Looper.java:143)09-01 09:58:30.613: ERROR/BitmapUtil(1534):     at android.os.HandlerThread.run(HandlerThread.java:60)</code></pre>","410071","","436938","","2012-01-20 18:57:18","2012-01-20 18:57:18","I get this error in Logcat upon my app startup","<android>","0","2","","",""
"3614663","1","3614787","","2010-09-01 02:32:29","62","69307","<p>I don't understand why I'm getting this error. I'm using AsyncTask to run some processes in the background.</p><p>I have:</p><pre><code>protected void onPreExecute() {    connectionProgressDialog = new ProgressDialog(SetPreference.this);    connectionProgressDialog.setCancelable(true);    connectionProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);    connectionProgressDialog.setMessage(""Connecting to site..."");    connectionProgressDialog.show();    downloadSpinnerProgressDialog = new ProgressDialog(SetPreference.this);    downloadSpinnerProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);    downloadSpinnerProgressDialog.setMessage(""Downloading wallpaper..."");}</code></pre><p>When I get into <code>doInBackground()</code> depending on a condition I:</p><pre><code>[...]    connectionProgressDialog.dismiss();downloadSpinnerProgressDialog.show();[...]</code></pre><p>Whenever I try <code>downloadSpinnerProgressDialog.show()</code> I receive the error.</p><p>Any ideas guys?</p>","149166","","","","","2013-02-27 08:06:57","Can't create handler inside thread that has not called Looper.prepare() inside AsyncTask for ProgressDialog","<java><android><runtime-error><progressdialog><looper>","4","0","21","",""
"3614763","1","","","2010-09-01 03:05:12","0","216","<p>I have a wallpaper app and it seems to work fine but... when i open the app in eclipse... the app icon appears as the first image in the wallpaper. I cannot figure out what is happening. can someone help.</p><p>also the scrolling seemed to have slowed down after i added more images (40)..any suggestions. what is the recommended file size the files papers should be. I know the dimensions but what about the resolution.</p>","433522","","","","","2010-09-01 05:40:28","Problem with wallpaper app","<android><wallpaper>","1","0","","",""
"3614779","1","3614882","","2010-09-01 03:14:08","15","27989","<p>I am new to Android development and have been following the tutorials available on the Android website. I am currently on the section of tutorials for Views, specifically the one for Grid Views: <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"">Hello, Grid View Tutorial</a>.</p><p>I am having trouble understanding how views are made through an adapter. I understand that you must override the getView() method in your adapter class and in this method is where you define how your Views are set up. What I don't understand is where does getView() actually get called? Perhaps I've got the wrong kind of mentality here, but in the code below (the Grid View tutorial) I don't see any calls to getView() (or any other things used in the adapter class such as getCount()).</p><p>Main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridview""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:columnWidth=""90dp""    android:numColumns=""auto_fit""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:stretchMode=""columnWidth""    android:gravity=""center"" /&gt;</code></pre><p>Start.java</p><pre><code>package com.examples.hellogridlayout;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.GridView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;public class Start extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    GridView gridview = (GridView)findViewById(R.id.gridview);    gridview.setAdapter(new ImageAdapter(this));    gridview.setOnItemClickListener(new OnItemClickListener(){        public void onItemClick(AdapterView&lt;?&gt; parent,View v, int position, long     id){            Toast.makeText(Start.this, """" + position,Toast.LENGTH_SHORT).show();        }      });    }}</code></pre><p>ImageAdapter.java</p><pre><code>package com.examples.hellogridlayout;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;public class ImageAdapter extends BaseAdapter {    private Context mContext;    public ImageAdapter(Context c) {        mContext = c;    }    public int getCount() {    return mThumbIds.length;    }    public Object getItem(int position) {    return null;    }    public long getItemId(int position) {        return 0;    }    // create a new ImageView for each item referenced by the Adapter    public View getView(int position, View convertView, ViewGroup parent) {        ImageView imageView;        if (convertView == null) {  // if it's not recycled, initialize some attributes            imageView = new ImageView(mContext);            imageView.setLayoutParams(new GridView.LayoutParams(85, 85));            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);            imageView.setPadding(8, 8, 8, 8);        } else {            imageView = (ImageView) convertView;        }        imageView.setImageResource(mThumbIds[position]);        return imageView;    }    // references to our images    private Integer[] mThumbIds = {            R.drawable.sample_2, R.drawable.sample_3,            R.drawable.sample_4, R.drawable.sample_5,            R.drawable.sample_6, R.drawable.sample_7,            R.drawable.sample_0, R.drawable.sample_1,            R.drawable.sample_2, R.drawable.sample_3,            R.drawable.sample_4, R.drawable.sample_5,            R.drawable.sample_6, R.drawable.sample_7,            R.drawable.sample_0, R.drawable.sample_1,            R.drawable.sample_2, R.drawable.sample_3,            R.drawable.sample_4, R.drawable.sample_5,            R.drawable.sample_6, R.drawable.sample_7    };}</code></pre>","436528","","1659009","","2013-01-20 23:32:13","2013-04-15 19:25:36","How is the getView() method used and where is it getting called?","<android><android-widget>","2","0","2","",""
"3614849","1","3614994","","2010-09-01 03:29:44","10","6623","<p>I'm writing an application which will have two Activities, when the user presses the back button on the second activity a dialog should pop up asking the user to confirm the action. So how do I intercept this? I seriously doubt about this coz the backstack is a part of the OS itself. Has anyone found a workaround?</p>","421372","","","","","2013-09-16 21:15:15","Intercepting the back button","<android><function>","3","2","1","",""
"3614934","1","3615178","","2010-09-01 03:55:25","1","4230","<p>My ListView populates correctly, but for some reason adding and removing is quirky and does not work properly! Am I doing something wrong?</p><p>Set things up in OnCreate()</p><pre><code>listView = (ListView) findViewById(R.id.ListView);        registerForContextMenu(listView);         deserializeQuotes();        if(quotes == null || quotes.size() == 0){            quotes = new ArrayList&lt;Quote&gt;();            //populateDefaultQuotes();            //serializeQuotes();            //getQuotesFromYQL();        }        this.quotesAdapter = new QuoteAdapter(this, R.layout.mainrow, quotes);        listView.setAdapter(this.quotesAdapter);        listView.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                deserializeQuotes();                Quote myQuote = quotes.get(position);                Toast toast = Toast.makeText(getApplicationContext(), myQuote.getName(), Toast.LENGTH_SHORT);                toast.show();            }        });</code></pre><p>Quote Adapter Private Class</p><pre><code>private class QuoteAdapter extends ArrayAdapter&lt;Quote&gt; {        private ArrayList&lt;Quote&gt; items;        public QuoteAdapter(Context context, int textViewResourceId,                ArrayList&lt;Quote&gt; items) {            super(context, textViewResourceId, items);            this.items = items;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.mainrow, null);            }            Quote q = items.get(position);            if (q != null) {                TextView nameText = (TextView) v.findViewById(R.id.nameText);                TextView priceText = (TextView) v.findViewById(R.id.priceText);                TextView changeText = (TextView) v.findViewById(R.id.changeText);                if (nameText != null) {                    nameText.setText(q.getSymbol());                }                if (priceText != null) {                    priceText.setText(q.getLastTradePriceOnly());                }                if (changeText != null) {                    changeText.setText(q.getChange());                }            }            return v;        }    }</code></pre><p>Remove an item from the list <strong>(THIS DOESNT WORK, DOES NOTHING)</strong></p><pre><code>@Override      public boolean onContextItemSelected(MenuItem item) {          if(item.getTitle()==""Remove""){            deserializeQuotes();            AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();            quotesAdapter.remove(quotes.get(info.position));            quotesAdapter.notifyDataSetChanged();            serializeQuotes();        }          else {            return false;        }          return true;      }  </code></pre><p>Add an item to the list (THIS WORKS)</p><pre><code> protected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (resultCode == RESULT_OK) {        deserializeQuotes();        this.quotesAdapter = new QuoteAdapter(this, R.layout.mainrow, quotes);              quotesAdapter.notifyDataSetChanged();        listView.setAdapter(quotesAdapter);    }}</code></pre><p>Here is how I serialize and deserialize</p><pre><code>private void serializeQuotes(){        FileOutputStream fos;        try {            fos = openFileOutput(Constants.FILENAME, Context.MODE_PRIVATE);            ObjectOutputStream oos = new ObjectOutputStream(fos);            oos.writeObject(quotes);             oos.close();        } catch (FileNotFoundException e) {            e.printStackTrace();        }catch(IOException e){            e.printStackTrace();        }    }    @SuppressWarnings(""unchecked"")    private void deserializeQuotes(){        try{            FileInputStream fis = openFileInput(Constants.FILENAME);            ObjectInputStream ois = new ObjectInputStream(fis);            quotes = (ArrayList&lt;Quote&gt;) ois.readObject();        } catch (FileNotFoundException e) {            e.printStackTrace();        }catch(IOException e){            e.printStackTrace();        }catch(ClassNotFoundException e){            e.printStackTrace();        }    }</code></pre>","19875","","19875","","2010-09-01 16:33:31","2010-09-01 16:33:31","Am I creating my custom ArrayAdapter correctly?","<android><listview><arraylist><android-arrayadapter><listadapter>","1","3","2","",""
"3615013","1","3615128","","2010-09-01 04:16:25","0","892","<p>Android News &amp; Weather app lets you swipe to reveal another view, just like the iPhone. Can someone show me an example of how this is done? </p><p>It is not a ViewFlipper attached to a GestureDetector.</p>","19875","","","","","2011-09-13 15:04:40","How can I create horizontal view scrolling like the News & Weather app?","<android><layout><scrolling>","2","0","2","",""
"3615111","1","","","2010-09-01 04:49:38","4","1104","<p>In native Android calendar app RFC 2445 protocol is used to create <code>.ics</code> files. I found in some blogs that RFC 2445 is replaced with RFC 5545. Can any one please tell me what are the extra features in RFC 5545 and how it is different from RFC 2445?</p><p>Regards,<br>Rajani</p>","434921","","313758","","2010-09-01 05:03:16","2010-12-27 08:26:26","How RFC 5545 is different from RFC 2445","<android><calendar><standards><rfc>","2","0","2","",""
"3615140","1","","","2010-09-01 04:59:58","2","6113","<p>As you in following android album widget images placement is from middle of the gallery i want to start image placement from beginning of the album.</p><p><img src=""http://i.stack.imgur.com/tSTIt.png"" alt=""alt text""></p>","216431","","","","","2012-03-13 14:15:55","android gallery image position problem","<android><position><gallery>","4","1","","",""
"3615174","1","3615244","","2010-09-01 05:09:23","0","253","<p>I have made app which allows me to send message to multiple user from my device.</p><p>Now i want to send message to the person which are stored in My Contact list.So i want to retrive phone number from my contact list and then i should be able to send message to that particular number..</p><p>Any hints how can i go further...</p><p>Thanks  </p>","1386533","","","","","2010-09-01 05:26:11","Send message to Numbers stored in Contact of the device in android","<android>","1","0","","",""
"3615187","1","","","2010-09-01 05:11:27","0","2864","<p>i have a small issue i can't figure out.for my program, i basically want to execute some code if the user hasn't done anything with the application for 5 minutes (say log out).</p><p>how can i go about doing this? i'm lost on detecting that the user has done nothing, and then reset the count once the user has touched the tablet or something.  can somebody give me some pointers?</p><p>thanks in advance!</p>","436605","","1339987","","2012-11-29 15:23:24","2012-11-29 15:23:24","writing a time out event for android","<java><android>","1","1","2","",""
"3615231","1","","","2010-09-01 05:22:10","5","1167","<p>y android application i would like to use time which do not come from device but a standard time that the user cannot change.Is there any way to do this.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2013-02-06 03:27:54","Get device and user independent time in android","<android>","4","0","","",""
"3615323","1","","","2010-09-01 05:45:10","1","1983","<p>Zoom works without any problem, but if I select any input field the webview zooms in automatically.</p><p>How do I can prevent this zoom behavior?</p><ul><li>set fix zoom level?</li><li>scale back to previous zoom level?</li></ul>","245322","","245322","","2010-09-01 16:06:40","2011-05-06 23:19:40","How to set fix zoom level or scale back in webview?","<android><webview><zoom>","1","0","","",""
"3615396","1","3615419","","2010-09-01 06:00:29","0","1547","<p>I would like to know how to establish the link between eclipse - tomcat - MYSQL.And also which version of mysql to download.</p><p>Thank you.</p>","358218","","358218","","2010-09-01 06:09:46","2010-09-01 08:20:19","How would i connect from Eclipse to Tomcat to MYSQL?","<mysql><android><eclipse><tomcat>","1","0","","",""
"3615405","1","","","2010-09-01 06:02:54","6","3647","<p>I have a problem with acquiring a WakeLock. It seems not to work.I am trying to acquire a FULL_WAKE_LOCK but neither the display gets enabled nor is my app able to perform tasks.</p><p>I am using the following permission: android.permission.WAKE_LOCK</p><p>My acquire code looks like this:</p><pre><code>PowerManager pm = (PowerManager) getBaseContext().getSystemService(Context.POWER_SERVICE);wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK|PowerManager.ACQUIRE_CAUSES_WAKEUP, ""My Tag"");wl.acquire();</code></pre><p>What am i doing wrong?</p><p>Edit: Added another flag ACQUIRE_CAUSES_WAKEUP ... but no changes in behavior</p><p>Edit2: All i am trying to do is, to play music and to wake my device up upon a certain event. The music is working perfectrly but the device stays black. </p>","314597","","314597","","2010-09-01 10:03:29","2012-09-18 18:04:56","Android WakeLock","<android><wakeup>","3","0","4","",""
"3615412","1","3615432","","2010-09-01 06:05:38","0","343","<p>When a try to deploy my android App in the emulator, after the application(.apk) gets loaded in to the emulator, when i tap on the menu button in emulator for loading my application's initial screen, its is raising me a alert message with this information,</p><pre><code>&lt;pre&gt;Sorry Application Keyboard in Process (Force Quit / Wait)..&lt;/pre&gt;</code></pre><p>and some other similar messages too..</p><p>What does it mean,can anybody help me...How can i avoid this issue that is happening at all time, </p><p>When this happens,unless i tap on Wait button, i can't able to proceed.</p><p>Thanks in advance..</p>","384193","","","","","2010-09-01 06:10:24","Android : Sorry Application Keyboard in Process (Force Quit / Wait)","<android><android-emulator>","1","0","","","2010-09-01 06:05:54"
"3615420","1","3616598","","2010-09-01 06:07:37","0","303","<p>Under new Date(); it has an error. I want to place it as a file name. </p><p>Date date = new Date(); </p><p>SimpleDateFormat dateFormat = new SimpleDateFormat(""ddMMyyyyHHmmSS"");filename = dateFormat.format(date).concat("".jpg"");</p>","358218","","","","","2010-09-01 09:25:06","DateFormat Error","<android><date-format>","1","3","1","",""
"3615538","1","3617280","","2010-09-01 06:34:22","1","281","<p>Can there be a standard way to handle this in all three platforms? Example would be using a single payment gateway for all. The app(on all platforms) asks for username, password, credit card info then submits to our server. Then our server authenticates and send to a payment gateway. When approved user is allowed to login to the App. Is that a good idea? Will it be allowed on all platforms?</p><p>Or does it require different approach for each platform?</p>","130237","","130237","","2010-09-01 06:39:55","2010-09-01 10:58:33","Subscription based model for iPhone, Android and BlackBerry App","<iphone><android><blackberry><subscription>","1","1","","",""
"3615549","1","","","2010-09-01 06:35:56","1","1182","<p>I want to play a number of sound files in raw directory one after another in android.How to do that?Please anyone provide me an example.Thanks in advance.</p>","436663","","225667","","2010-09-01 06:38:46","2013-06-29 04:33:31","Play music in android","<android><audio>","2","0","","2013-06-30 09:35:19",""
"3615581","1","3615618","","2010-09-01 06:41:00","0","233","<p>Hello In my android app when the no of items in the list is small the footer sticks to end of the list like the one shown below.<img src=""http://i.stack.imgur.com/ALHtm.png"" alt=""alt text""></p><p>but not to the end of screen.Is there any way that i can stick it to the bottom of the screen.I am using a seperate footer.xml and am calling it using Inflator service.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2010-09-01 06:48:59","footer View issue in android","<android>","1","0","","",""
"3615587","1","3615706","","2010-09-01 06:43:04","7","12848","<p>What languages are supported by android for localization with their respective values folder name,  the best link i could find was <a href=""http://developer.android.com/reference/java/util/Locale.html"">http://developer.android.com/reference/java/util/Locale.html</a></p><p>any body can help me with more languages what if we need to support more languages then listed above.</p>","392574","","","","","2013-06-06 09:37:10","Localization Android","<android><localization>","3","1","3","",""
"3615649","1","3616508","","2010-09-01 06:55:30","0","629","<p>1) is it possible to record vedios and audios using android emulator(using webcam) ? , and storing the recorded vedio or audio into the pc possibly as</p><p>recorder.setOutputFile(""C:/test.mp4"");</p>","413770","","","","","2010-09-01 09:11:14","android vedio recording with emulator","<android>","1","0","","",""
"3615772","1","","","2010-09-01 07:14:39","0","365","<p>I wish to add an option of 'SEND' to the context menu of Contacts. Is it possible to extend the ContextMenu Activity? or is there any other option for the same?</p>","335984","","","","","2010-09-01 10:57:41","Adding an item to the Context Menu","<android><contextmenu><contacts>","1","0","","",""
"3615803","1","3615980","","2010-09-01 07:18:11","2","2013","<p>Not sure how to figure out which android project on android.git.kernel.org corresponds to the classes extended in some of the app examples in the SDK such as Activity, Intent, and ContentProvider.</p>","369722","","","","","2010-09-01 07:47:54","Where on android.git.kernel.org can I find the source for such classes as Activity, Intent, and ContentProvider?","<android><activity><android-intent><source><android-contentprovider>","1","0","","",""
"3615816","1","3617264","","2010-09-01 07:20:11","6","4459","<p>How can i disable the panning/zooming functionality of a MapView (not the zoom controls, i want a wholly static map)? </p><p>I've also noticed that touching the map doesn't seem to trigger the MapView onClickListener, could anyone elaborate why?</p>","100191","","","","","2013-12-24 06:19:08","Disable pan/zoom in com.google.android.maps.MapView","<android><android-mapview>","6","1","","",""
"3615821","1","3617257","","2010-09-01 07:21:24","0","899","<p>permission failure :android.permission.RECORD_AUDIO from uid =10053 pid =1499</p><p>why is this error happening eventhough i added</p><p>'uses-permission android:name=""android.permission.RECORD_AUDIO"" ',android.permission.CAMERA</p>","413770","","","","","2010-09-01 10:55:50","android permission","<android>","1","0","","",""
"3615822","1","","","2010-09-01 07:21:33","1","2759","<p>I have written a <code>ListView</code> with a text and image clubbed together in a row.I wanted to add a button on top of <code>listview</code>, then the entire content of listview should be seen. <code>Button</code> is named as ""More"", when someone clicks it i will be updating the listcontent. That is the main theme.</p><p>Can anyone suggest how to do it?</p><h2>My java file.</h2><pre><code>package com.example.firstandroid;import org.json.JSONArray;import org.json.JSONObject;import android.app.ListActivity;import android.content.Context;import android.content.Intent;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.ImageView;import android.widget.TextView;public class Screen2 extends ListActivity  {String result="""";private static String DATA[];        /** * Demonstrates how to write an efficient list adapter. The adapter used in this example binds * to an ImageView and to a TextView for each row in the list. * * To work efficiently the adapter implemented here uses two techniques: * - It reuses the convertView passed to getView() to avoid inflating View when it is not necessary * - It uses the ViewHolder pattern to avoid calling findViewById() when it is not necessary * * The ViewHolder pattern consists in storing a data structure in the tag of the view returned by * getView(). This data structures contains references to the views we want to bind data to, thus * avoiding calls to findViewById() every time getView() is invoked. */private static class EfficientAdapter extends BaseAdapter {    private LayoutInflater mInflater;    private Bitmap mIcon1;    private Bitmap mIcon2;    public EfficientAdapter(Context context) {        // Cache the LayoutInflate to avoid asking for a new one each time.        mInflater = LayoutInflater.from(context);        // Icons bound to the rows.        mIcon1 = BitmapFactory.decodeResource(context.getResources(), R.drawable.next_arrow);        mIcon2 = BitmapFactory.decodeResource(context.getResources(), R.drawable.next_arrow);    }    /**     * The number of items in the list is determined by the number of speeches     * in our array.     *     * @see android.widget.ListAdapter#getCount()     */    public int getCount() {        return DATA.length+1;    }    /**     * Since the data comes from an array, just returning the index is     * sufficent to get at the data. If we were using a more complex data     * structure, we would return whatever object represents one row in the     * list.     *     * @see android.widget.ListAdapter#getItem(int)     */    public Object getItem(int position) {        return position;    }    /**     * Use the array index as a unique id.     *     * @see android.widget.ListAdapter#getItemId(int)     */    public long getItemId(int position) {        return position;    }    /**     * Make a view to hold each row.     *     * @see android.widget.ListAdapter#getView(int, android.view.View,     *      android.view.ViewGroup)     */    public View getView(int position, View convertView, ViewGroup parent) {        // A ViewHolder keeps references to children views to avoid unneccessary calls        // to findViewById() on each row.        ViewHolder holder;        // When convertView is not null, we can reuse it directly, there is no need        // to reinflate it. We only inflate a new View when the convertView supplied        // by ListView is null.        if(position ==0)        {            convertView = mInflater.inflate(R.layout.main2, null);        }        else        {        if (convertView == null) {            convertView = mInflater.inflate(R.layout.main1, null);            // Creates a ViewHolder and store references to the two children views            // we want to bind data to.            holder = new ViewHolder();            holder.text = (TextView) convertView.findViewById(R.id.text);            holder.icon = (ImageView) convertView.findViewById(R.id.icon);            convertView.setTag(holder);        } else {            // Get the ViewHolder back to get fast access to the TextView            // and the ImageView.            holder = (ViewHolder) convertView.getTag();        }        // Bind the data efficiently with the holder.        holder.text.setText(DATA[position]);        holder.icon.setImageBitmap((position &amp; 1) == 1 ? mIcon1 : mIcon2);        }        return convertView;    }    static class ViewHolder {        TextView text;        ImageView icon;    }}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Intent myIntent = new Intent(this , firstandroid.class);    //startActivityForResult(myIntent, 0);    Bundle bun = getIntent().getExtras();    result = bun.getString(""mani"");    try    {    JSONObject json=new JSONObject(result);    JSONArray ja;    json = json.getJSONObject(""responseData"");    ja = json.getJSONArray(""results"");    int resultCount = ja.length();    DATA = new String[resultCount];    for (int i = 0; i &lt; resultCount; i++)      {      JSONObject resultObject = ja.getJSONObject(i);      DATA[i]=resultObject.get(""titleNoFormatting"").toString();      DATA[i]+=""\n"";      JSONArray addr;      addr = resultObject.getJSONArray(""addressLines"");      int count = addr.length();      for(int j=0;j&lt;count;j++)      {         // JSONObject resultObject1 = ja.getJSONObject(j);          DATA[i]+=addr.getString(j);      }      }    }    catch(Exception e)    {    }    setListAdapter(new EfficientAdapter(this));}</code></pre><p>}</p><h2>My xml file. /res/layout</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt; LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""horizontal"" android:layout_width=""match_parent""android:layout_height=""match_parent""&gt;TextView android:id=""@+id/text"" android:layout_gravity=""center_vertical"" android:layout_width=""0dip"" android:layout_weight=""1.0"" android:layout_height=""wrap_content"" /&gt;ImageView android:id=""@+id/icon"" android:layout_width=""30dip"" android:layout_height=""30dip"" /&gt;&lt;/LinearLayout&gt;</code></pre>","436689","","119895","","2010-09-01 11:42:33","2010-09-01 13:27:33","How to add a button in top before the listview android","<android><listview>","2","0","","",""
"3615840","1","3617090","","2010-09-01 07:23:24","0","304","<p>I have already implemented sending message to multiple users.Now here is what i want to do further</p><ol><li>I have button on My main activity on button click Android's Default contact book should open  </li><li>When i click on the particular contact from phonebook, thenparticular phone number   from thatselected contact should occur ineditbox in my main activity.</li></ol><p>I have called intent on click event of button like this</p><pre><code>addcontact.setOnClickListener(new View.OnClickListener() {    public void onClick(View V) {        Intent ContactPickerIntent = new Intent(Intent.ACTION_PICK,ContactsContract.Contacts.CONTENT_URI);        startActivityForResult(ContactPickerIntent, CONTACT_PICKER_RESULT);                 }});</code></pre><p>Now i m stuck in how to retrieve phone number from OnActivity results.</p>","1386533","","114066","","2010-09-01 07:27:16","2011-10-21 06:46:19","Sending SMS in Android,","<android>","1","0","1","",""
"3615886","1","4195295","","2010-09-01 07:30:54","3","1667","<p>I am Intercepting outgoing call following is my code of outgoing call interception</p><pre><code>public class InterceptCall extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        String calling_number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);                setResultData(""123,""+calling_number );}}</code></pre><p>in android , is used for pause, but it is not working?how can I send DTMF input or use pause, wait and  symbol?I am stuck in it any help will be appreciated</p>","265064","","","","","2011-03-17 18:52:59","Sending Pause and DTMF input in android","<android>","1","0","1","",""
"3616023","1","3616088","","2010-09-01 07:56:00","6","1371","<p>Apologies if this ends up being a stupid question, but I was just wondering why this is done on step 9 of the Notepad Exercise 1 tutorial (<a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html</a>) ...</p><pre><code>public static final int INSERT_ID = Menu.FIRST;</code></pre><p>... and then <code>INSERT_ID</code> is used everywhere, instead of just using <code>Menu.FIRST</code> directly instead everywhere?</p><p>I was thinking that I don't want to create any new variables if I don't have to, especially when they are static final already.</p><p>Is it expensive to create <code>INSERT_ID</code>?</p>","435519","","69824","","2010-09-01 08:14:46","2010-09-01 08:14:46","Android Notepad Exercise 1 tutorial and Menu.FIRST","<android>","1","1","","",""
"3616151","1","","","2010-09-01 08:16:14","1","1312","<p>Is it possible that an android app can listen to voice commands all the time without any other user input? </p>","436740","","","","","2012-03-08 13:56:29","Listen to voice command in Android","<android><command><voice>","2","0","","",""
"3616209","1","3616382","","2010-09-01 08:27:18","2","319","<p>While doing normal day-to-day Android development, is it safe to assume that hook methods called by the system will not pass in invalid references (ex.: <code>null</code>), or should I always be double-checking what arguments get passed in?</p><p>For example, can the method <code>onOptionsItemSelected(MenuItem)</code> ever have a null <code>MenuItem</code> reference passed into it?</p><p>The reason I ask is because I was working on the Notepad 1 tutorial, and the tutorial asked me to set up a switch statement like this ...</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {        case INSERT_ID:            createNote();            return true;        default:            break;    }    return super.onOptionsItemSelected(item);}</code></pre><p>I started wondering if I should be testing if <code>item</code> is <code>null</code> before making a <code>getItemId()</code> method call on it, or just trust the system to not ever pass me a <code>null</code>?</p><p>I don't want to make my code slower by doing null checks when I shouldn't be worried about that happening, etc.</p>","435519","","","","","2010-09-01 08:52:25","Can hook methods called by the system ever be passed in a null argument reference?","<android>","1","0","1","",""
"3616257","1","3616307","","2010-09-01 08:34:25","4","5169","<p>I'm more than happy coding apps.  I am, however, rubbish at icon design.  I'm sure I'm not the only one for whom this is a problem - and yet all android devs need to create a launcher icon.</p><p>Does anyone have any good tips on knocking up simple but effective launcher icons?</p>","398293","","","","","2013-01-31 08:33:38","Launcher Icon Design","<android>","8","0","6","2013-01-31 16:22:07",""
"3616263","1","","","2010-09-01 08:35:06","2","2852","<p>How handle all input key an touch event incoming to my Android application?</p><p>Is any one place where I can catch all this events?</p>","436703","","119895","","2010-09-01 11:34:31","2013-04-30 13:37:50","Android handle all input key an touch event","<android><events><key><touch>","2","0","","",""
"3616349","1","3617478","","2010-09-01 08:47:57","1","258","<p>Please help me for going from <code>main.xml</code> to another layout by showing the main layout for 5 seconds with an image.</p><p>Only one image is there in main layout. </p>","436765","","379693","","2010-10-30 08:43:36","2010-10-30 08:43:36","usage of setcontentview in android","<android><layout><android-layout>","1","1","","",""
"3616355","1","3616446","","2010-09-01 08:48:49","4","7753","<p>My ads don't display at all, I think I've followed the documentation correctly but they still won't show. The program is basically a webview and I want the ad to display at the bottom.</p><p>Heres my layout file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout   xmlns:android=""http://schemas.android.com/apk/res/android""   xmlns:myapp=""http://schemas.android.com/apk/res/man.utd.headlines""   android:orientation=""vertical""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""&gt;   &lt;WebView      android:id=""@+id/webview""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent"" /&gt;   &lt;com.admob.android.ads.AdView      android:id=""@+id/ad""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      myapp:backgroundColor=""#000000""      myapp:primaryTextColor=""#FFFFFF""      myapp:secondaryTextColor=""#CCCCCC"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Any ideas?</p><p>EDIT: this is what I now have but it still doesn't appear to be quite right:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""xmlns:myapp=""http://schemas.android.com/apk/res/man.utd.headlines""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent"" &gt;&lt;com.admob.android.ads.AdView     android:id=""@+id/ad""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    myapp:backgroundColor=""#000000""    myapp:primaryTextColor=""#FFFFFF""    myapp:secondaryTextColor=""#CCCCCC"" /&gt;&lt;WebView    android:id=""@+id/webview""    android:layout_above=""@id/ad""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;&lt;/RelativeLayout&gt;</code></pre>","319940","","319940","","2010-09-01 14:42:49","2011-10-04 10:06:20","Admob ads not showing - Android","<android><webview><admob>","3","1","1","",""
"3616386","1","","","2010-09-01 08:52:48","6","17126","<p>I am creating an SMS Application to send and receive SMS. </p><p>I am able to send SMS using the following code:</p><pre><code>SmsManager sms = SmsManager.getDefault();sms.sendTextMessage(phoneNumber, null,message , pi, null); </code></pre><p>I would like to receive SMS and put them in my own inbox. How do I create this inbox? I would like it to work the same way as a normal inbox.</p><pre><code>Bundle bundle = intent.getExtras();             Object[] pdus = (Object[]) bundle.get(""pdus"");         SmsMessage[] messages = new SmsMessage[pdus.length];            for (int i = 0; i &lt; messages.length; i++)         {             messages[i] = SmsMessage.createFromPdu((byte[])pdus[i]);             Log.v(""SMSFun"",""Body: "" + messages[i].getDisplayMessageBody());            Log.v(""SMSFun"",""Address: "" + messages[i].getDisplayOriginatingAddress());               //If say we wanted to do something based on who sent it                   if (messages[i].getDisplayOriginatingAddress().contains(""5556""))                {                        // we could launch an activity and pass the data                   Intent newintent = new Intent(ctx, SecretMessage.class);                    newintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                newintent.putExtra(""address"", messages[i].getDisplayOriginatingAddress());                newintent.putExtra(""message"", messages[i].getDisplayMessageBody());                ctx.startActivity(newintent);            }              }</code></pre><p>How do I store incoming SMS in the inbox?</p><p>Is it possible in Android to listen to particular port number for SMS?</p>","436761","","115845","","2011-06-27 16:30:33","2014-04-16 04:08:21","Creating a SMS Application in Android?","<android><sms>","3","1","6","",""
"3616429","1","","","2010-09-01 08:58:21","1","902","<p>I have two Activity ActivityOne and ActivtyTwo.This two has Corresponding XML Files main.xml and main1.xml.if i press the next button in ActivityOne ActivityTwo appears with animation.is it possible through viewflipper</p>","454665","","","","","2010-09-01 10:08:47","Android View Flipper","<android>","1","0","","",""
"3616585","1","","","2010-09-01 09:22:52","0","187","<p>Does Android 2.1 support HTTP streaming for mp3</p>","436791","","1968972","","2014-02-10 15:50:09","2014-02-10 15:50:09","Does Android 2.1 support HTTP streaming for mp3","<android>","1","0","","",""
"3616676","1","3616831","","2010-09-01 09:35:29","63","121086","<p>Can anybody tell how to  draw a line in Android, perhaps with an example?</p>","426344","","50049","","2011-11-04 01:16:07","2013-06-27 11:09:19","How to draw a line in android","<android>","8","1","27","",""
"3616758","1","","","2010-09-01 09:47:07","1","753","<p>I've added this intent filter</p><pre><code>&lt;intent-filter android:label=""@string/app_name""&gt;  &lt;action android:name=""android.intent.action.SEND"" /&gt;  &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;  &lt;data android:mimeType=""text/plain"" /&gt;&lt;/intent-filter&gt;</code></pre><p>My app shows up as a target for the intent in the chooser for many apps but not for the default mail application which is my main focus.  In other words, if I open the BBC news app, for example, select some text and choose Share, my app is listed as an option.  If I do the same from the mail app, it's not shown.  I also tried text/* for the mimeType.</p><p>Am I missing something?</p><p>Thanks</p><p>Simon</p>","436811","","436811","","2010-09-01 11:18:39","2013-01-30 05:54:58","Adding an intent filter for the default mail app","<android><android-intent><android-manifest>","1","0","","",""
"3616956","1","3618069","","2010-09-01 10:12:09","5","9257","<p>Is there any way to get the details of current song played by <a href=""http://developer.android.com/reference/android/media/MediaPlayer.html"" rel=""nofollow"">MediaPlayer</a>?</p>","362088","","63550","","2012-12-20 17:59:03","2013-07-17 08:18:00","How to get current playing song details from MediaPlayer","<android><music><media-player>","4","1","4","",""
"3616971","1","3617019","","2010-09-01 10:15:11","1","2133","<p>I have two problems with ListView+images.I get the values for the list from an xml file which contains all necessary infos.</p><ol><li><p>I need to set up a Listview. Every row should contain an icon and a title. The icon is a local drawable (shipped whith the app). </p><p>An example what I want to achieve can be found here: <a href=""http://www.tutomobile.fr/wp-content/uploads/2010/07/listViewPerso_1.png"" rel=""nofollow"">http://www.tutomobile.fr/wp-content/uploads/2010/07/listViewPerso_1.png</a></p><p>I need a dynamic way to add images to the ListView, the xml file contents may change.</p></li><li><p>Is the same as the previous but this time the images are hosted on a server so I need to load them from the server and then display them in the list.</p></li></ol>","426418","","379693","","2010-10-30 08:44:06","2010-10-30 08:44:06","ListView and images","<android><image><listview><android-layout>","1","0","","",""
"3617058","1","","","2010-09-01 10:24:58","2","871","<p>Why could breakpoint in NetBeans (Android 1.5) not fire?</p>","406631","","1968972","","2014-02-10 16:27:37","2014-02-10 16:27:37","Breakpoint do not hitting during debugging","<android>","2","2","","",""
"3617142","1","","","2010-09-01 10:37:13","3","1177","<p>How can i set the <code>onScrollStateChanged</code> method for the Android Gallery Widget?</p><p>I would like to do something if the scrolling is finished.</p>","436845","","119895","","2010-09-01 11:15:28","2010-09-01 11:30:52","Android Gallery Widget onScrollStateChanged","<android><user-interface><widget><gallery>","1","1","","",""
"3617226","1","","","2010-09-01 10:51:19","2","1224","<p>the ajax in webview works fine if you keep using it,but if you don't do anything and wait for about 10min and try to use ajax to send data to server nothing happens.i checked the server side there is no request sent from the ajax in webview.is it bug of webview or i mess somthing up?</p><p>the ajax codes i use(the jquey $.ajax with some my own function)</p><pre><code>function extendBaseAjax(paramObj){if(typeof(paramObj['maxRetryTimes'])=='undefined'){    paramObj['maxRetryTimes']=0;}var maxRetryTimes=paramObj['maxRetryTimes'];var retryCounter=0;var error=paramObj['error'];  var errorHandler=function(XMLHttpRequest, textStatus, errorThrown){    if(textStatus=='timeout'){        retryCounter+=1;        if(retryCounter&lt;maxRetryTimes){            $.ajax(paramObj);        }else{            error(textStatus);//timeout"", ""error"", ""notmodified"" ,""parsererror""        }    }else{        error(textStatus);    }}var success=paramObj.success;var successHandler=function(data){    if(typeof(data)==""string""){        data=eval('('+data+')');    }    success(data);}paramObj['success']=successHandler;paramObj['error']=errorHandler;paramObj['date']=new Date().getTime();//no cache$.ajax(paramObj);</code></pre><p>}</p><p>and most of my ajax use like thie:</p><pre><code>        extendJsonpAjax({        url:url,        data:data,        timeout:timeout,        maxRetryTimes:maxRetryTimes,        success:function(data){            var resultNumber=data['resultNumber'];            totalPageNumber=resultNumber+1            totalPageNumber=Math.ceil(resultNumber/limit);            executeCallBack(data,currentPageNumber,totalPageNumber);            isAjaxCompleted=true;        },        error:function(textStatus){            errorCallBack(textStatus);            isAjaxCompleted=true;        }    });</code></pre>","436850","","436850","","2010-09-01 13:56:23","2010-09-01 13:56:23","ajax in webview not send data to server","<android><ajax><webview>","0","2","","",""
"3617284","1","3617411","","2010-09-01 10:58:54","7","14236","<p>I have a button that pops up with a dialog box on click.</p><p>I want the dialog box to have an <code>EditText</code> and a <code>Spinner</code> inside the dialog box.</p><p>I don't know how I'd set the view for it, I have the code for an <code>AlertDialog</code> and it works, it's just the <code>EditText</code> and <code>Spinner</code> that I need to place inside it then I can get on with the rest of the app's code.</p><p>Please can someone show me how I'd add an <code>EditText</code> and <code>Spinner</code> please?</p>","427234","","488657","","2012-10-13 21:30:29","2012-10-13 21:30:29","Dialog box with EditText and Spinner","<android><dialog>","2","0","2","",""
"3617453","1","3618236","","2010-09-01 11:21:42","11","7110","<p>I am getting data from the server using <code>AsyncTask</code>. I need to update the data periodically.</p><p>Whats the best way to do it?</p>","215399","","119895","","2010-09-01 12:16:24","2012-11-12 21:06:33","Best way to periodically executing AsyncTasks in Android","<java><android>","4","0","5","",""
"3617501","1","","","2010-09-01 11:27:40","-3","117","<p>Android mobile application development is the J2ME Application.I need to know about it? Can anyone help me?</p>","423037","","","","","2010-09-01 11:34:42","About android mobile application development?","<android>","2","0","","2013-03-01 03:42:36",""
"3617507","1","3617740","","2010-09-01 11:28:22","1","2222","<p>I'm trying to obtain the size of a file before I download it. I use <code>conn.getContentLength();</code> to do this and it works fine on my home computers Android 2.1 Emulator.</p><p>It however doesn't work once I run my app from my phone (either WiFi or 3G) and it also doesn't work when I run it from my work laptops Android 2.1 Emulator.</p><p>Does anyone know a workaround for this? Is there another way I can obtain the size of the file maybe without using <code>HttpURLConnection</code>.</p>","149166","","","","","2012-03-09 21:20:59","getContentLength() returning -1 on some devices and not others","<java><android><httpurlconnection>","2","2","1","",""
"3617787","1","","","2010-09-01 12:06:36","1","805","<p>I have two applications App-1 &amp; App-2. App-2 has a button which will start App-1.</p><p>The need is to behave like the following:-</p><ol><li>User launches App-1 (using launcher) &amp; activities A, B &amp; C are started &amp; activity C is at the top of the activity stack.</li><li>Please note that entry point of App-1 is activity A.</li><li>User presses home key. </li><li>User then launches the application App-2. User chooses the button in App-2 to start App-1.</li><li><p><code>onClick()</code> of the button in App-2 has the following code:-</p><p>Intent i = new Intent();     i.setAction(""com.x.y.z""); //resolves to activity A of App-1     i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);     i.putExtra(""x"", ""y"");     startActivity(i);</p></li></ol><p>After step-4, <code>onCreate()</code> of activity A is called which is quite normal. But I want Android to bring the entire Activity Stack to be brought to the foreground, since App-1 is running &amp; Android hasn't killed it.(Which is the same behavior if I had launched App-1 after step-2).</p><p>I want activity C to be shown to the user.</p><p>Kindly help me if it is possible to do this.</p><p>I have tried making activity A as singleTask &amp; singleInstance. if i do that, only activity A is brought to the foreground which is not what i want.</p><p>the snippet of App-1's manifest looks like below:-</p><pre><code>&lt;activity android:name="".aa.a""         android:configChanges=""orientation|keyboardHidden|locale""         android:label=""@string/app_name""         android:theme=""@android:style/Theme.NoDisplay""         &gt;            &lt;intent-filter&gt;             &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;           &lt;/intent-filter&gt;           &lt;intent-filter&gt;                 &lt;action android:name=""com.x.y.z"" /&gt;                 &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;                 &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;             &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre>","436917","","1232277","","2013-01-04 01:26:12","2013-02-26 21:44:30","Android can i avoid onCreate() being called?","<android><stack><activity>","1","2","","",""
"3617794","1","","","2010-09-01 12:07:13","1","776","<p>I'd like to be able to customize the view of a <code>PreferenceScreen</code>, and so I'm interested in knowing how to set a style for it. </p>","304866","","119895","","2010-09-01 12:18:32","2013-05-31 06:42:07","Style for PrefenceScreen","<android>","2","0","1","",""
"3618114","1","","","2010-09-01 12:48:52","4","2957","<p>How can I make my application to get started while my phone boots up itself. </p>","384193","","229106","","2010-09-01 12:57:58","2011-09-08 04:58:36","Autostart application while phone boots up","<android><autostart>","1","2","4","","2010-09-01 12:49:04"
"3618172","1","","","2010-09-01 12:54:15","6","2694","<p>I have a <code>Preference</code> that enables a sync adapter, and takes a while to actually do its work when toggled.  Consequently, when the user clicks the <code>Preference</code>, I spin off an AsyncTask to do the work. In the meantime, I disable the <code>Preference</code> and replace the check box with an indeterminate <code>ProgressBar</code>.  I have all of this working via a hack involving a subclass of <code>CheckBoxPreference</code> that overlays the <code>ProgressBar</code> on top of the <code>CheckBox</code>.  Yuck.</p><p>The <code>android:widgetLayout</code> attribute seems like it's designed exactly for this.  I should be able to use <code>android:widgetLayout</code> to specify a replacement for the default <code>CheckBox</code>.  Said replacement would implement <code>Checkable</code> and use a <code>ViewSwitcher</code> to switch appropriately between a <code>CheckBox</code> and a <code>ProgressBar</code>.  </p><p>The only problem is that <code>CheckBoxPreference</code>, in its <code>onBindView()</code> method, seems to ignore the possibility that <code>android:widgetLayout</code> may be used.  It explicitly does this:</p><pre><code>View checkboxView = view.findViewById(com.android.internal.R.id.checkbox);</code></pre><p>This effectively makes it impossible to swap in a custom <code>Checkable</code> via <code>android:widgetLayout</code> and have it actually work.</p><p>Is this an oversight/bug in <code>CheckBoxPreference</code>, or have I misunderstood <code>android:widgetLayout</code>?  Is there a cleaner intended way to do what I'm trying to do?</p>","339257","","","","","2012-03-04 16:00:36","Customizing CheckBoxPreference via android:widgetLayout","<android><preference>","2","2","1","",""
"3618267","1","","","2010-09-01 13:03:00","1","1079","<p>                                     </p><p>package com.broadcastreceiver;</p><p>import java.util.ArrayList;import android.appwidget.AppWidgetManager;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.util.Log;</p><p>public class ExampleBroadCastReceiver extends BroadcastReceiver { </p><pre><code>@Overridepublic void onReceive(final Context context, final Intent intent) {    // TODO Auto-generated method stub     Log.d(""ExmampleBroadcastReceiver"", ""intent="" + intent);      Intent intent1 = new Intent(context,Login.class);         context.startActivity(intent1); } </code></pre><p>} </p><p>I run this above code change the time zone in settings  not calling other activity can anybody tell what is problem</p>","426344","","426344","","2010-09-01 13:08:19","2011-05-29 18:35:31","time zone example not working in emulator","<android>","3","0","","",""
"3618457","1","","","2010-09-01 13:19:49","0","1402","<p>I'm creating a custom widget by expanding LinearLayout. One of the elements in my custom widget is a linear layout, inflated from another layout. When I set the OnClickListener it is not responding. Can you please advise?</p><p>Thanks!</p>","436993","","","","","2011-04-29 21:15:12","LinearLayout OnClickListener not responding","<android><android-linearlayout>","1","1","","",""
"3618498","1","3618545","","2010-09-01 13:24:27","0","494","<p>I'm a newbie Android developer and I'm also in the market for a new phone, so I spent all last week doing side-by-side comparisons between various Verizon 'droids with my wife's iPhone.  We found a lot of problems.  One problem was on 2 different manufacturers' phones running 2.2, but it does NOT occur on my Android emulator in Eclipse running 2.2!   </p><p><strong>MY Question:</strong>  Does Google have a searchable list of known issues (and workarounds and statuses) similar to Microsoft's Knowledge Base (the famous KB's) ?</p><p><strong>N.B.</strong>  I'm <strong>not</strong> asking for a list of bugs people have encountered -  I can find that by Googling - Microsoft's KB articles are issues that the company has acknowledged and they often include workarounds or other useful information.  </p>","424690","","1046207","","2012-09-04 14:40:20","2012-09-04 14:40:20","Does Google/Android have a ""known issues"" list?","<android><known-issues>","2","8","","",""
"3618588","1","4257156","","2010-09-01 13:32:54","1","1302","<p>I need to use my custom view for the indicators of my TabHost. With Android API level >=4 no problem but in the Android API level &lt;4 this method is not implemented. Any suggestion? </p><p>I was thinking to implement this method but unfortunately the TabHost class does not allow changes because has all attributes private and not protected. </p><p>Thanks.</p>","321354","","321354","","2013-04-27 17:09:34","2013-04-27 17:09:34","Workaround for the absence TabSpec.setIndicator(View view) on Android API level <4","<android><android-tabhost>","1","0","","",""
"3618779","1","3618967","","2010-09-01 13:53:34","0","2312","<p>Is it possible to update the TabWidget icons/indicators? If so, how, when you are creating TabContent through intents?</p><p>Edits below with answer thanks to @Bart</p><p>Generic code:</p><p>MainActivity:</p><pre><code>public class TestActivity extends TabActivity {public int i;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //TabHost mTabHost = (TabHost) findViewById(android.R.id.tabhost);    TabHost mTabHost = getTabHost();    mTabHost.addTab(mTabHost.newTabSpec(""tab1"").setContent(            new Intent(this, OneActivity.class)).setIndicator(""One""));    mTabHost.addTab(mTabHost.newTabSpec(""tab2"").setContent(            new Intent(this, TwoActivity.class)).setIndicator(""Two""));    changeTitle(0, 20);}public void changeTitle(int cnt, int i){    View v = getTabWidget().getChildAt(cnt);    TextView tv = (TextView) v.findViewById(android.R.id.title);    tv.setText(""One (""+i+"")"");}</code></pre><p>}</p><p>OneActivity (ChildActivity):</p><pre><code>public class OneActivity extends Activity {TextView tv;Button btn;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.one);    tv = (TextView) findViewById(R.id.tv);    btn = (Button) findViewById(R.id.btn);    btn.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            int i = Integer.parseInt((String) tv.getText());            i++;            tv.setText(""""+i);             TestActivity parent = OneActivity.this.getParent();             parent.changeTitle(0,i);        }    });}</code></pre><p>}</p><p>I'd like to show the number in the Tab's title</p>","356580","","356580","","2010-09-02 08:24:00","2011-06-14 15:33:41","Dynamically updating TabWidget icons?","<android><tabwidget><tabactivity>","3","0","","",""
"3618870","1","","","2010-09-01 14:03:53","2","731","<p>How to open a similar popup like the one that appears when you click on a contact icon in contacts? Is Dialog suitable for that? Or maybe PopupWindow?</p><p><img src=""http://i.stack.imgur.com/TE337.png"" alt=""Android screenshot""></p>","243225","","243225","","2010-09-01 14:15:20","2010-09-01 14:31:39","How to create a popup","<android><popup>","2","0","1","",""
"3619053","1","","","2010-09-01 14:21:58","2","660","<p>I'm new to Android &amp; Eclipse. I have modified a small app by changing 2 of the icons among other things. When i test the app using emulators all works as expected. But, when i load the .apk file to an actual device, I get the old version of the app (old icons). How can i get the .apk file to use the current icons &amp; code?</p>","437035","","213269","","2010-11-10 11:47:18","2010-11-10 11:47:18",".apk does not contain current icons - why?","<android><apk>","3","0","","",""
"3619133","1","","","2010-09-01 14:29:21","1","1476","<p>I'm developing an application which serves as bluetooth server for a bluetooth external device (the communication is started by the external device). This external device request from the bluetooth service I'm deploying a concrete service name (""PWAccessP""), so I initiate the serversocket by the following instruction:</p><pre><code>serversocket = Activa.myBluetoothAdapter.listenUsingRfcommWithServiceRecord(""PWAccessP"", UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB""));</code></pre><p>But when with a test application which search the bluetooth services offered by my phone, I get the following log:</p><pre><code>search services on 38E7D82E98F8 HTC Desireservice Unknown found btspp://38E7D82E98F8:22;authenticate=false;encrypt=false;master=false</code></pre><p>With ""Unknown"" as service name, indicating that the name of the offered service is unknown. I've checked this service is the one I'm deploying.</p><p>The phone I'm working is a HTC Desire.</p><p>Does anybody know what can be the problem?</p><p>Thanks in advance.</p>","365610","","","","","2011-01-18 13:21:14","Android problem in setting a bluetooth service name","<android><bluetooth>","1","0","2","","2010-09-01 14:29:21"
"3619197","1","","","2010-09-01 14:35:49","3","3021","<p>I've got a gallery (images) in a <code>RelativeLayout</code> and if the users click on it, three <code>Buttons</code> and a <code>TextView</code> appears. I made it with the visible-property, that means the three <code>Buttons</code> and the <code>TextView</code> are declared as invisible in the xml-file and later the <code>onClick()</code> of the <code>Gallery</code> makes it visible with <code>setVisibility(0)</code>.That works fine, but I want the <code>Gallery</code> to stop scrolling during the <code>Buttons</code> and the <code>TextView</code> are in front.</p><p>Is there any way to do this?</p>","437057","","437057","","2010-09-01 15:04:54","2011-02-25 18:13:04","how to stop scrolling gallery?","<android><scrolling><gallery><stop>","1","2","2","",""
"3619274","1","3619298","","2010-09-01 14:42:59","1","110","<p><strong>my goal:</strong>create an image gallery with each image having a description, name, title, other possible misc info.  as the user navigates through the gallery, image info will be displayed.  i plan to store the data in an arraylist of maps <code>ArrayList&lt;Map&lt;String, String&gt;&gt;</code> which is filled from the database. the list will include resource ID values among image info.</p><p><strong>problem:</strong>I am saving drawable resource ID values in an SQLite database when the app is opened for the first time.  from then on, i will be referring to the sqlite stored resource ID values, and not directly retrieving resources by this <code>R.drawable.drawable_name</code> fashion.  can i guarantee that the resource ID values will never change after the app is installed?</p>","416412","","416412","","2010-09-01 14:54:43","2010-09-01 14:54:43","Will resource identification numbers stay the same for each install?","<android>","3","0","","",""
"3619372","1","3619793","","2010-09-01 14:53:20","3","13846","<p>Based on a suggestion in a previous question I asked on here, I'm trying to push my socket connection for an application that I've written into a service.  I spent the better part of the day yesterday researching services and actually mocked up a few (one remote, one local).</p><p>My question is in two parts:</p><p>1) after having played with both a local service and a remote service, I'm still not sure as to which one would be best for my situation.  This is due in large part to the fact that I guess I still don't quite understand what advantages running in another 'process' is going to give me.  I'm spawning a new thread for the socket connection no matter what so I won't have any thread contention with the UI.  So what does putting the service in another process enable me to do?  Will I potentially see better performance that way?  My limited understanding is that by putting it in a different process, the service will run independently of whatever activity I have running on my app.  I do have a few different activities, but only one of them requires the socket connection which I will rebuild everytime that activity is opened anyway.  So would a local service be the way to go for me?</p><p>2) I'm going to have my socket ""listener"" (DataInputStream().readLine() inside a while loop) inside my service for any new data that gets passed down from the server.  After the playing I did yesterday, I could not figure out how to pass the data that it reads to the actual ""client"" (either bound client by remote service, or local client itself) in ""realtime"".</p><p>Would greatly appreciate some suggestions for part 1, and some help with part 2 (code examples? :))</p><p>TIA</p><p>Edit: added code of my service - going with local service</p><p>Service Class:</p><pre><code>   public class SocketService extends Service {    Socket s;    PrintStream os;    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return myBinder;    }    private final IBinder myBinder = new LocalBinder();    public class LocalBinder extends Binder {        public SocketService getService() {            return SocketService.this;        }    }    @Override    public void onCreate() {        super.onCreate();        s = new Socket();    }    public void IsBoundable(){        Toast.makeText(this,""I bind like butter"", Toast.LENGTH_LONG).show();    }    public void onStart(Intent intent, int startId){        super.onStart(intent, startId);        Toast.makeText(this,""Service created ..."", Toast.LENGTH_LONG).show();        Runnable connect = new connectSocket();        new Thread(connect).start();    }    class connectSocket implements Runnable {        @Override        public void run() {            SocketAddress socketAddress = new InetSocketAddress(""192.168.1.104"", 4505);            try {                               s.connect(socketAddress);            } catch (IOException e) {                e.printStackTrace();            }        }    }    @Override    public void onDestroy() {        super.onDestroy();        try {            s.close();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        s = null;    }}</code></pre><p>Activity that calls service:</p><pre><code>public class SocketServiceController extends Activity {        private SocketService mBoundService;        private Boolean mIsBound;        public SocketServiceController ssc;       @Override        protected void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            ssc = this;            setContentView(R.layout.main);            Button start = (Button)findViewById(R.id.serviceButton);            Button stop = (Button)findViewById(R.id.cancelButton);            start.setOnClickListener(startListener);            stop.setOnClickListener(stopListener);       }       private ServiceConnection mConnection = new ServiceConnection() {            public void onServiceConnected(ComponentName className, IBinder service) {                mBoundService = ((SocketService.LocalBinder)service).getService();            }            public void onServiceDisconnected(ComponentName className) {                mBoundService = null;            }        };        private void doBindService() {            bindService(new Intent(SocketServiceController.this, SocketService.class), mConnection, Context.BIND_AUTO_CREATE);            mIsBound = true;            mBoundService.IsBoundable();        }        private void doUnbindService() {            if (mIsBound) {                // Detach our existing connection.                unbindService(mConnection);                mIsBound = false;            }        }        @Override        protected void onDestroy() {            super.onDestroy();            doUnbindService();        }       private OnClickListener startListener = new OnClickListener() {        public void onClick(View v){            startService(new Intent(SocketServiceController.this,SocketService.class));            doBindService();         }                      };       private OnClickListener stopListener = new OnClickListener() {            public void onClick(View v){                stopService(new Intent(SocketServiceController.this,SocketService.class));            }                         };}</code></pre>","233971","","233971","","2010-09-01 19:00:26","2010-09-01 19:00:26","Android service for TCP Sockets","<android><sockets><service>","1","2","3","",""
"3619396","1","","","2010-09-01 14:55:17","0","1259","<p>I am using several listview's in my application that receive many notifications each second on a thread. when this happens i update data in the array adapter and then call notifiyDataSetChanged() on the UI thread.</p><p>However this causes getView to be called on the adapter on all the visible postions.this is causes various issues for me.<br>1. in the getView i cannot tell which view actually got updated ( i would like to do something in case it was).<br>2. if i manage to know what was updated based on a flag on the ArrayAdapter and try to perform some animation sometimes the animation doest trigger ( Perhaps getView is called with a disposable view for some reason).<br>3. since views are recycled i cannot tell what were the previous values in the rows TextView.  </p><p>What im trying to do is simply have a list of items that updates allot. everytime a row updates do an animation on that row for 2 seconds (only if the row data changed ) based on the previous value that was in the row.</p><p>Please any help on how to achieve this?</p><p>Thanks,   Totem</p>","274180","","274180","","2010-09-01 18:39:42","2010-09-01 18:39:42","Dynamic ArrayAdapter and listview Updating issues","<android><adapter>","0","2","","",""
"3619400","1","3619479","","2010-09-01 14:55:47","1","566","<p>I have a ListActivity containing an object I've defined called a MessageItem.  I want to pass the data in this MessageItem off to a Service to do some stuff, but I don't want the Activity to be data bound to the Service such that Android can't reclaim the Activity if it needs to (ergo memory leak).</p><p>What I'm doing is passing the MessageItem object to a method in a singleton class along with the application Context.  The singleton method uses the application Context to start my Service.  I pass to this Service an Intent.  In this Intent, I put items from the MessageItem object like so:</p><pre><code>    intent.putExtra(""subject"", msg.getSubject());    intent.putExtra(""summary"", msg.getSummary());    intent.putExtra(""created_on"", msg.getCreatedDate());    intent.putExtra(""read"", msg.getIsRead());</code></pre><p>Will this data bind my Activity to the Service the Intent gets passed into and cause a memory leak?</p><p>Would this be a better implementation?:</p><pre><code>    intent.putExtra(""subject"", new String(msg.getSubject()));    intent.putExtra(""summary"", new String(msg.getSummary()));    intent.putExtra(""created_on"", new Integer(msg.getCreatedDate()));    intent.putExtra(""read"", new Boolean(msg.getIsRead()));</code></pre>","406790","","","","","2010-09-01 15:03:09","Is this a memory leak?","<java><android><memory><service><singleton>","2","0","","",""
"3619495","1","","","2010-09-01 15:04:55","1","517","<p>I have a singleton in an activity. When I end my application (like pressing back button), and start it again after some time, the singleton is not recreated, but is holding previous state. Singleton is not destroyed if the application is destroyed? Do I have to null its static members in onDestroy() to avoid memory leak? Thanks.</p>","410757","","410757","","2010-09-01 17:05:00","2010-09-01 18:11:15","living singleton, when activity end","<android>","1","4","","",""
"3619529","1","","","2010-09-01 15:09:22","2","2895","<p>I need to size the top-most layout of my application dynamically (programmatically) based on information loaded from a configuration file.</p><p>Right now the in main.xml I have </p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;     &lt;LinearLayout               android:id=""@+id/LinearLayout01""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             xmlns:android=""http://schemas.android.com/apk/res/android""             android:background=""@drawable/background""&gt;    &lt;/LinearLayout&gt;</code></pre><p>So I am looking for a way to change android:layout_width and layout_height programmatically.</p><p>Any help would be appreciated</p><p>RM</p><p>EDIT:</p><p>As per suggestions I have tried the following:</p><pre><code>LinearLayout l2 = (LinearLayout)findViewById(R.id.LinearLayout07);LinearLayout.LayoutParams params =  new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,LinearLayout.LayoutParams.FILL_PARENT,1);l2.setLayoutParams(params);</code></pre><p>But that gives me the following error when running:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception ClassCastException))    FrameLayout.onLayout(boolean, int, int, int, int) line: 288 FrameLayout(View).layout(int, int, int, int) line: 6133 ....</code></pre>","14587","","14587","","2010-09-01 17:18:19","2011-12-29 18:39:52","How to size android layout dynamically","<android>","2","2","","",""
"3619533","1","3622631","","2010-09-01 15:09:50","6","2824","<p>I want to check my program code for time consuming operations. I thought DDMS is the best tool to achieve that.</p><p>However, I cant see Threads, Heaps and so on. It tells my to select a client. But I dont know where other than the Devices Tab, which doesnt take effect.</p><p>What do I have to do? Is there maybe smth wrong with my ADB setup (But LogCat works fine)?</p><p>Thanks!</p><p><img src=""http://i.stack.imgur.com/ewsxe.png"" alt=""enter image description here""></p>","433718","","39648","","2011-04-29 11:06:04","2011-04-29 11:06:04","Cannot select my Android client in DDMS perspective of eclipse","<android><android-emulator><ddms><performance>","1","1","","",""
"3619625","1","","","2010-09-01 15:20:20","4","1498","<p>Let's say I have a ListView of items:</p><ul><li>Cat</li><li>Dog</li><li>Mouse</li></ul><p>And these are bound to the ListView via an adapter to a database.</p><p>What I want to be able to do is to be able to re-order the list view,. For example I want to somehow drag ""Mouse"" up to the top of the list above ""Cat"".  Once I have an order set, I then want to ""save"" the list and its order back to the database.</p><p>Is there any way to do this?  Has someone made such a custom ListView that I could use?  The only alternative I can think of is to long press on a list view item and have a ""Move up by one"", ""Move to top"", etc. context menu that moves items around in the list.</p>","396","","82187","","2011-01-28 17:39:53","2013-11-02 15:51:51","Is there an easy way to drag items around in a ListView to change their order?","<android><gui><listview><order>","1","0","2","",""
"3619657","1","3669475","","2010-09-01 15:24:10","0","1647","<p>Anybody can explain me how to serialize easly a class/object and save it under a name or tag for restoring later ?</p><p>thanks to give code examples if possible.</p>","429222","","","","","2010-09-08 15:44:52","android how to serialize a class and save it somewhere with a name or tag?","<android><serialization>","1","0","","",""
"3619663","1","3757678","","2010-09-01 15:24:40","0","1723","<p>Let's say I have an android app, and in that app I want to animate a graphic of a ball in an ""L"" shape.  This would require me to define a Tween Animation where I create an animation xml file (written below) and apply it to a View which has the ball graphic in it.</p><pre><code>&lt;translate&gt;Ydelta = 20;offset = 0;duration = 100;&lt;/translate&gt;&lt;translate&gt;Xdelta = 20;offset = 100;duration = 100;&lt;/translate&gt;</code></pre><p>Now lets say I want to control the speed of this animation dynamically so that over time, the L animation goes faster and faster and faster.  How can I dynamically control the speed of this whole animation?  I have tried myAnimation.setDuration($var) but this only seems to work on the first part of the animation.  Any part of the animation that has an offset greater than 0 doesn't have its duration adjusted by the setDuration() method.</p><p><strong>Does anyone know a way that I can scale a multi-setp animation uniformly?</strong></p><p>Thanks</p><p>ps - I know there are ways around solving this such as creating a 2 part animation and scaling each part independently or generating an animation using code, but if there's a simpler solution then that would be preferred.</p>","107459","","107459","","2010-09-02 06:16:01","2010-09-21 06:00:34","How to dynamically adjust the duration/speed of a Tween Animation in Android","<android><animation><dynamic><duration>","1","0","","",""
"3619670","1","3619929","","2010-09-01 15:25:22","2","1241","<p>I like the layout of the <code>toast</code> widget very much, that means rounded corners, transparency, light grey border. Is there any way to see the layout parameters of such android standard widgets like the <code>toast</code>?</p><p>I would like do define a <code>TextView</code> with the same layout parameters.</p>","437057","","","","","2010-09-01 15:57:33","how can I find the layout parameters of the toast widget?","<android><layout><parameters><toast>","2","0","1","",""
"3619687","1","3620045","","2010-09-01 15:27:08","0","795","<p>is it possible to start a context menu on the onCreate method? I know its probably bad design ethics but I have my resons!! I've tried the: </p><pre><code>registerForContextMenu(this.getCurrentFocus());</code></pre><p>But its not working.. So does anyone have any better ideas? </p><p>Many thanks in advance! </p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    LinearLayout layout = new LinearLayout(this);    layout.setLayoutParams(new    LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));    //Button button = new Button(this);    //button.setLayoutParams(new    //LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));    //button.setText(""my button"");    TextView text = new TextView(this);    text.setLayoutParams(new    LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));    layout.addView(text);    setContentView(layout);    registerForContextMenu(text);    openContextMenu(layout);</code></pre>","397085","","397085","","2010-09-01 19:59:34","2010-09-01 19:59:34","Android ContextMenu starts in the onCreate method?","<android><contextmenu><oncreate>","1","0","","",""
"3619693","1","3621042","","2010-09-01 15:28:00","33","33830","<p>Can I get a View's x and y position relative to the root layout of my Activity in Android?</p>","243225","","56285","","2013-11-29 12:54:03","2014-04-05 07:06:01","Getting View's coordinates relative to the root layout","<android><android-layout><coordinates>","4","1","10","",""
"3619859","1","","","2010-09-01 15:49:20","5","2187","<p>Is there a way to style a RadioButton as a flat button? I have four options:</p><pre><code>| btn1 | btn2 | btn3 | btn4 |</code></pre><p>instead of having the little radio circle next to each, I'd like to show each as just a plain flat button. Is that possible without having to draw them myself?</p><p>Thanks</p>","246114","","","","","2014-04-08 15:37:42","RadioButton as flat button?","<android>","4","0","","",""
"3619924","1","4045287","","2010-09-01 15:57:10","15","17871","<p>I want to use the Geocoder in an android application, I've got the following piece of code to sample it : </p><pre><code>public class LocatorGeo extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Geocoder geo = new Geocoder(getApplicationContext());        List&lt;Address&gt; myAddrs = new ArrayList&lt;Address&gt;();        try {            myAddrs = geo.getFromLocationName(""CO100AR"", 1);        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }}</code></pre><p>I get the following stack trace : </p><pre><code>09-01 15:52:38.809: WARN/System.err(334): java.io.IOException: Service not Available09-01 15:52:38.819: WARN/System.err(334):     at android.location.Geocoder.getFromLocationName(Geocoder.java:159)09-01 15:52:38.829: WARN/System.err(334):     at com.jameselsey.LocatorGeo.onCreate(LocatorGeo.java:25)09-01 15:52:38.829: WARN/System.err(334):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-01 15:52:38.839: WARN/System.err(334):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)09-01 15:52:38.849: WARN/System.err(334):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)09-01 15:52:38.849: WARN/System.err(334):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)09-01 15:52:38.868: WARN/System.err(334):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)09-01 15:52:38.868: WARN/System.err(334):     at android.os.Handler.dispatchMessage(Handler.java:99)09-01 15:52:38.879: WARN/System.err(334):     at android.os.Looper.loop(Looper.java:123)09-01 15:52:38.889: WARN/System.err(334):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-01 15:52:38.899: WARN/System.err(334):     at java.lang.reflect.Method.invokeNative(Native Method)09-01 15:52:38.909: WARN/System.err(334):     at java.lang.reflect.Method.invoke(Method.java:521)09-01 15:52:38.919: WARN/System.err(334):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-01 15:52:38.929: WARN/System.err(334):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-01 15:52:38.929: WARN/System.err(334):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Why is the service unavailable? I have the following in my manifest</p><pre><code>   &lt;uses-permission android:name=""android.permission.INTERNET""/&gt;</code></pre><p>The <a href=""http://developer.android.com/reference/android/location/Geocoder.html"">documentation</a> states : <code>The Geocoder class requires a backend service that is not included in the core android framework</code>, how/where can I obtain such a service?</p>","155695","","","","","2013-07-08 10:48:18","Android; Geocoder, why do I get ""the service is not available""?","<android><geocoding><android-2.2-froyo>","4","2","3","",""
"3620053","1","3630358","","2010-09-01 16:10:28","0","138","<p>I have a ViewFlipper that presents 3 different views.</p><p>Is it possible to have 3 classes manage* the 3 different views? If so, how do I go about doing this?</p><ul><li>For example, if View 1 shows a List of News and View 2 Shows a List of Prices, I want to have a News class that handles the interaction of the listview in News, and a Prices class that handles the interaction of the listview in Prices</li></ul>","19875","","19875","","2010-09-01 16:36:29","2010-09-02 19:10:40","How can I assign a separate class for each view in a ViewFlipper?","<java><android><android-widget><viewflipper>","1","4","","",""
"3620252","1","3620320","","2010-09-01 16:38:02","1","647","<p>is it possible to change the layout of the app when the orientation of the screen changes from portrait to landscape ?I mean linking the app to two different .xml layout files for each landscape and portrait?or maybe is it possible to change placement of 2 views ?like...i want a button to be below the textview in portrait mode but i want them side by side in landscape mode...:/please help...</p>","434885","","","","","2010-09-01 16:50:25","Android dev: screen orientation","<android>","2","0","","",""
"3620392","1","3620636","","2010-09-01 16:57:00","1","853","<p>I have an android app that uses a background service for uploading data.</p><p>When we go upload data, everything works fine.  Even when we make the display sleep, everything works.</p><p>However, this was while we were connected to Eclipse via USB.  Once we disconnected the device, started to send the data and made the screen 'sleep,' we got a socket timeout exception.</p><p>Is there a special setting in the Service I need to make to allow it to continue to send data when the display sleeps?</p>","386541","","","","","2010-09-01 17:30:55","Android HttpPost socket timeout when android goes to sleep in background service","<android>","1","0","","",""
"3620403","1","","","2010-09-01 16:57:55","0","234","<p>I am trying to create an Android application that would use a configuration file (plain text) when loading.</p><p>When testing locally (with an emulator), I place my config file in the src/ folder (ecplise) and I see it is copied and used from the bin/ folder upon project build.</p><p>My questions are:</p><p>1) Where do I need to place this file when testing on a device ?From what I understand I need the *.apk file and the config file to be both present on the device during run time.</p><p>2) If I am using eclipse to install the *.apk file  can I somehow specify the config file as a dependant file and force eclipse to copy it as well ? If not do  I need to manually copy the *.apk &amp; config files to the device ?</p><p>NOTE: I am using <code>getResourceAsStream</code> to load the file.</p><p>Thanks,</p><p>RM</p>","14587","","","","","2010-09-01 17:45:25","Configuring Android application from file","<android>","1","0","","",""
"3620422","1","","","2010-09-01 17:01:35","1","1167","<p>Has anyone used the Android NDK to port a Linux app? We have an SSL VPN solution at work which Openconnect (http://www.infradead.org/openconnect.html) works with, but there is currently no client (from Cisco or otherwise) on Android. Is using the Android NDK a feasible approach to get this to work?</p><p>Thank you in advance</p>","394056","","","","","2010-09-13 09:56:41","Porting C to Android using Android NDK","<android><android-ndk>","2","0","","",""
"3620445","1","3620668","","2010-09-01 17:06:04","0","4079","<p>When I use a ImageButton in the ListView row, the ros is no selectable. When I change it to a ImageView it is selectable.</p><p>I have this simple row layout, and below is my list , am I missing something simple?</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:orientation=""horizontal""android:id=""@+id/layoutrowtop""&gt;    &lt;ImageButton android:id=""@+id/imgDetailDisclosure""     android:layout_height=""fill_parent""     android:layout_width=""48dip""     android:layout_gravity=""center_vertical""    android:background=""#00000000""&gt;    &lt;/ImageButton&gt;    &lt;RelativeLayout         android:layout_width=""wrap_content""        android:layout_height=""?android:attr/listPreferredItemHeight""        android:padding=""6dip""&gt;                &lt;TextView android:id=""@+id/firstLine""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:ellipsize=""marquee""                android:textStyle=""bold""                android:textSize=""18dp""                android:singleLine=""true""                android:gravity=""top""                &gt;&lt;/TextView&gt;                &lt;TextView android:id=""@+id/secondLine""                 android:layout_height=""fill_parent""                 android:layout_below=""@+id/firstLine""                 android:layout_width=""wrap_content""                android:ellipsize=""marquee""                android:textStyle=""italic""                android:textSize=""14dp""                android:singleLine=""false""                android:gravity=""top""                android:lines=""2""&gt;&lt;/TextView&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p></p><pre><code>&lt;LinearLayout  android:layout_height=""wrap_content"" android:orientation=""horizontal""android:layout_width=""fill_parent""&gt;&lt;EditText      android:id=""@+id/search_box""    android:layout_height=""wrap_content""     android:layout_weight=""1""    android:layout_width=""fill_parent""    android:hint=""type to filter""    android:inputType=""text""/&gt;&lt;ImageButton     android:id=""@+id/search_button""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:src=""@drawable/icon_mag_glass""/&gt;&lt;/LinearLayout&gt;&lt;!-- Set height to 0, and let the weight param expand it --&gt;&lt;!-- Note the use of the default ID! This lets us use a ListActivity still! --&gt;&lt;ListView android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""0dip""    android:layout_weight=""1"" /&gt;</code></pre><p></p>","172861","","172861","","2010-09-01 17:33:05","2010-09-01 17:35:38","Android ListView Not selectable anymore?","<android><layout>","1","0","","",""
"3620591","1","","","2010-09-01 17:24:31","1","298","<p>I want to create keyboard shortcuts in my Android app such that, say, alt-t runs a certain command. I can't seem to figure out how to detect the presence of the alt modifier in the emulator, though.</p><p>I've overridden onKeyDown() in my app to look like the following (Scala):</p><pre><code>  override def onKeyDown(keycode:Int, event:KeyEvent) =  keycode match {    case KeyEvent.KEYCODE_B =&gt;      StatisticsService.map(_.sayBatteryLevel())      true    case KeyEvent.KEYCODE_D =&gt;      StatisticsService.map(_.sayDate())      true    case KeyEvent.KEYCODE_S =&gt;      StatisticsService.map(_.saySignalStrengths())      true    case KeyEvent.KEYCODE_T =&gt;      StatisticsService.map(_.sayTime())      true    case _ =&gt; super.onKeyDown(keycode, event)  }</code></pre><p>That of course matches the plain keys just fine, but not alt-b, alt-t, etc. How can I change the above to match the given alt-modified bindings?</p><p>I've searched Google and have tried using event.isAltPressed, but this doesn't work. I've also logged the results of the keypresses, and have noticed that the alt key isn't at all picked up. That is, simply pressing alt does nothing, and pressing alt-t produces identical logs to just t.</p><p>This is being tested in the emulator if that makes a difference.</p><p>Edit: Not sure how to respond to comments left on my question, but I'm aware that not all devices have alt keys, but that's not an issue here because I'm coding for a custom device that does. The question isn't ""what's the most generic way to do this,"" but ""how do I match alt keybindings when the documented methods don't work and no explanation seems to be given in Google's own docs?""</p><p>Thanks.</p>","277144","","277144","","2010-09-01 21:05:28","2010-09-01 21:05:28","Detecting alt keypresses in Android app","<android>","0","2","","",""
"3620599","1","3620699","","2010-09-01 17:25:25","2","854","<p>is there something similar to the NotImplementedException on the android platform?</p><p>thanks!</p>","97688","","","","","2010-09-01 17:40:17","NotImplementedException on android","<android>","1","0","","",""
"3620616","1","","","2010-09-01 17:27:50","0","9076","<p>Something is wrong with my code. In the application, when I ""add item"", it doesn't show anything, and if I am clicking somewhere around the Android application, then ""item"" sometimes comes.Can somebody help me?</p><pre><code>package com.example.proov;import java.util.ArrayList;import com.example.proov.R;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;public class proovin extends Activity {    private ListView LView;    ArrayList &lt;String&gt;ar = new ArrayList&lt;String&gt;();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LView = (ListView) findViewById(R.id.ListView01);        //      Set option as Multiple Choice. So that user can able to select more the one option                LView.setAdapter(new ArrayAdapter&lt;String&gt;(this,                        android.R.layout.simple_list_item_multiple_choice, ar));                LView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);             Button b = (Button) findViewById(R.id.add_item);             final EditText d = (EditText) findViewById(R.id.title);             b.setOnClickListener(new View.OnClickListener() {                    @Override                    public void onClick(View v) {                        ar.add(d.getText().toString());                     }                });    }}</code></pre>","581785","","895646","","2012-08-21 05:21:25","2013-03-20 13:32:51","How to add item to arraylist with button click?","<android><arraylist>","3","0","","",""
"3620691","1","3620755","","2010-09-01 17:39:14","2","378","<p>I am programming an app that eventually will have several Activities. Right now, however, I got stuck trying to start the second activity from the first one. For some odd reason I am always only getting an ActivityNotFoundException.</p><p>The code that tries to start the second activity reads:</p><pre><code>    ...    Intent intent = new Intent(Intent.ACTION_INSERT);     /* intent.addCategory(""foo""); */    Log.v(TAG, ""starting activity: "" + intent);                 startActivity(intent);    ...</code></pre><p>The Intent.ACTION_INSERT string constant is ""android.intent.action.INSERT"".</p><p>The corresponding fragment in the AndroidManifest.xml reads:</p><pre><code>    ...    &lt;activity         android:label=""@string/item_details""         android:name=""ItemDetails""        android:screenOrientation=""portrait""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.INSERT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""foo"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    ...</code></pre><p>The Activity class ""ItemDetails"" exists and is in the same package as the ""calling"" Activity. The Intent names match and according to the Android docs the ""android.intent.category.DEFAULT"" category should apply to all Intents that have no category set. Still, that Activity is not found. Why? </p><p>I also tried to specify a unique category ""foo"" as shown in the commented line in the code snippet and also added that to the manifest file, but same result.... :-(</p><p>What am I missing? Any hints?</p>","423411","","","","","2010-09-01 17:53:13","Trying to start another Activity always only yields ""ActivityNotFoundException"". What am I missing?","<android>","3","1","","",""
"3620752","1","3620837","","2010-09-01 17:46:40","2","1112","<p>ok i am having real troubles with screen orientation. My application has a countdown timer in it along with other variables.And everytime the screen goes from landscape to portrait mode all my variables get reset to their default value, and the countdown timer gets canceld and reset !!!Is the onCreate method called everytime the screen changes orintation ?is there a solution to this problem ?</p>","434885","","","","","2010-09-01 18:36:26","Android dev: screen orientation problems","<android><screen>","1","0","2","",""
"3620906","1","3620946","","2010-09-01 18:12:24","0","619","<p>I'm beginner of Android. I want to run my first application on emulator. I use eclipse.</p><p>I don't know what's happen. I installed my apk. I ""register"" my acitivity in manifest file, but I can't see it in list of application. When I open manage application setting it's written that my apk is installed. I searched about it everywhere. </p><p>Even in faq of Android Development there is post about but I did all this things.</p>","437223","","","","","2011-01-13 16:02:23","My android application isn't showing on main list of application. What I have to do?","<android><android-emulator><android-install-apk>","1","0","","",""
"3621055","1","","","2010-09-01 18:32:06","0","339","<p>It am sub-dividing an app I have into ""platform"" and ""app"" layers so that I can distribute the platform as a jar for use by partners - while protecting my IP.  </p><p>I now have two Eclipse projects. Building has no ability to compile any resources into a jar, so I moved all resource references into the app project (the platform project gen/ directory is empty).  I compiled the platform and then manually used the jdk to to jar it,  imported that jar into the app project, marked the jar for export in the app project, and successfully compiled and installed a test app:</p><pre><code>public class NotifyService extends Service {    ...    @Override    public void onStart(Intent intent, int startId) {        myNotify(intent.getIntExtra(EXTRA_ICON),...));    }    private void myNotify(int iconResource, String s1, String s2, String s3) {        Context c = getApplicationContext();        if (H.VERBOSE) Log.d(TAG, ""myNotify()""); //$NON-NLS-1$        Notification n = new Notification(iconResource, s1, currentTime);        Intent nextStep = new Intent(Intent.ACTION_VIEW,Uri));        PendingIntent pending = PendingIntent.getActivity(c, 0, nextStep, 0);        n.setLatestEventInfo(c, s2, s3, pending);        mgr.notify(1, n);    }... </code></pre><p>The test activity launches as expected and I get the LogCat() message from this service. But no notification is shown and no error is logged - its just silent. ... </p><p>Anyway, I want partner apps to make use of my platform which connects to services, content providers, the web, the works.  Anyone offer some guidance?</p><p>UPDATE!</p><p>Hah... typical... when I moved all the resources out of my platform and into my app I did not properly pass these down from the app layer.  Thus, the code example I gave had no error.  Using an intent rather than linking decouples ""arguments passed"" from ""arguments expected"" of course - and the compiler does not complain.  With a corrected app, this works.</p><p>Though I'd think creating a binary distribution platform is not uncommon, I'm not finding much doc on it so I'll keep adding any significant findings as I open the doors ... hope it's of use to someone.</p>","294973","","294973","","2010-09-02 00:03:38","2010-09-02 00:03:38","Creating and using a ""common platform"" jar in Android - what works?","<android><jar><platform>","2","0","1","",""
"3621163","1","3621387","","2010-09-01 18:46:41","34","30958","<p>I have an application which has 11 different activities.  One of these activities is an extension of MapActivity (it is a map for data visualization).  To get to this activity the user must first travel through the launch activity, then 3 other activities.  The code to launch the MapActivity is:</p><pre><code>Intent i = new Intent(getBaseContext(), MapVis.class);i.putExtra(""edu.uml.cs.isense.visualizations.session_list"", sessions);startActivity(i);</code></pre><p>When this is executed I get the following output from the Log:</p><pre><code>09-01 14:36:22.389: WARN/dalvikvm(592): Class resolved by unexpected DEX: Ledu/uml/cs/isense/visualizations/MapVis;(0x44981910):0x128260 ref [Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/MapActivity;(0x44981910):0x13d33009-01 14:36:22.389: WARN/dalvikvm(592): (Ledu/uml/cs/isense/visualizations/MapVis; had used a different Lcom/google/android/maps/MapActivity; during pre-verification)09-01 14:36:22.389: WARN/dalvikvm(592): Unable to resolve superclass of Ledu/uml/cs/isense/visualizations/MapVis; (118)09-01 14:36:22.389: WARN/dalvikvm(592): Link of class 'Ledu/uml/cs/isense/visualizations/MapVis;' failed09-01 14:36:22.389: DEBUG/AndroidRuntime(592): Shutting down VM09-01 14:36:22.389: WARN/dalvikvm(592): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0)09-01 14:36:22.399: ERROR/AndroidRuntime(592): FATAL EXCEPTION: main09-01 14:36:22.399: ERROR/AndroidRuntime(592): java.lang.NoClassDefFoundError: edu.uml.cs.isense.visualizations.MapVis09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at edu.uml.cs.isense.visualizations.Visualizations.onOptionsItemSelected(Visualizations.java:213)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at android.app.Activity.onMenuItemSelected(Activity.java:2195)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at android.view.View$PerformClick.run(View.java:8816)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at android.os.Handler.handleCallback(Handler.java:587)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at android.os.Handler.dispatchMessage(Handler.java:92)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at android.os.Looper.loop(Looper.java:123)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at java.lang.reflect.Method.invokeNative(Native Method)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at java.lang.reflect.Method.invoke(Method.java:521)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at dalvik.system.NativeStart.main(Native Method)09-01 14:36:22.399: ERROR/AndroidRuntime(592): Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at dalvik.system.DexFile.defineClass(Native Method)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)09-01 14:36:22.399: ERROR/AndroidRuntime(592):     ... 17 more09-01 14:36:22.409: WARN/ActivityManager(92):   Force finishing activity edu.uml.cs.isense/.visualizations.Visualizations09-01 14:36:22.909: WARN/ActivityManager(92): Activity pause timeout for HistoryRecord{44c84a90 edu.uml.cs.isense/.visualizations.Visualizations}</code></pre><p>I do have the target set to Google APIs, this is an app meant for Android 1.5, and specifies the minsdk to be level 3 in the manifest file.  uses-library for maps is also in manifest file.</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""edu.uml.cs.isense""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;    &lt;uses-permission android:name=""android.permission.CONTROL_LOCATION_UPDATES""/&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""/&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_LOCATION_EXTRA_COMMANDS""/&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Isense"" android:label=""@string/app_name""&gt;   &lt;intent-filter&gt;             &lt;action android:name=""android.intent.action.MAIN"" /&gt;             &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;         &lt;/intent-filter&gt;        &lt;/activity&gt;  &lt;activity android:name="".experiments.Experiments"" android:label=""@string/app_name_experiments""/&gt;  &lt;activity android:name="".sessions.Sessions"" android:label=""@string/app_name""/&gt;  &lt;activity android:name="".people.People"" android:label=""@string/app_name_people""/&gt;  &lt;activity android:name="".profile.Profile"" android:label=""@string/app_name""/&gt;  &lt;activity android:name="".sensors.Sensors"" android:label=""@string/app_name_sensors""/&gt;  &lt;activity android:name="".visualizations.DataTable"" android:label=""@string/app_name""/&gt;  &lt;activity android:name="".visualizations.Visualizations"" android:label=""@string/app_name""/&gt;  &lt;activity android:name="".sensors.DataListActivity""                  android:label=""@string/selectFile""                  android:theme=""@android:style/Theme.Dialog""                  android:configChanges=""orientation|keyboardHidden"" /&gt;        &lt;activity android:name="".sensors.Upload"" android:label=""@string/app_name_uploader""/&gt;        &lt;activity android:name="".visualizations.MapVis"" android:label=""@string/app_name""            android:theme=""@android:style/Theme.NoTitleBar"" /&gt;        &lt;uses-library android:name=""com.google.android.maps""/&gt;&lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3""/&gt;&lt;/manifest&gt;</code></pre><p>I have been at this for almost 2 days now with no results.  It seems that there are a lot of people having issues launching a MapActivity from other activities but there are no solutions anywhere.  Does anyone have a clue?  Thanks.</p>","437263","","341091","","2011-04-07 11:25:04","2013-12-30 11:28:23","Cannot resolve MapActivity class on Android","<android>","11","1","3","",""
"3621178","1","3621280","","2010-09-01 18:49:26","0","1583","<p>can someone helpme out with how to save state of the app when the screen orientation is changed i read the development guide at<a href=""http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange"" rel=""nofollow"">http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange</a></p><p>but i dont know how to define the method collectMyLoadedData();</p><p>can someone help me with an example or something ?</p>","434885","","","","","2011-06-23 17:02:02","Android Dev: save state","<android>","2","0","","",""
"3621239","1","3621427","","2010-09-01 18:58:26","2","1069","<p>I am trying to get one line with three buttons on it.  One far left one in the center and one far right.  Ideally I would like the center button to take up all the space between the two side ones.  Right now the center(menu) button just overlaps the left side(prev) button.  Here is what I have now:</p><pre><code>&lt;RelativeLayout android:layout_marginTop=""-50dip"" android:gravity=""bottom"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;&lt;Buttonandroid:id=""@+id/previous_button""android:layout_height=""wrap_content""android:layout_width=""110px""android:layout_alignParentLeft=""true"" android:text=""@string/previous""/&gt; &lt;Buttonandroid:id=""@+id/menu""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:scaleType=""center"" android:text=""@string/menu""/&gt; &lt;Buttonandroid:id=""@+id/next_button""android:layout_height=""wrap_content""android:layout_width=""110px""android:layout_alignParentRight=""true""android:text=""@string/next""/&gt;        </code></pre><p></p>","431204","","","","","2010-09-01 19:24:35","How do I center a button between two other buttons?","<android>","1","0","1","",""
"3621249","1","","","2010-09-01 19:00:17","0","1120","<p>I have need to make a sort of ""Pie Chart""-style circular display.  the wedges of the chart have to be touchable, and the whole circle has to be able to spin 360deg..  </p><p>I'm still an android noob, but I'm guessing that I can't do this with a Layout.. right?</p><p>preferably, the wedges would be image assets that I create in Photoshop, and not programmaticaly created</p><p>does anyone have any Idea where to start with this?</p>","420775","","918414","","2012-06-30 04:11:12","2013-02-19 16:27:52","Android: how to make a ""pie Chart"" with touchable wedges And the whole thing can rotate","<android><graphics><touch><rotation>","1","0","","",""
"3621267","1","","","2010-09-01 19:03:05","1","504","<p>Is there a way that when I start my app, it can figure out if any Bluetooth devices are actively connected to the phone?  I want my app to be able to report on an active BT connection by supplying the BT device name.  </p><p>I cannot find anything in the BT API that seems to be able to handle checking sockets for activity and reporting on active devices.  Only seem to be able to track such devices if my app stops all active connections and then tries to establish one while it is running.</p><p>Any help here would be appreciated.</p>","437275","","21234","","2010-09-01 19:16:49","2011-03-17 19:40:07","Android: Identifying active Bluetooth connections","<android><bluetooth>","1","0","","",""
"3621339","1","","","2010-09-01 19:12:42","0","3356","<p>I came across an interesting issue when testing android 2.2. My testing was to use webview api,</p><p>webview.loadUrl(url);</p><p>if url is from any public domain, ex, www.google.com, the web content is rendered very well.(url=""http://www.google.com"")if url is from local host, ex, tomcat with port 8080, the web content is rendered as well.(url=""http://10.123.21.111:8080/MyWeb"")but if url is from other port, ex, websphere with port 9080, the web content is not rendered. (url=""http://10.123.21.111:9080/MyWeb"")there is no exception thrown, and it shows blank on the emulator.</p><p>Is there any setting needed for different port? Anyone can answer this issue?</p><p>Thanks.</p><p>John</p>","437287","","21234","","2010-09-01 19:15:58","2010-10-25 08:12:10","webview loadurl cannot load webpage from localhost web application?","<android><android-webview>","2","1","","",""
"3621475","1","3621735","","2010-09-01 19:30:35","2","317","<p>For some reason when I deserialize my quotes ArrayList, I don't get the right object back. I want to make sure that whenever I read/write my object, it will always be the same object.</p><p>Serialization code:</p><pre><code>private void serializeQuotes(){        FileOutputStream fos;        try {            fos = openFileOutput(Constants.FILENAME, Context.MODE_PRIVATE);            ObjectOutputStream oos = new ObjectOutputStream(fos);            oos.writeObject(quotes);             oos.close();        } catch (FileNotFoundException e) {            e.printStackTrace();        }catch(IOException e){            e.printStackTrace();        }    }    @SuppressWarnings(""unchecked"")    private void deserializeQuotes(){        try{            FileInputStream fis = openFileInput(Constants.FILENAME);            ObjectInputStream ois = new ObjectInputStream(fis);            quotes = (ArrayList&lt;Quote&gt;) ois.readObject();            fis.close();        } catch (FileNotFoundException e) {            e.printStackTrace();        }catch(IOException e){            e.printStackTrace();        }catch(ClassNotFoundException e){            e.printStackTrace();        }    }</code></pre><p>Here is my Quote object</p><pre><code>package org.stocktwits.model;import java.io.Serializable;public class Quote implements Serializable {    private static final long serialVersionUID = 1L;    public String symbol;    public String name;    public String change;    public String percentChange;    public String open;    public String daysHigh;    public String daysLow;    public String volume;    public String peRatio;    public String marketCapitalization;    public String yearHigh;    public String yearLow;    public String lastTradePriceOnly;    public String getSymbol() {        return symbol;    }    public void setSymbol(String symbol) {        this.symbol = symbol;    }    public String getName() {        return name;    }    public void setName(String name) {        this.name = name;    }    public String getChange() {        return change;    }    public void setChange(String change) {        this.change = change;    }    public String getPercentChange() {        return percentChange;    }    public void setPercentChange(String percentChange) {        this.percentChange = percentChange;    }    public String getOpen() {        return open;    }    public void setOpen(String open) {        this.open = open;    }    public String getDaysHigh() {        return daysHigh;    }    public void setDaysHigh(String daysHigh) {        this.daysHigh = daysHigh;    }    public String getDaysLow() {        return daysLow;    }    public void setDaysLow(String daysLow) {        this.daysLow = daysLow;    }    public String getVolume() {        return volume;    }    public void setVolume(String volume) {        this.volume = volume;    }    public String getPeRatio() {        return peRatio;    }    public void setPeRatio(String peRatio) {        this.peRatio = peRatio;    }    public String getMarketCapitalization() {        return marketCapitalization;    }    public void setMarketCapitilization(String marketCapitalization) {        this.marketCapitalization = marketCapitalization;    }    public String getYearHigh() {        return yearHigh;    }    public void setYearHigh(String yearHigh) {        this.yearHigh = yearHigh;    }    public String getYearLow() {        return yearLow;    }    public void setYearLow(String yearLow) {        this.yearLow = yearLow;    }    public String getLastTradePriceOnly() {        return lastTradePriceOnly;    }    public void setLastTradePriceOnly(String lastTradePriceOnly) {        this.lastTradePriceOnly = lastTradePriceOnly;    }    @Override    public int hashCode() {        final int prime = 31;        int result = 1;        result = prime * result + ((change == null) ? 0 : change.hashCode());        result = prime * result                + ((daysHigh == null) ? 0 : daysHigh.hashCode());        result = prime * result + ((daysLow == null) ? 0 : daysLow.hashCode());        result = prime                * result                + ((lastTradePriceOnly == null) ? 0 : lastTradePriceOnly                        .hashCode());        result = prime                * result                + ((marketCapitalization == null) ? 0 : marketCapitalization                        .hashCode());        result = prime * result + ((name == null) ? 0 : name.hashCode());        result = prime * result + ((open == null) ? 0 : open.hashCode());        result = prime * result + ((peRatio == null) ? 0 : peRatio.hashCode());        result = prime * result                + ((percentChange == null) ? 0 : percentChange.hashCode());        result = prime * result + ((symbol == null) ? 0 : symbol.hashCode());        result = prime * result + ((volume == null) ? 0 : volume.hashCode());        result = prime * result                + ((yearHigh == null) ? 0 : yearHigh.hashCode());        result = prime * result + ((yearLow == null) ? 0 : yearLow.hashCode());        return result;    }    @Override    public boolean equals(Object obj) {        if (this == obj)            return true;        if (obj == null)            return false;        if (getClass() != obj.getClass())            return false;        Quote other = (Quote) obj;        if (change == null) {            if (other.change != null)                return false;        } else if (!change.equals(other.change))            return false;        if (daysHigh == null) {            if (other.daysHigh != null)                return false;        } else if (!daysHigh.equals(other.daysHigh))            return false;        if (daysLow == null) {            if (other.daysLow != null)                return false;        } else if (!daysLow.equals(other.daysLow))            return false;        if (lastTradePriceOnly == null) {            if (other.lastTradePriceOnly != null)                return false;        } else if (!lastTradePriceOnly.equals(other.lastTradePriceOnly))            return false;        if (marketCapitalization == null) {            if (other.marketCapitalization != null)                return false;        } else if (!marketCapitalization.equals(other.marketCapitalization))            return false;        if (name == null) {            if (other.name != null)                return false;        } else if (!name.equals(other.name))            return false;        if (open == null) {            if (other.open != null)                return false;        } else if (!open.equals(other.open))            return false;        if (peRatio == null) {            if (other.peRatio != null)                return false;        } else if (!peRatio.equals(other.peRatio))            return false;        if (percentChange == null) {            if (other.percentChange != null)                return false;        } else if (!percentChange.equals(other.percentChange))            return false;        if (symbol == null) {            if (other.symbol != null)                return false;        } else if (!symbol.equals(other.symbol))            return false;        if (volume == null) {            if (other.volume != null)                return false;        } else if (!volume.equals(other.volume))            return false;        if (yearHigh == null) {            if (other.yearHigh != null)                return false;        } else if (!yearHigh.equals(other.yearHigh))            return false;        if (yearLow == null) {            if (other.yearLow != null)                return false;        } else if (!yearLow.equals(other.yearLow))            return false;        return true;    }}</code></pre>","19875","","19875","","2010-09-01 19:42:40","2010-09-01 20:04:53","Am I serializing/deserializing correctly?","<java><android><serialization><arraylist>","1","6","","",""
"3621577","1","3648584","","2010-09-01 19:43:25","0","914","<p>In my app I'm developing, I have a spinner in an alert dialog box.</p><p>The spinner works fine, but when I added the following lines to add the array to the spinner, my app crashing a few seconds after starting up:</p><pre><code>    ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this, R.array.newFileTypeArray, android.R.layout.simple_spinner_item);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    newFileType.setAdapter(adapter);</code></pre><p>What am I doing wrong?</p><p>These Android spinners seem to be a bit complicated as well, I don't think I'll be able to remember how to make them without referencing to the Android docs.</p>","427234","","488657","","2012-10-13 21:28:22","2012-10-13 21:28:22","Problems with creating spinner","<android><spinner><android-arrayadapter>","2","2","","",""
"3621599","1","3623170","","2010-09-01 19:45:20","15","29787","<p>Hey i need to wake my sleeping android device up at a certain time.Any suggestions?</p><p>P.S. Wake up: turn display on and maybe unlock phone</p>","314597","","","","","2014-01-12 12:09:32","Wake Android Device up","<android><wakeup>","5","0","17","",""
"3621749","1","3622139","","2010-09-01 20:06:34","2","1659","<p>I was wondering if it is possible to set the priority of an <code>IntentService</code> like you can with a <code>Thread</code>. So far I have not found anything.</p>","413575","","635608","","2012-05-17 20:56:20","2014-03-17 17:19:48","How to set Priority of IntentService in Android","<android><multithreading><service><thread-priority>","3","0","1","",""
"3621891","1","3621912","","2010-09-01 20:23:51","0","126","<p>The users of my app will purchase any batches of 10 credits.My question is, where should I store the current number of credits?</p><p>My goals are:</p><ul><li>I want to make it not easy to steal</li><li>I want to make it reliable, I don't<br>want users to lose their credits</li><li>I need to tell the user when they runout</li></ul><p>Ideas:</p><ul><li>Store # credits on phone DB</li><li>Store # credits in server database</li><li>Store # credits in a preference</li><li>Store in all places, and double check on each transaction</li><li>Since the transactions will be low volume, write code to detect excessive behaviors or manually check anything suspicious</li></ul><p>I'd like some opinions about how paranoid I should be. Thanks!</p>","108495","","","","","2013-01-25 01:27:53","Where should I store number of credits to minimize stealing on my mobile app?","<android><payment>","2","1","","",""
"3622009","1","","","2010-09-01 20:43:22","0","673","<p>I have a ListActivity that was originally using an ArrayAdapter.  Each item in my ListView contains a checkbox.</p><p>I changed Adapters to a CursorAdapter.  Everything is working fine except checkboxes are out of control.  For example: When I click the checkbox in position 1, the checkbox in position 4 gets checked.  If I click the checkbox in position 1 again, it will check (Ie: When I click the checkbox in position 1, if the checkbox in position 4 is not checked, the checkbox in position 4 will get checked; else, the checkbox in position 1 is checked).  Unchecking checkboxes doesn't seem to show any weird behavior.  Any ideas why?</p><p>Update: It's checking the checkbox backwards based on how many items are on screen.  What I mean is, if there are 5 items visible, clicking the 1st one will check the 5th, clicking the 2nd one with check the 4th, clicking the 3rd one will check the 3rd one.  Also, once one has been checked, they all start behaving properly.</p><p>Apparently commenting out this makes the problem go away:</p><pre><code>    if (holder.chkSelect != null) {        holder.chkSelect.setOnCheckedChangeListener(this);    }</code></pre><p>This definitely has something to do with showMultiPanel popping up and possibly reducing the number of rows that can be seen.  Though I don't understand why it worked fine with an ArrayAdapter.</p><p>Here is a copy of my CursorAdapter</p><pre><code>public class InboxAdapter extends CursorAdapter implements CheckBox.OnCheckedChangeListener {    private int mCheckedCount = 0;    public InboxAdapter(Context context, Cursor c) {        super(context, c);    }    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {        if (buttonView.getId() == R.id.inbox_itemcheck) {            if (isChecked) {                mCheckedCount++;            }            else {                mCheckedCount--;            }            ActivityInbox.this.showMultiPanel((mCheckedCount &gt; 0) ? true : false);        }    }    @Override    public void bindView(View view, Context context, Cursor cursor) {        InboxHolder holder = (InboxHolder)view.getTag();        if (holder.txtDate != null) {            DateFormat df = new SimpleDateFormat(""MM/dd/yyyy"");            Date d = new Date(cursor.getInt(cursor.getColumnIndex(""created_on"")) * 1000L);            holder.txtDate.setText(df.format(d));        }        if (holder.txtSubject != null) {            holder.txtSubject.setText(cursor.getString(cursor.getColumnIndex(""subject"")));            if (cursor.getInt(cursor.getColumnIndex(""read"")) == 0) {                holder.txtSubject.setTypeface(null, Typeface.BOLD);            }            else {                holder.txtSubject.setTypeface(null, Typeface.NORMAL);            }        }        if(holder.txtSummary != null) {            holder.txtSummary.setText(cursor.getString(cursor.getColumnIndex(""summary"")));        }        if (cursor.getInt(cursor.getColumnIndex(""read"")) == 0) {            view.setBackgroundResource(R.drawable.selector_inbox_unread);        }        else {            view.setBackgroundResource(R.drawable.selector_inbox_read);        }        if (holder.lMessageType != null) {            if (cursor.getInt(cursor.getColumnIndex(""read"")) == 0) {                holder.lMessageType.setVisibility(View.VISIBLE);            }            else {                holder.lMessageType.setVisibility(View.INVISIBLE);            }        }    }    @Override    public View newView(Context context, Cursor cursor, ViewGroup parent) {        LayoutInflater inflater = LayoutInflater.from(context);        View v = inflater.inflate(R.layout.layout_inbox_item, parent, false);        InboxHolder holder = new InboxHolder();        holder.txtDate = (TextView) v.findViewById(R.id.inbox_item_date);        holder.txtSubject = (TextView) v.findViewById(R.id.inbox_item_subject);        holder.txtSummary = (TextView) v.findViewById(R.id.inbox_item_summary);        holder.chkSelect = (CheckBox) v.findViewById(R.id.inbox_itemcheck);        holder.lMessageType = (LinearLayout) v.findViewById(R.id.inbox_messagetype);        v.setTag(holder);        if (holder.chkSelect != null) {            holder.chkSelect.setOnCheckedChangeListener(this);        }        return v;    }</code></pre><p>}</p>","406790","","406790","","2010-09-01 20:58:19","2010-09-02 17:21:31","""Whack a checkbox"" game with ListView","<android><listview><checkbox><cursor><listactivity>","1","1","","",""
"3622087","1","","","2010-09-01 20:54:57","1","1359","<p>I'm building an android app that is basicaly a directory of up to 10 local radio.The app should allow the user to listen to any of thosne radios. All i got for those radio i a stream URL (pls/asx,/m3u/mp3).How should i implement the MediaPlayer to stream all those format?</p><p>thansk in advance.</p>","267980","","","","","2010-12-19 08:44:10","Stream mp3/asx/pls/m3u webradio android","<java><android><streaming>","1","0","","",""
"3622184","1","3622487","","2010-09-01 21:09:56","0","2001","<p>I am trying to print Hello + written text in text box (As I posted earlier). Here's the code I have done. But instead of printing Hello+written text, its only printing Hello after clicking the button.</p><p>Any suggestion will be appreciated. Thanks.</p><pre><code>public class myActivity1 extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);      /* // testing add button         setContentView(R.layout.content_layout_id);      */        final TextView nameText= (TextView) findViewById(R.id.entry);          //final TextView tv1 = new TextView(this);        final TextView tv2 = new TextView(this);        tv2.setText(""Hello""+ nameText.getText().toString());        final Button button = (Button) findViewById(R.id.Button01);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                setContentView(tv2);            }        });    }}</code></pre>","400859","","609782","","2012-12-13 10:01:10","2012-12-13 10:01:10","Viewing Dynamic text in Android","<java><android>","2","3","","",""
"3622457","1","3623659","","2010-09-01 22:03:31","0","967","<p>I need to store an retrieve a vector of an unknown number of objects in an android sqlite database.</p><p>Essentially, the setup is this: I am developing a task management app, where the user can add as many notes as they like to their tasks. My current setup uses one database, with one row per task. This presents a problem when I need to associate multiple notes and their associated information with one task. I can see two approaches: try to store an array of notes or a vector or something as a BLOB in the task's row, or have another notes database in which each row contains a note and it's info, as well the id of the task which the note belongs to. This seems a little easier to implement, as all I would have to do to retrieve the data would be to get a cursor of all notes matching a particular id and then iterate through that to display them to the user. However, it seems a little inefficient to have a whole new database just for notes, and it makes syncing and deleting notes a little more difficult as well.</p><p>What do you think? Is it worth it to have a separate notes database? Should I use a BLOB or go for the separate database? If a BLOB, are there any good tutorials out there for storing and retrieving objects as BLOBs?</p>","381299","","135152","","2011-05-25 03:12:19","2011-05-25 03:12:19","store and retrieve Vector in Android sqlite database","<android><sql><database-design>","2","0","1","",""
"3622613","1","3622835","","2010-09-01 22:39:24","0","728","<p>The first time my app loads it starts my main activity, and inside my main activity i automatically start a service:</p><pre><code>Intent s = new Intent(this, Soc.class);startService(s);//start the service for the first time</code></pre><p>I need to make sure that when the user is opening the app NEXT TIME, it kills the old service, and recreate the service:</p><pre><code>@Override//this code is on every activity in my applicationprotected void onRestart(){     super.onRestart();     Intent s = new Intent(this, Soc.class);     stopService(s);     //kill the service     startService(s);     //start a brand new service}</code></pre><p>Is this the correct way of killing a service and renewing the service?</p>","242769","","","","","2010-09-01 23:30:46","Android - How to work with Services?","<android><service>","1","0","","",""
"3622632","1","3622840","","2010-09-01 22:43:01","0","173","<p>I want to pass a value from one Activity to another to update an integer.  So basically I want Activity2 to send Activity1 a value it has garnered from user input.  Seems like it should be simple just not sure how.  Is it possible to run a function from another Activity and give it this value as an argument?</p>","431204","","","","","2010-09-01 23:31:55","Is it possible to use Intent to update a value in another activity?","<android>","1","0","","",""
"3622634","1","3622892","","2010-09-01 22:43:14","1","861","<p>I have a program that displays info based on the day.  Everything has been working fine up till today.  for some reason when have the calendar roll back one day to get yesterdays date it goes straight to august 30th.  it skips august 31st.  It will grab todays date fine (septermber 1st) but when i trace it, it goes right past the 31st.  anyone suggestions on what I'm doing wrong or a better way to do it?  here is my code</p><pre><code>    Calendar date2;    date2 = Calendar.getInstance();    mday1 = date2.get(Calendar.DATE);    date2.roll(Calendar.DATE, false);  //rolls back the date by one day    mday2 = date2.get(Calendar.DATE);</code></pre>","274365","","157882","","2010-09-01 23:46:36","2010-09-01 23:46:36","Calendar skips August 31st on roll(Calendar.DATE, false)","<java><android><calendar>","1","0","","",""
"3622680","1","","","2010-09-01 22:50:27","1","349","<p>I'd like to be able to display a set of image thumbnails and allow the user to long-press, then drag the image to change the order.  I've been looking at the events, and I think there's a way to do this, but it will be painful to code well.  Just wondering if there's a component out there that does it.</p><p>The ""Gallery"" component is also an option.</p>","227313","","","","","2010-09-01 22:50:27","Android: User ordering items a Grid (or other component)","<android><gridview><gallery>","0","0","","",""
"3622687","1","3622696","","2010-09-01 22:52:43","1","157","<p>I'm just curious, who in the world names a class R ? Is there any history behind this convention?</p><p>Thanks,<br />Teja.</p>","116858","","","","","2010-09-01 22:54:49","Why is the generated Android class called R?","<android><android-layout>","1","0","","",""
"3622705","1","","","2010-09-01 22:56:23","0","334","<p>I followed @seanhodges sample of the footer bar (android navigation bar bottom) : <a href=""http://stackoverflow.com/questions/2369975?tab=votes#tab-top"">http://stackoverflow.com/questions/2369975?tab=votes#tab-top</a></p><p>Is it possible to call it from include tag and then access each button at runtime</p><pre><code>&lt;LinearLayout android:layout_alignParentBottom=""true""    android:layout_height=""wrap_content"" android:layout_width=""fill_parent""&gt;     &lt;include  android:id=""@+id/footer"" layout=""@layout/footer"" /&gt; &lt;/LinearLayout&gt;</code></pre><p>when calling it from the include tag, it looks good on the screen.I try reach the buttons at run time but could get it work..</p><p>I know this is not the way but I am looking for something like this... </p><pre><code> Button _BackButton= (Button)findViewById(R.id.footer);_BackButton.setText(""new text""); Button _Backhome= (Button)findViewById(R.id.footer);_Backhome.setText(""new text"");</code></pre><p>can it be done through the -include- tag?</p><p>thanks</p>","1514062","","","","","2011-03-07 01:08:06","Android ,Calling buttons from include tag","<android><android-linearlayout>","1","0","","",""
"3622722","1","3622807","","2010-09-01 23:00:01","0","184","<p>What I did was create two .java files. One that can compile and run on a 1.5 phone (SDK3) and then one that works on 2.0(SDK5) So for this example i'll call the 1.5 file ExampleOld and the new one Example. I was wondering if i just made activity like this if it would work sort of like a ""portal"" and pick the activity to load depending on the SDK so there is no crash or compile errors. Are there any changes I should make to my code? Maybe anyone out there that's had to do this before. thanks!</p><pre><code>package com.my.app;import android.app.Activity;import android.content.Intent;import android.os.Build;import android.os.Bundle;public class ExamplePortal extends Activity {     int sdk=new Integer(Build.VERSION.SDK).intValue();public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);    if (sdk&lt;5) {        Intent v = new Intent(this, ExampleOld.class);        startActivity(v);    }    else {        Intent v = new Intent(this, Example.class);        startActivity(v);    } }}</code></pre>","393373","","","","","2010-09-01 23:24:16","Trying to make a Adapter class to choose .Java file depending on firmware version","<java><android><backwards-compatibility><android-1.5-cupcake>","2","0","2","",""
"3622849","1","3624716","","2010-09-01 23:34:16","1","444","<p>I have a ViewFlipper that contains Layouts.</p><p>Is there a way I can hook up a Class to manage each layout seperately? </p><p>Kind of like <code>setContentView(R.layout.main);</code> but I'm not sure how to reference the 3 different layouts in code.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt;          &lt;ListView android:layout_width=""wrap_content"" android:id=""@+id/ListView"" android:layout_height=""220dp""&gt;&lt;/ListView&gt;          &lt;ViewFlipper android:id=""@+id/ViewFlipper"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;                &lt;LinearLayout android:id=""@+id/LinearLayoutST"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;                      &lt;ImageView android:id=""@+id/ImageView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/icon""&gt;&lt;/ImageView&gt;                &lt;/LinearLayout&gt;                &lt;LinearLayout android:id=""@+id/LinearLayoutChart"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;                      &lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""View 2""&gt;&lt;/TextView&gt;                &lt;/LinearLayout&gt;                &lt;LinearLayout android:id=""@+id/LinearLayoutDetails"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;                      &lt;TextView android:id=""@+id/TextView02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""View 3""&gt;&lt;/TextView&gt;                &lt;/LinearLayout&gt;          &lt;/ViewFlipper&gt;    &lt;/LinearLayout&gt;</code></pre>","19875","","","","","2010-09-02 07:43:30","Can I set a contentView inside of a ViewFlipper?","<java><android><xml><android-linearlayout><viewflipper>","1","0","","",""
"3622859","1","3622986","","2010-09-01 23:36:57","2","1389","<p>I am a complete noob to android but I have been programing c# for a long time. I am writing an android application and have gotten to a point where the c# programmer in me wants to start creating a loosely coupled design and and moving code into different layers, using interfaces, etc. </p><p>But then I stumble upon the <a href=""http://developer.android.com/guide/practices/design/performance.html"" rel=""nofollow"">Designing for performance</a> guidelines it is telling me to <strong>avoid object creation</strong> and then it also is saying to <strong>optimize judicially</strong>. </p><p>Do I just build based on good design and then deal with performance issues as they come up? </p><p>The last thing I want to do is go through the work of building a application and have it perform poorly. <strong>Can someone point me to some examples of application that are designed well and have good performance or just make some recommendations?</strong> </p><p>Thanks</p>","86452","","","","","2010-09-02 02:17:35","android, object oriented programing vs designing for performance","<android><performance><design><oop><architecture>","3","1","1","",""
"3622874","1","3624641","","2010-09-01 23:39:32","2","2499","<p>I don't get the Android Intent matching concept! I must be missing something, but I read and re-read the docs and don't get it. Maybe some kind soul can shed some light on this? </p><p>I am able to start an Activity if I specify a Category filter <code>android.intent.category.DEFAULT</code> in the manifest:</p><pre><code>    ...    &lt;activity         android:name=""mmmo.android.test.ItemDetails""        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.INSERT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    ...</code></pre><p>and if I then don't add any Category to the Intent object:</p><pre><code>        ...        Intent intent = new Intent(Intent.ACTION_INSERT);        startActivity(intent);        ...</code></pre><p>That works. However, as soon as I define any other category than <code>android.intent.category.DEFAULT</code> I am only getting <code>ActivityNotFoundException</code>s. E.g. if I specify:</p><pre><code>    ...    &lt;activity         android:name=""mmmo.android.test.ItemDetails""        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.INSERT"" /&gt;                    &lt;category android:name=""foo.bar"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    ...</code></pre><p>and then try to start that Activity using:</p><pre><code>        ...        Intent intent = new Intent(Intent.ACTION_INSERT);        intent.addCategory(""foo.bar"");         startActivity(intent);        ...</code></pre><p>this does not work. The doc reads ""... every category in the Intent object must match a category in the filter. ..."". The category name I add to the Intent matches the category I specified in the filter. So why does this not match up and just throws an exception???</p><p>Michael</p>","423411","","844882","","2012-03-21 05:12:59","2012-03-21 05:12:59","How are Intent-Categories matched?","<android>","2","0","2","",""
"3622966","1","","","2010-09-02 00:01:47","2","1336","<p>Running Ubuntu Lucid, 32-bit. Eclipse Galileo with Android SDK Tools installed.</p><p>After setting up an Android Virtual Device in the Android SDK and AVD Manager:</p><pre><code>Name         Target Name      Platform   API LevelTestDevice   Android 2.2      2.2        8</code></pre><p>...clicking the Start... button does nothing--no errors anywhere, no sounds, no window or dialog anywhere, nothing at all.</p><p>I've spent the last hour creating, trying, deleting devices and Googling. I can't find anything anywhere about a problem of the start button not working on Linux.</p><p>Note that the emulator will start if I simply right-click on an Android project, and choose Run As, then Android Application.</p><p>I've done this successfully on Windows for the last month+; I'm a Linux guy and decided to attempt to maintain a parallel development environment there rather than condemn myself to Windows-dependence.</p><p>Any comment would be appreciated.</p><p>Thanks,</p><p>Russ</p>","339736","","339736","","2010-09-02 00:35:50","2011-02-28 22:17:01","AVD (emulator) won't start on Linux","<android><android-emulator><android-sdk-2.2>","1","0","","",""
"3623137","1","","","2010-09-02 00:57:52","2","7314","<p>I am trying to intercept mailto: links in an embedded webview in my app.  What I have is working ok, except when the user presses the link it is blurred upon returning to the app.  Here is what I am doing in my WebViewClient</p><pre><code>    @Overridepublic boolean shouldOverrideUrlLoading(WebView view, String url) {    if(url.startsWith(""mailto:"")){        url = url.replaceFirst(""mailto:"", """");        url = url.trim();        Intent i = new Intent(Intent.ACTION_SEND);        i.setType(""plain/text"").putExtra(Intent.EXTRA_EMAIL, new String[]{url});        context.startActivity(i);        return true;    }    context.findViewById(R.id.loadingBar).setVisibility(View.VISIBLE);    view.loadUrl(url);    return true;}</code></pre><p>If I do a view.reload() it does fix the problem, but is there a better way to fix it without wasting the bandwidth?  I tried invalidate() but it didn't work. </p><p>here is an example of what I'm talking about <img src=""http://i.stack.imgur.com/PsqPK.jpg"" alt=""alt text""></p>","384306","","384306","","2010-09-02 06:54:53","2013-11-11 15:55:52","howto handle mailto: in android webview","<android><android-webview>","3","2","","",""
"3623143","1","3714848","","2010-09-02 00:59:24","14","15533","<p>Has anyone gotten Multicast to work on Android 2.2, specifically JmDNS for Bonjour service detection.  There are many questions &amp; answers from the Android 1.5->2.0 timeframe, including on stackOverflow, that indicate varying levels of success, and a bug in the bug tracker that indicate it was fixed, and closed, for 2.2 (<a href=""http://code.google.com/p/android/issues/detail?id=2323"">http://code.google.com/p/android/issues/detail?id=2323</a>) .  I've tried the ""TuneControl"" source code, but that worked on ~1.5 and has not been updated, and does not work for me on 2.2.</p><p>So, the questions...1) Has <em>anyone</em> seen multicast work on 2.2, specifically JmDNS, and specifically for Bonjour service detection?</p><p>2)  What is necessary in code to make this work?</p><p>I'm using the appropriate permissions:</p><p><code>&lt;uses-permission android:name=""android.permission.CHANGE_WIFI_MULTICAST_STATE"" /&gt;</code></p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""/&gt;&lt;uses-permission android:name=""android.permission.ACCESS_WIFI_STATE""/&gt;</code></pre><p>I acquire the multicast lock:</p><pre><code>WifiManager wifi = (WifiManager)getSystemService( Context.WIFI_SERVICE );if(wifi != null){    MulticastLock mcLock = wifi.createMulticastLock(""mylock"");    mcLock.acquire();...</code></pre><p>And then try to start jmDNS to look for servers:</p><pre><code>    mdns = JmDNS.create(addr, HOSTNAME);    jmdns.addServiceListener(TOUCH_ABLE_TYPE, listener);    jmdns.addServiceListener(DACP_TYPE, listener);    ...</code></pre><p>The listener never sees any services.  I've verified using Wireshark that the request packets are sent, and that the server responds, but the response packet are never seen by the socket listener code in the jmDNS library.</p><p>So... am I missing something?  Is this still a bug?  Has ANYONE gotten anything even remotely like this to work???</p>","437485","","","","","2012-07-13 02:29:00","Multicast on Android 2.2","<android><multicast><jmdns>","3","0","10","",""
"3623319","1","3624098","","2010-09-02 01:52:11","1","1021","<p>Is it possible to create/push-onto-stack a new Activity of the same main Activity in an Android application with an argument passed to the Activities constructor? Specifically from a Dialog object...</p>","291059","","291059","","2010-09-02 01:57:25","2010-09-02 05:36:44","Android push new instance of main Activity?","<android>","1","0","1","",""
"3623330","1","4286577","","2010-09-02 01:54:54","4","3985","<p>I am looking for an Android open source Calendar control which displays the full month in a grid, much like a real printed-on-paper calendar. It's for an app to show special days.</p><p>Like this from my iPhone version we are porting:</p><p><img src=""http://i.stack.imgur.com/CF6GB.jpg"" alt=""alt text""></p>","172861","","","","","2011-03-09 19:19:39","Android Calendar ""Grid of Dates""","<android><controls><calendar>","1","0","","",""
"3623360","1","","","2010-09-02 02:01:56","1","682","<p>I am just getting started with Android programming, and I have implemented a <strong>very</strong> simple remote service.  I am able to bind to my service from other processes and send simple ""ping"" and ""pong"" messages back and forth.  (I am not using AIDL, stubs, etc.  I am just passing <code>Messages</code> and using the <code>what</code> field.)</p><p>I am now investigating permissions, and I've run into a problem.  In my <code>onBind()</code> method, <code>checkCallingPermission()</code> is always returning <code>PERMISSION_DENIED</code>, even though the calling process does have the permission in question (verified by calling <code>checkCallingOrSelfPermission()</code> in that process).  I suspect that this is happening because <code>Binder.getCallingUid()</code> is returning the PID of the server process, rather than the caller.</p><p>Any idea what I might be doing wrong?  <code>checkCallingPermission()</code> is supposed to work this way in a service's <code>onBind()</code> method, right?</p><p>Thanks!</p>","437515","","","","","2011-01-12 17:20:49","getCallingPid() returning my PID in onBind()","<android>","1","0","","",""
"3623505","1","","","2010-09-02 02:41:35","1","906","<p>I want to make an app that downloads a specific MP3 file, allow the user to crop/trim it and re-upload it back to our server. How can I trim MP3 files inside my app ? Do I need to achieve this in C and then port it/use NDK ? If MP3 is tough, I can switch over to other easy formats too.</p><p>Will be great if anyone can show me the right path. </p>","406295","","","","","2012-10-19 12:19:23","How to make an Android app that can edit MP3 files?","<android><mp3><edit>","3","1","","",""
"3623586","1","3629081","","2010-09-02 03:04:53","0","235","<p>I have an application that must create a database and if that fails, then no sense moving forward.  I've built an AlertDialog and show() it but it never displays.  The logic falls through and then barfs because of the missing database.</p><p>What is the right/best way to throw up a message and halt the activity?  The code below executes fine (meaning the show() occurs while debugging and it falls to the next line) but the UI never displays this alert.  BTW - I realize the throw might not be the most graceful but I'm not even getting that far so... B^)</p><pre><code> try {</code></pre><p>myDBHelp.createDataBase();  } catch (IOException ioe) {</p><p>new AlertDialog.Builder(this).setCancelable(false)    .setMessage(ioe.getMessage())    .setTitle(""Database Create Failed"")    .setPositiveButton(""Quit"", new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int which) {              throw new Error(""Unable to create database - please try uninstall/reinstall"");</p><pre><code>         }         }).show();</code></pre>","407261","","","","","2010-09-02 16:21:50","What is the best way to stop an activity and alert the user?","<android><terminate><alertdialog>","2","0","","",""
"3623603","1","","","2010-09-02 03:11:22","1","1995","<p>I'm having trouble with the <code>IMediaPlaybackService</code> for Android.  I'm told that all I need to do is place it into its package (in this case, <code>com.android.music</code>), however I can't get my project to build when I do this.  The code for IMediaPlaybackService is as follows:</p><pre><code>/* //device/samples/SampleCode/src/com/android/samples/app/RemoteServiceInterface.java**** Copyright 2007, The Android Open Source Project**** Licensed under the Apache License, Version 2.0 (the ""License""); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ****     http://www.apache.org/licenses/LICENSE-2.0 **** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an ""AS IS"" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License.*/package com.android.music;interface IMediaPlaybackService{    void openFile(String path, boolean oneShot);    void openFileAsync(String path);    void open(in long [] list, int position);    int getQueuePosition();    boolean isPlaying();    void stop();    void pause();    void play();    void prev();    void next();    long duration();    long position();    long seek(long pos);    String getTrackName();    String getAlbumName();    long getAlbumId();    String getArtistName();    long getArtistId();    void enqueue(in long [] list, int action);    long [] getQueue();    void moveQueueItem(int from, int to);    void setQueuePosition(int index);    String getPath();    long getAudioId();    void setShuffleMode(int shufflemode);    int getShuffleMode();    int removeTracks(int first, int last);    int removeTrack(long id);    void setRepeatMode(int repeatmode);    int getRepeatMode();    int getMediaMountedCount();}</code></pre><p>However there appear to be several problems that prevent me from building my project with this file:</p><ul><li>The ""in"" keywords are causing Eclipse to give an error.  The exact error is: <code>Syntax error on token ""long"", delete this token.</code>  I'm not sure why there are ""in"" keywords there.  They don't appear to be keywords in Java, what are they?</li><li>Another error that occurs is <code>The type com.android.music.IMediaPlaybackService is not visible</code>, which is remedied by making the interface public.</li><li>The final error is <code>Stub cannot be resolved or is not a field.</code> when I execute this line of code: <code>this.mService = IMediaPlaybackService.Stub.asInterface(service);</code> because there is not a Stub in IMediaPlaybackService.</li></ul><p>Others seem to have been able to overcome these problems with ease, so what am I missing?  It's probably something simple that I'm not seeing, but I've been wrestling with this for longer than I should have.  Do I need to mess with my project setup?</p><p>Thanks in advance!</p><p>Regards, celestialorb.</p><p>EDIT:</p><p>So I've been able to build my project, but now I'm having issues with the service itself.  Here is the code for my MediaPlayerServiceConnection class:</p><pre><code>import android.content.ComponentName;import android.content.ServiceConnection;import android.os.IBinder;import android.os.RemoteException;import android.util.Log;import com.android.music.IMediaPlaybackService;public class MediaPlayerServiceConnection implements ServiceConnection {    //  Tag for debugging.    private static final String TAG = ""MediaPlayerServiceConnection"";    //  The service.    private IMediaPlaybackService mService;    @Override    public void onServiceConnected(ComponentName name, IBinder service) {        Log.i(TAG, ""MediaPlaybackService is connected!  Name: "" + name.getClassName());        //  This is the important line.        this.mService = IMediaPlaybackService.Stub.asInterface(service);        //  If all went well, then we can use the interface.        try {            Log.i(TAG, ""Current track: "" + this.mService.getTrackName());            Log.i(TAG, ""Artist: "" + this.mService.getArtistName());        } catch(RemoteException e) { e.printStackTrace(); }    }    @Override    public void onServiceDisconnected(ComponentName name) {        Log.i(TAG, ""MediaPlaybackService disconnected!"");    }}</code></pre><p>...and here is the code in my activity that binds the service, but the onServiceConnected method is not being called, am I incorrectly trying to use the service?</p><pre><code>//  TESTING MEDIAPLAYBACK SERVICEIntent intent = new Intent();intent.setClassName(""com.android.music"", ""com.android.music.MediaPlaybackService"");MediaPlayerServiceConnection conn = new MediaPlayerServiceConnection();this.bindService(intent, conn, Context.BIND_AUTO_CREATE);//  END TEST</code></pre>","384386","","384386","","2010-09-02 06:25:35","2011-03-04 08:21:59","Setting up the IMediaPlaybackService for Android","<android><service><music><playback>","1","2","1","",""
"3623641","1","3623676","","2010-09-02 03:29:52","2","586","<p>I've a simple service that several of my activities need to access. The standard approach seems to be:</p><ol><li>Create ServiceConnection to specify what to do after binding [with the service object]</li><li>call bindService with ServiceConnection</li></ol><p>But that requires calling bindService at least once per activity. What if I call bindService exactly once, store the service object globally to allow for different activities to access it?</p><p>Is this bad practice? Why?</p>","70488","","","","","2010-09-02 03:42:56","Accessing Android Service Through Global Object","<android><android-service>","1","0","1","",""
"3623704","1","3623778","","2010-09-02 03:50:45","2","8904","<p>I have 3 activities in my application:</p><pre><code>Activity1 -&gt; Activity2 -&gt; Activity3</code></pre><p>Inside Activity3, if the user presses Back, I would like to return to Activity2.  In Activity3's onPause event, I added a <code>finish()</code> statement.  That's probably not even necessary, but I wanted to make sure this Activity gets cleaned up.  This works fine.</p><p>However, while in Activity3, if the user presses Home or starts a new app (through notification bar or some other means), I want both Activity3 and Activity2 to finish.  If the user returns to this app, he should resume with Activity1.</p><p>I have figured out how to do one or the other, but I can't figure out how to handle both cases, if it's even possible.  Can I trap the ""Back"" button in Activity3 and send a message back to Activity2 telling it not to <code>finish()</code>?  It seems like the Activities follow the same lifecycle flow (Pause, Stop) regardless of what you do to send them to the background.</p><p>Just to answer the question of why I want this behavior, imagine that <code>Activity1</code> is a login screen, <code>Activity2</code> is a selection screen, and <code>Activity3</code> is a content screen.  If I press Back from the content page, I want to be able to make a new selection.  If I exit via any other means (Home, notification bar), I want the user to be <code>""logged out""</code>.</p><p>Thanks in advance for your help.</p>","434574","","1139398","","2012-09-05 07:07:36","2012-09-05 07:07:36","How to control Activity flow - Back button versus Home button","<android><activity><android-intent>","4","0","4","",""
"3623779","1","","","2010-09-02 04:16:29","3","989","<p>I am new to android, and ended up (have to) ask a question here,</p><p>Let's make it simple, I simply want to make my own TextView-like(MyView extends View),</p><p>this is my code:</p><pre><code>public class MyView extends View {    private Paint mPaint;    private String mText;    private Bitmap mBitmap1;    private Bitmap mBitmap2;    public MyView(Context context) {        super(context);        initView();    }public MyView(Context context, AttributeSet attrs) {    super(context, attrs);    initView();}private final void initView() {    mPaint = new Paint();}public void setText(String text) {    mText = text;}@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {    int measuredWidth = measureWidth(widthMeasureSpec);    if (mBitmap1 == null) initBitmap1(measuredWidth);    int measuredHeight = measureHeight(heightMeasureSpec);    setMeasuredDimension(measuredWidth, measuredHeight);}private void initBitmap1(int measuredWidth) {    mBitmap1 = Bitmap.createBitmap(measuredWidth, Fonts.getHeight(), Bitmap.Config.ARGB_4444);    Canvas canvas = new Canvas(mBitmap1 );    canvas.drawText(mText, 0, 0, mPaint);}private void initBitmap2() {    mBitmap2 = Bitmap.createBitmap(30, Fonts.getHeight(), Bitmap.Config.ARGB_4444);    Canvas canvas = new Canvas(mBitmap2);    canvas.drawText(mText, 0, 0, mPaint);}private int measureWidth(int widthMeasureSpec) {    int measuredWidth = 0;    int specWidthMode = MeasureSpec.getMode(widthMeasureSpec);    int specWidthSize = MeasureSpec.getSize(widthMeasureSpec);    if (specWidthMode == MeasureSpec.EXACTLY) {        measuredWidth = specWidthSize;    } else {        measuredWidth = getWidth();        if (specWidthMode == MeasureSpec.AT_MOST) {            measuredWidth = Math.min(measuredWidth, specWidthSize);        }    }    return measuredWidth;}private int measureHeight(int heightMeasureSpec) {    int measuredHeight = 0;    int specHeightMode = MeasureSpec.getMode(heightMeasureSpec);    int specHeightSize = MeasureSpec.getSize(heightMeasureSpec);    if (specHeightMode == MeasureSpec.EXACTLY) {        measuredHeight = specHeightSize;    } else {        measuredHeight = 80;        if (specHeightMode == MeasureSpec.AT_MOST) {            measuredHeight = Math.min(measuredHeight, specHeightSize);        }    }    return measuredHeight;}@Overrideprotected void onDraw(Canvas canvas) {   super.onDraw(canvas);   canvas.drawBitmap(mBitmap1, getLeft(), 0, mPaint);   initBitmap2();   canvas.drawBitmap(mBitmap2, getLeft(), 30, mPaint);}</code></pre><p>}</p><p>in my code, i populate some numbers of MyView (let's say 20) in aListActivity</p><p>my question is why mBitmap1's order changes randomly while i scroll(up-down) fastly (if i scroll slowly, this problem not occur)..?</p><p>mBitmap2 stays where those should be..</p>","428005","","","","","2010-09-08 03:20:18","List Item (a view) order changes unexpextedly while (fast) scrolling in a ListView","<android><listactivity><custom-view>","0","2","2","",""
"3623830","1","","","2010-09-02 04:30:25","0","471","<p>Do  android sdk supports opening the Mic to lock in a audio signal which would cause the app to trigger a function.</p>","363151","","","","","2011-03-23 23:46:43","Android - locking mic to audio signal","<android>","1","0","","",""
"3624091","1","","","2010-09-02 05:35:35","1","149","<p>Alright, this might be kinda simple, but I cannot figure out how to do this. How can I change this function to return the <code>String class_name</code>? I know that I need to change the function from <code>void</code> to <code>String</code>, but what else do I need to do?</p><p>Much appreciated!</p><pre><code>public void addClass() {    AlertDialog.Builder alert = new AlertDialog.Builder(this);      alert.setTitle(""Add Class"");    final EditText input = new EditText(this);      alert.setView(input);      alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int whichButton) {              String class_name = input.getText().toString();        }      });      alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int whichButton) {          }      });      alert.show();}</code></pre>","362857","","","","","2010-09-02 06:06:56","Returning through multiple functions","<java><android>","4","0","","",""
"3624111","1","","","2010-09-02 05:40:20","1","1419","<p>Ok well, I need help adding settings to choose which texture to show - you should be able to tell what I mean because there are already two set up. I have the gui for the settings set up along with the activity I just can't figure out how to implement it. If you can help me I'll credit you in the app in the settings and the market post. Along with your name, website or, whatever on my youtube channel in a video. Which can be found here, <a href=""http://youtube.com/motodroidhelpandinfo"" rel=""nofollow"">youtube.com/motodroidhelpandinfo</a>. I have over 1,200 subscribers. Thanks in advance.</p><p>Here's my preference Activity:</p><pre><code>package quotesandothers.livewallpaper.quotesandothers;import android.content.SharedPreferences;import android.os.Bundle;import android.preference.PreferenceActivity;public class Settings extends PreferenceActivity implements        SharedPreferences.OnSharedPreferenceChangeListener {    @Override    protected void onCreate(Bundle icicle) {        super.onCreate(icicle);        getPreferenceManager().setSharedPreferencesName(                livewallpaper.PREFERENCES);        addPreferencesFromResource(R.xml.wallpaper_settings);        getPreferenceManager().getSharedPreferences()                .registerOnSharedPreferenceChangeListener(this);    }    @Override    protected void onResume() {        super.onResume();    }    @Override    protected void onDestroy() {        getPreferenceManager().getSharedPreferences()                .unregisterOnSharedPreferenceChangeListener(this);        super.onDestroy();    }    @Override    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,            String key) {}}</code></pre><p>And here's my attempt at implementing it in the main activity. Note I couldn't fit in the whole Activity just what is relevant. Also I want the setting to change between the to textures that you can see. Also I use andengine.org as the backbone.</p><pre><code>@Overridepublic void onLoadResources() {    preferences = PreferenceManager.getDefaultSharedPreferences(this);    preferences.registerOnSharedPreferenceChangeListener(this);    this.mTexture = new Texture(2048, 2048, TextureOptions.DEFAULT);    this.mParallaxLayerMid1 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxMotivationalTexture, this, ""gfx/middle1.png"",            0, 320);    this.mParallaxLayerTop = TextureRegionFactory.createFromAsset(            this.mAutoParallaxMotivationalTexture, this, ""gfx/top.png"", 0,            0);    this.mParallaxLayerTop2 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxMotivationalTexture, this, ""gfx/top2.png"", 0,            173);    this.mParallaxLayerMid2 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxMotivationalTexture, this, ""gfx/middle2.png"",            0, 450);    this.mParallaxLayerLow1 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxMotivationalTexture, this, ""gfx/lower1.png"",            200, 574);    this.mParallaxLayerLow2 = TextureRegionFactory.createFromAsset(            this.mAutoParallaxMotivationalTexture, this, ""gfx/lower2.png"",            0, 740);    this.mEngine.getTextureManager().loadTextures(this.mTexture,            this.mAutoParallaxMotivationalTexture);    this.mTexture = new Texture(2048, 2048, TextureOptions.DEFAULT);    this.mParallaxLayerTopInspired = TextureRegionFactory.createFromAsset(            this.mAutoParallaxInspirationalTexture, this,            ""gfx/topinspired.png"", 0, 0);}public void OnSharedPreferenceChanged(SharedPreferences prefs, String key) {}</code></pre>","435285","","281545","","2013-03-24 18:42:50","2013-03-24 18:42:50","Implement preferences using SharedPreference, For Android Live Wallpaper","<java><c++><android><wallpaper>","1","1","1","",""
"3624144","1","","","2010-09-02 05:48:04","1","716","<p>i need to know to how add a new custom action button exactly at the lefthand corner of my soft keyboard...so once i tap on the ok(my custom button name), it should force the softkeyboard to hide.</p><p>if possible please provide me with some reference..</p><p>Thanks in advance..</p>","384193","","","","","2011-03-06 15:19:40","android: Adding a Custom action button in the softkeybord","<android><keyboard>","1","0","1","","2010-09-02 05:48:53"
"3624171","1","3629454","","2010-09-02 05:55:58","4","12110","<p>Following is my html content which i want to show in the webview using android sdk. It will displays only</p><blockquote>  <p>//Please</p></blockquote><p>But when I put this HTML content into the browser then it shows differently.</p><pre><code>&lt;br /&gt;&lt;br /&gt;Read the handouts please for tomorrow.&lt;br /&gt;&lt;br /&gt;&lt;!--homework help homeworkhelp help with homework homework assignments elementary school high school middle school// --&gt;&lt;font color=""#60c000"" size=""4""&gt;&lt;strong&gt;Please!&lt;/strong&gt;&lt;/font&gt;</code></pre><p>Please suggest how to resolve this problem</p><p>I have another problem that in HTML content there is a tag </p><pre><code>&lt;img src=""http://www.homeworknow.com/hwnow/upload/images/tn_star300.gif"" border=""0"" /&gt;</code></pre><p>in this images does not shows.</p>","339116","","694652","","2012-05-10 10:21:31","2012-05-10 10:21:31","how to show the html contents to the webview using android","<html><android><android-webview>","3","2","3","",""
"3624212","1","","","2010-09-02 06:07:00","0","543","<p>i'm make example parsing xml from </p><pre><code>http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser/</code></pre><p>in this example, layout using an array textview..</p><p>I tried to change the layout into a ListView, but is not working..</p><p>I get error in adapter.. can anyone help me?</p>","430280","","","","","2011-07-28 05:52:18","Layout Parsing Xml","<android><xml><parsing><listview>","1","0","","",""
"3624214","1","","","2010-09-02 06:07:21","0","431","<p>Hi Anyone please help me solve my problem. i want to create a contact list application in my android    phone.i want to  retrieve all the contact list from emulator and the contacts should be listed.so  please help me in this . Thanks in advance </p><p>RegardsRevathy</p>","244540","","","","","2010-09-02 06:29:19","How to retreive contacts from emulator to my application in android?","<android>","1","0","","",""
"3624280","1","3624358","","2010-09-02 06:26:52","135","173449","<p>I want to store a time value and need to retrieve and edit it. Can somebody guide me here with a sample code/project please?</p>","2355649","","1017893","","2013-07-24 05:28:56","2014-03-27 17:32:16","How to use SharedPreferences in Android to store, fetch and edit values","<android><sharedpreferences>","11","1","67","",""
"3624297","1","","","2010-09-02 06:30:13","15","2548","<p>I am using a TextView for which I have set autolink=""web"" property in XML file. I have also implemented the onClickListener for this TextView. The problem is, when the text in TextView contains a hyperlink, and if I touch that link, the link opens in browser but simultaneously the onClickListener triggers too.  I don't want that.</p><p>What I want is, if I touch the hyperlink the clickListener should not fire. It should only fire if I touch the part of the text that is not hyperlinked. Any suggestion?</p>","278194","","","","","2014-02-18 17:12:19","Control onclicklistener in autolink enabled textview","<android>","5","2","3","",""
"3624324","1","3624517","","2010-09-02 06:36:19","0","284","<p>develop android apps that should support iphone,ipad,android.is there any way for developing this kind of generic app or we need to develop aps depending on mobile os</p>","1746300","","","","","2010-09-07 11:10:02","support iphone,ipad,android","<iphone><android><ipad>","6","0","","",""
"3624352","1","3624401","","2010-09-02 06:41:22","0","935","<p>I have a binary file which contains image.i have to jump on different locations in file to read the image file. So far i am using mark and reset methods but these are not helping me as i want.please somebody help me about that i,ll be really thankful.and i am using Input Stream to read the file.</p>","397901","","397901","","2010-09-02 06:51:03","2012-08-07 19:04:47","jump on specific location in binary file","<java><android><file-io>","2","1","","",""
"3624410","1","","","2010-09-02 06:52:12","3","739","<p>Does SoftKeyBoard support the Indian Languages(Hindi,Tamil,Telugu,etc) in Android? The packages <a href=""http://developer.android.com/reference/java/util/Locale.html"" rel=""nofollow"">Locale</a> and <a href=""http://developer.android.com/reference/java/lang/Character.UnicodeBlock.html"" rel=""nofollow"">UnicodeBlock</a> are used for the Fonts. But how to integrate the Custom IME in it? the <a href=""http://developer.android.com/resources/articles/on-screen-inputs.html"" rel=""nofollow"">sample</a> in the developer site is not enough.   </p><p>Can you share some idea or tutorials?</p>","267269","","469983","","2013-03-07 10:07:36","2013-03-07 10:07:36","Custom SoftKeyBoard in Android?","<android><android-softkeyboard><tamil><input-language>","1","0","","",""
"3624424","1","3684592","","2010-09-02 06:54:30","1","1893","<p>I am using twitter4j-2.1.3.jar to make a simple post to twitter. The code I use is:</p><pre><code>System.setProperty(""twitter4j.oauth.consumerKey"", TWITTER_CONSUMER_KEY);System.setProperty(""twitter4j.oauth.consumerSecret"",TWITTER_SECRET_KEY); Twitter twitter = new TwitterFactory().getInstance(username,password);AccessToken accessToken = twitter.getOAuthAccessToken();twitter.updateStatus("": xAuth test"");</code></pre><p>The error message I get is:</p><pre><code> TwitterException{exceptionCode=[e07c50ee-0000d883 1ac06e3f-626a1296], statusCode=401,   retryAfter=0, rateLimitStatus=null, version=2.1.3}   at twitter4j.http.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:185)   at twitter4j.TwitterOAuthSupportBaseImpl.getOAuthAccessToken(TwitterOAuthSupportBaseImpl.java:108)   at twitter4j.Twitter.getOAuthAccessToken(Twitter.java:54)   at com.sfway.detailpage.CheckinTab$16$1.run(CheckinTab.java:640)   TwitterException{exceptionCode=[1ac06e3f-626a1296], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.3}   at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:307)   at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:72)   at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:103)   at twitter4j.http.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:178)</code></pre><p>I tried an other way like this:</p><pre><code>ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();configurationBuilder.setOAuthConsumerKey(TWITTER_CONSUMER_KEY); configurationBuilder.setOAuthConsumerSecret(TWITTER_SECRET_KEY);Configuration configuration = configurationBuilder.build();twitter = new TwitterFactory(configuration).getInstance(username,password);AccessToken token = twitter.getOAuthAccessToken();twitter.updateStatus("": xAuth test"");</code></pre><p>In both methods I get the error at ""twitter.getOAuthAccessToken()"" line. Please let me know what is the wrong. I have registered my app exactly 14 hrs before, to get the secret and consumer key. Is this something to do with approval of my app for xAuth use, if yes how can I know whether they have enabled XAuth for my application at Twitter.</p>","286044","","50846","","2010-09-16 08:47:03","2010-09-16 08:48:31","TwitterException with xAuth while posting from Android using Twitter4j","<android><twitter-api><twitter4j><xauth>","4","0","","",""
"3624572","1","","","2010-09-02 07:18:55","0","1497","<p>Just found out that I don't need content providers if I don't need to share data with other applications.  But since the examples I've seen all use content providers, I'm not sure how to proceed without them and populate activities with data derived from accessing my application's database directly.</p>","369722","","","","","2013-08-01 19:25:19","Examples of android applications that use direct database access instead of content providers?","<android><database><provider><android-contentprovider>","3","2","1","",""
"3624607","1","3625415","","2010-09-02 07:24:13","0","1295","<p>I am developing an Android application and I access a RESTfull web service that returns a JSON. This JSON I want to put it in POJOs but I think I am missing something as it doesn't work.</p><p>The JSON retuned is as follow:</p><p>[{""CategoryName"":""Food"",""Id"":1},{""CategoryName"":""Car"",""Id"":2},{""CategoryName"":""House"",""Id"":3},{""CategoryName"":""Work"",""Id"":4}]</p><p>this is returned in response variable </p><pre><code>  String response = client.getResponse();</code></pre><p>And now I try the following:</p><pre><code>GsonBuilder gsonb = new GsonBuilder();Gson gson = gsonb.create();JSONObject j;MainCategories cats = null;try{    j = new JSONObject(response);    cats = gson.fromJson(j.toString(), MainCategories.class);}catch(Exception e){    e.printStackTrace();}</code></pre><p>The error I get is:</p><blockquote>  <p>09-02 07:06:47.009:  WARN/System.err(568):  org.json.JSONException: Value  [{""Id"":1,""CategoryName"":""Food""},{""Id"":2,""CategoryName"":""Car""},{""Id"":3,""CategoryName"":""House""},{""Id"":4,""CategoryName"":""Work""}]  of type org.json.JSONArray cannot be  converted to JSONObject  09-02 07:06:47.029:  WARN/System.err(568):     at  org.json.JSON.typeMismatch(JSON.java:107)</p></blockquote><p>Here are the POJO objectsMainCategories.java</p><pre><code>public class MainCategories { private List&lt;CategoryInfo&gt; category; public List&lt;CategoryInfo&gt; getCategory() {     if (category == null) {         category = new ArrayList&lt;CategoryInfo&gt;();     }     return this.category; }}</code></pre><p>CategoryInfo.java</p><pre><code>public class CategoryInfo { public String categoryName; public Integer id; public String getCategoryName() {     return categoryName; } public void setCategoryName(String value) {     this.categoryName = ((String) value); } public Integer getId() {     return id; } public void setId(Integer value) {     this.id = value; }}</code></pre><p>To access the web service I use the class from: <a href=""http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/"" rel=""nofollow"">http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/</a></p><p>Please help me as I am stuck for 2 days now and can't figure out how to continue. I found some subjects here but still didn't found a way around. Thank you very much.</p>","379865","","","","","2010-09-02 08:51:56","gson to POJO object, not working properly","<android><pojo><gson>","1","0","","",""
"3624752","1","","","2010-09-02 07:49:28","0","959","<p>I'm begginer in android, How to play beep sound when charecter limit exceeds in edittext, i have tried by Setting addTextChangeListener but it wont get event after limit exceed so cant play sound and onKeylistener is only works on physicle keys so please give me any hints to solve the problem.</p><p>This is my code</p><p>private EditText editTextBox;    private MediaPlayer mMediaPlayer;    private int len;    private int limit = 10;</p><pre><code>public void onCreate(Bundle icicle) {    super.onCreate(icicle);    // setContentView(new EditText(this));    setContentView(R.layout.main);    editTextBox = (EditText) findViewById(R.id.EditTextBox);    editTextBox.addTextChangedListener(new TextWatcher() {        public void onTextChanged(CharSequence s, int start, int before,                int count) {            if (s.length() &gt; 10) {                playAudio();            }            if (s.length() == limit) {                len = limit + 1;            } else {                len = s.length();            }            Log.e(""beep"", ""onTextChanged"" + "" "" + count);        }        public void beforeTextChanged(CharSequence s, int start, int count,                int after) {            Log.e(""beep"", ""beforeTextChanged"");        }        public void afterTextChanged(Editable s) {            Log.e(""beep"", ""afterTextChanged"");        }    });    editTextBox.setOnKeyListener(new OnKeyListener() {        public boolean onKey(View v, int keyCode, KeyEvent event) {            Log.e(""beep"", ""onKeyListener"" + "" "" + len);            if (len == limit + 1) {                len++;            } else {                if (len &gt; limit) {                    if (!(keyCode == KeyEvent.KEYCODE_DEL))                        playAudio();                }            }            Log.e(""beep"", ""onKeyListener"");            return false;        }    });}private void playAudio() {    try {        mMediaPlayer = MediaPlayer.create(this, R.drawable.beep1);        mMediaPlayer.setLooping(false);        Log.e(""beep"", ""started0"");        mMediaPlayer.start();        Log.e(""beep"", ""started1"");        mMediaPlayer.setOnCompletionListener(new OnCompletionListener() {            public void onCompletion(MediaPlayer arg0) {                // finish();                stopAudio();            }        });    } catch (Exception e) {        Log.e(""beep"", ""error: "" + e.getMessage(), e);    }}@Overrideprotected void onDestroy() {    super.onDestroy();    stopAudio();}private void stopAudio() {    if (mMediaPlayer != null) {        mMediaPlayer.release();        mMediaPlayer = null;    }}</code></pre><p>Thanks in advance</p>","421675","","421675","","2010-09-02 09:03:10","2012-06-30 01:11:51","Beep Sound when editext Character limt exceeds in android","<android>","1","2","","",""
"3624886","1","3625335","","2010-09-02 08:07:59","4","644","<p>HiI have a small doubtWhich is the best way to design UI for Android Coding or Desinging in XML?</p><p>Which is better in performance?</p>","286831","","","","","2013-08-04 18:29:41","Designing in XML or Coding UI.Which is better?","<android>","3","0","","",""
"3625386","1","3626304","","2010-09-02 08:33:26","3","6304","<p>I am attempting to parse HTML for specific data but am having issues with return characters, at least I think that's what the problem is. I am using a simple substring method to take apart the HTML as I know beforehand what I am looking for.</p><p>Here is my parse method:</p><pre><code>public static void parse(String response, String[] hashItem, String[][] startEnd) throws Exception{    for (i = 0; i &lt; hashItem.length; i++)    {        part = response.substring(response.indexOf(startEnd[i][0]) + startEnd[i][0].length());        value = part.substring(0, part.indexOf(startEnd[i][1]));        DATABASE.setHash(hashItem[i], value);    }}</code></pre><p>Here is a sample of the HTML that is giving me issues</p><pre><code>&lt;table cellspacing=0 cellpadding=2 class=smallfont&gt;&lt;tr onclick=""lu();"" onmouseover=""style.cursor='hand'""&gt;&lt;td class=bodybox nowrap&gt;&amp;nbsp;     21,773,177,147 $&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td class=bodybox nowrap&gt;&amp;nbsp;        629,991,926 F&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td class=bodybox nowrap&gt;&amp;nbsp;             24,537 P&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td class=bodybox nowrap&gt;&amp;nbsp;                  0 T&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td class=bodybox nowrap&gt;&amp;nbsp;RT&amp;nbsp;&lt;/td&gt;</code></pre><p>There are hidden return characters but when I try to add them into the string that I am trying to use it doesn't work out well, if at all. Is there a method or perhaps a better way to strip hidden characters from the HTML to make it easier to parse? Any help is greatly appreciated as always.</p>","423519","","","","","2013-12-22 07:21:54","Parse HTML in Android","<java><html><android>","4","0","1","",""
"3625394","1","3625436","","2010-09-02 08:33:58","11","3242","<p>I have a Android application that requires a splash screen. I have a simple activity which shows the splash screen and after a number of seconds, it starts the 'main' activity. Now, when a user presses the back button from that activity, the splash screen shows again. How can I prevent this? I tried keeping a boolean shownSplash and this partially works, but when the app is running and the user wants to open it from the app-launcher, the app exits (since splash calls finish() when splashShown is true). Any ideas?</p><p>Thanks,Erik</p>","419625","","","","","2012-06-02 10:25:56","Android: 'Splash screen' only once","<android>","1","0","7","",""
"3625411","1","3626054","","2010-09-02 08:36:09","5","1638","<p>I got a Widget on my HomeScreen on which i add an click to a Button. I pass the widget id from the Widget to a Service, but when im reading the WidgetId at the Service it's always 3.</p><p>Widget:</p><pre><code>@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) {    for (int appWidgetId : appWidgetIds) {        RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget);        Intent intent = new Intent(context, WidgetService.class);        // prints the correct appWidgetId        System.out.println(appWidgetId);        intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);        PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0);        remoteView.setOnClickPendingIntent(R.id.Button01, pendingIntent);        appWidgetManager.updateAppWidget(appWidgetId, remoteView);    }    super.onUpdate(context, appWidgetManager, appWidgetIds);}</code></pre><p>The Service looks like this:</p><pre><code>public int onStartCommand(Intent intent, int flags, int startId){    if (intent != null &amp;&amp; intent.getExtras() != null) {        int widgetId = intent.getExtras().getInt(AppWidgetManager.EXTRA_APPWIDGET_ID);        // 3 is always printend        System.out.println(widgetId);        // More stuff here    }    return super.onStartCommand(intent, flags, startId);}</code></pre><p>So what am I doing wrong?</p>","437740","","","","","2013-03-17 14:36:26","Android: Passing AppWidgetId to a Service","<java><android><widget><android-widget>","3","0","3","",""
"3625424","1","","","2010-09-02 08:38:13","1","1150","<p>I am making an IM application for Android.The application consists of a server and client, both residing on the android.At startup, the applications register with a webserver.If a client wants to send an IM to a server behind a NAT router, how this be done?I heard of stun4j and jstun but found nowhere an example of their usage in android.Thanks!</p>","437731","","","","","2012-07-05 07:31:19","Instant Messaging server on Android behind NAT-router","<android><messaging><traversal><nat><instant>","2","0","1","",""
"3625477","1","","","2010-09-02 08:46:32","0","859","<p>As you can see in the link below there is an extra padding (around 2mm) below the EditText field. I can't seem to remove this padding in anyway. This occurs with other widgets as well (like Buttons). It looks like Android is default adding this extra padding to all elements.</p><p><a href=""http://img266.imageshack.us/img266/4000/bottompadding.png"" rel=""nofollow"">http://img266.imageshack.us/img266/4000/bottompadding.png</a></p>","294661","","","","","2013-09-24 10:43:18","Remove bottom padding on widgets","<android><padding>","2","0","","",""
"3625496","1","3669512","","2010-09-02 08:49:19","7","14974","<p>Does someone know how to save and restore an object to a file on android ?</p>","429222","","","","","2011-07-23 22:56:36","android how to save an object to file?","<android><file><object><save>","3","0","4","",""
"3625506","1","","","2010-09-02 08:50:44","2","2022","<p>Android device is much slower and have much lower memory compare to PC/server, So what is the best way to handling XML in Android? And I have a set of very complex xml needed to parse. both SAX or DOM will cause too much code. Anybody have good suggestion? I want to make it clean and fast </p>","361010","","","","","2010-09-02 09:30:53","What is the best way to handling XML in Android","<java><android><xml>","4","0","","",""
"3625777","1","","","2010-09-02 09:29:22","0","835","<p>I build and run my project with 1.5 SDKBut when I tried to run my project after installing 2.2. I get this error.Please help; what does this Error mean ? And how do I solve it ?</p><pre><code>W/ResourceType( 2680): Bad string block: string #8 extends to 1575, past end at 60W/ResourceType( 2680): Bad string block: string #7 extends to 2075, past end at 60W/ResourceType( 2680): Bad string block: string #6 extends to 1303, past end at 60W/ResourceType( 2680): Bad string block: string #5 extends to 1299, past end at 60W/ResourceType( 2680): Bad string block: string #4 extends to 1295, past end at 60W/ResourceType( 2680): Bad string block: string #3 extends to 1553, past end at 60W/ResourceType( 2680): Bad string block: string #2 extends to 1292, past end at 60W/ResourceType( 2680): Bad string block: string #1 extends to 516, past end at 60W/ResourceType( 2680): Bad string block: string #0 extends to 1029, past end at 60res\layout\chart.xml:2: error: No resource identifier found for attribute 'id' in package 'android'res\layout\chart.xml:2: error: No resource identifier found for attribute 'layout_width' in package 'android'res\layout\chart.xml:2: error: No resource identifier found for attribute 'layout_height' in package 'android'res\layout\chart.xml:2: error: No resource identifier found for attribute 'orientation' in package 'android'res\layout\chart.xml:9: error: No resource identifier found for attribute 'id' in package 'android'res\layout\chart.xml:9: error: No resource identifier found for attribute 'layout_width' in package 'android'res\layout\chart.xml:9: error: No resource identifier found for attribute 'layout_height' in package 'android'res\layout\chart.xml:9: error: No resource identifier found for attribute 'text' in package 'android'</code></pre>","406631","","229044","","2010-12-05 05:16:14","2010-12-05 05:16:14","Error: when i tried to run running project with 2.2 then it gives error","<android>","1","1","","",""
"3625778","1","","","2010-09-02 09:29:26","6","1065","<p>I would like to know how many times I must wait to post an update for my application. I want to be sure that the update will appears in the ""news"" section of the Android Market.</p><p>Thanks very much.</p>","437775","","","","","2010-10-27 16:51:37","Android Market - Time to wait between two updates","<android><news><google-play>","4","1","2","",""
"3625837","1","3626033","","2010-09-02 09:38:15","6","27721","<p>Im trying to use openFileOutput function but it doesnt want to compile... doesnt recognize de function. Im using android sdk 1.6. Is this a sdk problem ? Is this a parameter problem ?</p><pre><code>import java.io.FileOutputStream;public static void save(String filename, MyObjectClassArray[] theObjectAr) {        FileOutputStream fos;        try {            fos = openFileOutput(filename, Context.MODE_PRIVATE);            ObjectOutputStream oos = new ObjectOutputStream(fos);            oos.writeObject(theObjectAr);             oos.close();        } catch (FileNotFoundException e) {            e.printStackTrace();        }catch(IOException e){            e.printStackTrace();        }    }</code></pre>","429222","","272824","","2010-09-02 10:08:51","2011-07-18 22:57:52","android what is wrong with openFileOutput?","<java><android><file>","2","0","2","",""
"3625890","1","","","2010-09-02 09:46:10","0","496","<p>I have a issue with Android, Eclipse and OSGI. </p><p>On a Android 2.1 device is a OSGI container running successfully, but for the bundle i need to use the android API so there are no imports missing. In my opinion the android.jar is already available by the system, so he doesn't need to be imported.</p><p>I'm not familiar with configure the build path.  </p><p>Can someone point me in the right direction to solve my import problem? </p><p>Thanks,</p><p>Yours sincerely,</p><p>Jelmert</p>","431742","","","","","2011-09-12 18:16:57","Creating a Android OSGI bundle with Eclipse","<android><eclipse><osgi>","1","0","3","",""
"3625907","1","3626027","","2010-09-02 09:49:02","4","2504","<p>There is description tag in xml. It contains the html tags. I am using SAX parser in android to parse. But when it fetch data from the description tag then it does not fetch the html contents, not any tags. Then how i solve the problem of the html content parsing from the XML using SAX parser please help.</p>","339116","","759866","","2014-02-20 17:20:29","2014-02-20 17:20:29","How to parse the html content in android using SAX PARSER","<android><xml><cdata><saxparser>","1","0","2","",""
"3625941","1","","","2010-09-02 09:53:46","1","778","<p>I have used gesture implementation in my application, my object moves perfectly throughout the screen, during fling, scroll..etc, but sometimes my object goes out of the view and its getting disappear, now i have to restrict the boundary of my gesture object, i  have placed this gesture with in a <code>view</code>, i tried to get the <code>width</code> and <code>height</code> of the `view and tried to restrict,but i can;t find it right , still the ;object moves out of its boundary....</p><p>My viewholder(layout where the gesture is placed) , i tried to get the width and height<code>viewholder.getWidth()</code>,<code>viewholder.getHeight()</code> but both returns 0,</p><p>i knew i have gone wrong somewhere, could anyone able to correct me, how i can move further</p><pre>framelayout = (FrameLayout) findViewById(R.id.LinearLayout_DrawCircle);framelayout.addView(new DrawTarget(this)); // View 1 (Draws Concentric circle)framelayout.addView(gestureaction); // View 2 (Draws a bitmap and invokes gesture that can move around)//trying to find the `width` and `height` of the view, so that movement of object can be restricted px = framelayout.getWidth(); py = framelayout.getHeight(); Log.i(TAG,""Width ="" +px + "","" + ""Height = "" +py); //return 0,0</pre><p>please let me know how to proceed further...</p><p>Thanks in advance</p>","384193","","1543541","","2013-02-22 21:37:33","2013-02-22 21:37:33","finding the Width and Height of View to restrict the boundary of Image Movement using Gesture","<android><gesture>","1","0","","","2010-09-02 09:56:11"
"3625959","1","","","2010-09-02 09:56:26","0","1611","<p>I am trying to remake a java application into an android application, but I cannot make it work. The application is meant to talk to a device that uses OBEX Push. The device cannot take any incoming connections and it has no user interface but some LEDs.</p><p>The java code snippet I am trying to remake is following:</p><pre><code>LocalDevice local;local = LocalDevice.getLocalDevice();local.setDiscoverable(DiscoveryAgent.LIAC);String sConnectionURL = ""btspp://localhost:"" + myUUID + "";name="" + obexName;this.server = (StreamConnectionNotifier) Connector.open(sConnectionURL);</code></pre><p>I am no java expert, but as far as I know, this snippet should register an SPP service with the name obexName and start to listen for incoming connections via the UUID myUUID. This works as intended.</p><p>When the device is pairing to the phone running the java midlet, it will set a bit to send to an SPP with the UUID on the phone or not send at all. If it cannot find any SPP with the UUID during the pairing, it will try to connect to the phone using normal OBEX instead.</p><p>This is the technique I cannot make work on an android phone, neither an HTC Hero, nor an HTC Desire, both with version 2.1-update1. No matter how I try, the phone is only connecting to the phone, and not to the application as desired.</p><p>I created a class much like the example on developer.android.com:</p><pre><code>private class AcceptThread extends Thread{    private final BluetoothServerSocket __serverSocket;    public AcceptThread()    {        BluetoothServerSocket tmpSocket = null;        trace(""Creating AcceptThread"");        try         {            trace(""Starting to listen"");            tmpSocket = _bluetoothAdapter.listenUsingRfcommWithServiceRecord(obexName, myUUID);            trace(""Listening successful"");        }         catch (Exception e)         {            trace(""Listening NOT successful"");            // TODO: handle exception        }        __serverSocket = tmpSocket;        trace(""AcceptThread created"");    }    public void run()    {        BluetoothSocket socket = null;        trace(""AcceptThread started"");        while(true)        {            try             {                trace(""Waiting for socket acceptance"");                socket = __serverSocket.accept();                trace( ""Socket accepted"");            }             catch (Exception e)             {                trace(""Error when accepting socket: "" + e.getLocalizedMessage());                break;                // TODO: handle exception            }            if (socket != null)            {                synchronized (BTTransfer.this)                {                    trace(""Socket exists"");                    try                    {                        __serverSocket.close();                        trace(""Socket successfully closed"");                    }                    catch (Exception e) {}                    break;                }            }            trace(""Socket does not exist"");        }    }    public void cancel()    {        try        {            __serverSocket.close();        }        catch (Exception e) {}        trace(""AcceptThread cancelled and Socket successfully closed"");    }}</code></pre><p>Comments about the code:<br>The trace function is a synchronized function feeding text to the Handler object, giving the UI information.<br>The application is knowingly not doing anything but closing the connection after a successful connection.<br>The application reaches ""Waiting for socket acceptance"" but never the trace after that.</p><p>I have a PC .NET application that can disguise itself as the device, and by using correct UUID it works flawlessly, but then the PC is already paired to the phone, and do not have the bit saying it should send over normal OBEX if it cannot find the specified one.</p><p>I have been working with this for several days, and can not come up with a solution. Does anyone out there have any ideas?</p><p>Thanks in advance,<br> /Trygg</p><hr><p>With the second message I mean following:</p><p>When the device contacts the phone, there is a notification in the drop down menu telling a device is contacting. A few seconds later (depending on the file size) the file is transferred, and there is a second notification telling the file is transmitted. This is the second ""message"". </p><p>Since I listen for the disconnection from the device, and the customer then through my program already knows that the file is transmitted, this second notification is utterly useless. Still, it will come up every time the device sends files to the phone.</p><p>In our tests on Legend and Hero, we never come to the second notification, though. This is where those phones fail. The first notification comes, then nothing, and the device returns an error after a few seconds.</p><p>Hope this helps to clarify what I meant.</p><p>/Trygg</p><hr><p>I did not get this working, but made sort of a workaround. I registerad a BroadcastReceiver on the event BluetoothDevice.ACTION_ACL_DISCONNECTED and then checked for what device was disconnected. If it was ""mine"" I searched for the files in the bluetooth inbox.</p><p>I got a message from the manufacturer of the device saying that it will not work yet, but they are working on a new firmware. This is why I haven't been active here nor worked for a better solution.</p>","437801","","50049","","2011-11-19 15:35:36","2011-11-19 15:35:36","Android RFComm with OBEX Push not working","<android><bluetooth><obex>","1","1","1","",""
"3626013","1","","","2010-09-02 10:02:53","0","705","<p>I am new to twitter .I like to develope one twitter Application. Can anyone tell me:</p><ol><li><p>The methods to be used for replying the tweets.</p></li><li><p>How to retweet with userID in arraylist</p></li></ol>","410871","","119895","","2010-09-02 11:22:34","2010-09-02 11:22:34","Twitter Application-android","<android><twitter4j>","1","0","","",""
"3626023","1","","","2010-09-02 10:03:55","0","540","<p>well once you get the necessary classes and instantiate the DevicePolicyManager,ActivityManager and ComponentName</p><p>when i try to enable it using an intent call, it shows me an info screen about this to Activate or Cancel in which i wanted to have it activated already without the user's permission.</p><p>is there a work-around with this?</p>","279560","","","","","2010-09-02 10:03:55","How to activate DevicePolicyManager in android implicitly?","<java><android>","0","2","","",""
"3626071","1","3626156","","2010-09-02 10:09:35","12","6556","<p>Is there a way to retrieve Browser's user-agent without having a <code>WebView</code> in activity?</p><p>I know it is possible to get it via <code>WebView</code>:</p><pre><code>WebView view = (WebView) findViewById(R.id.someview);String ua = view.getSettings().getUserAgentString() ;</code></pre><p>But in my case I don't have/need a webview object and I don't want to create it just for retrieving user-agent string.</p>","283037","","648313","","2011-09-12 14:23:15","2014-01-30 16:36:10","Retrieve User-Agent programatically","<android><webview><android-webview><user-agent>","5","0","7","",""
"3626107","1","3628731","","2010-09-02 10:14:36","4","4511","<p>Friend's</p><p>I am very new to android,i had developed an sample web application and    hosted that .apk build file in different android version and on different sized devices,   here i am getting problem in my design in layout such as listview not being displayed properly    bottom portion is not displayed well and the alignment is not so good.</p>","424413","","424413","","2010-12-30 17:31:56","2012-10-17 04:50:17","Supporting Multiple Screens in Android Devices?","<android>","5","2","1","",""
"3626199","1","","","2010-09-02 10:27:45","0","1613","<p>I am working on an Android game..I live in Taiwan but i want to make an English game, i have some problem when using facebook login Dialog is always loaded in Chinese. Is there any way i can change it to English which is the same with the device's language? </p><p>Thanks,</p><p>Eve</p>","430926","","","","","2010-09-02 10:34:39","Localization of Facebook","<android><facebook><localization>","1","0","","",""
"3626241","1","3626587","","2010-09-02 10:34:18","1","542","<p>I don't know why. Install the package directly won't have any problem. But will fail because of Force Close if update the old package. the log is:</p><pre><code>09-02 18:19:20.922: ERROR/AndroidRuntime(1659): Caused by: android.view.InflateException: Binary XML file line #5: Error inflating class java.lang.reflect.Constructor09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.view.LayoutInflater.createView(LayoutInflater.java:512)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:318)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.app.Activity.setContentView(Activity.java:1631)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at com.yidongsoft.ultraNoteEnhancedRegister.StartUI.setupWidgets(StartUI.java:237)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at com.yidongsoft.ultraNoteEnhancedRegister.StartUI.initialize(StartUI.java:129)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at com.yidongsoft.ultraNoteEnhancedRegister.StartUI.checkPassword(StartUI.java:591)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at com.yidongsoft.ultraNoteEnhancedRegister.StartUI.onCreate(StartUI.java:112)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1132)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     ... 11 more09-02 18:19:20.922: ERROR/AndroidRuntime(1659): Caused by: java.lang.reflect.InvocationTargetException09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.widget.ExpandableListView.&lt;init&gt;(ExpandableListView.java:198)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at java.lang.reflect.Constructor.constructNative(Native Method)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.view.LayoutInflater.createView(LayoutInflater.java:499)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     ... 25 more09-02 18:19:20.922: ERROR/AndroidRuntime(1659): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-480x320/list_selector_background.xml from drawable resource ID #0x7f02000509-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.content.res.Resources.loadDrawable(Resources.java:1625)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.widget.ListView.&lt;init&gt;(ListView.java:160)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.widget.ExpandableListView.&lt;init&gt;(ExpandableListView.java:202)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     ... 29 more09-02 18:19:20.922: ERROR/AndroidRuntime(1659): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-480x320/list_selector_background.xml from xml type drawable resource ID #0x7f02000509-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:1843)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.content.res.Resources.loadDrawable(Resources.java:1620)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     ... 32 more09-02 18:19:20.922: ERROR/AndroidRuntime(1659): Caused by: java.io.FileNotFoundException: res/drawable-480x320/list_selector_background.xml09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.content.res.AssetManager.openXmlAssetNative(Native Method)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:471)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:1825)09-02 18:19:20.922: ERROR/AndroidRuntime(1659):     ... 33 more</code></pre><p>The file not found seems android embedded resources. Can any one explain why? I am using HTC Magic, official rom 1.5</p>","414787","","3171","","2010-09-02 11:16:26","2012-11-13 08:10:31","After update, Force Close for system resources not found","<android>","2","2","","",""
"3626284","1","","","2010-09-02 10:38:54","1","6236","<p>I am new to android dev. I want to add images in a <code>ListView</code> like <a href=""http://cellnxt.in/temp/smp3.jpg"" rel=""nofollow"">this</a>.</p><p>Any idea ?</p>","436765","","368964","","2012-12-07 07:50:03","2012-12-07 07:50:03","Adding images in ListView","<android><listview>","3","1","1","",""
"3626317","1","","","2010-09-02 10:44:24","2","1511","<p>I have an alert dialog which contains a button.  The button is defined in some XML and the layout is set using Dialog.setContentView().</p><p>The button has a listener class and I want to know how, if at all, I can access the dialog from the onClick(View v) method.</p><p>The reason for this is simply that I want to be able to dismiss the dialog - so if there's an easier/better way to do this then that would be useful to know!</p>","398293","","180538","","2010-09-02 10:52:07","2010-09-02 11:14:25","Find the parent Dialog of a Button","<android><dialog>","3","0","1","",""
"3626662","1","","","2010-09-02 11:30:56","1","460","<p>I need to track my Android application exit as a page view.My application has several activities, but there is no hierarchy, so there is not an unique exit point.</p><p>My understanding is that ""application exit"" means another application is on top of mine, hiding it completely. So if my application is no more visible, there is an ""application exit"".Is my understanding correct?</p><p>So, how could I track this ""application exit"" with Google Analytics?</p><p>Looking forward for advice.Thank you.</p>","364420","","","","","2010-09-02 11:30:56","Android, Google Analitics: how to implement page view tracking on ""/quit"" application exit?","<android><google-analytics><tracking><pageviews>","0","0","","",""
"3626740","1","3635019","","2010-09-02 11:43:27","1","990","<p>i have rectangles and images and i want to show that images on that positions that rectangle holds in it...it is all dynamic. and i am using bitmap class to display but now i have to set positions according to that rectangle...</p><p>please help.thanks a lot.</p>","397901","","182971","","2010-09-02 11:45:54","2011-10-10 19:18:45","how to display images dynamically on dynamic positions","<android><image>","1","0","","",""
"3626750","1","3626951","","2010-09-02 11:45:02","15","5674","<p>I'm trying to make my horizontal layouts take advantage of the room available.</p><p>In an info showing activity I have a 'fact box' followed by a large box of text. I'd like the infobox to float right, similar to the following picture.</p><p>Is this possible using the android TextView api?</p><p><img src=""http://i.stack.imgur.com/1hqSB.png"" alt=""Example picture""></p>","205521","","44390","","2012-05-10 18:49:58","2012-05-10 18:49:58","Textview wrap around View","<android><android-layout><textbox><alignment><wrap>","3","5","4","",""
"3626754","1","","","2010-09-02 11:45:32","0","3283","<p>In my code i have state for each row of content so in list view if row has state as read, i need to display it with opacity/ transparency but for the view there is no direct method to set alpha.</p><p><pre><code>if(termDetails.getInt(""isRead"") > 0) {    AlphaAnimation animation = new AlphaAnimation(1, 0.2f);    animation.setFillAfter(true);    rowView.setAnimation(animation);} else {    AlphaAnimation animation = new AlphaAnimation(1, 1);    animation.setFillAfter(true);    rowView.setAnimation(animation);}</pre></code></p><p>Above code works but it is unstable as u scroll through list it looses the consistency.</p>","288156","","","","","2012-03-20 01:45:22","How to set opacity/ transparancy on view/ List view row","<android><listview><transparency><opacity>","2","0","","","2010-09-02 11:45:32"
"3626823","1","3669561","","2010-09-02 11:55:30","0","615","<p>I want to serialize my class. I have this code :</p><pre><code>public class Video implements Serializable{public long videoId;public String title;public String publisher;public String language;public Date lastModified;public Date published;public String imageUrl;public String url;public Bitmap myVideoScreenshotBm;//public Drawable myVideoScreenshotDrawable;public CedemoVideo (long newVideoId) {    this.videoId=newVideoId;}</code></pre><p>}</p><p>As far I have check i'm getting a NotSerializableException because of the Bitmap variable.</p><p>I apparently need to implement :</p><pre><code> private void writeObject(java.io.ObjectOutputStream out) throws IOExceptionprivate void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException</code></pre><p>Anyone know what I should do in these function ?? How should I write my Bitmap variable ?Any code examples ? anyone did it ?</p>","429222","","243782","","2010-09-02 12:52:49","2010-09-08 15:52:59","how to serialize manually a class?","<java><android><serialization>","2","0","1","",""
"3626976","1","3627018","","2010-09-02 12:17:10","6","11613","<p>If i run my android application with a htc magic with locale English, I find my application running properly and if i try to run it on Motorola droid with locale korean, My application(apk) is not even installing on the device. Does android support different language? Is it is because of different language OS versions?</p>","431655","","114066","","2010-09-02 13:13:30","2012-02-01 16:46:31","Do android support multiple languages?","<android><multilanguage>","2","0","3","",""
"3627010","1","3627382","","2010-09-02 12:22:16","1","1865","<p>I am new to Titanium and created a HelloWorld application. Every time my application starts up a Titanium startscreen is show.</p>","292465","","114066","","2010-09-02 13:00:51","2010-09-02 13:08:49","How to start Titanium application ported to Android without welcome Appcelerator screen?","<android><titanium>","1","0","1","",""
"3627030","1","","","2010-09-02 12:24:23","1","1996","<p>i have a address and wants to find the latitude and longitude for that address...anybody know how can we get lat long from address in android...</p><p>i am using this code </p><pre><code>Geocoder coder = new Geocoder(getApplicationContext(), Locale                    .getDefault());            List&lt;Address&gt; address;            address = coder.getFromLocationName(                    ""Pallekele International Cricket Stadium,Kandy, 1);            if (address == null) {            }            Address location = address.get(0);            location.getLatitude();            location.getLongitude();            GeoPoint point = new GeoPoint((int) (location.getLatitude() * 1E6),                    (int) (location.getLongitude() * 1E6));</code></pre><p>but i got this exception </p><pre><code>09-02 17:46:56.086: ERROR/Exception(1724): Service not Available09-02 17:46:56.086: ERROR/Exception(1724): java.io.IOException: Service not Available09-02 17:46:56.086: ERROR/Exception(1724):     at android.location.Geocoder.getFromLocationName(Geocoder.java:159)09-02 17:46:56.086: ERROR/Exception(1724):     at pack.sample.map.SampleMapApplication.onCreate(SampleMapApplication.java:38)09-02 17:46:56.086: ERROR/Exception(1724):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-02 17:46:56.086: ERROR/Exception(1724):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)09-02 17:46:56.086: ERROR/Exception(1724):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)09-02 17:46:56.086: ERROR/Exception(1724):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)09-02 17:46:56.086: ERROR/Exception(1724):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)09-02 17:46:56.086: ERROR/Exception(1724):     at android.os.Handler.dispatchMessage(Handler.java:99)09-02 17:46:56.086: ERROR/Exception(1724):     at android.os.Looper.loop(Looper.java:123)09-02 17:46:56.086: ERROR/Exception(1724):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-02 17:46:56.086: ERROR/Exception(1724):     at java.lang.reflect.Method.invokeNative(Native Method)09-02 17:46:56.086: ERROR/Exception(1724):     at java.lang.reflect.Method.invoke(Method.java:521)09-02 17:46:56.086: ERROR/Exception(1724):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-02 17:46:56.086: ERROR/Exception(1724):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-02 17:46:56.086: ERROR/Exception(1724):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>what i did wrong?</p>","421645","","","","","2010-09-02 12:41:13","how can we find lat long from address in android?","<android>","1","0","","",""
"3627096","1","5631853","","2010-09-02 12:33:07","5","1908","<p>I have being playing around with expandable list views recently. </p><p>I am trying to get a list view that has a checkbox as one of the elements of the child view. </p><p>I found this tutorial, <a href=""http://mylifewithandroid.blogspot.com/2010/02/expandable-lists-and-check-boxes.html"">http://mylifewithandroid.blogspot.com/2010/02/expandable-lists-and-check-boxes.html</a>,  and it seemed perfect. However when I compiled it and started playing with it I realised its very buggy. Checking a box in one group can cause a random box from another group to check or uncheck., </p><p>This is the only tutorial I can find on this, It seems like a thing that would be used in a lot of apps, so I was wondering, is there any other good tutorial or resource out there that deals with this?</p><p>Or even better, would anyone care to show their own code having gotten this to work...</p><p>Thanks</p><p>Kev</p>","409826","","","","","2011-04-12 07:32:52","Android: ExpandableListViews and Checkboxes","<java><android><expandablelistview>","2","0","2","",""
"3627182","1","3627799","","2010-09-02 12:43:51","0","2074","<p>I'm parsing a date which is in format <code>EEE, dd MMM yyyy HH:mm:ss Z</code>. One of the sample values is <code>Thu, 02 Sep 2010 04:03:10 -0700</code>.</p><p>This is the parsing code:</p><pre><code>SimpleDateFormat FORMATTER = new SimpleDateFormat(""EEE, dd MMM yyyy HH:mm:ss Z"");Date date = FORMATTER.parse(dateString);</code></pre><p>This works absolutely fine if Phone Language is English but it throws parserException when language is changed to ""France"" or ""Italian"". I have even tried this:</p><pre><code>SimpleDateFormat FORMATTER = new SimpleDateFormat(""EEE, dd MMM yyyy HH:mm:ss Z"", Locale.getDefault());</code></pre><p>or for French locale more explicit:</p><pre><code>SimpleDateFormat FORMATTER = new SimpleDateFormat(""EEE, dd MMM yyyy HH:mm:ss Z"", Locale.French);</code></pre><p>But no luck.....Can someone tell me what I am doing wrong? </p>","337214","","243782","","2010-09-02 13:54:51","2010-09-02 13:57:53","Simpledateformat parse issue","<java><android><date><timezone><simpledateformat>","1","0","","",""
"3627214","1","","","2010-09-02 12:47:32","2","1849","<p>I have built an app that does some co-ordinate calculation for me. It works well it retrieves points from a database I built as well.  What I want to do now is when a menu button is pressed display a map.  I did a tutorial that is simply a map display.. that's all it does when it runs.  but when I try to incorporate what I have done in my app..I have no luck at all.</p><p>So here are some of the items I have done and maybe someone can help me.</p><p>Here are the important lines from my android manifest.xml</p><pre><code>&lt;uses-library android:name=""com.google.android.maps"" android:required=""true""/&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>Here is the the XML for the map display activity</p><pre><code>&lt;com.google.android.maps.MapView     android:id=""@+id/mapView""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:enabled=""true""        android:clickable=""true""        android:apiKey=""0EVD3Q_WMbtaa_vIjrPoaiN7Egbs8amSorNF-qw""        /&gt;</code></pre><p>I have a menu item in my main application that I want to invoke the map( I want to pass coordinates too it later.. but right now if it would just simply display I would be happy) In this code it is the case statement 3 that I am trying to invoke the map.</p><pre><code>public boolean onOptionsItemSelected(MenuItem item) {               switch (item.getItemId()) {               case 1:                 String v_band1 = spin2.getSelectedItem().toString();                 Intent myIntent2 = new Intent(Tower.this, BuildList.class);                 myIntent2.putExtra(""BAND"", v_band1);                 Tower.this.startActivity(myIntent2);                return true;              case 2:                 Intent myIntent = new Intent(Tower.this, Activity2.class);                 Tower.this.startActivity(myIntent);                 return true;             case 3:                Intent myIntent1 = new Intent(Tower.this, Mapit.class);                Tower.this.startActivity(myIntent1);                return true;             case 4:                loadspinner();                return true;             }               return false;           }   </code></pre><p>in the test app there is an import line at the top of the class </p><pre><code>import com.google.android.maps.MapActivity;</code></pre><p>In my new app when you start typing in the import statement you get to ""import com.google.android.maps."" and the MapActivity or anything will not come up to select as it did in the test tutorial.  What am I doing wrong??  I have tried  pasted my entire Android Manfiest.xml asa well as the XML from the view to display the map, in here but the whole thing does not show up. So I added the googlemaps line to show you I use it.</p><pre><code>&lt;uses-library android:name=""com.google.android.maps"" android:required=""true""/&gt;</code></pre>","437926","","150398","","2012-11-09 21:41:17","2012-11-09 21:41:17","Android: How can I display a google map in an android app?","<android><google-maps>","1","2","0","",""
"3627216","1","3627399","","2010-09-02 12:48:02","7","7916","<p>I have an ""open"" animation and am using Handler.postDelayed(Runnable, delay) to trigger a ""close"" animation after a short delay. However, during the time between open and close, there is possibly another animation triggered by a click...my question is, how would I cancel the ""close"" animation in the handler?</p><p>Thanks</p>","409853","","","","","2013-05-18 08:16:58","How to remove a runnable from a handler object added by postDelayed?","<android><handler><runnable><postdelayed>","3","0","3","",""
"3627289","1","3627483","","2010-09-02 12:57:40","0","212","<p>HelloIn my android appl;ication I am using a table inside a scrollview and below that there is a footer.Now the issue is the last row of the table is covered by the footer and is not visible.Is there any solution for this.My layout xml is</p><pre><code>    &lt;ScrollView        android:id=""@+id/Scroll""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_weight=""1""        xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;TableLayout    android:id=""@+id/SubTable""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""vertical""            xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;/TableLayout&gt;        &lt;/ScrollView&gt;</code></pre><p>Please let me know your valuable suggestions.Thanks in advance :)</p>","420261","","420261","","2010-09-02 13:08:29","2010-09-02 13:22:28","scrollView issue in android","<android>","1","0","","",""
"3627322","1","3664505","","2010-09-02 13:01:20","4","8354","<p>By default,the android system's default location is US and language is en.But I want to set the default location to an other country. So, the users will see their mother language when the first time start up android.</p><p>I have tried to modify the code(<code>/dalvik/libcore/luni/src/main/java/java/util/Locale.java</code>), changed the locale's default value. But no effect.</p><p>Can you tell me how to set the default location?</p><p>*I want to make an android image, then burn it to device, when the android start up the first time,  I want it's os language is not english but other language. </p>","437972","","508666","","2012-01-29 03:04:41","2012-01-29 03:04:41","How can I modify the default locale in android?","<android><locale><default>","4","1","","",""
"3627874","1","","","2010-09-02 14:04:55","2","1027","<p>I removed all child view from the ViewSwitcher by</p><pre><code>mSwitcher.removeAllViews();</code></pre><p>But when I add a previously removed view back, it throws an java.lang.IllegalStateException and says I haven't remove this view from its parent.</p><p>Here is the code:</p><pre><code>View curView = mSwitcher.getCurrentView();mSwitcher.removeAllViews();Log.d(TAG, ""parent &gt;&gt; "" + nextView.getParent());Log.d(TAG, ""switcher &gt;&gt; "" + mSwitcher);mSwitcher.addView(curView);mSwitcher.addView(nextView);mSwitcher.showNext();</code></pre><p>the Exception has thrown in this line</p><pre><code>mSwitcher.addView(nextView);</code></pre><p>Here is the log:</p><pre><code>09-03 10:04:14.551 D/MainActivity( 8852): parent &gt;&gt; null09-03 10:04:14.551 D/MainActivity( 8852): switcher &gt;&gt; android.widget.ViewSwitcher@43ebb58009-03 10:04:14.551 D/AndroidRuntime( 8852): Shutting down VM09-03 10:04:14.551 W/dalvikvm( 8852): threadid=1: thread exiting with uncaught exception (group=0x4001d7e8)09-03 10:04:14.571 E/AndroidRuntime( 8852): FATAL EXCEPTION: main09-03 10:04:14.571 E/AndroidRuntime( 8852): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.view.ViewGroup.addViewInner(ViewGroup.java:1970)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.view.ViewGroup.addView(ViewGroup.java:1865)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.widget.ViewAnimator.addView(ViewAnimator.java:160)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.widget.ViewSwitcher.addView(ViewSwitcher.java:66)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.view.ViewGroup.addView(ViewGroup.java:1822)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.view.ViewGroup.addView(ViewGroup.java:1802)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at com.aimi.appstore.tulipa.ui.activity.MainActivity.setSelected(MainActivity.java:104)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at com.aimi.appstore.tulipa.ui.activity.MainActivity$2.onClick(MainActivity.java:54)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.view.View.performClick(View.java:2408)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.view.View$PerformClick.run(View.java:8818)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.os.Handler.handleCallback(Handler.java:587)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.os.Handler.dispatchMessage(Handler.java:92)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.os.Looper.loop(Looper.java:123)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at java.lang.reflect.Method.invokeNative(Native Method)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at java.lang.reflect.Method.invoke(Method.java:521)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-03 10:04:14.571 E/AndroidRuntime( 8852):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","234939","","234939","","2010-09-03 03:19:44","2010-09-03 03:19:44","ViewSwitcher can't remove the child view?","<android>","0","4","","",""
"3627907","1","","","2010-09-02 14:07:53","0","245","<p>I am new to the android development as well as eclipse IDE, but I do have some experience in using Java (Used to work with C# in vs2008 before). Right now I have both Eclipse and Android SDK up and running. I did manage to do the ""Hello, world"" in android. But when ever I am making a new project it shows up in the solution explorer next to the previous project ""Hello, World"" and it shares/copy the string.xml, so when ever I run it, it give me Hello World previous project result.  </p><p>Please tell me what to do and thank you.</p>","438055","","","","","2010-09-02 18:34:57","new android project share/copy the same string.xml file","<android><eclipse>","1","2","","",""
"3627987","1","5502173","","2010-09-02 14:16:56","3","1977","<p>are there any good examples out there of using an expandablelistadapter with the results of an sql query? </p><p>The docs give 3 examples of using expandablelistadapter, but none of them deal with sqlite</p><p>Thanks</p><p>Kevin</p>","409826","","","","","2011-03-31 15:16:38","Android. ExpandableListAdapter and Sqlite","<android><sqlite><expandablelistadapter>","1","0","3","",""
"3628016","1","3669601","","2010-09-02 14:19:19","6","13844","<p>Im trying to serialize a class in wich i have a bitmap variable. Here is the code that is a bit working.... I need help to find out what is still wrong.....</p><pre><code>private Bitmap myVideoScreenshotBm;private void writeObject(ObjectOutputStream out) throws IOException{    out.writeInt(myVideoScreenshotBm.getRowBytes());    out.writeInt(myVideoScreenshotBm.getHeight());    out.writeInt(myVideoScreenshotBm.getWidth());    int bmSize = myVideoScreenshotBm.getHeight() * myVideoScreenshotBm.getRowBytes();    ByteBuffer dst= ByteBuffer.allocate(bmSize);    myVideoScreenshotBm.copyPixelsToBuffer(dst);    byte[] bytesar=new byte[bmSize];    dst.position(0);    dst.get(bytesar);    out.write(bytesar);}private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException{    int nbRowBytes=in.readInt();    int height=in.readInt();    int width=in.readInt();    //    int bmSize = nbRowBytes * height;    byte[] toread= new byte[bmSize];    in.read(toread, 0, toread.length);    ByteBuffer dst= ByteBuffer.allocate(bmSize);    dst.put(toread);    dst.position(0);    myVideoScreenshotBm=Bitmap.createBitmap(width, height, Bitmap.Config.ALPHA_8);    myVideoScreenshotBm.copyPixelsFromBuffer(dst);}</code></pre><p>Im not getting an error but the bitmap Im getting are wrong... also, I do not know how to know which Bitmap.Config flag is suitable... how to know ?</p><p>any help ?</p>","429222","","651865","","2012-05-25 21:39:56","2012-05-25 21:39:56","android how to save a bitmap - buggy code","<android><serialization><bitmap><save>","3","0","4","",""
"3628052","1","3628372","","2010-09-02 14:23:01","6","14769","<p>It's perfectly described <a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesInternal"">here</a> how to do it, the only problem: He doesnt know the function <code>openFileOutput()</code>;</p><pre><code>private void saveSettingsFile() {          String FILENAME = ""settings"";          String string = ""hello world!"";          FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE); //openFileOutput underlined red          try {            fos.write(string.getBytes());            fos.close();          } catch (IOException e) {            Log.e(""Controller"", e.getMessage() + e.getLocalizedMessage() + e.getCause());          }}</code></pre><p>Those are the relevant packages I imported:</p><pre><code>import java.io.FileOutputStream;import java.io.IOException;import android.content.Context;</code></pre>","433718","","433718","","2010-09-02 15:13:45","2013-08-02 12:07:23","Android: How to store data on internal memory?","<android><file-io><java-io><fileoutputstream>","3","6","3","",""
"3628176","1","","","2010-09-02 14:37:25","0","216","<p>i need to know that do i define the service class as a seperate .class file or do i define it within my main class of the activity ?</p><p>can someone provide me with an example apart from this one... <a href=""http://developer.android.com/reference/android/app/Service.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/Service.html</a></p><p>???:/Thank you</p>","434885","","","","","2013-02-27 18:51:26","android dev: Services","<android>","2","0","","",""
"3628283","1","","","2010-09-02 14:48:56","0","127","<p>please, let me know how to bring a activity within the following Tab Programatically..</p><pre> ts1.setContent(new TabHost.TabContentFactory() {   public View createTabContent(String tag) {    //here i have to bring my page(Activity)    return frameLayout;    }  });</pre><p>please , its very urgent....help me out to find the solution....</p><p>Thanks in advance....</p>","384193","","","","","2010-09-02 14:48:56","TabLayout in android","<android><layout>","0","2","","","2010-09-02 14:49:27"
"3628337","1","","","2010-09-02 14:56:21","0","164","<p>Could you tell me where I can find specification of simple_item_list_1 or simple_item_list_2?Or tell me how to use them both?</p>","437223","","","","","2010-09-02 16:00:12","Could you tell me where I can find specification of simple_item_list_1 or simple_item_list_2?","<android>","1","1","","",""
"3628412","1","","","2010-09-02 15:04:00","1","636","<p>I have an Android application, a JNI code which captures images from Camera and sends it to UI. JNI code runs in a separate thread which fills a shared queue which is present in UI class. Randomly I am getting the following error.</p><pre><code>W/dalvikvm(  360): JNI WARNING: 0x659 is not a valid JNI referenceW/dalvikvm(  360):              in Ldalvik/system/NativeStart;.run ()V (NewLocalRef)I/dalvikvm(  360): ""Binder Thread #3"" prio=5 tid=8 RUNNABLEI/dalvikvm(  360):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x4515e1b8 self=0xa5770I/dalvikvm(  360):   | sysTid=457 nice=0 sched=0/0 cgrp=unknown handle=2280392I/dalvikvm(  360):   at dalvik.system.NativeStart.run(Native Method)I/dalvikvm(  360): E/dalvikvm(  360): VM aborting</code></pre><p>Let me know how to fix this issue. Issue occurs while displaying first image or after some images.</p><p>Some more Info: It is crashing after calling NewLocalRef on a variable.</p>","28641","","28641","","2010-09-03 05:28:19","2010-09-03 05:28:19","Error in Android application","<android><jni>","0","0","","",""
"3628414","1","","","2010-09-02 15:04:06","0","960","<p>Im implementing app widget to play audio from url,</p><p>I used mediaplayer class to play audio when click on a play button in widget.</p><p>but im not getting audio output, is there any way to work out on this issue.</p><p>Please let me know, or give me a reference to follow</p><p>Thanks in advance</p>","341443","","","","","2011-05-21 05:39:21","How to play an audio from url in a app widget","<android>","1","0","","",""
"3628544","1","3628678","","2010-09-02 15:17:37","3","4873","<p>I have a listview from an SQLDatabase using custom CursorAdaptor. I would like to go back to the activity that i used to create the items when i click on them in the listview.so that i can edit the entries. But nothing happen when i implement the OnItemClick method and the getItemId() on the CursorAdapter even though am not sure i am correct there. Here is my Code:</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; adapview, View view, int position, long rowId) {        Cursor c = adapter.retrieveRow(rowId); // retrieve row from Database            Intent edit = new Intent(this,NewItem.class);        edit.putExtra(DBAdapter.KEY_ID, rowId);            edit.putExtra(DBAdapter.Title, c.getString(c.getColumnIndex(DBAdapter.Title)));      edit.putExtra(DBAdapter.DATE, c.getString(c.getColumnIndex(DBAdapter.DATE)));            startActivity(edit);        }public long getItemId(int id){            return id;        }</code></pre>","316843","","316843","","2010-09-02 15:24:19","2010-09-02 16:26:36","Edit List Items in ListView","<android>","1","0","","",""
"3628668","1","3629023","","2010-09-02 15:32:04","10","3916","<p>Can someone tell my when to use Overlay or when to use ItemizedOverlay class!</p><p>What are differences between this two classes?</p><p>Draw methods do the same thing?</p><p>Can I use only ItemizedOverlay  class in my project or I must use and Overlay as base class!</p><p>Thanks</p>","432848","","479633","","2012-12-04 16:33:12","2012-12-04 16:33:12","Differences between ItemizedOverlay and Overlay class","<android><android-mapview>","1","0","5","",""
"3628737","1","","","2010-09-02 15:43:02","0","706","<p>friend's    i have listview with 10 records parsed initially from internet and i have footer at bottom of my listview by using for click more to view,the view getting ok but the problem here is during my click event i have to call the same adapter class with different url it getting parsed well,the problem is click event adapter data are not binded with listview,i'm getting error has like this..</p><p>09-02 21:02:15.042: ERROR/AndroidRuntime(424): java.lang.IndexOutOfBoundsException: Invalid location 58, size is 109-02 21:02:15.042: ERROR/AndroidRuntime(424):     at java.util.ArrayList.get(ArrayList.java:353)</p><p>here my java code initially executing....</p><pre><code>LayoutInflater inflater2 = this.getLayoutInflater();        View footerView = inflater2.inflate(R.layout.footer, null);        footerView.findViewById(R.id.text1);//      ((ListView) adapter).    //  setListAdapter(adapter);        adapter = new Adapter(Expand.this,url);        getListView().addFooterView(footerView);            setListAdapter(adapter);</code></pre><p>code at my footer click event ...</p><pre><code>footerView.findViewById(R.id.text1).setOnClickListener(new OnClickListener(){        @Override        public void onClick(View arg0) {            // TODO Auto-generated method stub</code></pre><p>//                  </p><pre><code>int  a = adapter.count;                    len =100;//                  Log.v(""Count"",Integer.toString(a));                    url = ""http://www.artistdirect.com/nad/rss/top100/0,,,00.xml"";                    adapter = new Adapter(Expand.this,url);    adapter.notifyDataSetChanged();}</code></pre><p>how can i resolve it,is there any otherway to place link to view more and bind it on listview.</p><p>Thanks in advance.</p>","407506","","407506","","2010-09-02 18:26:09","2012-01-19 14:55:42","how to bind the adapter list content of click event","<android>","2","0","","",""
"3628868","1","","","2010-09-02 15:56:01","0","1204","<p>I have a really weird problem, which I am unable to debug so far...Thing is...my app needs to download something to work. So in the beginning of the onCreate() method, I check if that something is already downloaded. If not, I pop a dialog up asking the user to download it.</p><pre><code>if (!isInstalled) {            showDialog(DIALOG_INSTALL);        } else {            start();        }</code></pre><p>Where start() method performs some other action. Now, that showDialog calls this:</p><pre><code>builder = new AlertDialog.Builder(MyApp.this);        builder.setMessage(""Would you like to install..."")        .setCancelable(false)        .setPositiveButton(""Install"", new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                dialog.dismiss();                aManager.install(MyApp.this);            }        });        dialog = builder.create();        return dialog;</code></pre><p>My dialog is shown and I am clicking, so aManager.install() is called. I am passing the context because that aManager.install() pops up a ProgressDialog to show downloading progress and spawns a new thread in which everything is downloaded. So obviously before creating my dialog I make a Handler to receive the response from that aManager.install(). And the response MAY vary, because for example the internet connection isn't available (Exception raised and catched and listener called with different code).</p><p>Now, when that happens (Exception) I would like to call another dialog saying ""something went wrong, would you like to retry?""...so another call to showDialog(DIALOG_REINSTALL) (this time with another code).Thing is...the showDialog() gets called (I can verify this by logging) but the dialogs doesn't show up. Instead my application JUST HANGS!?!?!?</p><p>Does someone have a clue why it's doing this???? No exception raised, absolutely nothing from logcat, I can't tell WHERE it's hanging...just see that the method is called and the dialog should be displayed...</p><p>Thank you very much!!</p>","438153","","","","","2012-06-19 23:03:32","Showing Dialog after another Dialog: HANGS","<java><android><dialog>","2","0","","",""
"3628976","1","3629482","","2010-09-02 16:06:54","1","3248","<p>Just learning and thought this would be neat to learn.</p><p>basically getting the value from editText1 and editText2, then by pressing an add button, be able to show the result answer on a second activity. I know this is probably very easy, but I wanted to learn more about how I can do simple math practice while learning the language. Thank you for your time if you respond. </p>","438162","","","","","2010-09-02 17:13:39","adding two numbers from editText in first activity and displaying the answer on a second activity?","<android>","1","0","","",""
"3628999","1","3629100","","2010-09-02 16:09:06","1","1289","<p>I have a pretty simple local service that I'm trying to bind to my activity.  I worked through this yesterday with CommonsWare and he got me straightened out as I was having a difficult time getting the service to bind.  It turns out that the reason I was having so much trouble was that I was trying to bind the service with:</p><pre><code>bindService(new Intent(this, myService.class), mConnection, Context.BIND_AUTO_CREATE);</code></pre><p>inside a void method that was being called after a button click.</p><pre><code>private void doBindService() {            bindService(new Intent(this, SimpleService.class), mConnection, Context.BIND_AUTO_CREATE);            mIsBound = true;        }       private OnClickListener startListener = new OnClickListener() {        public void onClick(View v){            doBindService();        }                      };</code></pre><p>when I moved my bindService() call to the onCreate method of the activity, it works fine. CommonsWare mentioned something about that call being asynchronous and I don't know enough about android activity creation to know if that's what my issue was or not.  I do know that my onServiceConnection() was being called inside my ServiceConnection() when the button was being clicked, by my mBoundService would not work when I tried accessing members inside the service.</p><p>Can someone tell me why it doesn't work inside the button click, but does work inside the onCreate()?</p><p>TIA</p>","233971","","","","","2010-09-02 16:24:44","bindService not working inside a button click but works in onCreate - android","<android><binding><service><oncreate>","1","0","","",""
"3629036","1","3635679","","2010-09-02 16:14:53","1","2049","<p>I am developing an Android Application and I need to generate some RSA private and public keys to use for secure communication with web services. To do this I need to have the public key in a .NET compatible form. Like: </p><pre><code>&lt;RSAKeyValue&gt;&lt;Modulus&gt;{0}&lt;/Modulus&gt;&lt;Exponent&gt;{1}&lt;/Exponent&gt;&lt;/RSAKeyValue&gt;</code></pre><p>So far I managed to to this:</p><pre><code>  keyGen = KeyPairGenerator.getInstance(""RSA"");  keyGen.initialize(1024);  keypair = keyGen.genKeyPair();  privateKey = keypair.getPrivate();  publicKey = keypair.getPublic();  // Get the bytes of the public and private keys  byte[] privateKeyBytes = privateKey.getEncoded();  byte[] publicKeyBytes = publicKey.getEncoded();</code></pre><p>I've got no clue how to continue. Could you please provide some help ?</p>","379865","","","","","2013-08-24 02:43:47","Android create RSA 1024 .NET compatible keys","<android><rsa>","2","0","","",""
"3629123","1","","","2010-09-02 16:27:12","1","935","<p>I 'm using  in an Activity in Android so that It could receive the intent when I try to send SMS. While sending the SMS I want to get a pop up asking me which app I want to use, native sms app or my app. </p><p>My problem is that it works when I 'm resending those sms which are failed to sent in last attempt i got the pop asking to choose sms app but If i just type a message after inputting target phone no It just uses native sms app not ask choices for SMS apps </p><p>MOreover Is there any way thourgh which I could put listener to outgoing sms so that I could invoke my application.</p><ul><li>RegardsAnil   </li></ul>","218665","","","","","2010-09-02 16:27:12","Android SMS Sending Intent filter","<android>","0","2","","",""
"3629155","1","3629198","","2010-09-02 16:30:22","5","1265","<p>I have read tutorials all over the web with different kinds of tutorials specified on game (however, this turns out to be pretty general).</p><p>Are there any reasons to why many developers name their variables like:</p><pre><code>mContext</code></pre><p>For me it is default to just name it ""context"" or something similar.</p><p>Are there any reasons why the ""m"" are before? (I know that this is a matter of style, but I'm just curious what it stands for)</p>","386562","","114066","","2010-09-21 08:21:33","2010-09-21 08:21:33","An interesting detail about variable name","<android><coding-style><hungarian-notation>","3","2","2","",""
"3629179","1","","","2010-09-02 16:33:21","14","15585","<p>Similar to:<br><a href=""http://stackoverflow.com/questions/3381594/how-to-make-android-activity-show-above-keypad-screen-lock"">http://stackoverflow.com/questions/3381594/how-to-make-android-activity-show-above-keypad-screen-lock</a></p><p>How can I display an <code>Activity</code> or <code>Dialog</code> over visible lock screen?</p><p>I have already tried displaying my lock activity when screen goes on setting various window type in <code>Activity.onCreate()</code> method:  </p><p><code>TYPE_PRIORITY_PHONE</code><br><code>TYPE_SYSTEM_ALERT</code><br><code>TYPE_KEYGUARD</code></p><p>and others</p><p>together with <code>SYSTEM_ALERT_WINDOW</code> and <code>INTERNAL_SYSTEM_WINDOW</code> permissions.</p><p>My activity is visible after I unlock the device.</p><p>UPDATE:</p><p>I actually already managed to display my own Activity instead of default lock screen. It work perfectly unless you use HOME button.</p>","387710","","387710","","2010-09-09 14:29:16","2014-02-23 03:47:25","Android activity over default lock screen","<android><activity><lockscreen>","2","6","17","",""
"3629204","1","3629293","","2010-09-02 16:37:16","0","1183","<p>I'm trying to convert my LinearLayout to a bitmap so that I can save the current layout content as an image in SD card. First, I create bitmap and canvas and attach the layout to the canvas. Followed steps from <a href=""http://www.brighthub.com/mobile/google-android/articles/30676.aspx#comments"" rel=""nofollow"">http://www.brighthub.com/mobile/google-android/articles/30676.aspx#comments</a>. </p></p><pre><code>//code to add child view into layout before creating bitmap screenBitmap = Bitmap.createBitmap(200,200,Bitmap.Config.ARGB_8888);Canvas canvas = new Canvas(screenBitmap);layout.draw(canvas);   </code></pre><p><p> When I press the save button, it should save the current layout as an image to SD card. Here are my steps:</P></p><pre><code>FileOutputStream outStream = null;File file = new File(""/sdcard/Health Management System/"");file.mkdirs();File outputFile = new File(file, fileName);outStream = new FileOutputStream(outputFile);BufferedOutputStream bos = new BufferedOutputStream(outStream);bos.flush();bos.close();screenBitmap.compress(Bitmap.CompressFormat.PNG, 100,bos);</code></pre><p><p> It can create folder in SD card but no file created under this folder. It always gives me FileNotFoundException. I'm not sure it is the file creating problem or the screenBitmap problem. Can anyone give me some clue? Thanks! </p>","394815","","","","","2010-09-02 16:55:50","Convert View to bitmap FileNotFoundException problem","<android><bitmap><sd-card>","2","0","","",""
"3629210","1","3629829","","2010-09-02 16:38:08","0","2368","<p>I have an app that downloads a very large file (over 50MB). Unfortunately I'm getting reports that the download fails. </p><p>Below is the logcat of one such failure, which ends with a <code>java.net.SocketException: The operation timed out</code>. In-between it has various messages from the <code>WifiMonitor</code>. I don't know how to interpret these messages. </p><p>Is there something special that I should do to download a large file, or is this simply a connection problem?</p><pre><code>09-02 16:41:19.925 I/ActivityManager(  646): Displayed activity com.example/com.example.sp.MainActivity: 1110 ms (total 3786 ms)09-02 16:41:21.935 W/InputManagerService(  646): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45133d0809-02 16:41:23.495 I/global  ( 7345): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.09-02 16:41:23.895 D/dalvikvm( 7345): GC freed 5348 objects / 307096 bytes in 160ms09-02 16:41:25.885 D/dalvikvm( 7345): GC freed 15282 objects / 713544 bytes in 124ms09-02 16:41:27.405 D/dalvikvm( 7345): GC freed 11775 objects / 524576 bytes in 131ms09-02 16:41:28.982 I/wpa_supplicant( 7284): CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys09-02 16:41:28.985 V/WifiMonitor(  646): Event [CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys]09-02 16:41:28.985 V/WifiStateTracker(  646): New network state is DISCONNECTED09-02 16:41:28.985 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=009-02 16:41:28.985 V/WifiMonitor(  646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=0]09-02 16:41:28.995 V/WifiStateTracker(  646): Changing supplicant state: COMPLETED ==&gt;  DISCONNECTED09-02 16:41:29.086 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=209-02 16:41:29.086 V/WifiMonitor(  646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=2]09-02 16:41:29.086 V/WifiStateTracker(  646): Changing supplicant state: DISCONNECTED ==&gt;  SCANNING09-02 16:41:29.086 W/wpa_supplicant( 7284): Failed to initiate AP scan.09-02 16:41:29.095 I/wpa_supplicant( 7284): CTRL-EVENT-SCAN-RESULTS  Ready09-02 16:41:29.095 I/wpa_supplicant( 7284): Trying to associate with 00:1c:f0:6e:2a:56 (SSID='WLANR' freq=2412 MHz)09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key09-02 16:41:29.095 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=309-02 16:41:29.105 V/WifiMonitor(  646): Event [Trying to associate with 00:1c:f0:6e:2a:56 (SSID='WLANR' freq=2412 MHz)]09-02 16:41:29.105 V/WifiMonitor(  646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=3]09-02 16:41:29.125 V/WifiStateTracker(  646): Changing supplicant state: SCANNING ==&gt;  ASSOCIATING09-02 16:41:29.825 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=409-02 16:41:29.825 V/WifiMonitor(  646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=4]09-02 16:41:29.825 V/WifiStateTracker(  646): Changing supplicant state: ASSOCIATING ==&gt;  ASSOCIATED09-02 16:41:29.825 I/wpa_supplicant( 7284): Associated with 00:1c:f0:6e:2a:5609-02 16:41:29.825 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=709-02 16:41:29.825 I/wpa_supplicant( 7284): CTRL-EVENT-CONNECTED - Connection to 00:1c:f0:6e:2a:56 completed (reauth) [id=0 id_str=]09-02 16:41:29.825 I/wpa_supplicant( 7284): wpa_supplicant - IPC_EVENT_AUTH_SUCC09-02 16:41:29.825 V/WifiMonitor(  646): Event [Associated with 00:1c:f0:6e:2a:56]09-02 16:41:29.825 V/WifiMonitor(  646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=7]09-02 16:41:29.845 V/WifiStateTracker(  646): Changing supplicant state: ASSOCIATED ==&gt;  COMPLETED09-02 16:41:29.855 V/WifiMonitor(  646): Event [CTRL-EVENT-CONNECTED - Connection to 00:1c:f0:6e:2a:56 completed (reauth) [id=0 id_str=]]09-02 16:41:29.855 V/WifiStateTracker(  646): New network state is CONNECTED09-02 16:41:29.865 D/WifiStateTracker(  646): Deconfiguring interface and stopping DHCP09-02 16:41:29.865 E/wpa_supplicant( 7284): prepare_filter_struct: type=509-02 16:41:29.945 E/FileUtils( 7345): Download failed09-02 16:41:29.945 E/FileUtils( 7345): java.net.SocketException: The operation timed out</code></pre>","143378","","143378","","2010-09-02 16:47:19","2010-09-02 18:04:03","Download large file in Android","<android><file-download><wifi><socketexception>","2","0","1","",""
"3629331","1","3629442","","2010-09-02 16:55:44","15","4340","<p>I'm trying to divide a page in three parts. I'd like to do it in percentage values, however that is not supported by Android. Instead I have to use <code>android:layout_weight</code>. But I have a hard time understanding it and getting it right. Especially how the actual size gets calculated. Is there a way to get a percentage value (0..100%) out of <code>android:layout_weight</code>?</p><p>I went through a few cases (see attached screenshot) to describe the problems. The colored fields are all <code>&lt;LinearLayout&gt;</code> with <code>android:layout_height=""fill_parent""</code>, because I want the full screen to be divided between those.</p><p><strong>Case 1</strong></p><p><img src=""http://i.stack.imgur.com/FQwIv.png"" alt=""alt text""></p><p>Okay, simple. Every <code>&lt;LinearLayout&gt;</code> gets 33%.</p><p><strong>Case 2</strong></p><p><img src=""http://i.stack.imgur.com/kF1sR.png"" alt=""alt text""></p><p>Ups?! The first (yellow) <code>&lt;LinearLayout&gt;</code> disappears completely? Why?</p><p><strong>Case 3</strong></p><p><img src=""http://i.stack.imgur.com/rhXxa.png"" alt=""alt text""></p><p>Confused again. The yellow <code>&lt;LinearLayout&gt;</code> is back. However, the two first <code>&lt;LinearLayout&gt;</code> with the heavier weight get smaller? What is going on?</p><p><strong>Case 4</strong></p><p><img src=""http://i.stack.imgur.com/AWvuL.png"" alt=""alt text""></p><p>I have absolutely no idea what the maths behind all this is.</p>","184367","","","","","2010-11-23 10:04:27","Android: trying to understand android:layout_weight","<android><layout><weight>","2","0","8","",""
"3629440","1","","","2010-09-02 17:08:04","1","1130","<p>I'm gonna try to introduce briefly what I'm working on, andthen present my question... any help will be very much appreciated!</p><p>I've been trying to connect an Android device to other phones in orderto import their phonebook info over bluetooth, using the phonebookaccess profile. To achieve that, I'm trying to place my device as PCE,while the other phone will act as the PSE.</p><p>I know that the PSE role is already implemented on Android, so I'mlooking into its code and trying to somehow reverse engineer it toimplement the other side.</p><p>So.. my problem is: when the server socket is created, it doesn'tspecify any UUID, it simply starts listening on a port 19, like this:</p><pre><code>mServerSocket = mAdapter.listenUsingRfcommOn(PORT_NUM);</code></pre><p>Wasn't it supposed to register the PBAP service somewhere? How doesother devices discover the service, and more important, which UUIDshould I use when trying to connect in my PCE device with:</p><pre><code>mSocket = mDevice.createRfcommSocketToServiceRecord(UUID_PBAP);</code></pre><p>Thanks, Pedro.</p>","438210","","","","","2013-01-23 12:40:44","Android Bluetooth PBAP","<android><bluetooth><profile>","2","0","1","",""
"3629540","1","3629700","","2010-09-02 17:21:03","1","113","<p>Been trying to get an answer on what I am doing wrong all over the place. I would like the user to select a button in the calling class, open a called listactivity which displays the contents of a database, let the user click an entry, copy that entry into a new database, send back the rowid from the new database to the calling class and have the calling class assign the title from the new database entry to the original button that was pushed.</p><p>Here is the calling class</p><pre><code>static final private int CHOOSE_MONDAY = 0; static final private int CHOOSE_TUESDAY = 0; private int ButtonPushed = 0; private NotesDbAdapter mDbHelper; private MenuDbAdapter menuDbHelper; private Long mRowId; String menuTitle; String menuProtein; String menuBody;@Overrideprotected void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    setContentView(R.layout.plan_menu);    Toast.makeText(this, ""Choose a day to pick a meal for!"", Toast.LENGTH_LONG).show();    mDbHelper = new NotesDbAdapter(this);    mDbHelper.open();    menuDbHelper = new MenuDbAdapter(this);    menuDbHelper.open();}public void mButtonHandler(View target){    switch(target.getId())    {    case R.id.monday:        // Create new intent object and tell it to call the ColorPicker class        Intent question = new Intent(this, PlanMenuList.class);         // Start ColorPicker as a new activity and wait for the result         startActivityForResult(question, CHOOSE_MONDAY);        break;    case R.id.tuesday:        // Create new intent object and tell it to call the ColorPicker class        Intent question1 = new Intent(this, PlanMenuList.class);            // Start ColorPicker as a new activity and wait for the result         startActivityForResult(question1, CHOOSE_TUESDAY);        break;    }</code></pre><p>And then this is the called class where I am trying to copy in the user's selection to the new database and then send back the id to the calling class.</p><pre><code>public class PlanMenuList extends ListActivity {private NotesDbAdapter mDbHelper;private MenuDbAdapter menuDbHelper;private List&lt;Data&gt;data;String menuTitle;String menuProtein;String menuBody;private Long mRowId;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.notes_list);    mDbHelper = new NotesDbAdapter(this);    menuDbHelper = new MenuDbAdapter(this);    mDbHelper.open();    menuDbHelper.open();    fillData(); }private void fillData() {    Cursor notesCursor = mDbHelper.fetchAllNotes();    startManagingCursor(notesCursor);    // Create an array to specify the fields we want to display in the list (only TITLE)    String[] from = new String[]{NotesDbAdapter.KEY_TITLE};    // and an array of the fields we want to bind those fields to (in this case just text1)    int[] to = new int[]{R.id.text1};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter notes =             new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor, from, to);    setListAdapter(notes);}private void populateFields() {    if (mRowId != null) {        Cursor note = mDbHelper.fetchNote(mRowId);        startManagingCursor(note);        menuTitle=(note.getString(                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));        menuProtein=(note.getString(                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_PROTEIN)));        menuBody=(note.getString(                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));    }}protected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    mDbHelper.fetchNote(id);    mRowId = id;    //populateFields();    menuDbHelper.createMenu(""Monday"", menuTitle, menuProtein, menuBody);    Intent answer = new Intent();    answer.putExtra(""MenuDbAdapter.KEY_ROWID"", mRowId);    setResult(RESULT_OK, answer);    finish();}}</code></pre><p>I have been messing around with this thing for days and can't seem to get it to do what I want - any help would be appreciated.</p>","436204","","151445","","2010-09-02 17:35:52","2010-09-02 17:53:16","Database Quandry","<android>","3","0","","",""
"3629644","1","8415597","","2010-09-02 17:35:31","7","7545","<p>I'm looking for a programmatic way to set-up http proxy settings for android handsets.  I've tried using android.provider.Settings.System.putString() to set System.HTTP_PROXY, but my call fails (I'm using a 2.2 emulator image at the moment). My code looks like:</p><pre><code>if (System.putString(getContentResolver(), System.HTTP_PROXY, ""10.10.2.1:8080"")) {    tv.append(""put for HTTP_PROXY succeeded.\n"");}else {    tv.append(""put for HTTP_PROXY failed.\n"");}</code></pre><p>I've also added to my android manifest:</p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" /&gt;&lt;uses-permission android:name=""android.permission.WRITE_SECURE_SETTINGS"" /&gt;</code></pre><p>..although it's not clear from the docs which permission, if any, is required.</p><p>I'm familiar with <a href=""http://stackoverflow.com/questions/2011432/how-do-i-set-a-proxy-in-android-phones"">this SO thread</a>, but the technique there requires manual adb commands, which require the SDK tools and (possibly) a rooted phone. </p><p>Is there a way to accomplish this? Ideally, I'd like away to set an http proxy that will be used for both data and wifi connections.</p>","1362","","","","","2012-03-06 13:21:45","How can you set the http proxy programatically?","<android>","5","0","","",""
"3629688","1","3629839","","2010-09-02 17:42:06","1","115","<p>I have observed from the HDPI, MDPI and LDPI icons from a new Android project, they are in the ratio of 6:4:3 (72:48:36). So would it be a good idea to scale my other drawables in the same ratio? If not what is the best way to scale drawable resources for an application for deployment?</p>","421372","","","","","2010-09-02 18:01:41","Dealing with drawables for various screens sizes","<java><android><user-interface><graphics>","1","0","1","",""
"3629704","1","","","2010-09-02 17:43:46","0","908","<p>I like to display a progress bar on my AppWidget as the Widget downloads data from a server. </p><p>Can someone please post an example or a hint how to implement that?</p>","212021","","212021","","2010-09-06 10:06:22","2010-09-06 10:06:22","Android: How to use Progress bar on AppWidget?","<android><progress-bar><appwidget>","0","3","0","",""
"3629744","1","3631624","","2010-09-02 17:49:20","1","1334","<p>Looked at other posts but, haven't seen the answer I'm looking for...</p><p>I have two layouts: layout-port and layout-land.<br>If I run the app with emulator or device, either vertically or horizontally, the app runs fine with the correct layouts.  </p><p><strong>However, if I rotate either the emulator or device, the app exits. There's no crashing, perse', it just exits.</strong>  </p><p>I have other app's with similarly defined layouts that work fine without any orientation handling in the manifest. I'm not concerned about persisting data.</p><p><strong>The main differences</strong> between the one's that work and this one are (this one has):<br>* Menus with sub-menus<br>* Dialog screens (not the android dialog widget)<br>* Tab widget  </p><p>All of the above items work in their respective layouts (port and land), the app just exits when rotating the emulator or device and I need to restart the app.</p><p>Any recommendations? Thanks<img src=""http://i.stack.imgur.com/60oPY.png"" alt=""alt text""></p><p>The Manifest:</p><p>(deleted)</p>","382200","","382200","","2010-09-14 17:00:43","2010-09-14 17:00:43","Android - Orientation Change - exits app but w/o crashing","<android><orientation><android-layout>","2","4","","",""
"3629816","1","","","2010-09-02 17:58:41","0","218","<p>The Google doc's cover every one of the sensors except the temperature sensor, but continue to say that you can access that data...........it's aggrevating as heck, the doc's are very good in some parts and very bad in others.</p><p>I have no problem getting the data from the other sensors so I'm quite sure my code is good.  Would love some insite on how to retrieve the temp sensors value(s).  </p>","438250","","","","","2010-11-02 04:58:51","Can only get a value of false to return when accessing Sensor.TYPE_TEMPERATURE","<android><sensor><temperature>","1","1","1","",""
"3629821","1","","","2010-09-02 17:59:23","0","665","<p>OK, I have a list activity in my application.I have tried to make it so that when a list item is selected to show the selection the background of the view should change. But now when I select one item, the item does get selected, but the background of random list items changes at the same time, but the selection is still correct.Where am I making the mistake?</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    // TODO Auto-generated method stub    super.onListItemClick(l, v, position, id);    Cursor c = (Cursor) mAdapter.getItem(position);    String a = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));    String b = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));    if (names != null)    {        if(numbers.contains(b))        {            names = names.replace(a+"";"", """");            numbers = numbers.replace(b+"";"", """");            v.setBackgroundResource(R.drawable.background);        }        else{            names = names + a + "";"";            numbers = numbers + b + "";"";            v.setBackgroundResource(R.drawable.background_sel);        }    }    else    {        names = a+"";"";        numbers = b+"";"";        v.setBackgroundResource(R.drawable.background_sel);    }}</code></pre>","434885","","63550","","2011-01-20 22:14:05","2011-01-20 22:14:05","Android list activity","<android>","1","0","","",""
"3629833","1","3642750","","2010-09-02 18:01:16","2","1553","<p>I am creating an Android application for a customer which will be pre-installed and distributed together with the handsets. Now the customer asked me to lock down the ROM to prevent the future users from using anything else apart from this one app. I.e. no browsing, no email, nothing which could create any costs etc.</p><p>Now after some googling it seems to be relatively straightforward to remove applications from an Android image. But even if I can remove the web browser, email client, the Android Market App etc, how can I make sure that the user will not reinstall those apps via the USB connector? As Android is just Linux I am sure there are ways of denying all users the right to install new applications (or actually denying them pretty much anything apart from using this one app).</p><p>If somebody could point me in the right direction it would be much appreciated.</p><p>EDIT:To clarify things a bit, the customer does not want to use the android devices as phones, even though they are phones. With 100€ touch screen phones becoming available, it becomes viable to use those phones for just one specific purpose. In my customers case, the device  will be used as something like a POS system: the employee uses the phone to process a certain kind of customer request, and for this the app needs to have a data connection which will accrue costs of course. Now obviously contracts can be set up that will oblige employees to pay any irregular costs themselves, but why make it that complicated?</p><p>This is not about taking freedom away from users but rather about using android phones as general purpose touch screen devices with a data connection that employees can use in a business environment without shooting themselves in the foot with unexpected high data connection cost.</p>","400332","","400332","","2010-09-04 13:38:32","2011-09-29 22:44:39","modify a an existing Android ROM to control user actions","<android>","3","5","1","",""
"3629855","1","","","2010-09-02 18:03:57","0","2045","<p>hey guys i am developing a final year location-based project(gps) in android.I have to create a server using php and mysql which contains name and location(in latitude and longitude) of important hospitals in Mumbai.The android client should be able to retrieve the the latitude and longitude of locations in mysql(external) database and then plot it on a google map.</p><p>Could u plzz tell me whether this is possible?If yes, then how?Any help would be appreciated....cheers</p>","438256","","402253","","2010-09-02 18:15:46","2010-11-05 23:34:34","connecting android with mysql","<php><mysql><android><client-server><application-design>","3","0","","",""
"3629856","1","3631557","","2010-09-02 18:04:00","2","10541","<p>I just installed the <code>SDK</code> and the <code>ADT Eclipse plugin</code>. What I was trying to do is a simple ""Hello, World"" program. I am using the <code>2.2 (8) API</code>. Here's my code:</p><pre><code>package com.example.hello;import android.app.Activity;import android.widget.TextView;import android.os.Bundle;    public class HelloWorld extends Activity {        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState)         {            super.onCreate(savedInstanceState);            setContentView(R.layout.main);            TextView txt = new TextView(this);            txt.setText(""Hello, Android"");            setContentView(txt);        }    }</code></pre><p>My <code>Eclipse</code> console:</p><pre><code>[2010-09-02 13:27:32 - HelloWorld] ------------------------------[2010-09-02 13:27:32 - HelloWorld] Android Launch![2010-09-02 13:27:32 - HelloWorld] adb is running normally.[2010-09-02 13:27:32 - HelloWorld] Performing com.example.hello.HelloWorld activity launch[2010-09-02 13:27:32 - HelloWorld] Automatic Target Mode: Preferred AVD 'Android' is not available. Launching new emulator.[2010-09-02 13:27:32 - HelloWorld] Launching a new emulator with Virtual Device 'Android'[2010-09-02 13:28:12 - HelloWorld] New emulator found: emulator-5554[2010-09-02 13:28:12 - HelloWorld] Waiting for HOME ('android.process.acore') to be launched...</code></pre><p>And on my emulator (5554:Android) there is nothing displayed but a blank screen with a cool fonted ""Android"" imprint. What am I fundamentally missing ?</p>","346583","","493939","","2012-05-02 06:08:34","2012-10-20 01:36:19","Android Hello World application not working, no text is displayed on the emulator","<android><adt>","7","0","2","",""
"3629995","1","","","2010-09-02 18:22:46","0","1356","<p>i need to make a timer service and bind it to an activity... i cant do it...can someone share an example of such a thing or a tutorial...ive already gone through<a href=""http://developer.android.com/resources/samples/BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChatService.html"" rel=""nofollow"">http://developer.android.com/resources/samples/BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChatService.html</a>and the adnroid developer documention guideplease help:/</p>","434885","","","","","2010-09-02 19:22:17","android timer service","<android>","1","1","","",""
"3630086","1","3630331","","2010-09-02 18:35:47","34","18991","<p>I would like to get height too if possible.</p>","438274","","229106","","2010-09-02 19:08:00","2013-08-13 09:14:26","How to get string width on Android?","<android><string><bounding-box>","3","0","13","",""
"3630180","1","","","2010-09-02 18:45:44","1","1632","<p>I'm trying to place a set of Checkboxes within the same RadioGroup in a tabular fashion.</p><p>Something like this:</p><pre><code>  [Check1] [Check2]  [Check3] [Check4]</code></pre><p>I tried to have a couple of TableRow objects within the RadioGroup, but that removes the ""group behaviour"" and allows more than one Checkbox can be selected at the same time.</p><p>I am able to put all the items on a single line (by setting the RadioGroup's ""orientation"" to ""horizontal"") but not in a grid like style.</p><p>Any ideas?</p><p>Thanks.</p>","425749","","","","","2012-08-27 06:00:22","Display a RadioGroup's itens in a table like form","<android><checkbox>","0","1","","",""
"3630445","1","10566163","","2010-09-02 19:21:08","6","1258","<p>I'm building a test version of an app for a client. Part of this app uses a WebView that calls out to a SSL-based site. In turn, the client has provided a test domain where the certificate name does not match the FQDN. Alas, they are not in a position to provision a cert that matches. :(</p><p>I'm working around this issue on the companion iOS ad hoc app with one line of code (again, not for production use - just for test purposes). I have searched for similar info on Android OS, but the solutions I've seen here and elsewhere are enough to make my head spin big time by comparison!</p><p>Is there a straightforward way to work around this? Even a user-facing setting tucked away somewhere?</p><p>Clues appreciated!</p>","126660","","126660","","2010-09-02 19:49:42","2012-05-12 18:01:43","Android WebView SSL 'Security Warning'","<testing><android><webview><ssl-certificate><android-webview>","1","0","1","",""
"3630457","1","3630576","","2010-09-02 19:22:21","7","13752","<p>from what I can incur out of the SharedPreferences documentation, I can update a preference, add one or clear all preference values in a shared preference file.</p><p>But I want to completely clear everything inside a shared preference file, not just the values, but the preferences they refer to as well.</p>","223876","","","","","2011-02-24 11:38:42","Clearing preferences in SharedPreferences in Android, not just Values","<java><android><mobile>","2","0","1","",""
"3630468","1","","","2010-09-02 19:24:10","4","14293","<p>I'm just beginning Android development, and I'm working to get a Custom listview with a checkbox working. I've created a base class that extends <strong>Activity</strong>, Created an Adapter and overrode the getView() method to add the checkbox to the listview. I'm assuming I need to do this because I need something equivalent to <code>didSelectRowIndexAtPath</code> from Obj C to update my model. Please let me know if there's an alternate way of doing this too!</p><p>Now in my base class, I have the following code -</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //setContentView(R.layout);    setContentView(R.layout.facilityscreen);    /* Static Data source */    facilityModel = new FacilityDataModel[2];    facilityModel[0] = new FacilityDataModel();    facilityModel[1] = new FacilityDataModel();    facilityModel[0].setFacilityName(""Test 1"");    facilityModel[0].setFacilityID(""Facid0001"");    facilityModel[0].setChecked(false);    facilityModel[1].setFacilityName(""Test 2"");    facilityModel[1].setFacilityID(""Facid0002"");    facilityModel[1].setChecked(true);    facilityListView = (ListView) findViewById(R.id.facilityListView);    FacilityScreenAdapter adapter = new FacilityScreenAdapter(this, facilityModel);    facilityListView.setAdapter(adapter);        myPatBtn = (Button) findViewById(R.id.myPatBtn);    myPatBtn.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View arg0) {            // TODO Auto-generated method stub            int i=0;            i++;        }});    facilityListView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,                int arg2, long arg3) {            int i=0;            i++;        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {            // TODO Auto-generated method stub        }    });}    </code></pre><p>My problem now is the setOnItemSelectedListener isn't getting called at all. Been struggling with this for a couple of hours now, and I can't figure out why it wouldn't get called at all.</p><p>Any help is much appreciated!</p><p>Thanks, <br />Teja.</p>","116858","","","","","2013-10-16 09:42:23","Android custom listview, setOnItemSelectedListener not working","<android><listview>","3","0","3","",""
"3630733","1","3630879","","2010-09-02 19:58:19","10","9713","<p>I have made an app that sets notifications in the drop-down status bar of Android phones. However, there is a bug in my code (sometimes the notifications are set, sometimes they are not). I want to be able TO CHECK (in the code) IF THE NOTIFICATION IS VISIBLE TO THE USER. (i.e. can the user see the notification in the status bar?). </p><p>How can I do this? (Thanks in advance).</p><p>Sample code is greatly appreciated.</p>","399717","","","","","2013-11-13 22:06:09","How to check which notifications are active in status bar in Android Dev?","<android>","4","0","5","",""
"3630780","1","3631149","","2010-09-02 20:05:26","1","541","<p>Is there any way that I can link a keyword in a TextView to a file or directory on the user's SD card? My app produces stack trace files when it crashes and I want the user to able to click a link in my About dialog to view either the latest one or the folder containing all of them. (Something like ""If this app crashes, please send [link]the latest stack.trace file[/link] to us at myapp@example.com."")</p><p>I know it is possible to use the following code to make a Web link but I tried to modify it to use ""file:///sdcard/path/to/file/stack.trace"" which causes my app to Force Close when the link is clicked.</p><pre><code>&lt;string name=""strSample""&gt;This is Web link to &amp;lt;a href=&amp;quot;http://www.google.com&amp;quot;&gt;Google&amp;lt;/a&gt;!&lt;/string&gt;final TextView tvSample = (TextView)findViewById(R.id.tvSample);tvSample.setMovementMethod(LinkMovementMethod.getInstance());String strSample = getResources().getString(R.string.strSample);tvSample.setText(Html.fromHtml(strSample));</code></pre>","192185","","","","","2010-09-02 20:49:12","Link keyword in TextView to file/directory","<android><file><directory><hyperlink><textview>","1","0","","",""
"3630873","1","3630950","","2010-09-02 20:16:52","13","10931","<p>This happened to two programs of mine now and makes absolutely no sense. It usually comes about when I'm adding a resource file (in this case, a menu). In the package explorer:-the project name has a small red x, indicating that there is an error in one of its files-none of the sub-folders or files have an x or show any red highlights</p><p>None of my code has errors! Ocasionally, I see this:</p><pre><code>[2010-09-02 16:09:20 - FallDown] 'default' is not a best match for any device/locale combination.[2010-09-02 16:09:20 - FallDown] Displaying it with 'Normal, Not Long, Landscape, Medium Density, Finger, Soft, Qwerty, Trackball, 480x320'</code></pre><p>What is going on?</p>","426554","","768935","","2013-09-24 19:57:23","2013-09-24 19:57:23","eclipse tells me my project has errors, nothing is red-highlighted","<android><eclipse>","4","0","2","2013-09-25 01:26:05",""
"3630980","1","3631421","","2010-09-02 20:29:58","3","233","<p>This app has multiple activities: eg: Activity1 -> Activity2 -> Activity3. If the app is opened after the Home button is used while in Activity2, the app returns to Activity2, but the desired functionality is for the app to always start with Activity1 from the launcher. Adding a finish() to the onStop() for Activity2 does cause app to start with Activity1 following use of the Home button, but then Activity3 causes the app to revert to Activity1 when it finishes, rather than Activity2, which is also undesirable. Is there a way to force the app to always start with Activity1 following use of the Home button?</p><pre><code>public class Activity1 extends Activity {    ...    public void onCreate(Bundle savedInstanceState) {        ...        button1.setOnClickListener(new OnClickListener() {            public void onClick(View arg0) {                startActivity(Activity2);                ...public class Activity2 extends Activity {    ...    private boolean applyMenuChoice(MenuItem item) {        switch (item.getItemId()) {        case R.id.menuItem1:            startActivity(Activity3);            ...</code></pre>","398460","","","","","2010-09-02 21:26:21","Is there a way to force the app to always start with Activity1 following use of the Home button?","<java><android>","1","0","","",""
"3631200","1","4795662","","2010-09-02 20:56:17","1","3661","<p>I want to develop an android application that will be able to launch tcpdump. Can any one give me any suggestion regarding this issue? </p><p>thankskaisar</p>","438383","","","","","2011-06-01 22:29:42","running tcpdump from android application","<android>","1","1","","",""
"3631201","1","","","2010-09-02 20:56:33","14","10732","<p>I have a similar problem to <a href=""http://stackoverflow.com/questions/2824820/unable-to-load-library-at-runtime-in-android-application"">this question</a>, but slightly different.  I have compiled a .so library to use with JNI.  Because it is large (15 MB), I am putting it on the SDCard instead of in the standard application place.</p><p>The file is called libSample.so and it's located at <code>/data/library/libSample.so</code></p><p>I load it in a static initialization block:</p><pre><code>try {        File sdcard = Environment.getExternalStorageDirectory();        File libraryLoc = new File(sdcard.getAbsolutePath() + ""/library/libSample.so"");        Log.i(""Library"", ""Does the library exist?"" + libraryLoc.exists());        System.load(libraryLoc.getAbsolutePath());    }    catch (UnsatisfiedLinkError e) {        Log.e(""Translator"", e.getMessage());        Log.e(""Translator"", e.toString());    }</code></pre><p>Here's the relevant logcat output:</p><pre><code>09-02 16:42:58.882: DEBUG/dalvikvm(4185): Trying to load lib /data/data/com.example.hellojni/lib/libhello-jni.so 0x434fb6f809-02 16:42:58.892: DEBUG/dalvikvm(4185): Added shared lib /data/data/com.example.hellojni/lib/libhello-jni.so 0x434fb6f809-02 16:42:58.892: DEBUG/dalvikvm(4185): No JNI_OnLoad found in /data/data/com.example.hellojni/lib/libhello-jni.so 0x434fb6f809-02 16:42:58.892: INFO/Library(4185): Library exists: true09-02 16:42:58.902: INFO/Library(4185): Library can be read: true09-02 16:42:58.902: DEBUG/dalvikvm(4185): Trying to load lib /sdcard/library/libSample.so 0x434fb6f809-02 16:42:58.902: INFO/dalvikvm(4185): Unable to dlopen(/sdcard/library/libSample.so): Cannot find library09-02 16:42:58.912: ERROR/Translator(4185): Library /sdcard/library/libSample.so not found09-02 16:42:58.912: ERROR/Translator(4185): java.lang.UnsatisfiedLinkError: Library /sdcard/library/libSample.so not found</code></pre><p>Any idea what's wrong?</p><p>I read the post about <a href=""http://stackoverflow.com/questions/3170619/can-android-load-dlls-from-sdcard-in-native-mode"">can android load dll's from sdcard in native mode</a> which said that the sdcard cannot be used to load libraries, so I moved the .so into /data/data/com.example.hellojni/lib/libSample.so (the private app data storage location).  No change:</p><pre><code>09-02 16:53:18.332: DEBUG/dalvikvm(4515): Trying to load lib /data/data/com.example.hellojni/lib/libhello-jni.so 0x434fb6f809-02 16:53:18.342: DEBUG/dalvikvm(4515): Added shared lib /data/data/com.example.hellojni/lib/libhello-jni.so 0x434fb6f809-02 16:53:18.342: DEBUG/dalvikvm(4515): No JNI_OnLoad found in /data/data/com.example.hellojni/lib/libhello-jni.so 0x434fb6f809-02 16:53:18.352: INFO/Library(4515): Library exists: true09-02 16:53:18.352: INFO/Library(4515): Library can be read: true09-02 16:53:18.352: DEBUG/dalvikvm(4515): Trying to load lib /data/data/com.example.hellojni/lib/libSample.so 0x434fb6f809-02 16:53:18.482: INFO/dalvikvm(4515): Unable to dlopen(/data/data/com.example.hellojni/lib/libSample.so): Cannot find library09-02 16:53:18.492: ERROR/Translator(4515): Library /data/data/com.example.hellojni/lib/libSample.so not found09-02 16:53:18.492: ERROR/Translator(4515): java.lang.UnsatisfiedLinkError: Library /data/data/com.example.hellojni/lib/libSample.so not found</code></pre><p>What I don't understand is that clearly the library exists, and the OS is trying to load it ... so what would make it fail?</p><p>Following the advice of one of the commentors, I tried attaching via strace to get more detailed error information.  The log can be found as a <a href=""http://gist.github.com/588375"">github gist</a>.</p><p>The error appears to be on lines 47-51:</p><pre><code>mprotect(0x4235d000, 4096, PROT_READ)   = 0ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbeb58080) = -1 ENOTTY (Not a typewriter)write(1, ""bionic/linker/linker.c:1243| ERROR:    34 unknown reloc type 3 @ 0x811a854c (2441)\n"", 83) = 83write(1, ""bionic/linker/linker.c:1641| ERROR: failed to link /data/data/com.example.hellojni/lib/libSample.so\n"", 100) = 100munmap(0x81000000, 8839168)             = 0</code></pre><p>Here's the readelf of the library:</p><pre><code>arm-eabi-readelf -d libSample.so Dynamic section at offset 0x80b648 contains 17 entries:  Tag        Type                         Name/Value 0x00000019 (INIT_ARRAY)                 0x7ff234 0x0000001b (INIT_ARRAYSZ)               76 (bytes) 0x00000004 (HASH)                       0xd4 0x00000005 (STRTAB)                     0x7f41c 0x00000006 (SYMTAB)                     0x2650c 0x0000000a (STRSZ)                      1197287 (bytes) 0x0000000b (SYMENT)                     16 (bytes) 0x00000003 (PLTGOT)                     0x80c6f0 0x00000002 (PLTRELSZ)                   76480 (bytes) 0x00000014 (PLTREL)                     REL 0x00000017 (JMPREL)                     0x1ccb84 0x00000011 (REL)                        0x1a3904 0x00000012 (RELSZ)                      168576 (bytes) 0x00000013 (RELENT)                     8 (bytes) 0x00000016 (TEXTREL)                    0x0 0x6ffffffa (RELCOUNT)                   2412 0x00000000 (NULL)                       0x0</code></pre>","155392","","155392","","2010-09-20 18:26:27","2013-09-18 18:10:16","Android - failure on loading library","<java><android><jni><native>","4","3","3","",""
"3631224","1","3632523","","2010-09-02 20:58:57","0","660","<p>Is there a way to animate drawables on a canvas using the android built-in animation classes?</p><p>I’ve been modeling my test application, a game, after the example apps lunarlander and jetboy.  They contain a lot of reusable code, but they manually update the drawable objects in real time.  It seems like using the android animation built ins would be so much easier since they provide the type of animation I need…a simple linear movement.</p><p>Is there a way to do this, or am I better off updating my canvas in real time much like the example apps.</p><p>If there is a way, could anyone get me started with some sample code?  I am currently inheriting SurfaceView in my class.</p><p>Thanks.</p>","432209","","","","","2011-10-05 08:07:29","Animating a drawable on a canvas inside a surfaceview","<java><android><eclipse>","1","0","0","",""
"3631273","1","3631820","","2010-09-02 21:06:55","1","878","<p>When I run this code from Java project it works fine.</p><pre><code>InetAddress ia=null;    try {        ia = InetAddress.getByName(""www.google.com"");    } catch (UnknownHostException e) {        e.printStackTrace();    }    System.out.println(ia.getHostAddress());</code></pre><p>When i try the same code from emulator (already tried few versions) I'm getting UnknownHostException. Internet works fine on emulator and I'm able to connect to IP address like ""93.86.230.251"" but never to hostname ""something.org"".</p><p>Please help</p>","438395","","","","","2010-09-02 22:37:27","Android emulator cannot resolve internet address","<android><emulator>","1","0","","",""
"3631287","1","3631329","","2010-09-02 21:08:26","0","805","<p>I have the following code:</p><pre><code>Intent myIntent = new Intent(Intent.ACTION_VIEW,    ContentURI.create(arAdapter.getItem(position).getUrl()));    startActivity(myIntent);</code></pre><p>But I get the compile time error:</p><pre><code>ContentURI cannot be resolved.</code></pre><p>How can I fix this? or is there a different way to launch the android browser?</p>","19875","","","","","2012-08-05 20:58:16","How to launch the android browser?","<android><security><browser><android-intent>","2","1","1","",""
"3631370","1","","","2010-09-02 21:19:23","27","16537","<p>My application has an assets directory in which I've dumped a bunch of text files I need to load at runtime.</p><p>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.</p><p>I have code like this:</p><pre><code>AssetManager assetMgr = getAssets();String[] assetsIWant = assetMgr.list(""subdir"");for(String asset: assetsIWant) {  doAssetyThing(asset);}</code></pre><p>I've tried a zillion different versions of the parameter to assetMgr.list() and am not getting anywhere.</p><p>If I use ""/"", I get back a list containing the ""assets"" directory, and a few random other items (META_INF, for example).  If I pass any other string (like ""assets"" or ""assets/"" or ""/assets"" or ""/assets/"" or ""mysubdir"" or ""/mysubdir"" or ""assets/mysubdir"" or ...) then I get back an empty array.</p><p>The documentation is unfortunately fairly incoherent.</p><p>Does anybody know what the correct formula for that list() parameter is?  </p>","397155","","114066","","2012-06-13 12:30:19","2013-12-25 01:07:12","List assets in a subdirectory using AssetManager.list","<java><android>","9","0","6","",""
"3631383","1","3632332","","2010-09-02 21:21:27","2","711","<p>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 Galileo.   We're using the latest SDK.</p><p>Where can I get an idea of what the differences and improvements are between the different versions of Eclipse Classic's, (e.g. Galileo vs Helios) so I can form an opinion about whether we should switch to the latest version?   (the latest version of Classic is 3.6) </p><p>Thanks for any comments.</p>","424690","","","","","2010-09-03 00:52:40","Eclipse Classic Version Differences?","<android><eclipse>","1","0","","",""
"3631558","1","3687753","","2010-09-02 21:47:50","6","735","<p>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.</p><p>That is, they show up at the root of the dominator tree. The OQL <code>SELECT objects e FROM com.unboundid.ldap.sdk.LDAPException e WHERE (inbounds(e).length = 0)</code> returns over 20,000 results, totalling to nearly all of the heap.  And yet, the GC runs before the heap dump and I can see that it's running in the console, repeatedly, during the execution of the leaky code.  If these instances have no inbound refs, what could be keeping them alive?</p><p>I also tried doing a ""shortest paths to GC"" query.  It shows one LDAPConnectionReader row retaining 2 instances, and ~20k <code>LDAPException @ &lt;addr&gt; unknown</code> rows with various hex addresses.</p><p><strong>Update</strong>: I haven't had time to further diagnose this since posting it, and the bounty I posted is ending before I likely will.  I'm awarding it as best I can now, lest the points go to waste.  Thanks to everyone who looked into this!  I will come back later and update again with the results of further diagnosis, when life is a little less hectic.</p>","197325","","197325","","2010-09-14 06:28:10","2010-09-14 06:28:10","How to debug memory leak where exception instances in heap dump have no inbound references?","<java><android><memory-leaks>","3","1","1","",""
"3631661","1","3631772","","2010-09-02 22:09:42","8","3170","<p>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 reference to the string at the cursor position.  </p><p>Does such a facility exist?</p>","403455","","403455","","2012-01-05 23:13:38","2012-12-26 14:28:27","Automatic Code Generation for Strings.xml from Eclipse","<android><string><code-generation>","1","0","3","",""
"3631764","1","","","2010-09-02 22:25:59","0","1228","<p>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.</p><pre><code>Display display = getWindowManager().getDefaultDisplay();    int width = display.getWidth();     int height = display.getHeight();</code></pre><p>When i set it i get width of 320 and height 570. that looks wrong, it should be 320x480. i want to place a 300x50 image on the bottom of the screen on any device (actually) so normally i would get the height of the screen and minus the image height so it places it on a view. but since i am getting 570 for some reason, i have to scroll down to see the image. why is it getting the wrong screen size and is there another more accurate way of getting the size. Thank you</p><p>Layout code goes as follows</p><pre><code>   linearOut = new LinearLayout(this);    linear = new LinearLayout(this);    linear.setOrientation(LinearLayout.VERTICAL);    scroll = new ScrollView(this);    linearOut.addView(scroll);    scroll.addView(linear);            linear.addView(text);    linear.addView(bbottom.getViewGroup());    setContentView(linearOut);</code></pre>","423305","","","","","2010-09-02 23:04:44","Unable to get the correct screen size using Services for Android","<android><fullscreen>","2","0","","",""
"3631795","1","","","2010-09-02 22:34:12","3","8418","<p>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)...</p><p>The error is either thrown when calling setContentView or shortly after. </p><p>This is the code block that throws the error: </p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    if(DebugFlags.LOG_MEMORY)    {        MemoryAnalyser.logHeap(this.getClass());    }    setContentView(R.layout.activity_stats);    try    {    monthsAvailable = getMonthTimeStamps();    Spinner xSpin = (Spinner) findViewById(R.id.spinnerTimespan);    m_adapterForSpinner = new ArrayAdapter&lt;CharSequence&gt;(this, android.R.layout.simple_spinner_item);           m_adapterForSpinner.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    xSpin.setAdapter(m_adapterForSpinner);    for(Iterator&lt;monthObject&gt; i = monthsAvailable.iterator();i.hasNext();)    {        monthObject xObj = i.next();        String dateString = String.format(""%1$te.%1$tm.%1$tY - %2$te.%2$tm.%2$tY"", xObj.fromDate, xObj.toDate);        m_adapterForSpinner.add(dateString);    }    xSpin.setSelection(xSpin.getCount()-1);    xSpin.setOnItemSelectedListener(this);    //setupStatData(null, null);    checkStatsAvailable();    //throw(new java.lang.OutOfMemoryError());    }     catch(java.lang.OutOfMemoryError e)     {         MemoryAnalyser.dumpHeap();         MemoryAnalyser.logHeap(this.getClass());         Toast xToast = Toast.makeText(getApplicationContext(), ""OutOfMemoryException - bitte Log und Datei com.eventkontor.networkcheck.hprof auf SD-Karte an Entwickler senden"", 5000);         xToast.show();         this.finish();     }    if(DebugFlags.LOG_MEMORY)    {        MemoryAnalyser.logHeap(this.getClass());    }}</code></pre><p>as i said - the error is usually thrown when calling setContentView or when calling getMonthTimeStamps()</p><p>getMonthTimeStamps is a helper function which creates a list of dates available in the internal database. It creates a couple of (small objects) and returns an ArrayList. Here is the function</p><pre><code>private ArrayList&lt;monthObject&gt; getMonthTimeStamps(){    ArrayList&lt;monthObject&gt; dates = new ArrayList&lt;monthObject&gt;();    Cursor c = getContentResolver().query(CallLogTableMetaData.CONTENT_URI, new String[]{CallLogTableMetaData.CALLOG_DATE}, null, null, CallLogTableMetaData._ID + "" asc"");    try{    if(c.moveToFirst())    {        SharedPreferences prefs = Utils.getPreferences(this);        int resetDay = prefs.getInt(""pref_callog_reset_day"", 1);        prefs = null;        long starttime = c.getLong(0);        c.close();        c=null;        Date startDate = new Date(starttime);        GregorianCalendar today = new GregorianCalendar();        GregorianCalendar xCal = new GregorianCalendar();        xCal.setTime(startDate);        xCal.set(GregorianCalendar.DAY_OF_MONTH, resetDay);        while(xCal.before(today))        {            monthObject xObj = new monthObject();            xObj.setTimestamp(xCal.getTimeInMillis());            xObj.setFromDate(xCal.getTime());            xCal.add(GregorianCalendar.MONTH, 1);            xCal.set(GregorianCalendar.DAY_OF_MONTH, resetDay);            xCal.set(Calendar.HOUR_OF_DAY, 0);            xCal.set(Calendar.MINUTE, 0);            xCal.set(Calendar.SECOND, 0);            xCal.set(Calendar.MILLISECOND, 0);            xObj.setToDate(xCal.getTime());            xObj.setToTimestamp(xCal.getTimeInMillis());            dates.add(xObj);            xObj = null;        }        xCal = null;        today = null;        return dates;    }    else    {        return dates;    }    }    finally{        try        {            c.close();        }        catch(Exception e)        {        }    }    }</code></pre><p>I'm not claiming that my code is flawless or perfect, but i really don't understand why this error is thrown. The XML-layout doesn't contain any references to images and not very complicated (textview, spinner, tablelayout). </p><p>Here is the error log i received from one user: </p><pre><code>I/ActivityManager(16789): Starting activity: Intent { cmp=com.eventkontor.networkcheck/.StatActivity }D/dalvikvm( 5053): GC freed 8267 objects / 556152 bytes in 45msD/dalvikvm( 5053): GC freed 1716 objects / 371240 bytes in 45msD/dalvikvm( 5053): GC freed 15 objects / 62936 bytes in 56msD/dalvikvm( 5053): GC freed 4 objects / 233856 bytes in 77msD/dalvikvm( 5053): GC freed 14 objects / 544 bytes in 83msW/ActivityManager(16789): Launch timeout has expired, giving up wake lock!W/ActivityManager(16789): Activity idle timeout for HistoryRecord{46a4b878 com.eventkontor.networkcheck/.StatActivity}D/dalvikvm( 5053): GC freed 3 objects / 210456 bytes in 107msD/dalvikvm( 5053): GC freed 3 objects / 315656 bytes in 118msD/dalvikvm( 5210): GC freed 7752 objects / 904320 bytes in 1116msD/dalvikvm( 5053): GC freed 2 objects / 48 bytes in 136msD/dalvikvm( 5053): GC freed 3 objects / 473448 bytes in 155msD/dalvikvm(  641): GC freed 4397 objects / 781024 bytes in 1246msD/dalvikvm( 5053): GC freed 2 objects / 48 bytes in 175msD/dalvikvm( 5053): GC freed 2 objects / 56 bytes in 203msI/dalvikvm-heap( 5053): Clamp target GC heap from 24.522MB to 24.000MBD/dalvikvm( 5053): GC freed 3 objects / 710120 bytes in 207msI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBD/dalvikvm( 5053): GC freed 2 objects / 56 bytes in 220msI/dalvikvm-heap( 5053): Clamp target GC heap from 24.012MB to 24.000MBI/dalvikvm-heap( 5053): Grow heap (frag case) to 24.000MB for 16-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 238msI/dalvikvm-heap( 5053): Forcing collection of SoftReferences for 24-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 220msE/dalvikvm-heap( 5053): Out of memory on a 24-byte allocation.I/dalvikvm( 5053): ""HeapWorker"" daemon prio=5 tid=5 RUNNABLEI/dalvikvm( 5053):   | group=""system"" sCount=0 dsCount=0 s=N obj=0x44e0eab8 self=0x14a298I/dalvikvm( 5053):   | sysTid=5054 nice=0 sched=0/0 cgrp=default handle=1351480I/dalvikvm( 5053):   at com.android.internal.os.BinderInternal$GcWatcher.finalize(BinderInternal.java:~48)I/dalvikvm( 5053):   at dalvik.system.NativeStart.run(Native Method)I/dalvikvm( 5053): E/dalvikvm( 5053): Out of memory: Heap Size=22791KB, Allocated=22204KB, Bitmap Size=1806KBI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 291msI/dalvikvm-heap( 5053): Forcing collection of SoftReferences for 40-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 220msE/dalvikvm-heap( 5053): Out of memory on a 40-byte allocation.I/dalvikvm( 5053): ""main"" prio=5 tid=3 RUNNABLEI/dalvikvm( 5053):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x4001b470 self=0xbdd0I/dalvikvm( 5053):   | sysTid=5053 nice=0 sched=0/0 cgrp=default handle=-1343993180I/dalvikvm( 5053):   at com.eventkontor.networkcheck.StatActivity.getMonthTimeStamps(StatActivity.java:~270)I/dalvikvm( 5053):   at com.eventkontor.networkcheck.StatActivity.onCreate(StatActivity.java:119)I/dalvikvm( 5053):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)I/dalvikvm( 5053):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)I/dalvikvm( 5053):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)I/dalvikvm( 5053):   at android.app.ActivityThread.access$2200(ActivityThread.java:126)I/dalvikvm( 5053):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)I/dalvikvm( 5053):   at android.os.Handler.dispatchMessage(Handler.java:99)I/dalvikvm( 5053):   at android.os.Looper.loop(Looper.java:123)I/dalvikvm( 5053):   at android.app.ActivityThread.main(ActivityThread.java:4595)I/dalvikvm( 5053):   at java.lang.reflect.Method.invokeNative(Native Method)I/dalvikvm( 5053):   at java.lang.reflect.Method.invoke(Method.java:521)I/dalvikvm( 5053):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)I/dalvikvm( 5053):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)I/dalvikvm( 5053):   at dalvik.system.NativeStart.main(Native Method)I/dalvikvm( 5053): E/dalvikvm( 5053): Out of memory: Heap Size=22791KB, Allocated=22204KB, Bitmap Size=1806KBI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 231msI/dalvikvm-heap( 5053): Forcing collection of SoftReferences for 24-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 220msE/dalvikvm-heap( 5053): Out of memory on a 24-byte allocation.I/dalvikvm( 5053): ""HeapWorker"" daemon prio=5 tid=5 RUNNABLEI/dalvikvm( 5053):   | group=""system"" sCount=0 dsCount=0 s=N obj=0x44e0eab8 self=0x14a298I/dalvikvm( 5053):   | sysTid=5054 nice=0 sched=0/0 cgrp=default handle=1351480I/dalvikvm( 5053):   at com.android.internal.os.BinderInternal$GcWatcher.finalize(BinderInternal.java:~48)I/dalvikvm( 5053):   at dalvik.system.NativeStart.run(Native Method)I/dalvikvm( 5053): E/dalvikvm( 5053): Out of memory: Heap Size=22791KB, Allocated=22204KB, Bitmap Size=1806KBI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBI/dalvikvm( 5053): Uncaught exception thrown by finalizer (will be discarded):I/dalvikvm( 5053): Ljava/lang/OutOfMemoryError;: [memory exhausted]I/dalvikvm( 5053): at dalvik.system.NativeStart.main(Native Method)D/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 237msI/dalvikvm-heap( 5053): Forcing collection of SoftReferences for 24-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.012MB to 24.000MBD/dalvikvm( 5053): GC freed 1 objects / 16 bytes in 220msE/dalvikvm-heap( 5053): Out of memory on a 24-byte allocation.I/dalvikvm( 5053): ""main"" prio=5 tid=3 RUNNABLEI/dalvikvm( 5053):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x4001b470 self=0xbdd0I/dalvikvm( 5053):   | sysTid=5053 nice=0 sched=0/0 cgrp=default handle=-1343993180I/dalvikvm( 5053):   at com.eventkontor.networkcheck.StatActivity.getMonthTimeStamps(StatActivity.java:~270)I/dalvikvm( 5053):   at com.eventkontor.networkcheck.StatActivity.onCreate(StatActivity.java:119)I/dalvikvm( 5053):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)I/dalvikvm( 5053):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)I/dalvikvm( 5053):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)I/dalvikvm( 5053):   at android.app.ActivityThread.access$2200(ActivityThread.java:126)I/dalvikvm( 5053):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)I/dalvikvm( 5053):   at android.os.Handler.dispatchMessage(Handler.java:99)I/dalvikvm( 5053):   at android.os.Looper.loop(Looper.java:123)I/dalvikvm( 5053):   at android.app.ActivityThread.main(ActivityThread.java:4595)I/dalvikvm( 5053):   at java.lang.reflect.Method.invokeNative(Native Method)I/dalvikvm( 5053):   at java.lang.reflect.Method.invoke(Method.java:521)I/dalvikvm( 5053):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)I/dalvikvm( 5053):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)I/dalvikvm( 5053):   at dalvik.system.NativeStart.main(Native Method)I/dalvikvm( 5053): E/dalvikvm( 5053): Out of memory: Heap Size=22791KB, Allocated=22204KB, Bitmap Size=1806KBI/dalvikvm-heap( 5053): Clamp target GC heap from 26.011MB to 24.000MBD/dalvikvm( 5053): GC freed 11 objects / 728 bytes in 221msI/dalvikvm-heap( 5053): Clamp target GC heap from 24.011MB to 24.000MBI/dalvikvm-heap( 5053): Grow heap (frag case) to 24.000MB for 24-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.011MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 221msI/dalvikvm-heap( 5053): Clamp target GC heap from 24.011MB to 24.000MBI/dalvikvm-heap( 5053): Grow heap (frag case) to 24.000MB for 136-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.011MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 219msI/dalvikvm-heap( 5053): Clamp target GC heap from 24.011MB to 24.000MBI/dalvikvm-heap( 5053): Grow heap (frag case) to 24.000MB for 24-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.011MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 220msI/dalvikvm-heap( 5053): Clamp target GC heap from 24.011MB to 24.000MBI/dalvikvm-heap( 5053): Grow heap (frag case) to 24.000MB for 54-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.011MB to 24.000MBD/dalvikvm( 5053): GC freed 4 objects / 272 bytes in 221msI/dalvikvm-heap( 5053): Clamp target GC heap from 24.011MB to 24.000MBI/dalvikvm-heap( 5053): Grow heap (frag case) to 24.000MB for 24-byte allocationI/dalvikvm-heap( 5053): Clamp target GC heap from 26.011MB to 24.000MBD/dalvikvm( 5053): GC freed 0 objects / 0 bytes in 240msI/dalvikvm-heap( 5053): Clamp target GC heap from 24.011MB to 24.000MBI/dalvikvm-heap( 5053): Grow heap (frag case) to 24.000MB for 68-byte allocationD/dalvikvm( 5053): GC freed 589340 objects / 19930400 bytes in 180msI/dalvikvm( 5053): hprof: dumping VM heap to ""/sdcard/com.eventkontor.networkcheck.hprof-hptemp"".I/dalvikvm( 5053): hprof: dumping heap strings to ""/sdcard/com.eventkontor.networkcheck.hprof"".I/dalvikvm( 5053): hprof: heap dump completed, temp file removedD/dalvikvm( 5053): GC freed 8 objects / 616 bytes in 1056msD/NetworkCheck( 5053): debug. =================================D/NetworkCheck( 5053): debug.heap native: allocated 5,81MB of 6,94MB (0,61MB free) in [com.eventkontor.networkcheck.StatActivity]D/NetworkCheck( 5053): debug.memory: allocated: 22,00MB of 24,00MB (19,00MB free)D/dalvikvm( 5053): GC freed 148 objects / 7608 bytes in 34msD/dalvikvm( 5053): GC freed 5 objects / 264 bytes in 33msE/dalvikvm-heap( 5053): 32980-byte external allocation too large for this process.E/dalvikvm( 5053): Out of memory: Heap Size=22791KB, Allocated=2743KB, Bitmap Size=1806KBE/        ( 5053): VM won't let us allocate 32980 bytesD/skia    ( 5053): --- decoder-&gt;decode returned falseD/AndroidRuntime( 5053): Shutting down VMW/dalvikvm( 5053): threadid=3: thread exiting with uncaught exception (group=0x4001b390)D/UNHANDLED_EXCEPTION( 5053): Writing unhandled exception to: /data/data/com.eventkontor.networkcheck/files/1.5-55980.stacktraceI/global  ( 5053): Default buffer size used in BufferedWriter constructor. It would be better to be explicit if an 8k-char buffer is required.D/UNHANDLED_EXCEPTION( 5053): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eventkontor.networkcheck/com.eventkontor.networkcheck.StatActivity}: android.view.InflateException: Binary XML file line #21: Error inflating class &lt;unknown&gt;D/UNHANDLED_EXCEPTION( 5053): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)D/UNHANDLED_EXCEPTION( 5053): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)D/UNHANDLED_EXCEPTION( 5053): at android.app.ActivityThread.access$2200(ActivityThread.java:126)D/UNHANDLED_EXCEPTION( 5053): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)D/UNHANDLED_EXCEPTION( 5053): at android.os.Handler.dispatchMessage(Handler.java:99)D/UNHANDLED_EXCEPTION( 5053): at android.os.Looper.loop(Looper.java:123)D/UNHANDLED_EXCEPTION( 5053): at android.app.ActivityThread.main(ActivityThread.java:4595)D/UNHANDLED_EXCEPTION( 5053): at java.lang.reflect.Method.invokeNative(Native Method)D/UNHANDLED_EXCEPTION( 5053): at java.lang.reflect.Method.invoke(Method.java:521)D/UNHANDLED_EXCEPTION( 5053): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)D/UNHANDLED_EXCEPTION( 5053): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)D/UNHANDLED_EXCEPTION( 5053): at dalvik.system.NativeStart.main(Native Method)D/UNHANDLED_EXCEPTION( 5053): Caused by: android.view.InflateException: Binary XML file line #21: Error inflating class &lt;unknown&gt;D/UNHANDLED_EXCEPTION( 5053): at android.view.LayoutInflater.createView(LayoutInflater.java:513)D/UNHANDLED_EXCEPTION( 5053): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)D/UNHANDLED_EXCEPTION( 5053): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)D/UNHANDLED_EXCEPTION( 5053): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)D/UNHANDLED_EXCEPTION( 5053): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)D/UNHANDLED_EXCEPTION( 5053): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)D/UNHANDLED_EXCEPTION( 5053): at android.widget.Toast.makeText(Toast.java:235)D/UNHANDLED_EXCEPTION( 5053): at com.eventkontor.networkcheck.StatActivity.onCreate(StatActivity.java:140)D/UNHANDLED_EXCEPTION( 5053): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)D/UNHANDLED_EXCEPTION( 5053): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)D/UNHANDLED_EXCEPTION( 5053): ... 11 moreD/UNHANDLED_EXCEPTION( 5053): Caused by: java.lang.reflect.InvocationTargetExceptionD/UNHANDLED_EXCEPTION( 5053): at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:92)D/UNHANDLED_EXCEPTION( 5053): at java.lang.reflect.Constructor.constructNative(Native Method)D/UNHANDLED_EXCEPTION( 5053): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)D/UNHANDLED_EXCEPTION( 5053): at android.view.LayoutInflater.createView(LayoutInflater.java:500)D/UNHANDLED_EXCEPTION( 5053): ... 20 moreD/UNHANDLED_EXCEPTION( 5053): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budgetD/UNHANDLED_EXCEPTION( 5053): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)D/UNHANDLED_EXCEPTION( 5053): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:464)D/UNHANDLED_EXCEPTION( 5053): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:340)D/UNHANDLED_EXCEPTION( 5053): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)D/UNHANDLED_EXCEPTION( 5053): at android.content.res.Resources.loadDrawable(Resources.java:1705)D/UNHANDLED_EXCEPTION( 5053): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)D/UNHANDLED_EXCEPTION( 5053): at android.view.View.&lt;init&gt;(View.java:1850)D/UNHANDLED_EXCEPTION( 5053): at android.view.View.&lt;init&gt;(View.java:1799)D/UNHANDLED_EXCEPTION( 5053): at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:296)D/UNHANDLED_EXCEPTION( 5053): ... 24 more</code></pre><p>Thanks</p><p>Andreas</p>","360386","","","","","2010-10-06 23:36:50","Android: Strange Out of Memory Exception","<android><out-of-memory>","3","4","","2013-02-21 20:04:32",""
"3631967","1","","","2010-09-02 23:12:41","0","3319","<pre><code>@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"");      }  </code></pre><p>I want my menu to say ""Remove AAPL""</p><p>I would get the string AAPL from my array adapter, but I am not sure how I can access my array adapters index from this method.</p>","19875","","","","","2012-06-20 16:40:31","How to create a dynamic context menu in android?","<android><contextmenu><android-arrayadapter><listadapter>","2","0","1","",""
"3631982","1","3632061","","2010-09-02 23:15:00","76","69944","<p>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).</p><p>Couple questions:1) I have a fairly decent handle on how to switch between activities (based on this article: <a href=""http://www.linux-mag.com/id/7498"">http://www.linux-mag.com/id/7498</a>) but I'm not sure how to go about creating a new one (with eclipse).2) once I have a new activity created, how can I set it as the default activity of my application?  I presume I could just change the name of the classes...but is there a more elegant way to handle that (maybe within the AndroidManifest.xml)?</p>","233971","","","","","2014-01-31 08:19:58","change application's starting activity - android","<android><activity>","6","0","17","",""
"3632182","1","3632680","","2010-09-03 00:06:47","0","1172","<p>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.</p>","413414","","","","","2010-09-03 02:21:59","Android: Sliding button container widget","<android><widget><slider><containers>","1","0","","",""
"3632237","1","","","2010-09-03 00:23:02","2","885","<p>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 particular accounts.</p><p>Anyone have experience with this?</p>","438495","","","","","2013-07-16 02:35:57","Where does Android Account Manager store account specific preferences?","<android><accounts><account-management>","3","0","","",""
"3632253","1","3635184","","2010-09-03 00:31:55","0","2790","<p>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 the code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:paddingTop=""6dip""    android:paddingLeft=""12dip""    android:paddingRight=""12dip""    android:paddingBottom=""2dip""&gt;&lt;CheckBox     android:id=""@+id/saleListingCheckbox""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:text=""Save sale""  android:textColor=""#fff""  android:layout_alignParentBottom=""true""    &gt;&lt;/CheckBox&gt;&lt;ScrollView     android:id=""@+id/saleListingLinear""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:layout_above=""@id/saleListingCheckbox""    android:layout_alignParentTop=""true""    &gt;    &lt;TextView        android:id=""@+id/saleListingTextView""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""       android:textColor=""#fff""       android:textSize=""7pt""       android:paddingBottom=""4dip""    /&gt;&lt;/ScrollView&gt;&lt;/RelativeLayout&gt;</code></pre><p>java code:</p><pre><code>@Overrideprotected boolean onTap(int index) {    if (overlays.isEmpty()) {        return false;    }    final SaleOverlayPushPin saleItem = overlays.get(index);    AlertDialog alertDialog = new AlertDialog.Builder(context).create();    alertDialog.setButton(""Ok"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {            dialog.cancel();        }    });    LayoutInflater inflater = context.getLayoutInflater();    dialogView = inflater.inflate(R.layout.sale_listing, null);    textView = (TextView) dialogView.findViewById(R.id.saleListingTextView);    checkbox = (CheckBox) dialogView.findViewById(R.id.saleListingCheckbox);    checkbox.setOnCheckedChangeListener(this);    alertDialog.setView(dialogView);    alertDialog.setTitle(saleItem.getTitle());    textView.setText(saleItem.getSnippet());    checkbox.setTag(saleItem);    checkbox.setChecked(saleItem.isSelected());    alertDialog.show();    return true;}</code></pre><p>And here is what it looks like with little data and a lot of data:</p><p><img src=""http://i.stack.imgur.com/Yilf3.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/n0gBh.png"" alt=""alt text""></p><p>I have been able to make it work using a LinearLayout, but then I have a different problem where if the text content is larger than the dialog it cuts off the checkbox. Here is the code and the screenshots:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:paddingTop=""6dip""    android:paddingLeft=""12dip""    android:paddingRight=""12dip""    android:paddingBottom=""2dip""    android:orientation=""vertical""&gt;&lt;ScrollView     android:id=""@+id/saleListingLinear""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""  android:layout_weight=""1""  android:layout_gravity=""top""    &gt;    &lt;TextView        android:id=""@+id/saleListingTextView""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""       android:textColor=""#fff""       android:textSize=""7pt""       android:paddingBottom=""4dip""    /&gt;&lt;/ScrollView&gt;&lt;CheckBox     android:id=""@+id/saleListingCheckbox""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:text=""Save sale""  android:textColor=""#fff""  android:layout_weight=""1""  android:layout_gravity=""bottom""    &gt;&lt;/CheckBox&gt;&lt;/LinearLayout&gt;</code></pre><p><img src=""http://i.stack.imgur.com/0om7P.png"" alt=""alt text""><img src=""http://i.stack.imgur.com/4Ktmg.png"" alt=""alt text""></p><p>I would prefer that the ""little data"" behavior works like the LinearLayout and the ""lot of data"" work like the RelativeLayout. Is this possible?</p><p>UPDATE: bart's solution for the LinearLayout works perfectly. Removing the layout_weight from the CheckBox was the key. </p><p>However the RelativeLayout still does not work as expected. It makes the CheckBox unviewable if the data in the TextView is large enough. I would still love to know the solution for the RelativeLayout if at all possible. See below:</p><p><img src=""http://i.stack.imgur.com/G6bqU.png"" alt=""alt text""></p>","32965","","32965","","2010-09-03 15:10:16","2011-05-26 22:48:13","RelativeLayout in dialog has extra space","<android><relativelayout>","2","0","","",""
"3632257","1","3632311","","2010-09-03 00:33:07","0","330","<p>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 provide such method to return the instance reference. So I suspect there must be a reason?</p>","109704","","","","","2010-09-03 00:46:50","Android: Is it safe to create a static method to return the application instance?","<android>","1","0","","",""
"3632298","1","","","2010-09-03 00:42:26","1","1088","<p>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 keys in the cursor exist (data1, data2), but the values were ""1"" and null respectively.  Any Ideas?</p><pre><code>Cursor cursor = getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, null, null, null);        while (cursor.moveToNext() != false) {        String id = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts._ID));        String fname = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME));        String lname = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME));        if (lname != null &amp;&amp; lname.length() &gt; 0) {              String sDName = lname + "","" + fname;              ContentValues values = new ContentValues();              values.put(ContactsContract.Contacts.DISPLAY_NAME, sDName);              getContentResolver().update(ContactsContract.Data.CONTENT_URI, values, ContactsContract.Contacts._ID+""="", new String[] {id});        }        }</code></pre>","438431","","","","","2010-09-03 12:59:28","access to contact data","<android><contacts><contactscontract>","1","0","","",""
"3632416","1","3632710","","2010-09-03 01:16:46","13","19174","<p>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 that seems like a hack and next I want to do a similar thing but with the text at the top so I would prefer a more elegant solution.Here's what I have:</p><pre><code>&lt;Button        android:layout_width=""312dp""        android:layout_height=""95dp""        android:id=""@+id/gv_music_button""        android:text=""Music""        android:textSize=""30sp""        android:paddingLeft=""20dp""        android:gravity=""left|center_vertical""    /&gt;</code></pre>","304795","","","","","2012-12-18 15:30:02","android button fine text alignment","<android><layout><button>","1","0","1","",""
"3632449","1","3688095","","2010-09-03 01:27:08","3","2752","<p>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</p><pre><code>cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);cm.setMobileDataEnabled(true);</code></pre><p>Also found out which permissions I need, in particular WRITE_SECURE_SETTINGS, which is only available to system apps. I read adamk's <a href=""http://stackoverflow.com/questions/3476600/why-are-these-permissions-being-refused/3477237#3477237"">comment</a> and now need to know how to do what he suggested (add the app to system or sign it with the platform key).</p><p>At first I would like to do that on the emulator only, and then on my phone (which is rooted and using a custom ROM).I tried pushing it to the system directory on the emulator:</p><pre><code>adb remountadb push app.apk /system/app/adb sync</code></pre><p>which did not work, the app was not found and installed. </p><p>What did I forget? How is the proper way to do this?</p>","438528","","438528","","2010-09-04 16:31:10","2010-09-10 20:25:12","Android: Add app to firmware, use WRITE_SECURE_SETTINGS","<android>","1","0","4","",""
"3632484","1","","","2010-09-03 01:36:08","2","642","<p>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? </p><p>I need to put all my apps together and have separate page for single one.</p>","238061","","","","","2013-08-31 20:43:10","Any good free website template or theme for wordpress or joomla to demo my phone apps?","<iphone><android><wordpress><demo>","1","0","1","",""
"3632632","1","3638392","","2010-09-03 02:07:53","44","29840","<p>while compiling android project in eclipse 3.4.2 , am getting <strong>The project cannot be built until the build path errors are resolved.</strong> </p><p>i got a <strong>temporary solution</strong>  from the blog <strong>http://www.scottdstrader.com/blog/ether_archives/000921.html</strong></p><p>The resolution was to force a resave of the selected projects (and their .classpath files):</p><ol><li>Open the project properties</li><li>Select Java Build Path > Libraries</li><li>Add a new, arbitrary library (to be deleted later) > OK</li><li>Wait for the workspace to refresh (or force a refresh of the project)</li><li>The error(s) will go away</li><li>Remove the dummy library</li></ol><p>The only other references I could find were to make minor alterations of contents of the .classpath file. </p><p>is there any permanent fix for this issue?</p>","205929","","","","","2014-02-28 06:24:00","The project cannot be built until the build path errors are resolved","<android><eclipse><build><compilation>","8","6","5","",""
"3632647","1","","","2010-09-03 02:12:17","0","160","<p>Can anyone tell me about the Japanese phonebook sorting status inAndroid contacts?</p><p>Does froyo support AKASATANA and Yomigana?</p>","438554","","995926","","2012-05-05 13:50:10","2012-05-05 13:50:10","Does froyo support AKASATANA and Yomigana based contact sorting?","<android><unicode><localization><contacts><android-2.2-froyo>","1","0","","",""
"3632827","1","3633300","","2010-09-03 03:16:30","1","3022","<p>In my Android app, I need to get 50,000 database entries (text) and compare them with a value when the activity starts (in <code>onCreate()</code>). 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 ways to do it more effectively ?</p><p><strong>Edit:</strong> The app is ""scrabble solver"" that is why I am not using <code>WHERE</code> clause in my query (Take the whole data and compare it with combination of the input letters). At first I was using a big table which contains whole possible words. Now I am using 26 tables. This reduced the lag and I am making database calls on a thread - that solved a lot problems too. It is still little bit laggy but much better.</p>","426815","","1134080","","2013-11-10 09:29:31","2013-12-16 17:39:55","Is there any efficient way to make Android database query faster?","<android><sqlite><sqlite3>","4","2","2","",""
"3632885","1","3633082","","2010-09-03 03:32:41","0","1018","<p>if I click on a listview item i want to keep the highlight on it. how do i do this?</p>","19875","","","","","2010-09-03 04:41:47","How to keep android listview highlighted?","<android><listview><listviewitem>","1","1","1","",""
"3632939","1","3633195","","2010-09-03 03:49:39","1","877","<pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Typeface font = Typeface.createFromAsset(                getAssets(), ""DejaVuSans.ttf"");        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item,                        getGroups()));        tv = (TextView)findViewById(R.id.textitem);        //Uncomment a line below and the app crashes!!        //tv.setTypeface(font);        //tv.setGravity(Gravity.LEFT);</code></pre><p>}</p><p>list_item.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/textitem""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dp""    android:textSize=""16sp""    android:gravity=""right""/&gt;</code></pre><p>The problem is that I want to set a new typeface for the TextView in the ListView, and it seems it can't be done in the XML file!!</p>","433261","","","","","2010-09-03 05:09:49","changing TextView properties of a ListView crashes the app","<android>","1","0","","",""
"3632965","1","3633703","","2010-09-03 03:57:10","2","2314","<p>When my app loads, I want the first item in the listview to already be selected. how can I do this?</p>","19875","","","","","2010-09-03 07:12:05","How to select the first item in a ListView by default","<android><listview><listviewitem>","1","2","","",""
"3632979","1","3633023","","2010-09-03 04:03:01","0","1741","<p>I using Eclipse Helios and JDK6 ,The Android SDK virtual device make a problem follow the step.</p><ol><li>The device cannot shut down,it stop at</li></ol><blockquote>  <p>09-03 03:59:02.986:  INFO/ShutdownThread(72): Performing  low-level shutdown...</p></blockquote><ol><li><p>If i force close the device, i cannot start up again, it make emulator.execrash.</p></li><li><p>It have only one way to make the device can startup again, before launch the device , check ""wipe use data"".</p></li></ol><p>So any body experience this issue?</p>","83952","","","","","2010-09-03 04:20:28","Android SDK virtual device fail?","<android>","1","0","","",""
"3633044","1","3633204","","2010-09-03 04:28:10","3","2504","<p>How can I simulate landscape orientation in the android simulator?</p>","19875","","19875","","2010-09-03 04:58:05","2010-09-03 05:11:51","How to simulate landscape orientation in the android simulator?","<android><adt>","2","0","2","",""
"3633047","1","","","2010-09-03 04:30:05","1","765","<p>have a dump_log which points to ""Out of Memory exception"". How do I fix the issue as we have a number of applications running on the Android target?</p>","438614","","23897","","2010-09-03 04:31:17","2010-09-03 04:43:45","Out of Memory exception handling?","<android><exception-handling>","2","0","","",""
"3633050","1","3634197","","2010-09-03 04:31:35","1","1110","<p>I want my view to change when it has changed to horizontal orientation:</p><pre><code>@Override    public void onConfigurationChanged(Configuration newConfig) {      super.onConfigurationChanged(newConfig);      setContentView(R.layout.chartsactivity);    }</code></pre><p>This works, but I want my layout to switch back when it is in portrait mode.</p>","19875","","19875","","2010-09-03 04:42:51","2010-09-03 08:44:03","How can I change my view in horizontal orientation and then back to portrait?","<android><orientation>","2","0","","",""
"3633260","1","","","2010-09-03 05:32:47","3","1363","<p>If I want to write a Screensaver or Lockscreen. Is there a way to prevent the home key from going back to the launcher?</p>","438633","","114066","","2010-09-03 07:23:28","2011-10-24 18:54:17","How to shield the home key if my app is active? (Screensaver, Lockscreen)","<android>","3","1","1","",""
"3633370","1","3793561","","2010-09-03 06:00:12","4","7639","<p>I am a newbie to android development.Now i would like to do gallery view as circular like image as below.The things is that i want to enlarge the center image when user scroll from left to right and right to left. Is there any tutorials for that ?</p><p><img src=""http://i.stack.imgur.com/zcYhp.png"" alt=""enter image description here"">what I want is the image that's been swiped need to be enlarged while it's at the center. I thought I could do it with Gallery. but the example from the android developer is not the one I want. :(</p>","405219","","379693","","2012-02-07 06:44:47","2012-02-07 06:44:47","android circular gallery?","<android><android-gallery><android-image>","3","0","6","",""
"3633407","1","4512212","","2010-09-03 06:10:40","3","431","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1114287/good-book-for-beginning-android-development"">Good book for beginning android development</a>  </p></blockquote><p>hi to everyone i m a new one in want to develop android app so which is the best ebook or site to refer? thank in advance</p>","429295","","525478","","2012-09-20 10:22:13","2012-09-20 10:22:13","android beginning","<android>","2","0","4","2011-11-23 16:58:52",""
"3633439","1","3633679","","2010-09-03 06:16:48","1","2197","<p>What are Handler used in android proggraming for? How do we use them to dismiss the ProgressDialog?</p><p>I have referred few things from the Net regerding this but couldn't found them pretty convincing. An example of dismissing a ProgressDialog along with Handler will be a great thing.</p><p>Thanks,david</p>","422859","","","","","2010-09-03 07:07:22","Handlers in Android","<android>","1","0","2","",""
"3633605","1","","","2010-09-03 06:54:45","4","7758","<p>I have a widget that shows some informations from database. The widget is periodically updated every one hour. But i also let user to update it manually by clicking a refresh button on widget.How can i perform the click action and refresh the widget? </p><p>Note: The widget uses service to perform operations.</p><p>Thanx in advance.</p>","431041","","467900","","2013-10-10 08:35:03","2013-12-10 02:12:26","Android update Widget from a button click","<android><widget><refresh><android-appwidget>","2","0","1","",""
"3633815","1","","","2010-09-03 07:35:29","0","1132","<p>is there a way to keep an activity running even though it has been sent to the background, home button is clicked, ?My app has a countdowntimer and i want the timer to keep running even though the app is in the background.</p><p>Is there a way to do this without using services ? Because ive been reading up on services and im really notgetting how to use them... and if services is the only way can someone give me a simple tutorial or guide from where i can try this...I've already seen all the documents and examples on the developer.android.com website... anything apart from those...</p><p>thankyou </p>","434885","","","","","2010-09-10 14:01:35","android activity running in bkground","<android>","3","0","","",""
"3633823","1","6584597","","2010-09-03 07:37:09","2","1731","<p>Im trying to implement an activity that uses ExpandableListView and I have gotten so far but now I have found some strange behavior.</p><p>My activity is meant to record food intake as specified by the user. they have a choice of menus (breakfast, lunch and dinner - the outer group) which expand to show their contents.when a user clicks on an inner menu item a dialog appears asking them for the qty. once they enter a qty and dismiss the dialog the text on the menu item changes to reflect the quantity of that item that has  been consumed<img src=""http://i.stack.imgur.com/BWxmm.jpg"" alt=""fig 1""></p><p>The above image shows the list in a closed state.</p><p>below is the list after I have opened the lunch menu and clicked on 'Potato Chips' and indicating a Quantity of 1. As you can see the 'Potato' itemtext has now been changed to reflect the Qty of 1.</p><p><img src=""http://i.stack.imgur.com/Nyi6p.jpg"" alt=""fig 2""></p><p>The strange part happens now. if I click on 'Lunch' and close the list and then click on it again re-opening it, the 'Qty X 1' text has jumped to another item (Milk)</p><p><img src=""http://i.stack.imgur.com/MopI2.jpg"" alt=""alt text""></p><p>each time I open and close the list it jumps back and forth between the two items. Also if I open up other items, such as breakfast, I find that they too have now gotten items with 'Qty X 1' even though I havent clicked them.</p><p>The bits of code that are relevant are as such:</p><p>The XML for a child element:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/childname""         android:paddingLeft=""50dip""         android:textSize=""14dip""         android:textStyle=""italic""         android:layout_width=""200dip""         android:textColor=""@color/black""         android:layout_height=""40dip""/&gt;    &lt;TextView android:id=""@+id/qty_display""         android:text=""-""         android:textSize=""14dip""         android:textStyle=""italic""         android:layout_width=""50dip""         android:textColor=""@color/black""         android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre><p>The code thats triggered on clicking a child element:</p><pre><code>public boolean onChildClick(            ExpandableListView parent,             View v,             int groupPosition,            int childPosition,            long id) {           // open the dialog and inflate the buttons     myDialog  = new Dialog(this);  myDialog.setTitle(""Food Item Qty"");  myDialog.setContentView(R.layout.food_intake_dialog);  final Button ok = (Button)myDialog.findViewById(R.id.fi_ok_but);     Button cancel = (Button)myDialog.findViewById(R.id.fi_cancel_but);      //the id for this item is stored as a hash key in a map (say, item_id01)     String key = ""item_id""+groupPosition+""""+childPosition;     current_selected_food_item_id = Integer.parseInt(itemMap.get(key));       // inflate the textview that shows the qty for this item on the expandablelist     barQty = (TextView) v.findViewById(R.id.qty_display);        // set the ok button to record teh quantity on press     ok.setOnClickListener(new OnClickListener() {   public void onClick(View viewParam) {                             //inflate the input box that receives quantity from user    EditText fiQty = (EditText) myDialog.findViewById(R.id.fiQty);    // get the quantity and append the text on hte list item    String qty = fiQty.getText().toString();    barQty.setText(""Qty X ""+qty);                            //open the database and save state                 FoodIntake.this.application.getFoodIntakeHelper().open();    FoodIntake.this.application.getFoodIntakeHelper().storeFoodIntakeLog(current_selected_food_item_id,qty,visit_id,remote_visit_id);    String log = FoodIntake.this.application.getFoodIntakeHelper().getFoodIntakeLog(visit_id);    FoodIntake.this.application.getFoodIntakeHelper().close();                        //    append the main food intake list and close the dialog                            list.setText(""Food Intake Log:\n\n""+log);    myDialog.cancel();   }     });</code></pre><p>The above code opens a dialog, accepts a value for quantity, appends the list element to reflect this, also saves to database and sets a textview with the selected item and quantity.</p><p>Sorry to just dump a whole load of code, but this has me stumped and hopefully someone can help.</p><p>Thanks</p><p>Kevin</p>","409826","","409826","","2010-09-03 07:43:23","2012-09-22 04:27:07","Strange behaviour in Expandablelistview - Android","<java><android><expandablelistview><expandablelistadapter><settext>","2","0","1","",""
"3633868","1","3633933","","2010-09-03 07:45:06","0","451","<p>I want to know about the util Class used in Java. I am currently working on one Application in Android where I need to used a class from one file to another different file. I was told to import it like ""import com.android.utli.(ClassName)"" here the ""com.android.util"" is a package name.</p><p>Can I use thast class in my another file simply by importing the package along with the Class Name?</p><p>Getting slightly confused.</p><p>Thanks,david</p>","422859","","","","","2010-09-03 07:56:49","Util Class in Java","<java><android>","2","1","","",""
"3633956","1","3634048","","2010-09-03 08:00:46","0","895","<p>I have the current code:</p><pre><code>ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item, array_spinner);        adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );        colourSpinner.setAdapter(adapter);</code></pre><p>How would i put a vector into my array_spinner?</p><p>Thank you.</p>","358218","","","","","2010-09-03 08:17:05","How do i put a vector into my arrayadapter?","<android><eclipse><android-arrayadapter>","1","0","","",""
"3634041","1","14604886","","2010-09-03 08:15:57","8","2594","<p>I want to create a script where I start an emulator and after the system is fully booted, I want to install an .apk.</p><p>How can I know when the emulator is fully booted so I can run the install command? Here <a href=""http://developer.android.com/guide/developing/tools/adb.html"">http://developer.android.com/guide/developing/tools/adb.html</a> it is said that <code>adb wait-for-device install &lt;app&gt;.apk</code> is not correct.</p><p>So how can I achieve this? Is it possible? Is my only option to sleep for a few minutes until I can be sure that the emulator is started?</p>","292263","","","","","2013-01-30 13:12:25","Detect when Android emulator is fully booted","<android><scripting><emulator>","4","1","2","",""
"3634044","1","3634476","","2010-09-03 08:16:31","0","1799","<p>I have a requirement where in i need to updated my widget once in every 15 seconds. There is a method called <code>android:updatePeriodMillis</code> but that seems to be getting fired only after 30 minutes. </p><p>I took an approach of <em>updating my Widget</em> with the help of <code>AlarmManager</code>. The <em>widget updates</em> but the issue is it slows down the performance of the device. When the <code>AlarmManager</code> of my application runs on the background i could see a big delay on the device to respond to user events. <strong>Is it wise to have a widget that updates frequently?</strong></p><p><strong>Is it the recommended approach to update the widget</strong>..or can any one provide me some code samples or any application where the update happens frequently?. </p><p><strong>Why is that the <code>android:updatePeriodMillis</code> is set to 30 mins?. Is it because Android does not want us to update a widget before that time interval?</strong></p>","302328","","","","","2010-09-03 09:25:53","AlarmManager with pending intents to update a widget","<android><appwidget><alarmmanager>","1","0","0","",""
"3634191","1","","","2010-09-03 08:43:28","35","23365","<p>I want to have an Android Button with icon+text centered inside it. I'm using the drawableLeft attribute to set the img, this work well if the button has a width of ""wrap_content"" but I need to stretch to max width so I use width ""fill_parent"". This moves my icon straight to the left of the button and I want both icon and text centered inside the button. </p><p>I've try setting up the padding but this only allows to give a fix value so it is not what I need. I need to have icon+text aligned in the center.</p><pre><code>&lt;Button     android:id=""@+id/startTelemoteButton""     android:text=""@string/start_telemote""    android:drawableLeft=""@drawable/start""    android:paddingLeft=""20dip""    android:paddingRight=""20dip""                android:width=""fill_parent""    android:heigh=""wrap_content"" /&gt;</code></pre><p>Any suggestion how could I archive that? </p>","438775","","53926","","2013-04-19 00:29:17","2014-04-03 18:25:39","How to center icon and text in a android button with width set to ""fill parent""","<android><button><alignment><center>","13","3","9","",""
"3634207","1","3634267","","2010-09-03 08:45:28","0","437","<p>what does ContactsContract.CommonDataKinds.StructuredPostal.TYPE mean. I want to know what does ""TYPE"" mean in ""ContactsContract.CommonDataKinds.StructuredPostal.TYPE "".I will be waiting for any kind reply?</p>","429501","","","","","2010-09-03 08:53:38","what does ContactsContract.CommonDataKinds.StructuredPostal.TYPE stand","<android><android-widget>","1","0","","",""
"3634233","1","3634390","","2010-09-03 08:48:43","1","622","<p>I'm really struggling with a part of layout in my app. I have a header bar with a centered image and on the right there should be two buttons (or clickable images like I have right now). I managed to get the images next to eachother (all centered) but I want the images on the right. When I use layout_weight to make the 'first' one stretch, the buttons are on the right but they get so small. I want the buttons (images) to keep their original sizes. I even tried to hardcode that with minWidth and minHeight but that doesn't work.</p><p>Here is the code that centers everything:</p><pre><code>&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center""    android:background=""@drawable/header_tile""&gt;    &lt;ImageView       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:src=""@drawable/header_logo""&gt;    &lt;/ImageView&gt;    &lt;LinearLayout        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;        &lt;ImageView           android:id=""@+id/previous""           android:src=""@drawable/omhoog""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""&gt;        &lt;/ImageView&gt;        &lt;ImageView           android:id=""@+id/next""           android:src=""@drawable/omlaag""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""&gt;        &lt;/ImageView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is the code that works, except that the last image gets so small:</p><pre><code>&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center""    android:background=""@drawable/header_tile""&gt;    &lt;ImageView       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       android:src=""@drawable/header_logo""        android:layout_weight=""2""&gt;    &lt;/ImageView&gt;    &lt;LinearLayout        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_weight=""1""&gt;        &lt;ImageView           android:id=""@+id/previous""           android:src=""@drawable/omhoog""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""&gt;        &lt;/ImageView&gt;        &lt;ImageView           android:id=""@+id/next""           android:src=""@drawable/omlaag""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""&gt;        &lt;/ImageView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Any ideas? Thanks a lot!</p><p>Erik</p>","419625","","","","","2010-09-03 09:31:15","Android: Bar with centered image and buttons on the right","<android><layout>","3","0","","",""
"3634324","1","","","2010-09-03 09:04:43","0","1265","<p>How can I create a WCF service for Android client.</p><p>ThanksIkram</p>","438798","","1104926","","2011-12-19 13:58:53","2011-12-19 13:58:53","create wcf service for Android client","<android><wcf>","1","2","1","",""
"3634373","1","","","2010-09-03 09:11:25","3","641","<p>I haven't manage  all errors on my application anymore. So I would like to know if it is possible to Kill the entire app when it crashes?</p><p>(when the message ""app MyApp crash, force close"" appear, I would like the application to be killed when user clicks on ""force close"")</p>","335500","","114066","","2010-09-03 09:16:22","2010-09-03 09:16:22","kill application after crash","<android><crash><kill>","1","0","","",""
"3634444","1","3751585","","2010-09-03 09:21:22","4","3970","<p>I am drawing some textures with alpha channel, but when they are displayed it looks like the alpha channel is only binary.  So a pixel is either transparent or opaque, although in the texture file itself the pixel is half-transparent.  The blending is set up like this:</p><pre><code>gl.glEnable(GL10.GL_BLEND);gl.glBlendFunc(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);</code></pre><p>Is there a workaround for this problem?</p><p>The above shows how it should be like, and the below shows how it is:</p><p><img src=""http://i.stack.imgur.com/ciQBC.png"" alt=""alt text""></p>","97688","","105170","","2010-09-12 01:51:18","2010-09-20 14:58:51","android/opengles alpha textures not semitransparent but binary transparent","<android><opengl-es><transparency><textures><alphablending>","4","8","3","",""
"3634490","1","3920995","","2010-09-03 09:28:27","2","2763","<p>Is it possible to invoke native SMIL player on Android 2.1? Can you please provide a code sample or a pointer to relevant info?</p><p>Thanks a lot</p>","367677","","","","","2010-10-13 05:26:24","Playing SMIL on Android 2.1","<android><android-sdk-2.1><smil>","2","0","","",""
"3634496","1","3634520","","2010-09-03 09:29:24","4","9391","<p>I have a video thumbnail and when you click on it, the video starts playing in the YouTube player. This works great, but It's not so clear that you have to click on the thumbnail to play, so I have a play button image that I want to draw over the thumbnail in the bottom right corner. How would I go about this? I currently have the thumbnail in a Drawable object and the play button in my drawable resource directory. I tried stuff with bitmaps and canvas but it's quite hard and I don't know if this is the way to go.</p><p>Thanks a lot!Erik</p>","419625","","","","","2011-09-09 08:26:27","Android: Image over image","<android><image-processing>","2","0","3","",""
"3634549","1","","","2010-09-03 09:41:12","1","632","<p>How can i create a seek bar which increments itself automatically when a  button is pressed?  i'm developing a music player. So when i click on Play button...The seek bar should increment itself automatically till the song is played..Can you please expalin with the help of code snippet?</p>","396437","","","","","2011-06-15 06:21:47","Android Seek Bar Autoincrement","<java><android>","1","1","","",""
"3634588","1","","","2010-09-03 09:46:11","2","322","<p>HelloIn my android application i am trying to append data to url.But the data is not getting appended.Below is my code.Please correct me.</p><p>URL url=new URL(""http://220.226.22.57:8780/WEB-3/client/requests/sgduTimeStampRequest.action"");</p><pre><code>        HttpURLConnection conn = (HttpURLConnection) url.openConnection();        conn.setRequestProperty(""aContentType"",""text/plain"");        conn.setRequestProperty(""aBody"",""modified_since=3491039964"");        conn.setRequestMethod(""POST"");        conn.setDoOutput(true);         conn.setDoInput(true);        SGDUParser parser=new SGDUParser(context);        parser.parseUpdateBinaryFile(conn.getInputStream())</code></pre><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","420261","","2010-09-03 12:51:08","2010-09-21 15:51:59","append data to url in android","<android>","2","1","0","",""
"3634626","1","","","2010-09-03 09:53:59","5","5899","<p>I have some problems with the creation of a file. For instance, I want to create a file on the sdcard and first i want to check whether file exists or not. If file not exist i will create one and write some text in otherwise if it exists i will append it some text.</p>","438831","","114066","","2010-09-03 10:19:11","2010-09-03 10:19:11","Create file in android emulator","<android>","1","0","1","",""
"3634772","1","3635147","","2010-09-03 10:13:40","4","4309","<p>I my android application,i would like to read a text file which is placed on the sdcard. Read the file to search for a string: ""some string"" and would like to get the value for that string.Is there any way that i can do that in android.</p><p>Please share your valuable suggestions.</p>","420261","","114066","","2010-09-03 10:16:21","2010-09-03 11:08:36","read a text file and search a string in android","<android>","1","3","","",""
"3634781","1","3635461","","2010-09-03 10:15:44","2","1308","<p>I've been playing around with the NDK recently, finding that many of the tutorials available online really don't help. I've been using <a href=""http://marakana.com/forums/android/examples/49.html"" rel=""nofollow"">this tutorial</a> and I've got it running great.</p><p>However. Is this the correct use of the NDK? I mean if I have a game say with many classes all in C++ that I wish to port over to the android. Do I have to really manually change all my methods to the likes of:</p><pre><code>JNIEXPORT jstring JNICALL Java_com_domain_ndk_NativeLib_hello  (JNIEnv * env, jobject obj) {        return (*env)-&gt;NewStringUTF(env, ""Hello World!"");}</code></pre><p>I can't see this being a very efficient way of porting my code over and I get the feeling I'm using the NDK wrong. I also have no idea how the NDK samples are supposed to work. Could anyone point me in the right direction?</p><p>Thanks</p>","143979","","356","","2010-09-03 20:36:39","2010-12-21 20:45:18","Android NDK Confusion","<java><c++><android><eclipse><osx>","5","0","","",""
"3634857","1","","","2010-09-03 10:27:55","0","203","<p>I want to load an mp3 from a string path in andriod which is situated in drawable folder?Please anyone help me on this.</p>","655814","","1104926","","2011-12-19 13:40:50","2011-12-19 13:40:50","I want to load an mp3 from a string path in android?","<android><mp3>","2","0","","",""
"3634929","1","3635416","","2010-09-03 10:38:33","5","5347","<p>My Android app (a text-based game) uses background images a lot in order to provide a better visual ambiance. For example, if the action in the game takes you into a tavern, then you get a background image of a tavern in the game. This is a vast improvement, graphically, over the boring black background that you would otherwise get.</p><p>It is also a problem, however, since android:background always stretches to the dimensions of the screen. The result is that the background images look very bad if the player switches between portrait and landscape mode. And to make matters worse, many devices have very different aspect ratios (e.g., 320x480 mdpi, 480x800 hdpi, and 480x852 hdpi) and even more variations are coming.</p><p>How do others solve this problem? Having individual images for the main resolutions/orientations is not an option for me, as this would result in the apk growing too large.</p>","268108","","2020956","","2014-01-06 10:54:28","2014-01-06 10:59:08","Handling different screen resolutions for background images in Android","<android><user-interface><screen-resolution><aspect-ratio>","3","2","1","",""
"3635011","1","3636586","","2010-09-03 10:52:01","5","1139","<p>I want to implement the same behaviour of the notification view in the official Facebook app.The ""notifications"" tab are at the bottom and can drag/drop via fingers to full screen.</p><p>How can i do that?</p><p>I've tried it via ViewFlipper and Animation.... But no success.</p><p>Does anyone know how we can do this?</p><p>The app ""Zedge"" has the same in the ""search"" function.Via drag/drop you can open the ""search"" view.</p>","242070","","","","","2010-09-03 14:12:39","How to get a Gesture View like in official Facebook app","<android><facebook><view><gesture>","2","0","1","",""
"3635101","1","3651653","","2010-09-03 11:02:58","25","27649","<p>I've downloaded and compiled Android 2.1 version with <code>signed-google_ion-ota-14721.zip</code> image for my HTC phone. The compile completed successfully and so the system image flash.How can I sign my own Android application with the system signature? </p><p>Can someone describe the whole process for signing a user application with system signature as I am completely new to the signing process. </p>","342863","","68805","","2011-06-27 06:37:15","2014-02-23 13:16:05","How to sign Android app with system signature?","<android>","3","0","28","",""
"3635309","1","3635707","","2010-09-03 11:34:47","0","121","<p>i am fighting with android hardware backbuttonnow my question to you is can i restrict its functionality upto 3 or 4 levels?</p><p>right now for example, i have 1,2,3,4,5,6,7,8,9,10 activities</p><p>i go to 1 then 2 then 3 .... upto 10 and start pressing backbutton</p><p>it takes me to 9 then 8 then 7 upto end </p><p>i want to keep track of only last three levels is this possible or not?</p><p>any help would be appreciated.</p>","249991","","","","","2010-11-22 16:25:42","can we restrict backbutton functionality to given levels?","<android><activity>","2","0","","",""
"3635374","1","","","2010-09-03 11:44:38","0","543","<p>i use following code to check 3g,edge connectivity in android phone application</p><pre><code>public boolean isConnected()    {        try        {            final ConnectivityManager conn_manager = (ConnectivityManager)             this.getSystemService(Context.CONNECTIVITY_SERVICE);            final NetworkInfo network_info = conn_manager.getActiveNetworkInfo();            if ( network_info != null &amp;&amp; network_info.isConnected() )             {                return true;            }            else            {                return false;            }        }        catch (Exception e)         {            return false;        }    }</code></pre><p>if i connect it to wifi then this check does not work correctlyactually when wifi is connected to network and internet coverage is not there above check say ok infact its wrong  any one guide me how to handle packet lost case like</p><p>internet comming then disconnnecting and this process keeps continue in android ?or am i doing something wrong?</p><p>any help would be appreciated.</p>","249991","","","","","2010-09-03 12:26:41","how to mange wifi internet connectivity in android?","<android>","1","0","","",""
"3635426","1","","","2010-09-03 11:51:55","1","943","<p>When adding a contact in the new android contacts API, can I use <strong>newAssertQuery()</strong> also for insert, or will it only update an existing entry. If so, what is the difference between <strong>newAssertQuery()</strong> and <strong>newUpdate()</strong>?</p><p>More generally, do I need to check whether a raw contact or data exist first and then either insert or update, or is there a simpler way?</p>","271813","","271813","","2010-09-07 10:45:39","2010-09-07 10:45:39","Update/insert in new Android contacts API","<android><api><contacts><contactscontract>","0","1","1","",""
"3635503","1","3635563","","2010-09-03 12:05:00","3","1583","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3572463/what-is-context-in-android"">What is Context in Android?</a>  </p></blockquote><p>Can anybody please tell me about the ""context"" term used in android. I wonder what exactly this means because this is something i used to see at lots of places. </p><p>I found it being a Class :- ""Interface to global information about an application environment"" but I am not quite clear regarding it still by now.</p><p>for Instance:           public GetCurrentLocation(Context context)          {        this.context = context;          }</p><p>Thanks,david</p>","422859","","","","","2010-09-03 12:12:33","Context in Android Programming","<android>","1","0","","2011-10-30 13:35:22",""
"3635509","1","","","2010-09-03 12:05:26","4","803","<p>A Provider is implemented in application  and application updates provider data and triggers a remote service  which queries the provider to retrieve the stored values.The application is closed  after sometime but service keep on accessing the content provider.At some point the following error is thrown in logcat and the remote service  is crashed.</p><p>""Killing app  (pid 1724) because provider  is in dying process ""</p><p>I googled for this error and couldn't find information about why this error occurs.</p><p>UPDATE: In one of the places context returned by getApplicationContext is used instead of Service to get contentresolver to query the content provider. Does it cause any problem? </p>","110024","","110024","","2010-09-03 13:28:08","2013-07-11 11:05:18","Killing app <my service> (pid 1724) because provider <my provider> is in dying process <my app>","<android>","3","1","4","",""
"3635583","1","3635647","","2010-09-03 12:14:26","0","434","<p>Im fairly new at programming and was wondering if the Jigloo gui builder plugin would work with android app developement. I have Eclipse setup with the android sdk plugin configured, after seeing what Jigloo can do and that you can see the source code after creating the gui iI figured this would be a helpful tool to use.</p><p>I would be very grateful if someone could tell me if it does work and how to configure it.</p><p>Thank you in advance</p>","438930","","","","","2010-09-03 12:50:58","Jigloo, Eclipse and Android","<android><eclipse>","2","0","","",""
"3635917","1","3651855","","2010-09-03 12:55:32","1","1249","<p>I need the correct way of getting latitude and longitude in android programatically. I viewed different sites and forums but still i could'nt get the correct one. The program should support for all the android versions.I use wifi to get my device connected to net.</p>","431655","","","","","2010-09-06 13:32:30","correct way of getting latitude and longtitude in android","<android><geolocation><gps><location>","2","0","1","",""
"3636084","1","3636479","","2010-09-03 13:16:17","0","263","<p>How to do my own custom list? I mean, that each element of list will be looking like I want.</p>","437223","","","","","2010-09-03 13:59:28","How to do my own custom list?","<android>","2","1","","",""
"3636106","1","3697930","","2010-09-03 13:19:30","8","2564","<p>I would like to replace the default GPS location provider on android phones with my own coordinate source. </p><p>Is there any layer/API/library/provider that would allow to be replaced with my signal provider instead of the built-in hardware GPS, or read from an external plugin? It should allow all apps that rely on the GPS service to receive my signal instead of GPS. Ideally, the replacement should still be able to access the GPS signal (for comparison/correction or to toggle between the two providers). </p><p>I am thinking for example of implementing my own LocationManager, and registering it in the system (as optional or default), if that is possible. But at this stage, I am still trying to find out what is possible and suitable.</p><p>Thank you for any pointers. </p>","369113","","","","","2010-09-13 20:46:40","Replace default GPS signal provider on Android devices","<android><gps><driver>","3","3","7","",""
"3636231","1","","","2010-09-03 13:32:24","0","656","<p>Okay, this would be fairly simple in some other environments, but I can't figure out how to do it, or if its even possible in Android.</p><p>I have placed an icon on the status bar.  I would like to run a method of another class whenever the user selects that icon.  I've seen similar functionality used in volume icons that sit on the status bar that allow a user to raise or lower the volume when the icon is clicked.  However, these icons are on the right side of the status bar, and from what I've seen, I'm not allowed to put an icon there.  I don't know if that kind of functionality is available to left side icons.</p><p>So basically, I'm looking for how to run a function when a status bar icon is clicked.  I don't want to open an activity, I just want to run a function.</p>","438991","","","","","2011-11-02 18:10:32","How to Create Clickable on Icon in Status Bar to Run Function/Method/Code","<android>","1","0","1","",""
"3636243","1","3636306","","2010-09-03 13:33:48","3","2755","<p>I have a noob problem. Here is my situation:</p><p>I want to start a new activity from the main activity. The code to launch the new activity is found in a separate class file. I seem to be passing the wrong arguments and I am ending up in a nullpointerexception when trying to launch the new activity. The new activity launches fine when I place the code in the main activity class file, therefore the second activity and the manifest are fine. Here is a sample of my code:</p><p>In my main activity class where I instanciate the second class (THIS IS MY MAIN ACTIVITY. I OMITTED THE REST BECAUSE I DO NOT THINK IT IS RELATED TO THE PROBLEM):</p><pre><code>Tester mytest = new Tester();mytest.test(this);</code></pre><p>In my second class file (THIS IS NOT AN ACTIVITY; iT IS A CLASS THAT IS INTANCIATED IN THE ACTIVITY):</p><pre><code>public class Tester extends Activity {     Intent myIntent;     public void test (Context context) {               myIntent = new Intent (Intent.ACTION_VIEW);               myIntent.setClass(context, newActivity.class);               thebutton.setOnClickListener(            new OnClickListener() {                  public void onClick(View v) {                     startActivity(myIntent);                }              }               ):}</code></pre><p>When I perform the click I receive a nullpointerexception at startactivity. Can anyone enlighten me on this please?I am sure that I am wrongly using the context.</p><p>Thanks</p>","439002","","439002","","2010-09-03 14:19:30","2010-09-03 15:20:31","New Activity nullpointerexception Problem","<android><class><activity><context><nullpointerexception>","1","0","","",""
"3636251","1","3823299","","2010-09-03 13:34:28","29","4603","<p>I have a 9-patch image file which looks like this:</p><p><img src=""http://i.stack.imgur.com/uNIMS.png"" alt=""alt text""></p><p>When I use it it appears like this:</p><p><img src=""http://i.stack.imgur.com/UfIXq.png"" alt=""alt text""></p><p>What I actually wanted to achieve is the complete dot in the center <strong>repeated</strong> instead of <strong>stretched</strong>. I hope that it's possible.</p>","184367","","","","","2011-08-27 20:12:58","Android: 9-patch repeat pattern instead of stretching","<android><nine-patch>","3","3","7","",""
"3636299","1","3649861","","2010-09-03 13:40:14","2","4809","<p>here's my problem, I am receiving a string from a soap Webservice which seems to contain UTF8 encoded %c3%89. This string is a URL i have to reach to get a picture that contains a part of the URL in it.</p><p>My problem is that the server generating the picture doesn't recognize the %c3%89  encoding and thus doesn't create the right . When replaced with it's normal representation (i.e É) the server is generating the picture correctly. </p><p>My question is: How can i replace the encoded character in the string?</p><p>Ps: I don't have access to the server side</p><p>here's my code </p><p><code>URL aURL = new URL(URLDecoder.decode(url));URLConnection conn = aURL.openConnection();conn.connect();InputStream is = conn.getInputStream();BufferedInputStream bis = new BufferedInputStream(is);bm = BitmapFactory.decodeStream(bis);</code></p><p>Thanks a lot :)</p><p>Hush</p>","395843","","157882","","2010-09-03 13:49:04","2010-09-06 07:58:43","Java (Android) UTF-8 character in string","<java><android><character-encoding>","2","0","","",""
"3636410","1","3636490","","2010-09-03 13:53:14","2","202","<p>My project contains three drawable's folders: drawable-hdpi, drawable-mdpi and drawable. I build it with <code>android:minSdkVersion=""3""</code>. When it runs on Andriod 1.6 or higher it always uses images from drawable-mdpi on high density screens. </p><p><strong>How to fix this?</strong></p>","238123","","","","","2010-09-03 14:01:10","Application doesn't see high density's images","<android>","1","0","1","",""
"3636702","1","3637290","","2010-09-03 14:25:37","1","783","<p>I'm developing an Android application where I want to pin out certain spots/addresses on a google map. I have managed to add point to a mapView using OverlayItem and a Drawable. That works great.</p><p>But I have installed an application where the pins/spots are added asynchronously, and it looks like they are dropped from the top of the screen on to the map. Looks really nice.</p><p>I think I can manage to code the async functionality using threads, but I have no idea how to implement the ""falling"" feature... Does anyone have a clue??</p>","297410","","","","","2010-09-03 15:33:45","How do I drop spots on Google Map in an Android app?","<android><maps>","1","0","","",""
"3636746","1","6493276","","2010-09-03 14:30:41","2","2024","<p>I'd like to use the method profiler to see how many times particular methods are executed. However, everything I see in there is rather cryptic.</p><p>For example, all I'd like to see is how many times method doWork() is called. I simply can't find it. How do I do that?</p><p>Also, it seems like the android SDK has no documentation on how to use this feature. Does anyone have a guide somewhere?</p><p>Thanks</p>","425962","","","","","2011-06-27 13:05:54","Question on DDMS method profiler","<android><profiler><ddms>","1","0","","",""
"3636816","1","3637076","","2010-09-03 14:39:36","1","1090","<p>so i started android programming like a month ago, and i've got a probleme today.</p><p>The thing i want to do is : From a Item in the Spinner, when i select it there is a Text View changing on the back.</p><pre><code>    spin.setAdapter(adapter_city);    spin.setOnItemClickListener(this);}@Overridepublic void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {    switch(v.getId()){        case R.string.Paris : description.setText(""blah blah"");    }}</code></pre><p>and i would like the description fit with the resource.</p><p>Paris is in a xml called ""cities"", it's a value xml.Thank you.</p>","439058","","","","","2010-09-03 15:11:01","How can i use a switch with a spinner?","<android><string><case><switch><spinner>","1","1","1","",""
"3636852","1","","","2010-09-03 14:43:37","1","27120","<p>My Activity onClick() below doesn't appear to be doing anything (not seeing any string appear), yet I dont get any errors.  What am I missing?  Is there a way to trace the function? </p><pre><code>package com.HelloTabWidget2;import android.app.Activity;import android.os.Bundle;import android.widget.Button;import android.widget.TextView;import android.view.View;import android.view.View.OnClickListener;import android.widget.Toast;public class AlbumsActivity extends Activity {    private Button closeButton; public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.setContentView(R.layout.tab1);        this.closeButton = (Button)this.findViewById(R.id.button);        this.closeButton.setOnClickListener(new OnClickListener() {          public void onClick(View v) {           Toast.makeText(AlbumsActivity.this, ""You clicked the button"", Toast.LENGTH_SHORT).show();          }        });    }}</code></pre><p>Thanks!</p>","430060","","3415","","2010-09-03 14:44:51","2012-06-10 21:43:27","android: button onClick(), cant tell if anything is happening","<java><android><eclipse><onclick>","4","0","","",""
"3636865","1","3637033","","2010-09-03 14:45:02","0","55","<p>HelloIn my android app i am reading a file but require anly the data on third line to be displayed.Is there any way to do that.</p><p>Please forward your suggestion:)</p><p>Thanks in advance.</p>","420261","","","","","2010-09-03 15:06:11","get only third line data of a file in android","<android>","1","0","","",""
"3636897","1","3636954","","2010-09-03 14:49:34","3","2695","<p>I want to develop Android apps on the Mac, but the information on <a href=""http://developer.android.com/sdk/index.html"" rel=""nofollow"">http://developer.android.com/sdk/index.html</a> is confusing. Apart from the android-sdk_r06-mac_86.zip , does the Mac need JDK or Eclipse ?</p><p>The <a href=""http://www.oracle.com/technetwork/java/javase/index-137561.html"" rel=""nofollow"">JDK installation page</a> gives a link to Apple site for downloading ""Java Developer Preview 10M3222+9M3222"", which is a pre-release version. I am not sure whether this is what I need. Also somewhere says Mac has already got Java SDK by default and no need to install extra, which makes more confusing.</p><p>Do I need to install the ""Eclipse+ ADT Plugin for Eclipse"" as well?</p><hr><p>I just did a check, and not sure whether the following means I do not need to install any extra JDK. Is the Mac's JDK 1.6.0_20 the equivalent of the other platforms' JDK 6?</p><p>$ javac -version</p><p>javac 1.6.0_20</p><p>$ which javac</p><p>/usr/bin/javac</p><p>$ ls -la /System/Library/Frameworks/JavaVM.framework/Versions/</p><p>total 64</p><p>....drwxr-xr-x   9 root  wheel  306 26 May 11:34 A</p><p>lrwxr-xr-x   1 root  wheel    1 26 May 11:34 Current -> A</p><p>lrwxr-xr-x   1 root  wheel    3 26 May 11:34 CurrentJDK -> 1.6</p>","312938","","59303","","2013-06-01 09:44:04","2013-06-01 09:44:04","Does Mac need JDK (5 or 6) or Eclipse for developing Android Apps?","<android><jdk><macbookpro>","1","0","2","",""
"3637044","1","4721944","","2010-09-03 15:06:53","1","2276","<p>I'm currently implementing a gesture detector for multi-touch events on Android. For testing the behaviour of the detector, i want to send MotionEvents into the detector and check his actions.</p><p>The problem i am currently having is that i can only create MotionEvents by calling one of the existing <code>MotionEvent.obtain()</code> methods, but it seems these methods do not allow me to set the pointer id for an event. I.e. i can only create single-touch events.</p><p>Does anyone know if it's possible to do this somehow? I could use another datastructure for input to the detector, but if possible i want to avoid this and stick with the MotionEvent class.</p>","148912","","","","","2012-07-18 01:53:17","Generating multitouch MotionEvents for testing","<android><multi-touch>","3","1","1","",""
"3637221","1","3637489","","2010-09-03 15:27:15","2","1542","<p>I'm pretty sure that android services are going to be the end of me.  I have almost no hair left after the last few days....</p><p>...anyway, I digress.</p><p>At first I was having a heck of a time getting the service to bind on an onclick of a button, got that straightened out from help here yesterday.  Now I actually want the service to bind in the onCreate() method of the activity.  That part is no problem, works as intended.  My service is actually a socket service to connect TCP sockets to a socket server that I wrote.  If I put the call to the method from the bound service mBoundService.StartSocketServer() inside a button click, bingo, works great.  But I need this to fire up immediately when the activity loads, so directly under my bindService() call within my onCreate() method of the activity.  When I place the call to start the socket inside my onCreate() I get a force-close.</p><p>This method (StartSocketServer()) spawns a new thread then opens the socket on that thread to my remote machine.  I'm guessing that the problem lies with the new thread generation before the activity fully loads...not sure.</p><p>LogCat is fairly cryptic here.  It does say something about thread attach failed, then shows an uncaught handler exception that has ""Caused by: java.lang.NullPointerException"" within it.</p><p>Again, if I put this call to the method inside a button click, I""m in business, if it's in the onCreate() it fails.  Is there some way inside an activity (presuming that my assumption is correct that it needs to fully load before spawning a new thread) to call the StartSocketServer() after it's loaded: ala body.onLoad() in html?</p><p>please help me save the rest of my hair :)</p><p>TIA</p>","233971","","","","","2010-09-03 15:57:48","calling a method from android service immediately after it's bound on onCreate","<android><service><oncreate>","1","0","1","",""
"3637228","1","3637359","","2010-09-03 15:28:14","1","450","<p>HelloIn my android application i would like to replace my first line of a txt file with some other data.Is there any way that i can do this.</p><p>Please let me know your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","115145","","2010-09-03 15:30:32","2010-09-03 15:43:16","Replace the first line of a file in android","<java><android>","1","1","","",""
"3637305","1","3637347","","2010-09-03 15:35:12","0","770","<p>I have a very simple Android activity layout like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;ImageView id=""@+id/blaimg""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Now when I (from onOptionsItemSelected) do the following:</p><pre><code>ImageView imgView = (ImageView)findViewById(R.id.blaimg);</code></pre><p>the contents of imgView is allways null!What am I doing wrong?</p><p>(thanks!)</p>","216582","","","","","2010-09-03 15:41:18","ImageView object allways null","<android><imageview>","1","0","","",""
"3637464","1","3637527","","2010-09-03 15:55:07","1","1150","<p>It turns out that Google <a href=""http://android-developers.blogspot.com/2010/09/securing-android-lvl-applications.html"" rel=""nofollow"">recommends</a> obfuscating your Android app. </p><p>In order to understand the problem, I would like to disassemble my own app and see what information I can extract from the code. How do I do this?</p>","143378","","","","","2010-09-03 16:03:46","Disassembling Android app","<android><obfuscation><deobfuscation>","2","1","2","",""
"3637467","1","3640302","","2010-09-03 15:55:42","2","1900","<p>my App is Launched by ""Main.java"" (Activity) and opens a Notification and a second Activity called ""Sub.java"", now I press the Home-Button and the App disapears (everything okay until here).</p><p>If I'll now click on the Notification the ""Main.java""-Activity is launched, the ""Sub.java"" seems to be lost.Is there any posibility to reorder the Stack of Activities to the front?</p><p>Thanks a lot for any answer.</p><p>Example of my Problem is found here:entire eclipse project: <a href=""http://files.foxylion.de/android/problems/sample1.zip"" rel=""nofollow"">http://files.foxylion.de/android/problems/sample1.zip</a></p>","439126","","439126","","2010-09-03 16:28:48","2010-09-03 23:53:25","How to reopen a stack of Activities?","<android><activity><notifications>","1","0","0","",""
"3637665","1","3637686","","2010-09-03 16:23:51","36","8597","<p>The <code>AndroidManifest.xml</code> contains the version name of the application, something like</p><pre><code>android:versionName=""1.0""</code></pre><p>Now the question - is it somehow possible to access this version name in the source code, so that I can display it for example in an About <code>Dialog</code>?</p>","415347","","119895","","2010-12-17 20:46:13","2011-09-23 19:23:23","User versionName value of AndroidManifest.xml in code","<android><android-manifest>","2","0","9","",""
"3637704","1","3637794","","2010-09-03 16:29:44","4","1464","<p>It appears that android's Spinner class (and possibly ListView in general, although I don't know for sure) calls your OnItemSelectedListener's onItemSelected() method after you call setAdapter(), even if the user hasn't explicitly selected anything yet.</p><p>I can see how this would be useful in many situations, but there are times when I only want onItemSelected() to be called when an item is actually specifically selected.</p><p>Is there a way to control this behavior and have Spinner NOT call onItemSelected() after setting the adapter?</p>","82156","","","","","2014-04-06 04:33:40","How to avoid having android spinner call itemselectedlistener when setting adapter?","<android>","4","0","","",""
"3637712","1","3637775","","2010-09-03 16:30:22","0","115","<p>So i'm starting a application and the first thing to do is make a description of a city when the city is selected. I can show the description but it make the description of all the cities on the same time and it don't come out when i select another city : it add more and more .</p><p>this is my code :</p><p>public class Main extends Activity implements OnItemClickListener, OnItemSelectedListener {</p><pre><code>TextView description;Spinner spin;ArrayAdapter adapter_city;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    description = (TextView)findViewById(R.id.description);    spin = (Spinner)findViewById(R.id.spin);    adapter_city = ArrayAdapter.createFromResource(this, R.array.Cities, android.R.layout.simple_spinner_item);    adapter_city.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spin.setAdapter(adapter_city);    spin.setOnItemSelectedListener(this);}@Overridepublic void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {}@Overridepublic void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position,        long id) {    switch(position){    case 0 :    description.append(getString(R.string.Paris));    case 1 :    description.append(getString(R.string.Chicago));    case 2 :    description.append(getString(R.string.NewYork));    }}@Overridepublic void onNothingSelected(AdapterView&lt;?&gt; parent) {}</code></pre><p>thank you .</p>","439058","","","","","2012-04-05 14:08:32","i've got some problems with my spinner","<android><arrays><spinner>","3","0","","",""
"3637827","1","3637851","","2010-09-03 16:48:44","2","2929","<p>Is there a simple way to obtain the x,y coordinate whenever someone touches the screen while my app is running?  Just looking to store them in some integers.</p>","431204","","","","","2010-09-03 16:51:38","How do i get the x,y coordinate for a screen touch?","<android>","1","0","2","",""
"3638002","1","3638033","","2010-09-03 17:13:39","2","3637","<p>I need to obtain the screen resolution, width &amp; height, how do I do that?</p><p>Solution:</p><pre><code>    Display d = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();    width = d.getWidth();    height = d.getHeight();</code></pre>","431204","","431204","","2010-09-03 17:25:54","2010-09-03 18:55:44","How do I obtain screen resolution information?","<android>","2","0","","",""
"3638147","1","3638203","","2010-09-03 17:35:04","2","1284","<p>Is this possible to interchange a TextView and an EditText. Like display the text when needed, but allow editing when needed. Is there a method (as in NON-XML) way of editing a TextView or non-editing a EditText?</p>","200477","","","","","2012-11-09 15:28:03","Switch between a TextView and EditText","<java><android><textview><edittext><editable>","2","0","","",""
"3638283","1","3638528","","2010-09-03 17:51:51","4","8279","<p>I'm having a hard time trying to indent XML files using <code>XMLSerializer</code>.</p><p>I've tried</p><pre><code>serializer.setFeature(""http://xmlpull.org/v1/doc/features.html#indent-output"",                      true);</code></pre><p>I've tried to append <code>\n</code> into <code>FileWriter</code> but the output is the <code>\n</code>'s and <code>\t</code>'s at the beginning of the file and not in the right place. I've tried <code>setPropery</code> with the proper URI etc.</p><p>Part of the code:</p><pre><code>XmlPullParserFactory parserFactory = XmlPullParserFactory.newInstance();parserFactory .setNamespaceAware(true);XmlSerializer serializer = parserFactory .newSerializer();File xmlFile = new File(PATH + "".xml"");         FileWriter writer = new FileWriter(xmlFile);            serializer.setOutput(writer);//serializer.setProperty(INDENT_URL, INDENT);serializer.startDocument(""UTF-8"", null);//serializer.setFeature(""http://xmlpull.org/v1/doc/features.html#indent-output"",                        true);serializer.startTag(null, ""bla"");writer.append('\n');</code></pre><p>What am I missing?</p>","2443607","","418183","","2011-06-30 11:59:02","2012-01-27 16:39:43","How to indent XML properly using XMLSerializer?","<java><android><xml-serialization><indentation>","4","0","1","",""
"3638322","1","3639801","","2010-09-03 17:57:39","0","1351","<p>I need to have a listview like it is having for the following android application </p><p>Since I cannot post the image this is how it should be</p><hr><p>INAGE Over here | Some Free text                | User name etc</p><hr><p>Here is your task</p><hr><h2>Task 1                     ></h2><h2>Task 2                     ></h2><hr><p>Task 1 &amp; Task 2 are the list which would be dynamically picked up from the DB </p><p>I am trying to have a list with a textview the problem is that I can only get the List or the text view not both any point of time I have even tried relative layout in that case i see the text overlapping</p><pre><code>    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/g_tracker_layout""      android:orientation=""vertical""    android:layout_width=""match_parent""    android:layout_height=""match_parent""&gt;      &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""                        android:id=""@+id/question1""                        android:layout_width=""match_parent""                        android:layout_height=""match_parent""                        android:autoLink=""all""                        android:text=""@string/question1""                        /&gt;    &lt;ListView android:id=""@+id/ListView01"" android:layout_width=""match_parent"" android:layout_height=""match_parent"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Any help guidance would be really helpful in achiving the layout similar to this</p><p>Following is the snippet in the onCreateMethod()</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.g_tracker_home);         this.dh = new TrackerDAO(this);         lv1=(ListView)findViewById(R.id.ListView01);         trackerObj = dh.selectAll();        if(trackerObj!=null) {        List&lt;String&gt; al = new ArrayList&lt;String&gt;();        for(Tracker obj : trackerObj ){          al.add(obj.getTrackerName());        }           lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , al));   }</code></pre>","435170","","244296","","2010-09-03 18:11:13","2010-10-23 11:16:25","Can I have a List view and images icon with textview on the Android","<android><image><listview><layout>","3","0","","",""
"3638463","1","","","2010-09-03 18:16:54","0","142","<p>My app has a TabHost with 3 tabs (checked, unchecked, all).  Each of the tabs has a function called fillData() which loops through database records populating a ScrollView.  If a user clicks a checkbox on one tab the record will move to the next tab (changing it from checked to unchecked, or vice versa).  As it's designed right now the record is being removed from the current tab, because I'm recalling fillData() after the update is made.  The tab it has been moved to has not been updated.</p><p>I am calling fillData from the onCreate method, which works for the initial load, but when a user returns to a previously created tab onCreate doesn't seem to be called.  What method is called each time the page loads?  I assume that is where I should call fillData(), right?</p><p>Thank you for your help.</p>","422967","","","","","2010-09-03 18:39:58","How should I call fillData() to update each time the screen loads?","<android>","1","0","","",""
"3638467","1","3639840","","2010-09-03 18:17:47","1","2692","<p>I am having trouble setting up landscape mode in my application.</p><p>I have a /res folder that contains a layout folder and a layout-land folder</p><pre><code>layout-----main.xmllayout-land-----main.xml</code></pre><p>My /layout-land/main.xml contains different UI elements than /layout/main.xml. How can I map each layout appropriately when the user has switched to landscape mode and vice versa?</p><p>I am basically displaying a full screen ImageView when the user switches to landscape mode. The ImageView will download an image from the internet and display it. Switching back to portrait, should simply go back to my portrait mode, which has a different set of UI components.</p><p>I get a crash when I switch to landscape mode:</p><p>because I can't get the id:</p><pre><code>chartImageViewLandscape = (ImageView) this.findViewById(R.id.chartImageViewLandscape);</code></pre><p>chartImageViewLandscape is in /layout-land/main.xml</p><p>How can I get a reference to this?</p>","19875","","19875","","2010-09-03 21:20:04","2012-01-19 15:32:08","App crashes when switching to landscape layout","<java><android><layout><orientation>","3","0","1","",""
"3638499","1","","","2010-09-03 18:21:18","-2","1117","<p>Can I pass a singleton class's object from one activity to another activity using intent?  I am using singleton class as <code>imageclass img =  imageclass.getInstance();</code>, so i need the <code>img</code> instance for another activity, how can i pass an object instance in Android?</p><p>Thanks all</p>","410757","","345708","","2010-09-03 19:26:08","2010-09-03 19:26:08","Can we pass singleton class's object via intent?","<android>","2","2","","",""
"3638660","1","3639893","","2010-09-03 18:43:10","1","3690","<p>I have copied and pasted the code from the Form stuff example on this website.  I am getting an error when i try and run the project, the project has a little red square with a white cross on it but when drilling down into the elements of the project (using eclipse) there is element with an error.  In the problems tab of eclipse I have the following text</p><p>Description Resource Path Location TypeUnparsed aapt error(s)! Check the console for output. HelloFormStuff2  Unknown Android Packaging Problem</p><p>But there is nothing in the console!!Here is the code and elements that I am using...</p><p><strong>HelloFormStuff2.java</strong></p><pre><code>package com.android.HelloLinearLayouts;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class HelloFormStuff2 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final Button button = (Button) findViewById(R.id.button);        button.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // Perform action on clicks                Toast.makeText(HelloFormStuff2.this,                                ""Beep Bop"",                                Toast.LENGTH_SHORT).show();            }        });    }}**res/drawable-hdpi/android-button.xml**&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:drawable=""@drawable/android_pressed""          android:state_pressed=""true""/&gt;    &lt;item android:drawable=""@drawable/android_focused""          android:state_focused=""true""/&gt;    &lt;item android:drawable=""@drawable/android_normal""/&gt;&lt;/selector&gt;**res/layout/main.xml**&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;    &lt;Button        android:id=""@+id/button""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:padding=""10dp""        android:background=""@drawable/android_button"" /&gt;&lt;/LinearLayout&gt;</code></pre>","439242","","1228","","2013-08-14 15:54:01","2013-08-14 15:54:01","Undefined error when trying to run android tutorial Form stuff","<java><android>","2","0","","",""
"3638661","1","","","2010-09-03 18:43:15","0","982","<p>I am in one activity say Activity A. I am calling another activity B.In activity A I write the following Statement: startActivity(new Intent(this,ActivityB.class));</p><p>Now, I want to log a  debug message  only when Activity A is able to successfully launch ActivityB.How can I achieve this feature in Android.Any kind of Help is appreciatedThanks,</p>","385939","","","","","2011-03-07 15:08:58","How to display log message when an activity is started in Android","<android><android-widget>","1","0","","",""
"3638728","1","","","2010-09-03 18:55:31","3","3392","<p><strong>My Question</strong> - I want the text of a TextView I have in a custom ListView to marquee scroll ONLY when the item is selected in the ListView. When the list item loses focus, I want the marquee to stop scrolling. I know that I need to set the TextView to enabled (<strong>setEnabled(true)</strong>) for scrolling to work however when I do this as items are added, they ALL scroll, which is not the behavior I want (but it does make sense why this happens). I tried setting them programmatically using the click handler of the ListView to set the TextView to enabled (<strong>setEnabled(true)</strong>), keep track of the current selected item in a private variable, then conversely setting the previous Views TextView enabled status to false when a new item is clicked and so on. I hope this makes sense. Here's some Java code that might better illustrate it:</p><pre><code>    private View tempListItemView = null;    if (this.tempListItemView != null) {       TextView tempTxtView = (TextView) tempListItemView.findViewById(R.id.txtArticleTitle);       tempTxtView.setSelected(false);       tempTxtView.setEllipsize(TruncateAt.END);    }    // Set marquee of currently selected list item    TextView tt = (TextView) v.findViewById(R.id.txtArticleTitle);    tt.setEllipsize(TruncateAt.MARQUEE);    tt.setSelected(true);    tempListItemView = v; </code></pre><p>This does work, sort of. However, it's a little clunky. For example if the previous item leaves the display it never gets turned off and when I select the list item, I lose all of the custom listSelector properties I have set (see below). Also, I've had some other odd behavior with the background item of the scrolling TextView changing to black (and even the entire ListView listSelector disappearing entirely. None of this occurs when I use the keypad on my Droid. It works as it should, however I'm just trying to emulate this functionality when list items are pressed. I haven't found much on the web on how to achieve this. Below are snippets and screen shots.</p><p>I have a ListActivity that I've bound to an ArrayAdapter with a custom list view. The content view that this activity is tied to looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ListView    android:id=""@+id/android:list""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:listSelector=""@drawable/list_selector""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>The list_selector drawable looks like this:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item android:state_focused=""true"" android:drawable =""@drawable/maroon_list_select_bg"" /&gt;  &lt;item android:drawable=""@drawable/maroon_list_select_bg"" /&gt;&lt;/selector&gt;</code></pre><p>Its Drawable is simply a 1x1 maroon pixel to paint a maroon background color of the list item selection. In the interest of saving space, I've attached a screenshot of what the custom view looks like: (my first post so I couldn't :(</p><p>and here is a brief snippet of the custom layout that defines each list item (with the marquee TextView)...</p><pre><code>            &lt;TextView                android:id=""@+id/txtArticleTitle""                android:textSize=""16sp""                android:textStyle=""bold""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/list_item""                android:singleLine=""true""                android:ellipsize=""end""&gt;              &lt;/TextView&gt;            &lt;TextView                android:id=""@+id/txtArticleSnippet""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:textColor=""@color/list_desc_copy""                &gt;            &lt;/TextView&gt;            &lt;TextView                android:id=""@+id/txtArticleVotes""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:text=""Votes: 1576""                android:textColor=""@color/list_small_copy""                &gt;            &lt;/TextView&gt;</code></pre><p>Please remember, I do know that I need to set android:ellipsize to ""marquee"" to get the scrolling but as explained above, I was doing this programmatically to currently selected list tiems.</p><p>Does anyone have a solution for this? Thanks in advance and I apologize for the lengthy post...just trying to be thorough. Thanks again!</p>","439216","","","","","2013-12-12 06:13:57","Android Ellipsize marquee issues with currently selected list item","<android><listview><marquee><android-arrayadapter>","2","0","","",""
"3638891","1","3642663","","2010-09-03 19:21:31","1","1639","<p>I've got to missing something completely stupid on this one since updating a TextView should be an easy task.  I have an Activity class that is an observer of another that receives messages.  In my Activity's onCreate I do the following and it works fine.</p><p>theStatus = (TextView) findViewById(R.id.theStatus);</p><p>theStatus.setText(""waiting"");</p><p>Later when the message activity receives a new message it hands it off to it's observer (my Activity)</p><p>public void statusUpdate( GenericMessage aMessage )</p><p>{</p><p>String statusText = aMessage.getDetails();</p><p>theStatus.setText(statusText);</p><p>theSessionStatus.invalidate();  // I've tried with and without this call</p><p>}</p><p>However the screen doesn't update.  I must be overlooking something...Thanks for any input!</p>","418714","","","","","2010-09-04 14:23:11","Android TextView text not updating during runtime","<android><android-widget>","1","7","1","",""
"3638926","1","","","2010-09-03 19:26:09","0","783","<p>I use the following ffmpeg command to convert a video for smartphones.  It works for Droid x and Iphone4, but not windows media player nor the older version of droid.  Can anyone shred some light?</p><p>Those droids works with Youtube h264 codec.  But somehow doesn't play the video of my encoded mp4 (the audio plays just fine).</p><p><code>ffmpeg -y -i inputfile.mp4 -pass 1 -s 320x180 -vcodec libx264 -vpre fastfirstpass -b 64k -bt 64k -threads 0 -f mp4 -an /dev/null &amp;&amp; ffmpeg -i inputfile.mp4 -pass 2 -acodec libfaac -ab 32k -ac 2 -vcodec libx264 -vpre hq -s 320x180 -b 64k -bt 64k -threads 0 -f mp4 -y output.mp4</code></p>","310627","","","","","2010-09-03 19:26:09","FFMPEG libx264 2-pass for smartphones","<iphone><android><windows-mobile><blackberry>","0","2","","",""
"3639019","1","","","2010-09-03 19:37:35","2","611","<p>I'm adding an intent filter to my android application and I want it to catch requests that go http://www.somedomain.com/[numericValue] .  I only want to catch it if the path is numeric, but if it has text, I don't care about it.  </p><p>I tried the pathPattern of [0123456789]*, but that didn't work.  Is this possible to do?</p>","388065","","","","","2010-09-03 21:00:25","Android intent-filter pathPattern numeric matching","<android><android-manifest>","1","0","","",""
"3639031","1","3741653","","2010-09-03 19:39:33","7","3693","<p>I started building an Android app that uses a flat file for storage.  The app doesn't store more than six records, and I'm familiar with JSON, so I just write out a <code>JSONArray</code> to the file.</p><p>I just discovered today, though, that the Android JSON API doesn't include a <code>remove()</code> option.  Huh?  Do I have to dump the array into another collection, remove it, then rebuild the <code>JSONArray</code>?  What's the point?</p>","331791","","1318946","","2013-10-08 11:00:09","2013-11-27 19:02:02","Why isn't there a remove(int position) method in Android's JSONArray?","<android><json>","4","2","2","",""
"3639121","1","","","2010-09-03 19:50:31","3","480","<p>So I've recently released an application on to the Android Market. Whilst it was in the ""Just In"" section I was seeing decent download numbers, but since then interest seems to have dropped off significantly. I think now people can only find my app through a specific keyword search, which doesn't make me particularly confident about it ever becoming popular.</p><p>What can you do when your app has passed the 'Just In' stage but has not reached the 'Featured' stage? The majority of applications seem to be in this middle stage so I think other people must have a similar problem. It seems like the 'Featured' section just makes the <a href=""http://en.wikipedia.org/wiki/The_rich_get_richer_and_the_poor_get_poorer"" rel=""nofollow"">popular apps more popular</a>, and makes it really difficult for newer apps to ever catch up with them. Does anyone know if the situation with the Apple App Store is any different?</p><p>It seems to be possible to refresh your app and make it appear in the 'Just In' section again if you update it sometime after, but I can't find any real guidelines on this. Is anyone familiar with the specific rules for this, and is repeatedly riding the 'Just In' buzz the only viable strategy for a new app?</p>","438140","","","","","2012-10-26 11:27:46","What are some of the best ways to get your Android application noticed after it leaves the 'Just In' section?","<android><google-play>","2","2","3","2013-04-04 06:42:21",""
"3639369","1","3639449","","2010-09-03 20:27:16","4","1587","<p>I have a ListView populated via a CursorAdapter.  I give my user the ability to alter the data in the list.  For example, the user can mark a row as being unread (the data are messages).</p><p>Suppose my user marked a row unread.  Would a proper implementation mark the row in the database as read and then requery the Cursor?</p>","406790","","","","","2012-06-18 13:22:40","Proper implementation of changing ListView data with CursorAdapter","<android><listview><cursor><listactivity>","2","0","1","",""
"3639577","1","","","2010-09-03 21:07:24","0","337","<p>I have been tasked with sourcing an off the shelf touch pad device that can be used as a dedicated industrial instrument controller. </p><p>Is it possible to run a dedicated application and prevent user access to all other functions/applications within Android.   </p><p>Also is it possible write your own USB device driver which would allow you to connect an USB serial class device?</p>","439319","","58074","","2013-02-27 17:03:54","2013-02-27 17:03:54","Application dedicated Android Device is it possible?","<android><serial-port><usb><dedicated>","3","1","1","",""
"3639860","1","","","2010-09-03 22:02:18","1","2511","<p>I defined static variables in Activities in order to pass complex data between Activities.</p><p>Many people suggest not to use any static variables in Android. Some people suggest to store global data in a custom android.app.Application. I don't think there is any difference between static variable and custom Application.</p><p>I'd like to know your thoughts on static variables. Any suggestions?</p><p>Thanks.</p>","256239","","","","","2010-09-03 22:13:17","Static variables in Android","<android>","2","0","","",""
"3639954","1","4100544","","2010-09-03 22:19:47","0","316","<p>Say that there is an <a href=""http://developer.android.com/guide/topics/appwidgets/index.html"" rel=""nofollow"">App Widget</a> that shows a configuration Activity when placed.  The configuration page allows adjusting the appearance of the widget.</p><p>The user may place multiple instances of this widget on their home screen. What would be the best way to maintain the unique configuration states on each of the widget instances? Or would each widget instance have to adopt the same global state?</p>","105137","","","","","2010-11-04 19:36:57","instance-specific AppWidget configuration","<android><appwidget>","1","0","","",""
"3640004","1","3640071","","2010-09-03 22:31:05","5","3748","<p>I need help understanding the following.</p><p>Say I have a display that is 854x480 pixels. Why is it that the MotionEvent.getX and getY methods return floats? As far as I can tell, the pixels on the display are discrete integers, there is no such thing as a half a pixel on the display.</p>","425962","","","","","2010-09-03 23:07:33","Motionevent.getX and getY","<android><events><motion>","1","0","","",""
"3640090","1","","","2010-09-03 22:50:46","0","348","<p>I've just published my app on the android market but something weirdhappened, this is not my first time publishing an app so I'm almostsure I'm not doing anything wrong here, so would like to know ifanyone had this same issue before.</p><p>1st Attempt:</p><p>Manifest.xml file</p><pre><code>&lt;supports-screens android:largeScreens=""true""android:normalScreens=""true"" android:smallScreens=""true""android:anyDensity=""true"" /&gt;&lt;uses-sdk android:minSdkVersion=""4"" /&gt;</code></pre><p>default.properties:</p><pre><code>split.density=falsetarget=android-4</code></pre><p>2nd Attempt:</p><p>Manifest.xml file</p><pre><code>&lt;supports-screens android:largeScreens=""true""android:normalScreens=""true"" android:smallScreens=""true""android:anyDensity=""true"" /&gt;&lt;uses-sdk android:minSdkVersion=""4"" android:targetSdkVersion=""8"" /&gt;</code></pre><p>default.properties:</p><pre><code>split.density=falsetarget=android-8</code></pre><p>This is suppose to be visible for all android devices that has theversion 1.6 and later, right? we have 3 androids here and I can onlysee the app in the android market with the 1.6 android phone, theother ones are 2.0.1 and 2.01 and I'm not being able to see the appthere.</p><p>Is there anything wrong with this configurations or something isreally going on with apps publication lately?</p>","","user439324","881229","","2014-01-06 19:48:50","2014-01-06 19:48:50","Bug in minSdkVersion or what?","<android><google-play><manifest>","0","2","","",""
"3640267","1","3641192","","2010-09-03 23:40:51","3","4485","<p>Is there a way to store a BLOB into Android's SQLite using <code>SQLOpenHelper</code>?</p><p>My BLOB of type <code>InputStream</code>.</p>","149166","","149166","","2010-09-04 06:04:53","2010-09-05 17:55:19","Store BLOB in Android's SQLite using SQLOpenHelper","<java><android><sqlite><blob><inputstream>","1","0","3","",""
"3640282","1","3645995","","2010-09-03 23:47:55","3","1343","<p>The documentation seems to imply you can't do localization AND resolution targetting.</p><p>Can anyone tell me how you can go about localizing drawable-nodpi?</p><p>Eclipse returns an invalid resource directory name error.</p><p>I'm targeting Android 2.2 only so if there are more recent ways to solve this, would be great to hear about them.</p>","29553","","29553","","2010-09-05 11:03:13","2010-09-05 12:09:26","How can you localize drawable-nodpi?","<android><localization>","2","0","","",""
"3640387","1","3672668","","2010-09-04 00:20:57","2","637","<p>I've implemented the <a href=""http://developer.android.com/guide/publishing/licensing.html"" rel=""nofollow"">android licensing</a> in my application following the example code using the ServerManagedPolicy.</p><p>The licence checker works fine, however when a device or emulator has no data connection then the licensing code will always return dontAllow(), while I want it to allow. I cannot seem to find anything on the page above that details how to avoid this.</p>","315998","","","","","2012-10-03 07:28:50","Android licencing ServerManagedPolicy returns dontAllow when no data connection is active","<android><licensing>","2","0","","",""
"3640496","1","3640514","","2010-09-04 01:03:36","2","517","<p>In a previous question I asked how I could display two different layouts for portrait and landscape orientations: </p><p><a href=""http://stackoverflow.com/questions/3638467/app-crashes-when-switching-to-landscape-layout"">Problem switching to landscape orientation</a></p><p>Now I would like to know how I can save the state of my application before it goes into another orientation? I seem to lose this data any time orientation changes.</p>","19875","","","","","2010-09-04 01:12:00","How can I save state between orientations?","<java><android><configuration><orientation>","1","0","","",""
"3640545","1","","","2010-09-04 01:26:51","0","774","<p>I am trying to use a gradient divider in my simple listview. But it simply will not work. </p><p>Layout xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    android:id=""@+id/main_layout""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/wood_small""    android:padding=""5dip"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;ImageView android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:id=""@+id/masthead_image"" android:layout_gravity=""center_horizontal""         android:src=""@drawable/tavi_mh_copy""&gt;    &lt;/ImageView&gt;    &lt;ListView  android:id=""@+id/station_list""         android:layout_height=""fill_parent"" android:layout_width=""fill_parent""        android:divider=""@drawable/black_white_gradient"" android:dividerHeight=""2px""&gt;    &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>Divider Xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""    android:shape=""rectangle""&gt;  &lt;gradient      android:startColor=""#00222222""      android:centerColor=""#FFFFFFFF""      android:endColor=""#00222222""      android:angle=""0"" /&gt;&lt;/shape&gt;</code></pre>","439405","","750987","","2011-05-28 14:09:27","2011-05-28 14:09:27","Divider not working in my listview","<android><android-listview>","1","3","","",""
"3640555","1","3641223","","2010-09-04 01:30:53","0","3994","<p>I have a FrameView that's created in my XML layout, and in my code, I'm trying to create a series of new ImageViews and add them as children of this FrameView.  The ImageViews are small, only about 15 pixels square, and I want them to show up in various positions around the FrameView (I'm trying to implement what looks like a radar screen).  I'm able to create them and add them just fine, and they show up on the screen.  However, when I try to set their margins, it doesn't seem to have any effect.  No matter what I set, all the ImageViews show up in the top left corner of the FrameView, as opposed to offset by the appropriate margins.  My XML layout is listed below, along with the code that generates the child views.  Am I doing something wrong?  How can I get the margins to show up properly?  Or is there a better way to do this than by using margins.</p><p>XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/RadarBackground""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:background=""@drawable/radar_bg""&gt; &lt;FrameLayout    android:id=""@+id/RadarFrame""    android:layout_width=""320dip""    android:layout_height=""320dip""    android:layout_marginTop=""25dip""&gt; &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Java:</p><pre><code>for (int i = 0; i &lt; getData().getTargetCount(); i ++) { int id = getData().getTargetId(i); Log.d(T.TAG_A, ""Radar: plotting target "" + id); TargetView tv = new TargetView(this, id, getData().getTargetName(id)); FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(   LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lp.setMargins(   radarCenterX + (int) (getData().calcTargetRadarX(id, radarSize) / radarScale) - (targetSizeX / 2),    radarCenterY - (int) (getData().calcTargetRadarY(id, radarSize) / radarScale) - (targetSizeY / 2),    0, 0); tv.setImageResource(R.drawable.radar_civilian); tv.setOnClickListener(this); mTargets.add(tv); mFrame.addView(tv, lp);}</code></pre>","433792","","","","","2010-09-04 06:57:21","Set a new view's margins programatically","<java><android><layout><view><margin>","1","0","","",""
"3640653","1","","","2010-09-04 02:29:46","0","189","<p>I have one EditText, and I want to get the current column position.</p><p>I am using SDK 1.5</p><p>Thanks,Alex</p>","412449","","","","","2010-09-04 02:40:00","how to get android EditText column","<java><android>","1","0","","",""
"3640733","1","3640746","","2010-09-04 03:08:28","4","1484","<pre><code>HashMap myMap = (HashMap) getLastNonConfigurationInstance();</code></pre><p>myMap is always null. getLastNonConfigurationInstance() returns an object. My map has two keys ""symbol"" and ""name"".</p><pre><code>public Object onRetainNonConfigurationInstance()    {        HashMap myMap = new HashMap();        myMap.put(""symbol"", this.symbol);        final Object data = myMap;        return data;    }</code></pre>","19875","","564626","","2012-01-16 17:24:05","2012-01-16 17:24:05","getLastNonConfigurationInstance always returning null","<java><android><data-structures><object><hashmap>","3","1","0","",""
"3640774","1","","","2010-09-04 03:29:23","0","460","<p>I have an app that i am working on. but when i run it through the eclipse avd... It shows two icons in the app screen. any ideas what is going on?</p><p>Also I used the apk to install on my phone and i also saw two installation of the same app on my phone. </p>","439432","","","","","2010-09-04 03:35:14","Double installation of apk","<android><eclipse><sdk>","1","1","","",""
"3640781","1","3640838","","2010-09-04 03:31:30","2","3895","<p>i want to develop apps based on speech to text conversion.can you please share your suggestions and how to develop this app</p>","1746300","","302328","","2010-11-15 09:40:44","2011-08-12 18:00:27","speech to text conversion in android","<android><speech-to-text>","2","0","","",""
"3640805","1","","","2010-09-04 03:43:08","0","542","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3640733/how-to-cast-an-object-to-a-hashmap"">How to cast an object to a HashMap?</a>  </p></blockquote><pre><code>HashMap myMap = (HashMap) getLastNonConfigurationInstance();</code></pre><p>myMap is always null. getLastNonConfigurationInstance() should return an object. </p><pre><code>public Object onRetainNonConfigurationInstance()    {        HashMap myMap = new HashMap();        myMap.put(""symbol"", this.symbol);        final Object data = myMap;        return data;    }</code></pre><p>Why is this?</p>","19875","","","","","2010-12-19 01:10:25","getLastNonConfigurationInstance always returns null","<android><configuration>","0","1","0","2011-08-28 09:52:52",""
"3640892","1","3640922","","2010-09-04 04:19:58","5","6601","<p>Is this possible to do? Landscape mode distorts the background image, and therefore I would like to lock orientation to vertical on phones with accelerometers.</p><p>Thanks.</p>","312390","","","","","2010-09-04 04:33:54","How to lock phone orientation in Android to prevent landscape mode","<android>","2","0","","",""
"3640973","1","3641792","","2010-09-04 04:57:18","0","3487","<p>I need to write a background service to get latitude and longitude values. I have an Android application in which it has to find where the user is currently. Is there any way to programmatically get the latitude and longitude values from the system services (or some program)?</p>","431655","","63550","","2011-02-19 09:38:23","2013-12-19 12:12:49","How to write a background service to get latitude and longitude?","<android><geolocation><gps><latitude-longitude>","2","2","1","",""
"3640981","1","3641168","","2010-09-04 05:03:41","0","2938","<p>i am trying out this code for scanning wifi networks but getting null pointer exception not sure what problem i registered all permission in manifest.</p><pre><code>IntentFilter i = new IntentFilter();    i.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);    registerReceiver(new BroadcastReceiver(){            @Override            public void onReceive(Context context, Intent intent) {                // TODO Auto-generated method stub                Log.i(TAG, ""opening wifimanager"");                WifiManager mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);                mWifiManager.getScanResults();            }        }    ,i);        mWifiManager.startScan();</code></pre>","430556","","","","","2011-11-11 14:01:09","android scan for wifi network","<android><wifi>","1","0","1","",""
"3641048","1","3641098","","2010-09-04 05:31:19","1","1304","<p>We can use the XPathEvaluator object(in javascript) to do xpath evaluation on Safari,Google Chrome and Safari on Iphone. But on android the browser said that the XPathEvaluator object is undefined.</p><p>So how can I get a instance of XPathEvaluator object, or is there any other solution to perform xpath evaluation on android browser?</p>","318333","","318333","","2010-09-04 05:45:29","2010-09-04 06:01:13","Where is XPathEvaluator in android web browser?","<javascript><android><xpath><webkit>","1","0","","",""
"3641059","1","3641361","","2010-09-04 05:35:27","3","2999","<p>I have a linear layout with few child components in it. I have onTouchListener on the linearlayout. I want onTouch event to trigger when I touch child components of the linear layout too.</p>","215399","","","","","2010-09-04 07:55:35","Android onTouchListener on LinearLayout","<java><android>","1","0","1","",""
"3641145","1","3647813","","2010-09-04 06:21:17","1","1700","<p><img src=""http://i.stack.imgur.com/kBKAl.png"" alt=""alt text""></p><p>First off, sorry about the large screen. I am trying to get the text to wrap but am currently unable to do so. I have tried android:layout_width=""fill_parent"", android:scrollHorizontal=""false"", android:width=""0dip"" all of which suggested in another question. Does anyone have any idea how I can achieve text wrapping? Here's a sample of the xml:</p><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""&gt;&lt;TableLayout     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:stretchColumns=""2""&gt;    &lt;TableRow&gt;        &lt;TextView            android:layout_column=""1""            android:gravity=""center""            android:background=""@drawable/lgrayborder""            android:paddingRight=""5dip""            android:paddingLeft=""5dip""            android:id=""@+id/chatUser1""/&gt;        &lt;TextView            android:layout_column=""1""            android:gravity=""left""            android:background=""@drawable/lgrayborder""            android:paddingLeft=""5dip""            android:id=""@+id/chatComm1""/&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:layout_column=""1""            android:gravity=""center""            android:background=""@drawable/lgrayborder""            android:paddingRight=""5dip""            android:paddingLeft=""5dip""            android:id=""@+id/chatUser2""/&gt;        &lt;TextView            android:layout_column=""1""            android:gravity=""left""            android:background=""@drawable/lgrayborder""            android:paddingLeft=""5dip""            android:id=""@+id/chatComm2""/&gt;    &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;/ScrollView&gt;</code></pre><p>Update: I have tried setting attributes in the ScrollView, TableLayout, and TableRow in hopes that it would force the TextViews to wrap but to no avail. Still looking for a solution to this.</p>","423519","","423519","","2010-09-05 20:58:12","2011-02-17 20:24:53","Text wrap in TextView within a Tab","<android><xml>","3","0","","",""
"3641220","1","3920956","","2010-09-04 06:56:36","-1","1735","<p>When I use CreateProcess to create process adb.exe, It will Block in ReadFile.</p><pre><code>void KillAdbProcess(){    DWORD aProcesses[1024], cbNeeded, cProcesses;    unsigned int i;    if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &amp;cbNeeded ) )        return;    cProcesses = cbNeeded / sizeof(DWORD);    for ( i = 0; i &lt; cProcesses; i++ )        if( aProcesses[i] != 0 ){            bool shouldKill =false;            wchar_t szProcessName[MAX_PATH] = L""&lt;unknown&gt;"";                //Get a handle to the process.                HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |                                   PROCESS_VM_READ | PROCESS_TERMINATE,                                   FALSE, aProcesses[i] );                if (NULL != hProcess )                {                    HMODULE hMod;                    DWORD cbNeeded;                    if ( EnumProcessModules( hProcess, &amp;hMod, sizeof(hMod),                          &amp;cbNeeded) )                    {                        GetModuleFileNameExW( hProcess, hMod, szProcessName,                                            sizeof(szProcessName)/sizeof(TCHAR));                        int len = wcslen(szProcessName);                        if(!wcscmp(L""\\adb.exe"",szProcessName+len-8)){                            shouldKill = true;                        }                    }                }                if(shouldKill) TerminateProcess(hProcess,0);                CloseHandle( hProcess );        }} int testadb(){    KillAdbProcess();    char buff[4096] = {0};    int len = sizeof(buff);    DWORD exitCode = 0;    SECURITY_ATTRIBUTES   sa;       ZeroMemory(&amp;sa, sizeof(sa));     sa.bInheritHandle = TRUE;       sa.lpSecurityDescriptor = NULL;       sa.nLength = sizeof(sa);    HANDLE hOutputReadTmp,hOutputRead,hOutputWrite;    // Create the child output pipe.    if (!CreatePipe(&amp;hOutputReadTmp,&amp;hOutputWrite,&amp;sa,0))        return false;    // Create new output read handle and the input write handles. Set    // the Properties to FALSE. Otherwise, the child inherits the    // properties and, as a result, non-closeable handles to the pipes    // are created.    if (!DuplicateHandle(GetCurrentProcess(),hOutputReadTmp,        GetCurrentProcess(),        &amp;hOutputRead, // Address of new handle.        0,FALSE, // Make it uninheritable.        DUPLICATE_SAME_ACCESS))        return false;    // Close inheritable copies of the handles you do not want to be    // inherited.    if (!CloseHandle(hOutputReadTmp)) return false;    PROCESS_INFORMATION  pi;     ZeroMemory(&amp;pi, sizeof(pi));       STARTUPINFOW  si;    GetStartupInfoW(&amp;si);    si.cb = sizeof(STARTUPINFO);    si.dwFlags = STARTF_USESTDHANDLES;    si.wShowWindow = SW_HIDE;    si.hStdInput   = NULL;    if(buff) {        si.hStdOutput   =   hOutputWrite;           si.hStdError = hOutputWrite;    } else {        si.hStdOutput   =  NULL;           si.hStdError = NULL;    }    wchar_t cmdBuf[512] = L""adb.exe start-server"";    if( !::CreateProcessW(NULL, cmdBuf, NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &amp;si, &amp;pi) )    {        exitCode = -1;        goto exit;    }    ::CloseHandle(hOutputWrite);    hOutputWrite = NULL;    len--; //keep it for string end char.    DWORD dwBytes = 0;    DWORD dwHasRead = 0;    while(::ReadFile(hOutputRead, buff+dwHasRead, len-dwHasRead, &amp;dwBytes, NULL))    {        printf(""read byte=%d\n"",dwBytes);        if(0 == dwBytes) break;        dwHasRead += dwBytes;        //GetExitCodeProcess(pi.hProcess, &amp;exitCode);        //if(STILL_ACTIVE != exitCode) break;        if(dwHasRead &gt;= len) break;    }    buff[dwHasRead] = 0;    ::GetExitCodeProcess(pi.hProcess, &amp;exitCode);exit:    if(hOutputRead) ::CloseHandle(hOutputRead);    if(hOutputWrite) ::CloseHandle(hOutputWrite);    ::CloseHandle(pi.hProcess);    ::CloseHandle(pi.hThread);    return 0;}</code></pre><p>If I change code to</p><pre><code>while(::ReadFile(hOutputRead, buff+dwHasRead, len-dwHasRead, &amp;dwBytes, NULL)){    printf(""read byte=%d\n"",dwBytes);    if(0 == dwBytes) break;    dwHasRead += dwBytes;    GetExitCodeProcess(pi.hProcess, &amp;exitCode);    if(STILL_ACTIVE != exitCode) break;    if(dwHasRead &gt;= len) break;}</code></pre><p>it works, but when I delete printf code, it will block again.</p><pre><code>while(::ReadFile(hOutputRead, buff+dwHasRead, len-dwHasRead, &amp;dwBytes, NULL)){    if(0 == dwBytes) break;    dwHasRead += dwBytes;    GetExitCodeProcess(pi.hProcess, &amp;exitCode);    if(STILL_ACTIVE != exitCode) break;    if(dwHasRead &gt;= len) break;}</code></pre><p>In the code of adb.exe, I see some code like belows:</p><pre><code>#if ADB_HOSTint launch_server(){#ifdef HAVE_WIN32_PROC    /* we need to start the server in the background                    */    /* we create a PIPE that will be used to wait for the server's ""OK"" */    /* message since the pipe handles must be inheritable, we use a     */    /* security attribute                                               */    HANDLE                pipe_read, pipe_write;    SECURITY_ATTRIBUTES   sa;    STARTUPINFO           startup;    PROCESS_INFORMATION   pinfo;    char                  program_path[ MAX_PATH ];    int                   ret;    sa.nLength = sizeof(sa);    sa.lpSecurityDescriptor = NULL;    sa.bInheritHandle = TRUE;    /* create pipe, and ensure its read handle isn't inheritable */    ret = CreatePipe( &amp;pipe_read, &amp;pipe_write, &amp;sa, 0 );    if (!ret) {        fprintf(stderr, ""CreatePipe() failure, error %ld\n"", GetLastError() );        return -1;    }    SetHandleInformation( pipe_read, HANDLE_FLAG_INHERIT, 0 );    ZeroMemory( &amp;startup, sizeof(startup) );    startup.cb = sizeof(startup);    startup.hStdInput  = GetStdHandle( STD_INPUT_HANDLE );    startup.hStdOutput = pipe_write;    startup.hStdError  = GetStdHandle( STD_ERROR_HANDLE );    startup.dwFlags    = STARTF_USESTDHANDLES;    ZeroMemory( &amp;pinfo, sizeof(pinfo) );    /* get path of current program */    GetModuleFileName( NULL, program_path, sizeof(program_path) );    ret = CreateProcess(            program_path,                              /* program path  */            ""adb fork-server server"",                                    /* the fork-server argument will set the                                       debug = 2 in the child           */            NULL,                   /* process handle is not inheritable */            NULL,                    /* thread handle is not inheritable */            TRUE,                          /* yes, inherit some handles */            DETACHED_PROCESS, /* the new process doesn't have a console */            NULL,                     /* use parent's environment block */            NULL,                    /* use parent's starting directory */            &amp;startup,                 /* startup info, i.e. std handles */            &amp;pinfo );    CloseHandle( pipe_write );    if (!ret) {        fprintf(stderr, ""CreateProcess failure, error %ld\n"", GetLastError() );        CloseHandle( pipe_read );        return -1;    }    CloseHandle( pinfo.hProcess );    CloseHandle( pinfo.hThread );    /* wait for the ""OK\n"" message */    {        char  temp[3];        DWORD  count;        ret = ReadFile( pipe_read, temp, 3, &amp;count, NULL );        CloseHandle( pipe_read );        if ( !ret ) {            fprintf(stderr, ""could not read ok from ADB Server, error = %ld\n"", GetLastError() );            return -1;        }        if (count != 3 || temp[0] != 'O' || temp[1] != 'K' || temp[2] != '\n') {            fprintf(stderr, ""ADB server didn't ACK\n"" );            return -1;        }    }#elif defined(HAVE_FORKEXEC)    char    path[PATH_MAX];    int     fd[2];    // set up a pipe so the child can tell us when it is ready.    // fd[0] will be parent's end, and fd[1] will get mapped to stderr in the child.    if (pipe(fd)) {        fprintf(stderr, ""pipe failed in launch_server, errno: %d\n"", errno);        return -1;    }    get_my_path(path);    pid_t pid = fork();    if(pid &lt; 0) return -1;    if (pid == 0) {        // child side of the fork        // redirect stderr to the pipe        // we use stderr instead of stdout due to stdout's buffering behavior.        adb_close(fd[0]);        dup2(fd[1], STDERR_FILENO);        adb_close(fd[1]);        // child process        int result = execl(path, ""adb"", ""fork-server"", ""server"", NULL);        // this should not return        fprintf(stderr, ""OOPS! execl returned %d, errno: %d\n"", result, errno);    } else  {        // parent side of the fork        char  temp[3];        temp[0] = 'A'; temp[1] = 'B'; temp[2] = 'C';        // wait for the ""OK\n"" message        adb_close(fd[1]);        int ret = adb_read(fd[0], temp, 3);        adb_close(fd[0]);        if (ret &lt; 0) {            fprintf(stderr, ""could not read ok from ADB Server, errno = %d\n"", errno);            return -1;        }        if (ret != 3 || temp[0] != 'O' || temp[1] != 'K' || temp[2] != '\n') {            fprintf(stderr, ""ADB server didn't ACK\n"" );            return -1;        }        setsid();    }#else#error ""cannot implement background server start on this platform""#endif    return 0;}#endif</code></pre><p>I think the child process of adb.exe inherit the handle of adb.exe, if the child process of adb.exe doesn't exit, ReadFile will block for ever. But when I exec ""adb.exe start-server"" in command, all is Ok. So how does windows command call CreateProcess and ReadFile?</p>","303006","","","","","2011-09-07 03:35:15","CreateProcess for android adb start-server?","<android><adb><readfile><createprocess>","1","0","","",""
"3641236","1","","","2010-09-04 07:01:45","0","4079","<p>I would like to add radio buttons to my context menu, but I'm not sure how. This is how it is created:</p><pre><code>@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"");      }  </code></pre>","19875","","1393623","","2012-08-26 22:54:55","2013-08-31 15:48:14","Adding RadioButtons to ContextMenu","<java><android><menu><contextmenu>","2","0","","",""
"3641240","1","3641766","","2010-09-04 07:04:22","0","1670","<p>On the iPhone a user is able to re-arrange the actual rows in a list. Is this possible on Android? If so, any examples would be great.</p>","19875","","","","","2010-09-04 10:01:12","Is it possible to re-arrange items in a list view?","<android><listview><listviewitem>","2","0","3","",""
"3641259","1","3641449","","2010-09-04 07:11:41","4","4658","<p>I have 1 activity, but would like to have multiple context menu's for different UI components. </p><p>For example, I have a ListView which will react to:</p><pre><code>@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"");      }  </code></pre><p>How can I create another context menu for the onClick event for an ImageView I have?</p>","19875","","","","","2014-03-25 12:01:42","How can I create multiple context menus?","<android><listview><menu><contextmenu><imageview>","3","0","1","",""
"3641304","1","","","2010-09-04 07:28:51","4","5001","<p>i want to get the latitude and longitude using the zipcode for android application</p>","421645","","","","","2013-10-10 09:43:03","get latitude and longitude using zipcode","<android><google-maps>","5","0","3","",""
"3641352","1","3641436","","2010-09-04 07:48:00","-2","1602","<p>Here is the program I used to code it in my android application to find the GPS location of the device.</p><pre><code>package com.gps.TestingApps;import android.app.Activity;import android.content.Context;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;import android.widget.TextView;public class TestingApps extends Activity implements LocationListener{    private LocationManager locationManager;    private TextView latitude;    private TextView longitude;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);      //bind the ui components to code referances        latitude = (TextView) findViewById(R.id.latitude);        longitude = (TextView) findViewById(R.id.longitude);      //get the locationManager        locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        startListening();    }    private void startListening() {         //registers our class as the listener        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, (LocationListener) this);    }    private void stopListening() {        locationManager.removeUpdates((LocationListener) this);    }    public void onLocationChanged(Location location) {                latitude.setText(location.getLatitude()+"""");                longitude.setText(location.getLongitude()+"""");                stopListening();            }            public void onProviderDisabled(String provider) {                // TODO Auto-generated method stub            }            public void onProviderEnabled(String provider) {                // TODO Auto-generated method stub            }            public void onStatusChanged(String provider, int status, Bundle extras) {            // TODO Auto-generated method stub            }  }</code></pre><p>I didn't get any bugs but there is a runtime error, I can't get the values of latitude and longitude instead I get the value false values for both.</p><p>here is the error message displayed in my Logcat.</p><pre><code>09-04 12:52:47.541: WARN/ResourceType(59): Failure getting entry for 0x7f020000 (t=1 e=0) in package 0: 0xffffffb509-04 12:52:49.981: WARN/ResourceType(122): Failure getting entry for 0x7f020000 (t=1 e=0) in package 0: 0xffffffb509-04 12:52:50.161: WARN/PackageManager(122): Failure retrieving icon 0x7f020000 in package com.greatinnovus.TestingApps09-04 12:52:50.161: WARN/PackageManager(122): android.content.res.Resources$NotFoundException: Resource ID #0x7f02000009-04 12:52:50.161: WARN/PackageManager(122):     at android.content.res.Resources.getValue(Resources.java:846)09-04 12:52:50.161: WARN/PackageManager(122):     at android.content.res.Resources.getDrawable(Resources.java:534)09-04 12:52:50.161: WARN/PackageManager(122):     at android.app.ApplicationContext$ApplicationPackageManager.getDrawable(ApplicationContext.java:1923)09-04 12:52:50.161: WARN/PackageManager(122):     at android.content.pm.ComponentInfo.loadIcon(ComponentInfo.java:88)09-04 12:52:50.161: WARN/PackageManager(122):     at com.htc.launcher.LauncherModel.updateApplicationInfoTitleAndIcon(LauncherModel.java:488)09-04 12:52:50.161: WARN/PackageManager(122):     at com.htc.launcher.LauncherModel.makeAndCacheApplicationInfo(LauncherModel.java:469)09-04 12:52:50.161: WARN/PackageManager(122):     at com.htc.launcher.LauncherModel.access$300(LauncherModel.java:55)09-04 12:52:50.161: WARN/PackageManager(122):     at com.htc.launcher.LauncherModel$1.run(LauncherModel.java:188)09-04 12:52:50.181: ERROR/PackageInstallationReceiver(235): Remove /data/local/tmp/com.greatinnovus.TestingApps.apk Fail!09-04 12:52:50.201: WARN/System.err(235): java.io.IOException: Error running exec(). Commands: [/system/xbin/su, 0, /system/bin/rm, /data/local/tmp/com.greatinnovus.TestingApps.apk] Working Directory: null Environment: null09-04 12:52:50.281: WARN/System.err(235):     at java.lang.ProcessManager.exec(ProcessManager.java:196)09-04 12:52:50.291: WARN/System.err(235):     at java.lang.Runtime.exec(Runtime.java:225)09-04 12:52:50.291: WARN/System.err(235):     at java.lang.Runtime.exec(Runtime.java:313)09-04 12:52:50.301: WARN/System.err(235):     at java.lang.Runtime.exec(Runtime.java:246)09-04 12:52:50.301: WARN/System.err(235):     at com.htc.android.psclient.PackageInstallationReceiver.removeTempPackageFile(PackageInstallationReceiver.java:30)09-04 12:52:50.311: WARN/System.err(235):     at com.htc.android.psclient.PackageInstallationReceiver.onReceive(PackageInstallationReceiver.java:22)09-04 12:52:50.311: WARN/System.err(235):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2408)09-04 12:52:50.321: WARN/System.err(235):     at android.app.ActivityThread.access$2700(ActivityThread.java:112)09-04 12:52:50.321: WARN/System.err(235):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1741)09-04 12:52:50.321: WARN/System.err(235):     at android.os.Handler.dispatchMessage(Handler.java:99)09-04 12:52:50.331: WARN/System.err(235):     at android.os.Looper.loop(Looper.java:123)09-04 12:52:50.331: WARN/System.err(235):     at android.app.ActivityThread.main(ActivityThread.java:3948)09-04 12:52:50.341: WARN/System.err(235):     at java.lang.reflect.Method.invokeNative(Native Method)09-04 12:52:50.351: WARN/System.err(235):     at java.lang.reflect.Method.invoke(Method.java:521)09-04 12:52:50.351: WARN/System.err(235):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)09-04 12:52:50.351: WARN/System.err(235):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)09-04 12:52:50.361: WARN/System.err(235):     at dalvik.system.NativeStart.main(Native Method)09-04 12:52:50.361: WARN/System.err(235): Caused by: java.io.IOException: No such file or directory09-04 12:52:50.381: WARN/System.err(235):     at java.lang.ProcessManager.exec(Native Method)09-04 12:52:50.391: WARN/System.err(235):     at java.lang.ProcessManager.exec(ProcessManager.java:194)09-04 12:52:50.391: WARN/System.err(235):     ... 16 more09-04 12:52:51.751: WARN/Resources(1707): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}09-04 12:52:51.751: WARN/Resources(1707): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050002}09-04 12:53:19.541: ERROR/SETTING_AUTO_BACKLIGHT(59): open: /sys/class/leds/lcd-backlight/auto failed, errno: 209-04 12:54:27.811: ERROR/SETTING_AUTO_BACKLIGHT(59): open: /sys/class/leds/lcd-backlight/auto failed, errno: 209-04 12:54:43.911: WARN/KeyCharacterMap(1707): Bad keycharmap - filesize=3209-04 12:54:45.313: WARN/WeatherUtil(122): schedule DCS task, mixed quest code09-04 12:54:51.962: WARN/MobileDataStateTracker(59): startUsingNetworkFeature=enableAGPS  callid=59calluid= 100009-04 12:55:21.951: WARN/MobileDataStateTracker(59): stopUsingNetworkFeature=enableAGPS  callid=59calluid= 100009-04 12:55:38.811: WARN/dalvikvm(122): disableGcForExternalAlloc: true09-04 12:55:38.971: ERROR/SETTING_AUTO_BACKLIGHT(59): open: /sys/class/leds/lcd-backlight/auto failed, errno: 209-04 12:55:39.661: WARN/dalvikvm(122): disableGcForExternalAlloc: false09-04 12:55:39.841: WARN/dalvikvm(122): disableGcForExternalAlloc: true09-04 12:55:40.981: WARN/dalvikvm(122): disableGcForExternalAlloc: false09-04 12:55:43.481: WARN/WeatherUtil(122): schedule DCS task, mixed quest code09-04 12:56:26.191: WARN/dalvikvm(122): disableGcForExternalAlloc: true09-04 12:56:27.301: WARN/dalvikvm(122): disableGcForExternalAlloc: false09-04 12:56:29.811: WARN/WeatherUtil(122): schedule DCS task, mixed quest code09-04 12:56:42.331: WARN/ResourceType(59): Failure getting entry for 0x7f020000 (t=1 e=0) in package 0: 0xffffffb509-04 12:56:45.691: ERROR/PackageInstallationReceiver(235): Remove /data/local/tmp/com.greatinnovus.TestingApps.apk Fail!09-04 12:56:45.711: WARN/System.err(235): java.io.IOException: Error running exec(). Commands: [/system/xbin/su, 0, /system/bin/rm, /data/local/tmp/com.greatinnovus.TestingApps.apk] Working Directory: null Environment: null09-04 12:56:45.711: WARN/System.err(235):     at java.lang.ProcessManager.exec(ProcessManager.java:196)09-04 12:56:45.711: WARN/System.err(235):     at java.lang.Runtime.exec(Runtime.java:225)09-04 12:56:45.711: WARN/System.err(235):     at java.lang.Runtime.exec(Runtime.java:313)09-04 12:56:45.721: WARN/System.err(235):     at java.lang.Runtime.exec(Runtime.java:246)09-04 12:56:45.721: WARN/System.err(235):     at com.htc.android.psclient.PackageInstallationReceiver.removeTempPackageFile(PackageInstallationReceiver.java:30)09-04 12:56:45.721: WARN/System.err(235):     at com.htc.android.psclient.PackageInstallationReceiver.onReceive(PackageInstallationReceiver.java:22)09-04 12:56:45.721: WARN/System.err(235):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2408)09-04 12:56:45.721: WARN/System.err(235):     at android.app.ActivityThread.access$2700(ActivityThread.java:112)09-04 12:56:45.721: WARN/System.err(235):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1741)09-04 12:56:45.721: WARN/System.err(235):     at android.os.Handler.dispatchMessage(Handler.java:99)09-04 12:56:45.731: WARN/System.err(235):     at android.os.Looper.loop(Looper.java:123)09-04 12:56:45.731: WARN/System.err(235):     at android.app.ActivityThread.main(ActivityThread.java:3948)09-04 12:56:45.731: WARN/System.err(235):     at java.lang.reflect.Method.invokeNative(Native Method)09-04 12:56:45.731: WARN/System.err(235):     at java.lang.reflect.Method.invoke(Method.java:521)09-04 12:56:45.741: WARN/System.err(235):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)09-04 12:56:45.741: WARN/System.err(235):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)09-04 12:56:45.741: WARN/System.err(235):     at dalvik.system.NativeStart.main(Native Method)09-04 12:56:45.741: WARN/System.err(235): Caused by: java.io.IOException: No such file or directory09-04 12:56:45.761: WARN/System.err(235):     at java.lang.ProcessManager.exec(Native Method)09-04 12:56:45.761: WARN/System.err(235):     at java.lang.ProcessManager.exec(ProcessManager.java:194)09-04 12:56:45.761: WARN/System.err(235):     ... 16 more09-04 12:56:45.901: WARN/ResourceType(122): Failure getting entry for 0x7f020000 (t=1 e=0) in package 0: 0xffffffb509-04 12:56:45.941: WARN/PackageManager(122): Failure retrieving icon 0x7f020000 in package com.greatinnovus.TestingApps09-04 12:56:45.941: WARN/PackageManager(122): android.content.res.Resources$NotFoundException: Resource ID #0x7f02000009-04 12:56:45.941: WARN/PackageManager(122):     at android.content.res.Resources.getValue(Resources.java:846)09-04 12:56:45.941: WARN/PackageManager(122):     at android.content.res.Resources.getDrawable(Resources.java:534)09-04 12:56:45.941: WARN/PackageManager(122):     at android.app.ApplicationContext$ApplicationPackageManager.getDrawable(ApplicationContext.java:1923)09-04 12:56:45.941: WARN/PackageManager(122):     at android.content.pm.ComponentInfo.loadIcon(ComponentInfo.java:88)09-04 12:56:45.941: WARN/PackageManager(122):     at com.htc.launcher.LauncherModel.updateApplicationInfoTitleAndIcon(LauncherModel.java:488)09-04 12:56:45.941: WARN/PackageManager(122):     at com.htc.launcher.LauncherModel.updateAndCacheApplicationInfo(LauncherModel.java:289)09-04 12:56:45.941: WARN/PackageManager(122):     at com.htc.launcher.LauncherModel.access$500(LauncherModel.java:55)09-04 12:56:45.941: WARN/PackageManager(122):     at com.htc.launcher.LauncherModel$2.run(LauncherModel.java:265)09-04 12:56:46.551: WARN/Resources(1751): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050000}09-04 12:56:46.551: WARN/Resources(1751): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f050002}09-04 12:56:59.111: WARN/KeyCharacterMap(1751): Bad keycharmap - filesize=3209-04 12:57:00.524: WARN/WeatherUtil(122): schedule DCS task, mixed quest code09-04 12:57:59.821: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 12:58:59.911: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 12:59:59.981: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:01:00.121: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:01:03.131: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:01:06.141: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:02:06.281: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:03:06.461: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:03:09.463: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:03:12.481: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:04:12.621: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:05:12.741: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:05:15.744: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:05:18.751: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:06:18.881: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:06:21.873: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:07:21.963: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:07:24.971: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:07:27.981: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:08:28.181: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:08:31.182: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:08:34.201: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:08:37.221: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:08:40.241: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:09:40.383: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:09:43.381: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:09:46.401: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:10:46.531: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:11:46.641: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:11:49.641: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:12:49.771: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:12:52.771: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:12:55.801: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:12:58.822: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:12:59.721: WARN/Smack/Packet(166): notify conn break (IOEx), close connection09-04 13:13:01.832: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:13:04.842: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock09-04 13:13:07.861: WARN/LocationManagerService(59): acquireWakeLock(): Unable to get WiFi lock</code></pre>","431655","","881229","","2013-12-28 06:49:06","2013-12-28 06:49:06","Finding issue in getting latitude and longitude","<android><geolocation><gps><latitude-longitude>","1","5","","",""
"3641355","1","3641362","","2010-09-04 07:51:56","0","701","<p>This is getting called in onCreate(), how can I speed up orientation switching?</p><pre><code>private void setupChartView(int position){            Quote myQuote = quotesAdapter.getItem(position);            this.symbol = myQuote.getSymbol();            String url = ""http://chart.finance.yahoo.com/z?s="" + symbol + ""&amp;t=1d&amp;q=l&amp;l=on&amp;z=l&amp;p=s&amp;a=v&amp;p=s&amp;lang=en-US&amp;region=US"";            if(chartImageView != null)                imageDownloader.download(url, chartImageView);            if(chartImageViewLandscape != null)                imageDownloader.download(url, chartImageViewLandscape);        }</code></pre>","19875","","","","","2010-09-04 07:55:41","Switching to landscape orientation is slow","<android><orientation><landscape><android-asynctask>","1","0","","",""
"3641403","1","","","2010-09-04 08:06:34","5","16804","<p>I want to compile and run the C/C++ program on the Android phone program (like G1).</p><p>For example, I write a ""Hello World.c"" program, then compile and run it on my Android phone system.</p><p>I have never used MinGW to run my code on my Windows system, so I also want to do it on the Android phone system.</p>","395158","","63550","","2010-09-09 08:01:07","2014-02-21 03:09:44","How to compile and run a C/C++ program on the Android system (like MinGW on the Windows)?","<android><compiler><android-emulator>","5","0","1","",""
"3641473","1","4553057","","2010-09-04 08:31:42","1","1400","<p>I changed the ArrayAdapter method of spinner and i got my custom Spinner.just change the parameter of this method like</p><pre><code> Spinner spinner = (Spinner) findViewById(R.id.Spinner01); ArrayAdapter&lt;CharSequence&gt;   adapter=ArrayAdapter.createFromResource(This,R.array.statename,R.layout.mylayout); spinner.setAdapter(adp);</code></pre><p>In Which the mylayout file contains</p><pre><code>&lt;EditText  android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:id=""@+id/spinnerTarget"" android:textColor=""#FF8B1500"" android:gravity=""center""&gt;</code></pre>","439506","","244296","","2010-09-10 05:14:05","2010-12-29 09:51:48","How to make Spinner Editable in Android?","<android><android-widget><spinner><editable>","1","0","","",""
"3641603","1","","","2010-09-04 09:15:25","-2","432","<p>I have class A in which I have  a method openfileConnec(). It was written like the below:</p><pre><code>public void openfileConnec() throws Exception {    //code for opening a file}</code></pre><p>Now I come to class B where I will call this method like the below:</p><pre><code>class B {    try {        openfileConnect()    }    catch(Exception e) {    }}</code></pre><p>I was asked a question in an interview as follows:</p><ol><li>Why does the method have a throws Exception in its declaration? Is it that on of the methods called in the implementation throws the base class exception?</li><li>Also If we get a exception during calling the method (fileConnect( )) control goes to catch block. After executing catch where should the control go, what should be sent to base case?</li></ol><p>Can any one help me in sorting out this issue? Thanks in Advance.</p>","385939","","4249","","2010-09-04 13:53:15","2010-09-04 13:53:15","How to Handle throws clause in Java Exception Handling?","<java><android><javadoc>","2","0","0","",""
"3641655","1","","","2010-09-04 09:31:15","0","1527","<p>I am developing image application,i am using <code>WebView</code> to display image, so I want to fix some height and width size for the image, this size applicable for all kind of size of images in WebView.<br>Any sample code is welcome,</p><p>Thanks All</p>","410757","","263521","","2010-09-04 09:36:35","2010-09-04 09:36:35","How to fix image height and width in webview for android","<android><image><size><webview>","1","0","","",""
"3641765","1","","","2010-09-04 10:01:10","0","167","<p>i am developing a game with canvas. I want use the Android internalautoscaling feature (anydensity=false;) only for large densityscreens. Is it possible to enable this graphics (in the drawablefolder) scaling function only for large screens. For smallscreens myGame Engine does automatically manage the presentation.</p><p>I attempted the following in the manifest.xml:</p><pre><code>&lt;supports-screens android:smallScreens=""true"" android:normalScreens=""true"" android:largeScreens=""false"" android:anyDensity=""false"" /&gt;</code></pre><p>.. but it doesnt work, Android does also downscale the graphics for smallScreens.</p><p>Thank you!</p>","439553","","","","","2010-09-04 10:15:16","Android internal autoscaling feature only for large screens","<java><android><xml><android-manifest>","1","0","1","",""
"3641883","1","","","2010-09-04 10:42:57","0","442","<p>Is there any intent for getting the details of image captured by camera(default one)?</p><p>Thanks,Nithin</p>","401004","","","","","2011-08-10 04:43:05","Get the details if image captured via camera","<android>","1","0","","",""
"3641920","1","3692330","","2010-09-04 10:50:49","26","22362","<p><strong>I'm simplified my question and offered a bounty:</strong>What options are there for compressing raw PCM audio data to a mp3 on a Android device.</p><p><strong>My original post:</strong>I'm creating a synthesiser on my Android phone, and I've been generating PCM data to send to the speakers. Now I'm wondering if I can encode this PCM data as a mp3 to save to the sdcard. The <a href=""http://developer.android.com/reference/android/media/MediaRecorder.html"">MediaRecorder</a> object can encode audio coming from the microphone into various formats, but doesn't allow the encoding from programmatically generated audio data.</p><p>So my question is, is there a standard Android API for encoding audio? If not, what pure Java or NDK based solutions are there? And can you recommend any of them?</p><p>Failing this I'll just have to save my generated audio as a WAV file, which I can easily do.</p>","88646","","88646","","2010-09-06 11:31:33","2014-02-04 16:46:25","How to encode a WAV to a mp3 on a Android device","<java><android><encoding><mp3><wav>","3","4","19","",""
"3641945","1","","","2010-09-04 10:57:19","1","5343","<p>I am using grid view for images,first time i using 16 images display in gridview after i will add another 16 images in grid view,now totally 32 images in gridview,ok now i want to move scroll bar last 16 images position in grid view,how can dynamically scroll bar in grid view?,anybody know please give code..</p><p>Thanks All</p>","410757","","","","","2011-01-08 18:20:56","How can dynamically move scroll bar in gridview","<android>","2","0","","",""
"3641980","1","3642124","","2010-09-04 11:04:10","0","971","<p>I m using network service so when i click on button in my first activity , if it is dependent on network then on its click if the network is not available then its should give message that network not available and if network is available it should able to redirect to my  application.</p><p>So here i m sharing what problem i have</p><p>1> if network is available then i m calling intent from my main activity's button click event</p><p>mapbutton.setOnClickListener(new OnClickListener(){            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);</p><pre><code>            if ( connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED ||                     connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTING ) {            Toast.makeText(main.this,""You are:"" + NetworkInfo.State.CONNECTED, Toast.LENGTH_SHORT).show();            //Do something in here when we are connected            // call intent to go to map            Intent intent = new Intent(main.this,HelloMap.class);            startActivity(intent);</code></pre><p>}}</p><p>And in Else Condition i m displaying dialog that network connection unavailble...</p><p>HelloMap is my class which implements Map Functionality.</p><p>When i run my application it is giving error ...classdefnotfound HelloMap.java.</p><p>Can anybody tell me how to solve this proble</p><p>i have include permission ACCESS_NETWORK_STATE,include HelloMap class in manifest too..</p><p>Then also i m not getting proper output..</p><p>Can anybody help me.</p><p>Thanks Rakesh</p><pre><code>            } </code></pre>","1386533","","","","","2010-09-04 11:50:57","Android: using network service","<android>","1","0","","",""
"3642126","1","","","2010-09-04 11:52:00","2","1152","<p>Please let me know how to resolve this problem.</p><p>Statusbar notification messages are shown in X language even after locale language is changed from  X to Y.Please help me what needs to be done to refresh it.Eg:Even after changing locale lang from En to Ja , statusbar notification messages are shown in En only i.e The application which is  sending statusbar notification  is run firsttime in En language .</p><p>ThanksVenugopal</p>","439587","","","","","2010-09-04 12:08:51","How to refresh existing Statusbar notification messages when locale is changed","<android>","1","0","","",""
"3642135","1","","","2010-09-04 11:55:23","1","15744","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3721963/how-to-add-calendar-events-in-android"">How to add calendar events in Android?</a>  </p></blockquote><p>how can we add reminder data in android calendar?</p>","421645","","","","","2012-05-01 15:26:35","Programmatically add reminder in android calendar?","<android>","5","0","2","2012-07-11 00:29:26",""
"3642234","1","3643494","","2010-09-04 12:19:49","2","4958","<p>I tried to show a hint in the EditText of my form, but i can't see that hint that i have set in the XML Layout while my application gets deployed, but i can able see the hint in eclipse designer view, but while getting deployed the same hint suppose to appear is missing, i tried with all the possible ways still i could not get the hint in the EditText... This is one of the Edit Text layout that i have used..</p><pre>..EditText android:id=""@+id/SetTimerSec_EditText01""        android:layout_width=""60sp"" android:layout_height=""40sp""        android:singleLine=""true""         android:layout_x=""220sp"" android:layout_y=""170sp""        android:hint=""0""        android:inputType=""phone""        android:textColorHint=""@color/black""        android:gravity=""center""        android:focusableInTouchMode=""true"">    /EditText...</pre><p>[link text][1]</p><p>Can anybody Help me..Please</p><p>Thanks in advance</p><p>[1]: <a href=""http://imgur.com/PzomF.jpg"" rel=""nofollow"" title=""Hosted by  imgur.com"">http://imgur.com/PzomF.jpg</a>[ScreenShot of Designer View with hint displayed][1]</p>","384193","","384193","","2010-09-04 15:54:46","2011-05-10 22:25:02","Hint in Android","<android><hint>","2","4","1","","2010-09-04 12:39:00"
"3642267","1","3642396","","2010-09-04 12:27:20","0","1820","<p>I see this <a href=""http://stackoverflow.com/questions/3461227/how-to-know-device-is-connected-to-wifi-or-3g-programatically"">thread</a> but it could not help me much.</p>","301132","","","","","2010-09-04 13:03:26","Android: How can we know the current connection type (ex. Wifi, 3G, 2G...) programmatically?","<android><connection><wifi><3g>","1","0","","",""
"3642482","1","","","2010-09-04 13:30:29","1","1820","<p>I'm getting a Java Socket Exception ""Operation timed out"" when trying to call a .NET web service method.  I've followed the many examples out there on the web to get my android to call a .net web service.</p><p>I'm running the web service using VS2010 in debug mode.  The web method I'm calling is very simple -> ""string GetVersion()""</p><p>I've read some posts that eclipse needs to be configured to access the internet by modifying the Proxy preferences ""Preferences -> General -> Network Connections"" from the Window menu item.  I haven't been able to figure out exactly what I need to configure in the Proxy to get things to work if that is the problem.</p><p>I've also tried to access the .net web service root page (service.asmx) from my android with no success.  I can access the asmx page with no problems using IE on the local machine.  I've turned off the firewall and that didn't solve anything either.  This is the first time I've tried to access a web service from a remote computer when it was running using VS2010 in debug mode.</p><p>I don't know if I have a configuration issue on the eclipse side or on the VS2010 side.</p><p>I'm also running Windows 7 Home Premium.</p><p>Any ideas?</p><p>Below is a code snippet...</p><pre><code>private static final String SOAP_ACTION = ""http://192.168.1.151/MyWebService/GetVersion"";private static final String METHOD_NAME = ""GetVersion"";   private static final String NAMESPACE = ""http://192.168.1.151/MyWebService""; private static final String URL = ""http://192.168.1.151/MyService.asmx"";private void Connect(){    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);     envelope.dotNet=true;     envelope.setOutputSoapObject(request);     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);     System.out.println(""DEBUG &gt;&gt; HttpTransport.call()"");    try    {                androidHttpTransport.call(SOAP_ACTION, envelope);    }    catch(IOException iexc)    {     System.out.println(""EXCEPTION &gt;&gt; "" + iexc.toString());    }    catch(XmlPullParserException xexc)    {     System.out.println(""EXCEPTION &gt;&gt; "" + xexc.toString());    }    try    {       Object result = (Object)envelope.getResponse();       tv.setText(result.toString());    }    catch (SoapFault sp)    {     System.out.println(""EXCEPTION &gt;&gt; "" + sp.toString());    }}</code></pre>","439611","","928814","","2013-04-18 09:32:22","2013-04-18 09:32:22","Call to .NET web service timed out (Android dev using KSOAP2)","<.net><android><web-services><eclipse><visual-studio-2010>","4","0","","",""
"3642515","1","","","2010-09-04 13:42:23","0","990","<p>friend's    I have view to show the content alone have to scroll in the view on the layout.how to scroll the content alone not the whole layout.</p><p>Here my layout code  for content details.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>        </p><pre><code>  &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical"" android:background=""@color/blueback""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;               &lt;ImageView android:layout_width=""fill_parent"" android:layout_height=""300dip""        android:id=""@+id/img1"" android:adjustViewBounds=""true"" android:padding=""15dip""/&gt;            &lt;View android:layout_width=""310dip"" android:layout_height=""1dip"" android:layout_centerInParent=""true"" android:paddingRight=""5dip""                    android:background=""@color/orange"" android:layout_below=""@id/img1"" /&gt;                                       &lt;TextView android:id=""@+id/text1"" android:layout_below=""@id/img1""          android:textSize=""15sp""          android:textStyle=""bold""          android:textColor=""@color/black""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:paddingLeft=""20dip""          android:paddingTop=""3dip""          android:gravity=""top"" /&gt;          &lt;TextView android:id=""@+id/text2"" android:layout_below=""@id/text1""          android:textSize=""12sp""          android:textColor=""@color/black""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:paddingLeft=""20dip""          android:paddingTop=""2dip""          android:gravity=""top"" /&gt;           &lt;View android:layout_width=""310dip"" android:layout_height=""1dip"" android:layout_centerInParent=""true"" android:paddingRight=""5dip""                   android:id=""@+id/desc"" android:background=""@color/orange"" android:layout_below=""@id/text2"" /&gt;            &lt;WebView android:id=""@+id/text3"" android:layout_below=""@id/desc""          android:textSize=""12sp""           android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:paddingLeft=""20dip""          android:paddingTop=""10dip"" /&gt;     &lt;/RelativeLayout&gt;    &lt;/ScrollView&gt;</code></pre><p></p><p>how can set static background for whole view ,thanks in advance.</p>","407506","","","","","2010-09-04 14:19:02","how to set background of layout being static in android","<android>","1","0","","",""
"3642554","1","5602830","","2010-09-04 13:52:27","0","105","<p>I am trying to create an application that has a background image with widget like objects that can be touched and dragged.  Think of a chess set app where you can touch and drag a chess piece to the target square.  I've poured over the samples but I just can't seem to get it.  I thought widgets might be the answer, but they are more for home screen like apps.  I thought TouchRotateActivity in the samples would have the answer, but I can't get it to run so I can see if it behaves the way I want.</p><p>Any suggestions would be greatly appreciated.</p>","404762","","12171","","2011-04-09 02:12:04","2011-04-09 05:11:48","How can I create a widget against a background image that is touchable and dragable?","<android><android-widget>","1","0","","",""
"3642686","1","3677584","","2010-09-04 14:31:06","1","207","<p>I am new in Android.</p><p>I have downloaded Eclipse 3.4 and integrate with ADT and Android SDK r06.</p><p>My problem is that My Simulator is not working, it opens properly but the screen shows only ""ANDROID..""</p><p>What should I do?</p><p>Please help. </p>","389192","","628006","","2012-03-27 16:18:18","2012-03-27 16:18:18","Running android app in Eclipse","<android><eclipse><android-emulator>","1","0","","",""
"3642769","1","","","2010-09-04 15:00:05","0","503","<p>I have been trying to make my application available on Android Market, only to specific individual accounts/devices.</p><p>Is there any way to specify an arbitrary Market Filter?It currently has filters for country/carrier, but we need a finer grained filter than that.</p><p>I thought about adding my own system library and specify it in &lt;uses-library&gt; tag, but that would not work if user gets a system update from Google.</p><p>Non-Market option is not desirable, since we'd lose auto-update feature, etc.Another option is to make the app unusable by unregistered devices -- but I would rather not show the app on Market and not worry about the app being tampered.</p><p>Any ideas would be much appreciated!</p>","439639","","","","","2010-09-04 15:19:25","Custom criteria for Android Market Filter?","<android><google-play>","1","0","","",""
"3642928","1","3643015","","2010-09-04 15:46:41","87","119726","<p>This is a two-part question about adding a third-party library (JAR) to an Android project in Eclipse.</p><p>The first part of the question is, when I try to add a third-party JAR (library) to my Android project I first get the problem of</p><blockquote>  <p>Error parsing XML: unbound prefix</p></blockquote><p>because I'm trying to use a class from that JAR (and need the prefix somehow defined). What's going on?</p><p>Second, (after fixing that--the answer is given below), my application doesn't work on Android and I discover via the debugger (LogCat) that the class I'm attempting to consume doesn't exist.</p><blockquote>  <p>Caused by:  java.lang.ClassNotFoundException:  com.github.droidfu.widgets.WebImageView...</p></blockquote><p>Why, when I get no compilation or linker error in Eclipse, does it have this problem on the emulator?</p><p>These two questions are rhetorical for I'm going to answer them myself below. Other posts in this forum creep up to the problem and elsewhere there is discussion, but I feel that I can be more explicitly helpful for the next guy to come along.</p>","339736","","339736","","2010-09-04 17:22:48","2014-04-15 05:03:54","Adding a library/JAR to an Eclipse Android project","<android>","8","0","58","",""
"3643006","1","4254952","","2010-09-04 16:08:07","1","4499","<p>I am using an Executor [fixed thread pool] with my own ThreadFactory that adds a Looper:</p><pre><code>Handler HANDLER = new Handler();Executor    THREADS = Executors.newFixedThreadPool(THREAD_POOL_SIZE, new ThreadFactory() {    @Override public Thread newThread(Runnable runnable) {        return new MyThread(new Runnable() {            @Override public void run() {                Looper.prepare();                runnable.run();            }        });    }});private static class MyHandler extends Handler {    public boolean fail;        public void handleMessage(Message msg) {        switch(msg.what) {            case 1:                this.fail = msg.arg1 == 1;                Looper.myLooper().quit();                break;            }        }    }}</code></pre><p>I am running a thread that makes network requests but if the network fails I would like a dialog message to be displayed to the user.  This process is rather involving since it requires making AND displaying the request in the UI thread.  I can wait for the user's response to the dialog by simply adding a Loop to the network thread and wait for a message to be send from the UI thread.  This allows me to encapsulate the network requests in a while(tryAgain) thread.  All works well except when the Looper.loop() method is called the second time (after a second network error dialog is displayed) and a message is sent by the dialog (in the UI thread) to the network thread's handler:</p><pre><code>THREADS.execute(new Runnable() {    private MyHandler   myHandler   = new MyHandler();    @Override public void run() {        boolean tryAgain    = true;        while(tryAgain) {            try {                switch(request) {                    [Handle network requests]                }                tryAgain    = false;            } catch(IOException e) {                // The network is unavailable.  Ask the user if we should try again.                e.printStackTrace();            } finally {                if(tryAgain) {                    HANDLER.post(new Runnable() {   // The UI thread                        @Override public void run() {                            theAlertDialog.show();                        }                    });                    // Wait for the results from the dialog which lives in the UI thread.                    Looper.loop();                    // At this point the dialog has informed us of our answer.                    tryAgain = !myHandler.fail;                }            }        }    }});</code></pre><p>In the AlertDialog instance is an OnClickListener:</p><pre><code>DialogInterface.OnClickListener myOnclickListener = new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int id) {        Message msg = myHandler.obtainMessage(1);        msg.setTarget(this.handler);        msg.sendToTarget();    }}</code></pre><p>I've checked that the thread is still active with <code>handler.getLooper().getThread().isAlive()</code> which always returns true but it still gives me ""sending message to a Handler on a dead thread"".  How is it that the Message/Handler has decided that the thread is dead?  Shouldn't it rely on the .isAlive() method?  In the end I am trying to avoid replicating the thread management build into the Android OS :-)</p>","439682","","","","","2011-10-18 21:08:07","Calling Looper more than once causes ""sending message to a Handler on a dead thread""","<android><handler><executor><looper>","2","0","","",""
"3643023","1","","","2010-09-04 16:10:28","1","1216","<p>I have a listview with a custom BaseAdapter. Each row of the listview has a TextView and a CheckBox.</p><p>The problem is when I click (or touch) any row, the textview foreground becomes gray, instead of the default behavior (background -> green, textview foreground -> white).</p><p>Here is the code:</p><p>row.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                style=""@style/layout""&gt;    &lt;TextView android:id=""@+id/main_lv_item_textView""               style=""@style/textViewBig""              android:layout_alignParentLeft=""true""/&gt;    &lt;CheckBox android:id=""@+id/main_lv_item_checkBox""               style=""@style/checkBox""              android:layout_width=""wrap_content""              android:layout_alignParentRight=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>Custom Adapter:</p><pre><code>public class CustomAdapter extends BaseAdapter {        private List&lt;Profile&gt; profiles;        private LayoutInflater inflater;        private TextView tvName;        private CheckBox cbEnabled;        public CustomAdapter(List&lt;Profile&gt; profiles) {            this.profiles = profiles;            inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        }        public int getCount() {            return profiles.size();        }        public Object getItem(int position) {            return profiles.get(position);        }        public long getItemId(int position) {            return position;        }        public View getView(final int position, View convertView, ViewGroup parent) {            View row = inflater.inflate(R.layout.main_lv_item, null);            final Profile profile = profiles.get(position);            tvName = (TextView) row.findViewById(R.id.main_lv_item_textView);            registerForContextMenu(tvName);            cbEnabled = (CheckBox) row.findViewById(R.id.main_lv_item_checkBox);            tvName.setText(profile.getName());            if (profile.isEnabled()) {                cbEnabled.setChecked(true);            }            tvName.setOnClickListener(new OnClickListener() {                public void onClick(View v) {                    Bundle bundle = new Bundle();                    bundle.putString(PROFILE_NAME_KEY, profile.getName());                    Intent intent = new Intent(context, GuiProfile.class);                    intent.putExtras(bundle);                    startActivity(intent);                }            });            tvName.setOnLongClickListener(new OnLongClickListener() {                public boolean onLongClick(View v) {                    selectedProfileName = ((TextView) v).getText().toString();                    return false;                }            });            cbEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {                    if (!profile.isEnabled()) {                        for (Profile profile : profiles) {                            if (profile.isEnabled()) {                                profile.setEnabled(false);                                Database.getInstance().storeProfile(profile);                            }                        }                    }                    profile.setEnabled(isChecked);                    Database.getInstance().storeProfile(profile);                    updateListView();                }            });            return row;        }    }</code></pre><p>Any help would be appreciated.</p>","439684","","","","","2011-02-08 14:31:12","Show default selection color for custom listview","<android><listview>","2","0","1","",""
"3643037","1","3643185","","2010-09-04 16:13:59","0","951","<p>I wanted to place a working RadioGroup inside a ScrollView.</p><p>This <code>main.xml</code> caused the app to blow up on load... ""Sorry! The application... has stopped unexpectedly. Please try again. Force close""</p><pre><code>    &lt;ScrollView&gt;        &lt;RadioGroup android:id=""@+id/types""&gt;                    ...</code></pre><p>And this worked</p><pre><code>    &lt;ScrollView&gt;        &lt;RadioGroup android:id=""@+id/types"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;            ....</code></pre><p>My question, though, is <strong>how to figure this out?</strong> (aside from <a href=""http://www.droidnova.com/layout-technique-static-elements-below-scrollview,123.html"" rel=""nofollow"">trying out random code I find on the Internet</a>). On the force close, the stack trace seems to just be a bunch of launcher stuff, and <strong>never</strong> mentions my <code>main.xml</code> (using Debug mode in Eclipse with an AVD). <strong>Is there an error message somewhere that says that these attributes are missing?</strong> </p>","8047","","8047","","2010-09-04 16:47:31","2010-09-04 18:01:56","How to diagnose in Android (RadioGroup in ScrollView)","<android><eclipse-adt>","2","0","","",""
"3643192","1","3643202","","2010-09-04 16:57:16","2","1030","<p>Is it possible to load a layout XML at runtime and load into activity?</p><p>In my app, I have various types of data like Person, Company, City, etc; The requirement is to dynamically load the layout, find views by tags (property names like Person.name, Person.address) and then fill in data. For example, if user has selected an object of type Company, we want to load a company.xml layout, inflate it and then associate various properties (company name, company slogan, city, address, revenue) to tagged views. One possibility I see here is - each view in the layout will be associated with property-name as <code>tag</code> and then appropriate data will be loaded in appropriate views.</p><p>What should be the best design you would recommend?</p>","229106","","","","","2010-09-04 17:00:03","Creating layout dynamically from template","<android><xml><design><layout><android-inflate>","1","0","","",""
"3643295","1","","","2010-09-04 17:27:35","1","633","<p>I've followed the installation instruction to the letter.I've installed the latest JDK ADK ApacheAnt and Ruby installations.I've setup the JAVA_HOME, ANDROID_HOME, ANT_HOME paths, and added JAVA_HOME\bin; ANDROID_HOME\tools; ANT_HOME\bin; phonegap\bin to the path.However, when i try to run:</p><pre><code>C:\phonegap\bin&gt;ruby ./droidgap c:\android-sdk-windows test com.my.test c:\www c:\temp\test3</code></pre><p>I get:</p><pre><code>&lt;internal:lib/rubygems/custom_require&gt;:29:in `require': no such file to load --C:/phonegap/bin/lib/generate.rb (LoadError)        from &lt;internal:lib/rubygems/custom_require&gt;:29:in `require'        from ./droidgap:4:in `&lt;main&gt;'</code></pre><p>So ruby is looking for the lib dir in /bin? Something is wrong here.So if i copy the lib dir in /bin and run the same command again, i get nothing.No output, and the destination dir does not exist.</p><p>Why is this happening?</p>","117701","","","","","2010-09-10 16:15:02","Compiling phonegap application problem","<android><phonegap>","3","0","0","",""
"3643338","1","","","2010-09-04 17:42:02","5","3019","<p>I'm trying to play a PCM file in Android using the AudioTrack class. I can get the file to play just find but I cannot reliably tell when playback has finished. AudioTrack.getPlayState says playback has stopped when it hasn't. I'm having the same problem with AudioTrack.setNotificationMarkerPosition, and I'm pretty sure my marker is set to the end of the file (although I'm not completely sure I'm doing it right). Likewise, playback continues when getPlaybackHeadPosition is at the end of the file and has stopped incrementing. Can anyone help?</p>","439717","","","","","2012-11-27 02:10:13","How to tell when AudioTrack object has finished playing?","<java><android><mobile>","2","0","","",""
"3643340","1","3652384","","2010-09-04 17:42:26","2","1566","<p>I'm currently writing an Android application that should be able to receive push notifications from another application hosted in Google's App Engine.Since I can't use sockets in GAE, I though maybe using XMPP over GTalk server would solve my problem. But that way the Android Application would be connected to the users Gtalk account and thus showing the user as being online, when in reality the user is not.</p><p>Any way of achieving this kind of communication without showing the user as being online, and without asking the user to create a separate account?</p><p>Or any <strong>free</strong> push notification alternatives?</p><p>EDIT:I'm targeting 1.5+ Android devices so C2DM isn't an option.</p><p>Thanks!</p>","439716","","439716","","2012-03-12 01:56:15","2012-03-12 01:56:15","Using XMPP over GTalk to simulate push notifications","<android><google-app-engine><xmpp><real-time><google-talk>","4","0","2","",""
"3643395","1","3643468","","2010-09-04 18:02:23","37","70906","<p>I have an app that is not in the market place (signed with a debug certificate), but would like to get crash log data, whenever my application crashes. Where can I find a log of why my app crashed?</p>","19875","","19875","","2010-09-04 18:19:46","2014-03-20 08:52:51","How to get Android crash logs?","<android><logging><crash>","10","2","11","",""
"3643599","1","","","2010-09-04 19:04:00","1","708","<p>How can I read dmesg output in my program?</p><p>Thanks..</p>","439744","","","","","2013-12-10 16:30:02","read android dmesg with code","<android>","2","0","","",""
"3643708","1","","","2010-09-04 19:32:03","4","1409","<p>I am using a couple of ListView elements in my app. In all cases, it doesn't highlight the selected item when I click/touch it, but I can use the trackball to scroll up and down, and can see the orange highlighted color then. How do I fix this?</p><p>For e.g., one of them is a LinearLayout with two TextViews in it.</p>","76252","","","","","2011-03-03 13:34:57","Android ListView: Doesn't highlight on touch, but works when I use the trackball","<android><listview>","1","0","1","",""
"3643849","1","3644447","","2010-09-04 20:12:15","2","983","<p>Hey all, thanks for helping.  I'm going through an Android tutorial and I'm trying to access a color I've defined in colors.xml</p><pre><code>&lt;color name = ""my_background""&gt;#3500ffff&lt;/color&gt;</code></pre><p>Then I'm trying to access this color by name:</p><pre><code>Paint background = new Paint();background.setColor(getResources().getColor(R.color.my_background));</code></pre><p>but it doesn't recognize my_background as a resource.  If I let the suggestions come up, only a bunch of pre-defined colors pop up that are unrelated.  Any ideas?  It doesn't make sense for me, I see almost the exact same thing from the <a href=""http://developer.android.com/guide/topics/resources/more-resources.html"" rel=""nofollow"">developer documentation</a> and <a href=""http://www.linuxtopia.org/online_books/android/devguide/guide/topics/resources/available-resources.html"" rel=""nofollow"">another site</a>, but it doesn't work for me.</p>","306290","","","","","2010-09-04 23:51:03","Cannot retreive a color from colors.xml through a custom resource?","<java><android><eclipse>","1","3","0","",""
"3643872","1","3643882","","2010-09-04 20:19:00","4","7733","<p>I am using eclipse. I am trying to kill a process in my application. However, in eclipse it does not seem to know the hint for killBackgroundProcess from the ActivityManager and it will not let me proceed. I read that you have to have permissions to kill background processes and already added the permission which it did not recognize either from the manifest. Here is the code that I am trying to use:</p><pre><code>ActivityManager activityManager = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);activityManager.killBackgroundProcess(myProcessId);</code></pre><p>Any help is appreciated.</p>","160463","","","","","2013-03-20 21:22:45","Android ActivityManager killBackgroundProcess not working","<android><process><activity><manager>","4","1","1","",""
"3643907","1","3644072","","2010-09-04 20:31:45","1","1498","<p>I'm developing an application for Android 1.6 and newer which contains a functionality that switches the phone to sleep.</p><p>I tried to find a way of how to do that and I found the <strong>goToSleep</strong> method in the <strong>PowerManager</strong> class, but unfortunately the usage of that method requires <strong>android.permission.DEVICE_POWER</strong> permission which is a system level permission allowed only for system apps only.</p><p>Does anybody know an alternative way of forcing the phone to go into sleep mode or how to sign an application to gain the above mentioned permission and to allow the usage of the <strong>goToSleep</strong> method? Thank you!</p>","131404","","","","","2010-09-04 21:29:21","Putting the system to sleep on Android","<android>","1","0","1","",""
"3643940","1","3644120","","2010-09-04 20:43:41","1","4075","<p>I am having trouble passing data from one activity to another. </p><p>I can easily use startActivityForResult() to send an intent with the original data and then manipulate this data in the new Activity. I then use setResult() in the onPause() function of this new Activity to return some data in the Intent object. Doing this calls onActivityResult() in the original Activity, but the Intent sent to this function always ends up null, which is wrong. I don't understand why this Intent object is null.</p><p>Here are the main functions of the starting Activity, ""Test"":</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // add some data to play with    string_array_list.add(""item1"");    string_array_list.add(""item2"");    string_array_list.add(""item3"");    Button start_button = (Button) findViewById(R.id.button);    start_button.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            // start an activity to reverse the order of items in the list            startFlip();        }    });       }private void startFlip() {    // using a bundle isn't absolutely necessary,     // but useful in the real program    Intent i = new Intent(this, Flip.class);    Bundle extras = new Bundle();    extras.putStringArrayList(STRING_ARRAY_LIST, string_array_list);    i.putExtras(extras);    startActivityForResult(i, FLIP_REQUEST_CODE);}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    string_array_list.clear();    switch(requestCode) {        case FLIP_REQUEST_CODE:             if(data != null) { // RIGHT ANSWER                Bundle extras = data.getExtras();                string_array_list = extras.getStringArrayList(STRING_ARRAY_LIST);            }              // WRONG ANSWER, but the only answer I get            else Log.d(TAG, ""data is null"");     }   }</code></pre><p>And here are the main functions of the launched Activity, ""Flip"":</p><pre><code>@Overridepublic void onCreate(Bundle joy) {    super.onCreate(joy);    // retrieve the data from intent (or bundle)    Intent i = getIntent();    Bundle extras = i.getExtras();    if(joy != null) oldList = joy.getStringArrayList(Test.STRING_ARRAY_LIST);    else oldList = extras.getStringArrayList(Test.STRING_ARRAY_LIST);    // reverse the list order    for(int x = oldList.size() - 1; x &gt;= 0; --x)         newList.add(oldList.get(x));}@Override public void onPause() {    super.onPause();    Intent data = new Intent(this, Test.class);    Bundle extras = new Bundle();    extras.putStringArrayList(Test.STRING_ARRAY_LIST, newList);    data.putExtras(extras);    setResult(Test.FLIP_REQUEST_CODE, data);}</code></pre>","178910","","","","","2010-09-04 21:46:31","trouble passing data between Activities using Intents and setResult()","<android>","1","0","","",""
"3644030","1","","","2010-09-04 21:12:40","9","5210","<p>What's the best way to check if the view is visible on the window? </p><p>I have a CustomView which is part of my SDK and anybody can add CustomView to their layouts. My CustomView is taking some actions when it is visible to the user periodically. So if view becomes invisible to the user then it needs to stop the timer and when it becomes visible again it should restart its course. </p><p>But unfortunately there is no certain way of checking if my CustomView becomes visible or invisible to the user. There are few things that I can check and listen to: <pre><code>onVisibilityChange //it is for view's visibility change, and is introduced in new API 8 version so has backward compatibility issueonWindowVisibilityChange //but my CustomView can be part of a ViewFlipper's Views so it can pose issuesonDetachedFromWindows //this not as usefulonWindowFocusChanged //Again my CustomView can be part of ViewFlipper's views.</code></pre> So if anybody has faced this kind of issues please throw some light.</p>","195802","","89391","","2010-09-04 23:00:33","2013-10-30 15:35:38","What's the best way to check if the view is visible on the window?","<android><view><visibility>","3","0","2","",""
"3644063","1","","","2010-09-04 21:27:24","1","171","<p>When I run the Notepad3 tutorial, I got this error message:</p><blockquote>  <p>The application  com.android.demo.notepad3 (process  com.android.demo.notepad3) has stopped  unexpectedly</p></blockquote><p>It force close. What's wrong?</p>","419240","","","","","2010-09-04 21:27:24","Android Notepad3 run-time error forece close","<android>","0","5","","",""
"3644070","1","3644117","","2010-09-04 21:28:32","0","234","<p>I'm subclassing <code>InputMethodService</code> to create my own personal keyboard. A lot of stuff already works quite nice. But now I'm playing around with the suggestion bar (also called ""candiate view""). For now I'm just trying to load a static layout with one button in it:</p><pre><code>@Override public View onCreateCandidatesView() { LayoutInflater mLayoutInflater = LayoutInflater.from(this); mView = mLayoutInflater.inflate(R.layout.suggestion_bar, null); return mView;}</code></pre><p>The result looks like this:</p><p><img src=""http://i.stack.imgur.com/msPLN.png"" alt=""alt text""></p><p>Which is exactly what I expected, but with one big issue: the button in the suggestion bar is not selectable or clickable at all.</p><p>Any thoughts?</p>","184367","","49246","","2010-11-13 10:43:06","2010-11-13 10:43:06","Android: button in IME's suggestion bar not clickable","<android><layout><ime><android-input-method>","1","0","1","",""
"3644122","1","","","2010-09-04 21:47:16","0","430","<p>I'm writing a live wallpaper and need some help.  My wallpaper will create an effect over top of another image or existing wallpaper (not another live wallpaper) that the user chooses in the ""Settings..."".  </p><p>My problem is this:  I can't find a way to list the static wallpapers or images on the phone.  I've seen some examples of getting the camera images, but not the wallpapers.</p><p>Any help would be appreciated.</p>","24854","","","","","2010-09-04 22:16:17","Picking an image for Wallpaper","<android><image><wallpaper>","1","0","","",""
"3644133","1","3645886","","2010-09-04 21:52:28","4","893","<p>Could you point some good examples of Android projects that have unit testing in action?</p><p>It would be great to learn by example from those.</p>","296427","","352841","","2012-05-02 20:58:09","2012-05-02 20:58:09","Good examples of Android projects covered by tests?","<android><unit-testing><functional-testing>","1","0","3","",""
"3644144","1","4304110","","2010-09-04 21:57:26","31","50514","<p>Quick back story before someone tells me to buy an app. =)</p><p><em>I just got an EVO and it chews through the battery fairly quick. I downloaded JuiceDefender to manage my mobile data connection. That seems have worked out fairly well. However, the settings are just very restricted (even on the paid versions).</em></p><p>As of right now I am trying to develop a much more customizable battery saving application. The main thing I am trying to do first be able to enable/disable the mobile data connection at will. </p><p>The problem is I can't find any code snippets or articles on how to do this. The only thing I have found is the following. I don't know how accurate this is, but this was all I could piece together browsing developer.android.com</p><pre><code>ConnectivityManager cm = (ConnectivityManager) this.getSystemService(CONNECTIVITY_SERVICE);cm.stopUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, ""android.net.conn.CONNECTIVITY_CHANGE"");State state = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState();textView.setText(state.name());</code></pre><p>If anyone can point me to anything that could help, it would be most appreciated.</p><h3>UPDATE</h3><p>It appears that the HTC Evo on Sprint does not use APN settings. I tested this by downloading APNDroid and watching it not work. I then made a quick app to dump all APN entries to the screen. That yielded one result and it was for mms.</p><p>Looking at the phone info when JuiceDefender is running, I found that the GSRP network is getting turned on and off. This leaves me to believe it is possible to do it through code even though every page I find asking about this same issue says it cannot be done. The kicker is they all say to do it like APNDroid. Please someone give me some insight. </p><p>Thanks!</p>","359157","","359157","","2010-09-06 17:20:54","2013-01-30 13:13:39","How to disable Mobile Data on Android","<android>","7","0","37","",""
"3644150","1","3644213","","2010-09-04 21:59:56","0","126","<p>I am developing an Android application for which I would like to add Facebook functionality using Facebook's Android SDK. I have registered the application and acquired the ID and Secret, but what is the point of the URL? Am I supposed to install something on my website on that specific URL so that I Facebook can do the OAuth key exchange? </p><p>If so, then what is it?</p>","223876","","","","","2010-09-04 22:29:13","What is the point of the Application URL of Facebook Application registeration?","<java><android><facebook><oauth>","1","0","","",""
"3644322","1","","","2010-09-04 23:08:29","0","341","<p>I think the answer is going to be no, since the only question on the matter  on SO is about <a href=""http://stackoverflow.com/questions/3339409/minimum-memory-for-rar-decompression"">memory requirement</a>. However, before I go porting unrar to the android, I'd like to know if someone has done it already.</p>","95195","","","","","2010-09-05 15:33:41","Are there any free rar decompression implementations available for the android?","<android><rar>","1","0","","2012-12-30 10:23:14",""
"3644323","1","3644331","","2010-09-04 23:08:49","0","699","<p>It would work something like this </p><pre><code>someUtility.replace (""Hello, my name is {1}.  What is your {2}?"", ""Mark"", ""name"");</code></pre><p>Thanks in advance!</p>","369722","","","","","2010-09-05 02:33:01","Is there a utility in the Android SDK or in Java to replace parts of a string using placeholders?","<java><android><string><replace>","3","0","","",""
"3644393","1","3644534","","2010-09-04 23:32:50","2","3476","<p>I'm looking to create something EXACTLY like TimePickerDialog (look and feel) in Android, but it would be for MINUTES/SECONDS, not HOURS/MINUTES. Therefore AM/PM would not be relevant and would therefore allow MINUTE to be greater than 24 (making the max 59).</p><p>Is it possible to change the TimePickerDialog instance in any way to reflect this?</p><p>Any and all suggestions would be greatly appreciated. :-)</p>","439836","","","","","2014-03-03 19:12:00","How to customize a TimePickerDialog?","<android><dialog><timepicker>","2","0","3","",""
"3644408","1","","","2010-09-04 23:38:16","0","492","<ol><li>Where can I find the kernel including netfilter/iptables?</li><li>Can I assume most market phones has netfilter included within their kernels?</li></ol>","439801","","199122","","2010-09-04 23:41:59","2011-08-21 12:59:18","Android SDK avd emulator kernel does not include netfilter/iptables","<android><netfilter>","1","0","","",""
"3644425","1","","","2010-09-04 23:43:52","0","625","<p>My app fc when activity that's using SurfaceView as content view calls startActivityForResult(...) and activity that has been started calls finish()</p><p>This does not happen if I change content view to something else than SurfaceView.</p><p>This would be the requested logcat:</p><p>09-05 00:17:18.926: ERROR/AndroidRuntime(339): Uncaught handler: thread main exiting due to uncaught exception09-05 00:17:18.937: ERROR/AndroidRuntime(339): java.lang.IllegalThreadStateException: Thread already started.09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at java.lang.Thread.start(Thread.java:1322)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at fi.mikuz.soundboards.GraphicalSoundboardEditor$DrawingPanel.surfaceCreated(GraphicalSoundboardEditor.java:426)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.view.SurfaceView.updateWindow(SurfaceView.java:454)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:189)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.view.View.dispatchWindowVisibilityChanged(View.java:3782)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:692)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:692)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:692)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.view.ViewRoot.performTraversals(ViewRoot.java:706)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.os.Handler.dispatchMessage(Handler.java:99)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.os.Looper.loop(Looper.java:123)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at android.app.ActivityThread.main(ActivityThread.java:4363)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at java.lang.reflect.Method.invokeNative(Native Method)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at java.lang.reflect.Method.invoke(Method.java:521)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)09-05 00:17:18.937: ERROR/AndroidRuntime(339):     at dalvik.system.NativeStart.main(Native Method)</p>","438274","","438274","","2010-09-05 00:22:26","2010-09-05 00:34:16","onActivityResult fc when using SurfaceView on Android","<android><surfaceview>","1","1","","",""
"3644747","1","3644939","","2010-09-05 02:17:25","16","4967","<p>I have gone through the Android guide for <a href=""http://developer.android.com/guide/developing/other-ide.html"">other IDEs</a>, and I've got the basic build and install working fine using <code>ant</code> and a simple Emacs compile command.  I'm aware of some of the existing tools for developing Java and XML in Emacs.  I've also seen the <a href=""http://www.emacswiki.org/emacs/GoogleAndroid"">EmacsWiki page</a> recommending two Emacs packages, <a href=""http://www.emacswiki.org/emacs/EmDroid"">EmDroid</a> and <a href=""http://github.com/remvee/android-mode/blob/master/android-mode.el"">android-mode</a></p><p>I'd like to hear what people recommend, in terms of Emacs packages, small functions, or just workflows.</p><p>As a side note, I have decent familiarity with Eclipse, and I did setup the ADT plugin.  However, emacs is my primary editor, and I'd like to see how I can use it here.</p>","47773","","47773","","2010-09-05 02:52:36","2014-03-02 20:10:07","How can I develop for Android in Emacs?","<java><android><emacs><ant>","4","1","10","",""
"3644846","1","3722508","","2010-09-05 03:04:21","0","10","<p>When I exit and reopen my application, it immediately kills itself off, stating in the logcat:</p><p><img src=""http://i.stack.imgur.com/gDX1p.png"" alt=""alt text""></p><p>I cannot for the life of me figure out why it would be running out of resources, when there is pretty much nothing that it does when resuming the application, other than set a few variables. Any help?</p>","118241","","","","","2010-09-15 23:04:18","createNormalSurfaceLockedFailed Android","<java><android>","1","0","","",""
"3645024","1","","","2010-09-05 04:34:45","1","567","<p>i found this code for Android timers, public class myActivity extends Activity {</p><pre><code>private Timer myTimer;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    myTimer = new Timer();    myTimer.schedule(new TimerTask() {        @Override        public void run() {            TimerMethod();        }    }, 0, 1000);}private void TimerMethod(){    //This method is called directly by the timer    //and runs in the same thread as the timer.    //We call the method that will work with the UI    //through the runOnUiThread method.    this.runOnUiThread(Timer_Tick);}private Runnable Timer_Tick = new Runnable() {    public void run() {    //This method runs in the same thread as the UI.                   //Do something to the UI thread here    }};</code></pre><p>}I need to understand one thing... the comments say that this method runs in the same thread as the Ui does it mean that this method will keep running even when the screen is turned off or the activity is pushed to the background for eg. in case of an incoming phone call ?</p>","434885","","","","","2010-09-05 04:50:21","Android Timers Problem","<android>","1","0","","",""
"3645122","1","3645134","","2010-09-05 05:33:01","4","4765","<p>Specifically, I was trying to use the sqlite3 command with the adb shell to run some queries on the  database of the Android application I'm building.  I kept getting ""sqlite3: permission denied"".  I'm developing on a Nexus One that I purchased from Google.  Does my phone need to be rooted or something?  Thanks in advance.</p><pre><code>$ sqlite3 /data/data/com.moodme.android/databases/moodme.dbsqlite3 /data/data/com.moodme.android/databases/moodme.dbsqlite3: permission denied </code></pre>","369722","","31161","","2011-08-05 11:15:08","2013-01-04 06:55:01","Why does sqlite3 command using the android adb shell return ""permission denied""?","<android><shell><permissions><adb><nexus-one>","1","1","1","",""
"3645124","1","4028594","","2010-09-05 05:34:40","0","860","<p>I'm trying to get PhoneGap working.  I've hit a hurdle getting started.</p><p>I've downloaded version 0.9.1.  I've been following the instructions at <a href=""http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse"" rel=""nofollow"">http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse</a></p><p>Using MacOS 10.5.8.  Android SDK is already installed and working with Eclipse.</p><p>My .bash_profile file looks like this:-</p><pre><code>$PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/binexport PATH=${PATH}:/Applications/android-sdk-mac_86/toolsexport PATH=$PATH:/Applications/phonegap-android/bin</code></pre><p>(and I restarted my terminal window to make it take effect)</p><p>I've tried the following command:-</p><pre><code>cd /Applications/phonegap-android/binruby ./droidgap /Applications/android-sdk-mac_86 HelloPhoneGap  com.myidentity.android /Users/myidentity/Documents/workspace/HelloPhoneGap/assets/www /Users/myidentity/Desktop</code></pre><p>...and I get the following error:-</p><blockquote>  <p>./droidgap:4:in `require': no such file to load -- /Applications/phonegap-android/bin/lib/generate.rb (LoadError)      from ./droidgap:4</p></blockquote><p>Why?</p>","433579","","113124","","2010-09-05 05:50:07","2012-01-06 14:59:37","./droidgap:4:in `require': no such file to load","<android><phonegap>","2","1","","",""
"3645171","1","","","2010-09-05 05:58:25","0","353","<p>let say i have a myPrefs.xml in shared_prefs folder and i would like to retrieve the value within <code>myPrefs.xml</code> on boot.</p><p>How could i do it?</p><p>Thanks.</p>","439911","","227665","","2010-09-05 06:01:28","2010-09-05 06:01:45","get value from shared_prefs XML on boot in android","<android><xml>","1","0","","",""
"3645176","1","4999625","","2010-09-05 06:01:46","-1","1780","<p>i have a method which displays a map. i call this method in onDraw method. but on Action move i need to redraw the map and need to call that method again but i am not getting canvas reference to redraw the map tiles. i used invalidate method but it start refreshing the onDraw frequently which made my map movement too to slow..</p><p>here is my onDraw method.</p><pre><code>protected void onDraw(Canvas canvas)        {               Log.i(""On Draw Call"", ""On Draw call"");            mapMaker.getMapForScreenArea(map.getiScrnArea(), mapType, input, canvas);            invalidate();            this.canvas = canvas;        }</code></pre><p>any help will be appreciative.thanks a lot.</p>","397901","","227665","","2010-09-05 06:02:57","2012-01-07 19:45:19","onDraw calling frequently","<android>","1","0","","",""
"3645247","1","3672596","","2010-09-05 06:56:21","6","14208","<p>I'm trying to test the C2DM framework. I got the confirmation email a couple of days ago and then tryied to create a client that could register. For that purpose, I created  a simple client following the steps described in this tutorial: <a href=""http://code.google.com/intl/es-419/android/c2dm/index.html"">http://code.google.com/intl/es-419/android/c2dm/index.html</a>.</p><p>The Android manifest file contains among other things this code:</p><pre><code>&lt;permission android:name=""com.bilthon.ufrj.permission.C2D_MESSAGE"" android:protectionLevel=""signature"" /&gt;&lt;uses-permission android:name=""com.bilthon.ufrj.permission.C2D_MESSAGE"" /&gt;&lt;uses-permission android:name=""com.google.android.c2dm.permission.RECEIVE"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET""/&gt;&lt;receiver android:name="".C2DMReceiver"" android:permission=""com.google.android.c2dm.permission.SEND""&gt;&lt;intent-filter&gt;   &lt;action android:name=""com.google.android.c2dm.intent.REGISTRATION"" /&gt;   &lt;category android:name=""com.bilthon.ufrj"" /&gt;&lt;/intent-filter&gt;&lt;intent-filter&gt;   &lt;action android:name=""com.google.android.c2dm.intent.RECEIVE"" /&gt;   &lt;category android:name=""com.bilthon.ufrj"" /&gt;&lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>And then, the main activity launched when the program starts has the following code:</p><pre><code>Intent registrationIntent = new Intent(""com.google.android.c2dm.intent.REGISTER"");registrationIntent.putExtra(""app"", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); // boilerplateregistrationIntent.putExtra(""sender"",""mytestemail@gmail.com"");Log.d(""WelcomeScreen"",""mytestemail@gmail.com"");startService(registrationIntent);</code></pre><p>I also registered a google account on the AVD running my client, as they said it was required. But the problem is that I cannot get the broadcast receiver to ""wake up"". I don't know what could be wrong. By analysing the logs, I can see that the registration intent is created and apparently used correctly, but the receiver code just never is executed, what could be wrong?</p><p>Thanks in advanceNelson</p>","274434","","274434","","2010-09-06 19:51:59","2012-06-15 06:06:34","Problem registering for C2DM in Android","<android><android-manifest><android-c2dm>","4","0","3","",""
"3645309","1","3645793","","2010-09-05 07:24:26","1","1065","<p>I'm a newbie programmer for Android I was trying to start camera preview in Android on click of button. I'm trying directly to access camera hardware rather than using default camera application. Here is the code I've written</p><pre><code>import android.app.Activity;import android.hardware.Camera;import android.os.Bundle;import android.util.Log;import android.view.SurfaceHolder;import android.view.SurfaceView;import android.view.View;import android.widget.Button;import android.widget.Toast;public class CameraHandler extends Activity {    private SurfaceView sv = null;    private SurfaceHolder previewHolder = null;    private Button btnStop;    private Button btnStart;    private Camera camera = null;    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.cameraview);    // Get the surface view from main layout    sv = (SurfaceView) findViewById(R.id.cameraSurface);    // Get the buttons from XML    btnStart = (Button) findViewById(R.id.startButton);    btnStop = (Button) findViewById(R.id.stopButton);    btnStart.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {        // TODO Auto-generated method stub        SurfaceHolder.Callback surfaceCallBack = new SurfaceHolder.Callback() {            @Override            public void surfaceDestroyed(SurfaceHolder holder) {            // TODO Auto-generated method stub            camera.release();            camera = null;            }            @Override            public void surfaceCreated(SurfaceHolder holder) {            // TODO Auto-generated method stub            camera = Camera.open();            try {                camera.setPreviewDisplay(previewHolder);            } catch (Throwable t) {                // TODO Auto-generated catch block                Log.e(""PreviewDemo-surfaceCallback"",                    ""Exception in setPreviewDisplay()"", t);                Toast.makeText(CameraHandler.this, t.getMessage(),                    Toast.LENGTH_LONG).show();            }            }            @Override            public void surfaceChanged(SurfaceHolder holder,                int format, int width, int height) {            // TODO Auto-generated method stub            Camera.Parameters parameters = camera.getParameters();            parameters.setPreviewSize(width, height);            camera.setParameters(parameters);            camera.startPreview();            }        };        // Get the surface holder from the surface view        previewHolder = sv.getHolder();        // Now add these call backs        previewHolder.addCallback(surfaceCallBack);        previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);        }    });    btnStop.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {        // TODO Auto-generated method stub        camera.stopPreview();        }    });    }}</code></pre><p>As you can see I'm getting surface holder from the SurfaceView in XML adding it a call back when start button is clicked. For some reason SufraceHolder callback is not getting called. But If i place this entire code directly in onCreate function it works fine i.e camera preview starts as activity is launched. Am I missing something here? </p><p>Thanks in Advance</p>","154206","","","","","2010-09-05 10:52:11","Unable start camera Preview on button click","<android>","1","0","","",""
"3645319","1","3645800","","2010-09-05 07:28:52","21","27058","<pre><code># sqlite3 /data/data/com.moodme.android/databases/moodmesqlite3 /data/data/com.moodme.android/databases/moodmesqlite3: not found</code></pre>","369722","","","","","2014-03-26 01:53:16","Why do I get a ""sqlite3: not found"" error on a rooted Nexus One when I try to open a database using the adb shell?","<android><sqlite><shell><adb><rooted-device>","5","0","19","",""
"3645490","1","3646378","","2010-09-05 08:37:06","0","329","<p>I'm new in Android development and I often need to look at javadocs on almost every single class or method from Android SDK. </p><p>I found it very annoying to stop developing, go to the browser, look for the correspondent class and only then read the docs. It would be much more convenient to look at docs just in my IDE (for example, ctrl+click on interesting method and read docs, then click on 'back' button and go on developing not loosing speed).</p><p>But I cannot find Android SDK sources to attach them. I'd like to attach at least javadocs only but I cannot find them either. Android documentation has more <em>rich</em> format and it's more convenient to read it then old javadocs, but (I'm almost sure) none IDE can parse those docs any more.</p><p>Has someone managed this problem?</p>","100516","","100516","","2010-09-05 08:57:10","2010-09-05 14:21:40","Are there Android SDK source code or at least old plain javadocs somewhere?","<android><documentation>","1","3","1","",""
"3645545","1","","","2010-09-05 09:01:48","2","4297","<p>I am very new to Android development. I followed every steps from developer.com to install ADK. Now my issue is, when I tried to run HelloAndroid application, I get an error as I mentioned in the title.I hav JRE1.6 installed. Is tat enuf? Because I read tat ether jdk or jre is ok. I am clearly blank about the concept of this apk error. And I am using Eclipse Ganymede. Kindly give a solution for my issue. Thank You. :)</p>","439950","","21234","","2010-09-05 09:34:14","2012-05-26 14:31:57","Error : Could not find HelloAndroid.apk","<java><android>","5","0","2","",""
"3645741","1","3645779","","2010-09-05 10:29:01","2","974","<p>I'm looking for the location of the Android Froyo (2.2) default throbber animation resource.(In the progress dialog displayed as a animated wheel spinning).</p><p>What is the type of animation?(gif, png, avi?)</p><p>And how to get it as a separate file (or images) to be able to adjust.</p>","439977","","","","","2010-09-05 10:46:13","Android default throbber animation (Froyo 2.2)","<android>","1","0","","",""
"3645783","1","3646626","","2010-09-05 10:47:08","0","722","<p>i have coded this service, that computes stuff and i want other applications to be able to bind this service, i.e. i want to enable other programmers to communicate with this service.</p><p>problem is, this has to work without these other programmers to get access to the source code. just the (installed) apk with the remote service is given (and of course a detailed description of the service' interface)...</p><p>problem is, eclipse keeps braggin' about that the packages of the service are not available in source code...</p><p>how do i do this?</p>","370969","","","","","2010-09-05 15:43:44","how to bind a remote service that is installed on my android device?","<android><service>","1","0","","",""
"3645795","1","3671056","","2010-09-05 10:52:18","21","13388","<p>Is there any ready library to read ePub format ? I found ePublib in <a href=""http://github.com/psiegman/epublib"">http://github.com/psiegman/epublib</a>. I'm still learning how to use it.</p><p>I wonder if there is ePub jar which ready to use for read ePub format in android.</p>","436498","","436498","","2010-09-05 11:12:27","2013-05-06 18:33:37","ePub library for java or android","<java><android>","1","1","13","",""
"3645796","1","3646607","","2010-09-05 10:52:34","0","670","<p>I am trying to create activity with few controls and a DatePicker widget. And I am facing one strange problem that I can not explain. </p><p>If I set activity that has only DatePicker widget shown app works. And if I set activity that has other controls without DatePicker it works too. But when I show them both I get a NullPointer Exception. </p><p>What am I doing wrong? Why can't I display DatePicker widget together with other controls? </p>","310080","","","","","2010-09-05 15:38:36","Android - DatePicker widget problem","<android><activity><datepicker><widget>","1","0","","",""
"3645822","1","3650915","","2010-09-05 11:01:52","1","2801","<p>I currently have a ListView in my Android app that has a CheckBox on the side.</p><p>When the checkbox is changed I want to get some info from the listview row that the button is in and then persist it, however, I can not work out how to get the row data from the onClickChanged listener.</p><p>My listview is populated using a custom JSONObject listadapter, I am hoping it is something similar to working out what row is selected when detecting the onLongTouch - for example below is the code I use to get the relevant JSON object for the row selected on a longTouch:</p><pre><code>public boolean onContextItemSelected(MenuItem item) {         //get row selected information        AdapterView.AdapterContextMenuInfo menuInfo = (AdapterView.AdapterContextMenuInfo)item.getMenuInfo();        JSONObject selected = (JSONObject) getListAdapter().getItem(menuInfo.position);</code></pre><p>The above is obviously within my ListActivity, and my onCheckChanged listener would not be in the same activity (as it is defined in the row rather than the list)</p><p>Any help would be appreciated!</p>","258813","","","","","2010-09-06 11:03:40","Android - Getting the relevant ListView row on CheckBox changed","<android><listview><checkbox>","1","0","1","",""
"3645868","1","","","2010-09-05 11:16:44","-1","884","<p>Please help with the following code - I need a dialog box with a button to appear when the game puzzle is completed. Thank you!</p><p>Here's the code:</p><p>Sudoku.java</p><pre><code>package org.example.sudoku;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.content.Intent;import android.os.Bundle;import android.util.Log;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.view.View.OnClickListener;public class Sudoku extends Activity implements OnClickListener {   private static final String TAG = ""Sudoku"";   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      // Set up click listeners for all the buttons      View continueButton = findViewById(R.id.continue_button);      continueButton.setOnClickListener(this);      View newButton = findViewById(R.id.new_button);      newButton.setOnClickListener(this);      View aboutButton = findViewById(R.id.about_button);      aboutButton.setOnClickListener(this);      View exitButton = findViewById(R.id.exit_button);      exitButton.setOnClickListener(this);   }   @Override   protected void onResume() {      super.onResume();      Music.play(this, R.raw.main);   }   @Override   protected void onPause() {      super.onPause();      Music.stop(this);   }   public void onClick(View v) {      switch (v.getId()) {      case R.id.continue_button:         startGame(Game.DIFFICULTY_CONTINUE);         break;         // ...      case R.id.about_button:         Intent i = new Intent(this, About.class);         startActivity(i);         break;      // More buttons go here (if any) ...      case R.id.new_button:         openNewGameDialog();         break;      case R.id.exit_button:         finish();         break;      }   }   @Override   public boolean onCreateOptionsMenu(Menu menu) {      super.onCreateOptionsMenu(menu);      MenuInflater inflater = getMenuInflater();      inflater.inflate(R.menu.menu, menu);      return true;   }   @Override   public boolean onOptionsItemSelected(MenuItem item) {      switch (item.getItemId()) {      case R.id.settings:         startActivity(new Intent(this, Prefs.class));         return true;      // More items go here (if any) ...      }      return false;   }   /** Ask the user what difficulty level they want */   private void openNewGameDialog() {      new AlertDialog.Builder(this)           .setTitle(R.string.new_game_title)           .setItems(R.array.difficulty,            new DialogInterface.OnClickListener() {               public void onClick(DialogInterface dialoginterface,                     int i) {                  startGame(i);               }            })           .show();   }   /** Start a new game with the given difficulty level */   private void startGame(int i) {      Log.d(TAG, ""clicked on "" + i);      Intent intent = new Intent(Sudoku.this, Game.class);      intent.putExtra(Game.KEY_DIFFICULTY, i);      startActivity(intent);   }}</code></pre><p>Game.Java</p><pre><code>package org.example.sudoku;import android.app.Activity;import android.app.Dialog;import android.os.Bundle;import android.util.Log;import android.view.Gravity;import android.widget.Toast;public class Game extends Activity {   private static final String TAG = ""Sudoku"";   public static final String KEY_DIFFICULTY =      ""org.example.sudoku.difficulty"";   private static final String PREF_PUZZLE = ""puzzle"" ;   public static final int DIFFICULTY_EASY = 0;   public static final int DIFFICULTY_MEDIUM = 1;   public static final int DIFFICULTY_HARD = 2;   protected static final int DIFFICULTY_CONTINUE = -1;   private int puzzle[] = new int[9 * 9];   private final String easyPuzzle =      ""360000000004230800000004200"" +      ""070460003820000014500013020"" +      ""001900000007048300000000045"";   private final String mediumPuzzle =      ""650000070000506000014000005"" +      ""007009000002314700000700800"" +      ""500000630000201000030000097"";   private final String hardPuzzle =      ""009000000080605020501078000"" +      ""000000700706040102004000000"" +      ""000720903090301080000000600"";   private PuzzleView puzzleView;   @Override   protected void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      Log.d(TAG, ""onCreate"");      int diff = getIntent().getIntExtra(KEY_DIFFICULTY,            DIFFICULTY_EASY);      puzzle = getPuzzle(diff);      calculateUsedTiles();      puzzleView = new PuzzleView(this);      setContentView(puzzleView);      puzzleView.requestFocus();      // ...      // If the activity is restarted, do a continue next time      getIntent().putExtra(KEY_DIFFICULTY, DIFFICULTY_CONTINUE);   }   @Override   protected void onResume() {      super.onResume();      Music.play(this, R.raw.game);   }   @Override   protected void onPause() {      super.onPause();      Log.d(TAG, ""onPause"");      Music.stop(this);      // Save the current puzzle      getPreferences(MODE_PRIVATE).edit().putString(PREF_PUZZLE,            toPuzzleString(puzzle)).commit();   }   /** Given a difficulty level, come up with a new puzzle */   private int[] getPuzzle(int diff) {      String puz;      switch (diff) {      case DIFFICULTY_CONTINUE:         puz = getPreferences(MODE_PRIVATE).getString(PREF_PUZZLE,               easyPuzzle);         break;         // ...      case DIFFICULTY_HARD:         puz = hardPuzzle;         break;      case DIFFICULTY_MEDIUM:         puz = mediumPuzzle;         break;      case DIFFICULTY_EASY:      default:         puz = easyPuzzle;         break;      }      return fromPuzzleString(puz);   }   /** Convert an array into a puzzle string */   static private String toPuzzleString(int[] puz) {      StringBuilder buf = new StringBuilder();      for (int element : puz) {         buf.append(element);      }      return buf.toString();   }   /** Convert a puzzle string into an array */   static protected int[] fromPuzzleString(String string) {      int[] puz = new int[string.length()];      for (int i = 0; i &lt; puz.length; i++) {         puz[i] = string.charAt(i) - '0';      }      return puz;   }   /** Return the tile at the given coordinates */   private int getTile(int x, int y) {      return puzzle[y * 9 + x];   }   /** Change the tile at the given coordinates */   private void setTile(int x, int y, int value) {      puzzle[y * 9 + x] = value;   }   /** Return a string for the tile at the given coordinates */   protected String getTileString(int x, int y) {      int v = getTile(x, y);      if (v == 0)         return """";      else         return String.valueOf(v);   }   /** Change the tile only if it's a valid move */   protected boolean setTileIfValid(int x, int y, int value) {      int tiles[] = getUsedTiles(x, y);      if (value != 0) {         for (int tile : tiles) {            if (tile == value)               return false;         }      }      setTile(x, y, value);      calculateUsedTiles();      return true;   }   /** Open the keypad if there are any valid moves */   protected void showKeypadOrError(int x, int y) {      int tiles[] = getUsedTiles(x, y);      if (tiles.length == 9) {         Toast toast = Toast.makeText(this,               R.string.no_moves_label, Toast.LENGTH_SHORT);         toast.setGravity(Gravity.CENTER, 0, 0);         toast.show();      } else {         Log.d(TAG, ""showKeypad: used="" + toPuzzleString(tiles));         Dialog v = new Keypad(this, tiles, puzzleView);         v.show();      }   }   /** Cache of used tiles */   private final int used[][][] = new int[9][9][];   /** Return cached used tiles visible from the given coords */   protected int[] getUsedTiles(int x, int y) {      return used[x][y];   }   /** Compute the two dimensional array of used tiles */   private void calculateUsedTiles() {      for (int x = 0; x &lt; 9; x++) {         for (int y = 0; y &lt; 9; y++) {            used[x][y] = calculateUsedTiles(x, y);            // Log.d(TAG, ""used["" + x + ""]["" + y + ""] = ""            // + toPuzzleString(used[x][y]));         }      }   }   /** Compute the used tiles visible from this position */   private int[] calculateUsedTiles(int x, int y) {      int c[] = new int[9];      // horizontal      for (int i = 0; i &lt; 9; i++) {         if (i == y)            continue;         int t = getTile(x, i);         if (t != 0)            c[t - 1] = t;      }      // vertical      for (int i = 0; i &lt; 9; i++) {         if (i == x)            continue;         int t = getTile(i, y);         if (t != 0)            c[t - 1] = t;      }      // same cell block      int startx = (x / 3) * 3;      int starty = (y / 3) * 3;      for (int i = startx; i &lt; startx + 3; i++) {         for (int j = starty; j &lt; starty + 3; j++) {            if (i == x &amp;&amp; j == y)               continue;            int t = getTile(i, j);            if (t != 0)               c[t - 1] = t;         }      }      // compress      int nused = 0;      for (int t : c) {         if (t != 0)            nused++;      }      int c1[] = new int[nused];      nused = 0;      for (int t : c) {         if (t != 0)            c1[nused++] = t;      }      return c1;   }}</code></pre><p>PuzzleView.java</p><pre><code>package org.example.sudoku;import android.content.Context;import android.graphics.Canvas;import android.graphics.Paint;import android.graphics.Rect;import android.graphics.Paint.FontMetrics;import android.graphics.Paint.Style;import android.os.Bundle;import android.os.Parcelable;import android.util.Log;import android.view.KeyEvent;import android.view.MotionEvent;import android.view.View;import android.view.animation.AnimationUtils;public class PuzzleView extends View {   private static final String TAG = ""Sudoku"";   private static final String SELX = ""selX"";    private static final String SELY = ""selY"";   private static final String VIEW_STATE = ""viewState"";   private static final int ID = 42;    private float width;    // width of one tile   private float height;   // height of one tile   private int selX;       // X index of selection   private int selY;       // Y index of selection   private final Rect selRect = new Rect();   private final Game game;   public PuzzleView(Context context) {      super(context);      this.game = (Game) context;      setFocusable(true);      setFocusableInTouchMode(true);      // ...      setId(ID);    }   @Override   protected Parcelable onSaveInstanceState() {       Parcelable p = super.onSaveInstanceState();      Log.d(TAG, ""onSaveInstanceState"");      Bundle bundle = new Bundle();      bundle.putInt(SELX, selX);      bundle.putInt(SELY, selY);      bundle.putParcelable(VIEW_STATE, p);      return bundle;   }   @Override   protected void onRestoreInstanceState(Parcelable state) {       Log.d(TAG, ""onRestoreInstanceState"");      Bundle bundle = (Bundle) state;      select(bundle.getInt(SELX), bundle.getInt(SELY));      super.onRestoreInstanceState(bundle.getParcelable(VIEW_STATE));      return;   }   @Override   protected void onSizeChanged(int w, int h, int oldw, int oldh) {      width = w / 9f;      height = h / 9f;      getRect(selX, selY, selRect);      Log.d(TAG, ""onSizeChanged: width "" + width + "", height ""            + height);      super.onSizeChanged(w, h, oldw, oldh);   }   @Override   protected void onDraw(Canvas canvas) {      // Draw the background...      Paint background = new Paint();      background.setColor(getResources().getColor(            R.color.puzzle_background));      canvas.drawRect(0, 0, getWidth(), getHeight(), background);      // Draw the board...      // Define colors for the grid lines      Paint dark = new Paint();      dark.setColor(getResources().getColor(R.color.puzzle_dark));      Paint hilite = new Paint();      hilite.setColor(getResources().getColor(R.color.puzzle_hilite));      Paint light = new Paint();      light.setColor(getResources().getColor(R.color.puzzle_light));      // Draw the minor grid lines      for (int i = 0; i &lt; 9; i++) {         canvas.drawLine(0, i * height, getWidth(), i * height,               light);         canvas.drawLine(0, i * height + 1, getWidth(), i * height               + 1, hilite);         canvas.drawLine(i * width, 0, i * width, getHeight(),               light);         canvas.drawLine(i * width + 1, 0, i * width + 1,               getHeight(), hilite);      }      // Draw the major grid lines      for (int i = 0; i &lt; 9; i++) {         if (i % 3 != 0)            continue;         canvas.drawLine(0, i * height, getWidth(), i * height,               dark);         canvas.drawLine(0, i * height + 1, getWidth(), i * height               + 1, hilite);         canvas.drawLine(i * width, 0, i * width, getHeight(), dark);         canvas.drawLine(i * width + 1, 0, i * width + 1,               getHeight(), hilite);      }      // Draw the numbers...      // Define color and style for numbers      Paint foreground = new Paint(Paint.ANTI_ALIAS_FLAG);      foreground.setColor(getResources().getColor(            R.color.puzzle_foreground));      foreground.setStyle(Style.FILL);      foreground.setTextSize(height * 0.75f);      foreground.setTextScaleX(width / height);      foreground.setTextAlign(Paint.Align.CENTER);      // Draw the number in the center of the tile      FontMetrics fm = foreground.getFontMetrics();      // Centering in X: use alignment (and X at midpoint)      float x = width / 2;      // Centering in Y: measure ascent/descent first      float y = height / 2 - (fm.ascent + fm.descent) / 2;      for (int i = 0; i &lt; 9; i++) {         for (int j = 0; j &lt; 9; j++) {            canvas.drawText(this.game.getTileString(i, j), i                  * width + x, j * height + y, foreground);         }      }      if (Prefs.getHints(getContext())) {         // Draw the hints...         // Pick a hint color based on #moves left         Paint hint = new Paint();         int c[] = { getResources().getColor(R.color.puzzle_hint_0),               getResources().getColor(R.color.puzzle_hint_1),               getResources().getColor(R.color.puzzle_hint_2), };         Rect r = new Rect();         for (int i = 0; i &lt; 9; i++) {            for (int j = 0; j &lt; 9; j++) {               int movesleft = 9 - game.getUsedTiles(i, j).length;               if (movesleft &lt; c.length) {                  getRect(i, j, r);                  hint.setColor(c[movesleft]);                  canvas.drawRect(r, hint);               }            }         }      }      // Draw the selection...      Log.d(TAG, ""selRect="" + selRect);      Paint selected = new Paint();      selected.setColor(getResources().getColor(            R.color.puzzle_selected));      canvas.drawRect(selRect, selected);   }   @Override   public boolean onTouchEvent(MotionEvent event) {      if (event.getAction() != MotionEvent.ACTION_DOWN)         return super.onTouchEvent(event);      select((int) (event.getX() / width),            (int) (event.getY() / height));      game.showKeypadOrError(selX, selY);      Log.d(TAG, ""onTouchEvent: x "" + selX + "", y "" + selY);      return true;   }   @Override   public boolean onKeyDown(int keyCode, KeyEvent event) {      Log.d(TAG, ""onKeyDown: keycode="" + keyCode + "", event=""            + event);      switch (keyCode) {      case KeyEvent.KEYCODE_DPAD_UP:         select(selX, selY - 1);         break;      case KeyEvent.KEYCODE_DPAD_DOWN:         select(selX, selY + 1);         break;      case KeyEvent.KEYCODE_DPAD_LEFT:         select(selX - 1, selY);         break;      case KeyEvent.KEYCODE_DPAD_RIGHT:         select(selX + 1, selY);         break;      case KeyEvent.KEYCODE_0:      case KeyEvent.KEYCODE_SPACE: setSelectedTile(0); break;      case KeyEvent.KEYCODE_1:     setSelectedTile(1); break;      case KeyEvent.KEYCODE_2:     setSelectedTile(2); break;      case KeyEvent.KEYCODE_3:     setSelectedTile(3); break;      case KeyEvent.KEYCODE_4:     setSelectedTile(4); break;      case KeyEvent.KEYCODE_5:     setSelectedTile(5); break;      case KeyEvent.KEYCODE_6:     setSelectedTile(6); break;      case KeyEvent.KEYCODE_7:     setSelectedTile(7); break;      case KeyEvent.KEYCODE_8:     setSelectedTile(8); break;      case KeyEvent.KEYCODE_9:     setSelectedTile(9); break;      case KeyEvent.KEYCODE_ENTER:      case KeyEvent.KEYCODE_DPAD_CENTER:         game.showKeypadOrError(selX, selY);         break;      default:         return super.onKeyDown(keyCode, event);      }      return true;   }   public void setSelectedTile(int tile) {      if (game.setTileIfValid(selX, selY, tile)) {         invalidate();// may change hints      } else {         // Number is not valid for this tile         Log.d(TAG, ""setSelectedTile: invalid: "" + tile);         startAnimation(AnimationUtils.loadAnimation(game,               R.anim.shake));      }   }   private void select(int x, int y) {      invalidate(selRect);      selX = Math.min(Math.max(x, 0), 8);      selY = Math.min(Math.max(y, 0), 8);      getRect(selX, selY, selRect);      invalidate(selRect);   }   private void getRect(int x, int y, Rect rect) {      rect.set((int) (x * width), (int) (y * height), (int) (x            * width + width), (int) (y * height + height));   }   // ...}</code></pre>","439903","","17343","","2010-09-05 12:11:09","2013-11-29 14:08:20","How to launch a dialog box with a button when Game is complete?","<java><android>","1","0","","",""
"3645878","1","3646111","","2010-09-05 11:19:57","3","5111","<p>I want to create a file on the SD-Card and later save a CSV file in it.</p><p>From surfing around I noticed that there seem to be two ways about going about it:</p><p><a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesExternal"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html#filesExternal</a></p><blockquote>  <p>If you're using API Level 8 or  greater, use getExternalFilesDir() to  open a File that represents the  external storage directory where you  should save your files. This method  takes a type parameter that specifies  the type of subdirectory you want,  such as DIRECTORY_MUSIC and  DIRECTORY_RINGTONES (pass null to  receive the root of your application's  file directory). </p>    <p>If you're using API Level 7 or lower,  use getExternalStorageDirectory(), to  open a File representing the root of  the external storage. You should then  write your data in the following  directory:</p>    <p>/Android/data//files/</p></blockquote><p>And <a href=""http://www.anddev.org/working_with_files-t115.html"" rel=""nofollow"">http://www.anddev.org/working_with_files-t115.html</a> :</p><pre><code>FileWriter f = new FileWriter(""/sdcard/download/possible.txt"");</code></pre><p>What way should I use? If the first, how do I write my application to be compatible with both API level &lt;=7 and >=8? Is there some good tutorial for doing it the first way?</p>","25282","","","","","2013-05-06 15:06:42","Creating a file on the SD-Card in android","<android>","1","0","","",""
"3646317","1","3646419","","2010-09-05 14:07:54","2","2572","<p>I have a simple Android RSS reader app in which I am using SAX parser to fetch the data. All the records are being fetched correctly except for the ""desc"" element. The XML structure is as below.</p><pre><code>&lt;item&gt;&lt;title&gt;Boilermaker Jazz Band&lt;/title&gt;&lt;link&gt;http://eventur.sis.pitt.edu/event.jsp?e_id=1805&lt;/link&gt;&lt;type&gt;Music Concerts&lt;/type&gt;&lt;s_time&gt;09-02-2010 05:00 PM&amp;nbsp;&lt;/s_time&gt;&lt;venue&gt;Backstage Bar at Theater Square&lt;/venue&gt;&lt;venue_addr/&gt;&lt;desc&gt;&lt;p&gt;&lt;span style=""font-family: arial, geneva, sans-serif; font-size: 11px;""&gt;&lt;p style=""font-family: Arial, Helvetica, sans-serif; max-width: 600px; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; font-size: 9pt; vertical-align: top;""&gt;Authentic American Jazz, Ragtime and Swing The Boilermaker Jazz Band is an ecstatically fun band performing authentic hot jazz, ragtime, and swing. The group has ....&lt;/desc&gt;-&lt;img_link&gt;http://eventur.sis.pitt.edu/images/Boilheadshot1.jpg&lt;/img_link&gt;&lt;/item&gt;</code></pre><p>Data from all field is fetched as a whole. But when it comes to <code>&lt;desc&gt;</code>, the 'characters' method just fetches ""&lt;"" and ignores the rest. Could some one please advise what could be done.</p>","377337","","48503","","2010-09-05 14:23:21","2010-09-05 18:01:12","SAX parser ignoring CDATA - html tags","<java><html><android><rss><sax>","1","0","4","",""
"3646344","1","3646404","","2010-09-05 14:13:31","1","623","<p>So I have a physical chart of time intervals (minute:second) which map to point values (for example: 9:59-10:10 = 59.7) and I need to write a program that tries to find out the point value for a given time (such as 10:02 would return 59.7).</p><p>I would also like to have the interval chart stored in a .properties file, so my other ""calculators"" are all consistent.</p><p>What would be the best way to program this? </p>","439836","","","","","2010-09-05 14:30:30","How to check if a time (minute/second) is in a given interval?","<java><android>","1","0","","",""
"3646415","1","3646629","","2010-09-05 14:34:23","94","62565","<p>Is there any way to create <code>EditText</code> that has rounded corners?</p>","296427","","1198729","","2012-07-15 14:39:23","2014-02-17 04:40:54","How to create EditText with rounded corners?","<android><views><rounded-corners>","5","0","51","",""
"3646554","1","","","2010-09-05 15:23:50","-1","936","<p>I have a widget class and a service class updating the widget.</p><p>I have added in the widget class in onUpdate() the following code:</p><pre><code>  RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.countdownwidget);  Intent Intent1 = new Intent(Intent.ACTION_MAIN);  Intent1.addCategory(Intent.CATEGORY_LAUNCHER);  PendingIntent pendingIntent1 = PendingIntent.getActivity(context, 0, Intent1, 0);  views.setOnClickPendingIntent(R.id.button1, pendingIntent);  Intent Intent2 = new Intent(Intent.ACTION_MAIN);  Intent2.addCategory(Intent.CATEGORY_LAUNCHER);  PendingIntent pendingIntent2 = PendingIntent.getActivity(context, 0, Intent2, 0);  views.setOnClickPendingIntent(R.id.button2, pendingIntent2); </code></pre><p>And I have also added the following code in the widget service in the onStart()</p><pre><code>    Intent Intent1 = new Intent(Intent.ACTION_MAIN);    Intent1.addCategory(Intent.CATEGORY_LAUNCHER);    PendingIntent pendingIntent1 = PendingIntent.getActivity(getApplicationContext(), 0, Intent1, 0);    remoteView.setOnClickPendingIntent(R.id.button1, pendingIntent1);    Intent Intent2 = new Intent(Intent.ACTION_MAIN);    Intent2.addCategory(Intent.CATEGORY_LAUNCHER);    PendingIntent pendingIntent2 = PendingIntent.getActivity(getApplicationContext(), 0, Intent2, 0);    remoteView.setOnClickPendingIntent(R.id.button2, pendingIntent1);</code></pre><p>The problem I am having is that once the implicit intent registers the app to launch on button1, the button2 is identical to button1. How can i make the 2 intents behave differently? i.e register and launch different apps.Its working with one button, but the other button launches the same thing of the first button.I have have been looking to get this to work for the last week, reading things all over but with no result.I would appreciate your help.Thanks.</p>","364418","","","","","2010-09-05 16:54:55","Android widget intents","<java><android><widget><android-intent><android-pendingintent>","1","0","1","",""
"3646804","1","3646875","","2010-09-05 16:30:01","3","686","<p>I'd like to receive a TouchEvent in my Android application <strong>any time</strong> the screen is touched.  Even if my application is not in focus.</p><p>Is there an general even listener or intent filter I can write to achieve this?</p><p>The goal is to write system wide gesture engine.  So for example, if the user swiped up and then down, a certain application would be launched regardless of where the user is.</p><p>Thank you,</p>","9435","","","","","2013-01-30 09:57:30","System-wide TouchEvent on Android","<android><android-intent>","2","0","","",""
"3646834","1","3647096","","2010-09-05 16:39:09","0","2381","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3109158/how-to-draw-a-path-on-a-map-using-kml-file"">How to draw a path on a map using kml file?</a><br>  <a href=""http://stackoverflow.com/questions/3387894/android-draw-a-path-on-a-mapview-from-a-large-amount-of-longitude-latitude-points"">Android draw a path on a mapView from a large amount of longitude/latitude points</a>  </p></blockquote><p>In my android application I use this method in ""draw"" Overlay class for draw route on map.</p><p>Can someone tell me if this method is good (in terms of performance) for route draw on map or I must to put code in Thread ??</p><p>I'm new to android.</p><p>`</p><pre><code>public synchronized void draw(Canvas canvas, MapView mapView, boolean shadow) {  if (pointsAndTimes.isEmpty()) {   return;  }  Projection projection = mapView.getProjection();  Paint paint = new Paint();  paint.setARGB(250, 255, 0, 0);  paint.setAntiAlias(true);  paint.setFakeBoldText(true);  paint.setStrokeWidth(4);  paint.setAlpha(100);    for (int i = 0; i &lt; pointsAndTimes.size(); i++) {   PointAndTime pointAndTime = pointsAndTimes.get(i);   Point point = projection.toPixels(pointAndTime.getGeoPoint(), null);   if (i == pointsAndTimes.size() - 1) {   } else {    PointAndTime nextPointAndTime = pointsAndTimes.get(i + 1);    Point nextPoint = projection.toPixels(nextPointAndTime      .getGeoPoint(), null);    canvas.drawLine(point.x, point.y, nextPoint.x, nextPoint.y,      paint);   }  }  mapView.invalidate(); }`</code></pre><p>Thanks</p>","432848","","760489","","2011-09-26 10:04:41","2011-09-26 10:04:41","Andorid Draw route path Draw function","<android><map>","1","2","","2011-09-26 13:03:12",""
"3647014","1","3647121","","2010-09-05 17:30:07","2","1773","<p>Can't find information on how to print out documentation on android shell commands while in the shell.  Something along the lines of</p><pre><code>help ls</code></pre>","369722","","","","","2010-09-06 04:53:36","How can I get information from the shell about commands available in Android shell?","<android><shell><command-line>","3","0","0","",""
"3647022","1","","","2010-09-05 17:32:45","3","444","<p>my HTC has a nice cut &amp; paste function that allows me to mark text with two green sliders and then perform either a search on it, push the text to the clipboard or send it to an app.</p><p>The apps shown in the menu are: Friend Stream, Mail, Nachricht (SMS message), Peep (all HTC)</p><p>I want to have my app appear here - but don't know how.</p><p>My app is listed on other send menues (e.g. send link to, send image) but I cannot get on the cut &amp; paste menu.</p><p>Anyone out there who knows more?</p><p>/Paul</p>","346934","","65977","","2010-09-05 17:48:32","2010-09-09 08:00:51","Add my app to HTC cut & paste sendto menu","<android><android-intent>","2","1","1","",""
"3647305","1","3647604","","2010-09-05 18:51:41","0","840","<p>I find myself stuck in something I think would be really easy to solve. My app contains a lot of TextViews and ImageViews, and one TextView contains the content listed. I want each element of the displayed content internally linked to the respective TextView. Probably the TextView isn't the right element to use, but I have trouble finding the right element.</p><p>The internal link should work exactly like internal links in html-documents... is this possible to achieve in Android?</p><p>strings.xml:</p><pre><code>&lt;string name=""c3""&gt;3. Contents&lt;/string&gt;&lt;string name=""c4""&gt;1. Abstract\n3. Contents\n4. List of Abbreviations\n5. Introduction\n6. Materials &amp;amp; Methods\n6.1 Literature Selection\n6.2 Method\n6.3 What is Android?\n6.3.1 Dalvik Virtual Machine and Android Applications\n6.3.2 Android Structure, Java and XML\n6.3.3 Android Versions\n6.4 The Development Environment\n6.4.1 Android SDK\n6.4.2 Eclipse IDE\n6.4.3 Android Virtual Device\n6.4.4 Secure Digital Card\n6.5 “Hello World!” as Test of IDE\n6.6 Test Application\n6.7 Developing Strategy\n7. Result\n7.1 Facebook Connect\n7.1.1 Facebook Application\n7.1.2 Facebook Connect for Android\n7.2 Networking\n7.3 Data Synchronization\n8. Discussion\n9. Conclusion\n10. References\n10.1 Internet References\n10.2 Lecture References\n\n&lt;/string&gt;</code></pre><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@color/smoke""    android:scrollbars=""vertical""&gt;    &lt;ScrollView android:id=""@+id/ScrollView01""        android:layout_width=""wrap_content""         android:layout_height=""fill_parent""        android:scrollbars=""none""    &gt;        &lt;LinearLayout android:id=""@+id/LinearLayout02""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:orientation=""vertical""            android:paddingLeft=""4px""            android:paddingRight=""4px""        &gt;        &lt;TextView              android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:text=""@string/a""            android:textColor=""@color/black""            android:gravity=""center_horizontal""            android:textSize=""16dp""            android:paddingBottom=""2dp""            android:paddingTop=""20dp""            android:scrollbars=""vertical""            /&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:text=""@string/b""            android:gravity=""center_horizontal""            android:textColor=""@color/black""            android:scrollbars=""vertical""        /&gt;        &lt;TextView              android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:text=""@string/c1""            android:textColor=""@color/black""            android:textSize=""20dp""            android:paddingBottom=""2dp""            android:scrollbars=""vertical""        /&gt;        &lt;TextView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""             android:text=""@string/c2""            android:textColor=""@color/black""            android:scrollbars=""vertical""         /&gt;</code></pre>","286244","","286244","","2010-09-05 19:56:50","2010-09-05 20:08:39","Internal link to TextView in Android?","<android><hyperlink><textview><internal>","1","2","","",""
"3647432","1","","","2010-09-05 19:28:17","3","2766","<p>Hi I'm trying to pass an array of <a href=""http://developer.android.com/reference/android/location/Address.html"" rel=""nofollow"">Address</a> objects to another Activity through an Intent object. </p><p>As the Address class implements the <a href=""http://developer.android.com/reference/android/os/Parcelable.html"" rel=""nofollow"">Parcelable</a> interface I try to do the following. I got a List Address object from a Geocoder object, which I convert into a array of Address objects. Then I put this array into the Intent and call the activity.</p><pre><code>final Address[] addresses = addresseList.toArray(new Address[addresseList.size()]);final Intent intent = new Intent(this, SelectAddress.class);intent.putExtra(SelectAddress.INTENT_EXTRA_ADDRESSES, startAddresses);startActivityForResult(intent, REQUEST_CODE_ACTIVITY_SELECT_ADDRESSES);</code></pre><p>On the other activity I try to retrieve the Address[] from the Intent with the following piece of code. But the call of the last line ends with a ClassCastException <code>Landroid.os.Parcelable</code>.</p><pre><code>Bundle bundle = getIntent().getExtras();            Address[] addresses = (Address[]) bundle.getParcelableArray(INTENT_EXTRA_ADDRESSES);</code></pre><p>What am I doing wrong? How do I have to retrieve the Address[].</p>","19601","","19601","","2010-09-05 19:58:10","2014-02-13 10:49:40","How to pass an array of Address objects to an other Acitvity","<android><activity><android-intent><parcelable>","2","6","","",""
"3647446","1","","","2010-09-05 19:30:41","6","2577","<p>I 'm working with GPS in my application. When phone go to sleep, the GPS's data don't update. I want to stay phone screen wake up until my app will be close. How can I prevent sleeping in Android?</p>","410461","","106224","","2010-12-06 12:46:25","2010-12-06 12:46:25","How to prevent sleeping in Android","<android><sleep>","2","1","","",""
"3647583","1","","","2010-09-05 20:02:40","0","711","<p>I am new to Android programming and I'm trying to figure out how to go back to a previous screen/activity after opening another screen using startActivity.  From all the research I've done, using the finish() method should bring up the previous screen just before the current one; however, in my test program (has four screens with a ""next"" &amp; ""back""button), when pressing the back button, it jumps all the way back to the first screen instead of going to the previous screen.</p><p>Any help with this would be greatly appreciated. My code is below:</p><pre><code>public class Screen1 extends Activity implements OnClickListener {    private Button next;    private Button quit;    public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.screen1);     next = (Button) findViewById(R.id.next);        quit = (Button) findViewById(R.id.quit);        next.setOnClickListener(this);        quit.setOnClickListener(this);    }    public void onClick(View view) {      switch(view.getId()) {          case R.id.next: {             startActivity(new Intent(this, Screen2.class));        }        case R.id.quit: {             finish();        }      }     } }public class Screen2 extends Activity implements OnClickListener {    private Button next;    private Button back;    public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.screen2);     next = (Button) findViewById(R.id.next);        back = (Button) findViewById(R.id.back);        next.setOnClickListener(this);        back.setOnClickListener(this);    }    public void onClick(View view) {      switch(view.getId()) {          case R.id.next: {             startActivity(new Intent(this, Screen3.class));        }        case R.id.back: {             finish();        }      }     } }public class Screen3 extends Activity implements OnClickListener {    private Button next;    private Button back;    public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.screen3);     next = (Button) findViewById(R.id.next);        back = (Button) findViewById(R.id.back);        next.setOnClickListener(this);        back.setOnClickListener(this);    }    public void onClick(View view) {      switch(view.getId()) {          case R.id.next: {             startActivity(new Intent(this, Screen4.class));        }        case R.id.back: {             finish();        }      }     } }public class Screen4 extends Activity implements OnClickListener {    private Button back;    public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.screen4);        back = (Button) findViewById(R.id.back);        back.setOnClickListener(this);    }    public void onClick(View view) {             finish();        }     } }</code></pre>","440183","","106224","","2010-09-05 20:06:34","2010-09-05 20:46:41","Going Back to Previous Screens","<java><android>","1","2","","",""
"3647597","1","3652899","","2010-09-05 20:06:28","0","141","<p>this is a part of my code :</p><pre><code> public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {  TextView title_t = new TextView(this);  title_t.setText("""");  String title = title_t.getText().toString();  switch(position){  case 0 : new AlertDialog.Builder(this).setTitle(title).setMessage(""blah blah"").setNeutralButton(""close"", new DialogInterface.OnClickListener() {   @Override   public void onClick(DialogInterface dialog, int which) {    // TODO Auto-generated method stub   }  }).show();</code></pre><p>i want to replace the """" in the title_t.setText("""") by a thing that can work.I just want to take the title from the listview which come from a resource.Thanks</p>","439058","","244296","","2010-09-05 20:25:08","2010-09-06 16:21:18","how to take the text in an array which come from a resource?","<android><string><listview><resources><switch-statement>","1","2","","",""
"3647705","1","3647718","","2010-09-05 20:35:30","0","255","<p>I'm planning on buying a sony ericcson xperia x10 mini pro but I don't like the blueish UII saw video of it running ADW Launcher and that looked great but,</p><p>Does using a different launcher also change the UI in the texting/emailing screens? , I want to have homescreens like ADW Launcher and the texting/emailing UI should look like pure android or ADW style.</p><p>When I think about the word ""launcher"" it isn't clear, does it modify only the home screens or the entire UI of the android operating system</p>","360646","","","","","2010-09-05 21:58:19","If I install a different launcher on Android will the UI of everything be different?","<android><user-interface>","2","1","","",""
"3647821","1","3721880","","2010-09-05 21:10:58","1","3547","<p>In my Android app I use a TabWidget without any special customization. I'd like Android to take care of the specific appearance, which works fine if you compare Android 1.6 with 2.1 for example. By just using a TabWidget the same code leads to different forms of tabs because the SDK defines how to draw it.Here is how it looks on 2.1 for example:</p><p><img src=""http://i.stack.imgur.com/cVYkn.jpg"" alt=""alt text""></p><p>So, the highlighted tab is gray and the font is white and you can read it quite well.</p><p>But, if you have HTC Sense, it looks like this:<img src=""http://i.stack.imgur.com/FOT4Q.jpg"" alt=""alt text""></p><p>The picture isn't that good, but just believe me that it's white text on white background which is not really that easy to read...</p><p>My questions are:</p><p>1) Why does Android create a TabWidget with white on white text? I never defined either the text color or the background color, so the system is supposed to chose sensible colors.</p><p>2) I assume that other TabWidgets look just fine on HTC Sense, because otherwise it would be quite a big and popular problem. So why is my TabWidget having this problem and not others.</p><p>3) How can I fix this problem without changing the appearance on non Sense devices?</p><p>As I said I did not customize the TabWidget in any way. Here is my definition:</p><pre><code>&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@android:color/black""    &gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""0dp""            &gt;      &lt;ScrollView             android:id=""@+id/shortenerScrollView""            android:layout_height=""fill_parent""             android:layout_width=""fill_parent""            android:background=""@android:color/black""            android:fadingEdge=""horizontal""            &gt;</code></pre><p>So, besides defining black as my general background color of the app, there's no color or style defintion made. The only exception might be that I'm using standard Android ids for TabHost and TabWidget.</p><p>/Edit:Here's the defintion of the tabs in the onCreate method:</p><pre><code>th = getTabHost();th.addTab(th.newTabSpec(""shortener"").setIndicator(getString(R.string.tabShortenerName),        res.getDrawable(R.drawable.url_zip)).setContent(R.id.shortenerScrollView));</code></pre><p>The class extends a TabActivity.</p><p>/Edit 2:The device that comes up with the white on white text is a HTC Legend running Android 2.1 btw.</p><p>/Edit 3:dream3r was right. Changing the targetSdk value to 4 did the trick for me, too (before, it was set to 6)! I don't really get it, but I can live with that for now. :)</p><p>Here's a picture of how it looks now:<img src=""http://i.stack.imgur.com/dCy8Z.jpg"" alt=""alt text""></p>","388826","","388826","","2010-09-18 10:07:52","2014-03-10 07:09:07","Android: Highlighted tab of TabWidget not readable on HTC Sense","<android><layout><colors><tabwidget><htcsense>","1","2","3","",""
"3647858","1","","","2010-09-05 21:22:26","1","3101","<p>I have been working on my app and come to the point where I need to understand the Activity lifecycle and I don't think I get it.  What I have is an Activity with seven buttons on it.  When a user presses a button it opens a listActivity where a user can choose an item in the list, the title gets sent back to the calling Activity, and the calling activity adds the title next to the text on the button.  (The method it uses is in a switch statement that depends on what request code comes back to it - I think it's a little weak for my purposes.)  But if the user leaves the activity and comes back to it, via the back button or any other button, none of the extra information is there when they return - all that remains are the seven buttons with their original text.  I would like the information to stay - how do I go about that?</p><p>Here is the code from the calling Activity:</p><pre><code>package com.dinner.live;import android.app.Activity;import android.app.ListActivity;import android.content.Intent;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.SimpleCursorAdapter;import android.widget.Toast;public class PlanMenu extends Activity { static final private int CHOOSE_MONDAY = 0; static final private int CHOOSE_TUESDAY = 1; static final private int CHOOSE_WEDNESDAY = 2; static final private int CHOOSE_THURSDAY = 3; static final private int CHOOSE_FRIDAY = 4; static final private int CHOOSE_SATURDAY = 5; static final private int CHOOSE_SUNDAY = 6; private boolean ButtonPushed = false; private NotesDbAdapter mDbHelper; private MenuDbAdapter menuDbHelper; private Long menuID; private String mTitleText; private String m; @Override protected void onCreate(Bundle savedInstanceState) {  // TODO Auto-generated method stub  super.onCreate(savedInstanceState);  setContentView(R.layout.plan_menu);  Toast.makeText(this, ""Choose a day to pick a meal for!"", Toast.LENGTH_LONG).show();  mDbHelper = new NotesDbAdapter(this);        mDbHelper.open();        menuDbHelper = new MenuDbAdapter(this);        menuDbHelper.open();  } public void mButtonHandler(View target)    {  switch(target.getId())  {  case R.id.monday:   if(ButtonPushed == false)   {    // Create new intent object and tell it to call the ColorPicker class    Intent monday = new Intent(this, PlanMenuList.class);     // Start ColorPicker as a new activity and wait for the result     startActivityForResult(monday, CHOOSE_MONDAY);    ButtonPushed = true;    break;   }   else    Toast.makeText(this, ""That button has already been pushed."" , Toast.LENGTH_LONG).show();   break;  case R.id.tuesday:   // Create new intent object and tell it to call the ColorPicker class      Intent tuesday = new Intent(this, PlanMenuList.class);       // Start ColorPicker as a new activity and wait for the result       startActivityForResult(tuesday, CHOOSE_TUESDAY);      break;  case R.id.wednesday:   // Create new intent object and tell it to call the ColorPicker class      Intent wednesday = new Intent(this, PlanMenuList.class);       // Start ColorPicker as a new activity and wait for the result       startActivityForResult(wednesday, CHOOSE_WEDNESDAY);      break;  case R.id.thursday:   // Create new intent object and tell it to call the ColorPicker class      Intent thursday = new Intent(this, PlanMenuList.class);       // Start ColorPicker as a new activity and wait for the result       startActivityForResult(thursday, CHOOSE_THURSDAY);      break;  case R.id.friday:   // Create new intent object and tell it to call the ColorPicker class      Intent friday = new Intent(this, PlanMenuList.class);       // Start ColorPicker as a new activity and wait for the result       startActivityForResult(friday, CHOOSE_FRIDAY);      break;  case R.id.saturday:   // Create new intent object and tell it to call the ColorPicker class      Intent saturday = new Intent(this, PlanMenuList.class);       // Start ColorPicker as a new activity and wait for the result       startActivityForResult(saturday, CHOOSE_SATURDAY);      break;  case R.id.sunday:   // Create new intent object and tell it to call the ColorPicker class      Intent sunday = new Intent(this, PlanMenuList.class);       // Start ColorPicker as a new activity and wait for the result       startActivityForResult(sunday, CHOOSE_SUNDAY);      break;  }    } @Override    protected void onActivityResult(int requestCode, int resultCode,                                     Intent intent) {        super.onActivityResult(requestCode, resultCode, intent);        if(resultCode == RESULT_OK){         switch(requestCode)         {          case CHOOSE_MONDAY:           menuID = intent.getExtras().getLong(""newRowId"");              menuDbHelper.fetchMenu(menuID);           populateFields();           //String label = intent.getExtras().getString(""menuString"");//intent.getExtras().getLong(MenuDbAdapter.KEY_ROWID);           Button tv = (Button)findViewById(R.id.monday);           m = mTitleText;           tv.setText(""Monday"" + "" - "" + mTitleText);           break;          case CHOOSE_TUESDAY:           String labelT = intent.getExtras().getString(""menuString"");//intent.getExtras().getLong(MenuDbAdapter.KEY_ROWID);           Button tvT = (Button)findViewById(R.id.tuesday);           tvT.setText(""Tuesday"" + "" - "" + labelT);           break;          case CHOOSE_WEDNESDAY:           String labelW = intent.getExtras().getString(""menuString"");//intent.getExtras().getLong(MenuDbAdapter.KEY_ROWID);           Button tvW = (Button)findViewById(R.id.wednesday);           tvW.setText(""Wednesday"" + "" - "" + labelW);           break;          case CHOOSE_THURSDAY:           String labelTh = intent.getExtras().getString(""menuString"");//intent.getExtras().getLong(MenuDbAdapter.KEY_ROWID);           Button tvTh = (Button)findViewById(R.id.thursday);           tvTh.setText(""Thursday"" + "" - "" + labelTh);           break;          case CHOOSE_FRIDAY:           String labelFriday = intent.getExtras().getString(""menuString"");//intent.getExtras().getLong(MenuDbAdapter.KEY_ROWID);           Button tvFriday = (Button)findViewById(R.id.friday);           tvFriday.setText(""Friday"" + "" - "" + labelFriday);           break;                    case CHOOSE_SATURDAY:           String labelS = intent.getExtras().getString(""menuString"");//intent.getExtras().getLong(MenuDbAdapter.KEY_ROWID);           Button tvS = (Button)findViewById(R.id.saturday);           tvS.setText(""Saturday"" + "" - "" + labelS);           break;          case CHOOSE_SUNDAY:           String labelSa = intent.getExtras().getString(""menuString"");//intent.getExtras().getLong(MenuDbAdapter.KEY_ROWID);           Button tvSa = (Button)findViewById(R.id.sunday);           tvSa.setText(""Sunday"" + "" - "" + labelSa);           break;         }        } } private void populateFields() {        if (menuID != null) {            Cursor note = menuDbHelper.fetchMenu(menuID);            startManagingCursor(note);            mTitleText = (note.getString(                 note.getColumnIndexOrThrow(MenuDbAdapter.KEY_TITLE)));        }    }}</code></pre>","436204","","23897","","2010-09-05 21:26:14","2010-09-05 21:31:23","Android onPause() or saveInstanceState()?","<android>","1","1","1","",""
"3647945","1","3648042","","2010-09-05 21:48:00","0","899","<p>I am currently using pure OpenGL to paint buttons in my own little way.</p><p>I can detect if a button is pushed with onTouchEvent, but I want to know if the user is holding the button down, or if the user is no longer touching the screen.</p>","333361","","","","","2010-09-05 22:11:39","How can I sense if the user is holding down their finger on the screen without moving it?","<android><touch><surfaceview><glsurfaceview>","1","0","0","",""
"3647993","1","3648017","","2010-09-05 21:58:00","31","22166","<p>When I load an image frome the media gallery into a Bitmap, everything works fine, except that pictures that were shot with the camera while holding the phone vertically, are rotated so that I always get a horizontal picture even though it appears vertical in the gallery.Why is that and how can I load it correctly?</p>","388826","","","","","2014-03-17 16:10:33","Android: Bitmaps loaded from gallery are rotated in ImageView","<android><bitmap><rotation><gallery>","13","0","22","",""
"3648140","1","","","2010-09-05 22:49:14","1","1150","<p>Im writing a small webapp based on the idea of openspot for training proposal.</p><p>When I open the map with my desktop pc everything is fine, but when I open it with my HTC Desire and add a marker the map hangs.</p><p>You can find a demo here (in german)</p><p><a href=""http://park-a-lot.de"" rel=""nofollow"">http://park-a-lot.de</a> </p><p>Just go to ""eintragen"" and set a marker.Then go hack and click on ""parkplatze"".</p><p>You'll see the issue.</p><p>Its ok that the toolbar at the top hides when you move the map, because of a jqtouch bug with Google maps.</p><p>Thank you in advance.</p>","440238","","","","","2012-01-05 22:03:29","Google Maps slow when markers on it","<android><mobile><maps>","2","0","","",""
"3648166","1","","","2010-09-05 22:57:41","3","5955","<p>When my android app is removed, I would like to also remove files the app has created on the SD card, as these can consume many megabytes and are only of use to my app.</p><p>It seems that receiving the PACKAGE REMOVED intent would be the place to do this.However, my broadcast receiver is never called--it seems to have been deleted before the PACKAGE REMOVED intent is sent</p><p>The code is:</p><pre>public class UninstallReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) {  String action= intent.getAction();  Log.i(""U"", ""ACTION "" + action);  etc. }}</pre><p>and, in the manifest:</p><pre> &lt;application android:debuggable=""true""  android:icon=""@drawable/icon""  android:label=""@string/app_name"">  &lt;receiver android:name =""com.boom.UninstallReceiver"">   &lt;intent-filter>        &lt;action android:name=""android.intent.action.PACKAGE_REMOVED""/>      &lt;data android:scheme=""package"" />   &lt;/intent-filter>  &lt;/receiver></pre>","323843","","","","","2012-09-27 12:41:22","android not receiving Intent ACTION_PACKAGE_REMOVED in the removed package","<android><android-intent><package><broadcastreceiver>","2","0","3","",""
"3648262","1","3648561","","2010-09-05 23:36:35","5","4945","<p>Trying to read an utf-8 encoded file in android...    </p><pre><code>InputStreamReader reader = new InputStreamReader(assets.open(""data.txt""), ""UTF-8"");BufferedReader br = new BufferedReader(reader); String line;//The line below throws an IOException!!line = br.readLine();</code></pre><p>What's wrong with this code?</p>","433261","","272824","","2010-09-06 01:33:30","2010-09-06 01:33:30","reading unicode text from assets","<android><unicode><file-io>","1","2","","",""
"3648311","1","3656507","","2010-09-05 23:51:45","1","4205","<p>Do I need to implement a custom thumb Drawable?</p>","369722","","","","","2012-08-16 07:46:11","How do I get the thumb of an Android SeekBar to match the height of the SeekBar?","<android><height><scrollbar><thumb>","2","0","2","",""
"3648451","1","3648563","","2010-09-06 00:45:41","1","1977","<p>I've got a class that creates a list from a DB using SimpleCursorAdapter. I want to add an onClick event to each item in the list but I don't know where to place the code.</p><p>Any help?</p>","149166","","","","","2013-11-03 12:57:23","onClick inside ListActivity using SimpleCursorAdapter","<java><android><onclick><listactivity>","1","0","1","",""
"3648508","1","3648544","","2010-09-06 01:10:48","1","466","<p>I've tested deployment to Android Market already as a test, seems like everything is hooked up fine - but now getting a little deeper into java and need to figure out how to use the Eclipse IDE.</p><ol><li><p>I'm having exceptions, but where can see the exception message?.. it's not showing up in my consoles , not even the java stack trace console while in debug mode?</p><p>URLConnection uconn = null;try {uconn = u.openConnection();catch (IOException e) {e.printStackTrace();x = x + e.toString();}</p></li><li><p>Where does this output, not seeing it in any of the consoles. How can I output to console?</p><p>System.out.println(""-----------------hello"");</p></li><li><p>I can open up the view variable windows, but see no variables there, how do I add them into that so I can see their values, are they only they only visible if I add a line breakpoint? btw, what's the function key to step to next breakpoint?</p></li></ol>","440279","","","","","2010-09-06 01:27:18","Eclipse and Android development - a few noob questions","<java><android><eclipse><console>","1","0","","",""
"3648740","1","","","2010-09-06 02:39:42","11","2772","<p>I created a custom background image and wanted to use it as the background for a layout that has height of <strong>wrap_content</strong>.  However, the total height of the contents of within that layout are much less than the height of the background image.</p><p>When I set it as the background in XML via <strong>android:background=""@drawable/image""</strong>, I noticed that it displays the entire height of the image, although the height of the actual contents are much shorter.</p><p>Is there a way to stop this from happening?</p><p>Thanks.</p>","440308","","","","","2012-09-17 12:24:48","Background image for wrap_content","<android><image><graphics><layout><background>","3","0","0","",""
"3648758","1","6239946","","2010-09-06 02:47:08","9","19701","<p>I am working with Android OS to try to stream from an M3U. I don't see why this is a big deal on Android, but for some reason it is. The M3U structure is simple, it's essentially a list of URLs to external MP3 files. However, when you click the M3U in the browser, it tries to launch and then tells me that it's an unsupported file type.</p><p>MP3 is documented as being a supported streaming protocol:<a href=""http://developer.android.com/guide/appendix/media-formats.html"">http://developer.android.com/guide/appendix/media-formats.html</a></p><p>This works flawlessly on the iPhone. I'd really like to believe that ""Droid does"" (as they advertise) and I don't want to hate on it too hard, but why isn't a simple M3U even supported?</p><p>Is there an external app that supports these that has to be installed first?</p><p>Thanks to anyone who can shed a little light on this subject. All I have to test with is the emulators currently, but my friends with devices can confirm that this is not working.</p>","97964","","","","","2014-03-20 00:44:57","Streaming from M3U on Android","<android><streaming><m3u>","4","0","6","",""
"3648787","1","","","2010-09-06 03:00:30","0","2704","<p>I have tried adding a grid view to a custom dialog. When displaying the dialog it crashes.<br>But when tried displaying the grid view in normal activity it was working.( without dialog )<br>I took the examples from developer android website.Took grid view and tried to integrate in custom dialog.<br>I used two xml main.xml &amp; category.xml.<br>Here is my code:</p><pre><code>package com.android.test;   import android.app.Activity;   import android.app.AlertDialog;   import android.app.Dialog;   import android.content.Context;   import android.os.Bundle;   import android.view.LayoutInflater;   import android.view.View;   import android.view.ViewGroup;   import android.view.View.OnClickListener;  import android.widget.AdapterView;    import android.widget.BaseAdapter;   import android.widget.Button;   import android.widget.GridView;   import android.widget.ImageView;   import android.widget.TextView;   import android.widget.Toast;   import android.widget.AdapterView.OnItemClickListener;   public class test extends Activity {       /** Called when the activity is first created. */       public final static int CATEGORY_ID=0;       public void onCreate(Bundle savedInstanceState) {           super.onCreate(savedInstanceState);           setContentView(R.layout.main);           Button button = (Button)findViewById(R.id.categories);           button.setOnClickListener(new Button.OnClickListener(){               public void onClick(View v) {                                   showDialog(CATEGORY_ID);               }           });       }       protected Dialog onCreateDialog(int id) {           Dialog dialog;           switch(id) {           case CATEGORY_ID:                   AlertDialog.Builder builder;                   AlertDialog alertDialog;                   Context mContext = this;                   LayoutInflater inflater = (LayoutInflater)   mContext.getSystemService(LAYOUT_INFLATER_SERVICE);                   View layout = inflater.inflate(R.layout.categorydialog,                                                  (ViewGroup)   findViewById(R.id.layout_root));                   TextView text = (TextView) layout.findViewById(R.id.text);                   text.setText(""Hello, this is a custom dialog!"");                   ImageView image = (ImageView)   layout.findViewById(R.id.image);                   image.setImageResource(R.drawable.find);                   GridView gridview = (GridView) findViewById(R.id.gridview);              gridview.setAdapter(new ImageAdapter(this));               gridview.setOnItemClickListener(new OnItemClickListener()   {                   public void onItemClick(AdapterView&lt;?&gt; parent, View v,   int position, long id) {                       Toast.makeText(test.this, """" + position,   Toast.LENGTH_SHORT).show();                   }               });                   builder = new AlertDialog.Builder(mContext);                   builder.setView(layout);                   dialog = builder.create();               break;           default:               dialog = null;           }           return dialog;       }       public class ImageAdapter extends BaseAdapter {           private Context mContext;           public ImageAdapter(Context c) {               mContext = c;           }           public int getCount() {               return mThumbIds.length;           }           public Object getItem(int position) {               return null;           }           public long getItemId(int position) {               return 0;           }           // create a new ImageView for each item referenced by the   Adapter           public View getView(int position, View convertView, ViewGroup   parent) {               ImageView imageView;               if (convertView == null) {  // if it's not recycled,   initialize some attributes                   imageView = new ImageView(mContext);                   imageView.setLayoutParams(new   GridView.LayoutParams(85, 85));   imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);                   imageView.setPadding(8, 8, 8, 8);               } else {                   imageView = (ImageView) convertView;               }               imageView.setImageResource(mThumbIds[position]);               return imageView;           }           // references to our images           private Integer[] mThumbIds = {                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find,                   R.drawable.info, R.drawable.find           };       }   } </code></pre><p>main.xml   </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;   &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/   android""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:padding=""3dip""                 android:orientation=""vertical""&gt;   &lt;Button android:id=""@+id/categories""   android:layout_width=""150dip""   android:layout_height=""wrap_content""   android:layout_gravity=""right""   android:text=""Choose categories""   /&gt;   &lt;/LinearLayout&gt;   </code></pre><p>categorydialog.xml   </p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/   android""                 android:id=""@+id/layout_root""                 android:orientation=""vertical""                 android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:padding=""10dp""                 &gt;       &lt;ImageView android:id=""@+id/image""                  android:layout_width=""wrap_content""                  android:layout_height=""fill_parent""                  android:layout_marginRight=""10dp""                  /&gt;       &lt;TextView android:id=""@+id/text""                 android:layout_width=""wrap_content""                 android:layout_height=""fill_parent""                 android:textColor=""#FFF""                 /&gt;   &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/gridview""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""       android:columnWidth=""90dp""       android:numColumns=""auto_fit""       android:verticalSpacing=""10dp""       android:horizontalSpacing=""10dp""       android:stretchMode=""columnWidth""       android:gravity=""center""   /&gt;   &lt;/LinearLayout&gt;   </code></pre><p>Could anyone please help me out here.</p>","436689","","244296","","2010-09-06 04:31:34","2012-12-13 09:14:12","gridview in custom dialog not working...?","<android>","1","0","","",""
"3648840","1","","","2010-09-06 03:20:59","2","4691","<p>Hi I'm adding section headers for my listView, there are few methods on the web. Since I'm using simpleCursorAdapter to manage my listView, I adopted phil bogle's method. <a href=""http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/"" rel=""nofollow"">http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/</a> </p>The error occurred at this part of the code: </p><pre><code>    listAdapter.setViewBinder( new SimpleCursorAdapter.ViewBinder()    {        public boolean setViewValue(View view, Cursor cursor, int                                   columnIndex)        {              if (columnIndex == nDateIndex) {                if (isHeaderVisible(cursor)) {                    view.setVisibility(View.VISIBLE);                     prevDate = dateString;                    ((TextView) view).setText(dateString);                } else {                    ((TextView) view).setText("""");                    view.setVisibility(View.GONE);                }                return true;            }            return false;        }    });</code></pre><p>This is the LogCat shows how they compare while I scroll up the list:  </p><pre><code>09-06 11:06:43.460: INFO/System.out(563): Sun, 05 Sep 2010 11:41:53  (dateString)09-06 11:06:43.460: INFO/System.out(563): Wed, 01 Sep 2010 21:58:06  (preDate)09-06 11:06:43.460: INFO/System.out(563): 120.0                      (record)09-06 11:06:43.820: INFO/System.out(563): Sun, 05 Sep 2010 17:47:26  (dateString)09-06 11:06:43.820: INFO/System.out(563): Sun, 05 Sep 2010 11:41:53  (preDate)09-06 11:06:43.820: INFO/System.out(563): 112.0                      (record)</code></pre><p>The correct output should be:<br>     <strong>Sun, 05 Sep 2010</strong><br>     <strong>112<br>     120</strong> </p><p>But when I scroll up, the setViewValue calls 120 first and compare with preDate(show above), it becomes:<br>    <strong>Sun, 05 Sep 2010<br>    112<br>    Sun, 05 Sep 2010<br>    120</strong>  </p><p>So how can I make the section headers fixed after creating the headers? Why setViewBinder been called while scrolling? Any suggestions on this? Thanks!      </p>","394815","","508666","","2014-01-12 03:20:30","2014-01-12 03:20:30","ListView with section header problem","<android><listview><header>","3","0","0","",""
"3648942","1","3649053","","2010-09-06 04:05:03","17","11580","<p>How can I do this:</p><p>I'm trying to find a way to open resources which name is determined at runtime only.</p><p>Let me explain in more details</p><p>I want to have a XML that references a bunch of other XML files in the application apk.</p><p>For the purpose of explaining let's say the main XML is main.xml and the other XML are file1.xml file2.xml, fileX.xml.</p><p>What I want is to read main.xml, extract the name of the XML I want (fileX.xml) for example. And then read fileX.XML.</p><p>The problem I face is that what I extract form main.xml is a string and I can't find a way to change that to R.raw.nameOfTheFile</p><p>Anybody has an idea?</p><p>I don't want to:</p><ul><li>regroup everything in one huge XML file</li><li>hardcode main.xml in a huge switch case that links a number/string to the resource ID</li></ul>","440336","","815724","","2013-04-12 14:51:00","2013-04-12 14:51:00","Dynamic Resource Loading Android","<android>","2","1","13","",""
"3649095","1","3651319","","2010-09-06 04:55:51","3","640","<p>I would like to know more about the extent it is possible to control where each Scala actor is running. I happen to be in a somewhat particular case : high reactivity is desired, a good part of the code is time-critical, and worst of all, I'm on Android. With this in mind, my main goal is : make the code as readable and straightforward as possible.</p><p>What I would ideally want to achieve (some of those sound unreasonable/downright stupid at first, read rationales below)<br>- I would like to be able to respond to some messages in some particular, always the same, arbitrary thread, but I need to not be blocking it to wait for messages.<br>- I would like to have most my processing done on a pool of worker threads, ideally auto-resizing as Scala actors support, while guaranteeing this processing will never take place on the arbitrary thread above.</p><p>These requirements stem from an Android necessity : the Android framework uses a special thread to touch UI, and if you touch any UI object from another thread you get an exception. In this way, it enforces some sort of threads/lock model which is exactly what I'm trying to work around. But anyway, that's the way it is : I have to ensure some of my processing, namely what is dealing with UI objects, is running on this thread and no other, because the framework annoyingly says that's how I should do it.An annoying side effect of this is as long as this thread is processing my code the UI stops updating and my application stops being responsive. So I need to ensure that this thread does not get randomly selected for long-running code I could have in some react{}, and ideally that it never processes something that may as well have be done by another thread.</p><p>The android framework provides a class called Handle, which implements some kind of message passing - you send it a Runnable, and it will run on the UI thread. I can use that if I need to. Creating a Runnable each and every time significantly clutters the code - one thing that can be done would be to encapsulate it in some method so that I could write something like<br>    onUIThread { /* some code */ }<br>...which is much nicer than new Runnable() { def run () {}}. On the other hand, that's basically what the onUIThread function would be doing, so I'd be creating two closures - and then I'd have to deal with the details of memory allocation for closures. I'd have to, because each time I allocate an object, the GC gets a chance to run and on Android that's usually a 150ms pause in execution, which will ruin my user experience if it's happening in a critical execution path.</p><p>So in the end :<br>- Do I have any way of statically associating an actor with a thread, so that I could have a UI actor, react{} inside it and always have its code run on the UI thread ? /* I know it's bad design on its own, read the rationale above to see why I can't help it */<br>- Do I have any way of ensuring this particular thread will never be considered for responding to a message in a react{} ?- Any suggestions of what I could do, given my constraints, to get better code legibility ?</p>","440355","","","","","2010-09-06 12:11:09","Scala actors thread control","<android><scala><actor>","1","0","2","",""
"3649164","1","3649235","","2010-09-06 05:16:33","1","698","<p>I am making an application that fetches data from internet like web service,so it requires internet connection.</p><p>So when i first click on my application, If internet connection is not available it should show me dialog that Internet connection not available get it connected.And if connection is available then it should be able to work fetch data from internet.</p><p>Can anybody guide me how to check if internet connection is available or not?  </p>","1386533","","","","","2010-09-06 05:35:18","Android: Internet Accesing Application","<android>","1","0","1","",""
"3649190","1","3649277","","2010-09-06 05:23:03","4","627","<p>I've been developing applications for a long time now, but now I want to jump into Phone applications development. There are four main candidates:</p><ol><li>Nokia's Symbian</li><li>Apple's iPhone</li><li>Google's Android</li><li>Microsoft Windows Mobile Phone</li></ol><p>Can anyone suggest one, considering documentation, market, samples and availabilty of emulators, I'm not a millionaire so I can't buy it unless I know it would mean profits!</p><p>I don't have much preferences as for languages, but to stay within C# would be nice, however I've been thru Assembler for a long time, so it's hard to scare me :)</p>","420447","","138120","","2010-09-06 06:47:02","2010-09-07 06:15:30","Beginning Phone Applications Development","<iphone><android><windows-mobile><symbian><windows-phone-7>","7","0","1","",""
"3649312","1","3748645","","2010-09-06 05:52:01","1","619","<p>Hello In my android application i am using a table with scrollview.I am giving the user a service suchthat if the user clicks on a row and say delete the row gets deleted from the table.But after this deletion i want the table to get refreshed and load only the fresh data from database.</p><p>Could anyone please let me know how can i refresh the table or refresh the page in android?</p><p>Please share your valuable suggestions .</p><p>Thanks in advance :)</p>","420261","","","","","2010-09-20 04:03:38","refresh the table in android","<android>","2","0","","",""
"3649363","1","","","2010-09-06 06:11:17","3","3880","<p>it seems that I'm not the first one, but I don't find anything that helps. I'm new to Android and would like to develop a real simple photo sharing app (three tabs: camera, gallery and upload to Picasa) to start off. Unfortunately the <a href=""http://code.google.com/p/gdata-java-client/"" rel=""nofollow"">Google Data APIs for Java</a>, don't run on Android and I didn't find a good tutorial for the newer <a href=""http://code.google.com/p/google-api-java-client/"" rel=""nofollow"">Google Data API</a>. I also couldn't get the <a href=""http://samples.google-api-java-client.googlecode.com/hg/picasa-atom-android-sample/instructions.html"" rel=""nofollow"">Android Picasa sample</a> to run: Eclipse complains about a buildpath error, but doesn't show what exactly is wrong.</p><p>I'm looking for an easy tutorial how to use Picasa with Android. Anyone has some kind of ""middleware classes"" between the old and the new API which one can use. How do I fix the buildpatj problem to run the sample or how in general can I import external JARs to my Android project.</p>","440387","","83406","","2010-09-21 17:36:10","2012-08-14 09:25:34","Accessing Picasa from Android - Google Data APIs","<android><google-api><picasa><google-api-java-client>","1","3","2","",""
"3649401","1","3649439","","2010-09-06 06:20:54","0","562","<p>I have an application where I try to get address of a location based on the latitude,longitude coordinates.When I try to print all the address of particular coordinates , I am getting only single address. IS there any way to get the list of all addresses for the coordinates supplied . My code snippet is as below:</p><p>Where locationLatitude,locationLongitude are of type String which are converted to doubles </p><p>*<strong><em>List addresses = geoCoder.getFromLocation(Double                .parseDouble(locationLatitude), Double.parseDouble(locationLongitude), 1);        StringBuffer  addressAsString  = new StringBuffer("""");            if(!addresses.isEmpty()){        for (int i = 0; i &lt; addresses.get(0).getMaxAddressLineIndex(); i++)        addressAsString.append(addresses.get(0).getAddressLine(i) + ""\n"");                      return addressAsString.toString() ;</em>*</strong></p><p>I will be waiting for any reply.Thanks in Advance.</p>","429501","","","","","2010-09-06 06:31:44","How to get addresses if we give latitude and longitude using location API in Android","<android><android-widget>","2","1","","",""
"3649436","1","3649470","","2010-09-06 06:28:55","0","478","<p>I have people complaining my application gets FC when they launch it (meanwhile others never had a single problem). Here is my full activity source. Since it happens on devices I don't own I can not fix it. From what they tell me it doesn't work on: Motorola Blackflip, Motorola Dext, Motorola CLIQ XT. Guess Motorola doesn't like my app after all...</p><p>Could it be that I allow a minSdkVersion=""3""? I tested 1.5 on the emulator and worked fine...</p><p>Thank you in advance for your responses. </p><pre><code>public class workit extends Activity implements OnClickListener { Button yay; Button yay0; Button yay1;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,        WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.main);        yay = (Button) findViewById(R.id.gostart);        yay.setOnClickListener(this);        yay0 = (Button) findViewById(R.id.dontstart);        yay0.setOnClickListener(this);        yay1 = (Button) findViewById(R.id.exit);        yay1.setVisibility(ImageView.GONE);        ImageView inizio = (ImageView)findViewById(R.id.start);                                                inizio.setVisibility(ImageView.VISIBLE);        inizio.setBackgroundResource(R.drawable.start);    } public void onClick(View v) {  // TODO Auto-generated method stub     if (v == yay0) {      finish();  }     if (v == yay) {   ImageView inizio = (ImageView)findViewById(R.id.start);   inizio.setVisibility(ImageView.GONE);   WebView work = new WebView(this);   setContentView(work);   work.loadUrl(""file:///android_asset/index1.html"");   work.setWebViewClient( new work());    work.setBackgroundColor(0);   work.getSettings().setBuiltInZoomControls(true);   work.getSettings().setDefaultZoom(ZoomDensity.FAR);  }     if (v == yay1) {      finish();  }    }    private class work extends WebViewClient {             @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            if (url.contains(""exit.html"")) {             // TODO: do what you have to do             finish();            }            view.loadUrl(url);            return true;        }    } }</code></pre>","383576","","","","","2010-09-06 06:36:25","My app gets ""Force close"" on several devices","<android><onclick><webview><imageview>","1","3","","",""
"3649437","1","","","2010-09-06 06:29:15","1","245","<p>Hey all,    Does anyone know of an IDE for editing files such as PHP, HTML, and CSS through a SFTP connection? I  have both an android device and an iOS (version  3, that is) device, and the only result I get for an application like this in both marketplaces is in the App Store. It didn't seem particularly appealing (also, it required an iOS 4 upgrade), and i'd prefer something for my android device (it has a hardware keyboard). Is there such a thing out there?</p><p>Thanks.</p>","433380","","","","","2011-11-28 19:59:25","An IDE in my pocket?","<android><ide><ios>","1","4","","",""
"3649446","1","3649462","","2010-09-06 06:31:17","0","695","<p>Is there any way to access the a database server directly in Android? If not, why? Also, are there any external tools for this?</p>","267269","","23897","","2010-09-06 06:36:22","2010-09-06 06:36:22","Is there any possible way to access a database server directly in Android?","<sql-server><android>","1","0","","",""
"3649523","1","","","2010-09-06 06:47:17","0","770","<p>I am currently working on an application in android where I need to call the Web Service. I am working in Android and I don't have an idea about how to call a web Service in Android.</p><p>So, can anybody please help me out in how to call a Web Service in Android Programming.</p><p>Thanks,david</p>","422859","","","","","2010-09-06 06:54:55","Calling a Web Service in Android","<android>","1","0","","",""
"3649534","1","3663943","","2010-09-06 06:49:26","0","1210","<p>For some reason, the text has 0 width in the second row.</p><p><img src=""http://i.stack.imgur.com/PGmLs.png"" alt=""alt text""></p><p>Code:</p><pre><code>public LinearLayout getView(int position, View convertView, ViewGroup parent){    LinearLayout rowView;    if(convertView==null){        rowView=(LinearLayout) mActivity.getLayoutInflater().inflate(R.layout.icon_list, null);    }else{!        rowView=(LinearLayout) convertView;    }    //Image view    ImageView imageView=(ImageView) rowView.findViewById(R.id.list_icon);    Pair&lt;String,Bitmap&gt; p=getItem(position);    imageView.setImageBitmap(p.second);    //Text view    TextView textView=(TextView) rowView.findViewById(R.id.list_text);    textView.setText(""AAAA"");    return rowView;}</code></pre><p>XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""20dip""    android:id=""@+id/icon_list""    android:padding=""6dip""&gt;    &lt;ImageView android:id=""@+id/list_icon""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_marginRight=""6dip""        android:layout_gravity=""left""/&gt;    &lt;TextView android:id=""@+id/list_text""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:gravity=""center_vertical""/&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>EDIT:</strong></p><p>Before I had accidentally left in the line. </p><pre><code>android:src=""@drawable/icon""</code></pre><p>I removed it, but the problem remains</p>","165495","","165495","","2010-09-07 00:44:21","2010-09-08 01:14:18","Android Listview - first item is different","<android><listview>","1","2","1","",""
"3649621","1","3649693","","2010-09-06 07:03:02","1","876","<p>I have an application where I try to get address of a location based on the latitude,longitude coordinates.When I try to print all the address of particular coordinates , I am getting only single address. IS there any way to get the list of all addresses for the coordinates supplied . My code snippet is as below:</p><p>Where locationLatitude,locationLongitude are of type String which are converted to doubles. Address is a class which has getters and setters methods for getting details of state,city,country etc.  </p><pre><code>List&lt;Address&gt; addresses = geoCoder.getFromLocation(Double.parseDouble(locationLatitude),Double.parseDouble(locationLongitude), 1);StringBuffer  addressAsString  = new StringBuffer("""");if(!addresses.isEmpty()){    for (int i = 0; i &lt; addresses.get(0).getMaxAddressLineIndex(); i++)        addressAsString.append(addresses.get(0).getAddressLine(i) + ""\n"");    return addressAsString.toString();}</code></pre>","429501","","47773","","2010-09-06 07:24:37","2010-09-06 07:24:37","How to get addresses if we give latitude and longitude using location API in Android","<android><android-widget><reverse-geocoding>","1","1","1","",""
"3649780","1","","","2010-09-06 07:42:38","0","1161","<p>I need to change my profile to silent, pager or ringing based on the location(the location is set as home or office based on geo information) so when ever phone is at that location it would change to that profile automatically.</p>","440424","","158304","","2011-03-14 21:10:34","2012-04-11 07:10:20","Android-MobileProfiles: How to change Profile to silent or ringer automatically, on a change of mobile location?","<android>","2","0","","",""
"3649803","1","","","2010-09-06 07:47:09","0","171","<p>Can anyone please tell me what is Message ID and how to retrieve that ID to implement in program for twitter application</p>","410871","","133203","","2010-09-06 07:51:22","2011-05-13 21:39:09","Twitter Application","<android><twitter>","1","0","","",""
"3649814","1","3649917","","2010-09-06 07:50:07","4","8971","<p>could anyone give me a httpPut request example code?</p>","422405","","","","","2010-09-06 09:03:50","Android HttpPut example code","<android>","1","0","7","",""
"3649892","1","3649916","","2010-09-06 08:05:24","0","190","<p>I am new to android. I want to set OnclickListner for different buttons which are located in different xml layouts.</p>","436765","","","","","2010-09-06 08:11:27","How can set onClickListner fo buttons..?","<android>","2","1","","",""
"3649972","1","","","2010-09-06 08:23:14","1","464","<p>The documentation says : ""the roll represents the device's sideway tilt between -90 and 90 degrees on the X-axis. The tilt angle is 0 degrees when the device is flat on its back, -90 degrees when the screen faces left, and 90 degrees when the screen faces right.""but on my two phones (HTC magic and HTC desire), I've got positive degrees when I turn the phone toward the left side and negative toward the right. </p><p>Who's wrong ? </p>","164460","","","","","2010-09-06 08:23:14","android sensormanager roll angle","<android><sensor>","0","0","","",""
"3649973","1","3650040","","2010-09-06 08:23:24","1","289","<p>I need third party applications (""Foo"") to get information from my application (""Bar""), but my solution so far seems cumbersome:</p><ul><li>Application Foo needs information from Bar and sends a broadcast (""bar.POLL"").</li><li>Application Bar listens for this broadcast, and replies with another broadcast (""bar.PUSH"");</li><li>Foo listens for bar.PUSH and reads the contents of the included Bundle.</li></ul><p>Is there a more direct way to do this?</p><p><strong>EDIT</strong>: I solved it with an extremely simplistic ContentProvider as <a href=""http://stackoverflow.com/questions/3649973/how-do-i-ask-for-information-from-another-android-application/3650040#3650040"">Guido</a> suggested:</p><pre><code>public class MyProvider extends ContentProvider {  private String state = """";  @Override  public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {    MatrixCursor cursor = new MatrixCursor(new String[]{""state""});    cursor.addRow(new Object[]{state});    return cursor;  }  @Override  public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {    state = (String) values.get(""state"");    return 1;  }  @Override  public boolean onCreate() {    return true;  }  @Override  public String getType(Uri uri) {    return null;  }  @Override  public Uri insert(Uri uri, ContentValues values) {    return null;  }  @Override  public int delete(Uri uri, String selection, String[] selectionArgs) {    return 0;  }    }</code></pre><p>Remember to add the provider to the manifest:</p><pre><code>&lt;provider android:name="".MyProvider"" android:authorities=""com.example.hello"" /&gt;</code></pre><p>Update the state from an Activity like this:</p><pre><code>ContentValues cv = new ContentValues();cv.put(""state"", ""myNewState"");getContext().getContentResolver().update(Uri.parse(""content://com.example.hello""), cv, null, null);</code></pre><p>Get content from the provider in the external app:</p><pre><code>Cursor cur = managedQuery(Uri.parse(""content://com.example.hello""), null, null, null, null);if (cur.moveToFirst()) {  String myContent = cur.getString(0);}</code></pre>","13365","","13365","","2010-09-06 14:24:53","2010-09-06 14:24:53","How do I ask for information from another Android application?","<android><rpc><broadcastreceiver><android-intent>","1","1","1","",""
"3650011","1","","","2010-09-06 08:30:29","0","1490","<p>I am working on an Android Application where I need to display log information when I execute the .apk file in release mode based on some condition.It can be like below:</p><pre><code>if(debug)   display log inf.else  normal execution</code></pre><p>I will set this variable to true to enable debug mode to display log information.Can anyone help me in achieving this feature.</p><p>Thanks In Advance.</p>","429501","","225667","","2010-09-06 08:37:03","2010-09-17 03:23:16","How to Enable Logging in Android programatically","<android><logging><android-widget>","1","0","","",""
"3650250","1","3732163","","2010-09-06 09:11:10","1","192","<p>I have an Android Application which uses JNI calls. Now i want this application to boot with the Android OS(i.e. my application should compile with Android OS . I'm using Intel Atom board for Android compilation.). My Questions are as follows:</p><p>1) Do i follow the same procedure of creating make file and symbolic link with the Android OS NDK folder? If not how do i make JNI calls.? </p><p>2) I'm unable to understand the architecture of Android when i compile my Android Application with the Android OS. Can anyone please explain it? </p>","396437","","","","","2010-09-17 01:47:03","Android run application on OS compilation","<android><jni><android-ndk>","1","0","","",""
"3650272","1","3650302","","2010-09-06 09:14:05","0","4030","<p>Hi I found all things working with alert box,dialog box but when i try creating things with my own custom dialog box it gives me problems. Though i followed the instructions as per the dev guide: <a href=""http://developer.android.com/intl/de/guide/topics/ui/dialogs.html"" rel=""nofollow"">http://developer.android.com/intl/de/guide/topics/ui/dialogs.html</a> i could'nt reach with my results just it displays a force close with the following error message.</p><pre><code>03-04 11:37:08.780: ERROR/AndroidRuntime(726): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</code></pre><p>I have been trying to make my custom dialog box for many days but i couldnt bring it up. I even tried with the solutions that i got on forums but that too doesnt seems of working.    Give me some piece of good code or some suggestion to work with... Any suggestions on this is appreciable.</p>","431655","","","","","2012-04-05 10:53:42","Create custom dialog box in Android","<android><customdialog>","1","0","","",""
"3650316","1","","","2010-09-06 09:20:14","1","264","<p>I was curious about the nature of the <code>handleMessage()</code> and <code>sendMessage()</code> behavior of the <a href=""http://developer.android.com/reference/android/os/Handler.html"" rel=""nofollow""><code>Handler</code></a> class. I want to be able to send message to another thread in such a way that the destination thread can process the message queue when it wants to. It seems, however, that the message is processed by <code>handleMessage()</code> practically as soon as it's sent.</p><p>I'm trying to design a game loop thread that does something like this:</p><pre><code>void run(){   while (gameIsActive){     handleInput();     updateGameState();   }}handleInput(){  //Remove an item from the handler's message queue  //which can be UI events (click, touch, etc.)}</code></pre><p>However, I as soon as sendMessage() is called (from the parent/calling thread), the Handler.handleMessage() is processed (in the child/receiving thread), even if the child/receiving thread is blocking in a while loop. </p><p>I've seen this problem solved in other games by using a thread-safe list (<code>ConcurrentLinkedQueue</code>). The UI thread just posts events to this queue, and the game loop can remove the events as it seems fit. I just assumed the Handler class was designed for this purpose. It seems it's more intended for asynchronous callbacks to the parent thread. </p>","428100","","","","","2010-09-19 05:39:04","Handler class and the timing of when its message queue is emptied","<android>","1","0","1","",""
"3650435","1","","","2010-09-06 09:41:36","0","346","<p>I have a txt file in UTF8 format:</p><blockquote>  <p>æ ß ç ð ? h ? ø ? œ ? n d ? b a t d s t b a t d t d t d t ? u e ë l n e e m n l e ß e e e e e é e è ? </p></blockquote><p>I need to show it in Android, but some symbols do not display correctly. </p><p>How can I show all symbols correctly?</p>","440500","","488657","","2013-05-10 11:53:13","2013-05-10 11:53:13","How to correctly display UTF8 characters in Android?","<java><android><utf-8>","2","0","","",""
"3650438","1","","","2010-09-06 09:41:47","1","605","<p>I looked around and although there are many related questions I didn't see one that answers my exact question:</p><p>I would like to create an app that runs in the background that provides the <em>exact same</em> functionality as the hard coded 'Back' button in <em>all cases</em>. </p><p>The reason? I (for example) have a Droid X, and it is BIG. it makes it extremely hard to use one-handed and having a swipe gesture function as a back button (like in Palm Pre for example) would <em>greatly</em> increase the ease of use. </p><p>as far as I'm concerned the app could just be one simple class that contains:1) a listener for the 'back' swipe 2) a call to the physical hard button itself</p><p>Is this possible? are there built in APIs for the hard coded buttons that would allow me to call them without actually pressing them? </p><p>Again - I'm not interested in overriding the button, I'm interested in making a software call to it - or failing that, in emulating it's behavior in <em>any and all states and other apps</em>!</p><p>Please forgive the naivete of this post. I am a very novice programmer and really I just want to know whether this is possible before I start to devote myself to trying to build it.</p><p>Thank you,b</p>","362774","","","","","2010-09-06 09:48:41","android - possible to make a user action emulate the hardware 'Back' button?","<android>","1","1","","",""
"3650470","1","","","2010-09-06 09:47:26","0","716","<p>I am getting an insufficient storage error in android.I have about 100MB of data in my res/raw folder.Is this the reason.PLease anyone give me a solution.I created another AVD 2 but its not workingthe error is still comingPLease help meThanks in advance.</p>","655814","","","","","2011-10-06 11:22:51","Insufficient storage error","<android>","2","0","","",""
"3650550","1","3650570","","2010-09-06 09:59:46","1","120","<p>the problem is that i have two listView but one itemClick method, if i put a switch, the position on one list is the same than the other list... And by example if i want to open a popup on an item in one list, the item in the same position in the other list gonna do the same thing, and i really don't want, can you help me?Thanks</p><p>there is the code :</p><p>public void onItemClick(AdapterView parent, View v, int position, long id) {        Object str = parent.getId();        if(str.equals(adapter_todo)){            switch(position){            case 0 : new AlertDialog.Builder(this).setTitle(""test"").setMessage(""blah blah"").setNeutralButton(""close"", new DialogInterface.OnClickListener() {</p><pre><code>            @Override            public void onClick(DialogInterface dialog, int which) {                // TODO Auto-generated method stub            }        }).show();        case 1 :        case 2 :        case 3 :        case 4 :        case 5 :        case 6 :        case 7 :        case 8 :        case 9 :        case 10 :        }    }    else if(str.equals(adapter_not_todo)){        switch(position){        case 0 : new AlertDialog.Builder(this).setTitle(""test 2"").setMessage(""blah blah blah"").setNeutralButton(""close"", new DialogInterface.OnClickListener() {            @Override            public void onClick(DialogInterface dialog, int which) {                // TODO Auto-generated method stub            }        }).show();        case 1 :        case 2 :        case 3 :        case 4 :        case 5 :        case 6 :        case 7 :        case 8 :        case 9 :        case 10 :        }    }</code></pre>","439058","","439058","","2010-09-06 15:25:01","2010-09-06 15:25:01","I've got two list but one itemclick method","<android><list><listview><selecteditem>","1","0","","",""
"3650559","1","","","2010-09-06 10:01:28","0","738","<p>How can i use 3G network to run application that makes use of internet.i have make use of wi-fi, but not getting how to set preferance for 3G.</p><p>Any help.</p><p>here is the code i have used for wifi.</p><p>final ConnectivityManager connMgr = (ConnectivityManager)    getSystemService(Context.CONNECTIVITY_SERVICE);</p><p>final android.net.NetworkInfo wifi =                     connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);</p><p>Any help that how can i come to know whether 3G is available or not?if(wifi.isAvailable()){    Toast.makeText(Main.this,""Connected to wifi"",Toast.LENGTH_SHORT).show();    Intent intent =new Intent (Main.this, Myapplicationclass.class);    startActivity(intent);}</p><pre><code>                 }</code></pre>","1386533","","","","","2010-09-06 10:44:27","android:3G and GPRS","<android>","1","0","1","",""
"3650580","1","3650653","","2010-09-06 10:06:20","3","635","<p>I wrote an android application and after I run it, it occurs twice in main menu. I mean, there are two icons for this application, but only one could be open.</p><p>If I deinstall this application, I find only one entry in the application list.</p><p>It's the same, if application's running in simulator or on phone. And I don't have this problem with my other applications.</p><p>Any ideas???</p><p>Thanks a lot in advance.</p><p>Mur</p>","408780","","","","","2011-09-10 23:01:30","Android application occurs twice in main menu","<android>","1","0","","",""
"3650633","1","3650941","","2010-09-06 10:15:17","1","5723","<p>How to play video present in local file system (ex:in res/a.3gp) using VideoView .I need Sample code.I am trying to play as below:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.MediaController;import android.widget.VideoView;public class videoSample extends Activity {      /** Called when the activity is first created. */      String path=""D:/mApp2/videoSample/res/drawable-hdpi/adf.mp4"";     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);        setContentView(R.layout.main);        VideoView videoView = (VideoView) findViewById(R.id.VideoView01);        MediaController mediaController = new MediaController(this);        mediaController.setMediaPlayer(videoView);        videoView.setVideoPath(path);           videoView.setMediaController(mediaController);        videoView.requestFocus();        videoView.start();        mediaController.show();    }}</code></pre><p>I am getting error as Video cant be played.Can any one help me in sorting out this issue?Thanks in Advance.</p>","429501","","302328","","2010-11-23 06:26:16","2012-09-28 17:43:42","Playng video file present in Local File System in Android","<android><android-emulator>","3","1","","",""
"3650675","1","3650882","","2010-09-06 10:20:30","0","1469","<p>i want to create reminder application...I am using Notification Manager...I am using this line as instantiate of Notification...</p><pre><code>long when=sdf.parse(""09 06 2010 15:45:00"");Notification notifyDetails = new Notification(R.drawable.reminder_1,""Reminder"",when.getTime());</code></pre><p>I need to start the notification at specified time...but here it is notification started immediately when i gave the date...and also help  me to show multiple notification</p>","421645","","","","","2012-04-23 11:55:31","multiple Notification in android","<android>","2","0","","",""
"3650863","1","3651148","","2010-09-06 10:50:23","1","5596","<p>I want to listen to touch events for a viewFlipper. I've been able to listen to touch events in my activity and then modify the viewFlipper but these events are fired wherever the user is within the activity and I need to capture touch events specifically on the viewFlipper. I have tried adding setOnTouchListener but it is not called. I'm assuming the viewFlippers children (webviews) are 'consuming' the touch events. </p><p>One solution would be to setOnTouchListener's to each of the webviews but this feels like a hack. Does anyone know another way?</p><p>Thanks,</p><p>Ian</p><p>Sorry if this is a double post - but my previous post seems to have vanished.</p>","440556","","","","","2012-12-03 03:54:55","setOnTouchListener not called on ViewFlipper","<android><android-widget>","3","3","","",""
"3650868","1","3650897","","2010-09-06 10:51:59","-2","3717","<p>as i am facing problem here: <a href=""http://stackoverflow.com/questions/3584297/installing-application-on-sd-card-in-android-sdk-2-2"">http://stackoverflow.com/questions/3584297/installing-application-on-sd-card-in-android-sdk-2-2</a> , regarding application installation.</p><p>In above question, you can view the image in which ""Internal Phone Storage"" is showing where only 43.38 MB is showing , and in latest android phone, i know it is coming with higher space, i have seen 13.45 GB in Samsung Galaxy Android Phone.</p><p>But Right now, i am using HTC Hero, so my questions are:</p><ol><li>is there any way to increase ROM size without any side-effect?</li><li>How do i increase ROM Size?</li></ol>","379693","","","","","2013-06-29 13:10:30","Android - Increase ROM Size","<android>","3","0","1","",""
"3650935","1","3650971","","2010-09-06 11:06:56","0","120","<p>I want to do xml parsing of finding the ""Humidity"", ""Current Temperature"" and the ""Icon"" of the temperature(a SUN) in my android application.</p><p>Can anybody please help me? </p>","422859","","119895","","2010-09-06 11:09:52","2010-09-06 11:13:44","Parsing in Android","<android><xml-parsing>","1","3","","",""
"3650985","1","","","2010-09-06 11:15:49","0","1321","<p>In my app , am traping sms . and i have to send an image and text ,to whover sent me an sms , saying that i was busy or some thing ? I did my job with sms is fair and good . But when i am sending mms , i cant send it directly from code unlike sms. ? can any one sort out this problem ?</p>","414777","","","","","2010-09-06 11:28:52","How to send MMS in android behind the scene i.e; programmatically?","<android><sms>","1","0","","",""
"3651048","1","","","2010-09-06 11:26:42","1","2005","<p>I'm trying to force download a image file (jpg for example) using php. So I have a script here <strong>force.php</strong> and here would be the code:</p><pre><code>header(""Pragma: public""); // requiredheader(""Expires: 0"");header(""Cache-Control: must-revalidate, post-check=0, pre-check=0"");header(""Cache-Control: private"",false); // required for certain browsersheader('Content-Description: File Transfer');header(""Content-Type: image/jpeg"");header('Content-Length: ' . filesize($file));header('Content-Disposition: attachment; filename=test.jpg');readfile($file);</code></pre><p>Now the problem is for some browsers (mobile phone browsers especially), it'll work properly and prompt test.jpg for the user to save. However on some browser, it'll prompt force.php as download. Any solution?</p><p>Thank you!</p>","243832","","","","","2012-01-25 17:01:04","php force download on mobile browsers","<php><android>","2","0","","",""
"3651070","1","","","2010-09-06 11:31:19","2","3716","<p>How can I create a chat-text/VOIP calls application using Android sdk? What are the available apis and sources?</p>","274107","","165414","","2010-09-23 06:24:41","2013-02-14 18:15:16","Adding chat and VOIP calls functionality?","<android><chat><voip><sip><asterisk>","3","0","2","2012-10-21 19:03:25",""
"3651077","1","","","2010-09-06 11:32:16","0","464","<p>Is there any implementation of XQuery known to work with the Android SDK? I tried mxquery, but had no luck. I did not expect it to work as their site says Andriod support comming soon.</p><p>I'm unsing jTidy to parse web pages into XHMTL and am looking for something lite and fast to search, filter and reformat XML files. </p><p>Thanks.</p>","440279","","179850","","2011-02-21 18:44:25","2011-02-21 19:10:48","Android SDK and XQuery?","<java><android><xml><xquery><jtidy>","1","0","1","",""
"3651086","1","3651168","","2010-09-06 11:33:44","70","60099","<p>I applied a custom font to a <code>TextView</code>, but it doesn't seems to change the typeface.</p><p>Here is my code:</p><pre><code>    Typeface myTypeface = Typeface.createFromAsset(getAssets(), ""fonts/myFont.ttf"");    TextView myTextView = (TextView)findViewById(R.id.myTextView);    myTextView.setTypeface(myTypeface);</code></pre><p>Can anyone please get me out of this issue?</p>","435025","","296427","","2012-06-26 08:46:51","2014-03-03 12:59:11","Android - Using Custom Font","<android>","7","5","26","",""
"3651101","1","","","2010-09-06 11:35:37","0","607","<p>Is there any Listener to override methods of Videoview like <br></p><p>boolean  canPause()  <br>boolean  canSeekBackward()  <br></p><p>boolean  canSeekForward()  <br></p><p>int  getBufferPercentage()  <br></p><p>int  getCurrentPosition()  <br></p><p>int  getDuration()  <br></p><p>boolean  isPlaying()  <br></p><p>How to pause a video. For audio we use mediaController.setMediaPlayer. How we can use for video.</p><p>Basically my code for playing video is like this :<br></p><p>mediaController = new MediaController(activity); <br>        mediaController.setMediaPlayer(videoView);  <br>        videoView.setVideoPath(filePath);     <br><br>        videoView.requestFocus();<br>        videoView.start();<br>        mediaController.show();<br>        videoView.setMediaController(mediaController); <br> <br>And also I want to know what is the difference between  mediaController.setMediaPlayer <br>(videoView); and videoView.setMediaController(mediaController). <br>Can Anyone help me in sorting out thi issue.  <bR>Thanks in Advance.</p>","429501","","","","","2011-04-05 19:20:33","How to OverRide some of the methods of VideoView of android","<android><android-widget>","1","0","","",""
"3651197","1","3651241","","2010-09-06 11:51:07","5","2722","<p>Does Android provide smth. like that OR do I have to check every time during start of my app <em>""Oh, am I freshly installed? Do I have to initialize the Shared Preferences now?""</em></p>","433718","","","","","2012-02-22 10:19:06","Android: Set Shared Preferences during Installation?","<android><deployment><sharedpreferences><android-install-apk>","3","0","1","",""
"3651233","1","3651270","","2010-09-06 11:55:42","0","292","<p>is there a way to determine what apps are currently installed on an android device? I guess reading /data/app directory doesn't do the trick (access denied)thanks in advance for your helpregardspeter</p>","289510","","","","","2010-09-06 12:01:58","How to determine apps installed on Android device?","<android>","1","0","2","",""
"3651281","1","","","2010-09-06 12:03:24","3","4358","<p>My requirement is to make an activity which provides user with a screen in which user can input his signs. I want these signs to be then saved as an image in database. Is there any default activity which does similar task. </p>","440432","","493939","","2013-05-22 08:24:22","2013-05-22 08:24:22","Capture users signature in an Android app","<android>","1","3","2","2013-05-22 10:02:09",""
"3651346","1","","","2010-09-06 12:14:43","1","1146","<p>Im currently developing a software under android and im getting quite quickly some OutOfMemoryException.... I did modified some part of my code to use more static variables instead of making new allocation with the ""new"" operator but is there any things else to do ? or any other tips ? Any advices would be welcome.</p><p>Thanks.</p>","429222","","","","","2010-09-07 03:18:35","Tips for saving memory when coding under android?","<android><memory><memory-allocation>","4","0","0","",""
"3651401","1","3656365","","2010-09-06 12:21:41","1","5890","<p>I've got the below screen that contains some images (6 per visible page). Scrolling up and down seems quite laggy to me. It's like it's rendering the images again. Scrolling back up seems worse than scrolling down.</p><p>Anyone know how to increase performance in such an area to create a nice smooth scroll?</p><p><strong>Update</strong>: The images and text is all retrieved from my SQLite database. The list is created using SimpleCursorAdapter.</p><p><img src=""http://i.stack.imgur.com/pMhDh.png"" alt=""Gallery""></p><pre><code>private class HistoryViewBinder implements SimpleCursorAdapter.ViewBinder {    //private int wallpaperNumberIndex;    private int timeIndex;    private int categoryIndex;    private int imageIndex;    private java.text.DateFormat dateFormat;    private java.text.DateFormat timeFormat;    private Date d = new Date();    public HistoryViewBinder(Context context, Cursor cursor)     {        dateFormat = android.text.format.DateFormat.getDateFormat(context);        timeFormat = android.text.format.DateFormat.getTimeFormat(context);        //wallpaperNumberIndex = cursor.getColumnIndexOrThrow(HistoryDatabase.KEY_WALLPAPER_NUMBER);        timeIndex = cursor.getColumnIndexOrThrow(HistoryDatabase.KEY_TIME);        categoryIndex = cursor.getColumnIndexOrThrow(HistoryDatabase.KEY_CATEGORY);        imageIndex = cursor.getColumnIndexOrThrow(HistoryDatabase.KEY_IMAGE);    }    @Override    public boolean setViewValue(View view, Cursor cursor, int columnIndex)     {        Log.d(TAG, ""setViewValue"");        if (view instanceof TextView)        {            Log.d(TAG, ""TextView"");            TextView tv = (TextView) view;            if (columnIndex == timeIndex)            {                Log.d(TAG, ""timeIndex"");                d.setTime(cursor.getLong(columnIndex));                tv.setText(timeFormat.format(d) + ""  "" + dateFormat.format(d));                return true;            }            else if (columnIndex == categoryIndex)            {                Log.d(TAG, ""categoryIndex"");                tv.setText(cursor.getString(columnIndex));                return true;            }        }        else if (view instanceof ImageView)        {            Log.d(TAG, ""ImageView"");            ImageView iv = (ImageView) view;            if (columnIndex == imageIndex)            {                Log.d(TAG, ""imageIndex"");                byte[] image = cursor.getBlob(columnIndex);                Bitmap bitmapImage = BitmapFactory.decodeByteArray(image, 0, image.length);                iv.setImageBitmap(bitmapImage);                return true;            }        }        return false;    }}</code></pre>","149166","","114066","","2012-01-27 08:43:36","2012-01-27 08:43:36","Scrolling through ListView with some images very laggy","<android><performance><android-listview>","3","4","1","",""
"3651463","1","3653783","","2010-09-06 12:31:23","2","3767","<p>My application takes a picture and saves to the sdcard.  It worked fine on Android 2.1, but I just upgraded to Froyo and now I'm getting:</p><pre><code>ERROR/CameraPreview(28216): Problem taking pictureWARN/System.err(28216): java.io.FileNotFoundException: /mnt/sdcard/silviaterra/temp.jpg (Permission denied)WARN/System.err(28216):     at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)WARN/System.err(28216):     at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152)WARN/System.err(28216):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:97)WARN/System.err(28216):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:69)</code></pre><p>When I open up adb shell (as root user), I get:</p><pre><code>$ cd sdcardcd: can't cd to sdcard$ cd mnt/sdcardcd: can't cd to mnt/sdcard</code></pre><p>I've tried killing and restarting the adb server, but no luck.  Any ideas on what's going on?  Thanks!</p>","440630","","995926","","2012-05-05 13:50:35","2012-05-05 13:50:35","Unable to cd do sdcard with adb after update to Froyo","<android><adb><sd-card><android-2.2-froyo>","1","5","","",""
"3651482","1","3651529","","2010-09-06 12:35:24","0","856","<p>I have built a multi-touch application which is based on a Java EE backend and combined with BlazeDS to a Adobe Flex frontend. The application runs on a DIY-Multi-Touch which I built. Now I want to use another solution. The Adobe Flex frontend (with a multitouch library) and the BlazeDS adapter should be replaced by a solution which covers iPhone/iPad, Android and commercial Multi-Touch displays.</p><p>The problem is the iPad/iPhone, there is no Flash Player runtime (not the jail-breaked ones), but the application should be runnable also on those devices. So Adobe Flex and a Java frontend (no JVM on the iPhone/iPad) is not possible anymore. At first, starting the developing of the application it was not neccessary, to run it on Apples mobile devices, but this changed :-(</p><p>So, what can I do, using HTML5? So I can use it for Android and iPhone/iPad. But I also want to make it possible to use it on a commercial multi-touch-display and normal display with a mouse (I only have gestures for one finger, the 2-finger gestures are not neccessary). Are there any frameworks that allow this? Because I do not want to create several frontends (App for iPhone/iPad on Objective-C and a Adobe Flex for all other devices), it would be great if I can build a frontend for all devices.</p><p>Does anyone know how I could realize this?</p><p>Best Regards Tim</p>","224030","","","","","2010-09-06 12:48:32","One frontend for iPhone/iPad, Android and Multi-Touch displays","<iphone><android><flex><ipad><html5>","2","4","","",""
"3651497","1","","","2010-09-06 12:37:14","5","2432","<p><strong>How does Android determine whether to move the layout up when showing the softkeyboard?</strong></p><p>Note: I am aware that the activity property <code>android:windowSoftInputMode=""adjustResize|adjustResize|adjustUnspecified""</code>exists, as described here <a href=""http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft"">http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft</a>, but in my case it doesn't seem to have any effect. This is my problem:</p><p>I have two activities, pretty much the same layout, but the first one is using a <strong>ListView that holds a list of buttons</strong>. The second activity holds a <strong>scrollview with buttons</strong>.The rest is the same, same number of buttons, same height of elements, etc.</p><p>Now, when I press the search button to open the search input bar, in <strong>my first activity, the entire layouts gets moved up.</strong> <strong>While on the second activity, the layout is not being moved up but the softkeyboard just displays on top of it.</strong> This is actually how I want it to behave. How can I achieve the same with my activity that's using the ListView?</p><p>In my manifest, initially I didn't specify any <code>android:windowSoftInputMode</code> attribute, but even if I do, it doesn't make any difference; I tried all three values (adjustPan, adjustResize, adjustUndefined, without any difference).</p><p>This is my layout:</p><p>1) <a href=""http://pastebin.com/5zzVxjbK"">http://pastebin.com/5zzVxjbK</a></p><p>2) <a href=""http://pastebin.com/KFtPuHvP"">http://pastebin.com/KFtPuHvP</a></p><p><strong>Interestingly though: when I set my ListView visibility in my layout 1 (left) to View.INVISIBLE, then the layout doesn not get moved up!</strong></p><p><img src=""http://i.stack.imgur.com/UNXPz.png"" alt=""alt text""></p>","241475","","241475","","2010-09-06 13:56:37","2011-04-17 15:42:33","How does Android determine whether to move the layout up when showing the softkeyboard?","<android><android-manifest>","1","6","4","",""
"3651597","1","","","2010-09-06 12:53:05","0","539","<p>So im trying to make a request from a rest jersey webservice, but since i want to pass a variable that has the ""/"" character im having trouble to reach my resource class method. Heres the url:</p><p><strong>http://localhost:8030/IPDMS/rest/process/search/210/2010</strong></p><p>Where the 210/2010 is a variable, so the ""/"" character will mess when searching the resource.</p><pre><code>@Path(""/process"")public class ProcessResource extends IPDMSWebServices{int sizeList=1;public ProcessResource(){    super();}@GET@Produces(MediaType.APPLICATION_JSON)@Path(""/search/{idprocessoent}"")public Processo searchProcesso(@PathParam(""idprocessoent"") String idproc){    try {        URLDecoder.decode(idproc.replace(""!"", ""%""),""UTF-8"");    } catch (UnsupportedEncodingException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    return new Processo(idproc,""toma"",""haha"",""2000"");}</code></pre><p>So i tried encoding but if i encode the variable, the ""%"" character is used and that doesnt seem to go well with the Rest webservice. I could replace the ""%"" character but i was trying to avoid that.....</p>","382115","","","","","2010-09-06 12:53:05","Making rest request from android with url variable with ""/"" character","<android><rest>","0","2","","",""
"3651604","1","3651621","","2010-09-06 12:54:31","3","3562","<p>I am using the code shown below to get Data from our server where Gzip is turned on. Does my Code already support Gzip (maybe this is already done by android and not by my java program) or do I have to add/change smth.? How can I check that it's using Gzip? For my opionion the download is kinda slow.  </p><pre><code>private static InputStream OpenHttpConnection(String urlString) throws IOException {        InputStream in = null;        int response = -1;        URL url = new URL(urlString);        URLConnection conn = url.openConnection();        if (!(conn instanceof HttpURLConnection))          throw new IOException(""Not an HTTP connection"");        try {          HttpURLConnection httpConn = (HttpURLConnection) conn;          httpConn.setAllowUserInteraction(false);          httpConn.setInstanceFollowRedirects(true);          httpConn.setRequestMethod(""GET"");          httpConn.connect();          response = httpConn.getResponseCode();          if (response == HttpURLConnection.HTTP_OK) {            in = httpConn.getInputStream();            if(in == null)              throw new IOException(""No data"");          }        } catch (Exception ex) {          throw new IOException(""Error connecting"");        }        return in;      }</code></pre>","433718","","","","","2012-11-01 10:59:05","Android: Gzip/Http supported by default?","<android><gzipstream>","2","0","","",""
"3651701","1","3651763","","2010-09-06 13:10:37","0","2431","<p>I need a small help in List view. I am generating a list View, but whenever i do <code>getChildAt(int position</code>) it throws null pointer exception. </p><p>Here is the code</p><pre><code>_list=(ListView)findViewById(android.R.id.list);_loadListElements();_showListUI();_list.getChildAt(1).setBackgroundColor(Color.WHITE);</code></pre>","405521","","222159","","2010-09-06 13:11:38","2013-05-02 08:04:21","Android listView null pointer exception","<android><list><view>","4","4","","",""
"3651728","1","3651821","","2010-09-06 13:14:48","0","1131","<p>Here is my code : </p><pre><code>NumberFormat nf = NumberFormat.getInstance();nf.setMaximumFractionDigits(14);nf.setMinimumFractionDigits(0);double d = 0;System.out.println(nf.format(d));</code></pre><p>With Android SDK : it prints ""0.00000000000001""With Java SDK (j2SE) : it prints ""0""</p><p>Why this difference ? bug in NumberFormat class for Android SDK ?</p>","164460","","","","","2010-09-06 13:28:27","android NumberFormat","<android><numbers>","1","0","","",""
"3651772","1","","","2010-09-06 13:20:10","4","1406","<p>I am trying to understand the main differences between registering a BroadcastReceiver in the Manifest and registering it programmatically...</p><p>My understanding is basically as follows - would appreciate someone correcting my points if I am missing something. </p><p>Registered in Manifest:- The OS will magically find and instantiate your class if needed, calling the onReceive() method, regardless what the running state of your application was- Your receive will only get called once per broadcast (i.e. You can consider that registering in the manifest is like registering your 'class' for receiving the broadcast - and the broadcast instantiates your class as needed) (??)</p><p>Registered Programmatically:- registering in code means that you are registering instances of your class to receive broadcast messages (i.e. if your code is a little sloppy, and you manage to register several times, you will end up with multiple BroadcastReceiver instances all having their onReceive() called for a broadcast- to deregister, you need to deregister the specific BroadcastReceiver instance that you previously registered- if your application gets destroyed by the OS, your onReceive() method will not be called for a broadcast</p><p>thanks</p>","434950","","","","","2013-12-12 05:23:30","Main difference between Manifest and Programmatic registering of BroadcastReceiver","<android>","3","0","2","",""
"3651846","1","","","2010-09-06 13:31:18","2","1210","<p>I would like to create a spinner which only displays the drop-down arrow and not the selected value and is only the width of the arrow. You can see various examples of this in Android itself e.g. Settings->Display->Brightness (<strong>Edit:</strong> a commenter has pointed out that this is a DialogPreference, but I would like a similar effect using a spinner).</p><p>I have attached to the <code>setOnItemSelectedListener</code> event and set the selected text to null, but this does not decrease the width of the spinner and you can can briefly see the selected text flicker before it is set to null.</p><p>How can I do this with the spinner? Is the spinner the correct control to be using in the first place?</p><p>Thanks.</p>","79835","","79835","","2010-09-07 04:24:37","2010-09-07 04:24:37","Android Spinner with no selected text - arrow only","<android>","0","5","","",""
"3651876","1","3651991","","2010-09-06 13:35:26","2","1392","<p>I have something like the following line of code:</p><pre><code>Notification notif = new Notification(R.drawable.notification_XX, ""Notify"", System.currentTimeMillis());</code></pre><p>My problem is that i want to make <code>R.drawable.notification_XX</code> changeable, so for example if I have a variable <code>i = 24;</code> then the appropriate resource <code>R.drawable.notification_24</code> should be used</p><p>So, is there a way of creating a drawable resource path dynamically?</p><p>thanks in advance, Martin</p>","415347","","","","","2010-09-06 13:52:08","Create drawable resource path dynamically","<android>","1","0","1","",""
"3651906","1","3652044","","2010-09-06 13:40:58","1","1573","<p>i am using  android:layout_marginTop=""100dip"" in my imageview,i want to set margin top to each image depending its height using coding not using xml,how can i set image's margintop?</p>","410757","","","","","2010-09-06 13:59:02","how to set image's margin top using coding not xml in android","<android>","1","1","","",""
"3651965","1","","","2010-09-06 13:48:33","2","454","<p>How to check if the standard <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Calendar.git;a=summary"" rel=""nofollow"">Google calendar application</a> is available on the phone?</p>","353672","","","","","2011-02-23 19:21:13","Google standard calendar on phone?","<android>","1","1","","",""
"3652196","1","3652339","","2010-09-06 14:24:54","1","265","<p>I am starting an application for child monitoring. This would involve mainly the logging of the SMS messages sent and received and logging other activities that may be of interest to the parents. It will also be nice to have something like access control lists for these, too.</p><p>Now, as far as I know:</p><ul><li>It is not possible to make an app ""not uninstallable"".</li><li>It is not possible to prompt for a password to uninstall an app.</li><li>It is not possible to assure that your app is ""always"" running even if it's getting killed with something like Task Killer, although I think you can respawn the application at given time intervals.</li></ul><p>So, any ideas on how to overcome these problems?</p>","203905","","","","","2011-02-26 10:41:03","Application for Child Monitoring","<android>","3","0","2","",""
"3652198","1","","","2010-09-06 14:25:16","1","624","<p>Why do I have a <code>setSelection</code> in <a href=""http://developer.android.com/reference/android/view/inputmethod/InputConnection.html#setSelection%28int,%20int%29"" rel=""nofollow"">InputConnection</a>, but not a <code>getSelection()</code>?</p><p>Should I just do a getTextBeforeCursor(VERY_HIGH_NUMBER, 0) and calculate the .length() of that string?</p>","184367","","665800","","2011-08-17 23:11:46","2011-12-15 20:52:50","Android: InputConnection is missing a getSelection() method","<android><input>","1","0","1","",""
"3652223","1","","","2010-09-06 14:28:42","0","154","<p>can any one tell me the methods used to send direct message for particular user from list using twitter4j</p>","410871","","1904479","","2013-12-19 11:38:44","2013-12-19 11:38:44","Twitter Application-android","<android><twitter><message><twitter4j>","1","0","","2012-11-16 10:00:57",""
"3652393","1","","","2010-09-06 14:55:49","2","696","<p>I've been using the component <code>Gallery</code> has a toolbar, but I'm not so much satisfied because I didnt find how to set up her position on init.</p><p>Does anybody know a component to use to have kind of 5 or more icons, kind of toolbar to use under android.</p><p>Can you give a code example?</p>","429222","","119895","","2010-09-06 15:11:04","2010-09-06 23:11:07","What component to use to make a toolbar under android?","<android><toolbar>","1","0","","",""
"3652528","1","3653084","","2010-09-06 15:16:09","0","1327","<p>I'm trying to create a default handler for .p7s/.p7b files in Android.</p><p>I figured the best start would be to create a BroadcastReceiver that will capture the intent from the Android email application (or K-9 if that's a need) for opening of certain attachments (filtered by mime type). Specifically I'm trying to handle s/mime email so looking for the ""application/x-pkcs7-certificates"" and ""application/x-pkcs7-certificates"" mime types.</p><p>Just as a basic test I've been trying something like this:</p><p>Manifest.xml</p><pre><code>&lt;receiver android:name="".IntentReceiver"" android:enabled=""true""&gt;     &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;            &lt;data android:mimeType=""application/x-pki-signature""/&gt;     &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>Class file.</p><pre><code>public class IntentReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Log.d(""TEST"", ""Intent was caught"");        //Do something here    }}</code></pre><p>I've tried using the following mimeType filters as well (testing signatures first):</p><pre><code>application/pkcs7-signatureapplication/x-pkcs7-signatureapplication/keychain_access</code></pre><p>I can't seem to get the IntentReceiver class to capture the intent no matter what filtering I use though. Am I going about this the wrong way?</p>","217924","","","","","2011-06-21 20:03:06","Creating a default viewer / receiver for Android email attachments","<android>","2","1","","",""
"3652536","1","","","2010-09-06 15:17:50","0","3593","<pre><code>&lt;ImageView android:id=""@+id/ImageView01""     android:layout_gravity=""center_horizontal""   android:layout_marginTop=""30dip""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:scaleType=""fitCenter""    android:adjustViewBounds=""true""&gt;</code></pre><p>hi friends,i want to set this property in coding for image view not use this,how can i make it ?</p><p>Thanks all</p>","410757","","137350","","2010-09-06 15:29:55","2013-06-14 23:00:18","how to set image view property in coding for android","<android><imageview>","1","0","","",""
"3652560","1","3653478","","2010-09-06 15:20:33","26","22176","<p>Can someone explain to me what exactly the UI thread is?On developer.android.com it says about the runOnUiThread function</p><blockquote>  <p>public final void runOnUiThread (Runnable action)</p>    <p>Since: API Level 1 Runs the specified action on the UI thread. If the  current thread is the UI thread, then the action is executed  immediately. If the current thread is not the UI thread, the action is  posted to the event queue of the UI thread.</p></blockquote><p>Does the UI thread mean that this will be run everytime the activity is pushed the the background by some ui activity like incoming call or screen dimming etc.? If not, what exactly does the UI thread include ?</p><p>Thank you</p>","434885","","194894","","2011-09-27 15:42:21","2014-02-05 13:57:23","What is the Android UiThread (UI thread)","<android><ui-thread>","3","0","12","",""
"3652569","1","3653000","","2010-09-06 15:21:54","0","2930","<p>I'm looking for a way to detect a cursor position changed in an <a href=""http://developer.android.com/reference/android/widget/EditText.html"" rel=""nofollow"">EditText</a>. I couldn't find anything in the documentation so far. Has anyone solved this already?</p>","184367","","","","","2010-09-06 16:41:41","Android: EditText listener for cursor position change","<android><cursor><position><edittext>","1","0","1","",""
"3652570","1","3652576","","2010-09-06 15:21:56","0","244","<p>When I make a new android project and I go to res/values/string.xml I get a screen to add android resources instead of a XML document. I keeps getting the error about : <code>java.lang.NullPointerException.</code></p><p>Is there a way to just alter a XML file (like suggested in tutorials)?</p>","440758","","222159","","2010-09-06 15:23:41","2010-09-06 15:28:08","Android eclipse resource strings error","<android><eclipse>","2","0","","",""
"3652583","1","","","2010-09-06 15:24:27","23","15886","<p>My experience is that loading websites in a WebView is much slower than performing the same actions in the Android Web Browser. I can see that all files have been loaded in my Apache log, it will take a few seconds until the page is displayed in the WebView control, however. Opening the same page in the native Web browser will result in an immediate display. It seems that rendering is somehow crippled.</p><p>Which browser settings do we have to apply in order to achieve the same performance as loading the page in the native web browser?</p><p>Our current settings:</p><pre><code>browserset.setLoadsImagesAutomatically(true);browserset.setJavaScriptEnabled(true);browserset.setDatabaseEnabled(true);browserset.setDatabasePath(""data/data/com.xxx/databases"");browserset.setDomStorageEnabled(true);browserset.setRenderPriority(WebSettings.RenderPriority.HIGH);browserset.setSupportZoom(false);browserset.setUserAgentString( browserset.getUserAgentString() + "" (XY ClientApp)"" );browserset.setAllowFileAccess(true);browserset.setSavePassword(false);browserset.setSupportMultipleWindows(false);browserset.setAppCacheEnabled(true);browserset.setAppCachePath("""");browserset.setAppCacheMaxSize(5*1024*1024);</code></pre>","440763","","","","","2013-06-05 16:49:46","Enhance webView performance (should be the same performance as native Web Browser)","<android><performance><webview>","2","0","18","",""
"3652713","1","3652804","","2010-09-06 15:49:12","0","2804","<p>Im trying to have a searchbox on the top of my list view. But I want this searchbox to disapear sometimes and the listview to resize to regain space. Is there a way I can do that without reloading another and different layout ???</p><p>is there a way to add and remove a component from the current view ?I have been playing with setvisibility but it doesnt resize anything.</p><p>Please, if you know, give code example ! :)</p>","429222","","","","","2010-09-06 16:04:48","android : Dynamic layout?","<android><layout><dynamic>","1","0","2","",""
"3652871","1","","","2010-09-06 16:15:13","0","1404","<p>i am using this codepublic class newtimer extends Activity {</p><pre><code>    private Timer myTimer;@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    myTimer = new Timer();    myTimer.schedule(new TimerTask() {        @Override        public void run() {            TimerMethod();        }    }, 0, 1000);}int number = 0;private void TimerMethod(){    //This method is called directly by the timer    //and runs in the same thread as the timer.    //We call the method that will work with the UI    //through the runOnUiThread method.    Toast.makeText(this, ""TimerMethod Running ""+number, Toast.LENGTH_SHORT).show();    this.runOnUiThread(Timer_Tick);}private Runnable Timer_Tick = new Runnable() {    public void run() {    //This method runs in the same thread as the UI.                   //Do something to the UI thread here        Toast.makeText(getBaseContext(), ""UI Thread Running ""+number, Toast.LENGTH_SHORT).show();    }};}</code></pre><p>when i run it i get this exception in logcat</p><p>09-06 21:39:39.701: ERROR/AndroidRuntime(1433): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</p><p>what do i do ? i kno its something with handlers but i need help with the code...:/Thank you</p>","434885","","345717","","2010-09-06 16:36:34","2010-09-06 16:39:16","android timer handler","<android>","1","1","","",""
"3652880","1","","","2010-09-06 16:17:05","2","594","<p>I'm the developer of a Soundboard app. A lot of users have reported me that in their phones some of the sounds cut off early. I have a Nexus One and a HTC Tattoo and everything works fine, I've never noticed the cut off in my phones.</p><p>This is my code for the audio part:</p><p>First, I have a MediaPlayer object in my main class:</p><pre><code>private MediaPlayer mp = null;</code></pre><p>And when I puss a button, this is the code:</p><pre><code>    private OnClickListener onClickSound = new OnClickListener() {    public void onClick(View v) {        if(mp != null){            mp.stop();            mp.release();            mp = null;        }        mp = MediaPlayer.create(getBaseContext(), mp3id));        mp.start();        mp.setOnCompletionListener(completionListener);    }};</code></pre><p>And this is the completionListener:</p><pre><code>    MediaPlayer.OnCompletionListener completionListener = new MediaPlayer.OnCompletionListener(){    public void onCompletion(MediaPlayer mediaP) {        if(mp != null &amp;&amp; !mp.isPlaying()){            mp.stop();            mp.release();            mp = null;        }    }};</code></pre><p>You guys have any clue?</p><p>Greetings</p>","309853","","","","","2010-09-06 16:26:37","Sounds cut off early on some phones","<android><audio>","1","1","","",""
"3652985","1","3653031","","2010-09-06 16:39:06","0","72","<p>I have three activities, A, B and C.</p><p>User can start activity B from A, and then C from B.</p><p>I would like to have following. In C the user fill some field and click ""OK""-Button. After that both activities B and C should be finished.</p><p>I don't like my idea, to finish A after starting B, then finish B after starting C, and then start A from C.</p><p>What is the best way to do that?! </p><p>Is it possible to finish parent activity from the child? If, yes, then that would be my solution. But i haven't find any information about that.</p><p>Thank you,</p><p>Mur</p>","408780","","","","","2012-10-28 07:42:08","Android activities question","<android>","2","0","","",""
"3653051","1","3653193","","2010-09-06 16:49:19","0","125","<p>I have an app that contains a picture gallery when one of the items in the gallery is pressed, the item clicked views as an imageview fullscreen.  WHat I am then trying to do is allow the user to select whether to download the imageview to the phone or set it as a background...is this possible? How would I go about this?  Thanks!</p>","411224","","","","","2012-12-14 16:27:03","ANDROID: Possible to download imagview to phone or set an imagview as background?","<android><image><download><background-image><imageview>","2","0","","",""
"3653057","1","","","2010-09-06 16:49:48","0","404","<p>i want to create a method to open a popup when i click on it and the title and the text would be automatic, something like this :</p><pre><code>    public void Display(String test){        new AlertDialog.Builder(this).setTitle(getTitle()).setMessage(test).setNeutralButton(""close"", new DialogInterface.OnClickListener() {            @Override            public void onClick(DialogInterface dialog, int which) {                // TODO Auto-generated method stub            }        }).show();        }</code></pre><p>but test is a String and set Message doesn't accept Strings, and it would come from a resource XML, like Strings.xml. So i don't know ho to do this.And the 'getTitle()' i don't think it could work. My method to take the title is this one.</p><pre><code>TextView str = new TextView(this);        str.setText(parent.getItemAtPosition(position).toString());        String title = str.getText().toString();</code></pre>","439058","","251173","","2010-09-06 16:53:21","2010-09-06 17:16:24","try to do a public method","<java><android><string><listview><methods>","2","0","","",""
"3653101","1","","","2010-09-06 16:57:10","0","249","<p>i want to set equal top and bottom of each images,how can i set for all images in android?anybody know please give the code for that</p><p>Thanks all</p>","410757","","","","","2010-09-07 16:56:12","how to set equal top and bottom of image in android?","<android>","1","3","","",""
"3653235","1","","","2010-09-06 17:26:21","2","1521","<p>i want to build a simple bluetooth chat program that can do a 2 way chat with 2 mobile devices.</p><p>i know that i can use gamekit to develop such application for iphone and ipod touch. But i want to know is,  is it possible for other smart phones (running my application) to discover and communicate with ipones and other devices as well?</p><p>in simple: i want my application to run on iphone,symbian and android and to be able to discover and communicate with each other over bluetooth. </p><p>if you can point me in the right direction will be a great help. thanks.</p>","440825","","","","","2011-07-20 21:51:28","iPhone and anyother Smartphone peer-to-peer communication over bluetooth","<iphone><android><bluetooth><symbian><p2p>","2","0","","",""
"3653431","1","","","2010-09-06 18:05:56","2","554","<p><img src=""http://i.stack.imgur.com/VKv67.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/gr0tq.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/nMAfe.png"" alt=""alt text""></p><p><img src=""http://i.stack.imgur.com/GlyVv.png"" alt=""alt text""></p><p>I want to  display image in center and top and bottom in same size refer bellow screens,anybody know please give the code to me...Thanks All</p>","410757","","21234","","2010-09-06 18:07:42","2010-09-06 23:03:48","how to set image's top and bottom in same size for android?","<android><imageview>","1","1","","",""
"3653447","1","","","2010-09-06 18:09:07","0","660","<pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    // TODO Auto-generated method stub    super.onListItemClick(l, v, position, id);          Cursor c = (Cursor) mAdapter.getItem(position);         String a = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));          String b = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));    if (names != null)    {        if(numbers.contains(b))        {            names = names.replace(a+"";"", """");            numbers = numbers.replace(b+"";"", """");            v.setBackgroundResource(R.drawable.background);                     }        else{            names = names + a + "";"";            numbers = numbers + b + "";"";            v.setBackgroundResource(R.drawable.background_sel);        }    }    else    {        names = a+"";"";        numbers = b+"";"";        v.setBackgroundResource(R.drawable.background_sel);    }   }</code></pre><p>when i select an item random other items background also gets changed although they are not added to the array names and numbers.</p><p>i need only the background of the selected item tochange...is there a way to do this without creating my own listadapter ??</p>","434885","","272824","","2010-09-06 18:12:10","2010-09-06 22:56:40","android listadapter","<android>","1","0","","",""
"3653504","1","3653612","","2010-09-06 18:17:01","4","5724","<p>im trying to find the method behind having superuser access on android devices. basically i want my app to be able to remove system files, and so asking the user if its ok after the app is launched like most other apps, and then what code exactly am i looking to use to perform these sorts of actions? cant find much on google</p><p>thanks in advance!</p>","427113","","","","","2012-02-13 05:54:22","Android using Super User Permissions ? allowing access","<android>","3","0","4","",""
"3653573","1","3655216","","2010-09-06 18:26:53","1","214","<p>I want to draw a image filling the complete screen.Then when user clicks in any pixel or group of pixels they turn black.How can I know where the user clicked exactly and how can I turn the touched pixels black?</p>","419921","","","","","2010-09-07 01:34:29","How to know in which pixels of a image user clicked?","<android>","1","2","1","",""
"3653584","1","3658876","","2010-09-06 18:28:14","0","1709","<p>I'm getting a problem making an HTTP POST in Android. </p><p>The problem occur when the code is reading the response, it cant obtain the complete web page code I want to retrieve.</p><p>I only retrieve a piece of the web.</p><p>Here is the code:</p><pre><code>    try {        HttpClient httpclient = new DefaultHttpClient();         HttpPost httppost = new HttpPost(URL);        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);         nameValuePairs.add(new BasicNameValuePair(""text"", ""06092010""));        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));         HttpResponse response;         response=httpclient.execute(httppost);        BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));        String  s = """";        String line = reader.readLine();        while(line != null){            s += line+""\n"";            line = reader.readLine();        }        Log.d(""Street"", ""Result: ""+s);              } catch (ClientProtocolException e) {         // TODO Auto-generated catch block                  Log.d(""Street"", e.toString());       } catch (IOException e) {         // TODO Auto-generated catch block                  Log.d(""Street"", e.toString());    } catch (Exception e) {        Log.d(""Street"", e.toString());    }</code></pre>","440853","","","","","2012-08-07 19:03:46","Problem with HTTP Post in Android","<html><android><http><post><httpclient>","3","0","","",""
"3653614","1","","","2010-09-06 18:33:19","2","290","<p>I'm trying to get an Android background service to be ""notified"" when the user chooses a phone number (he wishes to call) from the phone's contacts list. My goal with this is to prevent the system from placing the call and present a user with a choice dialog, then go from there... Need help.</p>","440854","","","","","2010-09-25 23:13:45","Android: Detect when user chooses a number (he wishes to call) in the contacts list?","<android><service><contacts>","1","0","1","",""
"3653747","1","3653806","","2010-09-06 19:00:24","1","1179","<p>I am wondering how one would create a dialog box that only pops up when the app is first opened. For example, I have an Android app on the market. When I update it, I would like to implement a box that pops up that displays what has been updated in the app and will not pop up again until the app is updated again. Thanks! </p>","371018","","","","","2010-09-06 19:55:49","How to have a one-time only Dialog box","<android><dialog>","2","0","","",""
"3653831","1","","","2010-09-06 19:17:02","0","3376","<p>I'm using the Android SDK (2.2) with a Droid and I have access to the 3-axis accelerometer and gyrometer.</p><p>I apologize in advance if this reveals my ignorance of physics. It has been awhile.</p><p>What I don't understand is why the accelerometer is giving different x,y,z values when I tilt the phone. It's standing still, at least, with negligible acceleration and even mostly constant velocity, it's just tilted.  I thought that this was the gyrometer's job?</p><p>I don't want gravity in the equation...I just want the other forces affecting the phone. Everything had better be 0,0,0 unless I'm moving it faster.  I want to know how hard I hit the phone on the table, and the direction and magnitude of the x,y,z forces when I do so. So far, I am confused beyond belief about how to access this with the accelerometer and gyrometer data. I'm trying to take the gyrometer as the direction and the accelerometer as the magnitude. Unfortunately, the data for those aren't really in sync (I have to setup two events to get each pair of data, and they may come at different times), but it might be good enough to just buffer them and assume some sort of synchronization.</p><p>Desperate,Andrew</p>","363177","","","","","2010-09-07 02:26:30","Accelerometer and Gyrometer Data","<android><accelerometer><compass-geolocation>","1","0","","",""
"3653968","1","3654675","","2010-09-06 19:50:04","1","1061","<p>ProgressDialog quits updating when orientation of screen changes.  I have put into place a fix that salvages the asynctask and sets the activity of the asynctask to the new activity after it is destroyed and rebuilt.  The percentage complete on the progressdialog stays at the percentage it was at before the orientation change.</p><p>What am I missing?</p><pre><code>package net.daleroy.fungifieldguide.activities;import java.io.BufferedInputStream;import java.io.FileOutputStream;import java.io.InputStream;import java.io.OutputStream;import java.net.URL;import java.net.URLConnection;import android.app.Activity;import android.app.Dialog;import android.app.ProgressDialog;import android.content.Intent;import android.os.AsyncTask;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.Window;import android.view.View.OnClickListener;import android.widget.Toast;import net.daleroy.fungifieldguide.R;import net.daleroy.fungifieldguide.fungifieldguideapplication;public class FungiFieldGuide extends Activity {    //static final int PROGRESS_DIALOG = 0;    //ProgressThread progressThread;    private final static String LOG_TAG = FungiFieldGuide.class.getSimpleName();     fungifieldguideapplication appState;    private DownloadFile mTask;    public boolean mShownDialog;    ProgressDialog progressDialog;    private final static int DIALOG_ID = 1;     @Override    protected void onPrepareDialog(int id, Dialog dialog) {        super.onPrepareDialog(id, dialog);        if ( id == DIALOG_ID ) {            mShownDialog = true;        }    }    private void onTaskCompleted() {        Log.i(LOG_TAG, ""Activity "" + this + "" has been notified the task is complete."");        //Check added because dismissDialog throws an exception if the current        //activity hasn't shown it. This Happens if task finishes early enough        //before an orientation change that the dialog is already gone when        //the previous activity bundles up the dialogs to reshow.        if ( mShownDialog ) {            dismissDialog(DIALOG_ID);            Toast.makeText(this, ""Finished.."", Toast.LENGTH_LONG).show();        }    }    @Override    protected Dialog onCreateDialog(int id) {        switch(id) {        case DIALOG_ID:            progressDialog = new ProgressDialog(this);            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);            progressDialog.setMessage(""Loading Database (only first run)..."");            return progressDialog;        default:            return super.onCreateDialog(id);        }    }    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.main);        appState = ((fungifieldguideapplication)this.getApplication());        Object retained = getLastNonConfigurationInstance();        if ( retained instanceof DownloadFile ) {            Log.i(LOG_TAG, ""Reclaiming previous background task."");            mTask = (DownloadFile) retained;            mTask.setActivity(this);            //showDialog(DIALOG_ID);        }         else {            if(!appState.service.createDataBase())            {                Log.i(LOG_TAG, ""Creating new background task."");                //showDialog(DIALOG_ID);                mTask = new DownloadFile(this);                mTask.execute(""http://www.codemarshall.com/Home/Download"");            }        }            //showDialog(PROGRESS_DIALOG);        View btn_Catalog = findViewById(R.id.btn_Catalog);        btn_Catalog.setOnClickListener(new OnClickListener()         {            public void onClick(View v)             {                   Intent i = new Intent(getBaseContext(), Cat_Genus.class);//new Intent(this, Total.class);                startActivity(i);            }        });        View btn_Search = findViewById(R.id.btn_Search);        btn_Search.setOnClickListener(new OnClickListener()         {            public void onClick(View v)             {                   Intent i = new Intent(getBaseContext(), Search.class);//new Intent(this, Total.class);                startActivity(i);            }        });    }    @Override    public Object onRetainNonConfigurationInstance() {            mTask.setActivity(null);            return mTask;    }     @Override    public void onDestroy()    {        super.onDestroy();        //progressDialog.dismiss();        //progressDialog = null;        appState.service.ClearSearchParameters();    }    private class DownloadFile extends AsyncTask&lt;String, Integer, Boolean&gt;{        private FungiFieldGuide activity;        private boolean completed;        private String Error = null;        private String Content;        private DownloadFile(FungiFieldGuide activity) {            this.activity = activity;        }        @Override        protected void onPreExecute()        {            showDialog(DIALOG_ID);        }        @Override        protected Boolean doInBackground(String... urlarg) {            int count;            try {                URL url = new URL(urlarg[0]);                URLConnection conexion = url.openConnection();                conexion.setDoInput(true);                conexion.setUseCaches(false);                // this will be useful so that you can show a tipical 0-100% progress bar                int lenghtOfFile = conexion.getContentLength();                // downlod the file                InputStream input = new BufferedInputStream(conexion.getInputStream());                OutputStream output = new FileOutputStream(""/data/data/net.daleroy.fungifieldguide/databases/Mushrooms.db"");                byte data[] = new byte[1024];                long total = 0;                while ((count = input.read(data)) != -1) {                    total += count;                    // publishing the progress....                    publishProgress((int)total*100/lenghtOfFile);                    output.write(data, 0, count);                }                output.flush();                output.close();                input.close();            } catch (Exception e) {                Log.i(LOG_TAG, e.getMessage());            }            return null;        }        @Override        public void onProgressUpdate(Integer... args){            progressDialog.setProgress(args[0]);        }        @Override        protected void onPostExecute(Boolean result)        {            completed = true;            notifyActivityTaskCompleted();        }        private void notifyActivityTaskCompleted() {            if ( null != activity ) {                activity.onTaskCompleted();            }        }        private void setActivity(FungiFieldGuide activity) {            this.activity = activity;            if ( completed ) {                    notifyActivityTaskCompleted();            }        }    }}</code></pre>","1491425","","","","","2010-09-06 22:44:52","ProgressDialog not updating after Configuration Change (orientation turns to horizontal)","<java><android><android-asynctask><progressdialog>","1","0","1","",""
"3653988","1","","","2010-09-06 19:54:33","0","595","<p>I am writing an Android app in which I've extended the Application class in order to hold some global variables. I initialize these global vars in my root Activity (the first screen that the user sees).</p><p>My application contains a number of Activities containing ListViews full of selectable items. When the user selects an item, a new Activity is pushed onto the display stack. </p><p>Now if a user is in the 3rd or 4th Activity, and then they press the Home button, my app hides. If the user then force closes my app (using a Task Killer), and then reopens my app, the Application context is initialized and the app starts off in the Activity that the user was on when they clicked the Home button. But the problem is, none of my global variables have been initialized at this point since all that happens only on my first Activity.</p><p>So is there any way to force my root Activity to always appear when my app comes to the foreground, if the Application object has not yet been initialized?</p><p>Thanks!</p>","440889","","","","","2011-06-15 08:11:15","Android: Application context, force root intent to show upon launch","<android><context>","1","2","","",""
"3654118","1","","","2010-09-06 20:25:35","0","472","<p>The <a href=""http://developer.android.com/reference/java/io/BufferedWriter.html#write%28int%29"" rel=""nofollow"">Javadoc</a> for this says:</p><p><strong>Only the lower two bytes of the integer oneChar are written.</strong></p><p>What effect, if any, does this have on writing non-utf8 encoded chars which have been cast to an int?</p><p>Update:</p><p>The code in question receives data from a socket and writes it to a file. (A lot of things happen between receiving and writing, so I can't just use the string I get using BufferedReader#readLine()). I was using Writer#write(char[]) but this meant I had to create a new char array each time. To get around creating an array everytime, I had a single char array which is filled with -1 (cast to a char). </p><p>I then use TextUtils#getChars to fill it, expanding the array if necessary. For writing, I loop through the array, writing to the Writer until char[i] == (char) -1 == true.</p>","240251","","240251","","2010-09-07 22:27:13","2010-09-07 22:27:13","BufferedWriter#write(int) javadoc query","<android><encoding><character-encoding><bufferedwriter>","1","3","","",""
"3654130","1","","","2010-09-06 20:28:01","2","677","<p>I have a an array of objects and would like to be able to randomly choose one from the list when a button is pressed. How would you do that in Android?</p>","440901","","115145","","2010-09-06 20:34:11","2010-09-06 21:54:59","How to generate random events in android?","<java><android><arrays><random><generator>","3","1","0","",""
"3654321","1","3805076","","2010-09-06 21:12:10","35","25985","<p>Any straight forward way to measure the height of text?The way I am doing it now is by using Paint's measureText() to get the width, then by trial and error finding a value to get an approximate height. I've also been messing around with FontMetrics, but all these seem like approximate methods that suck.</p><p>I am trying to scale things for different resolutions. I can do it, but I end up with incredibly verbose code with lots of calculations to determine relative sizes. I hate it! There has to be a better way.</p><p>Any way, one thing at a time: Thanks.</p>","434400","","881229","","2013-12-07 20:34:01","2013-12-07 20:34:01","Measuring text height to be drawn on Canvas ( Android )","<android><graphics><view><android-canvas>","6","1","11","",""
"3654345","1","","","2010-09-06 21:16:33","1","4380","<p>I'm trying to write an app that has to manipulate my inbox and my sent messages without sending or receiving a message. </p><p>This <a href=""http://mobiforge.com/developing/story/sms-messaging-android"" rel=""nofollow"">tutorial</a> shows me how I can send messages, but I want my phone to think that I sent one, without actually sending one. </p><p>I've searched in the Android References and I think I need to use:</p><ul><li>SMS Manager</li><li>SMS Message</li></ul><p>How can I do this?</p>","440918","","1288","","2011-06-24 17:31:37","2011-06-24 17:31:37","How to add SMS in inbox and sent messages in android programmatically?","<java><android><sdk><sms>","2","0","2","",""
"3654405","1","3654519","","2010-09-06 21:29:31","0","5739","<p>I've got a preferences.xml:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;PreferenceCategory         android:title=""Category""&gt;        &lt;CheckBoxPreference             android:key = ""inputPreferences""             android:title = ""Title""             android:summary = ""Subtitle""/&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>I want to read out the value of the CheckBoxPreference, and depending on it, there sould be shown (for example) a TextView. I tried following code, but it doesn't work:</p><pre><code>@Overrideprotected void onResume() { // TODO Auto-generated method stub super.onResume(); Toast.makeText(this, ""onResume"", Toast.LENGTH_LONG).show(); SharedPreferences myPreference=PreferenceManager.getDefaultSharedPreferences(this); if(myPreference.getBoolean(""checkbox"", false)) {      VarText.setVisibility(View.VISIBLE);      VarText.setText(""foo""); }}</code></pre><p>Hope anyone can help, thanks :)</p>","395135","","","","","2010-09-06 22:02:23","Get Value of a CheckBoxPreference in an Activity","<android><checkbox><activity><preferences>","1","0","0","",""
"3654424","1","","","2010-09-06 21:33:43","0","221","<p>im having a bit of problem with this code can anyone help me with where im going wrong im getting a null pointer exception</p><p>SharedPreferences mPrefs;</p><pre><code>protected void onPause() {    super.onPause();SharedPreferences.Editor ed = mPrefs.edit();    ed.putString(""names"", names);    ed.putString(""numbers"", numbers);    ed.commit();}   @Overrideprotected void onResume() {    // TODO Auto-generated method stub    super.onResume();    SharedPreferences mPrefs = getSharedPreferences(""xyz"", 0);    mPrefs.getString(""names"", """");    mPrefs.getString(""numbers"", """");}</code></pre>","434885","","","","","2010-09-07 01:00:39","android sharedprefences","<android>","1","2","","",""
"3654464","1","","","2010-09-06 21:46:45","0","4573","<p>I'm trying to re-partition an SDCard on Android, with root access.</p><p>I have the 512 byte MBR file, and it shows up as this:</p><pre> Pos MBRndx Type/Name  Size Active Hide Start Sector   Sectors --- ------ ---------- ---- ------ ---- ------------ ------------  0    0    0C-FAT32X  5.9G   No    No            64   12,124,096  1    1    0C-FAT32X  1.9G   No    No    12,124,160    3,932,160</pre><p>What I'm trying to do is resize the 5.9GB partition into 3GB, and then make an EXT partition with the remaining space. I can think of two ways to do this, but I'm a bit stumped in doing either of them:</p><p>1) Cross-compile GNU parted, and run it on Android to modify the filesystem in place. This would be my preferred method, but I've been trying to statically compile parted using scratchbox and haven't had much luck, and I haven't been able to dynamically compile for Android in scratchbox either.</p><p>2) Directly modify the 512 byte MBR using some utility on my computer, and then dd the file on Android. I have a tool to view the MBR (mbrwiz), but I don't know how to edit it.</p><p>Does anybody have any suggestions for either, or possibly a third route?</p>","440937","","440937","","2010-09-07 05:55:29","2010-09-23 11:23:13","Partitioning the filesystem on Android","<android><android-ndk><mbr>","2","0","1","",""
"3654492","1","4265553","","2010-09-06 21:53:29","48","19325","<p>I'm trying to implement a <code>SlidingDrawer</code> that will occupy the full screen width, but whose height is determined dynamically by its contents: in other words, standard <code>fill_parent</code> layout behaviour for the width and <code>wrap_content</code> for the height. That's exactly how I've specified it in the layout XML (see below) but the sliding drawer always opens to the full screen height. The height of my content varies, but typically it's only about half the screen height, so I end up with a big gap underneath it. What I'd like is for the content to sit neatly on the bottom of the screen.</p><p>I've tried everything I can think of to fix it but nothing's worked so far. If I set the <code>SlidingDrawer</code>'s <code>layout_height</code> to a specific value (e.g. <code>160dip</code>) it works, but that's not what I need: it has to be dynamic. Of course I've made sure all the child elements have their height set to <code>wrap_content</code> too.</p><p>The documentation on SlidingDrawer is a bit vague on this and I haven't been able to find any examples that do what I'm after either. If anyone can see where I'm going wrong I'd really appreciate your help!</p><pre><code>&lt;RelativeLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;ViewFlipper        android:id=""@+id/ImageFlipper""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" &gt;        &lt;ImageView            android:id=""@+id/imageView0""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:scaleType=""centerCrop"" /&gt;        &lt;ImageView            android:id=""@+id/imageView1""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:scaleType=""centerCrop"" /&gt;        &lt;ImageView            android:id=""@+id/imageView2""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:scaleType=""centerCrop"" /&gt;    &lt;/ViewFlipper&gt;    &lt;SlidingDrawer        android:id=""@+id/infoDrawer""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:handle=""@+id/infoDrawerHandle""        android:content=""@+id/infoDrawerContent""        android:allowSingleTap=""false""        android:layout_alignParentBottom=""true""        android:orientation=""vertical"" &gt;        &lt;!-- Sliding drawer handle --&gt;        &lt;ImageView            android:id=""@id/infoDrawerHandle""            android:src=""@drawable/info_handle_closed""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content"" /&gt;        &lt;!-- Sliding drawer content: a scroller containing a group of text views        laid out in a LinearLayout --&gt;        &lt;ScrollView            android:id=""@id/infoDrawerContent""            android:background=""@drawable/info_background""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:fillViewport=""false"" &gt;            &lt;LinearLayout                android:id=""@id/infoDrawerContent""                android:orientation=""vertical""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:paddingRight=""5dip"" &gt;                &lt;TextView                    android:id=""@+id/infoTitle""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:textColor=""#ffffff""                    android:textSize=""16dip""                    android:textStyle=""bold"" /&gt;                &lt;TextView                    android:id=""@+id/infoCreator""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:textColor=""#ffffff""                    android:textSize=""14dip""                    android:textStyle=""italic""                    android:paddingBottom=""10dip"" /&gt;                &lt;TextView                    android:id=""@+id/infoDescription""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:textColor=""#ffffff""                    android:textSize=""14dip""                    android:paddingBottom=""10dip"" /&gt;                &lt;TextView                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:textColor=""#ffcc00""                    android:textSize=""14dip""                    android:textStyle=""bold""                    android:text=""@string/heading_pro_tip"" /&gt;                &lt;TextView                    android:id=""@+id/infoProTip""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                    android:textColor=""#ffcc00""                    android:textSize=""14dip"" /&gt;            &lt;/LinearLayout&gt;            &lt;/ScrollView&gt;    &lt;/SlidingDrawer&gt;&lt;/RelativeLayout&gt;</code></pre>","440921","","440921","","2010-09-06 22:00:54","2012-11-21 23:48:38","Android: can height of SlidingDrawer be set with wrap_content?","<android><layout><slidingdrawer>","5","0","31","",""
"3654549","1","","","2010-09-06 22:09:20","0","506","<p>If I compile my app with the Android 2.2 SDK target, it will not run on Android 1.5. If I compile with 2.1, it works fine. The problem seems to be in finding some of my resource files. Here's the stack dump:</p><pre><code>09-06 11:22:15.387 W/ResourceType( 2702): Failure getting entry for 0x7f020004 (t=1 e=4) in package 0: 0xffffffb509-06 11:22:15.397 W/System.err( 2702): android.view.InflateException: Binary XML file line #22: Error inflating class java.lang.reflect.Constructor09-06 11:22:15.442 W/System.err( 2702): at android.view.LayoutInflater.createView(LayoutInflater.java:512)09-06 11:22:15.442 W/System.err( 2702): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)09-06 11:22:15.442 W/System.err( 2702): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)09-06 11:22:15.442 W/System.err( 2702): at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)09-06 11:22:15.442 W/System.err( 2702): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:701)09-06 11:22:15.442 W/System.err( 2702): at android.view.LayoutInflater.rInflate(LayoutInflater.java:613)09-06 11:22:15.442 W/System.err( 2702): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)09-06 11:22:15.442 W/System.err( 2702): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)09-06 11:22:15.442 W/System.err( 2702): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)09-06 11:22:15.442 W/System.err( 2702): at com.drclabs.android.wootchecker.MainActivity.onCreate(MainActivity.java:203)09-06 11:22:15.442 W/System.err( 2702): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)09-06 11:22:15.442 W/System.err( 2702): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)09-06 11:22:15.442 W/System.err( 2702): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)09-06 11:22:15.442 W/System.err( 2702): at android.app.ActivityThread.access$1800(ActivityThread.java:112)09-06 11:22:15.442 W/System.err( 2702): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)09-06 11:22:15.442 W/System.err( 2702): at android.os.Handler.dispatchMessage(Handler.java:99)09-06 11:22:15.442 W/System.err( 2702): at android.os.Looper.loop(Looper.java:123)09-06 11:22:15.442 W/System.err( 2702): at android.app.ActivityThread.main(ActivityThread.java:3948)09-06 11:22:15.442 W/System.err( 2702): at java.lang.reflect.Method.invokeNative(Native Method)09-06 11:22:15.447 W/System.err( 2702): at java.lang.reflect.Method.invoke(Method.java:521)09-06 11:22:15.447 W/System.err( 2702): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)09-06 11:22:15.447 W/System.err( 2702): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)09-06 11:22:15.447 W/System.err( 2702): at dalvik.system.NativeStart.main(Native Method)09-06 11:22:15.447 W/System.err( 2702): Caused by: java.lang.reflect.InvocationTargetException09-06 11:22:15.447 W/System.err( 2702): at android.widget.ImageView.&lt;init&gt;(ImageView.java:103)09-06 11:22:15.447 W/System.err( 2702): at java.lang.reflect.Constructor.constructNative(Native Method)09-06 11:22:15.447 W/System.err( 2702): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)09-06 11:22:15.452 W/System.err( 2702): at android.view.LayoutInflater.createView(LayoutInflater.java:499)09-06 11:22:15.452 W/System.err( 2702): ... 22 more09-06 11:22:15.452 W/System.err( 2702): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f020004 a=-1 r=0x7f020004}09-06 11:22:15.457 W/System.err( 2702): at android.content.res.Resources.loadDrawable(Resources.java:1609)09-06 11:22:15.457 W/System.err( 2702): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)09-06 11:22:15.457 W/System.err( 2702): at android.widget.ImageView.&lt;init&gt;(ImageView.java:113)09-06 11:22:15.457 W/System.err( 2702): ... 26 more</code></pre><p>The relevant line in my Manifest:</p><pre><code>&lt;uses-sdk android:targetSdkVersion=""8"" android:minSdkVersion=""3""/&gt;</code></pre><p>The resource in question is a small PNG image located at res/drawable-hdpi/red_heart.png .I want to add support for some of the new features in 2.2 if the user's device supports them, but I can't do so if I can't compile against the 2.2 SDK without breaking the app for my 1.5 users.</p><p>Does anyone have any idea how to work around this problem? Do I need to do something different with the way I'm storing or referencing my image resources in my layout files? </p>","301145","","301145","","2010-09-06 22:18:31","2010-09-06 22:32:12","Resource Problem in 1.5 when compiling against 2.2","<android>","1","0","","",""
"3654607","1","","","2010-09-06 22:25:44","12","4723","<p>I develop Android using Eclipse and the ADT plug-in... and it's... slow. </p><p>I have to restart frequently and it gets painfully worse when I have various Android projects open (needed for when I use library projects).</p><p>Are there any specific optimizations that I can make to improve Eclipse performance when using the ADT plug-in?</p>","143378","","","","","2011-04-21 18:51:51","Optimizing Eclipse for Android development","<android><eclipse><performance><adt>","2","5","10","",""
"3654720","1","3654727","","2010-09-06 22:58:06","1","274","<p>Hey, I was curious if there was a way that I can assign each menu item in a <code>ListView</code>  its ID from the SQLite database, so that when I do something like onClick, or using a ContextMenu, I can tell what item / row I am referencing to.</p>","362857","","","","","2010-09-06 23:12:45","ListView - Each item having an ID?","<android>","1","0","","",""
"3654888","1","3744194","","2010-09-06 23:44:08","0","2110","<p>I am working on an app for my company.  One of the buttons loads a webview of a google calendar.  This works pretty well and all of my other webviews scroll appropriately.  However when loading this calendar it resizes to the screen size and will not scroll.  I tried setting the webview in a linear layout and making the height of the webview 4096px.  This extends the calendar beyond the bottom of the screen, however it will not scroll.  I am learning android as I go, I have some programming experience back when I was young and all command line.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""4096px""&gt;&lt;WebView android:id=""@+id/webview""android:layout_width=""fill_parent""android:layout_height=""1020px""&gt;&lt;/WebView&gt;&lt;/LinearLayout&gt;</code></pre><p>The code is</p><pre><code>WebView calendar = (WebView) findViewById(R.id.webview);    calendar.setBackgroundColor(0);    calendar.setScrollBarStyle(3);    calendar.getSettings().setJavaScriptEnabled(true);    Toast.makeText(getApplicationContext(), ""Loading Events Calendar"", Toast.LENGTH_SHORT).show();    calendar.loadUrl(""http://www.google.com/calendar/embed?src=blahblah%40blah.com&amp;mode=Agenda"");</code></pre><p>Javascript is enabled for for the webview.  Any help would be greatly appreciated.</p>","440968","","","","","2010-09-19 01:36:20","Android WebView will not scroll (Loading an embedded Google Calendar)","<android><calendar><scroll><webview>","1","0","","",""
"3654999","1","","","2010-09-07 00:17:40","0","769","<p>How would you create a Windows 7-like home screen replacement, on Android?</p>","440988","","23897","","2010-09-07 00:21:01","2010-09-15 19:40:12","How to create an Windows Phone 7-like home screen launcher","<android><windows-phone-7><homescreen><launcher>","2","3","","",""
"3655069","1","3655108","","2010-09-07 00:43:33","0","1134","<p>In my app I draw an image covering the entire screen.I want to now how can I know where the user touched the screen?</p><p>Thanks</p>","419921","","","","","2010-09-07 00:57:28","How to know the screen position where the user touched the screen?","<android>","2","1","","",""
"3655097","1","3655244","","2010-09-07 00:52:05","0","1020","<p>I need to change the dialog's typeface to use an external font that supports some unicode characters. Unfortunately, there is no AlertDialog.setTypeFace() method available...</p><p>Any ideas?</p>","433261","","","","","2010-09-07 02:52:15","change dialog typeface to use external fonts","<android><alertdialog>","1","0","","",""
"3655152","1","3655237","","2010-09-07 01:11:48","0","66","<p>i created a database with 6 columns and i have a create and update method in my class that takes 6 parameters/arguments which represent these columns. my problem is that, anytime i try to update or create the database without using all 6 arguments (setting some to null), i get an  error ""constraint failed"". this is most particular with the update method. </p><p>any ideas how i can get around this? because sometimes i don't want to fill all columns. I have removed the ""text not null"" constraint when creating the database.  Thank you.</p>","316843","","","","","2010-09-07 01:40:22","slight misunderstanding with sqlite database in android","<android>","1","0","","",""
"3655175","1","3655219","","2010-09-07 01:22:02","1","1265","<p>I have a layout that is three linear layouts.  The top has some icons and the middle has a tabhost.  Each tabhost has a list inside it.  The bottom linearlayout has two buttons that should stay at the bottom on the screen at all times.  The problem is when a list in the tabhost gets too long, it displays over the buttons.  I tried to find some way to get the buttons to bedisplayed over the list but have failed so far.  Any help would be appreciated. :-)  Thanks!</p><pre><code>&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TabHost         android:id=""@android:id/tabhost""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""&gt;        &lt;LinearLayout             android:orientation=""vertical""            android:layout_width=""fill_parent""             android:layout_height=""395dp""            android:background=""#000000""&gt;            &lt;TabWidget                 android:id=""@android:id/tabs""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""             /&gt;            &lt;FrameLayout                 android:id=""@android:id/tabcontent""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:padding=""5dp""             /&gt;        &lt;/LinearLayout&gt;    &lt;/TabHost&gt;&lt;/LinearLayout&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""horizontal"" android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:gravity=""fill""android:layout_margin=""0dp"" android:padding=""0dp"" &gt;&lt;Button     android:id=""@+id/btnGroup""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:text=""Ptt""     android:layout_gravity=""bottom""     android:layout_weight=""2""    android:hapticFeedbackEnabled=""true""/&gt;&lt;Button     android:id=""@+id/btnMenu""     android:layout_width=""fill_parent""    android:layout_height=""wrap_content""     android:text=""Menu""     android:layout_gravity=""bottom""    android:layout_weight=""2""     android:hapticFeedbackEnabled=""true""/&gt;&lt;/LinearLayout&gt;</code></pre>","441017","","441017","","2010-09-08 11:19:39","2010-09-08 11:19:39","Keep Buttons at bottom of layout visible when list is long","<android><layout><button>","1","0","","",""
"3655186","1","","","2010-09-07 01:25:01","0","920","<p>I've got it wrapped in a try catch, but the exception still trips that ugly screen.</p><pre><code> URL u = null;    try {      u = new URL(txturl.getText().toString());        }    catch (MalformedURLException e) {     ReportError(e,""Unable to connect to ""+u);    }</code></pre><p>calls this:</p><pre><code>    private void ReportError(Exception e, String message){Display(message+"" - ""+ e.getMessage().toString());System.out.println(""&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ""+message+"" - ""+e.getMessage().toString());printStackTrace();</code></pre><p>}</p><p>Any way around this. It happens on the Android 2.2 emulator with Eclipse and on my Sprint Hero.</p><p>Do I have to validate the form?</p><p>Thanks.</p>","440279","","","","","2010-09-07 15:55:01","Android Error handling - Sorry - The application has stopped unexpectedly","<android><validation><exception><forms>","1","1","","",""
"3655230","1","","","2010-09-07 01:38:22","0","1702","<p>I have a gallery with 7 images.How can I get the position when stop the scrolling of a <code>Gallery</code>?</p>","411452","","119895","","2011-06-18 13:56:32","2011-06-18 13:56:32","Gallery Position After scrolling","<android><gallery>","2","0","","",""
"3655358","1","3662998","","2010-09-07 02:22:02","1","546","<p>If you take an apk off the android filesystem and change the extention to .zip then open one of the xml files it won't work because it's encoded in dex. But you can run ./adb dexdump -l xml layout.xml > ~/Desktop/layout.xml then edit it to your likeing. I can't figure out how to get it back in the apk though. I think I need to encode it back into dex then just add it back in the archive. Can anyone tell me how to encode it into dex? </p>","428740","","","","","2010-09-07 21:44:08","Assemble a dex file","<android><xml><apk><dex>","1","0","2","",""
"3655373","1","5075440","","2010-09-07 02:29:36","0","4994","<p>I want to receive the WAP Push Message. My code is post as follow:</p><pre><code>public class PushMsgReceiver extends BroadcastReceiver {public final static String TAG = ""Push Receiver"";private static final String SMS_RECEIVED = ""android.provider.Telephony.SMS_RECEIVED"";private static final String PUSH_RECEIVED = ""android.provider.Telephony.WAP_PUSH_RECEIVED"";@Overridepublic void onReceive(Context context, Intent intent) {    // TODO Auto-generated method stub    Log.i(TAG, ""Intent recieved: "" + intent.getAction());     if (intent.getAction().equals(SMS_RECEIVED)) {        //toast to show result        Log.i(TAG, ""SMS: "" + intent.getAction());        Toast.makeText(context, ""SMS_RECEIVED"", Toast.LENGTH_LONG).show();    }    if (intent.getAction().equals(PUSH_RECEIVED)) {         //toast to show result        Log.i(TAG, ""PUSH: "" + intent.getAction());        Toast.makeText(context, ""PUSH MSG"", Toast.LENGTH_LONG).show();    }}</code></pre><p>}</p><p>The manifest is post as follow:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.test.pushmsg""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".main""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;receiver android:enabled=""true"" android:name="".PushMsgReceiver""&gt;     &lt;intent-filter&gt;      &lt;action android:name=""android.provider.Telephony.WAP_PUSH_RECEIVED"" /&gt;      &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED"" /&gt;     &lt;/intent-filter&gt;    &lt;/receiver&gt;&lt;/application&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_WAP_PUSH""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre><p>It can receive the SMS_RECEIVED,but can not receive the WAP_PUSH_RECEIVED. So Who knows why? I have try to use registerReceiver(),but it doesn't work either.</p>","787182","","787182","","2010-09-07 02:45:32","2012-03-01 00:45:46","Can not receiver android.provider.Telephony.WAP_PUSH_RECEIVED","<android><push><broadcastreceiver><wap>","3","2","","",""
"3655398","1","3655451","","2010-09-07 02:38:10","2","3264","<p>I have a ListView, and within each list item I have some TextViews and a CheckBox. When I check a CheckBox and my onCheckedChangeListener fires, everything works as it should. However, random other checkboxes get checked once one is checked. Here is an example.</p><p>If I click on the first CheckBox:8 is checked.15 is checked.21 is checked.27 is checked.33 is checked.41 is checked.Then if I scroll all the way up, none are checked until 6. The next being 13.</p><p>Basically... what is going on?</p>","205910","","","","","2014-02-05 15:05:37","Android: Problem With ListViews and CheckBoxes","<java><android><listview><checkbox>","4","0","1","",""
"3655412","1","","","2010-09-07 02:44:31","0","301","<p>I am trying to create a service that will use an AIDL-generated interface.  How can I make the interface available to applications in other APKs?</p><p>Thanks!</p>","441053","","","","","2010-09-07 11:23:21","How to share service interface with other APKs?","<android>","1","0","","",""
"3655432","1","","","2010-09-07 02:52:51","0","1878","<p>We can view an image with code:</p><pre><code>Intent intent = new Intent();  intent.setAction(android.content.Intent.ACTION_VIEW);  File file = new File(""/sdcard/test.jpg"");  intent.setDataAndType(Uri.fromFile(file), ""image/*"");  startActivity(intent); </code></pre><p>What if we have some images? How can we put the extras to let the viewer know we have </p><p>/sdcard/a.jpg, /sdcard/b.jpg, /sdcard/c.jpg ?</p><p>I hope to do this in a time because starting an activity is very expensive. </p><p>can any one help me? Thanks!</p>","414787","","95313","","2011-04-18 08:34:49","2011-04-18 08:34:49","Android: View multiple image with system image viewer","<android><image><view><android-intent>","2","0","","",""
"3655509","1","3686736","","2010-09-07 03:16:12","13","2017","<p>I want to publish an application that specifically runs only on 800x480 or higher screens.</p><p>I don't want users with 480x320, 320x240 etc devices to get it from Android Market. How do I configure it?</p><p><a href=""http://developer.android.com/guide/appendix/market-filters.html"" rel=""nofollow"">Market Filters</a> seems to have the answer but I still don't get it.</p>","11238","","","","","2012-06-06 10:09:54","Target only high-resolution (pixels) devices on Android Market","<android><filter><google-play><screen-resolution>","5","0","1","",""
"3655679","1","3942183","","2010-09-07 04:00:38","0","4222","<p>I'm building a list of contacts, where the user can select more than one one contact.Currently the android layouts only provide a multiple select with a single textview and a checkbox, what I want to do is have the name and number and a checkbox (two textviews and a checkbox). When I implement this with a custom layout, and when the user clicks on the list, the check boxes don't get ticked. I tried to bind the checkbox to the listview but it didnt work. Any help would be much appreciated. </p>","311001","","","","","2012-01-03 17:34:55","Android Listview, cursor adapter with custom multiple select","<android><listview><adapter><checkboxlist>","2","0","1","",""
"3655814","1","3655866","","2010-09-07 04:36:24","3","732","<p>how can we pass the value to receiver...i am using alarm manager...</p>","421645","","","","","2010-09-07 04:51:08","pass values in alarm manager","<android>","1","0","","",""
"3655936","1","","","2010-09-07 05:10:39","0","234","<p>How to find the release date of an app in the android market? I want to know when some apps with a big number of downloads where release to have a look on how long it took them to get there.</p>","1746300","","114066","","2010-09-07 06:59:27","2010-09-07 06:59:27","find app released date in android","<android><google-play>","1","0","","",""
"3655957","1","","","2010-09-07 05:15:44","0","605","<p>How to find runnning process in our android mobile phone programmatically?</p>","441105","","1108213","","2012-03-16 16:44:25","2012-03-16 16:44:25","finding running process in android","<android>","1","0","","",""
"3655987","1","","","2010-09-07 05:23:56","8","1598","<p>I use the android.os.Handler class to perform tasks on the background. When unit testing these, I call <code>Looper.loop()</code> to make the test thread wait for the background task thread to do its thing. Later, I call <code>Looper.myLooper().quit()</code> (also in the test thread), to allow the test thread to quit the <code>loop</code> and resume the testing logic.</p><p>It's all fine and dandy until I want to write more than one test method.</p><p>The problem is that Looper doesn't seem to be designed to allow quitting and restarting on the same thread, so I am forced to do all of my testing inside a single test method.</p><p>I looked into the source code of Looper, and couldn't find a way around it.</p><p>Is there any other way to test my Hander/Looper code? Or maybe some more test friendly way to write my background task class?</p>","441114","","","","","2013-01-21 12:49:18","How to better unit test Looper and Handler code on Android?","<android><multithreading><unit-testing><looper>","4","1","1","",""
"3656023","1","3656072","","2010-09-07 05:35:01","0","104","<p>I have a class structure such as following for storing static final constants:</p><pre><code>public final class A{  //..list of constants public final class B{  //..list of constants  public final class C{  // ..list of constants  } }}</code></pre><p>If I need to access static constants of class C(say about 10 to them) in some thread, which of the two approaches is better(faster)? Does it even make a difference? Is this some optimization that is VM specific? I am running this code on Android platform:</p><pre><code>void doIt(){A.B.C temp;S.O.P(temp.FIELD1);S.O.P(temp.FIELD2);...S.O.P(temp.FIELD10);}//ORvoid doIt(){S.O.P(A.B.C.FIELD1);S.O.P(A.B.C.FIELD2);...S.O.P(A.B.C.FIELD10);}</code></pre>","236128","","","","","2010-09-07 05:46:41","Accessing static field: caching handles locally","<java><android><performance>","1","0","","",""
"3656092","1","","","2010-09-07 05:53:58","1","357","<p>How to setup a https connection in android to get a response type of XML ....?</p>","323101","","","","","2010-09-07 05:53:58","https connection in android","<android><http><https>","0","0","1","",""
"3656110","1","","","2010-09-07 05:57:58","-1","188","<p>How can I fetch recurring events from native android calendar?</p>","441133","","436641","","2011-09-18 15:02:47","2011-09-18 15:02:47","Recurrent events","<android>","1","0","","",""
"3656139","1","","","2010-09-07 06:04:56","5","13171","<p>I want to determine the available height and width of the parent layout to which I have to add my view. </p><p>I have used many methods on layout like</p><ul><li>layout.getHeight()</li><li>layout.getRootView().getHeight()</li></ul><p>All these methods return 0(zero) as the result.</p><p>My main requirement is to be able to give width to a view that is some % of the width of the layout . </p><p>Also I dont want to use tag for this. I want to do it through code.</p><p>Thanks in advance.</p>","440432","","","","","2013-01-16 17:40:29","Android - get Height of the parent layouut","<android>","5","0","1","",""
"3656169","1","3657097","","2010-09-07 06:12:55","0","604","<p>develop one app speech to text conversion on mobile phones.i want to develop it for supporting all mobile(android,iphone,wince,windows 7,webos).for that i would like to develop one api.</p><p>is there any way  develop api for supporting all above os.Please Let me know and suggest me.any other way</p><p>Thanks in advance</p><p>aSwan</p>","1746300","","","","","2010-09-07 08:41:04","develop speech to text conversion api for mobile os","<iphone><android><windows-mobile><webos>","1","0","","",""
"3656170","1","3656194","","2010-09-07 06:13:03","1","777","<p>I want to make http connection which ensures that it is done through wifi only,so that I can not be charged for the transfer of packet from GPRS or 3G network.</p><p>It means what ever the connection available I can use only wifi that I want to ensure through Application itself..</p><p>All help is appreciated. </p>","1386533","","222159","","2010-09-07 06:14:51","2010-09-07 06:18:48","Android: Using Wifi connection through Application","<android>","1","0","","",""
"3656253","1","","","2010-09-07 06:33:28","1","788","<p>My Android app displays data in a table. How do I display a grid separating the cells, so that it's easier to visually follow rows and columns? I didn't find <em>any</em> option pertaining to grid in the android.widget.TableLayout class...</p><p>Michael</p>","423411","","","","","2010-09-07 06:52:00","Can one display a table's grid?","<android>","1","0","","",""
"3656255","1","","","2010-09-07 06:33:37","5","6287","<p>i am using custom notification...how can i set no of notification is showing?and list out those notification?this is my code...</p><pre><code>public void onReceive(Context context, Intent intent) {        Toast.makeText(context, ""coming"", Toast.LENGTH_LONG).show();        Bundle descBundle = intent.getExtras();        CharSequence desc = descBundle.getString(""description"");        int reminderId = descBundle.getInt(""reminderId"");        NotificationManager mNotificationManager;        mNotificationManager = (NotificationManager) context                .getSystemService(Context.NOTIFICATION_SERVICE);        PendingIntent contentIntent = PendingIntent.getActivity(context,                reminderId, new Intent(), PendingIntent.FLAG_UPDATE_CURRENT);        RemoteViews contentView = new RemoteViews(context.getPackageName(),                R.layout.main);        contentView.setImageViewResource(R.id.image, R.drawable.reminder_1);        contentView.setTextViewText(R.id.text, desc);        Notification notifyDetails = new Notification();        notifyDetails.icon = R.drawable.reminder_1;        notifyDetails.when = System.currentTimeMillis();        notifyDetails.tickerText = desc;        notifyDetails.iconLevel = 1;        notifyDetails.number = reminderId;        notifyDetails.contentView = contentView;        notifyDetails.contentIntent = contentIntent;        mNotificationManager.notify(0, notifyDetails);    }</code></pre><p>i am using this code to show the notification...but it shows only one notification content...but icon shows no of notification...</p>","421645","","437703","","2010-12-17 13:54:08","2012-03-06 11:28:59","Multiple notifications with one status bar icon in android","<android><notifications>","2","1","1","",""
"3656371","1","3656409","","2010-09-07 06:55:03","31","20298","<p>is it possible to have a string value in string.xml of the sort "" some string <strong>PLACEHOLDER1</strong> some more string"" so that the place holders can be assigned the value at run time.</p>","392574","","","","","2012-04-09 23:22:30","dynamic String using String.xml?","<android><string>","2","0","24","",""
"3656412","1","3656435","","2010-09-07 07:01:55","0","756","<p>I am working Android App where a file is given its location like the given below:</p><p>the method is like thispublic booelean log(ApplicationInfo  aplinfo)  <br>{                              <br></p><p>ApplicationInfo objAppinfo; <br>objAppinfo = apinfo;   <br></p><p>_strFilePath = objAppinfo.dataDir;   <bR>_strFilePath += ""/"";  <br>}  <br></p><p>where Appicationinfo is my activity name.</p><p>When I see in logcat I am getting file path as </p><p>09-07 06:34:41.355: INFO/System.out(525): <br> FileName::::::::::/data/data/com.andr.activity/Info_SA1.txt <br>my doubt is where can I find this file ,where does this file exists. When I am trying read the contents of this file , then the contents that are written in to this file are also visible. But I am not able to find the physical location of the file.where does data/data/com.andr.activity path exists?Can Any one help me in sorting out this issue?Thanks in Advance.</p>","429501","","","","","2010-09-07 09:39:18","where does dataDir in Android","<android>","1","0","","",""
"3656417","1","3658158","","2010-09-07 07:02:40","0","2447","<p>I have few queries on Android SQLiteDatabase</p><p>1.) As normally the database stored in internal memory, can we specify the path of external storage and use it in similar way ?2.) How to determine the size of available space of database ? I used getMaximumSize() from SQLIteDatabase class but that gives me 1099511626752Is this in bytes ? If assumed then this seems to be too large and not practical. I am using HTC G1 to test this.3.) How can I determine the size of an entry in table ? Or do I have to pull the whole table and manually see its size. Is it same that would be in phone storage ?4.) Can I check if any free space available before making entry in database ? I want to prevent SQLiteFullException.</p><p>Thanks.  </p>","315619","","","","","2010-09-07 11:19:33","How to determine android database max size and prevent SQLiteFullException?","<android>","1","0","1","",""
"3656572","1","3656642","","2010-09-07 07:27:12","0","2036","<p>In my application I need to set dynamic text to my textview so I want it to get resized dynamically. I have set:</p><pre><code>&lt;TextViewandroid:id=""@+id/TextView02"" android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:textStyle=""normal""android:layout_weight=""1""android:singleLine=""false""android:minLines=""4"" /&gt;</code></pre><p>And from java code I am setting <strong>text</strong> of the <strong>textview</strong> at runtime..</p><p>My textview height is not going beyond 1 line and the text is getting cut. Can anybody please help?</p><p>Thanx in advance.And from java code I am setting <strong>text</strong> of the <strong>textview</strong> at runtime..</p><p>My textview height is not going beyond 1 line and the text is getting cut. Can anybody please help?</p><p>Thanx in advance.</p>","435025","","55093","","2011-10-31 13:59:40","2012-05-26 15:30:26","How to dynamically set textview height android","<android>","3","2","0","",""
"3656586","1","3668872","","2010-09-07 07:29:22","9","4462","<p>How can I get background color and text color (default for child views) of an Activity in Java?</p>","121968","","121968","","2012-01-07 17:08:33","2012-01-07 17:08:33","Android: How to get background color of Activity in Java?","<java><android><activity>","1","0","3","",""
"3656594","1","","","2010-09-07 07:30:48","6","7981","<p>In order to generate the notifications i need to know about how to generate the low battery and low memory interrupts programmatically. Can any one please provide your suggestions.I am aware of Intents.</p>","395494","","65977","","2010-09-07 08:28:24","2013-09-26 08:14:55","Simulate low battery & low memory in Android","<android>","3","0","1","",""
"3656691","1","3656986","","2010-09-07 07:44:56","0","949","<p>I am working on an Android Application where I need to work on thread which is a well known concept of Java. I am having a thread named ""thrd"" in my application and I want to call it in the else part of the IF...Else loop.</p><p>Can anyone please tell me how can I call that thread in my loop, Sorry I am totally new as far as working with Java or Android is concerned.</p><p>Thanks for the help in Advance,david</p>","422859","","","","","2010-09-07 08:38:04","Thread Calling in Android","<java><android>","2","1","","",""
"3656765","1","3942902","","2010-09-07 07:53:40","6","8034","<p>DDMS is not able to send location to the emulator. I have tried sending just the location from DDMS but still the emulator is not able to receive location. The application works properly in the device but its not able to capture location data in the emulator.</p><p>I am testing on Android 2.2 emulator. Can anyone let me know what can be the issue?</p>","261566","","","","","2014-03-09 09:42:24","DDMS not able to send location to emulator","<android><location><ddms>","4","0","1","",""
"3656872","1","3656958","","2010-09-07 08:10:44","0","976","<p>I downloaded Android SDK when I run setup, it displays the following error message.</p><blockquote>  <p>Failed to fetch URL <a href=""https://dl-ssl.google.com/android/repository/repository.xml"" rel=""nofollow"">https://dl-ssl.google.com/android/repository/repository.xml</a>, reason: HTTPS SSL error. You might want to force download through HTTP in the settings.</p></blockquote><p>Any hints?</p>","438627","","301832","","2010-09-07 08:21:07","2011-11-02 00:17:39","HTTPS SSL error while installing android","<android><ssl><openssl>","2","0","","",""
"3657082","1","3657162","","2010-09-07 08:39:23","0","767","<p>I am trying to drag a view over the screen</p><pre><code>FrameLayout main = (FrameLayout) findViewById(R.id.main_view);final Ball bigball;bigball = new Ball(this,50,50,25, 0xFFFF0000);main.addView(bigball);</code></pre><p>This draws a red circle on my screen. How and where do I need to implement my touchscreen-handling, if I want it <em>only</em> to trigger if someone touches the red circle rather than the remainder of the screen?</p><p>Ball.Java is a separate class:</p><pre><code>public class Ball extends View </code></pre><p>I know I could check the coordinates where the user touched the screen and then compare that to where the circle is, but there must be a way to simply check the ID or some other reference of the circle, right?</p><p>Everything I have looked at and tried so far would run my code regardless of where the touch started or stopped on the screen. (So I can move the ball, I can draw lines on the screen with my finger and everything. But I cannot tell if I touched the red circle.)</p><p>Can anyone expain this to me in simple words, please? (And forgive me for using equally simple words in my question. I no longer feel I have a clue what I'm doing here, and I by now I would just not use big words like ""Listener"" or ""Event"" correctly anymore.</p><p>Thanks.</p>","441248","","4092","","2010-09-07 08:42:02","2010-09-07 08:50:49","Identify the View that triggered a touch-event","<android><view><touch>","1","0","","",""
"3657243","1","3657649","","2010-09-07 09:02:12","7","4581","<p>I have an imageview and when clicked, calls <code>OnClickListener.onClick(View v)</code>. How do I get the exact point/coordinate that the user clicked?</p><p>Thanks</p>","409853","","","","","2010-09-07 10:07:28","How do i get the point/coordinate the user clicked on an android view?","<android><view><onclick>","1","0","1","",""
"3657284","1","","","2010-09-07 09:10:09","-1","2914","<p>My phone has an IP.I would like to know how could I retrieve it? After searching in the web, I found that i can get only the current outside ip.(I want the local-perm ip of my phone)</p><p>Thanks,</p><p>ray.</p>","260511","","260511","","2010-09-07 09:15:26","2011-05-09 12:32:20","Get my phone's Internal ip","<android>","3","2","","",""
"3657294","1","6767211","","2010-09-07 09:11:32","0","161","<p>Hello i m Working On Application That Requires Northwest and Southeast Coordinates of Mapview when i zoom or pan around map...i want to calculate distance between this two Geopoints...</p><p>Guide Me Please...</p><p>Thanx.. </p>","392506","","","","","2011-07-20 19:12:36","Northwest and SouthEast coordinates of mapView","<android>","1","0","","",""
"3657382","1","3659104","","2010-09-07 09:23:15","6","796","<p>I've noticed that Android, WPF, and Silverlight all follow a two-pass layout pattern. There's a recursive Measure() method that gets called to size the element, possibly multiple times. Then a recursive Layout/Arrange() method is called which lays out the exact positions of children in their parent control, and will also set the final size of the control.</p><p>My question: why is this split into two passes, especially when, for some types of controls, Measure() can't compute the actual size of a control without actually laying out the positions of the children? Is there some type of layout minority case that is made possible by this?</p><p>I'm trying to create my own UI toolkit, and I'm currently leaning toward a one-pass Layout() pattern, but I'd like to be convinced whether this is wise or not.</p><p>Thanks for reading this :)</p><p>Sean</p>","345651","","","","","2010-09-08 09:10:59","Two-pass UI Layout : Why?","<android><wpf><silverlight><user-interface><layout>","1","0","3","",""
"3657404","1","","","2010-09-07 09:25:33","0","1654","<p>Im having trouble to make work the viewflipper. I created a xml layout file view_flipper.xml :</p><pre><code>&lt;ViewFlipper xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/flipper""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;include android:id=""@+id/MainView""  layout=""@layout/gallery_1"" /&gt;    &lt;include android:id=""@+id/SearchView""  layout=""@layout/search_internal"" /&gt;&lt;/ViewFlipper&gt;</code></pre><p>the layout gallery_1 is just a ListView.the layout search_internal has an edittext, a button, and a listview.</p><p>Im using :</p><pre><code> ViewFlipper theFlipper=(ViewFlipper) findViewById(R.id.flipper);    theFlipper.setDisplayedChild( R.id.SearchView );</code></pre><p>to change the layout, but its apparently work for the code, but on the display, nothing is happening... Can someone help ?</p><p>Here is the code of the layout search_internal :</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:id=""@+id/SearchBox""&gt;&lt;EditText android:text="""" android:id=""@+id/QueryText"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:layout_marginRight=""100px""&gt;&lt;/EditText&gt;&lt;Button android:layout_height=""wrap_content"" android:id=""@+id/BtnOk"" android:layout_width=""wrap_content"" android:layout_alignParentRight=""true""android:text=""@string/searchBtnTxt""android:clickable=""true""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;ListViewandroid:id=""@+id/list_view_id""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_below=""@id/SearchBox""android:background=""#FFFFFF""android:cacheColorHint=""#FFFFFF""android:layout_marginBottom=""65dip""android:gravity=""top""/&gt;&lt;/RelativeLayout&gt;</code></pre>","429222","","1226310","","2012-04-28 23:52:50","2012-04-28 23:52:50","android viewflipper not changing view : HELP ! :)","<android><viewflipper>","1","1","1","",""
"3657409","1","","","2010-09-07 09:25:52","1","1009","<p>I am using Android 2.1 sdk with Motorolad Droid A855 model, when try to connect to Bluetooth (Socket SPP ), I am getting the following error as per logcat, and getting exception throw in socket.conect();</p><pre><code> 09-07 05:03:40.874: ERROR/BluetoothEventLoop.cpp(1102): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/1142/hci0/dev_00_0E_6D_BA_89_F309-07 05:03:41.217: DEBUG/BluetoothService(1102): updateDeviceServiceChannelCache(00:0E:6D:BA:89:F3)09-07 05:03:41.233: DEBUG/BluetoothService(1102): Cleaning up failed UUID channel lookup: 00:0E:6D:BA:89:F3 550e8400-e29b-41d4-a716-446655440000 09-07 05:03:41.241: INFO/BTconnect(1650): Step 7 09-07 05:03:41.241: ERROR/--------Inner Exception-----(1650): Socket not conncected 09-07 05:03:41.256: VERBOSE/BluetoothEventRedirector(1660): Received android.bleutooth.device.action.UUID09-07 05:03:41.327: INFO/ActivityManager(1102): Displayed activity com.sample.BT/.BluetoothDemo: 947 ms (total 947 ms)09-07 05:03:45.038: ERROR/BluetoothEventLoop.cpp(1102): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/1142/hci0/dev_00_0E_6D_BA_89_F309-07 05:03:46.499: VERBOSE/BluetoothEventRedirector(1660): Received android.bleutooth.device.action.UUID</code></pre><p>and here is my code</p><pre><code>public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  out = (TextView) findViewById(R.id.out);  // Getting the Bluetooth adapter  BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();  out.append(""\nAdapter: "" + mBluetoothAdapter);   UUID uuid = UUID.fromString(""550e8400-e29b-41d4-a716-446655440000"");  if(mBluetoothAdapter==null) {    out.append(""\nBluetooth NOT supported. Aborting."");   return;  }  Log.i(""BTDemo"", "": ""+ mBluetoothAdapter.isEnabled());  if (!mBluetoothAdapter.isEnabled()) {   Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);   startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);  }  else  {   out.append(""\nBluetooth Adapter Enabled"");   }  try {   BluetoothDevice devices=mBluetoothAdapter.getRemoteDevice(""00:0E:6D:BA:89:F3"");   if(devices!=null)   {    socket = devices.createRfcommSocketToServiceRecord(uuid);    Log.i(""In Socket"",""Socket""+socket);    Log.i(""BTconnect"", ""Step 4"");   }   else   {    Log.e(""BTConnect"",""Bluetooth device is null"");    return ;   }   Log.i(""BTconnect"", ""Step 5"");   // Listing paired devices   out.append(""\nDevices Pared:"");   //BluetoothDevice devices;   Set&lt;BluetoothDevice&gt;  pairedDevices = mBluetoothAdapter.getBondedDevices();   for (BluetoothDevice device:  pairedDevices)    {    out.append(""\nFound device: "" + device);   }  } catch (Exception e) {   e.printStackTrace();  }  try{   if(socket !=null) // checking for socket is created or not   {    socket.connect();    Log.i(""BTconnect"", ""Step 6"");    Log.i(""BTconnect"", ""Socket Connected"");    out.append(""\n Socket Connected"");   }   else   {    out.append(""\n\n Socket is Null"");   }  }catch(Exception e)  {   Log.i(""BTconnect"", ""Step 7"");   Log.e(""--------Inner Exception-----"", ""Socket not conncected"");   out.append(""\n\n\n --------Inner Exception----- Socket not conncected"");   try {    socket.close();    out.append(""\n\n  Socket closed"");   } catch (IOException closeException)    {    Log.e(""InitBluetoothDevice"",""while closing socket in catch block of connect()""+closeException.getMessage());    out.append(""\n\n --------Exception----- while closing socket"");   }  } }</code></pre><p>and the manifest file is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.sample.BT""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".BluetoothDemo""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;&lt;uses-permission android:name=""android.permission.BLUETOOTH""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.BLUETOOTH_ADMIN""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre><p>I tried to connect using different UUID's but no success</p><p>Here is that exception I got from Logcat:</p><pre><code>09-07 06:24:14.077: VERBOSE/BluetoothEventRedirector(1649): Received android.bleutooth.device.action.UUID09-07 06:24:14.077: DEBUG/BluetoothService(1098): Cleaning up failed UUID channel lookup: 00:0E:6D:BA:89:F3 550e8400-e29b-41d4-a716-44665544000009-07 06:24:14.085: ERROR/--------Inner Exception-----(1769): Socket not conncected09-07 06:24:14.085: WARN/System.err(1769): java.io.IOException: Service discovery failed09-07 06:24:14.101: WARN/System.err(1769):     at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:377)09-07 06:24:14.101: WARN/System.err(1769):     at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:201)09-07 06:24:14.101: WARN/System.err(1769):     at com.sample.BT.BluetoothDemo.onCreate(BluetoothDemo.java:89)09-07 06:24:14.101: WARN/System.err(1769):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-07 06:24:14.101: WARN/System.err(1769):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)09-07 06:24:14.101: WARN/System.err(1769):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)09-07 06:24:14.101: WARN/System.err(1769):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)09-07 06:24:14.101: WARN/System.err(1769):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)09-07 06:24:14.101: WARN/System.err(1769):     at android.os.Handler.dispatchMessage(Handler.java:99)09-07 06:24:14.101: WARN/System.err(1769):     at android.os.Looper.loop(Looper.java:123)09-07 06:24:14.101: WARN/System.err(1769):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-07 06:24:14.101: WARN/System.err(1769):     at java.lang.reflect.Method.invokeNative(Native Method)09-07 06:24:14.101: WARN/System.err(1769):     at java.lang.reflect.Method.invoke(Method.java:521)09-07 06:24:14.101: WARN/System.err(1769):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-07 06:24:14.109: WARN/System.err(1769):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-07 06:24:14.109: WARN/System.err(1769):     at dalvik.system.NativeStart.main(Native Method)09-07 06:24:14.249: INFO/ActivityManager(1098): Displayed activity com.sample.BT/.BluetoothDemo: 3640 ms (total 3640 ms)09-07 06:24:16.874: VERBOSE/BluetoothEventRedirector(1649): Received android.bleutooth.device.action.UUID09-07 06:24:18.046: ERROR/BluetoothEventLoop.cpp(1098): event_filter: Received signal org.bluez.Device:PropertyChanged from /org/bluez/1137/hci0/dev_00_0E_6D_BA_89_F3</code></pre><p>Can some body help in connecting to bluetooth,</p>","428136","","19679","","2011-02-28 17:15:05","2011-02-28 17:15:05","Unable to connect to Bluetooth on Motorola Droid A855","<android>","0","5","1","",""
"3657417","1","3819126","","2010-09-07 09:27:22","1","531","<p>I have one android project.I have one class file of about 6000 lines when i tried to add more code it shows the java.lang.verifyerror<br>please help me out</p>","441224","","133203","","2010-09-07 09:29:38","2010-11-24 22:51:06","java.lang.verifyerror in android","<android>","2","6","1","",""
"3657452","1","","","2010-09-07 09:33:03","-1","188","<p>i want display multiple notification in single icon</p>","421645","","421645","","2010-09-07 10:31:04","2010-09-07 11:16:07","can we recognize statusbar already have notification icon in android?","<android>","1","3","","2012-08-23 01:26:02",""
"3657473","1","3657503","","2010-09-07 09:37:44","0","533","<p>I can't seem to get things to display programatically using text views? I have a main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    &gt;    &lt;TextView android:id=""@+id/username""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""Name""    /&gt;    &lt;Button android:id=""@+id/button""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Hello, I am a Button""     /&gt;&lt;/LinearLayout&gt;</code></pre><p>Then in my code, I use:</p><pre><code>//Update the GUIsetContentView(R.layout.main);TextView guiStr;guiStr = (TextView)findViewById(R.id.username);guiStr.setText(username);</code></pre><p>But the username does not display on the screen. I get just the default text in the XML. What am I doing wrong?</p>","330368","","","","","2010-09-07 09:42:57","Updating TextView","<java><android>","1","0","","",""
"3657515","1","3657598","","2010-09-07 09:45:46","7","5531","<p><img src=""http://i.stack.imgur.com/sCVQQ.png"" alt=""alt text""> <img src=""http://i.stack.imgur.com/Ik4Oi.png"" alt=""alt text"">d   I want to display the image like first image but my images are displaying like second image i want to display images like first image, like center in screen and equal spaces top and bottom look first image,but my images are displaying not center in screen and no spaces in top,what can i do for display image like first images...anybody knows,please give solution for that<strong>Thanks All</strong></p>","410757","","382920","","2011-08-08 18:14:27","2011-08-08 18:14:27","How can i display image in screen center?","<android><android-layout>","1","1","5","",""
"3657587","1","3658196","","2010-09-07 09:57:16","5","12402","<p>I want to download image from distant server and use it as resource.Is it possible ?How can I do this ?</p>","348175","","","","","2012-12-19 19:39:03","Android - How to download an image and use it as new resource?","<android><image><resources><download>","4","0","3","",""
"3657682","1","3658104","","2010-09-07 10:11:06","3","1749","<p>I love how Android automaticly displays a number of menuitems in the options menu and when there are too many for your screen, it displays a 'More' button. I'd like to keep it that way, but the menuitems in the popup that you get when you press 'More' don't have the menuicons. Is there a way that I can overrule this? If not, how can I display my own popup when the user clicks 'More'? I still want that Android figures out how many menuitems fit on the users screen.</p><p>Thanks a lot!Erik</p>","419625","","","","","2010-09-07 11:11:50","Android: Optionsmenu 'More-list' with icons","<android><menu>","1","0","2","",""
"3657789","1","3657845","","2010-09-07 10:29:12","0","660","<p>mp=MediaPlayer.create(AlarmAlert.this, R.raw.clear);mp.seekTo(0);mp.start();</p><p>I use this code in my application, it's working when i try it in android emulator.The application size is around 356KB in emulator.But when i install the .apk in my phone there are o sound at all and the application size only around 50 KB.</p><p>What could be the problem? Installation problem??</p><p>Thanks.     </p>","430926","","","","","2010-09-07 10:37:35","Playing sound in android","<android><audio>","1","0","","",""
"3657793","1","","","2010-09-07 10:30:12","6","6117","<p>I want to use a Bitmap that Tile on the Horizontal only, is there any way to do it, so that it will expand only on X like repeat x on CSS.I using the following code but the bitmap tile Horizontal and vertical :</p><p><code></code></p>","405765","","","","","2011-03-09 15:44:11","Android Bitmap Tile on X Only","<android><bitmap>","1","1","","",""
"3657798","1","3658649","","2010-09-07 10:30:41","0","6012","<p>I have some critical issue related to height of TextView. I want to set the height of the TextView based on the content which is set at runtime. Here is my xml code:-</p><p><code>&lt;TextView android:id=""@+id/tv"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;</code></p><p>Here is the java code to set the height of the TextView:-</p><p>`TextView tv = (TextView) findViewById(R.id.tv);</p><p>tv.invalidate();</p><p>int height_in_pixels = tv.getLineCount() * tv.getLineHeight();</p><p>tv.setHeight(height_in_pixels);`</p><p>But the <strong>problem</strong> is; <strong>it displays only 1 line, and not the rest of the lines</strong>.</p>","435025","","435025","","2010-09-07 10:48:32","2010-09-07 12:26:52","Android - Set Height to TextView Dynamically","<android>","2","1","","",""
"3657841","1","","","2010-09-07 10:36:47","3","648","<p>I'm trying to use Google Spreadsheet api to update a cell of a worksheet.I followed the guide , tried to send a HttpPut request to do that but failed.</p><p>i got  200 OK from the following Code, but nothing be updated in the worksheet........T.T</p><pre><code>String cellUri = ""https://spreadsheets.google.com/feeds/cells/tD0jOr1kFs6yHag573hB0YA/od6/private/full/R2C2"";     HttpPut httpput = new HttpPut(cellUri);     httpput.addHeader( new BasicHeader(""Content-Type"", ""application/atom+xml""));     httpput.addHeader( new BasicHeader(""GData-Version"", ""3.0""));     httpput.addHeader( new BasicHeader(""If-Match"", ""*""));     String reqBody=""&lt;entry xmlns=\""http://www.w3.org/2005/Atom\"" xmlns:gs=\""http://schemas.google.com/spreadsheets/2006\""&gt;"" +       ""&lt;id&gt;https://spreadsheets.google.com/feeds/cells/tD0jOr1kFs6yHag573hB0YA/od6/private/full/R2C2&lt;/id&gt;"" +       ""&lt;link rel=\""edit\"" type=\""application/atom+xml\"" href=\""https://spreadsheets.google.com/feeds/cells/tD0jOr1kFs6yHag573hB0YA/od6/private/full/R2C2/a115r\""/&gt;"" +       ""&lt;gs:cell row=\""2\"" col=\""2\"" inputValue='99999'/&gt;"" +       ""&lt;/entry&gt;"";     try     {      httpput.setEntity( new StringEntity(reqBody));   HttpResponse updateCellResponse = new DefaultHttpClient().execute(httpput);   if( updateCellResponse.getStatusLine().getStatusCode() != 200)    Log.i(""html2"", ""sl : "" + updateCellResponse.getStatusLine());   //display toast notification   Toast _toast = Toast.makeText(getApplicationContext(), updateCellResponse.getStatusLine().toString() , Toast.LENGTH_SHORT);   _toast.show();     }     catch(ClientProtocolException e )     {      Log.i(""html2"", e.getMessage().toString());     }     catch(IOException e )     {      Log.i(""html2"", e.getMessage().toString());     }    }</code></pre>","422405","","186035","","2011-12-29 20:33:35","2012-02-08 17:51:20","how to use google spreadsheet api on android emulator","<android><google-data-api>","1","0","","",""
"3657901","1","","","2010-09-07 10:44:11","1","448","<p>I want to build an application that is able to read <code>.CSV</code> files.These .CSV files are downloaded NOT from within the application but just the regular Android browser.</p><p>Now, when I start my custom application, is that download available to me? Any examples?</p>","441351","","119895","","2010-09-07 11:18:25","2012-11-01 11:26:02","Can I access downloaded files from an Android application","<android>","3","0","","",""
"3657903","1","3657975","","2010-09-07 10:44:23","2","908","<p>I have a cursor adapter and the logcat is filled with above errors, as soon as I click on a view. I am already releasing the CursorAdapter's cursor in onDestroy(). </p><p>Is there any way to get information about when the cursor was opened?</p>","427112","","","","","2013-01-08 08:14:23","Problem with ""Finalizing Cursor"" error in custom CursorAdapter","<java><android><database><sqlite><cursor>","4","0","2","",""
"3657963","1","3659110","","2010-09-07 10:51:54","2","1243","<p>I know it is possible to develop a full flex application using AIR for android but what I need is to embed a flex component into an already existing classic java android application.</p><p>I found some flash players in java but they all either require a JFrame or include of specific windows dlls.</p><p>Is it even possible ? I found no info on the net about this</p><p>Thanks</p>","441347","","","","","2011-09-21 13:48:33","Is it possible to embed a flex component in a pure java android application?","<java><android><flex><flash><embed>","2","0","1","",""
"3657988","1","3658341","","2010-09-07 10:54:58","0","65","<p>I am writing an android application for sending email which launches the default mail application of android and asks to allow sending mail or not.</p><p>I want to know the type of <code>Exceptions</code> that are expected to throw in this case.I have gone through Developer guide and some other Android PDFs ,I am finding only base class <code>Exception</code>.</p><p>I want to know are there ant other exceptions that will be thrown other that exception, which we need to handle in our program.</p>","429501","","119895","","2010-09-07 11:17:31","2010-09-07 11:44:27","Exceptions that are thrown when we are writing Email application in Android","<android><android-widget>","1","0","","",""
"3658002","1","","","2010-09-07 10:57:03","3","1327","<p>I have two activities. <code>A</code> and <code>B</code>.<code>A</code> starts <code>B</code>. Both are running in the screen and both are visible. Say now <code>B</code> is visible.</p><p>On a special key press, I want to bring the <code>A</code> to the front and make it active.The problem I am facing is when the special key is pressed, another instance of <code>A</code> is launched and the new instance is brought to the front.</p><p>But I want the original <code>A</code> to come to the front. I want to make this change in the framework layer rather than application specific by using the <code>singleInstance</code> theme in the launchMode in <code>AndroidManifest</code> file.</p><p>Please help me in this regard as this is really urgent for me.Any inputs will be really valuable for me.</p>","436668","","270037","","2014-03-01 10:04:13","2014-03-01 10:04:13","Issue in Single instance of an activity in android","<android><android-emulator>","2","2","","",""
"3658055","1","","","2010-09-07 11:04:24","0","2236","<p>I am developing an application which requires android phone to be configured as a wireless access point.</p><p>Any ideas?</p>","434708","","119895","","2010-09-07 11:09:16","2010-09-07 20:28:24","Android phone as Wi-Fi access point","<android><wifi>","2","1","","",""
"3658088","1","3658106","","2010-09-07 11:08:48","0","72","<p>please give me the solution</p><pre><code>public class Calc extends Activity implements OnClickListener {       private Button clr;                   clr=(Button)findViewById(R.id.Button01);}public void onClick(View v){   case R.id.Button01:              tv1.setText(""REF"");       if( ref_flg==true)       {          final AlertDialog alertDialog = new AlertDialog.Builder(this).create();          alertDialog.setTitle(""Reset..."");          alertDialog.setMessage(""REF was already entered"");          alertDialog.setButton2(""OK"", new DialogInterface.OnClickListener()          {              public void onClick(DialogInterface dialog, int which) {                  // here you can add functions                  dialog.dismiss();              }          });          alertDialog.setIcon(R.drawable.icon);          alertDialog.show();       } }</code></pre><p>so my question is that how i can write the code in case button01 in another activity and get the result from it.</p>","441224","","117362","","2010-09-07 11:30:55","2010-09-07 11:57:47","about activities in android","<android>","2","3","","",""
"3658142","1","3675496","","2010-09-07 11:17:29","2","1170","<p>In an application I need to limit the length of drop down list displayed by AutoCompleteTextView in android to let the below buttons be visible.Can anyone help me in limiting the length of drop down list programmatically.</p>","437703","","1288","","2011-05-26 15:28:06","2012-09-12 14:43:40","How tolimit the length of drop down list displayed by AutoCompleteTextView","<android><autocompletetextview>","1","1","","",""
"3658163","1","3658239","","2010-09-07 11:19:53","1","425","<p>I am making an application which makes use of internet.</p><p>It works fine when Wifi is availble.But when wi fi is turned of then it give me error ""Address Family Not supported"".</p><p>I am using NetworkInfo Class to know the status of network availble and using WifiManager to enable and manage Wi-fi connection if available</p>","1386533","","265167","","2011-12-18 10:30:33","2011-12-18 10:30:33","Android: problem with wifi","<android><wifi>","1","0","","",""
"3658176","1","3669336","","2010-09-07 11:21:23","2","9628","<p>I want to create two new custom buttons to use in my android application.</p><p>I want them to be like this:</p><ul><li>Icon on the left</li><li>Text on the right for a button</li><li>Another button with Icon on top and text on bottom</li></ul><p>So basically I will have a png image stored in my resources that will be the button's icon. I will have another image as a 9patch stretchable as the button background. I tried something but the result is hideous, so I must be doing something wrong.</p><p>This code:</p><pre><code>   &lt;Button              android:layout_width=""100px""       android:layout_height=""100px""             android:drawableTop=""@drawable/imgIcon""             android:drawablePadding=""2px""             android:text=""Text""             android:background=""@drawable/button_background""             /&gt;</code></pre><p>Later Edit:If I make like suggested by Macarse bellow:</p><pre><code>&lt;Button android:id=""@+id/yourid""       android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:text=""Your text here""        android:drawableTop=""@drawable/imgdonetracks""&gt;&lt;/Button&gt;</code></pre><p>I get like in first image</p><p>If I make this change:</p><pre><code>&lt;Button android:id=""@+id/yourid""        android:layout_height=""wrap_content""         android:layout_width=""wrap_content""         android:text=""Your text here""         android:drawableTop=""@drawable/imgdonetracks""        android:background=""@drawable/button_background""&gt;   &lt;/Button&gt;</code></pre><p>everything get's wrong</p><p>Check image <a href=""http://img255.imageshack.us/i/android3.png/"" rel=""nofollow"">http://img255.imageshack.us/i/android3.png/</a></p>","379865","","379865","","2010-09-07 12:54:44","2010-09-08 15:28:54","Create custom buttons with icon and text","<android>","3","0","","",""
"3658199","1","4877412","","2010-09-07 11:24:54","3","543","<p>Hi: I'm Facing some problems while scanning for bluetooth devices on a HTC Desire with Android 2.2 (Froyo). Directly after device reboot, it works but when I try to scan again later I only get the following error message. Broadcasts like BluetoothDevice.ACTION_FOUND and BluetoothAdapter.ACTION_DISCOVERY_FINISHED are not received.</p><pre><code>ERROR/BluetoothEventLoop.cpp(106): event_filter: Received signal org.bluez.Adapter:PropertyChanged from /org/bluez/7229/hci0 </code></pre><p>On Nexus One (Froyo) this problem does not occur. Are there any known issues about that?</p>","281535","","995926","","2012-05-05 13:51:01","2012-05-05 13:51:01","Android Bluetooth scanning on Froyo HTC Desire","<android><bluetooth><android-2.2-froyo>","1","1","","",""
"3658285","1","3658609","","2010-09-07 11:36:23","2","1841","<p>As we know, <code>startActivityForResult()</code> used to get a result for a task from parent activity. Here when we click the <code>setResult()</code>. It returns the result to the parent Activity. </p><p>Child Activity means it should maintain the persistent state. That is when the users clicks a button on the child activity. It do not finishes that activity and show the Parent Activity. And again i may go to the child activity from parent activity. If the child does not exists it starts a new child activity else it should show the existing child activity with persistent content. </p><p><strong>Edit:</strong></p><p>Simply said, my parent Activity starts a new Child Activity. Now both Activities should be alive. How to call the Parent Activity without finishing the child Activity(in other words, How to BringtoFront the parent Activity)? For this scenario, </p><ul><li>you can not use <code>startActivity()</code>. Because it creates a new Activity Instance. Not Existing Parent Activity</li><li>you can not use <code>startActivityForResult()</code>. Because it finishes the child Activity Instance.</li></ul><p>Is that possible in Android? Any Idea?</p>","267269","","267269","","2010-09-07 12:14:43","2012-04-20 20:26:46","How to BringtoFront the Parent Activity in Android?","<android><activity><childactivity>","3","2","","",""
"3658301","1","3658357","","2010-09-07 11:38:48","0","2708","<p>I'm trying to override the <code>onBackPressed()</code> method of the <code>ActivityGroup</code> class:</p><pre><code>public class MyClass extends ActivityGroup {    @Override    public void onBackPressed() {        // do something        return;    } </code></pre><p>but I'm getting the error <code>The method onBackPressed() of type MyClass must override a superclass method</code>.</p><p>I'm relatively new to Java, I've <a href=""http://blog.henriklarsentoft.com/2010/07/android-tabactivity-nested-activities/"" rel=""nofollow"">seen here that people do it</a> and it works for them</p><p>Why I'm getting this error?   </p><p>I'm writing an app for android 1.5, could the problem be here?</p>","386817","","3171","","2010-09-07 11:56:36","2011-03-18 19:43:22","The method onBackPressed() of type FirstGroup must override a superclass method","<java><android><override>","1","1","","",""
"3658317","1","3658366","","2010-09-07 11:42:13","3","1354","<p>i want to know how to use ListView.FixedViewInfo,</p><p>so i need some code spinet which shows a demo of how to use ListView.FixedInfo , </p><p>can any one help me regarding on this.</p><p>Thanks In Advance, </p>","424413","","424413","","2011-01-21 18:40:19","2011-01-21 18:40:19","How to use ListView.FixedViewInfo?","<android>","1","0","","2012-08-26 14:07:53",""
"3658386","1","","","2010-09-07 11:52:08","5","2666","<p>Can an Android APK archive be imported into another Android project and accessed the same way as a JAR archive can?</p>","413872","","","","","2010-09-08 04:11:19","Import Android APK archive?","<android><archive><apk>","2","0","1","",""
"3658473","1","","","2010-09-07 12:02:49","1","672","<p>I'm trying to display several Images dynamically. After retrieving a url from xml parsing, I convert it to a Bitmap and loaded in image view using <code>setImageBitmap</code> in AsyncTask ,but current url image does not loaded but next url images loaded,whenever call next url,so i want to refresh or reload imageview in AsyncTask?.is it possible? possible please give code for me.. </p><p>Thanks all</p>","410757","","410757","","2010-09-07 12:07:58","2010-09-07 12:08:00","How can i reload imageview in thread?","<android>","1","0","","",""
"3658535","1","3658587","","2010-09-07 12:12:10","0","456","<p>I want to create one method and call the created Thread inside that method in my Android Application, I am new to Java as I had told before.</p><p>Can anybody giive me an example of how should I create a method and call a Thread inside that method!</p><p>Thanks,david</p>","422859","","380734","","2010-09-07 12:16:08","2010-09-07 12:24:30","Methods and threads in Java","<java><android>","2","0","","",""
"3658779","1","3658934","","2010-09-07 12:48:29","0","888","<p>How can I implement a run() method of thread if I create a Thread Global?</p><p>I mean If I create a Thread Globally then can I implement its run() method {"" public void run()""} anywhere in my Application?</p><p>In the run() method I have to write the code to perform some action.</p><p>IF I can do it then please can anyone show me briefly how to do it particularly.</p><p>I am a bit confused!!!!!</p><p>Thanks,david</p>","422859","","","","","2010-09-07 13:08:10","Threads in java","<java><android>","2","2","","",""
"3658818","1","","","2010-09-07 12:53:19","1","662","<p>I am new to android. I am creating an application in which user authentication is needed, but to authorize application user needs to login first. After that the data can be received. I just wanna know is there any procedure to login to a remote website if there is no login api available for that.i am waiting for the reply.Thanks,Arun</p>","441432","","3043","","2012-02-10 20:31:08","2012-02-10 20:31:08","How to signin/login to a website programmatically?","<android><authentication>","2","1","1","",""
"3658984","1","3659230","","2010-09-07 13:18:34","0","570","<p>It is possible to draw markers in runtime or at onLocationChange event, not on Create event?</p>","432848","","114066","","2010-09-07 13:34:45","2010-09-07 13:52:58","Android draw marker in runtime or at on LocationChange?","<android>","1","0","1","",""
"3659103","1","","","2010-09-07 13:39:06","0","255","<p>I am about to embark on a project for android that will have a free version and a premium version.</p><p>In VC++ land you would do this by adding preprocessor tags around the premium sections (or where the code would enter a premium section).</p><p>I could have two projects with separate source trees, but a bug in one would require a fix in the other.</p><p>However in Java you don't have a preprocessor so how do I go about this?  Say you have a screen with an additional button that is the premium feature how would that be handled?</p><p>I will be using Eclipse as my IDE so Eclipse-centric answer appreciated.</p>","342","","","","","2011-08-15 14:30:15","Eclipse project layout for Android with premium features","<java><android><eclipse><project-planning>","3","0","","",""
"3659135","1","3659213","","2010-09-07 13:41:48","0","826","<p>Anyone know where I can find an example of how I can get a ClientLogin token for use in Cloud to Device messaging?  I get the general idea, but I'm not exactly sure what parameters I'm supposed to be sending, and how.</p>","238849","","","","","2010-09-07 13:51:14","Cloud to Device- Example for getting a ClientLogin token for the application server","<android>","1","1","1","",""
"3659310","1","3659563","","2010-09-07 14:01:18","1","8778","<p>I want to test my build on my device. Please provide some tool/information regarding installation of application on device ? </p><p>thanks and regards,</p>","406631","","","","","2014-02-01 11:11:34","How to install apk file on the Xperia Android mobile","<android>","5","0","","",""
"3659403","1","3659487","","2010-09-07 14:10:06","2","1165","<p>I'm looking for a simple animation example using the android SDK for displaying a little animation between views.</p><p>Basically when we have a list view and a detail view - lets have a 'transition' animation between them.</p><p>Thanks</p>","347359","","","","","2010-09-07 14:21:36","Simple navigation animation with android","<android><animation>","2","0","","",""
"3659457","1","3659624","","2010-09-07 14:15:48","28","7290","<p>I'm wondering if there is something like <a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch"">9-patch</a> in Android, but for web development?</p><p>Disclosure: I have no idea about web development at all, but I was curious to know if it exists. And a simple web search with the term 9-patch didn't bring up any related results, so I figured it has either another term or it doesn't exist or is not used widely enough.</p><p>Anyone knows?</p>","184367","","","","","2013-11-06 20:35:36","Nine-patch images for web development","<html><android><css>","3","2","4","",""
"3659468","1","3659613","","2010-09-07 14:16:43","1","805","<p>I'm developing an android app (if you want more info <a href=""http://www.txty.mobi"" rel=""nofollow"">http://www.txty.mobi</a>) and I am having some problems with dialogs management. I'm quite new to Android so the way I'm doing things completely wrong. If the case please just say so pointing me to the right documentation to follow.</p><p><strong>Background:</strong>  </p><p>The main blocks of the app so far are one activity and one Service (which derives from IntentService).The actvity needs to interact with the service in just two occasions: start/stop the service. The intent service will self regulate its lifetime using the AlarmManager.</p><p><strong>A typical flow when clicking on start/stop:</strong>  </p><p><strong>1)</strong> the activity on its onResume registers a broadcast receiver to events sent by the service (unregisters it in the onPause)  </p><p><strong>2)</strong> the activity starts a indeterminate progress dialog  </p><p><strong>3)</strong> the activty sends a single shot alarm event (either start or stop) which will be send **straight away to the service  </p><p><strong>4)</strong> the service does what it needs to do to start  </p><p><strong>5)</strong> the service emits a broadcast event basically saying ""done""  </p><p><strong>6)</strong> the activity receive this event and gets rid of the dialog.  </p><p><strong>The Problem:</strong>  </p><p>The activity can lose its foreground status let's say if the user switches focus or a call is received, so the onPause method is called (at this point the activity <em>could</em> even be killed by the system to claim memory). obviously if this is the case the activity will never receive its broadcast event because the receiver has been unregistered. This will leave the app in the awkward situation, when the activity is brought again to the front, of having a dialog that you can't kill nor will never get rid of.</p><p><strong>The (possible??) solution:</strong>  </p><p>The way I am handling this now (apart for keeping the broadcast receiver in place) is by creating a utility class that uses preferences to keep track of which operations are being executed and their status:</p><p><em>Activity</em><br>- in the <em>onResume</em> using my utility class gets the list of operations the activity is waiting for<br>- check their status<br>- if they are completed perform some actions accordingly (in my case get rid of dialog!)<br>- delete the operation from the preferences.- just before asking for a operation to the service it saves it to the preference using my utility class.</p><p><em>Service</em><br>perform operation and save state of the operation to the preference using my utility class.emit broadcast.  </p><p><strong>Disasters happen!</strong>  </p><p>Now this saves me in a normal situation, but if a disaster happens (i.e. with the task killer app you kill everything) the service might be killed before it can save the status of the operation I am stuck as before (the activity will think the operation is still going on so it won't touch the dialog). So as for now I add a <em>Dismiss</em> button to very dialog just in case :)    </p><p>Now all of this looks too complicated for what I think should be a fairly common thing to do. That's why, as said at the beginning of the post, I might (very likely!) be completely wrong.<br>Any ideas? Apologies if this question has been asked already, I looked around but didn't find anything. Please point me to any resource online explaining this.</p><p>Thanks and sorry for the lenghty post :P</p><p>Luca</p>","441457","","441457","","2010-09-07 14:29:04","2010-09-07 14:32:34","Android dialog management","<java><android><service><dialog><activity>","1","0","2","",""
"3659474","1","","","2010-09-07 14:17:02","0","270","<p>I have read that package manager can be used to get details of the android application.I have a .java of Android applciation in which I am using this to get the details of that file . I am getting the foolowng error : <br></p><pre><code>Logs.log(""OnClick(hiello)"", ""my Activity not found "",LogType.Debug,    myfile.this.getPackageManager().getApplicationInfo(getPackageName(), 0));</code></pre><p>In the above stmt myfile is simple .java file with one function composetotal()</p><pre><code>void composetotal(Activity acty,int m1,int m2,int m3){   Logs.log(""OnClick(hiello)"", ""my Activity not found "",LogType.Debug,      myfile.this.getPackageManager().getApplicationInfo(getPackageName(), 0));    }</code></pre><p><br>I am getting error at <code>this.getPackageManager()</code>.Help me in solving this issue. Also give me one sample program for this getPackageManager()</p>","429501","","24380","","2010-09-08 18:00:01","2010-09-08 18:00:01","Question regarding usage of PackageManager in Android","<android>","0","3","","",""
"3659492","1","","","2010-09-07 14:19:12","2","179","<p>Is it possible to create a text area with a custom shape in Android? I would like it to wrap around an image.</p><pre><code>...... ""This is the example text...... I would like to wrap around...... my test image in Android.And it would continue under the image.""</code></pre>","31399","","","","","2010-09-07 14:19:12","Custom shaped text areas in Android","<android>","0","0","1","",""
"3659567","1","3667240","","2010-09-07 14:27:04","1","2175","<p>I have an application that is designed to pop up a question when a phone call ends using a BroadcastReceiver and a PhoneStateListener.</p><p>My problem is, when a call is received while the user is not currently using my application, the dialog is not displayed until the application is manually started. I would like either for the dialog to be displayed on top of what ever context the user is currently in, or that my application will be focused.</p><p>How is this done?</p>","441531","","","","","2010-09-08 11:31:39","Displaying an android dialog out of application","<android><dialog><focus><activity>","2","0","","",""
"3659611","1","4066033","","2010-09-07 14:32:14","1","932","<p>I created a libray android pakage i included a external jar (apache.commons) i marked the project as library. </p><p>I create a new android project add library under andriod tab add project under source tab build it and it builds fine. As soon as i call something out of that class i get a java.lang.NoClassDefFoundError.</p><p>What is going on. I tried adding uses-library but then i get  shared library not found.</p><p>My permissions is the same as the library project. There is no activities in library project.</p><p>thanks</p>","106955","","","","","2010-11-01 01:04:30","Android library projects","<android><eclipse>","1","2","","",""
"3659792","1","3659818","","2010-09-07 14:54:34","5","2346","<p>I would like to create an xml selector of styles.</p><p>Basically i would do something like that:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true""      style=""@style/filter_btn""/&gt;  &lt;item android:state_pressed=""false""      style=""@style/transparent"" /&gt;&lt;/selector&gt;</code></pre><p>Could someone help me ? </p>","314407","","1155805","","2012-08-08 11:44:43","2012-08-08 11:44:43","Create a selector of styles","<android><android-layout>","1","0","","",""
"3659809","1","3660245","","2010-09-07 14:57:04","27","20808","<p>An android mobile actually does know quite well where it is - but is there a way of retrieving the country by something like a country code?</p><p>No need of knowing the exact GPS position - the <em>country</em> is sufficient </p><p>I first thought of using the time zone, but actually I need more information than that since it makes a difference if the location is New York or Lima.</p><p><em>The background of the question:</em> I have an application that uses temperature values, and I'd like to set the default unit either to Celsius or Fahrenheit, depending on whether the location is US or outside</p>","415347","","","","","2013-11-16 21:28:25","Where am I? - Get country","<android><geolocation>","5","1","17","",""
"3659851","1","3708801","","2010-09-07 15:02:05","2","491","<p>I just received a HTC Desire to test on. I noticed, that a mapView residuing in a frame smaller than a whole screen is not as sharp as a generic maps application. Is there any solution to this?</p>","403324","","","","","2010-09-14 12:22:34","MapView has a bad resolution comparing to generic Maps","<android>","2","0","3","",""
"3659886","1","","","2010-09-07 15:07:40","5","677","<p>I'm developing a web-application using HTML5 canvas and I need to debug in mobile browsers. </p><p>Normally I'm using firebug in Firefox and the built-in developer tools in Chromium for this, but I need to do some of the same on the iPhone and on Android-based phones, like the HTC Hero.</p>","441556","","258127","","2011-03-28 19:52:06","2012-04-24 19:31:57","Debugging in mobile browsers?","<javascript><iphone><android><debugging>","2","0","2","",""
"3659940","1","3660133","","2010-09-07 15:12:47","7","18888","<p>It would be nice if the ProgressBar could be made to go away until it is needed. Is there a problem using setVisibility.progressBar in applyMenuChoice? The problem with using setVisibility.progressBar in PrintStatusTask().execute() is that it crashes the app during runtime.</p><pre><code>public class Controller extends Activity {    private ProgressBar progressBar;    ...    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.controller);        progressBar = (ProgressBar)findViewById(R.id.progressBar);        ...    private boolean applyMenuChoice(MenuItem item) {        switch (item.getItemId()) {        case R.id.menuStatus:            progressBar.setVisibility(View.VISIBLE);            new PrintStatusTask().execute();            progressBar.setVisibility(View.GONE);            ...</code></pre>","398460","","579234","","2012-09-28 17:52:09","2012-09-28 17:52:09","Why isn't setVisibility working on Android ProgressBar?","<android><progress-bar>","2","0","2","",""
"3660126","1","3660398","","2010-09-07 15:30:46","2","553","<p>Ok so in my application I have a DBAdapter class, that does its job well. In the main Activity, I have a variable <code>this.dbAdapter</code>. I would like to share this variable with other Activites, so I don't have to create a new DBAdapter in each Activity.</p><p>How would be the best way of doing this? Should I do something like <code>intent.putExtra(""DbAdapter"", this.dbAdapter);</code>? Or is there another way that I should go about it?</p><p>Thanks!</p>","362857","","","","","2012-08-30 21:42:20","Share DBAdapter Between Activities","<android>","2","3","1","",""
"3660167","1","3660789","","2010-09-07 15:36:26","1","986","<p>An observation: While I was developing my app on android, I noticed following two lines in LogCat. These occurred because of too much memory requirements of my own app. I have read that Android can decide when to get rid of a process that are not needed or because of memory requirements.</p><p>Does it mean the alarm will not trigger at all (when some other app has made it to kill)? The alarm is a critical service and should not be killed.</p><pre><code>09-07 16:18:32.936: INFO/ActivityManager(63): Process com.android.alarmclock (pid 164) has died.09-07 16:19:01.655: INFO/ActivityManager(63): Process com.android.mms (pid 204) has died.</code></pre><p>(Please correct me if my understanding is wrong.)</p>","229106","","","","","2010-09-07 16:52:22","Process management: To be killed or Not to be killed","<android><process-management><application-lifecycle>","1","0","","",""
"3660209","1","7772170","","2010-09-07 15:42:30","73","103153","<p>I want to display animated GIF images in my aplication.As I found out the hard way Android doesn't support animated GIF natively.</p><p>However it can display animations using <a href=""http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html"">AnimationDrawable</a>:<a href=""http://developer.android.com/guide/topics/graphics/2d-graphics.html#frame-animation"">http://developer.android.com/guide/topics/graphics/2d-graphics.html#frame-animation</a></p><p>The example uses animation saved as frames in application resources but what I need is to display animated gif directly.</p><p>My plan is to break animated GIF to frames and add each frame as drawable to AnimationDrawable.</p><p>Does anyone know how to extract frames from animated GIF and convert each of them into <a href=""http://developer.android.com/reference/android/graphics/drawable/Drawable.html"">Drawable</a>?</p>","219449","","815724","","2013-04-12 15:08:24","2014-04-03 06:58:22","Display Animated GIF","<android><animated-gif>","14","1","41","",""
"3660335","1","3660820","","2010-09-07 15:57:13","0","309","<p>I have an implementation that just like gmail application, but havemet some problem in some case. And I tested it on the real device ofthe gmail application. Seems they are caused by the same reason.ListView.</p><p>Just go to the gmail application, scroll down to the last visiblemail, and at this time, make sure the ""loading conversation"" at thebottom is still on. Then long press the last one mail, and the contextmenu show up. Then wait for the background email loading finish ( youcan see that the scrollbar move up ). Then you do some action in thecontext menu, say ""read the mail"". However, the show up mail is notthe one that I long pressed.</p><p>After some debug, I found that this should be related to ListView andits adapter's getView method, the ""convert view"" is reused when thecontext menu is shown, and in that case the listItemview has somefield to record the index of the mail, while getView method isinvoked, the field has been changed.</p><p>Any one can provide a better way to solve this problem ?</p><p>Thanks.</p>","441316","","","","","2010-09-07 16:55:02","a bug in android listview and adpater","<android><listview>","1","0","","",""
"3660464","1","3660637","","2010-09-07 16:13:03","0","4792","<p>This app needs the device (and its display) to stay awake between onPreExecute() and onPostExecute().</p>","398460","","","","","2010-09-07 16:34:35","Is there a way to force an android device to stay awake?","<android>","2","1","2","",""
"3660572","1","3660754","","2010-09-07 16:26:14","3","14522","<p>This is simple, but not working.  I am trying to create a temp file (later a permanent storage file) for preview of an MP3 file.  I have tried the following variants of the suffix as  following example:</p><pre><code>public class StudyFileIo extends Activity {    private static final String TAG = ""StudyFileIo"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            File tempFooFile = File            .createTempFile(""foo"", ""dat"");            Log.i(TAG, tempFooFile.getAbsolutePath());        } catch (IOException e) {            Log.e(TAG, e.toString());            e.printStackTrace();        }    }}</code></pre><p>Log:</p><pre><code>09-07 11:25:20.299 E/StudyFileIo( 8859): java.io.IOException: Permission denied09-07 11:25:20.299 W/System.err( 8859): java.io.IOException: Permission denied09-07 11:25:20.299 W/System.err( 8859):     at java.io.File.createNewFileImpl(Native Method)09-07 11:25:20.299 W/System.err( 8859):     at java.io.File.createNewFile(File.java:1160)09-07 11:25:20.299 W/System.err( 8859):     at java.io.File.createTempFile(File.java:1224)09-07 11:25:20.299 W/System.err( 8859):     at java.io.File.createTempFile(File.java:1182)09-07 11:25:20.299 W/System.err( 8859):     at com.mobibob.studyfileio.StudyFileIo.onCreate(StudyFileIo.java:25)09-07 11:25:20.299 W/System.err( 8859):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-07 11:25:20.299 W/System.err( 8859):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)09-07 11:25:20.309 W/System.err( 8859):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)09-07 11:25:20.309 W/System.err( 8859):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)09-07 11:25:20.309 W/System.err( 8859):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)09-07 11:25:20.309 W/System.err( 8859):     at android.os.Handler.dispatchMessage(Handler.java:99)09-07 11:25:20.309 W/System.err( 8859):     at android.os.Looper.loop(Looper.java:123)09-07 11:25:20.309 W/System.err( 8859):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-07 11:25:20.309 W/System.err( 8859):     at java.lang.reflect.Method.invokeNative(Native Method)09-07 11:25:20.309 W/System.err( 8859):     at java.lang.reflect.Method.invoke(Method.java:521)09-07 11:25:20.319 W/System.err( 8859):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)09-07 11:25:20.319 W/System.err( 8859):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)09-07 11:25:20.319 W/System.err( 8859):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Is there some AndroidManifest.xml setting that I am missing (I am using default manifest)?</p>","157804","","","","","2011-03-28 01:39:34","android createTempFile throws permission denied?","<android><file-io><permissions><permission-denied>","2","0","2","",""
"3660602","1","3664563","","2010-09-07 16:30:20","0","553","<p>If I pass <a href=""http://www.ebay.com"" rel=""nofollow"">http://www.ebay.com</a> to this. Somewhere along the way ebay changes my url, perhaps a redirect. What's weird is Android java can't open the page.</p><pre><code>u = new URL(txturl.getText().toString());</code></pre><p>I get the error below as it apparently opening the new mobile site.  I'm just wonder at what point my url changes and If I somehow stop this. It does not appear to happen if I point to yahoo, google, amazon or other major sites. I just noticed this in my testing. </p><p>Thanks.</p><pre><code>09-07 16:08:08.739: INFO/System.out(360): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Unable to connect to **http://www.ebay.com - http://m.ebay.com?ebayref=http%3A%2F%2Fwww.ebay.com%3A80%2F%3Fredirect%3Dmobile**09-07 16:08:08.739: WARN/System.err(360): **java.io.FileNotFoundException**: http://m.ebay.com?ebayref=http%3A%2F%2Fwww.ebay.com%3A80%2F%3Fredirect%3Dmobile09-07 16:08:08.749: WARN/System.err(360):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)09-07 16:08:08.759: WARN/System.err(360):     at parser.XXXXXX.com.parserActivity.process(parserActivity.java:106)09-07 16:08:08.759: WARN/System.err(360):     at parser.XXXXXX.com.parserActivity.access$0(parserActivity.java:68)09-07 16:08:08.769: WARN/System.err(360):     at parser.XXXXXX.com.parserActivity$1.onClick(parserActivity.java:61)09-07 16:08:08.779: WARN/System.err(360):     at android.view.View.performClick(View.java:2408)09-07 16:08:08.779: WARN/System.err(360):     at android.view.View$PerformClick.run(View.java:8816)09-07 16:08:08.789: WARN/System.err(360):     at android.os.Handler.handleCallback(Handler.java:587)09-07 16:08:08.789: WARN/System.err(360):     at android.os.Handler.dispatchMessage(Handler.java:92)09-07 16:08:08.799: WARN/System.err(360):     at android.os.Looper.loop(Looper.java:123)09-07 16:08:08.809: WARN/System.err(360):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-07 16:08:08.809: WARN/System.err(360):     at java.lang.reflect.Method.invokeNative(Native Method)09-07 16:08:08.819: WARN/System.err(360):     at java.lang.reflect.Method.invoke(Method.java:521)09-07 16:08:08.819: WARN/System.err(360):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-07 16:08:08.829: WARN/System.err(360):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-07 16:08:08.839: WARN/System.err(360):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","440279","","4249","","2010-09-07 16:45:29","2012-05-11 07:55:43","fileNotFoundException when pointing to ebay.com from mobile","<java><android><url><redirect><ebay>","2","1","","",""
"3660695","1","3660793","","2010-09-07 16:40:18","1","923","<p>I have a list that gets refreshed every 2 seconds via the Handler postDelayed() method.</p><p>Every 2 seconds an AsyncTask is run that makes an HTTP GET request, turns the JSON into a list of objects, then sets the ListAdapter:</p><pre><code> MyListAdapter adapter = new MyListAdapter(someObjects); setListAdapter(adapter);</code></pre><p>My problem is that every time the task completes (so, roughly every two seconds) my list jumps back to the top, even if I have scrolled down to the middle or bottom of the list.  This would be very annoying to the end user, so I need the list to update in the background, as it's doing, but the current view of the list to not jump back to the top at the completion of the AsyncTask.</p><p>I can include any more code needed.  I'm somewhat new to android development, so I'm not sure what is helpful to others.</p><p><strong>Additional Information</strong></p><p>Taking suggestions from hacksteak25, I'm able to get to the point where I try to remove all the data from the adapter, then add it back one object at a time.  This isn't the end solution since this would probably still cause the screen to jump, but I'm trying to use it as a proof of concept for how I could merge the data at some point.</p><p>My problem is that I call the following code:</p><pre><code> MyListAdapter adapter = (MyListAdapter)getListAdapter(); adapter.clear(); for(MyObject myObject : myObjects) {  adapter.add(myObject); }</code></pre><p>After the first call to ""add(myObject)"" the getView() method of the MyListAdapter is being called.  The private internal ArrayList of the custom adapter is empty at this point, either because I set the adapter with no myObjects in onCreate() or because I called clear() on the adapter, I'm not sure.  Either way, this causes getView to fail since there are no objects in the ArrayList to be getting the view from.</p><p>getView() looks like this:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent){ ViewHolder holder; LayoutInflater mInflater = getLayoutInflater(); if (convertView == null) {  convertView = mInflater.inflate(R.layout.myObject, null);  holder = new ViewHolder();  holder.someProperty = (TextView)convertView.findViewById(R.id.someProperty);  holder.someOtherProperty = (TextView)convertView.findViewById(R.id.someOtherProperty);  holder.someOtherOtherProperty = (TextView)convertView.findViewById(R.id.someOtherOtherProperty);  convertView.setTag(holder); } else {  holder = (ViewHolder)convertView.getTag(); } // Bind the data efficiently with the holder. holder.someProperty.setText( mObjects.get(position).getSomeProperty()); ...</code></pre><p>That last line is the one that causes an IndexOutOfBoundsException.</p><p><em><strong>How should I handle this situation where I get the data I want in there without causing the list to jump?</em></strong></p>","253412","","253412","","2010-09-09 14:50:43","2010-09-09 17:40:53","Android - list returns to top after update","<android><gui><listview><android-asynctask><android-arrayadapter>","1","0","","",""
"3660815","1","","","2010-09-07 16:54:37","0","425","<p>I'd love to get some ideas on best practices for testing our Android software, especially for AT&amp;T devices.  We're using a Samsung Captivate, on AT&amp;T.  As you know, AT&amp;T disables sideloading (no Unknowns Sources option in Settings->Applications).</p><p>We need to have our QA team load our apk file onto these devices as part of our testing and validation process.  We're willing to install the SDK if needed, and upload the apk file via USB.  We are not willing to root the phone.</p><p>Can I get any suggestions/ideas on how this can be done?</p><p>Thank you,</p><p>Tony</p>","441657","","","","","2010-11-25 11:17:01","Loading an apk file on an AT&T device for QA/testing when","<android>","1","0","1","",""
"3660841","1","","","2010-09-07 16:57:16","0","325","<p>My ListView has to be customized like, it should have three imageView in each ListItem along with the name and date that has to populated from the DB,added with that, once i click upon the a list item ,that corresponding Listitem information has to be displayed in another Screen...The Size of the List should be based on the Cursor object from DB..and it should be possible to add data in to the Listview..too</p><p>Can anybody give me any suggestion/snippet/resource of how to proceed the above said..</p><p>Please check the ScreenShot of ListView that i mentioned..(My ListView should have to be like this only)..</p><p><img src=""http://i.stack.imgur.com/CUri4.jpg"" alt=""SampleListView""></p><p>Thanks in advance.....</p>","384193","","84042","","2011-12-04 00:30:32","2011-12-04 00:30:32","ListView in Android","<android><listview>","1","1","1","","2010-09-07 16:57:58"
"3660873","1","","","2010-09-07 17:02:53","1","813","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6685027/good-tutorial-for-sqlite-and-listview"">Good Tutorial for SQLite and ListView</a>  </p></blockquote><p>Im having sqlite file which contains data to display in a listview.</p><p>How i can get data from SQLite file</p><p>Please help me out.</p><p>Thanks...</p>","341443","","265167","","2011-12-17 20:20:38","2011-12-17 20:20:38","How to populate listview from Sqlite database?","<android><sqlite>","2","2","","2011-12-17 23:10:55",""
"3660876","1","","","2010-09-07 17:03:02","0","2517","<p>Im developping alarm application.</p><p>I'm using listview on activity to reserve alarm.after application finish BroadcastReceiver.onReceive() method, I want to remove check of list. </p><p>But i dont know how to access to activity.anybody knows?</p><p>The following is my code:</p><pre><code>public class Activity_001 extends ListActivity {        Intent intent = new Intent(this, ReceiverGenerateAlarm.class);        intent.setAction(Conf.GenerateAlarm);        intent.putExtra(cal,timerList.get(0).getCal().getTimeInMillis())        PendingIntent sender = PendingIntent.getBroadcast(this, 0, intent,0);        AlarmManager am = (AlarmManager)(this.getSystemService(ALARM_SERVICE));        am.set(AlarmManager.RTC_WAKEUP,timerList.get(0).getCal().getTimeInMillis(), sender);}</code></pre><p>.</p><pre><code>public class ReceiverGenerateAlarm extends BroadcastReceiver {        @Override        public void onReceive(Context context,Intent intent) {                String action = intent.getAction();                if(action.equals(Conf.GenerateAlarm)) {                        Bundle bundle=intent.getExtras();                        long cal = bundle.getLongArray(""cal"");                        Calendar c = Calendar.getInstance();                        c.setTimeInMillis(cal);                        MediaPlayer_inherit_Class tm = new MediaPlayer_inherit_Class(cal);                         tm.play();                        //in here, wanna access alarm reservation list and remove check of list. as application has executed.                        //set next alarm, if needed.                 } </code></pre>","640992","","244296","","2010-09-07 17:23:11","2010-09-07 17:23:11","access to activity from BroadCastReceiver.onReceive","<android>","1","0","","",""
"3660908","1","","","2010-09-07 17:07:06","0","563","<p>Okay, so I am still learning to do some coding here, and I seem to have gotten stuck.</p><p>I want to have a select number of documents added to a package for the Android OSbut I don't know how to store said documents. Do I add them all under res/raw, or make an SQLite database and call from there?</p><p>More importantly, I need to be able to call those documents when a search criteria is added.</p><p>I was on the Android reference site, and they add write functions for the SQLite db, which I would prefer not having as an option.</p><p>What kind of database should I implement here?I would prefer a link to an example, but anything would help at this point.</p>","441665","","23199","","2011-02-09 22:12:46","2011-02-09 22:12:46","What kind of database is used in Android document call functions?","<android><database>","1","2","","",""
"3661018","1","","","2010-09-07 17:20:30","4","7728","<p>What is PackageManager? </p><ul><li>What is the purpose of using it ?</li></ul><p>What do the following methods describe?:</p><ol><li>getPackageManager()</li><li>getApplicationInfo()</li><li>getPackageName()</li></ol><p>Can any one give  detailed description as I could not get complete information in the Android developer guide.</p><p>And also one sample program that comprises all the methods. </p>","385939","","18061","","2012-09-17 07:09:45","2012-09-17 07:25:19","purpose Of using PackageManager in Android","<android>","2","0","1","",""
"3661063","1","","","2010-09-07 17:26:06","0","466","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6685027/good-tutorial-for-sqlite-and-listview"">Good Tutorial for SQLite and ListView</a>  </p></blockquote><p>I have to know ..  How to get data from SQLite which contains some data. How to place it(the data) in the listview.</p><p>Thanks </p>","418980","","","","","2010-09-07 18:18:30","How to get data from sqlite","<android>","2","0","","2011-12-18 06:56:41",""
"3661137","1","3661323","","2010-09-07 17:36:17","6","22721","<p>I've been trying to find the answer to this for a while today and there's just so much contradictory information....</p><p>What I'd like to do is get a current unix timestamp in android, and then convert it to a format that allows me to getHours() and getMinutes().</p><p>I'm currently doing this:</p><pre><code>int time = (int) (System.currentTimeMillis());Timestamp ts = new Timestamp(time);mHour = ts.getHours();mMinute = ts.getMinutes();</code></pre><p>But it's not giving me a correct value for hour or minute (it's returning 03:38 for the current East-coast time of 13:33).</p>","355663","","","","","2013-01-06 22:26:10","Java simple Timestamp to Date conversion","<android><unix><date><timestamp>","5","0","3","",""
"3661195","1","3661242","","2010-09-07 17:44:51","0","279","<p>I have a looping animation I want to present for an image button before a static image is used; on each button press.  Is there a way to run this animation for around 2000 milliseconds then switch over to the image.  What I have tried just results in a pause then the static image.</p><pre><code>    button.setOnClickListener(new View.OnClickListener(){               @Override   public void onClick(View v) {       animationrun();             long time = System.currentTimeMillis();             time += 2000;             while(time &gt; System.currentTimeMillis())             {}       select();           }     });     public void animationrun() { button.setBackgroundResource(R.drawable.ball_anim);        animation = (AnimationDrawable)button.getBackground();        animation.start(); }      public void select()     {      button.setBackgroundResource(R.solidImage);      }</code></pre><p>SOLUTION: <a href=""http://www.facebook.com/topic.php?uid=128857303793437&amp;topic=74"" rel=""nofollow"">http://www.facebook.com/topic.php?uid=128857303793437&amp;topic=74</a></p>","431204","","431204","","2010-09-07 18:31:13","2010-09-07 18:31:13","How do I run an animation for a short period of time?","<android>","1","0","","",""
"3661205","1","3670750","","2010-09-07 17:46:27","1","1352","<p>Trying to build Android open source project on Ubuntu 10.04 (on VMware Player).</p><p>I followed the instructions at <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">this link</a> (and it said to use sun-java5 JDK 1.5 which takes some fishing to find for Ubuntu) -</p><p>Got 299 compile errors.  Wondering if the direction to use JDK 1.5 is out of date?  Some of the errors are as follows (and many similar) -</p><pre><code>external/jsilver/src/com/google/clearsilver/jsilver/data/HDFDataFactory.java:77: method does not override a method from its superclass  @Overrideexternal/jsilver/src/com/google/clearsilver/jsilver/data/UniqueStack.java:106: cannot find symbolsymbol  : method offerLast(T)location: class java.util.LinkedList&lt;T&gt;    objectStack.offerLast(object);external/jsilver/src/com/google/streamhtmlparser/impl/HtmlParserImpl.java:507: cannot find symbolsymbol  : method isEmpty()location: class java.lang.String    if (!tagString.isEmpty() &amp;&amp; tagString.charAt(0) == '/') {external/jsilver/src/com/google/streamhtmlparser/util/JavascriptTokenBuffer.java:80: cannot find symbolsymbol  : method copyOf(char[],int)location: class java.util.Arrays    buffer = Arrays.copyOf(aJavascriptTokenBuffer.buffer,</code></pre>","405054","","1399920","","2012-07-08 08:42:43","2012-07-08 08:42:43","Android make failure on ubuntu","<android><ubuntu>","3","0","2","",""
"3661221","1","3661318","","2010-09-07 17:48:00","0","921","<p>I'm expanding on the hello world application. I've created a button on the main.xml to bring up a new form, screen2.xml, with a second button. I'd like this this button to toast a message. However, as soon as I try add the code to define the OnClickListener, I get a force close message. It happens on this line of code:</p><pre><code>final Button btnShowToast = (Button) findViewById(R.id.btnShowToast)</code></pre><p>Does this mean one Activity can only access one screen/layout?</p><p>Also, in the line above, what does the ""final"" mean?</p>","181098","","244296","","2010-09-07 17:56:44","2010-09-07 17:59:18","Android - Can't access button on another layout","<android>","1","0","","",""
"3661327","1","6254777","","2010-09-07 18:01:45","6","484","<p>I'm about to implement Google Analytics support in an Android app, but after some googling, the documentation seems delightfully sparse. Are there any useful conventions or advice (i.e. when not to trigger pageviews/events, or something) that a newcomer to GA should know?</p>","321041","","172322","","2010-09-23 19:43:50","2012-03-09 04:08:39","What are good conventions for Google Analytics on Android?","<android><google-analytics><analytics>","3","0","1","",""
"3661367","1","","","2010-09-07 18:08:19","-1","1373","<p>I got a problem in one Android Application which I am working in which I am getting error when I use PackageManager.</p><p>The Application is as follows:  </p><h3>Home.java <br></h3><pre><code>package com.main.home;public class Home extends Activity{    //onclicking a Button say ""send""    send.onClickListener()     {        public void onClick() {            Intent i =new Intent();            i.setClassName(""com.main.home"", ""com.main.home.home1"");            startActivity(i);     }}</code></pre><h3>Home1.java</h3><pre><code>package com.main.home;import com.andr.resulting.Result ;public class Home1 extends Activity  {    EditText et=(EditText)findViewById(R.id.e1);    //Clicking on forwardButton in that onClick()    public void onClick()    {        String s[] = {e1.getText().toString(),""""};        //Calling a method in a class Result of another package which is not activity        Result.finalfunc(Home1.this,s);}</code></pre><h3>Result.java</h3><pre><code>package com.andr.resulting;   //different packagepublic class Result {    public static void finalfunc(Activity act,String[] re) ...    //Here I want to get the details of this particular class's package (com.andr.resulting) using PackageManager    // I tried like this:    Result.this.getPackageManager().getApplicationInfo(Result.getPackageName(),0))</code></pre><p>I am getting error <code>getPackageManager()</code> does not exists in this class file.</p><p>How do I solve this issue?  I will be eagerly waiting for valuable reply.Thanks in Advance.</p>","385939","","1288","","2010-09-07 20:33:28","2010-09-07 20:33:28","Error while using PackageManager in Android","<android>","2","5","0","",""
"3661464","1","3661933","","2010-09-07 18:21:47","24","15865","<p>I have a broadcast receiver in my program to get react to the battery level like so:</p><pre><code>private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver(){    @Override    public void onReceive(Context arg0, Intent intent) {        int level = intent.getIntExtra(""level"", 0);        // do something...    }}    registerReceiver(this.mBatInfoReceiver,             new IntentFilter(Intent.ACTION_BATTERY_CHANGED));</code></pre><p>However this code has to wait for the battery status to be updated so if you have a GUI element that needs to be set based on the battery level it must wait for a battery event to occur. Is there a way to nudge this to get it working or simply run some code to see what the battery level was on the last broadcast?</p>","315998","","","","","2014-02-04 19:09:55","Get battery level before broadcast receiver responds for Intent.ACTION_BATTERY_CHANGED","<android><broadcastreceiver><battery>","4","0","19","",""
"3661524","1","6403990","","2010-09-07 18:29:25","12","5254","<p>A lot of Android apps now display a modal dialog with the changelog (text) of the application (what's new in the latest version) the first time after it is installed or updated.</p><p>Does any one have example code on:</p><ol><li>How to display a nice modal dialog suitable for scrollable text </li><li>How to make sure the dialog is only shown once </li></ol><p>For 2. I assume SharedPreferences can be used for defining a preference ""hasChangeLogBeenShownForVersionX"" that is updated after the dialog has been shown. (though there might be a better way</p><p>Regards</p>","250787","","","","","2012-02-09 17:35:39","Android: Modal dialog with changelog for app shown only first time after install","<android><dialog>","5","0","5","",""
"3661561","1","3661851","","2010-09-07 18:34:01","1","1888","<p>I want to have 3 edittext with top and bottom having topleft and topright curves but bottom-left and bottom-right straight. I tried to use shape</p><p>   </p><p></p><p>but it makes all the corners curved. If i try to use bottomRightRadius, then i get exception. </p><p>So I tried different way of doing it </p><p>                    </p><p>  </p><p>using -ve margin so that bottom on hides the upper one's curve. But now bottom one is going behind  the upper one. There is nothing like goToBottom or goToTop :(</p><p>Any help is appreciated </p>","441730","","","","","2010-09-07 19:57:47","Android Edittext topleft and topright only rounded","<android>","2","0","1","",""
"3661645","1","3664045","","2010-09-07 18:45:45","1","3016","<p>i am using grid view for display images,i want to scroll move automatically,whenever i add another images in gridview,is it possible,please give code for that...</p><p>Thanks All</p>","410757","","","","","2012-04-26 15:16:44","how can move scroll bar automaticaly?","<android>","4","0","1","",""
"3661803","1","3662783","","2010-09-07 19:04:12","0","406","<p>how to display the contents of a vector in android?do i need to use TextView?</p>","275674","","","","","2010-09-23 18:27:35","android output display","<java><android>","2","2","","",""
"3661807","1","3661845","","2010-09-07 19:04:54","2","1007","<p>this problem is bugging me:</p><pre><code>HttpURLConnection con = (HttpURLConnection)new URL(url).openConnection();con.setRequestMethod(""HEAD""); if (con.getResponseCode()!=200 ){dosomething()}</code></pre><p>Is this the correct way to set the Request Method, or is it already too late since I called URL.openConnection() and it already made the connection using the default which is GET?</p><p>I can't call setRequestMethod(""HEAD"") in the same line as openConnection because it returns a URLConnection,not a HttpURLConnection.</p><p>So how do I ensure that the method will always be HEAD knowing the default is GET?</p><p>Should I just use HttpClient ?</p>","223876","","","","","2010-09-07 19:08:30","Optimizing HttpURLConnection in Android","<java><android><eclipse><http>","1","0","","",""
"3662030","1","3662424","","2010-09-07 19:33:04","0","823","<p>Is there a slick way to display getProgress() in an Android ProgressBar?</p>","398460","","","","","2010-09-07 20:24:44","Android ProgressBar getProgress?","<android><progress-bar>","1","0","","",""
"3662039","1","3662148","","2010-09-07 19:35:05","1","774","<p>getting error:</p><p>An error has occurred. See error log for more details.java.lang.NullPointerException</p><p>when I attempt to edit this file in my eclipse Android sdk project. </p><p>Not seeing anything in LogCat or the Console.</p><p>I need to update this file to rename the Project.</p>","440279","","440279","","2010-09-07 19:44:50","2011-01-19 14:59:54","Android Eclipse - error trying to open or edit /res/values/strings.xml - NullPointerException","<android><eclipse><string><nullpointerexception><edit>","2","0","","",""
"3662117","1","","","2010-09-07 19:46:09","2","1807","<p>I am working on a compute intensive app for Android. I do not have any device yet to test performance. However, the performance on emulator is a bit slower than expected.</p><p>I see an <a href=""http://stackoverflow.com/questions/103366/how-well-does-the-android-phone-emulator-reflect-the-performance"">old question about some estimation of emulator vs device</a>. What are your experiences while developing apps with recent SDK Froyo/2.2. Is performance observed on emulator is slower than actual device.</p><p>Please share your experience and the specs of your dev machine and mobile devices, both.</p><p>Note: To get virtual device's CPU speed one can run <code>cat /proc/cpuinfo</code> from <code>adb shell</code>. How is this comparable to actual device's CPU frequency?</p><pre><code>      Processor       : ARM926EJ-S rev 5 (v5l)      BogoMIPS        : 240.02</code></pre>","229106","","229106","","2010-09-08 05:17:37","2011-04-26 20:04:57","Performance of app on Android Phone Emulator vs Actual Device?","<android><android-emulator><performance>","4","1","1","","2010-09-07 19:48:10"
"3662136","1","","","2010-09-07 19:48:09","0","246","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3661367/error-while-using-packagemanager-in-android"">Error while using PackageManager in Android</a>  </p></blockquote><p>I got a problem in one Android Application which I am working in which I am getting error when I use PackageManager. <br>  <br> The Application is as follows:   </p><h1>Home.java <br></h1><p>package com.main.home <br>public class Home extends Activity{ <br>   //onclicking a Button say ""send""  <br>send.onClickListener() <br>{  <br>   public void onClick() { Intent i =new Intent();<br>i.setClassName(""com.main.home"",""com.main.home.home1"");<br> startActivity(i); <br> } }</p><p><b>  Home1.java </b> <br>package com.main.home <br>import com.andr.resulting.Result ; <br>public class Home1 extends Activity  { <br> EditText et=(EditText)findViewById(R.id.e1);<br> //Clicking on forwardButton in that onClick()<br> public void onClick(){ <br>String s[]={e1.getText().toString(),""""};  <br>//Calling a method in a class Result of another package which is not activity  <br> Result.finalfunc(Home1.this,s); <br>}}<br></p><h1>  Result.java</h1><p>package com.andr.resulting   //different package<br> import com.andr.other.otherclass<br>public class Result { <br>public static void finalfunc(Activity act,String[] re) { <br><b>//Here I want to get the details of this particular class's package (com.andr.resulting) using PackageManager </b><br></p><p><b>I tried like this: </b>  <br>otherclass.sendTo(""hi"",""hrll"",Result.this.getPackageManager().getApplicationinfo(Result.this.getPacakageName(),0));<br>I am getting error getPackageManager() doesnot exists in this class file.<br> How to solve this Issue.  I will be eagerly waiting for valuable reply <br>Thanks in Advance.</p>","385939","","","","","2010-09-07 19:53:47","Problem in Using PackageManager in Android","<android>","0","0","0","2010-09-07 20:24:48",""
"3662476","1","","","2010-09-07 20:30:45","0","454","<p>Does anybody know if Internet Bookmark URLs are accessable from Android applications? Any way to bind something like a spinner to them?</p><p>Thanks.</p><p>Update: To add to my question: I've tried this code but getting just blanks back in my spinner. I confirmed I have bookmarks in my emulator:</p><pre><code>private Cursor cbookmarks;</code></pre><p>SpinnerBM = (Spinner) findViewById(R.id.Spinner); cbookmarks = Browser.getAllBookmarks(getContentResolver());SimpleCursorAdapter ABM = new SimpleCursorAdapter(this,android.R.layout.simple_spinner_item, cbookmarks,new String[] {android.provider.Browser.BookmarkColumns.URL},new int[]{R.id.Spinner});ABM.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); SpinnerBM.setAdapter(ABM);</p>","440279","","440279","","2010-09-08 13:04:43","2010-09-08 13:04:43","Android and binding to internet bookmark URLs?","<android><binding><internet><bookmarks>","0","4","","",""
"3662532","1","","","2010-09-07 20:38:33","0","980","<p>is there a way i can delay the OS from killing my app... it runs in the background with a countdowntimer but its not a service... is there a way to raise its prioity or something so that it stay in the background for as long as possible and is still running when the application is resumed</p>","434885","","","","","2010-09-07 23:16:03","android onDestroy","<android>","1","1","","",""
"3662553","1","3662605","","2010-09-07 20:41:40","7","10888","<p>Can't understand how to browse android emulator sd card. I am using IDEA, not Eclipse and can't use Eclipse tool for this purpose.</p>","423868","","","","","2010-09-07 21:04:19","How to browse android emulator SD on Windows without Eclipse?","<android><android-emulator>","3","0","1","",""
"3662844","1","3662894","","2010-09-07 21:17:25","2","2492","<p>I have a general question regarding Android's separation of layouts into layout.xml files:</p><p>My app needs to display a table where the number of rows and columns varies at runtime.So far I did the layout up to the TableView in the corresponding layout/....xml file and then I added TableRow-s and cells (TextView) to the table at runtime as needed. The drawback of adding rows and cell programmatically is, that one can not really change the design later (e.g. changing colors or margins for the cells) without later code modification.</p><p>What I would this like to do is to add a single row to the table and a single cell to the row in the layout file and then use these as a ""pattern"" or templates to generate all the actual table's rows and cells. This would allow to specify colors and other parameters in the layout.xml file (and thus also be able to change them later without code change) but still allow for an arbitrary number of columns and cells.</p><p>However, I found no ""copy""-constructor or ""duplicate""-method in Views. How can one achieve this? What is the suggested method to create lists or tables from a single ""example"" or template element? Or is there another method to achieve what I want? </p><p>Hope I could make myself clear...Michael</p>","423411","","","","","2010-09-07 21:25:25","How to duplicate Views to populate lists and tables?","<android>","1","0","","",""
"3662846","1","3662867","","2010-09-07 21:17:37","0","1256","<p>I have a series of imageviews that I want to display, but on a button press there needs to be less or more.  These imageviews are stored in a list.  Is there a simple way to hide or display them?</p>","431204","","","","","2010-09-07 21:20:21","Is there a simple command to hide or display an imageview?","<android>","1","0","","",""
"3662891","1","3663037","","2010-09-07 21:24:38","1","488","<p>I've created an Android application which has a certain package name that I've been using personally for months now. I'm about to release it on the market, and I have to change the package name. This cannot be avoided.</p><p>My issue is that the application has an SQLite database attached to it that I want to keep, but I know if I change the package name, it'll install as a separate application and I'll have to restart my database, which would take a very long time.</p><p>Is there a good way to change a package name while maintaining the SQLite database? Or at least moving the database easily? This will just be for my own phone since it hasn't been released to the public yet.</p>","295199","","","","","2011-05-15 16:49:39","Changing package name but keeping database on Android","<android><sqlite><package>","2","0","","",""
"3662906","1","3662942","","2010-09-07 21:27:38","0","297","<p>How does one access a particular widget from within a custom layout while using Alert Builder? As you can see below, I'm setting the alert to a widget that is created in the code, but I'd MUCH rather use predefined layout.</p><p>Current code:</p><pre><code>    private AlertDialog numberDialog(String title, final int dialogID){            AlertDialog.Builder alert = new AlertDialog.Builder(this);                             alert.setTitle(title);              final NumberPicker np = new NumberPicker(this);            alert.setView(np);            alert.setPositiveButton(R.string.done, new DialogInterface.OnClickListener() {                      public void onClick(DialogInterface dialog, int whichButton) {                            int newNumber = np.getCurrent();                            calculatorVO.setWaiste(newNumber);                            PFACalculator.this.updateList();                            return;                                      }              });              alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                            return;                       }            });            AlertDialog ad = alert.create();            return ad;    }</code></pre><p>Psuedo-code for something I'd like:</p><pre><code>    private AlertDialog numberDialog(String title, final int dialogID){            AlertDialog.Builder alert = new AlertDialog.Builder(this);                             alert.setTitle(title);              alert.setView(R.layout.numberDialog);            alert.setPositiveButton(R.string.done, new DialogInterface.OnClickListener() {                      public void onClick(DialogInterface dialog, int whichButton) {                            NumberPicker np = (NumberPicker)findViewById(R.id.numpicker);                            int newNumber = np.getCurrent();                            calculatorVO.setWaiste(newNumber);                            PFACalculator.this.updateList();                            return;                                      }              });              alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                            return;                       }            });            AlertDialog ad = alert.create();            return ad;    }</code></pre><p>However, whenever I try to do it the second way I get a null pointer exception. Can anyone help?</p>","439836","","","","","2010-09-07 21:33:17","How to access a widget from within a layout with Alert Builder?","<android>","1","0","","",""
"3662984","1","3663273","","2010-09-07 21:40:55","1","1388","<p>I am interested in Android kernel level programming. Actually I am a Linux kernel programmer. I would like to know how to start with the kernel and how compile, boot and about the Kernel level subsystems (EX: How file systems are implemented etc..)  in Android. Any books or articles  or a good guide to start are very much appreciated</p><p>Thanks &amp; Regards,</p><p>Mousey.</p>","2605095","","648313","","2011-07-19 17:10:57","2011-07-19 17:10:57","Need some help with Android kernel","<android><c><kernel><kernel-programming><android-source>","2","2","1","","2010-09-07 21:40:55"
"3662985","1","3671552","","2010-09-07 21:40:56","1","699","<p>I am trying to add a divider between entries in a vertical LinearLayout, to emulate the appearance of a ListView. (I can't just use a ListView in this particular situation.)</p><p>This is what I have in list_divider.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;View  xmlns:android=""http://schemas.android.com/apk/res/android""  android:background=""@color/panel_border""  android:layout_width=""fill_parent""  android:layout_height=""@dimen/border_width"" /&gt;</code></pre><p>And here's the code which attempts to inflate this divider before every element except the first in the list:</p><pre><code>LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);for (int i = 0; i &lt; categories.size(); i++ ) {    if (i &gt; 0)        items.addView(vi.inflate(R.layout.list_divider, null));            // these dividers never appear    // but these main entries always appear just fine        items.addView(ad.getView(i, null, null));}</code></pre><p>The main list items appear correctly, but the dividers are invisible.</p><p>The dividers <em>do</em> appear if I change them to be a TextView rather than a plain View:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView  xmlns:android=""http://schemas.android.com/apk/res/android""  android:background=""@color/panel_border""  android:layout_width=""fill_parent""  android:layout_height=""@dimen/border_width""  android:text=""---"" /&gt;</code></pre><p>I have tried setting explicit pixel values for the width and height, as well as using the border_width definition and fill_parent options. It makes no difference.</p><p>Is there something special about a plain old View which makes it not appear?</p>","385478","","","","","2010-09-08 20:16:39","Android inflated view is empty","<android><view><inflate><divider>","1","0","","",""
"3663082","1","3663218","","2010-09-07 21:59:51","0","226","<p>I keep getting emails from people and companies wanting to release my Android app on various  alternative markets, and often they want me to send them (or upload on their website) my apk. </p><p>My questions are: What are the risks involved with this, how much can someone reverse engineer my app from the apk? How many other developers release their app on places that aren't the android market? Is it a fairly common practice?</p>","137839","","213269","","2010-11-10 11:48:21","2010-11-10 11:48:21","Emailing out my apk for alternate markets","<android><google-play><apk>","2","0","1","",""
"3663164","1","","","2010-09-07 22:14:21","4","1244","<p>I'm fairy new to unit testing and I've been learning how to use the jUnit framework for android(using <code>ActivityInstrumentationTestCase2</code>) but I'm having trouble working out how to I inject a mock data source into and activity, example:</p><p>In the activiy I have this</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState,R.layout.market_screen);        ListView products = (ListView)findViewById(R.id.product_list);        MarketsAdapter adapter = new  MarketsAdapter(this, new ProductDataSource());        products.setAdapter(adapter);}</code></pre><p>I currently pass a ProductDataSource into the adapter which connects to a webservice to pull in products for the adapter. In my tests I don't want to connect to the webservice. What is the best technique to inject a mock data source into the activity for testing? Should I create the ProductDataSource in an Application instance and then use a MockApplication in my tests to create a mock data source?</p><p>Thanks</p><p>I solved by doing the following in the test class <code>setUp()</code> method: Grab a reference to the <code>ListView</code> and set the Mock Data Source using <code>setAdapter(MockDataSource)</code>. This has to be run on the UI thread using <code>runOnUiThread()</code> method.</p><pre><code>mActivity = getActivity();mDataSource = new FakeDataSource();     mMarketsListView = (ListView)mActivity.findViewById(R.id.product_list);mActivity.runOnUiThread(      new Runnable() {        public void run() {          mMarketsListView.setAdapter(new MarketsAdapter(mActivity,mDataSource));        } // end of run() method definition   } // end of anonymous Runnable object instantiation); // </code></pre>","119203","","2613054","","2013-11-08 07:52:26","2013-11-08 07:52:26","Android Techniques for Mock Data Source in Activity Unit testing","<android><unit-testing><listview><adapter>","1","1","1","",""
"3663175","1","","","2010-09-07 22:16:32","0","56","<p>What's the best way to create a screen with comments surrounded by a globe image? I have to create <a href=""http://t3.gstatic.com/images?q=tbn%3aojVHzJxnrrXWKM%3ahttp://www.realvail.com/images/tomblog/iphone_text_message.jpg&amp;t=1"" rel=""nofollow"">this</a>.</p>","441877","","709202","","2011-07-21 20:30:45","2011-07-21 20:30:45","Screen Comments with globes like the Iphone","<android><android-widget>","1","0","","",""
"3663234","1","","","2010-09-07 22:27:14","1","669","<p>I have an app that has a portrait layout. When I rotate my phone into landscape, it loads another layout that is strictly landscape (it is displaying an ImageView). How can I make the transition from portrait to landscape animate smoothly?</p>","19875","","","","","2010-09-07 23:28:33","How can I animate my rotation smoothly?","<java><android><animation><layout><orientation>","1","0","","",""
"3663269","1","3663291","","2010-09-07 22:37:28","1","609","<p>I have a string in an Android app that I am trying to convert into a JSON object. The string looks like this (except longer and with actual values instead of the dummy values I entered here):</p><pre><code>[[{""1"":""a""}],[{""1a"":""1a"",""1b"":""1b""},{""2a"":""2a"",""2b"":""2b""}]]</code></pre><p>I have entered this exact string into two online JSON validators, and both of them confirm it to be valid JSON data. So I would assume that the JSONObject constructor would be able to accept this string and convert it into a JSON object. But when I try:</p><pre><code>json = new JSONObject(result);</code></pre><p>Where ""result"" is a String variable containing the string listed above, I get the following exception:</p><p>JSONException: A JSONObject text must begin with '{' at character 1 of [[{""1"":""a""}],[{""1a"":""1a"",""1b"":""1b""},{""2a"":""2a"",""2b"":""2b""}]]</p><p>What's going on here? Is the JSONObject's parser broken?</p>","321435","","","","","2010-09-07 22:54:42","org.json.JSONObject constructor not accepting what appears to be a valid JSON string","<java><android><json>","2","0","1","",""
"3663280","1","3664211","","2010-09-07 22:39:12","0","89","<p>I've only just started to write in Java on Android, so please bear with me.</p><p>I have some settings I want to hold in my app, normally I would have used an xml file. Trouble is i'm not sure how to load it into the xml parser to read it. </p><p>I thought I might be able to drop it into /res/values/Info.xml and open it from there but it does'nt find the file.</p><p>I have also read that people are starting to use a SQLite database to hold information in, is this more the standard way to go?</p><p>thanks a lot</p><p>Luke </p>","19638","","","","","2010-09-08 02:21:18","Holding Information in Android App","<java><android>","2","0","","",""
"3663364","1","3663507","","2010-09-07 23:01:05","1","7801","<p>I just had the odd case that my Android project for some reason would not properly rebuild in Eclipse (v3.5/Galileo). Occasionally that happends and so I did the usual Project => Clean... as I always do in such cases. But this time I now have the odd effect that almost all files show bugs, and looking closer it's that the compiler can't find the R-file (which is indeed missing from the gen subtree). </p><p>How do I force eclipse to rebuild that file?</p><p>Michael</p>","423411","","19635","","2010-09-07 23:04:11","2013-05-28 16:27:56","How to force eclipse to recreate the R (=resources) file?","<android>","4","2","0","",""
"3663365","1","","","2010-09-07 23:01:42","0","283","<p>I'm was trying with GridView tutorial with 14 of my own JPEGs.The first time I ran it worked but had an issue when I clicked on an image.I figured it might be because I left and extra comma at the end of my mThumbIds list.</p><p>But when I tried to run again I get:[2010-09-07 15:59:36 - HelloGridView] Installing HelloGridView.apk...[2010-09-07 15:59:44 - HelloGridView] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE[2010-09-07 15:59:44 - HelloGridView] Please check logcat output for more details.</p><p>These files do not take up much space (~20Mb). I restarted the AVD but keep getting the same issue. (Not sure what ""logcat"" refers to but Error Log had nothing.)</p><p>Can anyone tell me what is going on and how to fix this?</p>","441754","","","","","2010-09-08 08:07:26","GridView tutorial: insufficient storage issue","<android>","1","1","","",""
"3663665","1","3663693","","2010-09-08 00:15:47","44","21010","<p>I just want to set some flags when my orientation is in landscape so that when the activity is recreated in onCreate() i can toggle between what to load in portrait vs. landscape. I already have a layout-land xml that is handling my layout.</p><pre><code>public void onConfigurationChanged(Configuration _newConfig) {        if (_newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {            this.loadURLData = false;        }        if (_newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {            this.loadURLData = true;        }        super.onConfigurationChanged(_newConfig);    }</code></pre><p>Over-riding onConfigurationChanged will prevent my layout-land xml from loading in landscape orientation.</p><p>I just want to get the current orientation of my device in onCreate(). How can I get this?</p>","19875","","","","","2014-02-20 13:30:40","How can I get the current screen orientation?","<java><android><configuration><orientation>","4","0","10","",""
"3663701","1","","","2010-09-08 00:25:13","1","2037","<p>I've been working on an app that uses both GET and POST requests to Web Services.  The GET requests are no problems but the POST requests are killing me.  I've tried 2 different scenarios in the code.  The first looks like this...</p><pre><code> HttpClient httpclient = new DefaultHttpClient();   HttpPost httppost = new HttpPost(ws);   JSONObject jsonObject = new JSONObject(); try {  // Add your data  List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);  jsonObject.put(""action"", ""login"");jsonObject.put(""username"", ""*********"");    jsonObject.put(""password"", ""*********"");    httppost.setHeader(""jsonString"", jsonObject.toString());  StringEntity se = new StringEntity( jsonObject.toString());    se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, ""application/json""));  httppost.setEntity(se);             // Execute HTTP Post Request              HttpResponse response = httpclient.execute(httppost);              textview.setText(getResponse(response.getEntity()));        } catch (ClientProtocolException e) {              textview.setText(e.getLocalizedMessage());        } catch (IOException e) {              textview.setText(e.getLocalizedMessage());        } catch (JSONException e) {            textview.setText(e.getLocalizedMessage());        }</code></pre><p>This code gets this result for me...<br><strong>""Bad Request (Invalid Header Name)""</strong></p><p>Now here's my second piece of code...</p><pre><code> HttpClient httpclient = new DefaultHttpClient();        HttpPost httppost = new HttpPost(ws);        JSONObject jsonObject = new JSONObject();        try {              // Add your data              List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);              jsonObject.put(""action"", ""login"");            jsonObject.put(""username"", ""******"");            jsonObject.put(""password"", ""******"");            nameValuePairs.add(new BasicNameValuePair(""jsonString"", jsonObject.toString()));            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));              // Execute HTTP Post Request              HttpResponse response = httpclient.execute(httppost);              textview.setText(getResponse(response.getEntity()));        } catch (ClientProtocolException e) {              textview.setText(e.getLocalizedMessage());        } catch (IOException e) {               textview.setText(e.getLocalizedMessage());        } catch (JSONException e) {        }</code></pre><p>This gives me an entirely different result.  It's a long garbled mess of xml and SOAP that does have a SOAP Exception mentioned in it...<br><strong>""Server was unable to process request.  --- System.Xml.XmlException: Data at the root level is invalid.  Line 1, position 1.""</strong><br>Now, can anyone shed any light on what I am doing wrong.</p>","363591","","375874","","2010-09-08 00:28:24","2011-04-12 07:46:00","Can't do a HTTP Post to a Web Service from my Android App","<java><android><web-services><json><http-post>","2","0","1","",""
"3663745","1","3663829","","2010-09-08 00:31:56","107","81476","<p>I started learning android development. I'm following a todolist example from a book.Here is a piece of code:</p><pre><code>// Create the array list of to do itemsfinal ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();// Create the array adapter to bind the array to the listViewfinal ArrayAdapter&lt;String&gt; aa;aa = new ArrayAdapter&lt;String&gt;(  this,                                 android.R.layout.simple_list_item_1,                                todoItems                            );myListView.setAdapter(aa);</code></pre><p>I can't understand exactly this code especially this line:</p><pre><code>android.R.layout.simple_list_item_1</code></pre><p>Thank you,</p><p>Regards</p>","231116","","","","","2013-11-28 13:40:31","What is ""android.R.layout.simple_list_item_1""?","<android><layout><android-arrayadapter>","6","0","33","",""
"3663794","1","","","2010-09-08 00:41:28","3","1389","<p>Is there a reliable way to prevent truncating of sounds in soundpool? I have had some success with the sleep() function between sounds, but they still sometimes miss the last bit of sound before starting another sound. My app plays short sounds in sequence.Jerry</p>","276503","","","","","2012-02-29 04:17:11","Android soundpool timing","<android><soundpool>","2","0","0","",""
"3663803","1","3663853","","2010-09-08 00:43:43","5","15093","<p>I want to draw bitmap on draw method in MyPositionOverlay extends Overlay  class but I get this error: The method getResource() is undefined for the type MyPositionOverlay</p><p>Where I'm wrong?</p><p>Here is code form draw method:</p><pre><code>  Bitmap bmp = BitmapFactory.decodeResource(getResource(), R.drawable.icon);      canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);</code></pre><p>Thanks</p>","432848","","","","","2010-09-08 01:16:29","Android getResource() undefined error","<android>","2","0","3","",""
"3663847","1","3663878","","2010-09-08 00:53:27","6","17023","<p>I have an Android (2.2) project in Eclipse (Helios).  I want to add an MP3 file to the project so that the MP3 file is deployed to the device along with the application.</p><p>I then would like to open the file as a <code>File</code> object, which means I'd need to know the full path (?) to the file on the device, but I don't know how paths are specified in Android.</p>","14606","","14606","","2010-09-08 01:02:05","2011-05-05 11:57:19","How to add a file to an Android project, deploy it to the device, and then open it?","<android><eclipse><file-io><android-manifest>","2","0","1","",""
"3663885","1","3663950","","2010-09-08 01:02:33","1","138","<p>Is there a way I can save the current snapshot of my app before it gets destroyed (when it gets rotated):</p><p>I know I can save all my data in</p><pre><code>public Object onRetainNonConfigurationInstance() {}</code></pre><p>But is there something simpler because I have a lot of data that would need to get saved.</p>","19875","","","","","2010-09-08 03:21:39","How can I save a current snapshot of my app before I rotate?","<java><android><orientation>","2","2","","",""
"3664009","1","","","2010-09-08 01:26:04","8","2809","<p>I have trouble in installing the Android SDK to Eclipse at the course of registering available packages.What should I do :P</p>","441949","","","","","2011-06-22 03:28:56","Some packages were found but are not compatible updates","<android>","1","0","","",""
"3664122","1","3664206","","2010-09-08 01:58:31","0","1616","<p>Like the title. I have a small drawable file, but the ImageView is much larger than it. How I can fill it without left any extra space?Thanks in advance.</p>","316286","","404469","","2010-09-08 02:04:23","2013-10-03 12:19:26","How to tile a drawable file in ImageView?","<android><android-widget>","2","0","","",""
"3664398","1","","","2010-09-08 03:13:00","0","1432","<p>I installed JavaEE, JDK,  Eclipse 3.5.x (Galileo), the Android Starter SDK, and the current ADT all with no problems.  However, when I try to walk through the 'Hello Android' tutorial, I bring up the New Android Project wizard, fill it in and hit 'Finish'.</p><p>After a moment, it comes back with a message saying there was a problem at path X:\so and so\ (access denied).</p><p>Things to note:<br>    -Running Windows 7 Home Premium  64-bit<br>    -Quadcore Pentium with 8GB RAM, 8TB NAS<br>    -I am an Administrator<br>    -I have also tried this by activating the full (hidden) Administrator profile<br>    -I have reinstalled everything 8 or 9 times    -I have changed ownership &amp; permissions all over the place<br>    -I have launched eclipse in 'Run as Administrator' Mode<br>    -I have installed Everything as 32-bit, as others have done this successfully</p><p>Eclipse creates the folder it's having a problem with, but then cannot work with the .project file it creates (access denied).  It then can't save anything so there is nothing but an empty folder 'Hello_Android' on the left within Eclipse.</p><p>Anybody have any clues about what is going on-- I'm frustrated.  I want to get into this, and I've looked EVERYWHERE on the net trying to crack this nut.... but I need help.</p><p>-J  </p>","442009","","","","","2014-03-26 05:12:13","eclipse won't create adt project due to 'access denied'","<android><windows-7><access-denied>","4","1","1","",""
"3664420","1","3664477","","2010-09-08 03:18:54","1","4125","<p>Does anyone has the example of loading images from the sdcard to Image Switcher? I'm a beginner of android here. Willing to learn.</p>","358218","","","","","2010-09-08 03:51:58","How to load images from SDCard into Image Switcher?","<android><android-sdcard>","1","0","1","",""
"3664440","1","11562391","","2010-09-08 03:23:42","17","10217","<p>I have a WebViewClient attached to my WebView like so:</p><p>webView.setWebViewClient(new MyWebViewClient());</p><p>Here is my implementation of MyWebViewClient:</p><pre><code>private class MyWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {      webView.loadUrl(url);      return true;    }    }</code></pre><p>I give the webView a URL to load via loadUrl().  If I have a link (""a href..."") in the page, my shouldOverrideUrlLoading method is called and I can intercept the link click.</p><p>However, if I have a form whose method is ""POST"", the shouldOverrideUrlLoading method is not called.</p><p>I noticed a similar issue here: <a href=""http://code.google.com/p/android/issues/detail?id=9122"">http://code.google.com/p/android/issues/detail?id=9122</a> which seems to suggest overriding postUrl in my webView.  However, this API is only available starting from API level 5.</p><p>What can I do if I'm on API level 4?  Is there any other way to intercept form posts?</p>","409127","","672018","","2012-07-06 13:49:44","2012-07-19 13:53:46","Android - how to intercept a form POST in android WebViewClient on API level 4","<android><forms><post><webviewclient>","2","2","7","",""
"3664554","1","","","2010-09-08 03:59:53","5","5867","<p>I'm trying to implement a double-tap zoom like function in my MapView. The event always fires the first time, but never subsequent times. Below is my code. I have a feeling it has something to do with the map controller getting lost after the first time the event is fired.</p><pre><code>import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.View.OnTouchListener;import com.google.android.maps.MapActivity;import com.google.android.maps.MapController;import com.google.android.maps.MapView;public class mainmap extends MapActivity implements OnTouchListener{    long lasttime = -1;    MapController mapc;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        MapView mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);        mapc = mapView.getController();        mapView.setOnTouchListener(this);           }    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return false;    }    @Override    public boolean onTouch(View v, MotionEvent event) {        if (event.getAction() == MotionEvent.ACTION_DOWN){            if(event.getEventTime()-lasttime&lt;2000){                mapc.zoomInFixing((int)event.getX(),(int)event.getY());                         }        }               lasttime=event.getEventTime();        return true;    }  }</code></pre><p>I have also tried editing the OnTouch method to cast the incoming View to a MapView, getting the controller while the event is fired. However, I get the same results where the first event is fired but not subsequent ones.</p><pre><code>public boolean onTouch(View v, MotionEvent event) {        if (event.getAction() == MotionEvent.ACTION_DOWN){            if(event.getEventTime()-lasttime&lt;2000){                ((MapView)v).getController().zoomInFixing((int)event.getX(), (int)event.getY());                            }        }               lasttime=event.getEventTime();        return true;    }</code></pre><p>Being as basic as possible, I cut out all of the code in the OnTouch method and programmed it to simply display a small toast message.</p><pre><code>public boolean onTouch(View v, MotionEvent event) {        if (event.getAction() == MotionEvent.ACTION_DOWN){               Toast.makeText(this,""Down!"",Toast.LENGTH_SHORT).show();        }               return true;}</code></pre><p>This works as expected, displaying the Toast each time the MapView is touched.</p><p>I don't understand why the event will fire properly in this case but not in my previous implementation.</p>","436528","","436528","","2010-09-08 14:22:16","2012-09-03 10:40:50","OnTouch in MapView only fires the first time","<android><event-handling><android-mapview><ontouchlistener>","5","0","2","",""
"3664630","1","3664642","","2010-09-08 04:27:57","1","1065","<p>I am testing my app on my actual device, and it seems like there is a memory leak. The app has crashed after a couple of hours. How can I pull up the log of the crash?</p><p>I plugged my phone in via USB and tried:</p><pre><code>adb logcat -v</code></pre><p>but I get the following message in my terminal:</p><pre><code>- waiting for device -error: more than one device and emulator</code></pre><p>How can I diagnose my crash?</p>","19875","","","","","2010-12-01 13:24:45","My app just crashed, how can I get the crash log?","<java><android><logging><crash>","1","0","","",""
"3664636","1","","","2010-09-08 04:29:56","0","848","<p>I have custom gridview with icon &amp; text, gridview is displayed in 2 columns</p><p>now i want to implement it using viewflipeer</p><p>i.e every time I fling, it has to display a cell each time.when i fling to left, it has to show left cell item, like wise left,right, top, bottom</p><p>can any body help??</p><p>Thanx in advance</p><p>Chiranjeevi</p>","428136","","","","","2011-11-11 08:22:18","Implement gridview in Viewflipper","<android>","1","2","","",""
"3664660","1","","","2010-09-08 04:36:27","0","379","<p>Hi All I need to Detect My android Device is configured with email or not in Android 1.5.  i have Seen the class AccountManager but it is useful for only 2.0 not 1.5. Please any one tell what is class for 1.5 to Detect the Email Client of Device  </p>","438854","","","","","2011-04-19 09:05:59","Get Configured Email Account In Android 1.5","<android>","1","0","","",""
"3664699","1","3665169","","2010-09-08 04:47:03","14","5388","<p><strong>What we are doing currently?</strong><br/>We have some structured, textual data on a server which is exposed using web services(RESTful). My application polls this server regularly(AlarmManagerService)  to fetch the data and save it on local database(sqlite). Also, a user is authenticated and authorized beforehand for access.</p><p><strong>Questions:</strong>  </p><ol><li><p>There is a SyncAdapter/AccountManager class in the SDK and I was wondering if it can be of any use in my application to achieve the syncing mentioned above?  </p></li><li><p>If yes, what sort of infrastructure is needed at back end to support a sync set up using this adapter? Links to articles etc. that give details of using this adapter and other info is appreciated.</p></li></ol>","236128","","995926","","2012-08-01 10:27:40","2012-08-01 10:27:40","Android SyncAdapter use case","<android><android-syncadapter>","1","0","5","",""
"3664703","1","3664797","","2010-09-08 04:48:20","0","263","<p>I am placing a code below, I have created a local Thread and getting Error at the last Closing Braces, Can anybody please sort it out for me. </p><pre><code>Thread dt = new Thread(this){public void run()     {        Looper.prepare();        GetCurrentLocation loc = new GetCurrentLocation(RestaurantFinder.this);        loc.setLocParams();        int counter = 0;        String lat = GetCurrentLocation.getCurrentLatitude();        String lon = GetCurrentLocation.getCurrentLongitude();        while (lat == null &amp;&amp; lon == null                &amp;&amp; counter &lt;= 1000)         {            lat = GetCurrentLocation.getCurrentLatitude();            lon = GetCurrentLocation.getCurrentLongitude();            counter = counter + 1;        }        System.out.println(""The Latitude are:"" + lat);        System.out.println(""The Longitude are:""+ lon);        if (lat == null &amp;&amp; lon == null)     {            // another alert for location not found            AlertDialog.Builder builder1 = new AlertDialog.Builder(RestaurantFinder.this);            builder1.setTitle(""Restaurant Finder"");            builder1.setMessage(""Unable to find the Current Location"");            builder1.setPositiveButton(""OK"",new DialogInterface.OnClickListener()            {                                @Override                                public void onClick(DialogInterface dialog,int which)                                 {                                    dialog.dismiss();                                }            });            AlertDialog dialog1 = builder1.create();            dialog1.show();            // dismiss ProgressDialog by Handler            pd.dismiss();        }         else        {            weather();            // dismiss ProgressDialog by Handler            pd.dismiss();        }    }});&lt;--(Error:Syntax error on token "")"", Delete this token) </code></pre>","422859","","244296","","2010-09-08 05:10:00","2010-09-08 07:33:35","Thread Error needs to be found","<java><android>","2","0","","",""
"3664734","1","3664759","","2010-09-08 04:57:01","2","1496","<p>I seem to be getting a crash after a long period of time on my device:</p><pre><code>E/AndroidRuntime( 1115): FATAL EXCEPTION: mainE/AndroidRuntime( 1115): java.lang.RuntimeException: Unable to resume activity {org.stocktwits.activity/org.stocktwits.activity.Main}: java.lang.NullPointerExceptionE/AndroidRuntime( 1115):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3128)E/AndroidRuntime( 1115):    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3143)E/AndroidRuntime( 1115):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2059)E/AndroidRuntime( 1115):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 1115):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 1115):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime( 1115):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 1115):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 1115):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime( 1115):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime( 1115):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 1115): Caused by: java.lang.NullPointerExceptionE/AndroidRuntime( 1115):    at org.stocktwits.activity.Main.getQuotesFromYQL(Main.java:457)E/AndroidRuntime( 1115):    at org.stocktwits.activity.Main.onStart(Main.java:339)E/AndroidRuntime( 1115):    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1129)E/AndroidRuntime( 1115):    at android.app.Activity.performStart(Activity.java:3781)E/AndroidRuntime( 1115):    at android.app.Activity.performRestart(Activity.java:3811)E/AndroidRuntime( 1115):    at android.app.Activity.performResume(Activity.java:3816)E/AndroidRuntime( 1115):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3118)E/AndroidRuntime( 1115):    ... 10 more</code></pre><p>onStart() seems to work fine when I exit and resume my app, but fails after some time...</p><p>Line 457 in my app is the JSON 'query' object:</p><pre><code>/**     * Performs YQL, parses JSON, and adds Quotes to adapter     */    private void getQuotesFromYQL() {        quotesAdapter.clear();        System.out.println(""YQL QUERY: "" + buildQuery());        JSONObject json = RestClient.connect(buildQuery());        try {            JSONObject query = json.getJSONObject(""query"");            JSONObject results = query.getJSONObject(""results"");            if (query.getString(""count"").equals(""1"")) { // YQL JSON doesn't                // return an array for                // single quotes                JSONObject quote = results.getJSONObject(""quote"");                Quote myQuote = new Quote();                myQuote.setName(quote.getString(""Name""));                myQuote.setSymbol(quote.getString(""Symbol""));                myQuote.setLastTradePriceOnly(quote                        .getString(""LastTradePriceOnly""));                myQuote.setChange(quote.getString(""Change""));                myQuote.setOpen(quote.getString(""Open""));                myQuote.setMarketCapitalization(quote                        .getString(""MarketCapitalization""));                myQuote.setDaysHigh(quote.getString(""DaysHigh""));                myQuote.setYearHigh(quote.getString(""YearHigh""));                myQuote.setDaysLow(quote.getString(""DaysLow""));                myQuote.setYearLow(quote.getString(""YearLow""));                myQuote.setVolume(quote.getString(""Volume""));                myQuote.setAverageDailyVolume(quote                        .getString(""AverageDailyVolume""));                myQuote.setPeRatio(quote.getString(""PERatio""));                myQuote.setDividendYield(quote.getString(""DividendYield""));                quotesAdapter.add(myQuote);            } else {                JSONArray quotes = results.getJSONArray(""quote"");                for (int i = 0; i &lt; quotes.length(); i++) {                    JSONObject quote = quotes.getJSONObject(i);                    // .getJSONObject(""quote"");                    // Do something with the user                    Quote myQuote = new Quote();                    myQuote.setName(quote.getString(""Name""));                    myQuote.setSymbol(quote.getString(""Symbol""));                    myQuote.setLastTradePriceOnly(quote                            .getString(""LastTradePriceOnly""));                    myQuote.setChange(quote.getString(""Change""));                    myQuote.setOpen(quote.getString(""Open""));                    myQuote.setMarketCapitalization(quote                            .getString(""MarketCapitalization""));                    myQuote.setDaysHigh(quote.getString(""DaysHigh""));                    myQuote.setYearHigh(quote.getString(""YearHigh""));                    myQuote.setDaysLow(quote.getString(""DaysLow""));                    myQuote.setYearLow(quote.getString(""YearLow""));                    myQuote.setVolume(quote.getString(""Volume""));                    myQuote.setAverageDailyVolume(quote                            .getString(""AverageDailyVolume""));                    myQuote.setPeRatio(quote.getString(""PERatio""));                    myQuote.setDividendYield(quote.getString(""DividendYield""));                    quotesAdapter.add(myQuote);                }            }            serializeQuotes();        } catch (JSONException e) {            System.out.println(e);        }    }</code></pre>","19875","","","","","2010-09-08 05:15:03","Does Android kill local variables after some time?","<java><android><crash><nullpointerexception>","2","0","1","",""
"3664992","1","","","2010-09-08 05:59:57","1","1945","<p>i used this code</p><pre><code>InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(EditView.getWindowToken(), 0);</code></pre><p>this code works fine in a class which extends Activity</p><p>but i need to hide virtual keyboard in a class which extends LinearLayout.</p>","432901","","91299","","2010-09-08 06:02:17","2010-09-08 06:02:17","How to hide virtual keyboard in android","<android>","0","2","","",""
"3665105","1","3665133","","2010-09-08 06:22:47","-1","464","<p>I find <a href=""http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html"" rel=""nofollow"">this code</a> useful and want to copy-paste it into my application which is licensed as <a href=""http://en.wikipedia.org/wiki/Public_domain"" rel=""nofollow"">public domain</a>.</p><p>It is the Android blog, they often show useful code snippets.<br>There is no way to contact the author, and the only license info I can see is ""©2008 Google Inc. All rights reserved.""</p><p>Should I:</p><ul><li>Stop worrying and just copy-paste?</li><li>Reimplement it myself without looking?</li><li>Copy-paste and then make it look different?</li><li>Any better solution? ...</li></ul><p>Is there a rule like ""if shorter than 50 lines then no copyright applies"" or something?</p>","226958","","","","","2010-09-08 06:53:10","Can I copy-paste this code snippet into my Public Domain app?","<android><licensing>","3","0","","2013-03-11 03:31:31",""
"3665148","1","4807407","","2010-09-08 06:29:29","1","1888","<p>I have an Android project created in eclipse.I want to slightly modify this(package names,etc) and make another app.I want both apps to be installed on phone.How to take care of versioning an  app name.How should i go about renaming package and project names?</p><p>ThanksDheepak</p>","434708","","","","","2011-01-26 16:58:04","Renaming package and version names of Android project in eclipse","<android><eclipse><version><project-rename>","1","1","","",""
"3665183","1","3666690","","2010-09-08 06:35:57","6","7769","<p>Does anyone know what is the intent for missed call. Actually i want to send sms on missed call and incomming call in my application. </p>","307585","","881229","","2014-04-01 19:52:48","2014-04-15 13:59:33","broadcast receiver for missed call in android","<android><android-intent><broadcastreceiver>","2","0","2","",""
"3665205","1","","","2010-09-08 06:41:18","0","428","<p>I am running the tcpdump on my android emulator and since the tcpdump is running in the background there isnt any data in the buffer and hence the application is stuck at this point.here is the part of the code:</p><pre><code>else if (tcpdumpButton.isChecked())           {              try              {                 Process process1 = Runtime.getRuntime().exec(""tcpdump"");                 DataOutputStream os = new DataOutputStream(process1.getOutputStream());                 BufferedReader osRes = new BufferedReader(new InputStreamReader(process1.getInputStream()));                 //ByteArrayInputStream osRes = (ByteArrayInputStream) process1.getInputStream();                 // os.writeBytes(""tcpdump -l port 80"");                 os.flush();                 StringBuffer output = new StringBuffer();                 try                 {                    while ((osRes.readLine()) != null)                    {                       output.append(osRes.readLine());                       output.append(""\n"");                    }                 }                 catch (Exception e)                 {                    throw e;                 }                 process1.waitFor();                 tv.setText(output);                 setContentView(tv);              }              catch (Exception e)              {                 throw e;              }</code></pre><p>any help?</p>","275674","","275674","","2010-09-08 06:46:37","2011-06-01 22:38:16","output buffer empty until tcpdump is killed","<java><android>","1","2","","",""
"3665219","1","3665337","","2010-09-08 06:43:49","0","362","<p>I have got to know that the Handlers are basically used to Run the Small Section of Code and etc...</p><p>But I didn't got the exact scenerio about when particularly It is Ideal to use the Handlers!</p><p>Any Help???</p><p>Thanks,david</p>","422859","","","","","2010-09-08 07:09:31","Handlers in Android Programming","<android><handlers>","2","0","","",""
"3665289","1","3727714","","2010-09-08 06:54:15","1","3439","<p>I'm building a Webapp that uses OpenId to authenticate users, like Stackoverlfow does. There will be a mobile App too, e.g. Android or iPhone. These Apps have to authenticate or login somehow, to access data and update stuff that belongs to the user. Since there is no username and password one could provide to authenticate the mobile device, I wonder how to achieve this.</p><p>Two ways came into my mind:</p><ol><li><p>Generate some key on the server that must be entered on the device. This key will be send as auth-key when the mobile device sends or requests data and the user can be linked that way. When using this Option, the key should be transported somehow to the user, so he doesn't have to type it in. Maybe via email, SMS or by scanning a barcode.</p></li><li><p>The mobile App uses the Browser or shows an integrated Web-Panel that opens a special page of the Webapp. On this page, the user has to login in, and could then allow the mobile App to read and write data.</p></li></ol><p>My question is: Are both ways possible and save? Which one would you prefer? What are the details to watch out for? Are there any other ways to do this? If I got it all right, it would not be possible to use OpenId on the Device, and link the mobile and the webapp that way, right?</p>","60518","","","","","2010-09-16 14:34:08","How to authenticate a mobile App without username and password?","<iphone><android><authentication><mobile><web-applications>","3","3","3","",""
"3665343","1","","","2010-09-08 07:04:16","-5","1089","<p>I developed one app in that I want to send URI from Class1 editText to another class containing editText.<br>Can anyone tell me how to do that?</p>","410871","","1379664","","2012-12-10 11:53:40","2013-07-02 12:28:09","Shared preference","<android><activity><android-intent><bundle>","5","1","","",""
"3665386","1","3670432","","2010-09-08 07:11:55","26","11805","<p>I'm moving away from strict Android development and wanting to create iPhone applications. My understanding is that I can code the backend of iOS applications in C/C++ and also that I can use the NDK to include C/C++ code in Android apps. My question however is how? I've googled quite a bit and I can't find any clear and concise answers.When looking at sample code for the NDK, it seems that all the function names etc. are Android (or at least Java) specific and so I would not be able to use this C/C++ backend to develop an iPhone frontend? I'd appreciate some clarification on this issue and if at all available some code to help me out? (even just a simple Hello World that reads a string from a C/C++ file and displays it in an iOS and Android app). </p><p>Thanks guysChris</p>","410921","","","","","2013-03-28 08:34:36","How to code sharing between Android and iOS","<iphone><android><sharing>","6","5","18","",""
"3665458","1","","","2010-09-08 07:23:05","-3","121","<p>I am new to Android development.I want to know how you all manage objects.For eg we make object as A a = new A(); and then manage that object.But, here, we call A.class;</p><p>My concern is that i dont want to call onCreate(),nor do i want to push UI screen.I just want to make 1 static object for 1 screen;and want to manage it throughout my applicationthat is, instead of calling A.class; can i call A a = new A(),and manage that object without pushing,and whenever i need i push that screen. Is there someway ?</p><p>Thanks...</p>","406631","","","","","2010-09-08 08:58:55","How to manage objects?","<android>","1","2","","",""
"3665470","1","3666012","","2010-09-08 07:25:18","0","1687","<p>How can i measure length of string entered in the edittext while typing.Because i want to show a warning when the entered text length cross 100 character.Thanks in advance.</p>","307585","","302328","","2010-09-08 09:14:11","2010-09-08 09:14:11","measure length of edittext string dynamically in android","<android><edittext><textwatcher><charactercount>","1","0","1","",""
"3665489","1","","","2010-09-08 07:28:30","1","547","<p>I 've developed on SMS sending application for Android devices. A pop up opens up asking to choose sms applications (native app or mine ), whenever I try to send SMS to contact already present in Contact Book on my android device. But in case, if I try to resend a SMS already present in sms box in android device, no such pop up opens up ?   </p>","218665","","","","","2011-12-10 15:13:01","Android SMS Sending behavior","<android>","1","0","2","",""
"3665534","1","3666627","","2010-09-08 07:36:01","2","1838","<p>I am getting this exception when trying to start an activity (TestLocationActivity) that is derived from MapActivity, and which is declared inside an Android library project:</p><pre><code>09-08 09:29:45.357: ERROR/AndroidRuntime(7502): java.lang.NoClassDefFoundError: msumo.business.testlocation.impl.view.TestLocationActivity09-08 09:29:45.357: ERROR/AndroidRuntime(7502):     at msumo.app.test2.impl.Test2AppManagerImpl.loadNewScreen(Test2AppManagerImpl.java:94)09-08 09:29:45.357: ERROR/AndroidRuntime(7502):     at msumo.business.common.GuiAppManager.handleMessage(GuiAppManager.java:101)09-08 09:29:45.357: ERROR/AndroidRuntime(7502):     at msumo.core.MessageBus.dispatchMessage(MessageBus.java:338)09-08 09:29:45.357: ERROR/AndroidRuntime(7502):     at msumo.core.MessageBus$1.doWork(MessageBus.java:251)09-08 09:29:45.357: ERROR/AndroidRuntime(7502):     at msumo.core.util.WorkerThread.run(WorkerThread.java:29)</code></pre><p>I can not find the source of the problem. I have included in both AndroidManifest.xml of main application and library project the Google Maps library declaration:</p><pre><code> &lt;uses-library android:name=""com.google.android.maps"" /&gt;</code></pre><p>In Eclipse I get no error and application launches normally, but when trying to start the indicated Activity it fails. The chunck of code that starts the activity is the following one:</p><pre><code>    Intent intent = new Intent(ctx, TestLocationActivity.class);    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    ctx.startActivity(intent);</code></pre><p>I have no clue about what can be wrong. Is it maybe impossible to use a Google APIs library from an Android Library project?</p><h2>Update</h2><hr><p>I found some System traces that could help clear the situation:</p><pre><code>09-08 10:53:34.615: INFO/dalvikvm(13221): Rejecting re-init on previously-failed class Lmsumo/platform/location/impl/LocationModuleImpl$2; v=0x009-08 10:53:34.654: WARN/System.err(13221): java.lang.NoClassDefFoundError: msumo.platform.location.impl.LocationModuleImpl$209-08 10:53:34.654: WARN/System.err(13221):     at msumo.platform.location.impl.LocationModuleImpl.doUseBestProvider(LocationModuleImpl.java:189)09-08 10:53:34.654: WARN/System.err(13221):     at msumo.platform.location.LocationModule.performQuery(LocationModule.java:329)09-08 10:53:34.662: WARN/System.err(13221):     at msumo.platform.location.LocationModule.handleMessage(LocationModule.java:543)09-08 10:53:34.662: WARN/System.err(13221):     at msumo.core.MessageBus.dispatchMessage(MessageBus.java:338)09-08 10:53:34.662: WARN/System.err(13221):     at msumo.core.MessageBus$1.doWork(MessageBus.java:251)09-08 10:53:34.669: WARN/System.err(13221):     at msumo.core.util.WorkerThread.run(WorkerThread.java:29)09-08 10:53:34.685: WARN/System.err(13221): java.lang.NoClassDefFoundError: msumo.platform.location.impl.LocationModuleImpl$209-08 10:53:34.685: WARN/System.err(13221):     at msumo.platform.location.impl.LocationModuleImpl.doUseBestProvider(LocationModuleImpl.java:189)09-08 10:53:34.685: WARN/System.err(13221):     at msumo.platform.location.LocationModule.performQuery(LocationModule.java:329)09-08 10:53:34.693: WARN/System.err(13221):     at msumo.platform.location.LocationModule.handleMessage(LocationModule.java:543)09-08 10:53:34.693: WARN/System.err(13221):     at msumo.core.MessageBus.dispatchMessage(MessageBus.java:338)09-08 10:53:34.693: WARN/System.err(13221):     at msumo.core.MessageBus$1.doWork(MessageBus.java:251)09-08 10:53:34.693: WARN/System.err(13221):     at msumo.core.util.WorkerThread.run(WorkerThread.java:29)</code></pre>","34880","","34880","","2010-09-08 08:56:18","2010-09-08 10:54:31","ClassNotFound launchig maps activity declared in Android library","<android><google-maps><runtime>","4","0","","",""
"3665758","1","","","2010-09-08 08:13:30","0","593","<p>I have a ListView:</p><p>...</p><pre><code> &lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""</code></pre><p>android:id=""@id/android:list""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:drawSelectorOnTop=""false""  android:scrollingCache=""true""  android:fastScrollEnabled=""true""  android:choiceMode=""singleChoice""  android:background=""?android:attr/colorBackground""  android:layout_weight=""1""  android:cacheColorHint=""?android:attr/colorBackground""  android:fadingEdge=""none""/></p><p>...</p><p>And a layout for the list items:</p><p>...</p><pre><code> &lt;ImageView  android:id=""@+id/folder_image"" android:src=""@drawable/icon_folder""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:paddingRight=""5dip""        android:paddingTop=""3dip""/&gt;    &lt;TextView        android:id=""@+id/fol_name""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""22dip""        android:layout_toRightOf=""@+id/folder_image""/&gt;</code></pre><p>...</p><p>The ListView is populated from a database using a setListAdapter(SimpleCursorAdapter). For each row, I want to display an image (a folder icon). However, for two specific rows (assume I know how to identify the rows using, for example, some sort of indicator) I'd like to display different images. Let's assume that I have an undetermined number of folders and a folder icon will be displayed for each row along side the folder's name. Let's also assume that I have, for example, a Word doc and an Excel file, exactly one of each, and I'd like to display the appropriate images for each.</p>","442186","","","","","2010-09-08 10:16:41","How to use an image in a ListView from a database in Android?","<android><listview><listviewitem>","1","1","","",""
"3665968","1","3666061","","2010-09-08 08:43:54","0","135","<p>hey guys, till now i have developed web applications but know i'm thinking to get hands on Mobile Application. So how to i start it n from where coz i have no idea about Android,iPhone,Symbian etc.. nor i dn't have a big Phone to know how applications runs on it..mainly i want to focus on Android Applications, is there any simulator for Android Phones, i dn't even know how to use simulators..I just need a step-by-step tutorial for mobile app development n Android Application.</p>","276106","","","","","2010-09-08 08:53:41","Need a detail info about how to learn and start developing Mobile Application","<android><mobile-phones>","1","1","","",""
"3666066","1","","","2010-09-08 08:54:02","1","109","<p>I want my application to be started whenever the phone is turned on or restarted. can anyone give me some suggestions regarding this please.</p><p>thankskaisar</p>","438383","","","","","2010-09-08 08:57:04","starting android application","<android>","1","0","","",""
"3666150","1","","","2010-09-08 09:05:51","4","671","<p>In have developed application of streaming.</p><p>Code loks like:</p><pre><code>mediaPlayer = new MediaPlayer();    mediaPlayer.setWakeMode(this, PowerManager.PARTIAL_WAKE_LOCK);    mediaPlayer.setOnErrorListener(this);    mediaPlayer.setOnBufferingUpdateListener(this);    new Thread(new Runnable() {        public void run() {                            try {                                    mediaPlayer.setDataSource(getString(R.string.URL));                mediaPlayer.prepare();                mediaPlayer.start();            } catch (IOException e) {                e.printStackTrace();            }        }    }).start();   </code></pre><p>My application is working fine in G1 but not in Nexus.Problem is player stops after sometime in Nexus.and gives me error in log:</p><pre><code>09-08 11:01:34.640: ERROR/HTTPStream(34): recv failed, errno = 11 (Try again)</code></pre><p>and sometimes</p><pre><code> 09-08 11:13:45.130: ERROR/HTTPStream(34): recv failed, server is gone, total received: 12272 bytes</code></pre><p>What's wrong in this code?</p><p>Why this error occur in Nexus?</p>","385343","","","","","2010-09-08 09:05:51","recv failed server is gone in android","<android>","0","1","","",""
"3666250","1","3666654","","2010-09-08 09:19:46","3","6278","<p>i want to call the activity when user pull down the notification and click on that notification...how can i do that?</p>","421645","","","","","2013-03-16 16:13:13","call activity when notification click event","<android>","3","0","1","",""
"3666261","1","","","2010-09-08 09:21:26","0","857","<p>I 'm using Wake Lock to stay awake my phone.I want to activate  sleep mode when I will push the button ""Activate""</p><p>How can I activate sleep mode?</p>","366494","","","","","2010-09-08 10:12:08","Android How to back to sleep mode after staying awake(WAKE LOCK)","<android>","1","0","","",""
"3666291","1","3666863","","2010-09-08 09:25:34","1","2469","<p>Currently I'm trying to implement a reusable Twitter status 'poster'.  The Twitter status part of it is working, but the reusable bit isn't.  Here's what I'm doing:</p><p>An activity called SummaryDisplay imports a class TweetStatus and calls a function sendStatus.  It also implements a listener which is called when TweetStatus can confirm that the status was successfully sent.  So far so good.</p><p>TweetStatus sends an intent to another activity, OAUTH, <strong>which will return with the user token and secret</strong> allowing us to 'login' to Twitter.</p><p>If OAUTH can't find any saved tokens and secrets, it sends an intent to the browser so the user can login to Twitter and confirm that our app is allowed to send tweets on their behalf.  Twitter than uses a callback to return to the OAUTH application (by using an intent filter within the manifest we make our own android:scheme and host):</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.VIEW"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;    &lt;data android:scheme=""my-app"" android:host=""twitter-login-success"" /&gt; &lt;/intent-filter&gt;</code></pre><p>The callback URI is then:</p><pre><code>private static final Uri CALLBACK_URI = Uri.parse(""my-app://twitter-login-success"");</code></pre><p>It is because of this callback being an intent that the OAUTH class has to extend activity (so it can receive these intents).</p><p>So the problem is in OAUTH returning with the token and secret (shown in bold above).  Currently OAUTH sends an intent to SummaryDisplay that then sends the data to TweetStatus.  The problem is that the SummaryDisplay intent is hardcoded:</p><pre><code>Intent i = new Intent(this, SummaryDisplay.class);</code></pre><p>so the OAUTH class is no longer reusable as a new one will need to be made for each activity which wants to send a Twitter status.</p><p>One option is for the callback from Twitter to be changed to SummaryDisplay instead of OAUTH, but then this requires changing the callback to one of your choice (one not registered with Twitter and I need to check if that's allowed).  Another option which I'm trying is to use StartActivityForResult.</p><p>So:</p><p>TweetStatus calls OAUTH with StartActivityForResult,</p><p>OAUTH calls the browser,</p><p>Browser then calls OAUTH back using a callback URI,</p><p>OAUTH returns result to whomever started it.</p><p>Therefore reusable. However the callback URI received from the browser is seemingly creating a new instance of OAUTH which has no idea who to callback, so just does nothing.  I've tried setting the android:launchMode to singleInstance but this disables the result from being sent (with LogCat reporting):</p><pre><code>09-08 10:22:00.742: WARN/ActivityManager(563): Activity is launching as a new task, so cancelling activity result.</code></pre><p>Are there any other ways of doing this?  Is there, for example, a way of sending a ""class"" of yourself in an intent which can then be used in </p><pre><code>Intent i = new Intent(this, myClassVariableSetUsingAnIntent);</code></pre><p>So I can then use</p><pre><code>android:launchMode=""singleInstance""</code></pre><p>Thanks for any help.</p>","295930","","295930","","2010-09-08 12:17:30","2010-09-08 12:31:12","Android StartActivityForResult for reusable code - any other ways of doing this? (regarding Twitter)","<android><twitter><oauth>","2","0","1","",""
"3666368","1","3666721","","2010-09-08 09:37:23","1","3259","<p>In my application I need data which is accessible for a few activities. I've read that a good solution is to use <code>Application</code> class for this. So I use it like this:</p><pre><code>public class MyApplication extends Application {  private String str;  public String getStr(){    return str;  }  public void setStr(String s){    str = s;  }}</code></pre><p>and I can access this variable from activity like this:</p><pre><code>MyApplication appState = ((MyApplication)getApplicationContext());String str = appState.getStr();</code></pre><p>It's ok, but I also have xml parser class:</p><pre><code>public class MyXMLHandler extends DefaultHandler {</code></pre><p>and if I try to do the same here </p><pre><code>    MyApplication app = ((MyApplication)getApplicationContext());    String str = app.getStr();</code></pre><p>I'm getting <code>The method getApplicationContext() is undefined for the type MyXMLHandler</code></p><p>How can I access my variable?</p>","386817","","1288","","2013-07-06 14:02:57","2013-07-06 14:02:57","Access Application class from class other then Activity","<java><android><android-application>","2","0","2","",""
"3666432","1","","","2010-09-08 09:44:18","0","660","<p>Does anyone knows how to intercept events from other 3rd party Apps, say, games, Maps, etc.This includes events like motionevents, screen prompts, etc.</p><p>We have limited success with capturing touch events via the AccessibilityService, click, longclick, etc. But hitting a blank dealing with motionevents such as gestures or how the users are interacting with the screen.</p><p>(we have approval from users to capture such information in a control study)</p><p>We believe that if we root the phone (mess with the kernel) we can get such data but this inadvertently void the warranty on the user phone, so is there any other way to obtain such information on the API level?</p><p>Many thanks!</p>","442261","","","","","2010-12-04 13:19:05","Android Intercepting Events From Other Apps","<android><intercept><listen>","1","1","","",""
"3666505","1","3669153","","2010-09-08 09:54:02","1","1106","<p>I'm looking into using Monodroid for Android app development. I'd like to know what minimum version of Android is required for runnning Monodroid applications.</p><p>Thanks,</p><p>Adrian</p>","59301","","","","","2011-12-27 19:54:17","Minimum Android version for Monodroid applications?","<android><monodroid>","3","0","","",""
"3666511","1","","","2010-09-08 09:54:43","0","714","<p>i have trouble with a piece of code that runs fine on 99% of installations, but leads to an infinite loop on a few HTC Desire handsets. </p><p>What I'm trying to do is to create a list of months for which data is available. I start from the first date for which data is available and then use a loop until i reach the present. </p><p>Here is the code (simplified):</p><pre><code>    GregorianCalendar today = new GregorianCalendar();    GregorianCalendar xCal = new GregorianCalendar();    xCal.setTime(startDate);    xCal.set(GregorianCalendar.DAY_OF_MONTH, resetDay); // resetDay = end of billing period    while(xCal.before(today))    {        MonthObject xObj = new MonthObject(); // Create object to hold information        xObj.setTimestamp(xCal.getTimeInMillis()); // Save timestamp for start of period        xObj.setFromDate(xCal.getTime());  // Save date for start of period        xCal.add(GregorianCalendar.MONTH, 1); // Increment by 1 month        xCal.set(GregorianCalendar.DAY_OF_MONTH, resetDay); // set to end of billing period        xCal.set(Calendar.HOUR_OF_DAY, 0); // make sure it's midnight        xCal.set(Calendar.MINUTE, 0);        xCal.set(Calendar.SECOND, 0);        xCal.set(Calendar.MILLISECOND, 0);        xObj.setToDate(xCal.getTime()); // Save timestamp for end of period        xObj.setToTimestamp(xCal.getTimeInMillis()); // Save date for end of period    Log.v(""NetworkCheck"", ""Added MonthObject - "" + xObj.fromDate.toGMTString() + "" to "" + xObj.toDate.toGMTString());        dates.add(xObj); // Add to collection        xObj = null;    }    xCal = null;    today = null;</code></pre><p>So, on 99% of handsets this gives the desired result (list of months). On a few handsets, however, i get this output: </p><pre><code>D/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMTD/NetworkCheck( 2311): Added MonthObject - 30 Aug 2010 22:00:00 GMT to 30 Aug 2010 22:00:00 GMT</code></pre><p>and i have absolutely no idea why this is. Has anyone else come across a similar problem? </p><p>Thanks!</p><p>Andreas</p>","360386","","","","","2012-01-10 14:34:07","Android: Strange GregorianCalendar Behavior","<android>","2","0","","",""
"3666593","1","6456874","","2010-09-08 10:04:22","1","782","<p>I want to know the process or order of creating the AlertDialog. The order of I asking this question is that I suppose to filter and disable some list item in the AlertDialog. It this must be dynamically. So I chose overwrite the onPrepareDialog(int id, Dialog dialog) method.</p><p>First I create a AlertDialog in the onCreateDialog(int id) method</p><pre><code>protected Dialog onCreateDialog(int id) {    --------    builder.setMultiChoiceItems(itemsId, checkedItems, mListenter);    ---------}protected void onPrepareDialog(int id, Dialog dialog) {    -----------    ListView mListView = ((AlertDialog)dialog).getListView();    mListView.setItemChecked(0, false);    mListView.invalidateViews();    View view = mListView.getChildAt(0);    -----------}</code></pre><p>But these code not work. The first item was still be checked after I check it before.And the ChildView is null when the first time display the dialog, why?How to filer some item in ListView and how to disable but show some of items.</p>","389204","","","","","2011-06-23 15:45:01","What is the process of creating an AlertDialog with ListView in Android?","<android><listview><alertdialog>","1","0","","",""
"3666623","1","","","2010-09-08 10:09:01","1","688","<p>I am using bing maps for showing the distances between specified places in my app. We are using <code>SOAP</code> request for getting the image from bing. that image we are showing in <code>WebView</code>.</p><p>We want the effect same like shown in bing map website like zooming and panning effect. But through the SOAP we are unable to do that because, it gives us only one image at a time.</p><p>I have tried <code>ImageView</code> also for it but, not useful.</p><p>I have also tried to used mapview available in android but, it is not useful for these reasons.</p><ol><li>I am requesting map through the SOAP request.</li><li>I am not using any API key for getting the map images.</li><li>It uses ""com.google.android.maps"" for library.</li></ol><p>I would like to know is there any solution for such problem?</p>","329701","","119895","","2010-09-08 11:19:08","2011-09-20 22:09:53","mapview for bing maps in android","<android><bing-maps-controls>","1","2","","",""
"3666700","1","","","2010-09-08 10:20:30","0","1753","<p>I have some troubles when I try to create a droidgap project.I installed everything required to run a droidgap project (jdk, ruby, git bash, ...) and all of them work perfectly.</p><p>I found this post : <a href=""http://stackoverflow.com/questions/3588534/phonegap-android-sample-pr"">http://stackoverflow.com/questions/3588534/phonegap-android-sample-pr</a> where it's said that I should try to add "".bat"" tu the ""ant"" command found in the ""bin/droidgap"" file. The problem is that in that file the ""ant"" command call doesnt't exist since in the last phonegap version was released.I get the following errors:</p><pre><code>C:\Users\Zakaria\Development&gt;droidgap gen TestingC:\Users\Zakaria\Development\Testing&gt;droidgap createC:\Users\Zakaria\Development\Testing&gt;ruby C:\Users\Zakaria\Development\phonegap-android\bin\droidgap create'/*' is not recognized as an internal or external command, operable program or batch file. 'Licensed' is not recognized as an internal or external command, operable program or batch file. 'contributor' is not recognized as an internal or external command, operable program or batch file. 'this' is not recognized as an internal or external command, operable program or batch file. 'The' is not recognized as an internal or external command, operable program or batch file. 'grep' is not recognized as an internal or external command, operable program or batch file. C:/Users/Zakaria/Development/phonegap-android/lib/classic.rb:52:in `create_android': undefined method `match' for nil:NilClass (NoMethodError)        from C:/Users/Zakaria/Development/phonegap-android/lib/classic.rb:13:in `build'        from C:/Users/Zakaria/Development/phonegap-android/lib/create.rb:9:in `initialize'        from C:/Users/Zakaria/Development/phonegap-android/bin/droidgap:24:in `new'        from C:/Users/Zakaria/Development/phonegap-android/bin/droidgap:24:in `&lt;main&gt;'</code></pre><p>While the ""droidgap"" content is (here is where i can't replace ant bu ant.bat):</p><pre><code>#!/usr/bin/env rubyROOT = File.expand_path(File.dirname(__FILE__).gsub('bin',''))require 'fileutils'require File.join(ROOT, ""lib"", ""generate.rb"")require File.join(ROOT, ""lib"", ""classic.rb"")require File.join(ROOT, ""lib"", ""create.rb"")require File.join(ROOT, ""lib"", ""run.rb"")require File.join(ROOT, ""lib"", ""update.rb"")require File.join(ROOT, ""lib"", ""test.rb"")# ---------------------------------------------------------- ##                                                            ##                   command line interface                   ##                                                            ## ---------------------------------------------------------- ## droidgap gen [app name]Generate.new(ARGV[1]) if ARGV.first == 'gen'# droidgap classic (for windows users mostly)Classic.new(ARGV[1..-1]) if ARGV.first == 'classic'# droidgap create [path to phonegap project]Create.new(ARGV[1]) if ARGV.first == 'create'# droidgap run [optional directory]Run.new if ARGV.first == 'run'# droidgap update [params]Update.new if ARGV.first == 'update'# droidgap logif ARGV.first == 'log'  $stdout.sync = true  IO.popen('adb logcat') do |f|    until f.eof?      puts f.gets    end  endend# droidgap testTest.new if ARGV.first == 'test'# TODO implement these!puts ""droidgap ship not implemented"" if ARGV.first == 'ship'if ARGV.first.nil? || ARGV.first == 'help'  help = &lt;&lt;-EOF  DroidGap: PhoneGap/Android Dev Script  -------------------------------------  Useful utilities for devlopers building mobile apps using PhoneGap for Android.  Usage:  droidgap &lt;command&gt; &lt;parameters&gt;  Commands:  help ...... See this message. Type help [command name] to see specific help topics.  gen ....... Generate an example PhoneGap application to current directory.  create .... Creates an Android compatible project from a www folder. Careful, this clobbers previous packaging.  classic ... Backwards support for droidgap script. Run ""droidgap help classic"" for more info.  run ....... Installs a valid PhoneGap Project to first device found.  log ....... Attach a logger that listens for console.log statements.  update .... Copy a fresh phonegap.jar and phonegap.js into a valid PhoneGap/Android project.  test ...... Gets edge copy of mobile-spec and runs in first device or emulator attached.  ship ...... Build and sign an APK suitable for submission to an Android Marketplace.  Quickstart:  $ droidgap gen example   $ cd example  $ droidgap create  $ cd ../example_android  $ droidgap run   Now you can launch your app and optionally start a logger with:  $ droidgap log  EOF  gen = &lt;&lt;-EOF  DroidGap Generate  -----------------  Generate an example PhoneGap application to path supplied or current working directory if none is supplied.  Usage:    droidgap gen [path]  EOF  run = &lt;&lt;-EOF  DroidGap Run  ------------  Launches PhoneGap project to first device found and attaches a logger that listens for console.log statements.  Usage:    droidgap run &lt;path&gt;  EOF  ship = &lt;&lt;-EOF  DroidGap Ship  -------------  Build and sign an APK suitable for submission to an Android Marketplace.  Usage:    droidgap ship &lt;path&gt;  EOF  log = &lt;&lt;-EOF  DroidGap Log  -------------  Launches LogCat  Usage:    droidgap log  EOF  create = &lt;&lt;-EOF  DroidGap Create  ----------------  Creates an Android compatable project from a PhoneGap project. For example, if you have MyProject with index.html this command will create MyProject-android.  Usage:    droidgap create &lt;path&gt;  EOF  update = &lt;&lt;-EOF  DroidGap Update  ~~~~~~~~~~~~~~~  Builds the JS and PhoneGap Android jar file and copies them to your project.  EOF  classic = &lt;&lt;-EOF  DroidGap Classic  ~~~~~~~~~~~~-~~~  Compatability for older droidgap scripts.   Usage:  droidgap classic [android_sdk_path] [name] [package_name] [www] [path]  android_sdk_path ... The path to your Android SDK install.  name ............... The name of your application.  package_name ....... The name of your package (For example: com.nitobi.demo)  www ................ The path to your www folder. (Wherein your HTML, CSS and JS app is.)  path ............... The path to generate the application.  EOF  puts ARGV[1].nil? ? help : eval(ARGV[1])end</code></pre><p>Did anyone tried to run the new phonegap version on windows?</p><p>Thank you,</p><p>Regards</p>","231116","","231116","","2010-09-08 11:22:39","2010-09-11 20:17:53","Can't run the new PhoneGap version on Windows 7","<android><configuration><phonegap>","2","0","","",""
"3666737","1","","","2010-09-08 10:25:10","0","183","<p>is it ok to create a class which extends a service within a class that extends an activity</p><p>public class fill extends Activity {</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    setContentView(R.layout.seconds);               ....................}public class MyCount extends Servcie{       .................................        ..................................       .................................    }</code></pre><p>}</p>","434885","","","","","2010-09-08 10:30:14","android activity and service","<android>","1","0","","",""
"3666771","1","3666849","","2010-09-08 10:29:49","32","31330","<p>How do I create a home-screen replacement application? Is there any information about the home-screen application available?</p><p>Can any application be a home-screen by just registering it with a <code>CATEGORY_HOME</code> intent? </p>","165106","","418183","","2011-12-12 11:17:01","2013-12-12 15:16:19","How can I create a custom home-screen replacement application for Android?","<android><launcher><homescreen>","2","0","22","",""
"3666797","1","","","2010-09-08 10:33:16","4","1902","<p>I want to disable some items in <code>ListView</code> which is in the <code>AlertDialog</code>.</p><p>How may I do it?</p>","389204","","119895","","2010-09-08 11:21:03","2010-09-08 11:21:03","How to disable some items in listview which is in the Alert Dialog","<android><alertdialog>","1","0","","",""
"3666910","1","3700281","","2010-09-08 10:47:55","2","756","<p>How to showActivity which will display route between two points.</p><p>This will start installed map application on android phone.</p>","157937","","","","","2010-09-13 12:17:39","Display route between two points in installed application","<android><google-maps><maps>","1","0","2","",""
"3666940","1","3666984","","2010-09-08 10:52:09","1","805","<p>I want my Android Screen (320*480) to be split into two 2 screens each of resolution 320*240 which should mimic the ""split Screen"" feature of MS Word .How can this be achieved Any sample code or any suggestions .I will be waiting for reply.</p><p>Thanks In Advance.</p>","429501","","","","","2010-09-08 11:12:47","How to mimic Split Screen feature of MSWord for Android Screen.?","<android>","1","0","2","",""
"3667022","1","","","2010-09-08 11:04:47","65","34736","<p>Is there any way in android to know if your application is running in background ? By background, I mean none of the applications activities are currently visible to the user ?Any help will be appreciated!!</p>","248132","","648313","","2011-07-14 10:55:24","2014-03-04 09:12:57","Android: Is application running in background?","<android><background>","14","2","66","",""
"3667029","1","3667382","","2010-09-08 11:06:02","1","2266","<p>i want to show a Toast in an Activity when a missed call happened. How can i do it?</p><p>Thanks in advance. </p>","307585","","328193","","2010-09-08 11:08:08","2010-09-08 11:48:51","Show Toast on Missed Call in android application","<android><toast>","2","0","","",""
"3667062","1","","","2010-09-08 11:10:09","0","1945","<p>In the emulator on touching my button I want its image to be changed. I just want to bring my mouse pointer there, without click. This can be observed for thr keys of the emulator. On touch a blue image appears on the keys.</p>","403241","","119895","","2010-09-08 11:16:25","2010-09-08 11:20:26","How to change the image of my button on pointing my mouse over it?","<android><touch>","2","0","","",""
"3667304","1","3667696","","2010-09-08 11:39:08","4","469","<p>I have created a SQLite database on my PC. I have imported it into my <strong><em>assets</em></strong> folder in the project directory. How do I access it from my Android application?</p>","421372","","","","","2010-09-08 12:26:36","Packaging SQLite DB with my application","<sql><android><sqlite>","1","2","3","",""
"3667309","1","3668834","","2010-09-08 11:39:49","6","555","<p>Does anyone know of some alternative JVM language, however obscure it might be, which can compile to plain old java bytecode, without the need of a language runtime.</p><p>I need this in order to try to develop android applications without startup or size penalty. Scala, Clojure and Groovy all require its own runtime library distributed with the application, so they are out of the scope of this question.</p><p>The only one language which claims to satisfy this goal is Charles Nutter's <a href=""http://www.mirah.org"">Mirah</a>, but I couldn't make it to work on windows.</p><p>EDIT: To clarify a bit, I know any language has to have runtime library. Obviously, what I am looking for is a language that has no additional runtime required besides JRE, or at least very limited one.</p>","31141","","31141","","2010-09-08 14:02:40","2013-03-12 19:41:40","JVM based language without language runtime","<android><jvm><runtime><mirah>","2","3","2","",""
"3667316","1","","","2010-09-08 11:41:02","0","504","<p>Hi friends       I have the textview button in one activity and i want to add tabbar in the same  activity in below can anybody give example</p><p>Thanks</p>","426344","","","","","2011-05-17 08:38:29","How to add tabbar in view in android","<android>","1","0","","",""
"3667335","1","3667866","","2010-09-08 11:43:24","0","572","<p>I have read this question:<a href=""http://stackoverflow.com/questions/2154438/how-to-implement-remember-me-function-in-login-of-android-activity"">http://stackoverflow.com/questions/2154438/how-to-implement-remember-me-function-in-login-of-android-activity</a> ,</p><p>I am developing <strong>""Login""</strong> Activity for the first-time,Where i am also having:</p><ol><li>two EditText: Username, Password</li><li>One checkbpx: <strong>Remember me</strong></li><li>one Button: Login</li></ol><p>If user click on Login Button then Username, Password should be shared among all activity, i know this can be implemented using SharedPreference.</p><p>But On ""Remember me"" checkbox, if user check it once then next-time ""Login"" Activity should not be appeared, directly 2nd activity should appear, so for that what i should do?</p>","379693","","21234","","2011-02-04 08:29:55","2014-02-10 12:29:39","Android - Confusion Regarding ""Remember me"" functionality","<android><preferences>","2","2","1","",""
"3667391","1","3669798","","2010-09-08 11:49:56","3","907","<p>I want to draw a chart and I'm using a scrollview to do so. my scrollview holds the chart view. What I've observed is that the scrollview's onDraw calls the onDraw of my chart view. Now I draw the entire chart on the canvas when the onDraw of chart view is called. Also scrollview's onDraw is called everytime I scroll the view. So I end up drawing the entire chart multiple times. Is there any better way to achieve what this</p>","266272","","","","","2012-04-22 08:01:51","Chart using scrollview in Android","<android>","1","0","","",""
"3667625","1","3668657","","2010-09-08 12:17:39","0","118","<p>I signed for up this quite a few weeks back now but as of yet haven't heard anything. </p><p>Has anyone been granted access yet? <a href=""http://appinventor.googlelabs.com/about/"" rel=""nofollow"">Found here</a></p>","11802","","31899","","2010-11-02 17:54:12","2010-11-06 12:50:40","Has anyone gotten access to App Inventor for Android yet","<android><app-inventor>","2","2","","",""
"3667723","1","3667791","","2010-09-08 12:30:21","0","199","<p>in my application i want to create a shortcut (a button), to another application but i want the user to be able to select which application he wants...So how do i access a list of all the installed applications and how do i create an intent to start any one of those applications ?</p>","434885","","","","","2011-10-10 21:54:39","android applications","<android>","1","0","0","",""
"3667782","1","3669997","","2010-09-08 12:37:20","1","2689","<p>I have a downloaded MP3 that I can verify as MP3 by adb pull to my mac or pc and play in its respective media player.  However, the error from Android implies that it does not support the format.  I think it may be related to the directory location where I am storing the file, but that does not make sense (/data/data/com.myapp/files/file_audio.mp3).  This is the code inside an AsyncTask:</p><pre><code>    protected String doInBackground(String... params) {        String filename = params[0];        try {            StringBuilder filenameMp3 = new StringBuilder().append(context.getFilesDir());            filenameMp3.append(""/"").append(filename);            Uri uriMp3 = Uri.parse(filenameMp3.toString());            Log.d(TAG, ""Listen to this ringtone! ["" + uriMp3.toString() + ""]"");            MediaPlayer mp = MediaPlayer.create(context, uriMp3);            mp.prepare();            mp.start();        } catch (IllegalStateException e) {            Log.e(TAG, e.toString());            e.printStackTrace();        } catch (IOException e) {            Log.e(TAG, e.toString());            e.printStackTrace();        }        return null;    }</code></pre><p>Here is the log:</p><pre><code>09-07 23:16:09.617 E/MediaPlayerService( 1128): The Default Player is PV_PLAYER***********************09-07 23:16:09.617 V/PVPlayer( 1128): PVPlayer constructor09-07 23:16:09.617 V/PVPlayer( 1128): construct PlayerDriver09-07 23:16:09.617 V/PlayerDriver( 1128): constructor09-07 23:16:09.627 V/PlayerDriver( 1128): OpenCore hardware module loaded09-07 23:16:09.627 V/PlayerDriver( 1128): start player thread09-07 23:16:09.627 V/PlayerDriver( 1128): startPlayerThread09-07 23:16:09.627 V/PlayerDriver( 1128): InitializeForThread09-07 23:16:09.627 V/PlayerDriver( 1128): OMX_MasterInit09-07 23:16:09.647 V/PlayerDriver( 1128): OsclScheduler::Init09-07 23:16:09.647 V/PlayerDriver( 1128): CreatePlayer09-07 23:16:09.657 V/PlayerDriver( 1128): AddToScheduler09-07 23:16:09.657 V/PlayerDriver( 1128): PendForExec09-07 23:16:09.657 V/PlayerDriver( 1128): OsclActiveScheduler::Current09-07 23:16:09.657 V/PlayerDriver( 1128): StartScheduler09-07 23:16:09.657 V/PVPlayer( 1128): send PLAYER_SETUP09-07 23:16:09.667 V/PlayerDriver( 1128): Send player code: 209-07 23:16:09.667 V/PlayerDriver( 1128): CommandCompleted09-07 23:16:09.667 V/PlayerDriver( 1128): Completed command PLAYER_SETUP status=PVMFSuccess09-07 23:16:09.667 V/PVPlayer( 1128): setDataSource(/data/data/com.myapp/files/audio.mp3)09-07 23:16:09.667 V/PVPlayer( 1128): prepareAsync09-07 23:16:09.667 V/PVPlayer( 1128):   data source = /data/data/com.myapp/files/audio.mp309-07 23:16:09.667 V/PlayerDriver( 1128): Send player code: 309-07 23:16:09.667 V/PlayerDriver( 1128): handleSetDataSource09-07 23:16:09.667 V/PlayerDriver( 1128): handleSetDataSource- scanning for extension09-07 23:16:09.667 V/PlayerDriver( 1128): HandleInformationalEvent: PVMFInfoErrorHandlingStart09-07 23:16:09.667 V/PlayerDriver( 1128): HandleInformationalEvent: type=26 UNHANDLED09-07 23:16:09.667 W/MediaPlayer(14630): info/warning (1, 26)09-07 23:16:09.667 I/MediaPlayer(14630): Info (1,26)09-07 23:16:09.667 V/PlayerDriver( 1128): CommandCompleted09-07 23:16:09.667 V/PlayerDriver( 1128): Completed command PLAYER_SET_DATA_SOURCE status=PVMFErrNotSupported09-07 23:16:09.667 E/PlayerDriver( 1128): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported09-07 23:16:09.667 E/MediaPlayer(14630): error (1, -4)09-07 23:16:09.677 V/PVPlayer( 1128): run_init s=-2147483648, cancelled=009-07 23:16:09.677 V/PlayerDriver( 1128): HandleInformationalEvent: PVMFInfoErrorHandlingComplete09-07 23:16:09.677 W/PlayerDriver( 1128): PVMFInfoErrorHandlingComplete</code></pre><p>Any clues?</p>","157804","","","","","2010-09-08 16:44:31","Android media player fails MP3 with PVMFErrNotSupported?","<android><mp3><media-player>","3","0","","",""
"3667810","1","3677725","","2010-09-08 12:41:29","10","6875","<p>This seems like it should be simple, but I can't figure out a way to do it. I'm needing a tab to have beginning text, but then have that text change after the user selects an item from a list. I know how to change tab backgrounds and colors via</p><pre><code>mTabHost.getChildAt(index).setBackgroundColor();</code></pre><p>but there isn't an option to change the tab's indicator. I've tried using an EditText.</p><pre><code>private EditText tabName;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.statistics);    comm = new Communicator();    tabName = new EditText(this);    tabName.setText(""BeginningText"");    mTabHost = getTabHost();    mTabHost.addTab(mTabHost                   .newTabSpec(""tab_1_stat"")                   .setIndicator(User)                   .setContent(R.id.meStatsTab));    mTabHost.addTab(mTabHost                   .newTabSpec(""tab_2_stat"")                   .setIndicator(tabName.getText())                   .setContent(R.id.themStatsTab));    mTabHost.addTab(mTabHost                   .newTabSpec(""tab_3_stat"")                   .setIndicator(""Archive"")                   .setContent(R.id.archiveStatsTab));    mTabHost.setOnTabChangedListener(this);    getTabWidget().getChildAt(1).setOnClickListener(new onThemTabClicked());    mTabHost.setCurrentTab(0);    onTabChanged(""tab_1_stat"");</code></pre><p>}</p><p>.....</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent intent) {    super.onActivityResult(requestCode, resultCode, intent);    tabName.setText(""ChangedTabText"");    Bundle extras = intent.getExtras();    themStats = extras.getStringArray(""themStats"");    mTabHost.setCurrentTab(1);    onTabChanged(""tab_2_stat"");}</code></pre><p>That didn't work either, along with a few other attempts. Any ideas? Thanks ahead of time!</p>","442414","","","","","2013-08-18 02:26:02","How to change android tab text on the fly?","<android><tabs><android-widget>","4","0","1","",""
"3668015","1","","","2010-09-08 13:05:46","1","1253","<p>I have a single screen with a bank of buttons below a ListView. Entries on the ListView light up in orange when I scroll so I assume that are selected. When I then press the ""Delete"" button I want the onClickListener to remove the currently selected entry. But getSelectedItemPosition() always gives me -1. If I can't hope to use the GUI controls in this way, please give me another way of getting the same result.</p><p>I have even tried setting the onClickListener of the List View to store the index before the button is pressed (in case pressing the button unselects the entry) but even that is always -1 it seems. </p><p>Here's the code (without the modification which didn't work)</p><pre><code>package com.bayley;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;import java.util.ArrayList;/** * * @author p0074564 */public class September extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) {  super.onCreate(icicle);  setContentView(R.layout.main);  final ListView myListView = (ListView) findViewById(R.id.myListView);  Button addButton = (Button) findViewById(R.id.AddButton);  Button deleteButton = (Button) findViewById(R.id.DeleteButton);  final EditText editText = (EditText) findViewById(R.id.myEditText);  final ArrayList&lt;String&gt; todoItems = new ArrayList&lt;String&gt;();  todoItems.add(""Monday"");  todoItems.add(""Tuesday"");  todoItems.add(""Wednesday"");  final ArrayAdapter&lt;String&gt; aa =   new ArrayAdapter&lt;String&gt;(this,     android.R.layout.simple_list_item_1, todoItems);  myListView.setAdapter(aa);  addButton.setOnClickListener(new     Button.OnClickListener() {   public void onClick(View v) {    todoItems.add(editText.getText().toString());    aa.notifyDataSetChanged();   }  });  deleteButton.setOnClickListener(new     Button.OnClickListener() {   public void onClick(View v) {    // always returns -1 unfortunately ie nothing is ever selected    int index = myListView.getSelectedItemPosition();    if (index &gt;= 0) {     todoItems.remove(index);    }    aa.notifyDataSetChanged();   }  }); }}</code></pre>","442422","","51382","","2010-09-08 13:08:34","2011-01-24 13:26:23","How can a button click method find out which item is selected in a ListView?","<java><android><listview>","2","3","1","",""
"3668463","1","3669361","","2010-09-08 14:00:17","0","103","<p>I need to learn about making my own services and how to use these services.</p><p>Can anyone point me to a tutorial or anything which I can use? (I've already seen the <a href=""http://developer.android.com"" rel=""nofollow"">developer.android.com</a> site, but I am looking for something else...)</p>","434885","","180100","","2012-11-17 14:49:58","2012-11-17 14:49:58","android services","<android><service>","1","0","","2013-01-16 14:45:16",""
"3668467","1","","","2010-09-08 14:01:09","0","363","<p>I have pushed one Activity to make few changes. Now I want to pass all the changes to the previous(below) Activity. I dont want to create Activity again;and intead i want to access the previous activity.</p><p>thanks...</p>","406631","","","","","2010-09-08 14:05:03","Access Activity below in the stack","<android>","1","0","","",""
"3668528","1","3671376","","2010-09-08 14:05:59","1","351","<p>I am working on an Android app. It has corresponding spec/test application. As part of some of my tests, I need to pick up an image from my assets folder and calculate SHA-1 for it. I can calculate SHA, as long as I can pick the image. Since the tests run on emulator; I am not sure how to pick the image in my test.</p><p>Does anyone have any idea, how I can go about it. With and without AssetManager maybe? Any ideas will be helpful.</p><p>Cheers-Priyank </p>","57847","","","","","2010-09-08 19:52:42","Access image in my Android Tests","<android><unit-testing><file-listing>","1","0","","",""
"3668606","1","","","2010-09-08 14:13:16","1","542","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3369224/how-to-know-which-wifi-hotspot-is-public-or-secured-using-android-programmatica"">How to know which wifi hotspot is public or Secured using Android ,programmatically?</a>  </p></blockquote><p>Is there anyone knows how to programmatically check on Android if the current wifi connection is made to a WPA secured AP, or a weaker WEP secured AP, or a unsecure open AP?</p><p>Thanks!</p>","442510","","","","","2012-05-07 16:27:22","check wifi connection type on android","<android><security><wifi>","0","0","1","2012-05-07 16:42:08",""
"3668692","1","3758480","","2010-09-08 14:22:49","0","853","<p>I've been trying to upload an APK file to the Android Market for a few days, and the upload process hangs with the spinning icon just rotating.  I've let the upload run overnight and it still hangs.</p><p>1)  The APK file is 28 MB</p><p>2)  I've uploaded an APK file to the Android market before and it is now for sale.</p><p>Is there a way to find out what the error is?</p>","148635","","148635","","2010-09-08 14:42:12","2010-09-21 08:22:35","Android Market Upload APK file hangs","<android>","2","0","","",""
"3668713","1","3668778","","2010-09-08 14:24:45","4","599","<p>My application requires users to hold down the trackball in order to access an advanced menu.  Not all phones have a trackball, however, so I need to remove this requirement for such phones.  Is there a way to detect if the phone has a trackball?</p>","411500","","","","","2010-09-08 14:31:19","Is it possible to detect if an Android phone has a trackball?","<android><trackball>","1","0","1","",""
"3668870","1","4852904","","2010-09-08 14:40:35","0","152","<p>I want to add a new menu or context menu item to existing applications like the Phone and Contacts.</p><p>For example, in the contact list, select a contact then you see ""Send picture to this person"" in the menu. Or from the phone app, while talking to someone, you see a button that says ""Mark this call for follow-up"" or anything like this.</p><p>I've looked at the source code but couldn't figure out how to do it.</p><p>Any suggestion would be helpful. Thanks a lot!</p><p>Emmanuel</p>","442512","","","","","2011-01-31 15:53:54","Android: How do I customize phone apps menus?","<android><menu><contextmenu><phone>","1","0","1","",""
"3668925","1","3669142","","2010-09-08 14:45:22","1","635","<p>First off I'm really new to android (&lt; 4 days).  </p><p>I'm trying to wrap my head around how database data is linked to Views and widgets.</p><p>I've done a few tutorials and I've noticed that Adapters are used to link AdapterViews which are (as I understand it) Views which contain a bunch of identical subviews (eg lists, gallery, etc).  So the Adapter is responsible for creating those subviews and populating the data for each one (correct me if I'm wrong).</p><p>Now let's say I have a list view which lists Hotels for example.  Each row in the list has the Hotel's name and a basic rating (eg 5 star).  Now when you tap on a hotel in the list a new activity shows up showing the details of that particular hotel.  All the data is in a database.  I understand that you have an adapter manage the data&lt;->view link for the list, but what's the best way to then manage data for the hotel details view (which is not a list but just a couple of text views and an image for example)?  </p><p>Is it best to just pass the ID in the intent and then have the details activity fetch the data from the DB on its own (in this case do I store the query in the details activity?)?  Or do you get all the fields you need and put those in the intent directly?  Do you need an adapter for a view which doesn't actually generate lots of similar subviews?</p><p>I guess a summary of my question is what do you use instead of an adapter when you're not dealing with adapterviews but just simple straightforward single views.</p><p>Thanks for any help you can provide.</p>","316891","","","","","2014-01-12 06:39:20","Android Beginner: Adapter for simple view or direct DB query?","<android><database><cursor><adapter>","2","1","1","",""
"3668936","1","","","2010-09-08 14:47:13","-3","2645","<p>I am using VideoView component for <strong>streaming video in Android</strong> , but I am not getting the <strong>full screen</strong> display.</p><p>Kindly provide the code to display full screen in portrait/landscape mode.</p><p>Warm Regards,</p><p>Chiranjib Banerjee</p>","411780","","","","","2010-09-08 15:59:12","Full screen display in portrait/landscape mode in Android","<android>","2","0","0","",""
"3668958","1","","","2010-09-08 14:49:07","35","35134","<p>In the string.xml file I use the following tag </p><pre><code>&lt;color name=""mycolor1""&gt;#F5DC49&lt;/color&gt;</code></pre><p>If I use </p><pre><code> textview1.setTextColor(Color.CYAN);</code></pre><p>it works, but</p><pre><code> textview1.setTextColor(R.color.mycolor1);</code></pre><p>is not working.</p><p>How can I use the color defined in the XML file?</p>","423037","","2390083","","2013-11-04 18:24:06","2013-11-04 18:24:52","How to set the color of a TextView in Android?","<android>","2","0","3","",""
"3668978","1","3669229","","2010-09-08 14:51:27","13","25472","<p>Did google provide some special things or how do you add Adv. in your apps?</p>","415254","","18071","","2010-09-09 21:16:56","2014-02-24 23:04:00","How do I add Advertising in my Android Apps?","<android><advertising>","4","0","4","",""
"3669062","1","3669227","","2010-09-08 14:59:24","3","1662","<p>I have a custom Android view which overrides onTouchEvent(MotionEvent) to handle horizontal scrolling of content within the view. However, when the ScrollView in which this is contained scrolls vertically, the custom view stops receiving touch events. Ideally what I want is for the custom view to continue receiving events so it can handle its own horizontal scrolling, while the containing view hierarchy deals with vertical scrolling.</p><p>Is there any way to continue receiving those motion events on scroll? If not, is there any other way to get the touch events I need?</p>","39368","","","","","2012-07-18 00:34:34","Android View stops receiving touch events when parent scrolls","<android><scrolling>","2","1","","",""
"3669076","1","3760867","","2010-09-08 15:00:38","2","247","<p>Im testing a software on HTC desire phone. There is a special button on the right of the menu button. Its a circle. Its used to navigate and you can also press it.</p><p>I would like to detect when someone press it over a row of my listview.</p><p>I did put a convertView.setOnKeyListener((OnKeyListener)... but its doesnt work. Any ideas ?</p>","429222","","","","","2010-09-21 13:39:49","android : how to detect the navigation button pression on HTC?","<android><navigation><htc>","1","3","","",""
"3669239","1","","","2010-09-08 15:18:45","1","10373","<p>how to drag an image by touching in android?Please Help me with a sample code.</p>","655814","","","","","2012-10-30 08:42:47","how to drag an image by touching in android?","<android>","3","2","4","2013-05-16 07:55:01",""
"3669325","1","5092426","","2010-09-08 15:27:44","72","73394","<p>I'm trying to use in my <code>Android Application</code> the <code>notifyDataSetChanged()</code> method for an <code>ArrayAdapter</code> but it doesn't work for me. </p><p>I found <a href=""http://stackoverflow.com/questions/2345875/android-notifydatasetchanged"">as answer here</a>, that <code>notifyDataSetChanged()</code> should run in the main thread, but there was no example for that.</p><p>Could anybody send an example or at least a link?!</p>","408780","","1029088","","2013-02-13 05:36:41","2013-11-08 09:10:46","notifyDataSetChanged example","<android><android-arrayadapter><notifydatasetchanged>","4","1","39","",""
"3669377","1","3669499","","2010-09-08 15:33:40","4","6534","<p>How do I find my application's market URL on the Android Market/Google Play?</p>","434885","","8117","","2013-03-11 14:39:26","2013-03-11 14:39:26","Android Market/Google Play URL","<android><google-play>","5","0","1","",""
"3669378","1","3669453","","2010-09-08 15:33:45","0","569","<p>I am  new to android development and am currently working my way through the ""Hello..."" Tutorials on the <a href=""http://developer.android.com/resources/tutorials/views/index.html"" rel=""nofollow"">developer website</a>.</p><p>I got stuck on the Tab Layout walkthrough and the only way I could resolve it was to put each Activity Class in a separate .java file.</p><p>I was wondering if all Activities need to be in separate .java files, or am I missing something.</p>","174464","","","","","2011-12-21 21:51:06","(in Android) Do Activity classes need to be in a separate .java file?","<java><android><activity><tabs>","1","0","","",""
"3669380","1","","","2010-09-08 15:33:55","1","770","<p>I switched from a Mac to my PC because Eclipse on a Mac was killing me. Windows definitely is much better, but eclipse hangs for 5-6 seconds everytime I try to make it autocomplete my syntax. Say when I hit imgView. and wait for it to pull up an image view properties, it just hangs for 5 seconds and then pulls them up.</p><p>Is there any way I can fix this?</p><p>Thanks, <br />Teja.</p>","116858","","","","","2010-12-02 15:24:51","Android development on Eclipse + Win XP - Autocomplete syntax hangs","<android><eclipse><windows-xp>","2","4","1","",""
"3669459","1","3669722","","2010-09-08 15:43:54","1","493","<p>I want to create a paint and update loop in android for game animation on a canvas but I am having trouble as I can't seem to get the threading to work appropriately. It seems to crash almost immediately. Here is what I have tried:</p><pre><code>    // Create the thread supplying it with the runnable object    Thread thread = new Thread(runnable);    // Start the thread in oncreate()    thread.start();    class runner implements Runnable {    // This method is called when the thread runs    long wait = 1000;    public void run() {    update();    }    public void update()    {        try{          Thread.currentThread();            //do what you want to do before sleeping          Thread.sleep(wait);//sleep for 1000 ms          //do what you want to do after sleeping        }        catch(InterruptedException ie){        //If this thread was interrupted by another thread         }        run();    }}</code></pre><p>Also when I drop the wait down lower it crashes faster.</p><p>Is there a more appropriate way to approach this?</p><p>Changed to this:</p><pre><code>class runner implements Runnable {// This method is called when the thread runslong wait = 10;boolean blocked = false;public void run() {    if(!blocked){        blocked = true;        paint();    }}public void paint(){    update();}public void update(){    try{      Thread.currentThread();        //do what you want to do before sleeping      Thread.sleep(wait);//sleep for 1000 ms      //do what you want to do after sleeping    }    catch(InterruptedException ie){    //If this thread was interrupted by another thread     }    paint();}</code></pre><p>}</p><p>This results in the same error... :/</p>","431204","","431204","","2010-09-08 16:25:05","2010-09-08 16:25:05","How to implement a paint-update loop?","<android>","2","5","","",""
"3669549","1","","","2010-09-08 15:52:06","1","124","<p>Is there more efficient way of animating changing graphics without completely destroying and recreating ( within onDraw() ) the graphics every refresh?</p><p>Suppose I want to just add to my graphics.  Not completely redraw it every time.</p><p>Does anyone dynamically create new Views or SurfaceViews?  Each layered on top of each other?  So that we only need change the part of the picture, within the View/SurfaceView that needs changing (leaving the others alone).  When is the overhead of doing this, less than the overhead of executing the same drawing statements every single time?  </p><p>I noticed that SurfaceView seems to maintain two frame buffers, which it swaps every time surfaceCreated().  But as the implementation isn't documented  I don't expect we can utilise this?</p>","433579","","","","","2011-12-11 12:32:14","Best approach to do android graphics without completely redrawing?","<android>","0","0","2","",""
"3669816","1","3670053","","2010-09-08 16:22:26","3","1440","<p>Why is the use of static final variables encouraged to declare constants over just final variables? The use of static sounds logical when there will be many instances of a class but is this argument correct when used for a Android activity. In fact, since the Class instance will be around even after the activity finishes and is eventually garbage collected, it seems like all these constants will still be in memory until the class loader is around.</p><p>Also, does the compiler inline non-static final variables(ints and String) just like it does for static final variables?</p>","301784","","","","","2010-09-08 17:42:11","Use of static finals in Android Activity","<android><memory><static><activity><final>","2","0","1","",""
"3669899","1","","","2010-09-08 16:33:31","1","853","<p>Okay so with my code below for adding custom look to my tabs (works great), yet I am getting a border (padding or some sort of crop I assume) around my drawable image.  How and where do I remedy this?</p><p>Activity:</p><pre><code> TabHost mTabHost = getTabHost(); Drawable mySelector = getResources().getDrawable(R.drawable.tabselector); mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"").setIndicator(""TAB 1"" , mySelector).setContent(R.id.textview1));</code></pre><p>partial tabselecter XML:</p><pre><code>&lt;selector    android:id=""@+id/myselector""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;!-- Non focused states --&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""false""        android:state_pressed=""false""        android:drawable=""@drawable/darklogo""/&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""true""        android:state_pressed=""false""        android:drawable=""@drawable/lightlogo"" /&gt;</code></pre><p>Main XML:</p><pre><code>&lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_alignParentBottom=""true""            android:padding=""0px""            android:layout_marginBottom =""-4px""            android:clipToPadding=""false"" /&gt;</code></pre><p>Wouldnt let me post a screenshot...</p>","430060","","234039","","2010-09-08 17:27:01","2010-09-08 18:07:17","Android: When adding a drawable tabselector I am getting an unwanted apx. 5px padding on my tabs","<java><android><tabwidget>","1","3","","",""
"3670001","1","","","2010-09-08 16:45:23","0","913","<p>I followed all the instruction but my ad doesn't appear in my app. My app is already on the market, I configured admob and adwhirl, and it's say it's active, but I can't do it.Can somebody help me ?</p>","439058","","1037442","","2013-03-13 05:09:18","2013-03-13 05:09:18","admob for android","<android><web-applications><admob><adwhirl>","3","0","","",""
"3670176","1","","","2010-09-08 17:06:39","2","1829","<p>I am trying to port an existing iPhone application to android. I wish to have a button scroll into view at the bottom of a GridView to enable the user to load more data from the server. Presently, my solution simply fixes a button at the bottom of the screen instead of having it scroll into view. </p><p>Here is my layout code:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:orientation=""vertical""            &gt;           &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""             android:id=""@+id/grid""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:columnWidth=""70dp""            android:numColumns=""auto_fit""            android:verticalSpacing=""0dp""            android:horizontalSpacing=""0dp""            android:stretchMode=""columnWidth""            android:gravity=""center""            android:background=""#000000""        /&gt;        &lt;Button        android:id=""@+id/load_more""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        android:text=""Load More""         /&gt;    &lt;/LinearLayout&gt;</code></pre><p>Fixing the button at the bottom of the screen won't work because I plan on placing an ad at the bottom. </p><p>Can anyone either explain conceptually how to get a load more button to scroll into view, or point me to some sample code, OR tell me why this is not idiomatic to Android and what other UI convention it uses to load more data in a GridView?</p><p>Thanks!</p>","61072","","","","","2011-03-14 14:33:09","Getting a button to scroll into view at the bottom of a GridView on Android","<android><gridview>","2","1","","",""
"3670419","1","","","2010-09-08 17:34:30","0","2398","<p>i am writing two xml files for landscape and portrait and create res/layout-land folder,execute my code but did not work portrait mode,have any setting set for work my code for landscape and portrait..please give any sample code for that.</p><p>Thanks All </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.landimage.example""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".landimage""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""4"" /&gt;&lt;/manifest&gt; </code></pre>","410757","","410757","","2010-09-08 17:40:15","2011-09-09 06:02:46","how to run my code support for landscape and portrait in android","<android>","2","2","","",""
"3670438","1","3674701","","2010-09-08 17:36:38","0","603","<p>I am trying to make a custom button, having two 9patch files, one for normal state and one for status.</p><p>First I tried with a simple 9patch background and the result is fine:</p><pre><code>&lt;Button android:id=""@+id/btnTest""        android:layout_height=""80dip""         android:layout_width=""135dip""         android:text=""Test""         android:drawableTop=""@drawable/imgsomeimage""        android:background=""@drawable/main_button_background""&gt;&lt;/Button&gt;</code></pre><p>I get a button with a image and a text bellow it. Everything with the main_button_background underneath</p><p>I create a new xml file (main_menu_button.xml) with the following content</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item        android:state_focused=""false""        android:state_selected=""false""        android:state_pressed=""false""        android:drawable=""@drawable/main_button_background"" /&gt;    &lt;item        android:state_focused=""false""        android:state_selected=""true""        android:state_pressed=""false""        android:drawable=""@drawable/main_button_background"" /&gt;    &lt;!-- Focused states --&gt;    &lt;item        android:state_focused=""true""        android:state_selected=""false""        android:state_pressed=""false""        android:drawable=""@drawable/main_button_background_pressed"" /&gt;    &lt;item        android:state_focused=""true""        android:state_selected=""true""        android:state_pressed=""false""        android:drawable=""@drawable/main_button_background_pressed"" /&gt;    &lt;!-- Pressed --&gt;    &lt;item        android:state_pressed=""true""        android:drawable=""@drawable/main_button_background_pressed"" /&gt;  &lt;/selector&gt;      </code></pre><p>The button becomes:</p><pre><code>&lt;Button android:id=""@+id/btnTest""        android:layout_height=""80dip""         android:layout_width=""135dip""         android:text=""Test""         android:drawableTop=""@drawable/imgsomeimage""        android:background=""@drawable/main_menu_button""&gt;</code></pre><p></p><p>Now the text isn't displayed, only the background and the imgsomeimage.What am I doing wrong ?</p>","379865","","379865","","2010-09-08 17:40:23","2010-09-09 07:51:13","Custom button has missing text","<android><custom-controls>","1","0","","",""
"3670500","1","","","2010-09-08 17:44:17","3","4916","<p>I write following application:</p><ul><li>there is an AutoCompleteTextView field</li><li>as Adapter I'm using ArrayAdapter with ListArray</li><li>the ListArray consists of some constant string item and one item, which will be changed dynamically everytime user typed something in the field</li></ul><p>I took TextChangedListener to update this last list item. But it seems, that update occurs only once.</p><p>I add a bit code of me. May be somebody can show me, what did i do wrong.</p><pre><code>public class HelloListView extends Activity {    List&lt;String&gt; countryList = null;        AutoCompleteTextView textView = null;       ArrayAdapter adapter = null;    static String[] COUNTRIES = new String[]     {          ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa"", ""Andorra"",          ""Yemen"", ""Yugoslavia"", ""Zambia"", ""Zimbabwe"", """"    };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                countryList = Arrays.asList(COUNTRIES);        textView = (AutoCompleteTextView) findViewById(R.id.edit);        adapter = new ArrayAdapter(this, android.R.layout.simple_dropdown_item_1line, countryList);        adapter.notifyDataSetChanged();                textView.setAdapter(adapter);        textView.setThreshold(1);        textView.addTextChangedListener(new TextWatcher()         {            public void onTextChanged(CharSequence s, int start, int before, int count)             {                               countryList.set(countryList.size()-1, ""User input:"" + textView.getText());                            }            public void beforeTextChanged(CharSequence s, int start, int count,                    int after)             {                           }            public void afterTextChanged(Editable s)             {            }        });        new Thread()         {            public void run()             {                // Do a bunch of slow network stuff.                update();            }        }.start();            }    private void update()     {        runOnUiThread(new Runnable()         {            public void run()             {                adapter.notifyDataSetChanged();            }        });    }}</code></pre>","408780","","73488","","2010-09-18 11:56:27","2012-06-06 10:23:40","notifyDataSetChanged doesn't work?","<android>","2","4","","",""
"3670641","1","3671338","","2010-09-08 18:05:18","0","659","<p>I am currently trying to use the android library android fu to help me with my first proper app.</p><p>I am trying to makea test project using the droid fu library but when ever i go to test the app it force closes.</p><p>I have used an example of the asynctask and when i test the app it loads and does what its meant to but when i replace it with the betterasynctask the app force closes.</p><p>You can download the source of the test app from <a href=""http://androidapp.dino-digital.com/DroidFuTest.zip"" rel=""nofollow"">http://androidapp.dino-digital.com/DroidFuTest.zip</a></p><p>Hopefully someone can help me with this.</p><p>CheersAdam</p>","442701","","296677","","2011-11-28 14:18:01","2011-11-28 14:18:01","Force close when tying to use BetterAsyncTask in droid-fu Android","<android><android-asynctask><droid-fu>","2","4","","",""
"3670705","1","","","2010-09-08 18:15:33","1","880","<p>Hi can anyone help explain what's going on:</p><p>I've developed a simple app which uses webview, it fully works on HTC's Legend and Desire as well as the emulator in Eclipse.But from emails received, people with Droid Xs and Galaxy Ss get a 'The requested file was not found. d2.html' error message after clicking a link from the main html page.</p><p>The code i'm using is:</p><p><code>document.write('&lt;a href=""d2.html?gp=' + h1 + '&amp;hd=' + h2 + '&amp;th=' + h3 + '""&gt;link&lt;/a&gt;');</code></p><p>I've tried adding file:///android_asset/ but it gets the same results.</p><p>Any Ideas?</p>","442712","","","","","2010-09-08 18:15:33","Android webview links not working for some","<android><webview>","0","2","","",""
"3670760","1","","","2010-09-08 18:23:15","0","219","<p>I have asked the same question of their support staff, but I thought I would try here, too.  I have tried doing an HTTP Post with their sample data, and the response I get back doesn't match what it's supposed to.  Does anyone have sample code which includes the HTTP Post and conversion of the response to a byte array?</p><p>Here are the instructions from their site:<a href=""http://andappstore.com/AndroidApplications/purchase_checking.jsp"" rel=""nofollow"">http://andappstore.com/AndroidApplications/purchase_checking.jsp</a></p><p>Seems simple enough, but the byte array I get back has 39 elements when it is only supposed to have 20.  I assume the problem is on my side, but I don't really know.  I can post sample code if that helps.</p>","434574","","","","","2011-06-28 10:03:49","Problems with AndAppStore's Purchase Checking","<android><google-play>","1","0","","",""
"3670859","1","","","2010-09-08 18:35:46","1","130","<p>I've got a viewgroup class that I'm adding a checkbox to progammatically like this:</p><pre><code>checkbox = new CheckBox(getContext());        RelativeLayout.LayoutParams relativeParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);        addView(checkbox, relativeParams);</code></pre><p>When I call invalidate on the viewgroup, the checkbox is not drawn. However, if I put checkbox.draw() inside my view's onDraw() override, then I see the checkbox. But the checkbox is not functional, meaning clicking on it does not change it's state.</p><p>So there are two questions. First, I thought invalidating a view group would cause the view group to draw itself and it's children automatically. Second, why can't I press the checkbox and get a state change when I draw the checkbox explicitly?</p>","430890","","","","","2010-09-08 18:35:46","Child Views not Working as Expected","<android>","0","0","","",""
"3670955","1","","","2010-09-08 18:48:44","0","611","<p>I want to store image in sdcard using android coding,Anybody know the code for image store in sdcard using Android coding..</p><p>Thanks All</p>","410757","","","","","2010-09-08 19:40:10","how can i write code for store image in sdcard?","<android>","1","0","","",""
"3671144","1","","","2010-09-08 19:15:08","0","2368","<p>I want to add scroll bar  in gridview,How can i add scroll bar in grid view?</p>","410757","","","","","2012-11-15 10:42:53","how can i add scroll bar in grid view?","<android>","2","0","","",""
"3671212","1","7518348","","2010-09-08 19:24:02","2","1006","<p>I have a a list view that shows:</p><p>tag : 10tagb : 20</p><p>When I click on an item, I get an Alert asking to change a value (EditText)I set the value and click ok</p><ol><li>How can I refresh the listview to show the change</li><li>How can I manually change the row and put the new value there eg tagb : 122?</li></ol><p>BTW, The list of itemsand value comes from a result of a  REST call I make to a server</p><p>Hope this makes sense.</p><p>Thanks</p><p>Here is the code for the ListView:</p><p>setContentView(R.layout.listview);        list = (ListView) findViewById(R.id.list);</p><pre><code>    adapter = new ListViewAdapter(this, alarmName, deviceName, alarmDate,            alarmSev);    list.setAdapter(adapter);    adapter.notifyDataSetChanged();    list.setOnItemClickListener(new OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                long arg3) {            // TODO Auto-generated method stub            AlertDialog.Builder adb = new AlertDialog.Builder(                    AlarmsTab.this);            adb.setTitle(""Acknowledge Alarms"");            adb.setMessage(""Do you want to Acknowledge this Alarm? "" + ""\n""                    + alarmName.get(arg2));            alarmpos = alarmName.get(arg2);            adb.setPositiveButton(""Yes"",                    new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int id) {                            CloseAlarm(asset, model, alarmpos);                        }                    });            adb.setNegativeButton(""No"",                    new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int id) {                            dialog.cancel();                        }                    });            adb.show();        }    });    getAlarmsForAsset(asset);    adapter.notifyDataSetChanged();}</code></pre>","442731","","442731","","2010-09-09 05:10:37","2011-09-22 16:38:24","How do I refresh a ListView in Android - onItemClick, Alert shown with Edit Text","<android>","1","1","","",""
"3671222","1","","","2010-09-08 19:25:00","0","273","<p>I developing a system that consist of 2 units; 1 Android tablet and 1 iPhone. My users will have to identify themselfs to the Android tablet (this should be done as user-friendly as possible with as few steps as possible and in a secure manner, meaning it should not rely on gps that is not exact). I have looked at various techniques, but each and everyone of them seems to be inpossible to do:</p><p>idea #1: The iphone app has a barcode. The Android tablet scans the barcode using zxing (with the built in webcamera). This seems like the best idea but I cant get a hold of an Android tablet with a camera good enough to run zxing.</p><p>Anyone that knows of an Android tablet that can run Zxing or does anyone know of any other api that I can try (except shopsavvy).</p><p>idea 2#: Using the bump api. This doesn't seems lika a reliable method since 2 people next to eachother can bump 2 seperate Android tablets. Any input on bump?</p><p>idea 3#: Using bluetooth. Letting the Android tablet connect to the closest iphone (locating it on RSSI). The problem is that iPhone doesnt allow Bluetooth connections!?</p><p>idea 4# Using NFC. The problem is that iPhone doesnt support NFC.</p><p>idea 5# Using P2P wifi. As far as I know this seems like a challing thing to develop (finding the cloesest found etc.)</p><p>Anyone that has another take on things?</p>","439781","","","","","2010-10-06 19:15:44","Any ideas how to solve this problem?","<iphone><android><identification>","1","3","","",""
"3671303","1","3671737","","2010-09-08 19:39:27","3","8472","<p>I dont have a real Android device so I'm using emulators for all my development for now, are mailto: web links really unsupported on Android devices 2.1 and below? 2.2 works, but every time I click a <code>mailto:</code> link on 1.6 or 2.1 even, I get an [unsupported action] dialog. Anybody with a real device want to test this out?</p>","339768","","","","","2012-09-18 13:56:48","mailto: links unsupported in Android?","<android><mailto>","2","2","2","",""
"3671332","1","3671716","","2010-09-08 19:45:17","1","1649","<p>I am new to android kernel and Mobile Operating Systems and I have a few questions regarding android kernel.</p><p>1) Does Android OS has Kernel Mode and a User mode like Normal desktop OSs ? Also does it support things like Virtual Memory ? Also I heard about Dalvik VMM. Is a copy of dalvik VMM created for each and every process ?</p><p>2) Another Question is I heard android creates a separate file system for each and every process(every application). Is this true ? If so How OS maintains these file systems and where are they mounted. Does it have a hierarchy like Unix based systems ?</p><p>3) Another Question is regarding IPC in android. What are binders in android ? How does it differ from normal IPC mechanisms like pipes, msg queues etc.</p><p>4) Another Question not related to android but How does the driver address Flash based disks like Solid state drives etc. For ex: normal HDD block can be identified by cylinder, sector and a track.</p>","2605095","","","","","2010-09-08 20:48:14","Few Questions regarding Android Kernel","<c><android><linux-kernel><kernel>","3","3","1","",""
"3671357","1","","","2010-09-08 19:49:53","1","2777","<p>I'm trying to restore the background Color of a View.</p><p>I have several selectable Views. When the user clicks one of those Views, the following code is executed and the View becomes Yellow:</p><pre><code>View newSelection, previousSelection;...if(previousSelection != null) {    previousSelection.setBackgroundColor(Color.BLACK); // problem here}newSelection.setBackgroundColor(Color.YELLOW);</code></pre><p>However, I want to reset the color of the previously selected View. However, I do not know which color it was (I'm setting it to Color.BLACK in the above code). I was not able to find a getBackgroundColor or similar method in the View class. If I had it, I could save the previous color and just put it back when the new View is selected.</p>","425749","","114066","","2010-09-10 15:28:10","2011-06-24 02:24:25","Reseting the background color of a View","<android><view><background-color>","3","0","","",""
"3671424","1","","","2010-09-08 19:59:59","-1","1239","<p>I have a ListView which uses cursor adapter to show the records from database. When a new records is inserted in database ,it works great and shows that entry on top of ListView on requery. </p><p>Now I am facing problem when User scroll down the List, background thread call web service and brings old data. In this case when it does requery, old data is also getting appended on top of list which should append old data at the end of list. </p><p>What should i need to do differently, to add old data at the end of List rather than top ? do i need to change method of insertion when I am getting this old data ?</p>","442756","","","","","2011-07-11 12:33:32","Expandable ListView and cursor adapter","<android>","1","1","","",""
"3671564","1","3672018","","2010-09-08 20:18:37","0","1992","<p>I have an application that receives information from a database, and is used to visualize 2D bitmaps onto a GLSurfaceView. The information received will determine the x-position of the bitmap, and which bitmap image to use (there are 4 different bitmaps in my res folder to choose from). </p><p>Below are the three classes that are being used. The Activity sets the Shapes objects that need to be drawn by passing an ArrayList to the GLLayer class. This ArrayList is passed to the instance of ShapeStorage class via another setList method. This class is responsible for drawing when they are received.</p><p>The problem that I'm having is the following. Suppose I receive one object (let's say that it's a square at it's located at x=1). Some time goes by, and I receive another shape (this time, it's a triangle, and it's located at x=-1). However, when this new shape appears on the screen, the old bitmap's appearance changes to a triangle, and the new one becomes a square. In other words, the objects themselves are at the correct position that they are supposed to be at, but the bitmap being associated with them has changed. Does anyone know what the possible cause of this can be? I'm still a newbie to OpenGL-ES, and while this code looks very convoluted, it just involves setting a bunch of various properties for the View. Please help me, StackOverflow! You're my only hope.</p><pre><code>public class GLLayer extends GLSurfaceView implements Renderer {    int onDrawFrameCounter=1;    int[] cameraTexture;    byte[] glCameraFrame=new byte[256*256]; //size of a texture must be a power of 2    private Context context;    FloatBuffer cubeBuff;    FloatBuffer texBuff;    ShapeStorage shapes;    ArrayList&lt;Shapes&gt; shapereceptionbuffer;    public GLLayer(Context c) {        super(c);        this.context=c;        //Initiate our stars class with the number of stars        shapes = new ShapeStorage();        shapereceptionbuffer=new ArrayList&lt;Shapes&gt;();        this.setEGLConfigChooser(5, 6, 5, 8, 16, 0);        this.setRenderer(this); //set the following class as a GLSurfaceView renderer        this.getHolder().setFormat(PixelFormat.TRANSPARENT); //makes the GLSurfaceView translucent    }    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        try {                   gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);            gl.glShadeModel(GL10.GL_SMOOTH);                    //Enable Smooth Shading            gl.glEnable(GL10.GL_TEXTURE_2D);                    //Enable Texture Mapping            gl.glEnable(GL10.GL_BLEND);                         //Enable blending            gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);            //Black Background            gl.glClearDepthf(1.0f);                             //Depth Buffer Setup            gl.glDisable(GL10.GL_DEPTH_TEST);                   //Disable depth test            gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);     //Set The Blending Function For Translucency            shapes.setTextures(gl,context);        } catch (Exception e) {            // TODO Auto-generated catch block            Log.d(""Created"",e.getMessage());        }    }//end of surfacecreated        public void setList(ArrayList&lt;Shapes&gt; receivedList){        synchronized(this.shapereceptionbuffer){            shapereceptionbuffer=receivedList;        }    }    public void onSurfaceChanged(GL10 gl, int width, int height) {          try {            if(height == 0) {                       //Prevent A Divide By Zero By                height = 1;                         //Making Height Equal One            }            gl.glViewport(0, 0, width, height);//specifies transformation from normalized device coordinates to window coordinates            float ratio = (float) width / height;            gl.glMatrixMode(GL11.GL_PROJECTION); //Select The Projection Matrix            gl.glLoadIdentity();//Reset The Projection Matrix            GLU.gluPerspective(gl, 45.0f, ratio, 0.1f, 100.0f);            gl.glMatrixMode(GL11.GL_MODELVIEW);//Select The Modelview Matrix            gl.glLoadIdentity();//Reset The Modelview Matrix        } catch (Exception e) {            // TODO Auto-generated catch block            Log.d(""Changed"",e.getMessage());        }        //GLU.gluLookAt(gl, 0, 0, 4.2f, 0, 0, 0, 0, 1, 0);//eye-point location, center of the scene and an UP vector            }//end of surfacechanged    public void onDrawFrame(GL10 gl) {        try {            gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); //Clear Screen And Depth Buffer            Log.d(""Buffer Size"", String.valueOf(shapereceptionbuffer.size()));            synchronized(this.shapereceptionbuffer){                shapes.setShapes(shapereceptionbuffer);                shapes.draw(gl, this.context);            }        } catch (Exception e) {            Log.d(""Draw"",e.getMessage());        }       }//end of ondrawframe}</code></pre><p>This class is responsible for drawing each of the shapes that are received from the external database.   </p><pre><code>/** * This class contains, loads, initiates textures and draws our Shapes */public class ShapeStorage {    private ArrayList&lt;Shapes&gt; shapestoragebuffer;    private Random rand = new Random(); // Initiate Random for random values of                                        // stars    /** Our texture pointer */    private int[] textures = new int[4];    /**     * Constructor for our holder     */    public ShapeStorage() {        shapestoragebuffer = new ArrayList&lt;Shapes&gt;();    }    public void setShapes(ArrayList&lt;Shapes&gt; receivedlist) {        shapestoragebuffer = receivedList;    }    public void setupTextures(GL10 gl, Context context) {        // Get the texture from the Android resource directory        InputStream is = null;        gl.glGenTextures(4, textures, 0);        for (int i = 2; i &lt; 6; i++) {            switch (i) {            case 2:                is = context.getResources().openRawResource(R.drawable.square);                break;            case 3:                is = context.getResources().openRawResource(R.drawable.circle);                break;            case 4:                is = context.getResources().openRawResource(R.drawable.hexagon);                break;            case 5:                is = context.getResources()                        .openRawResource(R.drawable.triangle);                break;            }            Bitmap bitmap = null;            try {                // BitmapFactory is an Android graphics utility for images                bitmap = BitmapFactory.decodeStream(is);            } finally {                // Always clear and close                try {                    is.close();                    is = null;                } catch (IOException e) {                }            }            // Generate the texture pointer            // Create Linear Filtered Texture and bind it to texture            GLUtils.texImage2D(GL11.GL_TEXTURE_2D, 0, bitmap, 0);            gl.glBindTexture(GL11.GL_TEXTURE_2D, textures[i - 2]);            gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER,                    GL11.GL_LINEAR);            gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER,                    GL11.GL_LINEAR);            // Clean up            bitmap.recycle();        }    }    /**     * The drawing function.     *      * @param gl     *            - The GL Context     * @param twinkle     *            - Twinkle on or off     */    public void draw(GL10 gl, Context context) {        // Bind the icon texture for all Shapes        for (int loop = 0; loop &lt; shapestoragebuffer.size(); loop++) {            // Recover the current star into an object            Shapes shape = shapestoragebuffer.get(loop);            gl.glLoadIdentity(); // Reset The Current Modelview Matrix            // gl.glRotatef(180.0f, -1.0f, 0.0f, 0.0f);            float x = shape.get_Offset_from_center();            gl.glTranslatef(x, 0.0f, -40.0f);            // Draw            switch (victim.getType()) {            // green            case 2:                shape.draw(gl, textures[0]);                break;            // red            case 3:                shape.draw(gl, textures[1]);                break;            // yellow            case 4:                shape.draw(gl, textures[2]);                break;            case 5:                shape.draw(gl, textures[3]);                break;            }        }    }}</code></pre><p>Here is the class that defines each of the objects that are being drawn to the GLSurfaceView; each of the shapes that are being drawn.</p><pre><code>public class Shapes {    private int _Offset_from_center;    private int type;    Context c;    /** The buffer holding the vertices */    private FloatBuffer vertexBuffer;    /** The buffer holding the texture coordinates */    private FloatBuffer textureBuffer;    /** The initial vertex definition */    private float vertices[] = {                                -1.0f, -1.0f, 0.0f,     //Bottom Left                                1.0f, -1.0f, 0.0f,      //Bottom Right                                -1.0f, 1.0f, 0.0f,      //Top Left                                1.0f, 1.0f, 0.0f        //Top Right                                                    };    /** The initial texture coordinates (u, v) */       private float texture[] = {                                0.0f, 0.0f,                                 1.0f, 0.0f,                                 0.0f, 1.0f,                                 1.0f, 1.0f,                                            };    public Shapes() {        //        ByteBuffer byteBuf = ByteBuffer.allocateDirect(vertices.length * 4);        byteBuf.order(ByteOrder.nativeOrder());        vertexBuffer = byteBuf.asFloatBuffer();        vertexBuffer.put(vertices);        vertexBuffer.position(0);        //        byteBuf = ByteBuffer.allocateDirect(texture.length * 4);        byteBuf.order(ByteOrder.nativeOrder());        textureBuffer = byteBuf.asFloatBuffer();        textureBuffer.put(texture);        textureBuffer.position(0);    }    public int get_Offset_from_center() {        return _Offset_from_center;    }    public void set_Offset_from_center(int _Offset_from_center) {        this._Offset_from_center = _Offset_from_center;    }    public int getType() {        return type;    }    public void setType(int type) {        this.type = type;    }    /**     * The object own drawing function.     * Called from the renderer to redraw this instance     * with possible changes in values.     *      * @param gl - The GL Context     */    public void draw(GL10 gl,int texture) {        gl.glBindTexture(GL11.GL_TEXTURE_2D, texture);        //Enable the vertex, texture and normal state        gl.glEnableClientState(GL11.GL_VERTEX_ARRAY);        gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);        //Point to our buffers        gl.glVertexPointer(3, GL11.GL_FLOAT, 0, vertexBuffer);        gl.glTexCoordPointer(2, GL11.GL_FLOAT, 0, textureBuffer);        //Draw the vertices as triangle strip        gl.glDrawArrays(GL11.GL_TRIANGLE_STRIP, 0, vertices.length / 3);        //Disable the client state before leaving        gl.glDisableClientState(GL11.GL_VERTEX_ARRAY);        gl.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);    }} </code></pre>","155726","","155726","","2010-09-10 17:47:40","2010-09-10 17:47:40","GLSurfaceView swaps 2D bitmaps being drawn","<java><android><graphics><opengl-es>","1","0","","",""
"3671681","1","","","2010-09-08 20:38:28","1","974","<p>Say, I'm having a <code>ContentProvider</code> (which in fact do not performs database call) and I want to pass some additional data (for example, call statistics) with the cursor to the caller:</p><pre><code>public class SomeProvider extends ContentProvider {    . . .          public Cursor query(....) {        // I can not set extras for cursor here        return new MyCursorImplementation(iterationData, callStats);    }}</code></pre><p>In activity, I want to make:</p><pre><code>Cursor cursor = getContentResolver().query(...);CallStats callStats = ((MyCursorImplementation)cursor).getCallStats();</code></pre><p>But I can't make this because cursor is already wrapped in <code>ContentResolver.CursorWrapperInner</code> and <code>ClassCastException</code> is thrown.</p><p>It'd be very handy when using <code>AsyncTask</code>:</p><pre><code>protected class SomeAsyncTask extends AsyncTask&lt;Uri, Void, Cursor&gt; {     ...     @Override     protected Cursor doInBackground(Uri... uris) {         return getContentResolver().query(uris[0], ...);     }     @Override     protected void onPostExecute(Cursor cursor) {         if (cursor != null) {             // update view with cursor data, do other things using cursor             CallStats callStats = ((MyCursorImplementation)cursor).getCallStats();             // do some UI changes using call statistics             // ...but fails here         }      }}</code></pre><p>How can I pass the data with the cursor or get exactly the same cursor that I've returned from query. Or it is impossible?</p>","167262","","167262","","2010-09-08 21:02:16","2010-09-08 21:02:16","Android ContentResolver: Pass the data with cursor without requery or get the exact executed cursor when querying from activity","<android><cursor><android-contentprovider>","0","4","","",""
"3671686","1","3671879","","2010-09-08 20:39:14","0","901","<p>I am only a beginner to Android, but I have noticed a number of things that seem a little strange in the third notepad tutorial:</p><ul><li>The tutorial explicitly states that you need to call saveState from BOTH onSaveInstanceState and onPause. Is this really necessary? It seems to me from reading the process life-cycle documentation that onPause will always be called before the Activity is killed, regardless of whether it is done so by the system or the user. If this is the case, surely just calling saveState from onPause is sufficient?</li><li>Calling populateFields() in both onResume and onCreate is pointless, since onResume is always called after onCreate anyway. Hence if I understand correctly, the call in onCreate serves no useful purpose and can be safely removed.</li></ul><p>Could someone please either confirm these points, or let me know what I have misunderstood.</p><p>Olly</p>","442816","","","","","2010-09-08 21:02:22","Android Notepadv3 tutorial - Is saveState() in onSaveInstanceState really necessary?","<java><android><notepad>","1","4","","",""
"3671732","1","3701143","","2010-09-08 20:45:37","4","3419","<p>This was working fine when I first started the project.  I am referring to editing/adding to the strings.xml file.  It used to display a design and XML tab that allowed me to update it.  now its just showing up as a table.  Any ideas?  I don't understand how I could have messed this up.  I did check in another project of mine and I am getting the same results so I don't think it has anything to do with the XML.</p><p>Any ideas?  Thanks!</p>","418714","","","","","2010-09-13 14:02:27","Eclipse Android design view of res/values/strings.xml not working anymore","<android><eclipse>","1","3","1","",""
"3672022","1","","","2010-09-08 21:23:37","0","1053","<p>I'm relatively new to writing android apps and cant seem to get Linkify working with my EditText View.</p><p>I have a very simple application I'm using to try out some features, auto linking text. It's a single Activity with a single multiline EditText View. I have enabled Linkify in the main.xml (android:autoLink=""all"") so that any web, email or phone number entered in the EditText view gets linkified.</p><p>The issue I have is that after entering any text that should be linkified, i.e a web address, and then saving the text and exiting the app. When returning to the EditText I see the web address is now linkified but I cannot click on the EditText to enter more text as it will not give me a cursor anywhere but at the 1st position on the 1st line of the EditText. Then while clicking the screen trying to place a cursor at another line of text the app usually crashes.</p><p>These are the last few exceptions from the debug log:</p><blockquote>  <p>java.lang.IndexOutOfBoundsException: getChars (-1 ... 0) starts before  0  android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:949)  android.text.SpannableStringBuilder.getChars(SpannableStringBuilder.java:847)  android.text.TextUtils.getChars(TextUtils.java:69)  android.text.TextUtils.substring(TextUtils.java:255)  android.view.inputmethod.BaseInputConnection.getTextAfterCursor(BaseInputConnection.java:339)  com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:170)</p></blockquote><p>If the EditText is changed to a TextView Linkfiy works fine. The problem seems to be trying to edit text while it's linkified.</p><p>Thanks.</p>","442826","","709619","","2011-10-18 17:30:52","2011-10-18 17:30:52","EditText view with Linkify enabled (autoLink=""all"") causes force close","<android>","0","2","","",""
"3672052","1","","","2010-09-08 21:29:09","5","6930","<p>I'm trying to create a date range to cover a full month, i.e.</p><p>[startDate; endDate]</p><p>As such, I have a reference date and try to create a new date from it. I'm having problem with the ""endDate"" because I want it to be near the end of the day (i.e. 23:59:59).</p><p>The code I'm using is the following:</p><pre><code>  public static Date previousMonthLastDate(Date referenceDate) {    Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone(""UTC""));    calendar.setTime(referenceDate);    calendar.add(Calendar.MONTH, -1); // move to the previous month    int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);    calendar.set(Calendar.DAY_OF_MONTH, lastDay);    // set the time to be the end of the day    calendar.set(Calendar.HOUR_OF_DAY, 23);    calendar.set(Calendar.MINUTE, 59);    calendar.set(Calendar.SECOND, 59);    return calendar.getTime();  }</code></pre><p>This code is working as expected on the Android <strong>emulator</strong>. However, running it on a real phone gives the wrong date. As such, I'm assuming it is some kind of timezone problem.</p><p>On the phone, instead of giving say 31/August/2010, it gives 01/September/2010. This value seams to be set after the line of code that sets the HOUR_OF_DAY to 23.</p><p>Any ideas? </p><p>Thanks.</p>","425749","","","","","2012-08-07 18:20:22","Java last day of month problem","<java><android><date><calendar>","4","4","1","",""
"3672241","1","3826041","","2010-09-08 22:03:52","0","4795","<p>package com.example.helloandroid;</p><pre><code>import java.util.ArrayList;import java.util.Arrays;import android.app.TabActivity;import android.os.Bundle;import android.view.Window;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TabHost;public class HelloAndroid extends TabActivity {/** Called when the activity is first created. */private ListView mainListView ;  private ArrayAdapter&lt;String&gt; listAdapter ;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    setContentView(R.layout.main);    TabHost mTabHost = getTabHost();    mTabHost.addTab(mTabHost.newTabSpec(""tab_test1"").setIndicator(""TAB 1""));    mTabHost.addTab(mTabHost.newTabSpec(""tab_test2"").setIndicator(""TAB 2""));    mTabHost.addTab(mTabHost.newTabSpec(""tab_test3"").setIndicator(""TAB 3""));    mTabHost.setCurrentTab(0); // Find the ListView resource.       mainListView = (ListView) findViewById( R.id.lstMain);      // Create and populate a List of planet names.      String[] planets = new String[] { ""Mercury"", ""Venus"", ""Earth"", ""Mars"",                                        ""Jupiter"", ""Saturn"", ""Uranus"", ""Neptune""};        ArrayList&lt;String&gt; planetList = new ArrayList&lt;String&gt;();      planetList.addAll( Arrays.asList(planets) );      // Create ArrayAdapter using the planet list.     listAdapter = new ArrayAdapter&lt;String&gt;(this, R.layout.main, planetList);      // Set the ArrayAdapter as the ListView's adapter.      mainListView.setAdapter( listAdapter );  // End}</code></pre><p>}</p><p>and here is the code for my xml file.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;  &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TabWidget        android:id=""@android:id/tabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@android:id/tabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TextView             android:id=""@+id/textview1""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""             android:text=""this is a tab"" /&gt;        &lt;TextView             android:id=""@+id/textview2""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""             android:text=""this is another tab"" /&gt;        &lt;TextView             android:id=""@+id/textview3""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""             android:text=""this is a third tab"" /&gt;        &lt;ListView            android:id=""@+id/lstMain""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;</code></pre><p>                                </p>","442851","","442851","","2010-09-08 22:56:45","2012-01-12 23:50:01","List view under tab","<android><listview><uitabview>","1","6","","",""
"3672253","1","3672405","","2010-09-08 22:07:03","1","989","<p>I populate ListView with data from a Sqlite database using custom CursorAdapter.</p><p>When user moves away from my activity and comes back later I loose the position in my cursor and the ListView is positioned to the first item again.</p><p>When skipping startManagingCursor() it works as expected. How do I work around this?</p><p>Here is a code snippet called OnCreate():</p><pre><code>cursor  = db.getAll();      startManagingCursor(cursor);myAdapter = new MyAdapter(listview.getContext(), cursor, true);listview.setAdapter(myAdapter);</code></pre>","431502","","","","","2010-09-08 22:33:59","cursor position in a listview lost when move away from activity","<android><sqlite>","1","2","","",""
"3672394","1","","","2010-09-08 22:31:22","1","691","<p>First, I should mention that I am a beginner at Android development.</p><p>I just bought a Samsung Vibrant and I'm trying to connect to it with adb.  When I connect the phone and do a ""adb devices"" it didn't display anything.  So, I checked device Manager and the phone was listed under disk drives.  I tried downloading the adb driver for the phone and installing it manually.  SAMSUNG Android Composite ADB Interface was listed under the ADB Interface after that.  But, the device status is Device Cannot Start.</p><p>Is there a fix for this? </p><p>Thanks in advance.</p>","442894","","","","","2010-09-09 14:58:48","trouble running adb with Samsung Vibrant","<android>","1","1","","",""
"3672487","1","3675679","","2010-09-08 22:49:47","0","1101","<p>Im doing some research to build an iOS and Android app using titanium appcelerator. The only requirement I have not being able to confirm is the possibility to upload a photo directly to Amazon S3 in a way that is <strong>compatible with iOS and Android devices</strong>.</p>","124852","","","","","2010-09-09 10:21:13","Is it possible to upload files directly to Amazon S3 using titanium appcelerator?","<iphone><android><titanium><appcelerator>","2","0","","",""
"3672655","1","","","2010-09-08 23:23:03","5","3492","<p>i am currently developing an app with the Andoid Maps SDK.</p><p>Now i would like to get a notice if the user scrolls the map to load additional markers from a server based on the new map center.</p><p>I already searched for a function to register a listener but i didn´t find anything.</p><p>Is there any way to get informed about map center changes? I don´t want to implement a polling mechanism for that... :(</p>","272460","","","","","2013-06-03 13:55:34","Android Maps get Scroll Event","<android><maps>","2","0","3","",""
"3672691","1","3672825","","2010-09-08 23:30:05","0","1802","<p>I don't think my future lies in Android development, as I am consistently failing at the simplest things...</p><p>I've got a button with the label ""Game Slot 1"".  When the user clicks it, I succesfully take them through a couple of activities in which they create a new character.  I save the game name in an SQLite database, and the next time I launch my app, I can quite happily dynamically change ""Game Slot 1"" to the name of that slot's game from the database.  Perfect.</p><p>But how on earth do I get it to update the view in the same manner when I return to that activity via the back button, or having called finish() on all the subsequent activities?</p><p>I'm sure it's something to do with onResume(), and maybe invalidate(), but I just can't seem to find an example.</p><p>Is invalidate overkill just to refresh a few UI elements onResume()?</p><p>How the heck do you use it, anyway, even if it is?</p><p>Is there a better way?</p><p>Many thanks in advance for any help offered...just try not to laugh at how simple this probably is! :)</p><p>Cheers,James</p>","442912","","","","","2010-09-08 23:59:36","Android - Simple View Refresh","<android><refresh><screen><invalidate><onresume>","1","0","","",""
"3672724","1","","","2010-09-08 23:36:23","1","864","<p>I am developing an Android application. What I find most annoying during testing is, that the emulator always pops up that on-screen telephone keyboard whenever I click into a text input field. Since I input my data with the keyboard anyway I find that most annoying. Can one switch that on-screen keyboard appearance off? Or can one change that so that it at least presents a mini-qwerty keyboard as my actual device does, not that old-fashioned T9 keyboard?</p><p>Michael</p>","423411","","","","","2010-09-08 23:40:31","can one prevent the Android device emulator from popping up the onscreen keyboard?","<android>","1","3","","",""
"3672757","1","3813669","","2010-09-08 23:44:22","2","936","<p>I have a ViewFlipper with multiple views added dynamically. I override onTouchEvent (and onInterceptTouchEvent) in order to get the down, move and up events on the views, so I know when to animate left and right.</p><p>Now everything works fine, except that there is a small flicker (one of the other views is displayed on top for a split second) at the beginning of the swipe. This only happens after the first swipe is done.</p><p>I looked at the source code for the Home screen app on Android, which helped a lot, but they don't use the ViewFlipper, so it's a little different.</p><p>Did anyone encounter the same problem?</p><p>Thanks!</p>","338981","","","","","2010-09-28 14:14:42","Android viewflipper flicker","<android><flicker><viewflipper><swipe>","1","0","","",""
"3672806","1","3672820","","2010-09-08 23:53:23","1","384","<p>I have implemented the following function to be used with showDialog() and onDialogCreate(), but I would like the method to be called each time because it calculates the text of a text view every time the dialog is displayed.</p><pre><code>private AlertDialog overallScoreDialog(){    AlertDialog.Builder alert = new AlertDialog.Builder(this);    Context mContext = getApplicationContext();    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);    View layout = inflater.inflate(R.layout.overall_score_dialog,            (ViewGroup) findViewById(R.id.overall_score_dialog_layout_root));    alert.setTitle(""Results"");      TextView tv = (TextView) layout.findViewById(R.id.overallscoreresults);    ScoreCalculator sc = new ScoreCalculator(this, calculatorVO);    tv.setText(Double.toString(sc.getTotalScore()));    alert.setView(layout);    alert.setPositiveButton(R.string.done, new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int whichButton) {            return;                          }      });      AlertDialog ad = alert.create();    return ad;}</code></pre><p>Can anyone help?</p>","439836","","","","","2010-09-08 23:57:46","Alert Builder is only called first time?","<android>","1","0","","",""
"3672833","1","5900877","","2010-09-09 00:00:20","0","371","<p>In an Android project I am working on I have a ListActivity that is set up like this:</p><pre><code>public class myClass extends ListActivity {   public void onCreate(Bundle savedInstanceState) {      ...      String[] menuItems = new String[] { ""View"", ""Share"", ""Delete"" };      ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,          android.R.layout.simple_list_item_1, menuItems);      setListAdapter(adapter);      ...   }}</code></pre><p>The 3 menu items show up fine, but only the text portion of the item can be ""clicked"". How can I make it so that the entire row is ""clickable""?</p>","199230","","","","","2011-05-05 16:17:06","Selectable width of list items in ListActivity","<android><listactivity>","1","1","","",""
"3672846","1","","","2010-09-09 00:03:12","1","1424","<p>In Android when I am adding a view object like ImageView to FrameLayout view and then immediately trying to call <code>layout()</code> method to <code>repositioned the added view object</code> it is not working. <strong>But when I call the layout method alone after some new event e.g. touch event then layout() seems to work.</strong> This also happens when bringToFront() and layout() is used together, layout() does not seems to work together with other method. Is there any reason why is this like this? Also instead of adding view object in the middle of the screen can it be ADDED at some specific location in FrameLayout?</p>","365905","","1043882","","2012-10-15 02:48:47","2012-10-15 02:48:47","Android: addView and layout method does not work together","<android><layout><view>","2","0","","",""
"3672933","1","3673726","","2010-09-09 00:23:00","4","3382","<p>All,</p><p>I am trying to inject a long text entry into a SQLite database, in a  TEXT field.  This text has new lines in it (i.e. it spans multiple paragraphs).</p><p>I can get the new lines to show up if I do the INSERT manually:</p><pre><code>INSERT INTO ""LOGENTRY"" VALUES(5,40,'PLACE','line1line2line4',1283990533315,'4A','TEXT','',NULL);</code></pre><p>but if I have the equivalent text in a CSV file and attempt to .import it into the table, I get an error that it's expecting more columns than exist (as soon as the new line is encountered, the program assumes it's the end of the input and thus it's missing columns).</p><p>Is this possible?  Or is the only way to manually do each INSERT?</p>","155392","","","","","2014-02-14 00:53:00","SQLite - inserting a string with newlines into database from csv file","<android><database><string><sqlite>","4","0","2","",""
"3673008","1","3674036","","2010-09-09 00:44:22","2","6346","<p>I am having problem with download my android application from my own web server.</p><p>First I sent a html content with java script to ask Android phone to open my download link</p><pre><code>&lt;html&gt;    &lt;head&gt;        &lt;script&gt;            window.onload=function()            {{                window.location = ""downloadURL"";            }}        &lt;/script&gt;    &lt;/head&gt;&lt;/html&gt;""</code></pre><p>Android phone revice this java script will open the downloadURL </p><p>On my server end, I am using .Net ASP</p><p>I've set up the MIME content</p><pre><code>Response.Cache.SetCacheability(HttpCacheability.NoCache);Response.ContentType = ""application/vnd.android.package-archive"";Response.AppendHeader(""Content-Disposition"", ""attachment; filename="" + ""MyApp.apk"");Response.AppendHeader(""Content-Length"", """" + response.Application.Bytes.Length);Response.BinaryWrite(response.Application.Bytes);</code></pre><p>The apk file which is MyApp.apk is about 1.5MB</p><p>How ever, when I used Android emulator to download the app, the file size is only 4.25 KB, and the name is not MyApp.apk. It contains the name of my download link.</p><p><img src=""http://i.stack.imgur.com/7pxYn.jpg"" alt=""alt text""></p><p>When I use Firefox to download my app, Firefox successfully download it with correct name and size.<img src=""http://i.stack.imgur.com/bgxPC.jpg"" alt=""alt text"">Please help me out!!Thanks</p><p>When I debug my server, my server did sent out the application bytes with </p><pre><code>Response.BinaryWrite(response.Application.Bytes);</code></pre><p>I don't understand why, andorid emulator can not receive, intead it seems create its own apk file from the html content.</p>","399820","","399820","","2010-09-09 03:21:49","2012-07-12 13:16:09","download apk from own Webserver","<android>","2","3","","",""
"3673036","1","9530965","","2010-09-09 00:53:40","3","1477","<p>On my nexus one, there is a handy app reachable from Settings > About Phone > Battery use.</p><p>I'd like to StartActivity() that app from one of my Activities.</p><p>I can see in the log that when Settings runs it, this intent is logged:</p><pre><code>Starting activity:  Intent { act=android.intent.action.MAIN           cmp=com.android.settings/.fuelgauge.PowerUsageSummary }</code></pre><p>I'm having trouble relating that to something in Android Java source.  I can't even find ""fuelgauge"" in the GIT source.   Can anyone point me to the right file, or anything else helpful, like how to create the right kind of Intent?</p><p>Thanks</p><p>Peter</p>","253661","","","","","2012-03-02 09:38:04","Create ""Battery usage"" intent android","<android><android-intent><usage><battery>","1","0","2","",""
"3673049","1","3673169","","2010-09-09 00:57:24","0","1271","<p>The options menu's ""More"" button gets localized automatically, while the rest of the app isn't localized.  The ""More"" button changes to ""Mas"" because the I picked ""espanol"" as my language.  How do I prevent the ""More"" button from getting localized?</p>","442963","","","","","2010-09-09 01:29:32","How to prevent options Menu ""More"" Button from getting localized on android?","<android>","1","1","0","",""
"3673054","1","","","2010-09-09 00:57:53","0","478","<p>Hello and WelcomeI am trying to make a 2-D tile system heavily based off of the Snake example.  The original mTileGrid is still there, but there is a new array: mMapGrid.  The point is to copy the data from mMapGrid to mTileGrid on each update cycle and therefore simulate an area larger than the immediate screen.</p><p>I wrote more functions, which I will now briefly explain...  After that, the problem:</p><p>Set a tile in the map grid    public void setMapTile(int tileindex, int row, int column)    {     mMapGrid[row][column] = tileindex;    }</p><p>Called in onDraw(), moves the data from mMapGrid to mTileGrid</p><pre><code>private void CopyArrayData(){ //TODO: TAG int countrow, countcolumn; countrow = 0; countcolumn = 0;</code></pre><p>Log.w(""PassNumbers"", ""TopLeftCorner.column is: "" + TopLeftCorner.column + "" and TopLeftCorner.row is "" + TopLeftCorner.row);</p><pre><code> for(int x = TopLeftCorner.column; x &lt;= mXTileCount; x++) {  for(int y = TopLeftCorner.row; y &lt;= mYTileCount; y++)  {   countrow++;   countcolumn++;   if(countrow == mXTileCount)   {    countrow = 0;   }   if(countcolumn == mYTileCount)   {    countcolumn = 0;   }   int set = mMapGrid[y + TopLeftCorner.row][x + TopLeftCorner.column];   if(set == SnakeView.GRASS)   {    setTile(set, countrow, countcolumn);   }   else   {    setTile(SnakeView.ROCK, countrow, countcolumn);   }   if(pass1 == false)   {    Log.w(""TileGridAccess"",(""TileGrid Access: row"" + countrow + "" column"" + countcolumn));    Log.w(""MapGridAccess"",""MapGrid Access: row"" + (y + TopLeftCorner.row) + "" column:"" + (x + TopLeftCorner.column));   }  }  pass1 = true; }}</code></pre><p>}</p><p>The update() function, with setMapTile() called here</p><pre><code>public void update() {    if (mMode == RUNNING) {            clearTiles();            setMapTile(GRASS, 5, 5);            setMapTile(GRASS, 5, 6);            setMapTile(GRASS, 5, 7);            setMapTile(GRASS, 5, 8);            setMapTile(GRASS, 5, 9);        mRedrawHandler.sleep(mMoveDelay);    }}</code></pre><p>The onDraw() function: (unchanged from the original TileView in Snake, except for the elimination of the if greater than zero check since we have a default tile)</p><p>@Override    public void onDraw(Canvas canvas) {        super.onDraw(canvas);</p><pre><code>    CopyArrayData();    for (int x = 0; x &lt; mXTileCount; x += 1) {        for (int y = 0; y &lt; mYTileCount; y += 1) {                canvas.drawBitmap(mTileArray[mTileGrid[x][y]],                   mXOffset + x * mTileSize,                  mYOffset + y * mTileSize,                  mPaint);        }    }}</code></pre><p>The problem is that the tiles displayed are not evenly spaced and do not behave as they should.  They are haphazardly scattered about their row.</p>","389943","","389943","","2010-09-10 01:46:52","2010-09-10 02:48:28","2D Tile System not behaving properly","<android><map><grid><2d><tile>","1","3","","",""
"3673104","1","3673133","","2010-09-09 01:09:21","3","2740","<p>I want to create an android Layout of which I want to instantiate several copies. I understand that declaring the layout in an XML will create a single instance. Is there a way to use the XML View declaration as a 'definition' rather than a 'declaration' ? Or is it possible to clone a view ?</p><p>Thanks;</p>","442971","","","","","2010-09-10 06:32:40","Android views as templates","<android><view><clone>","4","0","","",""
"3673271","1","3673367","","2010-09-09 01:56:49","2","392","<p>I want to add a different type of item (like a simple textview) to the last position in my <code>ListView</code>.</p><p>I extends the <code>SimpleAdapter</code> and override some methods:</p><pre><code>@Overridepublic int getCount() {    if (super.getCount() == 0) {        return 0;    } else {        return super.getCount() + 1;    }}@Overridepublic Object getItem(int position) {    if (position == getCount() - 1) {        return null;    } else {        return super.getItem(position);    }}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View v;    if (position == getCount() - 1) {        if (convertView == null) {            v = new TextView(mContext);        } else {            v = convertView;        }        return v;    } else {        return super.getView(position, convertView, parent);    }}</code></pre><p>But it did not work. What is the problem or how to add one?Thanks.</p>","428022","","","","","2010-09-09 15:36:12","How to add a different type of item in the ListView using SimpleAdapter?","<android><listview><adapter>","1","0","1","",""
"3673298","1","3674134","","2010-09-09 02:03:05","3","2498","<p>I'm trying to draw a rounded rectangle with a border around it using a class that extends ShapeDrawable (see <a href=""http://stackoverflow.com/questions/2145131/trying-to-draw-a-button-how-to-set-a-stroke-color-and-how-to-align-a-gradient/3663956#3663956"">here</a>) and everything is working except that the shapedrawable seems to be cutting off some of the border because the shape itself doesn't extend outside those bounds. </p><p>Is there not some way to offset where the shapedrawable starts drawing so that there is some padding between the bounds of the shape itself and the canvas? I have tried both ShapeDrawable.setBounds to larger than the intrinsic size of the shape and ShapeDrawable.setPadding but don't seem to be getting anywhere. Should I be subclassing <em>Drawable</em> instead?</p>","278638","","","","","2013-07-04 12:58:07","Offset shape within a ShapeDrawable","<android><drawable><shapes>","2","0","1","",""
"3673410","1","3673422","","2010-09-09 02:40:15","1","659","<p>Is it possible to preserve file-persisted data when upgrading an app? For example my app stores data under /data/data/mypkg/store. I would like the store directory to be preserved when user upgrades my app.</p>","440093","","","","","2010-09-09 03:54:31","Android: Possible to preserve data when upgrading app?","<android>","3","0","","",""
"3673452","1","3673461","","2010-09-09 02:52:43","3","1566","<p>I was wondering if it is possible to have Eclipse automatically increment the build version number inside of the <code>Manifest</code> each time that I either build or run an Android app.</p><p>Has anyone ever done something like this?</p>","413575","","","","","2010-09-09 02:54:47","android manifest build number","<android><eclipse><android-manifest>","1","0","","",""
"3673468","1","3673629","","2010-09-09 02:56:16","5","1207","<p>Are the Android APIs open source? If so, I want to see how they implemented the smoothscroll method for the ListView object (this is implemented in API level 8, but I want to build against an earlier API level). How would I go about finding this?</p>","440889","","321731","","2014-02-04 15:21:02","2014-02-04 15:21:02","Finding Android source code","<android><api><android-source>","2","0","","",""
"3673623","1","","","2010-09-09 03:44:20","1","1234","<p>I currently have code that creates rows in a table that hold a string in column 1 with a RadioButton in column 2. </p><p>There can be a variable number of these rows. That all works just great, but I want to add them to a RadioGroup so only one button can be toggled at a time.</p><p>When I tried to add the dynamic RadioButton to the RadioGroup AFTER I added it to the table row, I got an error saying that the child (the RadioButton) already had a parent. I agree, it does have one, the TableRow.</p><p>My question is, can you have radio buttons tied to a radio group inside of a row or, should I just code my own toggle mechanism and avoid RadioGroup all together? I mean, I could code the onClick to unclick all other radio buttons, but I would rather not do this if I can use the build in RadioGroup.</p><p>Here is the layout:</p><pre><code>                &lt;ScrollView                    android:id=""@+id/ScrollViewModifyGroups""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                    android:scrollbars=""vertical""&gt;                    &lt;TableLayout                        android:id=""@+id/TableLayout_ModifyGroups""                        android:layout_width=""fill_parent""                        android:layout_height=""fill_parent""                        android:stretchColumns=""*""&gt;                        &lt;TableRow&gt;                            &lt;RadioGroup                                android:id=""@+id/radiogroup""                                android:layout_width=""fill_parent""                                android:layout_height=""wrap_content""                                android:orientation=""vertical""&gt;                             &lt;/RadioGroup&gt;                        &lt;/TableRow&gt;                    &lt;/TableLayout&gt;                &lt;/ScrollView&gt;</code></pre><p>Here is the Java code snippet of what I am doing:</p><pre><code>  TableLayout modifyGroupTable = (TableLayout)findViewById(R.id.TableLayout_ModifyGroups);  RadioButton groupButton = new RadioButton(this);  insertGroupRow(modifyGroupTable, ""SOME ID"", groupButton);    private void insertGroupRow(final TableLayout groupTable, String groupName, RadioButton radioButton)    {        final TableRow newRow = new TableRow(ReplayerCreateGroupsActivity.this);        int textColor = getResources().getColor(R.color.title_color);        float textSize = getResources().getDimension(R.dimen.help_text_size);        addTextToRowWithValues(newRow, groupName, textColor, textSize);        newRow.addView(radioButton);                 groupTable.addView(newRow);        try        {         radioGroup.addView(radioButton);        }        catch(Exception e)        {         e.printStackTrace();        }    }</code></pre>","443654","","443654","","2010-09-09 03:55:32","2010-09-09 17:13:59","Can this be done: Variable number of radio buttons in a radio group inside a table?","<android>","3","0","","",""
"3673642","1","3677492","","2010-09-09 03:49:03","3","431","<p>Is there any way we can launch the widget from our application immediately without user have to choose the widget.So it like automatically add widget to our home screen using code.</p><p>Thanks. </p>","430926","","430926","","2010-09-09 04:29:28","2010-09-09 14:23:35","Launch widget from code","<android><android-widget>","2","0","","",""
"3673658","1","3673662","","2010-09-09 03:53:21","2","204","<p>I want to load a URL when a certain view in my ViewFlipper is shown. How can I determine that X view is being shown, so I can perform the URL downloading logic?</p>","19875","","","","","2010-09-09 03:54:48","Doing work on demand in a ViewFlipper","<android><viewflipper>","1","0","","",""
"3673703","1","","","2010-09-09 04:06:15","5","1601","<p>What is the best way to synchronize android sqlite database with MSSql/MySQL database at the backend (over http?).?</p>","363111","","","","","2014-01-22 08:45:07","synchronize android sqlite database","<android><sqlite><sync>","1","0","2","2014-01-22 14:29:50",""
"3673704","1","3673815","","2010-09-09 04:06:16","4","3001","<p>I have two XML layouts declared in the res/layout folder one contains the generic template and the other contains the views specific to a particular screen. I want to add the second xml layout to the first one i.e. the generic one. As both of these layouts are declared as XML, I am not able to add one to other. How do I solve this problem?</p>","440432","","114066","","2010-09-29 07:46:19","2010-10-09 05:00:56","android - add one xml layout in other xml layout","<android>","2","0","","",""
"3673717","1","3678642","","2010-09-09 04:08:22","1","11487","<p>I'm getting a NullPointerException while attempting to create a Spinner within a dialog and can't seem to debug it because the code looks solid. Wonder if anyone else has any idea. Any help is greatly appreciated.</p><pre><code>    protected Dialog onCreateDialog(int id)    {        Dialog dialog;        switch(id) {        case DIALOG_SEND_PM:            Spinner spinner = (Spinner)findViewById(R.id.pm_server);            ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this, R.array.server_array, android.R.layout.simple_spinner_item);            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);            spinner.setAdapter(adapter);            spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());            dialog = new Dialog(PM.this);            dialog.setContentView(R.layout.send_pm_dialog);            dialog.setTitle(R.string.send_pm);            pmMessage = (EditText) dialog.findViewById(R.id.send_pm_box);            Button sendPm = (Button) dialog.findViewById(R.id.send_pm_button);            sendPm.setOnClickListener(PM.this);            break;        default:            dialog = null;   }</code></pre><p>I get the exception at adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); I changed the context to MyClass.this and the exception moved down to the next line, which confuses me. I'm wondering if it is the adapter having a null value but I call everything the same way I have before while not in a dialog.</p><p>Relevant XML data:</p><pre><code>&lt;LinearLayout&gt;    &lt;TextView/&gt;    &lt;LinearLayout&gt;       &lt;TextView/&gt;      &lt;EditText/&gt;      &lt;TextView/&gt;      &lt;Spinner        android:id=""@+id/pm_server""        android:layout_height=""fill_parent""        android:layout_width=""wrap_content""        android:background=""@drawable/yblueborder""        android:textColor=""#ABABAB""/&gt;    &lt;/LinearLayout&gt;    &lt;Button/&gt;&lt;/LinearLayout&gt;</code></pre><p>Edited out the rest of the data so it wouldn't take up too much space.</p>","423519","","423519","","2010-09-09 16:31:31","2012-10-28 16:06:49","Set spinner within custom dialog","<android><dialog><spinner>","1","2","0","",""
"3673873","1","","","2010-09-09 04:55:18","0","872","<p>Is there any way, When Wi-Fi is available i should be able to disable my 3G and 2G both(all operator based data ).</p><p>I want this to do from my application because</p><p>1> If both Wi-fi and 3G are available then it results in interminnent connectivity.2> I may be charged if GPRS or 3G data are used, based on packets transferred.</p><p>Any guidance</p><p>Thank you... </p>","1386533","","","","","2010-09-09 04:55:18","Android: WIfi and 3G connectivity","<android>","0","6","","",""
"3673888","1","3674203","","2010-09-09 04:59:35","6","6955","<p>i am using this code to show alert dialog...when i click on the ok button it should show the date picker..</p><pre><code>protected Dialog onCreateDialog(int id) {    switch (id) {    case TIME_DIALOG_ID:        return new TimePickerDialog(ListReminderActivity.this,                mTimeSetListener, mHour, mMinute, false);    case DATE_DIALOG_ID:        return new DatePickerDialog(ListReminderActivity.this,                mDateSetListener, mYear, mMonth, mDay);    case DESCRIPTION_DIALOG_ID:        return new AlertDialog.Builder(ListReminderActivity.this).setTitle(                ""Add Reminder"").setView(description).setPositiveButton(                R.string.add_alert_ok,                new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog,                            int whichButton) {                        ListReminderActivity.this                                .dismissDialog(DESCRIPTION_DIALOG_ID);                        ListReminderActivity.this                                .removeDialog(DESCRIPTION_DIALOG_ID);                        ListReminderActivity.this                                .showDialog(DATE_DIALOG_ID);                    }                }).setNegativeButton(R.string.add_alert_cancel,                new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog,                            int whichButton) {                        ListReminderActivity.this                                .dismissDialog(DESCRIPTION_DIALOG_ID);                        ListReminderActivity.this                                .removeDialog(DESCRIPTION_DIALOG_ID);                    }                }).create();    }    return null;}</code></pre><p>but the problem is.. i am getting the Exception when i clcik on the ok button</p><p>Exception is...</p><pre><code>    09-09 10:30:48.941: ERROR/AndroidRuntime(1189): FATAL EXCEPTION: main09-09 10:30:48.941: ERROR/AndroidRuntime(1189): java.lang.IllegalArgumentException: current should be &gt;= start and &lt;= end09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.widget.NumberPicker.setCurrent(NumberPicker.java:288)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.widget.DatePicker.updateDaySpinner(DatePicker.java:364)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.widget.DatePicker.updateSpinners(DatePicker.java:350)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.widget.DatePicker.init(DatePicker.java:346)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.app.DatePickerDialog.&lt;init&gt;(DatePickerDialog.java:124)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.app.DatePickerDialog.&lt;init&gt;(DatePickerDialog.java:83)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at com.app.reminder.ListReminderActivity.onCreateDialog(ListReminderActivity.java:149)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.app.Activity.onCreateDialog(Activity.java:2472)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.app.Activity.createDialog(Activity.java:881)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.app.Activity.showDialog(Activity.java:2547)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.app.Activity.showDialog(Activity.java:2514)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at com.app.reminder.ListReminderActivity$3.onClick(ListReminderActivity.java:164)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.os.Handler.dispatchMessage(Handler.java:99)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.os.Looper.loop(Looper.java:123)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at java.lang.reflect.Method.invokeNative(Native Method)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at java.lang.reflect.Method.invoke(Method.java:521)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-09 10:30:48.941: ERROR/AndroidRuntime(1189):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","421645","","","","","2011-12-25 19:02:43","Illegal argument exception in android dialog","<android>","4","6","","",""
"3673895","1","4851796","","2010-09-09 05:01:58","1","1518","<p>I have a ViewFlipper where one of the views is a ListView. To move back and forth between the views, I have a GestureListener that detects left and right swipes. Sometimes the left &amp; right swipes interfere with the ListView. That is, when I want to switch to the next view by swiping left/right, I may accidentally click on an item in my list. </p><p>Is there a good way to prevent this interference?</p>","19875","","19875","","2010-09-09 05:37:36","2011-09-08 08:10:25","Gesture problems with a ViewFlipper that contains a ListView","<android><listview><gesture><viewflipper><swipe>","2","0","1","",""
"3673933","1","","","2010-09-09 05:10:09","2","5883","<p>I had few pieces of hardware which run on WinCE 5 and 6. I wanted to know if there was any program I could use to install Android on it without having to write drivers etc for it. </p><p>I am looking for a solution similar to XDAndroid project but for WinCE systems. </p><p>Thanks! Please let me know what options I would have on this. </p>","443085","","","","","2014-01-23 07:32:39","Can I install Android on WinCE platforms?","<android><windows-ce>","2","0","1","",""
"3674112","1","","","2010-09-09 05:51:55","0","1154","<p>In my android application, i am displaying images of different categories.When i click on these images i would like to get a small list of the items in that particular category.What should i use for that.I am not sure which control will satisfy this and how can i use it.</p><p>Could any one please suggest me with a solution?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2010-09-09 07:02:17","Display dropdown on click of image in android","<android>","1","0","","",""
"3674170","1","","","2010-09-09 06:06:00","0","520","<p>Since the whole Android stuff is open source I was thinking about to do some minor modifications in a few internal classes from the <strong>com.android.internal.telephony</strong> package and of course then I would love if somehow my application could use the modified classes. I was thinking about replacing the classes with the original ones at <em>runtime</em> by using reflection or other kind of unknown java tricks :D ...maybe what I'm trying to do is impossible :( I don't know that's why I'm asking.  </p><p>Note: The changes in the internal classes would not change their functionality in any way, its more about extending their functionality so even if other apps would use the modified versions it would not break them!</p><p>Why I want to do it? What I'm trying to achieve ? Well i would like to modify the <strong>com.android.internal.telephony.gsm.CallTracker</strong> internal class so i could do proper <em>call handling</em> (call blocking etc..)Maybe if you know about another way how to do what I want to I would like to hear about it :)</p><p>Note2: I know about the method when you handle the <strong>android.intent.action.PHONE_STATE</strong>, action , but its simply too late to react when this action is broadcasted. I'm really looking for a better solution even if that solution involve ugly hacks :) </p><p>As always thanks for all your replies...   </p>","1205130","","","","","2010-09-09 06:21:58","Modify android internal class(es) / Call Handling","<java><android><hack>","2","1","","",""
"3674236","1","","","2010-09-09 06:19:25","1","971","<p>we are working on a project where image data is coming from webservice and we need to display that image bitmap data in our phones, the images could have more than 500, so when we download data form webservice and displaying then in gallery with converting image data into bitmap, outofmemory error is coming and program crashes.</p><p>Please give suggestion to how to achieve this.</p>","443118","","","","","2010-09-09 06:26:34","How to display gallery from fetching the image data from webservice in android?","<android><gallery>","1","0","","",""
"3674304","1","3710108","","2010-09-09 06:35:06","5","4340","<p>I am struggling to get Bitmaps blurred using Android.</p><p>I have seen a lot of information about using a simple kernel like</p><pre><code>0    0    0    5    0    0    00    5   18   32   18    5    00   18   64  100   64   18    05   32  100  100  100   32    50   18   64  100   64   18    00    5   18   32   18    5    00    0    0    5    0    0    0</code></pre><p>My problem is that I am really not sure how to multiply this with my Bitmap in an efficient way. </p><p>Should I go through every pixel and</p><pre><code>image.getPixel(x, y)</code></pre><p>while storing those values to a new array (so I don't have to get those values over and over again) and then go through the array and for each value add up the surrounding values multiplied by the corresponding field in the kernel divided by 1068 (in the case of the above kernel (= all entries summed up))?</p><p>Is there any better way to do this? Is there a simple solution for the borders?</p><p>Or is there even something available in the Android SDK I missed?</p>","443112","","","","","2012-04-05 12:07:41","How to blur a Bitmap (Android)?","<android><bitmap><blur>","2","1","1","",""
"3674313","1","3674338","","2010-09-09 06:37:09","1","208","<p>The following steps allow me to fetch an image kept on my TomCat server. but i am unable to access an image from google's web site . What could be the reason ?</p><pre><code>                        URL aURL = new URL(url);        URLConnection con = aURL.openConnection();        con.connect();        InputStream is = con.getInputStream();        /* Buffered is always good for a performance plus. */        BufferedInputStream bis = new BufferedInputStream(is);        /* Decode url-data to a bitmap. */        bm = BitmapFactory.decodeStream(bis);        bitmapDrawable = new BitmapDrawable(bm);</code></pre><p>My URL :http://172.29.26.34:8080/MyService/hb.gif</p><p>Google image  : </p><p><a href=""http://www.google.co.in/imgres?imgurl=http://www.androidguys.com/wp-content/uploads/2010/04/android_apps.jpeg&amp;imgrefurl=http://www.androidguys.com/2010/04/25/hardware-standards-android-handset-manufacturers-implement/&amp;usg=__VCGb9CrKDVzOjFJxQ0yFHGewblk=&amp;h=356&amp;w=570&amp;sz=156&amp;hl=en&amp;start=0&amp;sig2=N3UL3C995r94inBx8X822w&amp;zoom=1&amp;tbnid=wISGPUJqRDxB7M:&amp;tbnh=127&amp;tbnw=165&amp;ei=h3-ITKDXMov0vQOsg7GPCQ&amp;prev=/images%3Fq%3Dandroid%2Bimages%26um%3D1%26hl%3Den%26sa%3DN%26biw%3D963%26bih%3D525%26tbs%3Disch:1&amp;um=1&amp;itbs=1&amp;iact=rc&amp;dur=188&amp;oei=h3-ITKDXMov0vQOsg7GPCQ&amp;esq=1&amp;page=1&amp;ndsp=15&amp;ved=1t:429,r:2,s:0&amp;tx=107&amp;ty=75"" rel=""nofollow"">http://www.google.co.in/imgres?imgurl=http://www.androidguys.com/wp-content/uploads/2010/04/android_apps.jpeg&amp;imgrefurl=http://www.androidguys.com/2010/04/25/hardware-standards-android-handset-manufacturers-implement/&amp;usg=__VCGb9CrKDVzOjFJxQ0yFHGewblk=&amp;h=356&amp;w=570&amp;sz=156&amp;hl=en&amp;start=0&amp;sig2=N3UL3C995r94inBx8X822w&amp;zoom=1&amp;tbnid=wISGPUJqRDxB7M:&amp;tbnh=127&amp;tbnw=165&amp;ei=h3-ITKDXMov0vQOsg7GPCQ&amp;prev=/images%3Fq%3Dandroid%2Bimages%26um%3D1%26hl%3Den%26sa%3DN%26biw%3D963%26bih%3D525%26tbs%3Disch:1&amp;um=1&amp;itbs=1&amp;iact=rc&amp;dur=188&amp;oei=h3-ITKDXMov0vQOsg7GPCQ&amp;esq=1&amp;page=1&amp;ndsp=15&amp;ved=1t:429,r:2,s:0&amp;tx=107&amp;ty=75</a></p>","335429","","","","","2010-09-09 07:00:57","Fetching an image from internet","<android>","3","0","1","",""
"3674344","1","3674367","","2010-09-09 06:43:40","3","301","<p>Is it possible to develop a single application that is able to run in both android and iphone.If can how can i done post some link. Thank you very much in advance</p>","699226","","65977","","2010-09-09 06:48:17","2010-09-09 07:07:32","is it possible to run single application in both android and iphone","<iphone><android><cross-platform>","3","0","2","2012-08-30 16:09:07",""
"3674362","1","3674497","","2010-09-09 06:47:03","0","1301","<p>I am getting the following stack trace from some phones running my app.</p><p>This works fine on my G1 and the emulator, I have never had any troubles.  But I am getting the following stack trace from other users.</p><pre><code>    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.droidprofessor.android.mmm/com.droidprofessor.android.mmm.ActivityGame}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.speech.tts.engine.CHECK_TTS_DATA }       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)       at android.app.ActivityThread.access$2200(ActivityThread.java:119)       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)       at android.os.Handler.dispatchMessage(Handler.java:99)       at android.os.Looper.loop(Looper.java:123)       at android.app.ActivityThread.main(ActivityThread.java:4363)       at java.lang.reflect.Method.invokeNative(Native Method)       at java.lang.reflect.Method.invoke(Method.java:521)       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)       at dalvik.system.NativeStart.main(Native Method)Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.speech.tts.engine.CHECK_TTS_DATA }       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)       at android.app.Activity.startActivityForResult(Activity.java:2749)       at com.droidprofessor.android.mmm.ActivityGame.loadServices(ActivityGame.java:285)       at com.droidprofessor.android.mmm.ActivityGame.onCreate(ActivityGame.java:105)       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)       ... 11 more</code></pre><p>Here is the activity that handles TTS.  GameActivity extends this activity.</p><pre><code>public class ActivityTTS extends Activity implements OnInitListener {//TEXT TO SPEECH SERVICEpublic static final int CHECK_TTS_AVAILABILITY = 0;private static final String TAG = ""ActivityTTS"";private TextToSpeech mTts; //Text to speech library@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //TTS Service    Intent checkIntent = new Intent();    checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);    startActivityForResult(checkIntent, CHECK_TTS_AVAILABILITY);}/** * For TTS */@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    try {        if(Logging.DEBUG_LOG) Log.d(TAG, ""TTS Response: ""+requestCode);        if (requestCode == CHECK_TTS_AVAILABILITY) {            if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {                // success, create the TTS instance                mTts = new TextToSpeech(this, this);                        } else {                // missing data, install it                Toast.makeText(getApplicationContext(), R.string.install_audio_data, Toast.LENGTH_LONG).show();                Intent installIntent = new Intent();                installIntent.setAction(                        TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                startActivity(installIntent);                finish();            }        }    }catch (Exception e) {        if(Logging.ERROR_LOG) Log.e(TAG, ""Unable to access service"");        finish();    }}/** * Loads when the TTS is ready */@Overridepublic void onInit(int status) {    mTts.setLanguage(Locale.getDefault());}/** * Speak text */final void speak(String text) {    try{        mTts.stop(); //Stop speaking        mTts.speak(text, TextToSpeech.QUEUE_FLUSH, null);    }    catch(Exception e) {        if (Logging.ERROR_LOG) Log.e(TAG, ""TTS Failed - cannot say: ""+text );    }}@Overrideprotected void onDestroy() {    super.onDestroy();    //Close the Text to Speech Library    if(mTts != null) mTts.shutdown(); }</code></pre><p>}</p>","248521","","","","","2010-09-09 07:14:59","Getting Error when loading TTS","<android>","1","0","1","",""
"3674411","1","3675958","","2010-09-09 06:57:59","1","710","<p>I am using <strong>VideoView component for streaming video in Android</strong> , but the streaming video is <strong>occupying only a part of the screen of the mobile device both in portrait/landscape mode</strong>.</p><p>Kindly provide the code to so that the <strong>streaming video is displayed covering the full screen in portrait/landscape mode.</strong></p>","443141","","644073","","2011-12-21 14:35:57","2011-12-21 14:35:57","Need to display streaming video occupying the fullscreen","<android>","1","0","1","",""
"3674413","1","","","2010-09-09 06:58:35","6","18019","<p>I created the <code>AlertDialog</code> using the builder. It shows when we call the <code>show()</code> method. I have the <em>cancel</em> button in that dialog. I can cancel that dialog by clicking the cancel button. My problem is once I cancelled displaying the dialog, I can't show the dialog again. It throws an exception like:</p><pre><code>09-09 12:25:06.441: ERROR/AndroidRuntime(2244): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.09-09 12:25:06.441: ERROR/AndroidRuntime(2244):     at android.view.ViewGroup.addViewInner(ViewGroup.java:1970)09-09 12:25:06.441: ERROR/AndroidRuntime(2244):     at android.view.ViewGroup.addView(ViewGroup.java:1865)09-09 12:25:06.441: ERROR/AndroidRuntime(2244):     at android.view.ViewGroup.addView(ViewGroup.java:1845)09-09 12:25:06.441: ERROR/AndroidRuntime(2244):     at com.android.internal.app.AlertController.setupView(AlertController.java:364)09-09 12:25:06.441: ERROR/AndroidRuntime(2244):     at com.android.internal.app.AlertController.installContent(AlertController.java:205)09-09 12:25:06.441: ERROR/AndroidRuntime(2244):     at android.app.AlertDialog.onCreate(AlertDialog.java:251)</code></pre>","421645","","1820695","","2013-01-11 17:28:04","2013-01-11 17:28:04","the specified child already has a parent","<android><alertdialog>","3","1","","",""
"3674441","1","3675285","","2010-09-09 07:03:33","2","7619","<p>I've got a things to do with android,so, I have 2 images,1. image from camera2. another image from somewhere</p><p>so what I want to achieve is how to combine those image into 1 image, but it's overlapping (just like watermarking the image),the 2nd image should be scaled first into the size of the 1st image(camera) - so they have same dimension, then if the 2nd image pixel is black, don't combine it (so the black means transparent color - on 2nd image)</p><p>do you know what is the best way achieve this, can I do this with xor or bitwise?</p><p>Any reference or sample code would be really really much appreciate.</p><p>Thanks guys,</p>","286080","","","","","2010-09-09 09:19:29","Combining 2 Images overlayed","<android><image><bitmap>","2","1","6","",""
"3674508","1","","","2010-09-09 07:16:34","3","3357","<p>can anyody tell how to display superscript text in text view like two square(22) in android?</p><p>Thanks</p>","426344","","","","","2010-09-09 08:36:00","How to display superscript text for textview in android","<android>","0","0","","2013-07-26 07:57:01",""
"3674510","1","3675228","","2010-09-09 07:16:49","1","2712","<p>I am developing one application in which i am getting an exception, and i know this one is the silly or small mistake which i am doing but your help may catch me out and make my day:</p><pre><code>public class Demo extends Activity{    Button btnDemo;        Thread t;    AlertDialog alertDialog;     @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.demo);              btnDemo = (Button) findViewById(R.id.btnDemo);          btnDemo.setOnClickListener(new OnClickListener() {                      public void onClick(final View v) {                          t=new Thread() {                               public void run() {                                    tryDemo();                               }                         };                         t.start();                       }                });     }    public void tryDemo()    {          try         {              int i = 5;              if(i == 0 || i == 1)              {                    Intent intent_success = new Intent(getApplicationContext(), Main_Activity.class);                    startActivity(intent_success);              }              else              {                alertDialog = new  AlertDialog.Builder(getApplicationContext()).create();                alertDialog.setTitle(""Demo"");                alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialog, int which) {                       //here you can add functions                } });                 alertDialog.setIcon(R.drawable.icon);                alertDialog.setMessage(""Sorry!! Either Username or Password Invalid"");                alertDialog.show();              }         }         catch(Exception e)         {               Log.i(""Demo"", ""Demo - Demo Exception"");         }    }   }</code></pre><p>In above code, if i make i=0 or i=1 in tryDemo function then it is running successfully , but if i make it other than 0 or 1 then it <strong>throws an exception as ""Demo - Demo Exception""</strong>.</p><p>I am not sure but i think the exception raises from <strong><em>getApplicationContext()</em></strong>.</p><p><strong>Update:- 1</strong></p><p>The exception which i am getting, as follows:</p><p><img src=""http://i.stack.imgur.com/1ggK5.png"" alt=""alt text""></p><p><strong>Update:- 2</strong>If I remove the ""thread"" part and wrote the whole function code in the button click event and replaced the ""getApplicationContext()"" with v.getContext() then it is running successfully.........but i want to implement it within the THREAD.</p><p>Please help me and catch me out...</p><p>thanx</p>","379693","","379693","","2010-09-09 09:49:33","2010-09-10 23:56:04","Android - Getting Exception","<android><exception><try-catch><android-context>","4","4","1","",""
"3674512","1","","","2010-09-09 07:17:08","1","604","<p>Tried both soundpool and mediaplayer but cant quite manage to get sound files to play back correctly in sequence without overlap..  Need to be able to playback three randomly selected audio files in sequence without overlap. Any examples of using soundpool to play back audio sequentially? would be very much appreciated.. seems like such a simple thing is overly complicated..</p>","443009","","","","","2011-09-21 13:52:19","Android - Sequential audio playback?","<android><audio><media-player><sequential><soundpool>","1","0","","",""
"3674565","1","","","2010-09-09 07:26:52","4","1421","<p>Is it possible to communicate with the android RIL daemon using the android NDK ? I would like to get <em>notifications</em> from the RIL daemon or better i would like to grab the messages which are sent to the upper <em>Aplication Framework</em> and modify/filter them and after that transmit them to the upper layer.</p><p>I know there is a <strong>shared rilib</strong> and I know i can use it and access it functions using dlopen / dlsym ..but i have no idea if that would help me or not :) </p><p>Note: What i want to do is to filter messages from the RIL deamon about incoming calls from unvanted numbers (call blocking) </p><p>Also do you know any way (trick) how could I do call handling / call blocking in native code using android-ndk and the available libs ???</p><p>As always thanks for all your replies...</p>","1205130","","1448363","","2013-07-10 08:24:45","2013-07-10 08:24:45","Communicate with the android RIL daemon or Intercept Messages from the RIL android daemon","<android><android-ndk><ril>","1","0","2","",""
"3674605","1","","","2010-09-09 07:34:13","0","623","<p>Hai allI want to slowly fade out my main view Xml and go to another XML?</p><p>Please anyone give me an example with a sample code.please help.</p>","655814","","","","","2012-09-18 09:57:46","Slowly fade out my main view Xml and go to another XML","<android>","2","0","","",""
"3674646","1","3674694","","2010-09-09 07:41:15","4","3273","<p>I am trying to use custom font in android. I have written java code as given below.</p><pre><code>TextView txt = (TextView) findViewById(R.id.customfont);Typeface font = Typeface.createFromAsset(getAssets(), ""fonts/Molot.otf"");txt.setTypeface(font);</code></pre><p>where I have stored the custom font in ""./assets/fonts/"" folder.</p><p>But, I am getting nullpointerexception on the 3rd line.</p><p>Can anybody give me the solution for this issue? Thanks</p>","435025","","","","","2012-11-26 22:46:46","Custom Font Issue In Android","<android>","3","0","1","",""
"3674662","1","3674776","","2010-09-09 07:45:19","1","2462","<pre><code>public class Battery1 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);            }    @Override    protected void onResume() {        super.onResume();        IntentFilter filter = new IntentFilter();        filter.addAction(Intent.ACTION_BATTERY_CHANGED);        registerReceiver(mBroadcastReceiver, filter);    }    @Override    protected void onPause() {        super.onPause();        unregisterReceiver(mBroadcastReceiver);    }    private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            String action = intent.getAction();            if (action.equals(Intent.ACTION_BATTERY_CHANGED)) {                int status = intent.getIntExtra(""status"", 0);                int health = intent.getIntExtra(""health"", 0);                boolean present = intent.getBooleanExtra(""present"",false);                int level = intent.getIntExtra(""level"", 0);                int scale = intent.getIntExtra(""scale"", 0);                int icon_small = intent.getIntExtra(""icon-small"", 0);                int plugged = intent.getIntExtra(""plugged"", 0);                int voltage = intent.getIntExtra(""voltage"", 0);                int temperature = intent.getIntExtra(""temperature"",0);                String technology = intent.getStringExtra(""technology"");                String statusString = """";                switch (status) {                case BatteryManager.BATTERY_STATUS_UNKNOWN:                    statusString = ""unknown"";                    break;                case BatteryManager.BATTERY_STATUS_CHARGING:                    statusString = ""charging"";                    break;                case BatteryManager.BATTERY_STATUS_DISCHARGING:                    statusString = ""discharging"";                    break;                case BatteryManager.BATTERY_STATUS_NOT_CHARGING:                    statusString = ""not charging"";                    break;                case BatteryManager.BATTERY_STATUS_FULL:                    statusString = ""full"";                    break;                }                String healthString = """";                switch (health) {                case BatteryManager.BATTERY_HEALTH_UNKNOWN:                    healthString = ""unknown"";                    break;                case BatteryManager.BATTERY_HEALTH_GOOD:                    healthString = ""good"";                    break;                case BatteryManager.BATTERY_HEALTH_OVERHEAT:                    healthString = ""overheat"";                    break;                case BatteryManager.BATTERY_HEALTH_DEAD:                    healthString = ""dead"";                    break;                case BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE:                    healthString = ""voltage"";                    break;                case BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE:                    healthString = ""unspecified failure"";                    break;                }                String acString = """";                switch (plugged) {                case BatteryManager.BATTERY_PLUGGED_AC:                    acString = ""plugged ac"";                    break;                case BatteryManager.BATTERY_PLUGGED_USB:                    acString = ""plugged usb"";                    break;                }               Toast.makeText(context,                           ""status     :"" + statusString               +                       "";\nhealth     :"" + healthString               +                       "";\npresent    :"" + String.valueOf(present)    +                       "";\nlevel      :"" + String.valueOf(level)      +                       ""%;\nscale      :"" + String.valueOf(scale)      +                        "";\nicon_small :"" + String.valueOf(icon_small) +                       "";\nplugged    :"" + acString                   +                        "";\nvoltage    :"" + String.valueOf(voltage)    +                        "";\ntemperature:"" + String.valueOf(temperature)+                       "";\ntechnology :"" + technology, Toast.LENGTH_LONG).show();            }        }    };}</code></pre><p>i want to run this code to be running in background.and using socket communication between Android client and server PC. when ever i send the request for battery from server to client i have to display the battery information on client.please anyone guide me in correct path..what is the extra code i have to add for running it in back ground..or any correction is needed in this code..?</p>","399046","","","","","2010-09-09 08:04:01","How to run a task in background in android.?","<android>","2","0","1","",""
"3674825","1","3675453","","2010-09-09 08:10:05","3","2150","<p>I want to generate a low battery alert programmatically, same as that will be generated when battery is low..can any one post a sample code how to do it..am aware of ACTION_BATTERY_LOW. but how to use it..? i want to generate a low battery alert even though battery is not low.</p>","399046","","281545","","2013-09-23 15:04:45","2013-09-23 15:04:45","generate a low battery alert programmatically in Android","<android>","2","1","1","",""
"3674933","1","","","2010-09-09 08:26:18","4","8045","<p>Is there anyway to find out if a device is portrait or landscape by default? In that I mean how you normally use the device. </p><p>Most phones have a portrait screen for normal usage but is there some flag for finding that out?</p>","185433","","","","","2012-01-30 05:31:29","Find out if Android device is portrait or landscape for normal usage?","<android><default><landscape><portrait>","3","1","6","",""
"3674951","1","3680182","","2010-09-09 08:28:28","29","17072","<p>I have recently started working on Android. I want to know when and where adapters are used and how they are used. I didn't get much information from androids developer documentation.</p>","440432","","379693","","2010-09-09 10:03:37","2013-12-07 20:02:03","What's the role of adapters in Android?","<android><adapter><android-adapter>","6","0","10","",""
"3675045","1","3792681","","2010-09-09 08:44:57","7","4230","<p>I learned about the debug tool of ""ndk-gdb"" from Android NDK r4. Now I can start debugging the hello-jni sample(although some issue exists).</p><p>But, for my own Android applications, I have several so libs to use, build from a large number of c/c++ files. I used to build these so files with ndk-build, and then copy these so files under $PROJECT/libs directory, and it works fine without debugging. But now I want to debug one so lib with ndk-gdb. When I started ndk-gdb, it complains that no symbol table is loaded. </p><p>I also copy all these so files to $PROJECT/bin/ndk/local/armeabi(seems like the default directory where gdb tries to load symbol table). And still, it doesn't work.</p><p>Maybe ndk-gdb can't track my so files after I copy them? Or why it can't load any symbol tables, even after I copy them under $PROJECT/bin/ndk/local/armeabi?</p><p>Have anyone meet with this issue before?</p><p>Thanks a lot!</p>","429224","","429224","","2010-09-09 09:16:34","2010-09-25 05:56:07","ndk-gdb with multiple so libs","<android><gdb><android-ndk>","1","0","6","",""
"3675097","1","4485455","","2010-09-09 08:53:12","2","786","<p>What i have is a simple activity with some content inside of it. Right below that I have an admob ad. And it works great. </p><p>However, when i add <code>android:theme=""@android:style/Theme.Dialog""</code> to the activity in the manifest the activity still loads, the content loads, but then the ad will NOT load.</p><p>If i simply delete <code>android:theme=""@android:style/Theme.Dialog""</code> and view the activity as a regular activity it works fine again. But, I need this to work in a dialog :/ So, any ideas what I could do? Anyone have the same issue? </p><p>Maybe an admob bug? I just don't see why this isn't working</p>","393373","","","","","2011-03-05 19:26:35","Admob ad won't display in an dialog themed activity","<java><android><dialog><themes><admob>","1","0","1","",""
"3675195","1","","","2010-09-09 09:07:32","4","8256","<p><img src=""http://i.stack.imgur.com/PaiPc.png"" alt=""alt text""><br></p><p>Hi friends,<br></p><p>I am using <code>GridView</code> inside a  <code>ScrollView</code> for displaying images. In the GridView I have 16 images which were dynamically added, but the <code>ScrollView</code> does not display all 16 images (see screenshot). </p><p>I want the <code>ScrollView</code> to display the whole <code>GridView</code>, does anybody know  how I can fix this?</p><p>Thanks all.</p><p><strong>xml file:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge android:layout_width=""wrap_content"" android:layout_height=""340dip"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;LinearLayout  android:id=""@+id/LinearLayout01""   android:layout_width=""fill_parent""  android:layout_height=""320dip"" android:orientation=""vertical""  android:background=""@color/black""&gt; &lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/scrollview""            android:layout_width=""fill_parent""            android:layout_height=""500dip""            android:background=""#ffffff""            android:paddingTop=""10dip""            android:paddingLeft=""5dip""            android:layout_weight=""1""&gt; &lt;GridView                     android:id=""@+id/jr_lookbook_grid"" android:layout_width=""fill_parent""                    android:layout_height=""fill_parent"" android:numColumns=""4""                    android:verticalSpacing=""10dp"" android:horizontalSpacing=""10dp""                    android:columnWidth=""90dp"" android:stretchMode=""columnWidth""                    android:adjustViewBounds=""true""                    android:background=""@drawable/shape""                         android:gravity=""center""  android:layout_weight=""1""/&gt; &lt;/ScrollView&gt;                  &lt;Button  android:id=""@+id/click""                  android:background=""@android:color/transparent""                   android:text=""Load More Pictures...""                   android:textColor=""@color/white""                   android:layout_width=""fill_parent"" android:layout_height=""wrap_content""                   android:layout_centerVertical=""true""  /&gt;&lt;/LinearLayout&gt;  &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/LinearLayout02_img""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:layout_gravity=""center""    android:layout_alignParentBottom=""true""    android:background=""@color/black""                android:layout_alignParentLeft=""true""&gt;     &lt;WebView         android:id=""@+id/webview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""                 android:scrollbars=""none""      /&gt;    &lt;ImageView android:id=""@+id/ImageView01""     android:layout_gravity=""center_horizontal""    android:scaleType=""centerInside""    android:layout_width=""wrap_content""     android:layout_height=""fill_parent""    android:adjustViewBounds=""true""&gt;&lt;/ImageView&gt;    &lt;/LinearLayout&gt;   &lt;LinearLayout android:id=""@+id/LinearLayout02""     android:background=""#AA000000""          android:layout_width=""400px""        android:layout_height=""50dip""        android:layout_gravity=""bottom""                &gt;                            &lt;Button                android:id=""@+id/back""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""               android:background=""@drawable/back1""                android:layout_alignParentRight=""true""                android:layout_marginLeft=""10dip""              /&gt;                 &lt;Button                  android:background=""@drawable/forward5""                android:id=""@+id/next""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:gravity=""center""                android:layout_alignParentRight=""true""                android:layout_marginLeft=""215dip""                 /&gt;&lt;/LinearLayout&gt;&lt;/merge&gt;</code></pre>","410757","","1542891","","2014-02-28 15:05:37","2014-02-28 15:05:37","How to increase ScrollView height in Android?","<android><scrollview>","5","0","3","",""
"3675238","1","3675592","","2010-09-09 09:13:01","7","19902","<p>This is going to be a bit lame question. I have the following code:</p><pre><code>.............. public void onCreate (Bundle bundle) {  super.onCreate(bundle);  this.setContentView(R.layout.main2);  Button bnt = (Button) this.findViewById(R.id.browser);  bnt.setOnClickListener(new ButtonListener()); }..............class ButtonListener implements android.view.View.OnClickListener{ public void onClick(View v)  {  // I have a TextView in my xml layout file.   // I'd like to get it and change my text when I click this button.  // But I can't get it (the TextView) unless I make it as a value of a static member of this class and pass it to the constructor.   //I believe I am missing a big point here, so i'd be very thankful if you could explain how this is meant to be done ?  }}</code></pre><p>Any help is appreciated.</p>","346583","","","","","2011-07-20 19:25:03","Android::findViewByID - how can I get View of a TextView through a Listener of another UI element?","<android>","3","0","1","",""
"3675257","1","3675404","","2010-09-09 09:14:44","0","705","<p>I've got two android apps, one with a public void. How would the other app call this function?</p>","364727","","50846","","2010-09-09 09:16:33","2010-09-09 09:38:02","Android link to another package's function","<android><function><open><public><void>","1","0","0","",""
"3675335","1","","","2010-09-09 09:28:13","3","6348","<p>I am making an application which is a Twitter client. This means it connects to Twitter with OAuth. I register my application to Twitter and got all my keys, but now I do not have an idea how to connect my application with twitter. I have done some code mention below. Please help me out..</p><pre><code>Twitter twitter=new TwitterFactory().getInstance();twitter.setOAuthConsumer(Consumer key, Consumer secret);RequestToken requestToken = twitter.getOAuthRequestToken();AccessToken accessToken=null;Log.i(""Acces Token"",accessToken.getToken());     Log.i(""Acces Tokensec"",accessToken.getTokenSecret());</code></pre><p>Thanks in advance.</p>","439506","","50846","","2010-09-09 09:39:13","2013-03-18 10:00:11","How to Login twitter using Oauth from my android application?","<android><twitter><oauth>","3","1","3","",""
"3675375","1","","","2010-09-09 09:32:55","2","1074","<p>I am getting this error </p><pre><code>java.lang.NullPointerException at android.content.ContextWrapper.getPackageManager</code></pre><p>when am trying to get list of all installed applications on the device.</p><p>I have a server that starts when my application is started, and the client pings the server and asks to get a list of installed applications. The Server then asks the <code>getPackageManager()</code> and gets all the installed applications.But the <code>getPackageManager</code> throws a <code>NullPointerException</code>.</p><p>The Server is written in a java and is started from my android application.</p><p>Could someone please tell me what am missing and why I am getting this error?</p><p>Please find the code below</p><pre><code>public class ApplicationRecognition  extends Activity  {    // android.os.Debug.waitForDebugger();      Button buttonStart, buttonStop;    @Override      public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        buttonStart = (Button) findViewById(R.id.buttonStart);        buttonStop = (Button) findViewById(R.id.buttonStop);        final SecurityModuleServer server = new SecurityModuleServer(5902);        server.start();        Toast.makeText(this, ""Application Server is started"", Toast.LENGTH_SHORT).show();        buttonStart.setOnClickListener(new OnClickListener(){            public void onClick(View v) {                   startService(new Intent(getBaseContext(), AppReconService.class));            }});        buttonStop.setOnClickListener(new OnClickListener(){            public void onClick(View v) {                stopService(new Intent(getBaseContext(), AppReconService.class));            }});      }    public String[] getInstalledApplications()         {                 String[] appname =new String[10];                                   Intent mainIntent = new Intent(Intent.ACTION_MAIN,null);                 mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);                                   PackageManager manager = getPackageManager();                 List&lt;ResolveInfo&gt; pkgAppsList = manager.queryIntentActivities(mainIntent, 0);                 appname = new String[pkgAppsList.size()];                 for(int i=0;i&lt;pkgAppsList.size();i++)                 {                     appname[i]=pkgAppsList.get(i).activityInfo.packageName;                 }            return appname;        }</code></pre><p>}</p><p>the server side code public class SecurityModuleServer implements    Observer,Runnable{    private int numberOfConnectedClient;    private Thread serverThread;    private ServerSocket serverSocket;    private volatile boolean isServerRunning;</p><pre><code>public SecurityModuleServer(final int port){    numberOfConnectedClient = 0;            try             {                serverSocket = new ServerSocket(port);            } catch (IOException e) {                e.printStackTrace();            }}public void run(){    System.out.println(""SecurityModuleServer&gt;&gt; server thread started.""); //$NON-NLS-1$    while(isServerRunning)    {        numberOfConnectedClient++;        try        {                           SecurityModuleClientThread client = new SecurityModuleClientThread(serverSocket.accept(), numberOfConnectedClient);            client.addObserver(this);            client.start();        }        catch (IOException e)        {            e.printStackTrace();        }    }    System.out.println(""SecurityModuleServer&gt;&gt; server thread stopped.""); //$NON-NLS-1$}synchronized public void start(){    serverThread = new Thread(this);    isServerRunning = true;    serverThread.start();}synchronized public void stop(){    isServerRunning = false;}public boolean isRunning(){    return isServerRunning;}public static void main(String[] args){    SecurityModuleServer server = new SecurityModuleServer(5903);    server.start();}public void update(Observable o, Object arg){    numberOfConnectedClient--;}</code></pre><p>}</p><p>the client side code </p><pre><code>public SecurityModuleClientThread(Socket socket, int numberOfClient){    clientSocket = socket;    numberOfConnectedClient = numberOfClient;    try    {        printOut = new PrintStream(clientSocket.getOutputStream());        readerIn = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));        clientThread = new Thread(this);    }    catch (IOException e)    {        e.printStackTrace();    }}public void run(){    Looper.prepare();    String input = """"; //$NON-NLS-1$    System.out.println(""SecurityModuleClientThread&gt;&gt; thread started for client.""); //$NON-NLS-1$    if (numberOfConnectedClient &lt;= MAX_ALLOWED_CLIENTS)    {           printOut.println(CMD+Answer_Open_Connection+SEPARATOR+M002);                    while(isClientRunning)        {                try                {                     input = readerIn.readLine();                    System.out.println(""Message received&gt;&gt; ""+input); //$NON-NLS-1$                    parseInputMessage(input);                }                catch (IOException e)                {                    e.printStackTrace();                }        }    }    else    {           printOut.println(CMD+Error+SEPARATOR+M003);        stop();    }    System.out.println(""SecurityModuleClientThread&gt;&gt; thread stopped for client.""); //$NON-NLS-1$}private void parseInputMessage(final String input){        if (input.equalsIgnoreCase(CMD+Request_Close_Connection))        {            printOut.println(CMD+Answer_Close_Connection+SEPARATOR+M007);            stop();        }           else    {        String messages[] = input.split(SEPARATOR);        // Parse the command        switch(parseCommand(messages[0]))        {            case Request_Start_Application:                if(parseApplicationName(input) != null)                {                    if(startAndroidApplication(parseApplicationName(input)))                    {                        // TODO                        printOut.println(CMD+Answer_Start_Application);                        startAndroidApplication(parseApplicationName(input));                    }                    else                    {                        printOut.println(CMD+Error+SEPARATOR+M004);                    }                }                else                {                    printOut.println(CMD+Error+SEPARATOR+M004);                }                break;            case Request_Stop_Application:                if(parseApplicationName(input) != null)                {                    if (stopAndroidApplication(parseApplicationName(input)))                    {                        // TODO                        printOut.println(CMD+Answer_Stop_Application);                    }                    else                    {                        printOut.println(CMD+Error+SEPARATOR+M004);                    }                }                else                {                    printOut.println(CMD+Error+SEPARATOR+M004);                }                break;            case Request_Application_Installed:                String[] appnames = new String[provideInstalledApplication().length];                appnames = provideInstalledApplication();                for(int i=0;i&lt;appnames.length;i++)                {                    printOut.println(appnames[i]);                }                       break;            case Request_Application_Running:                //TODO                break;         default:             printOut.println(CMD+Error+SEPARATOR+M008);             break;        }    }}private int parseCommand(String cmd){    if (cmd.length() == 6)    {        return Integer.parseInt(cmd.substring(3, 6));    }    else    {        return 0;    }}private String parseApplicationName(String message){    if (message.length() &gt; 6)    {        // TODO        return message.substring(6, message.length());    }    else    {        return null;    }}public synchronized void  start(){    isClientRunning = true;    clientThread = new Thread(this);    clientThread.start();}public synchronized void stop(){    printOut.close();    try    {        readerIn.close();        clientSocket.close();    }    catch (IOException e)    {        e.printStackTrace();    }    finally    {        isClientRunning = false;        setChanged();        notifyObservers();    }}public boolean isRunning(){    return isClientRunning;}public String[] provideInstalledApplication(){     String[] appnames = null;     ApplicationRecognition apprecon = new ApplicationRecognition();     appnames=new String[apprecon.getInstalledApplications().length];     appnames = apprecon.getInstalledApplications();                 return appnames;}public String[] provideRunningApplication(){    // TODO Auto-generated method stub    return null;}public boolean startAndroidApplication(String applicationName){    // TODO Auto-generated method stub     ApplicationRecognition apprecon = new ApplicationRecognition();    apprecon.startApplication(applicationName);    return false;}public boolean stopAndroidApplication(String applicationName){    // TODO Auto-generated method stub    return false;}</code></pre><p>}</p><p>The main part that is giving me trouble is in ApplicationRecognition class under method <code>getInstalledApplications()</code> in getPackageManager is null.This method is called from the client side <code>SecurityModuleClientThread</code> class, <code>provideInstalledApplication</code> method.</p><p>Can someone please tell me where am I going wrong.</p>","415053","","592025","","2013-04-22 09:03:00","2013-04-22 09:03:00","java.lang.NullPointerException at android.content.ContextWrapper.getPackageManager","<android>","0","2","","",""
"3675523","1","3695416","","2010-09-09 09:55:41","5","775","<p>Is there a way I can access the data in Google Latitude to return the location of a fellow Latitude user?</p>","264276","","","","","2010-09-12 15:39:04","Android - how to get location of friend","<android><gps><location><google-latitude>","1","0","2","",""
"3675560","1","3675927","","2010-09-09 10:02:58","0","325","<p>I've got an app that retrieves data on a regular basis from the internet (3 times a week).</p><p>The data on the server is available via an XML api (which I built) and which works without any problem.</p><p>However, some of the users handsets are not on/connected when the call is made.</p><p>What is the best way to handle this lack of net connection failure?</p><p>Implement a net connection listener? Is this a bad idea?</p><p>I can always run the service at phone startup, but there are no guarantees that they will have a connection up and running at that point.</p><p>Slightly confused. Any help appreciated.</p>","417160","","","","","2010-09-09 11:06:18","android Service needs to handle connection failure - how?","<android><service><connection><listener>","1","0","","",""
"3675610","1","","","2010-09-09 10:10:32","8","2305","<p>What is a rendering engine? Is there any for Android?</p>","68571","","1065190","","2013-03-15 10:37:05","2013-04-01 08:11:40","Do you know a good android rendering engine?","<android><rendering-engine>","2","0","3","2013-07-25 11:55:13",""
"3675762","1","5279397","","2010-09-09 10:34:39","5","1964","<p>I'm writing an application with some embedded video content, it's Android 2.2 that I'm targetting. I need to show localized subtitles for the video content.</p><p>The video content can be mp4 or 3gp video, played from the SD card.</p><p>There are some third party video players out there that already support subtitles, but I haven't seen any open source ones I can bundle, or examine the code for.</p><p>So, are there any subtitle enabled controls or are there any open source video player projects which include subtitles?</p><p>What options are there for this scenario?</p>","29553","","29553","","2010-09-09 19:18:51","2011-03-14 03:32:56","Are subtitles supported in any of the native video controls?","<android><video><localization><subtitle>","2","1","3","",""
"3675952","1","4212296","","2010-09-09 11:11:07","1","478","<p>After trying out various combinations for the glBlendFunc, I've noticed that most of them have no effect on my phone (HTC Desire) while they work just fine in the emulator. On the phone, only 0+1, 1+0, 1+1 have any visible effect, while all other combinations seem to be ignored. Is this a hardware limitation?</p><p>P.S. I'm running my tests on Android 2.2, using Java.</p>","414251","","","","","2010-11-18 06:45:51","OpenGL ES glBlendFunc hardware reqs","<java><android><opengl-es>","2","0","1","",""
"3675975","1","","","2010-09-09 11:13:47","0","2658","<p>I am just learning and exercising @ Android, and I tried to make a TextView display the current time, meaning the TextView gets updated every second. Now I know there are probably loads of better ways - Calendar's, DigitalClocks and other widgets to do this properly, but as I said, I am merely training. </p><p>My problem is that my ""schedule"" is not working... or I so I believe. I have a simple XML layout. Here is my Java code:</p><pre><code>public void onClick(View v)  {  View parent = (View) v.getParent();  final Time tm = new Time();  final TextView tv = (TextView) parent.findViewById(R.id.tv);  Timer timer = new Timer();  TimerTask tt = new TimerTask() {   @Override   public void run() {    tm.setToNow();    tv.setText(time.hour + "":"" + time.minute + "":"" + time.second);   }  };  timer.scheduleAtFixedRate(tt, 0, 1000); }</code></pre>","346583","","346583","","2010-09-09 11:18:52","2010-09-09 13:27:10","Problem with Timer and schedule, Android","<android><timer>","1","0","","",""
"3675995","1","","","2010-09-09 11:16:39","0","3093","<p>How do i set the sound as ringtone with long press on the button?</p><p>At the moment it only works on sound4 but not sound5</p><p>package com.test.soundboard;</p><p>import java.io.File;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import android.view.ContextMenu.ContextMenuInfo;<br>import android.widget.Button;<br>import android.widget.Toast; import android.app.Activity;import android.content.ContentValues;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.provider.MediaStore;import android.view.ContextMenu;import android.view.MenuItem;import android.view.View;import android.view.View.OnClickListener;</p><p>public class SoundBoardTest extends Activity implements OnClickListener{</p><pre><code>private SoundManager mSoundManager;</code></pre><p>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    mSoundManager = new SoundManager();    mSoundManager.initSounds(getBaseContext());    mSoundManager.addSound(1, R.raw.sound4);    mSoundManager.addSound(2, R.raw.sound5);</code></pre><p>//BUTTONS PLAY SOUND WHEN PRESSED</p><pre><code>    View SoundButton4 = findViewById(R.id.SoundButton4);    SoundButton4.setOnClickListener(this);    View SoundButton5 = findViewById(R.id.SoundButton5);    SoundButton5.setOnClickListener(this);</code></pre><p>}</p><pre><code>        public void onClick(View v) {            switch (v.getId()) {            case R.id.SoundButton4:    mSoundManager.playSound(1);            break;        case R.id.SoundButton5:mSoundManager.playSound(2);            break;}</code></pre><p>//WHEN LONG PRESSED BUTTONS BRING UP CONTEXT MENU FOR SAVE AS RINGTONE OR NOTIFICATION</p><pre><code>    Button SoundButton4 = (Button) findViewById(R.id.SoundButton4);      registerForContextMenu(SoundButton4);      Button SoundButton5 = (Button) findViewById(R.id.SoundButton5);      registerForContextMenu(SoundButton5);  }  </code></pre><p>//CONTEXT MENU FOR BUTTON 1    @Override<br>    public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {<br>    super.onCreateContextMenu(menu, v, menuInfo);<br>        menu.setHeaderTitle(""Save as..."");<br>        menu.add(0, v.getId(), 0, ""Ringtone"");<br>        menu.add(0, v.getId(), 0, ""Notification"");<br>    }  </p><pre><code>@Override  public boolean onContextItemSelected(MenuItem item) {      if(item.getTitle()==""Ringtone""){function1(item.getItemId());}      else if(item.getTitle()==""Notification""){function2(item.getItemId());}      else {return false;}  return true;  }  public void function1(int id){     if (savering(R.raw.sound4)){          // Code if successful          Toast.makeText(this, ""Saved as Ringtone"", Toast.LENGTH_SHORT).show();        }          else          {          // Code if unsuccessful          Toast.makeText(this, ""Failed - Check your SDCard"", Toast.LENGTH_SHORT).show();        }}  public void function2(int id){      if (savering(R.raw.sound4)){          // Code if successful          Toast.makeText(this, ""Saved as Notification"", Toast.LENGTH_SHORT).show();        }          else          {          // Code if unsuccessful          Toast.makeText(this, ""Failed - Check your SDCard"", Toast.LENGTH_SHORT).show();        }       }</code></pre><p>public boolean savering(int ressound){<br>       byte[] buffer=null;<br>       InputStream fIn = getBaseContext().getResources().openRawResource(ressound);<br>       int size=0;  </p><pre><code>   try {      size = fIn.available();      buffer = new byte[size];      fIn.read(buffer);      fIn.close();     } catch (IOException e) {      // TODO Auto-generated catch block      return false;     }     String path=""/sdcard/media/audio/ringtones/"";     String filename=""soundtest4""+"".ogg"";     boolean exists = (new File(path)).exists();     if (!exists){new File(path).mkdirs();}     FileOutputStream save;     try {      save = new FileOutputStream(path+filename);      save.write(buffer);      save.flush();      save.close();     } catch (FileNotFoundException e) {      // TODO Auto-generated catch block      return false;     } catch (IOException e) {      // TODO Auto-generated catch block      return false;     }         sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse(""file://""+path+filename)));     File k = new File(path, filename);     ContentValues values = new ContentValues();     values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());     values.put(MediaStore.MediaColumns.TITLE, ""HahaSound"");     values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/ogg"");     values.put(MediaStore.Audio.Media.ARTIST, ""cssounds "");     values.put(MediaStore.Audio.Media.IS_RINGTONE, true);     values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);     values.put(MediaStore.Audio.Media.IS_ALARM, true);     values.put(MediaStore.Audio.Media.IS_MUSIC, false);     //Insert it into the database     this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);     return true;    }  </code></pre><p>}</p>","443333","","","","","2011-10-08 20:54:56","Android How to set a sound as ringtone with long press on button","<android>","1","0","","",""
"3676067","1","3676595","","2010-09-09 11:28:05","1","1368","<pre><code>public class Alarm extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Intent intent = new Intent(this, AlarmReceiver.class);        PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0,        intent, PendingIntent.FLAG_ONE_SHOT);        AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);        alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (10 * 1000), pendingIntent);        Toast.makeText(this, ""Alarm set"", Toast.LENGTH_LONG).show();    }}</code></pre><p>and </p><pre><code>public final class AlarmReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Toast.makeText(context, ""Alarm worked."", Toast.LENGTH_LONG).show();    }}</code></pre><p>After 10 secs am gettign toast as alarm worke..but no default sound ?how get the sound for alarm in android and instead of toas how can i display an dialog..?</p>","399046","","399046","","2010-09-11 07:45:50","2012-04-24 11:46:31","Alarm In Android","<android><alarmmanager>","2","0","","",""
"3676095","1","3936617","","2010-09-09 11:31:02","1","12925","<p>I have the following layout in my xml file:</p><pre><code>&lt;RelativeLayout android:layout_width=""fill_parent""                android:layout_height=""fill_parent""&gt;    &lt;FrameLayout android:id=""@+id/logoLayout""                   android:layout_width=""fill_parent""             android:layout_height=""wrap_content""&gt;          -- some images    &lt;/FrameLayout&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""                     android:layout_height=""wrap_content""                     android:gravity=""center""                     android:orientation=""vertical""                    android:layout_below=""@+id/logoLayout""&gt;               Button 1               Button 2               Button 3               Button 4    &lt;/RelativeLayout&gt;    &lt;RelativeLayout android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_margin=""5dip""            android:layout_alignParentBottom=""true""&gt;                 Button 5    &lt;/RelativeLayout&gt;&lt;RelativeLayout&gt;</code></pre><p>Maybe I didn't do it in the best way. What I want: have the Layout that contains the 4 buttons to use the entire space between the top and bottom layout, and I want to have the button equally arranged in the layout.</p><p>Something like this:<a href=""http://img16.imageshack.us/i/androidq.png/"" rel=""nofollow"">http://img16.imageshack.us/i/androidq.png/</a></p><p>I add the whole layout code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/background""&gt;    &lt;!--The header of the page--&gt;        &lt;FrameLayout android:id=""@+id/logoLayout""                      android:layout_width=""fill_parent""                     android:layout_height=""wrap_content""&gt;                     &lt;ImageView android:id=""@+id/logoBackground""                         android:src=""@drawable/logo_background_small""                        android:layout_width=""fill_parent""                         android:layout_height=""wrap_content""/&gt;             &lt;ImageView android:id=""@+id/logoImage""                         android:src=""@drawable/logo_small""                        android:layout_width=""wrap_content""                         android:layout_height=""wrap_content""                         android:layout_gravity=""left""                        android:gravity=""center""                        android:padding=""3dip""/&gt;               &lt;TextView android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:text=""@string/tracks""                       android:layout_gravity=""center""                       android:gravity=""right""                       android:textSize=""22dip""                       android:textColor=""#ffffff""                       android:padding=""3dip""&gt;             &lt;/TextView&gt;                      &lt;/FrameLayout&gt;        &lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""                         android:layout_width=""fill_parent""                          android:layout_height=""wrap_content""                          android:gravity=""center""                          android:orientation=""vertical""                         android:layout_below=""@+id/logoLayout""&gt;                             &lt;Button android:id=""@+id/btn1""                                    android:layout_height=""wrap_content""                                     android:layout_width=""250dip""                                     android:drawableLeft=""@drawable/img_small_btn_look_around""                                    android:background=""@drawable/main_long_menu_button""                                    android:text=""@string/btn1""                                     android:textSize=""18dip""                                    android:textColor=""#ffffff""                                    android:layout_marginTop=""20dip""                                    android:onClick=""btnMyTracksOnClick""&gt;                            &lt;/Button&gt;                             &lt;Button android:id=""@+id/btn2""                                    android:layout_height=""wrap_content""                                     android:layout_width=""250dip""                                     android:drawableLeft=""@drawable/img_small_btn_look_around""                                    android:background=""@drawable/main_long_menu_button""                                    android:text=""@string/btn2""                                     android:textSize=""18dip""                                    android:textColor=""#ffffff""                                    android:layout_marginTop=""20dip""                                    android:layout_below=""@+id/btn1""&gt;                            &lt;/Button&gt;                            &lt;Button android:id=""@+id/btn3""                                    android:layout_height=""wrap_content""                                     android:layout_width=""250dip""                                     android:drawableLeft=""@drawable/img_small_btn_look_around""                                    android:background=""@drawable/main_long_menu_button""                                    android:text=""@string/btn3""                                     android:textSize=""18dip""                                    android:textColor=""#ffffff""                                    android:layout_marginTop=""20dip""                                    android:layout_below=""@+id/btn2""&gt;                            &lt;/Button&gt;                            &lt;Button android:id=""@+id/btn4""                                    android:layout_height=""wrap_content""                                     android:layout_width=""250dip""                                     android:drawableLeft=""@drawable/img_small_btn_look_around""                                    android:background=""@drawable/main_long_menu_button""                                    android:text=""@string/btn4""                                     android:textSize=""18dip""                                    android:textColor=""#ffffff""                                    android:layout_marginTop=""20dip""                                    android:layout_below=""@+id/bt3""&gt;                            &lt;/Button&gt;        &lt;/RelativeLayout&gt;        &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                        android:orientation=""horizontal""                        android:layout_width=""fill_parent""                        android:layout_height=""wrap_content""                        android:layout_margin=""5dip""                        android:layout_alignParentBottom=""true""&gt;                        &lt;Button android:layout_width=""90dip""                                 android:layout_height=""wrap_content""                                android:textSize=""20dip""                                android:textColor=""#ffffff""                                android:layout_alignParentLeft=""true""                                android:background=""@drawable/sett_menu_button""                                android:text=""@string/back""                                 android:layout_marginLeft=""3dip""/&gt;          &lt;/RelativeLayout&gt;    &lt;/RelativeLayout&gt;</code></pre>","379865","","379865","","2010-09-09 15:36:18","2010-10-14 19:02:50","RelativeLayout height to fill remaining space","<android><relativelayout>","2","0","","",""
"3676136","1","","","2010-09-09 11:37:06","0","420","<p>I want to display an alert in the call screen when the user initiates a call.</p><p>Currently I have:</p><ul><li>A class MyAlert extends Activity to view and process the alert</li><li>A class CallReceiver extends BroadCastReceiver to process the call</li></ul><p>From CallReceiver, I launch the alert with startActivity on MyAlert. The problem is that the alert appears in my main activity, so we don't see it at the right time, but only if we open the app, which is totally useless.</p><p>If anyone has any ideas, it would help me a lot; I lost hope!</p>","442231","","496830","","2011-03-16 01:19:42","2011-03-16 01:19:42","Display AlertDialog from call screen in Android","<android><screen><alertdialog>","1","0","","",""
"3676153","1","","","2010-09-09 11:39:53","0","362","<p>Today, I placed our new app onto the market store. It can be found by most mobile phones - unfortunately, it cannot be detected by one specific model which is used by one of our customers. It is the Vodafone 845, with a small screen (240x320p) and low density (120 dpi). It's running with Android 2.1, updated version (i.e. SDK 7), and has all the necessary hardware (GPS, cam, and internet access), but, however, doesn't detect the app in the market.I have already tried anyDensity=""true"".The app is free, not copy protected, and open to all countries.I have the following settings in the manifest:</p><p><pre><code>  xmlns:android=""xxx""  package=""xxx""  android:versionCode=""10""  android:versionName=""1""&gt;  &lt;supports-screens      android:largeScreens=""true""      android:normalScreens=""true""      android:smallScreens=""true""           /&gt;  &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity       android:name="".CamaraView""      android:configChanges=""keyboardHidden|orientation""      android:screenOrientation=""landscape""      android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity    android:name="".ResultView""    android:configChanges=""orientation""    android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""    android:label=""@string/app_name""    /&gt;      &lt;/application&gt;</code></pre><p></p><p></p><p></p><p>Thanks for help.</p>","443299","","","","","2010-09-09 11:45:52","my app is not for all devices in market","<android><google-play>","1","1","","",""
"3676186","1","3676298","","2010-09-09 11:43:51","0","167","<p>i am currently working on anppication where i need to increment a counter depending on date. i mean i want to send 3 sms per day. How can in implement this feature.</p><p>Thanks in advance.</p>","307585","","","","","2010-09-09 11:58:56","Increment counter w.r.t date","<android><sms><counter>","1","0","","",""
"3676295","1","3677189","","2010-09-09 11:58:48","0","504","<p>Hallo,</p><p>I noticed that the keypress handling ('onKeyUp' etc) in the SDK LunarLander example is in the View class, whereas in the JetBoy example it is in the Activity class.Are there any advantages/disadvantages to either solution?</p><p>My own thoughts would be that it would be nicer to put all input handling (Key, Click &amp; Touch) into the Activity, as that doesn't do much.</p><ul><li>Frink</li></ul>","131209","","","","","2010-09-09 13:52:07","Android LunarLander and JetBoy Example Differences","<android>","1","0","","",""
"3676412","1","3676966","","2010-09-09 12:17:00","2","2083","<p>Can I query the Android Market for the latest version of my application in code? I would like to show an update notification for the user when a new version is available.</p><p>Related questions:</p><ul><li><a href=""http://stackoverflow.com/questions/2468449/process-in-updating-my-app-in-the-market"">http://stackoverflow.com/questions/2468449/process-in-updating-my-app-in-the-market</a></li><li><a href=""http://stackoverflow.com/questions/3057771/is-there-a-way-to-automatically-update-application-on-android"">http://stackoverflow.com/questions/3057771/is-there-a-way-to-automatically-update-application-on-android</a></li><li><a href=""http://stackoverflow.com/questions/2175945/android-market-application-updates"">http://stackoverflow.com/questions/2175945/android-market-application-updates</a></li></ul>","339052","","339052","","2010-09-09 12:25:43","2013-06-09 08:26:56","Querying latest application version from the Android Market","<android><google-play>","4","0","1","",""
"3676418","1","3677014","","2010-09-09 12:17:47","2","2986","<p>I have a Custom ListView with an imageview and 2 TextViews above each other next to the imageview. The bottom textView hold a description of the title, but it it cut off by the list.</p><p><a href=""http://tinypic.com/r/28tawrc/7"" rel=""nofollow"">http://tinypic.com/r/28tawrc/7</a> - what I get</p><p>this is what I have in my ""row.xml"":</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:gravity=""left|center"" android:minHeight=""?android:attr/listPreferredItemHeight""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;ImageView android:id=""@+id/icon"" android:layout_height=""50px""        android:layout_width=""50px"" android:minHeight=""?android:attr/listPreferredItemHeight""        android:scaleType=""fitXY"" android:layout_gravity=""center""&gt;&lt;/ImageView&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout01""        android:orientation=""vertical"" android:layout_marginLeft=""5dip""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:minHeight=""?android:attr/listPreferredItemHeight""        android:layout_weight=""1""&gt;        &lt;TextView android:id=""@+id/TextView01"" android:text=""hi""            android:textColor=""#336600"" android:textSize=""16dip""            android:layout_width=""fill_parent"" android:gravity=""center_vertical""            android:ellipsize=""marquee"" android:layout_weight=""1""            android:layout_height=""fill_parent""&gt;&lt;/TextView&gt;        &lt;TextView android:text=""hi"" android:id=""@+id/TextView02""            android:textColor=""#FFFFFF"" android:textSize=""14dip"" android:gravity=""top""            android:lines=""20"" android:layout_width=""fill_parent""            android:minHeight=""?android:attr/listPreferredItemHeight""            android:layout_height=""fill_parent"" android:layout_weight=""1""            android:singleLine=""false""&gt;&lt;/TextView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>How can I get the rest of the text to show?</p>","443376","","","","","2010-09-09 13:32:17","TextView in List is cut off","<android>","1","0","","",""
"3676455","1","3677057","","2010-09-09 12:23:19","1","399","<p>Hallo,</p><p>Is there a reason why the Thread class in the SDK LunarLander and JetBoy examples are not each in a separate java file, rather than being inside the View file?</p><p>It would make things a bit clearer, IMHO. Am I missing something?</p><ul><li>Frink</li></ul>","131209","","","","","2010-09-09 13:36:58","Android LunarLander and JetBoy Thread source","<android>","2","0","","",""
"3676484","1","3676577","","2010-09-09 12:26:41","0","800","<p>My scenario is like this:</p><pre><code>&lt;ScrollView        android:layout_width=""fill_parent""   android:layout_height=""fill_parent""         android:scrollbars=""vertical""           android:background=""#ffffeb""&gt;   &lt;LinearLayout       android:orientation=""vertical""      android:layout_width=""fill_parent""       android:layout_height=""fill_parent""      android:padding=""10dp""&gt;      // Other stuff in between here..      &lt;LinearLayout         android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:paddingLeft=""12dp""            android:paddingRight=""12dp""&gt;         &lt;Button             android:id=""@+id/insert_ad_ad_information_category_and_type_button""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_marginTop=""6dp""            android:text=""@string/insert_ad_ad_information_category_and_type_button""/&gt;         &lt;ListView            android:id=""@+id/insert_ad_ad_information_parameters_frame""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:background=""#ffffeb""            android:cacheColorHint=""#00000000""            android:divider=""#00000000""            android:dividerHeight=""0dp""            android:scrollbars=""none""            android:listSelector=""@android:color/transparent""/&gt;</code></pre><p>The problem I have is that I can't get my ListView to get the right height that I want. I'll add a couple of components with my custom BaseAdapter class and everything there works as intended. But when i then debug my application i can only see 1,5 out of 3 components in the list and the rest is hidden futher down in the ListView. But how can i make my ListView calculate how many components i have and get it to show all my components direcly without having too scroll down.</p><p>Another thought is if i could populate any other kind of View with my BaseAdapter? Because the only reason I'am using ListView is because of the setAdapter() method.</p><p>Appreciate all thoughts and comments :)</p>","395668","","395668","","2010-09-09 12:33:38","2011-02-10 07:13:47","Android ListView is not expanding as intended","<android><listview><adapter>","3","0","","",""
"3676492","1","3676820","","2010-09-09 12:27:40","2","139","<p>When developing J2EE web applications I would typically organise my package structure in the following way</p><p><code>com.jameselsey.&lt;applicationName&gt;.</code></p><ol><li><strong>Controller</strong> - Controllers/Actions go here</li><li><strong>Service</strong> - transactional service classes, called by Controllers</li><li><strong>Domain</strong> - My domain classes/objects that the application uses</li><li><strong>DAO</strong> - abstract DAO layer</li><li><strong>DAOImpl</strong> - implementing DAO layer, to make JPA/JDO/Hibernate switchable etc</li><li><strong>Utils</strong> - utility classes, anything generic I might want to use such as my own DateUtils etc</li></ol><p>This allows me to keep my classes organised in locations specific to their roles/tasks.</p><p>Is there an equivalent for Android? I haven't been able to find any guidelines as yet, I'm looking for an adopted standard of package heirarchy/structuring</p><p>Thanks</p>","155695","","","","","2010-09-09 13:11:54","Is/Are there any standard package structuring/heirarchy practices for Android?","<android><android-2.2-froyo><class-hierarchy><package-structuring>","1","0","1","",""
"3676637","1","","","2010-09-09 12:48:17","1","1387","<p>the image is stored in android sd card </p><p>I got the solution we need to specify   </p><pre><code> &lt;uses-permission android:name=""android.permission.SEND_SMS""/&gt;</code></pre><p>in manifest and the working code is: </p><pre><code>String _path = Environment.getExternalStorageDirectory() + ""/mapp/test.jpeg"";File file = new File( _path );Uri outputFileUri = Uri.fromFile( file );if(file.exists()){//final ConnectivityManager connMgr = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);//final int result = connMgr.startUsingNetworkFeature( ConnectivityManager.TYPE_MOBILE,Phone.FEATURE_ENABLE_MMS);    Toast.makeText(context,""exists"",Toast.LENGTH_LONG).show();    Intent sendIntent = new Intent(Intent.ACTION_SEND);    sendIntent.setType(""image/jpeg"");    sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {""abc@cde.com""});    sendIntent.putExtra(Intent.EXTRA_SUBJECT,""World Toyata(via Android App"");    sendIntent.putExtra(Intent.EXTRA_STREAM,outputFileUri);    sendIntent.putExtra(Intent.EXTRA_TEXT,""Problem Area Image"");    startActivity(Intent.createChooser(sendIntent, """"));}else{    Toast.makeText(context,""SD CARD Required "",Toast.LENGTH_LONG).show();}            }                   </code></pre>","400942","","100957","","2011-03-03 12:38:55","2011-03-08 13:56:28","sending email with attached pictures in android (solution)","<android><email><android-emulator><mms>","1","4","2","",""
"3676656","1","3677880","","2010-09-09 12:50:12","0","862","<p>I create a tabbed view with a list and a map, this is the code used to build the tab:</p><pre><code>tabHost = getTabHost();TabSpec tabSpec = tabHost.newTabSpec(""tab_map"");Intent i = new Intent().setClass(this, MyMapActivity.class);tabSpec.setIndicator(""Map"", getResources().getDrawable(android.R.drawable.ic_menu_mapmode)) .setContent(i);tabHost.addTab(tabSpec);</code></pre><p>now I need to access the <strong>MapView</strong> to set some <strong>Overlay</strong> on that map but if I try to do this:</p><pre><code>MapView mapView = (MapView) findViewById(R.id.myMap);</code></pre><p>the reference is always <strong>null</strong>, which is the right way? Thanks!!!</p><p>--Luca</p>","413820","","","","","2010-09-09 15:08:08","getting View reference from Intent","<android><maps><android-intent>","1","0","","",""
"3676742","1","3676800","","2010-09-09 13:02:27","2","2308","<p>Looking for games/physics engines to use for mobile game development.</p><ul><li>iPhone there is<a href=""http://www.cocos2d-iphone.org/"" rel=""nofollow"">Cocos2D</a></li><li>Android I've found<a href=""http://rokonandroid.com"" rel=""nofollow"">RokonAndroid</a></li></ul><p>Just wondering if there are any others (better ones) that anyone knows of? Or any that are more cross-compatible?</p><p>ThanksTom</p>","414972","","106224","","2010-09-09 13:11:08","2014-03-07 08:41:51","Best games/physics engines to use?","<iphone><android><physics>","5","1","3","",""
"3676890","1","","","2010-09-09 13:20:25","0","183","<p>how can i put appwidget on my view and let it updated itself??now,i can put the remoteviews on my activity,but it seems not update itself, how can i make it update itself?</p>","443407","","21234","","2010-09-09 13:26:23","2010-09-09 14:55:35","how can i put appwidget on my view and let it updated itself?","<android><appwidget>","1","2","","",""
"3676949","1","3677803","","2010-09-09 13:26:26","2","1167","<p>The <a href=""http://developer.android.com/reference/android/preference/PreferenceActivity.html"" rel=""nofollow"">documentation</a> for the PreferenceActivity states ""These preferences will automatically save to SharedPreferences as the user interacts with them."" That being the case, if I subclass PreferenceActivity, invoke <strong>addPreferencesFromResource</strong> in onCreate, set some preferences in the UI I would expect that any changes made to my preferences should automagically be saved; and when I return to my preference screen later all preferences should be restored.</p><p>The reason I'm asking is CheckBoxPreference is not behaving as expected, assuming my understanding is correct of course. I would expect if I have a CheckBoxPreference the users selection should be saved automatically upon change.  Is this not the case?</p><p>So can anyone please confirm my understanding or correct me if necessary?</p><p>I can create a custom preference screen where I handle all the changes in code but I'd prefer to use the recommended approach.  I 'm just wondering if there is a bug.</p><p>Suffice it to say I am a wee bit frustrated at the moment.</p><p>BTW I'm developing against v2.0 of the api.</p>","1466827","","1466827","","2010-09-09 13:31:42","2010-09-10 12:13:54","Preferences & CheckBoxPreference","<android><preferences><checkboxpreference>","2","0","","",""
"3676959","1","","","2010-09-09 13:26:52","10","1129","<p>Can I somehow detect if my app is running on HTC Sense?</p><p>More generally, the problem is, that I have a Button with custom drawable. It's something very similar to the account switcher in the top right of Gmail app. When pressed or focused, the button has orange highlight. But that doesn't look nice on HTC Sense - because the standard highlight color there is green.</p>","243225","","","","","2013-12-19 02:35:26","How to detect HTC Sense?","<android><android-ui>","6","0","3","",""
"3677187","1","","","2010-09-09 13:51:59","1","5060","<p>I have created Intent and I put data using <code>putExtra</code>method.</p><p>Now I want to put my <code>geoPointsArray</code>type variable to my intent object, here is type of geoPointsArray :</p><pre><code>List&lt;GeoPoint&gt; geoPointsArray = new ArrayList&lt;GeoPoint&gt;();</code></pre><p>In existing methods <code>putExtra</code>I can't find how to put my custom type.</p><p>Can someone help me with this?</p><p>Thanks</p>","432848","","","","","2012-02-06 15:38:19","Send ArrayList<GeoPoint> array in putExtra method","<android>","1","0","","",""
"3677229","1","","","2010-09-09 13:56:03","2","1486","<p>Is there anyway to find out the start time of an application?<code>ActivityManager</code> provides pids etc for each application process but doesn't tell for how long process is running.</p>","195802","","","","","2010-12-11 03:33:20","How to find out the running/start time of android application?","<android><process>","1","2","1","",""
"3677245","1","3677452","","2010-09-09 13:57:46","17","6453","<p>I have seen samples for Mercurial ignore files for <a href=""http://stackoverflow.com/questions/34784/mercurial-setup-for-visual-studio-2008-projects"">Visual Studio</a>, amongst others.</p><p>I've just started playing around with Android development, and I also use this time to experimenting with Mercurial. <strong>So my question is: does anyone have a good example of a <code>.hgignore</code> file to use for Eclipse and Android development?</strong></p><p>For starters I've got the following myself:</p><pre><code># use glob syntaxsyntax: glob# Ignore patterns.metadata\bin\gen\</code></pre><p>Are there any other ignore patterns that should be included? Should for instance the Eclipse files <code>.classpath</code> and <code>.project</code> be omitted from version control as well?</p><p><strong>-- Edit below --</strong></p><p>I haven't quite gotten the answers I hoped for yet, so I'll put out a bounty and try to specify a bit clearer what I'm looking for.</p><p>After experimenting a bit myself, I seem to have found that the suggested <code>.hgignore</code> listed above seems to be sufficient. The only addition I've made, is one line with <code>.settings</code> (this was a folder that appeared after I ran <em>Android Tools -> Fix Project Properties</em>). I've also found that (as mentioned by Ry4an) that the Eclipse files <code>.classpath</code> and <code>.project</code> should <em>not</em> be excluded.</p><p>I am however uncertain that this small ignore file will be sufficient when I get to projects a bit bigger than the basic tutorials (if it actually <em>is</em> all good, please explain why, and you'll get the credit). So to summarize what I'm looking for:</p><ul><li>I want a concrete example for a <code>.hgignore</code> file for an Android project under Eclipse</li><li>The ignore file should be so that whenever I check out a copy of the repository at a new location, it should work straight away (i.e. without having to mess with paths and references, add missing files etc.)</li><li>Please also explain <em>why</em> your include file looks like it does (I want to understand why certain files/directories are excluded (and why some definitely should be included))</li><li>If you include OS specific excludes, please also state so (I'm running on Windows 7 btw.)</li></ul>","310001","","310001","","2010-09-13 07:42:29","2012-09-12 00:25:47","Mercurial ignore-file for Eclipse and Android development","<android><eclipse><mercurial><hgignore>","4","2","10","",""
"3677293","1","6547081","","2010-09-09 14:01:46","5","1187","<p>I'm having problems with downloading binary file (zip file) in my app from te internet. I have to use basic access authentication to authorize acces to file, but server response is always HTTP/1.0 400 Bad request.</p><pre><code>String authentication = this._login+"":""+this._pass;String encoding = Base64.encodeToString(authentication.getBytes(), 0);            String fileName = ""data.zip"";URL url = new URL(""http://10.0.2.2/androidapp/data.zip""); HttpURLConnection ucon = (HttpURLConnection) url.openConnection();ucon.setRequestMethod(""GET"");ucon.setDoOutput(true);ucon.setRequestProperty (""Authorization"", ""Basic "" + encoding);ucon.connect();/* * Define InputStreams to read from the URLConnection. */InputStream is = ucon.getInputStream();BufferedInputStream bis = new BufferedInputStream(is);/* * Read bytes to the Buffer until there is nothing more to read(-1). */ByteArrayBuffer bab = new ByteArrayBuffer(50);int current = 0;while ((current = bis.read()) != -1) {    bab.append((byte) current);}bis.close();/* Convert the Bytes read to a String. */FileOutputStream fos = this._context.openFileOutput(fileName, this._context.MODE_WORLD_READABLE);fos.write(bab.toByteArray());fos.close();</code></pre><p>Could it be caused by whitespaces in password?</p>","396033","","","","","2011-07-01 11:00:20","Problem with basic access authentication in file downloader","<java><android><apache2>","1","0","","",""
"3677356","1","","","2010-09-09 14:08:20","0","3247","<p>I am having a problem trying to refresh a View in an Android application. I have a button that have a image and what I need to do is to change the image when someone clicked the button.</p><p>Where is the problem? The image don't refresh until the activity finished proccessing the code. Any idea how I can refresh the image as soon as It execute the instruction</p><pre><code>buttton1.setBackgroundDrawable(getResources().getDrawable(R.drawable.f1));</code></pre>","335518","","244296","","2010-09-09 14:28:19","2010-09-14 13:00:08","Android: Refresh view problem","<android><button><refresh>","3","2","","",""
"3677362","1","","","2010-09-09 14:08:55","0","287","<p>I have 7 to 8 buttons in my application.</p><p>Like this.<img src=""http://i.stack.imgur.com/4v9KN.jpg"" alt=""alt text""></p><p>How can I do this?I used:</p><pre><code>LinearLayout ll = (LinearLayout)findViewById(R.id.searchdialog_layout);ll.setOrientation(0);Button btn = new Button(context);btn.setBackgroundDrawable(getResources().getDrawable(R.drawable.bubble_layout));btn.setPadding(4,0, 4, 0);btn.setTextSize(14);btn.setTextColor(Color.BLACK);btn.setText(""bubble"" + "" x"");ll.addView(btn) ;</code></pre><p>But it didn't work.</p><p>Can anyone help?</p>","435025","","50846","","2010-09-09 14:27:30","2012-06-03 20:51:58","How to set buttons in Android?","<android>","1","2","","",""
"3677521","1","3989073","","2010-09-09 14:26:43","0","541","<p>I am using a ListView with a SimpleAdapter.  Once data is populated into it I would like to set the first item in the list.  This can be done by clicking on the list item on the screen.  I want to just call the method directly after I populate the list so that when you see the UI its already done.  My only problem is getting the View from the ListView.  I noticed its children are all null but the SimpleAdapter has items in it.  When I try to get those items they are not Views and I am not able to match the method call of</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id)</code></pre><p>because I cant get the right View.  Any help would be appreciated.</p>","441017","","","","","2010-10-21 15:24:09","Manual call to onListItemCLick","<android><view><adapter>","1","2","","",""
"3678030","1","4516983","","2010-09-09 15:26:27","1","784","<p>I am in the process of designing an application for android where the user can see a list of resources with short summary (e.g., title and date of an event) , and clicking on an item shows the details (e.g., event description, who is attending, etc). Currently I am exploring making a custom <code>ListView</code> and <code>LinearLayout</code> for this in Android, but styling elements looks a bit tedious.</p><p>I have read/noticed that many apps such as GMail and Twicca use webview for a large part of their UI. Since I have more HTML/CSS experience than I have Java UI experience, I am considering going that route. </p><p>Hence this set of (related questions)</p><ul><li>How do I enable loading of 'local' pages using URLs in the web view? [e.g., provide a hyperlink for the details page of an event as a url on the list page, which is loaded in the same webview, without accessing the internet]</li><li>Can I refer to a ""local"" CSS file to style my app?</li></ul><p>Thanks in advance for your answers (or links to good resources).<br>-A<br>P.S. I searched on this site, but I could only find fragments of this question.</p>","20386","","20386","","2010-09-10 09:32:34","2010-12-23 08:24:21","Designing a rich UI using Webview for a non-network-using Android application","<java><html><android><css><webview>","1","2","5","",""
"3678092","1","","","2010-09-09 15:34:41","6","6848","<p>I have app which reminds people to so their task. So there is one pending intent,now the user can delete the alram when he wants to. Ib this code there is just one pending intent for multiple user alarms so I am confused on cancelling that particular alarm where extras is <code>""pill""</code>. The remaining alarms should not be cancelled .I have no clue on this problem. Hope i am clear. Thanks </p><pre><code>Intent intent = new Intent(this, AlarmNotifyReceiver.class);intent.putExtra(""Name_pill"", ""pill"");sender = PendingIntent.getBroadcast(this,DatabaseConstants.NOTIFICATION_ID + 1, intent,PendingIntent.FLAG_UPDATE_CURRENT);AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);am.set(AlarmManager.RTC_WAKEUP,cal.getTimeInMillis(), sender);updateTheFlag(pillName[(pillName.length-1)]);</code></pre>","443571","","12707","","2010-09-09 15:36:00","2013-07-07 19:27:57","problem with cancel the alarm manager pending intent","<android>","5","1","1","",""
"3678253","1","","","2010-09-09 15:53:04","0","1414","<p>Hi I want to pass  complex data structures from my Service class to Activity class.</p><p>I create class Serializable :</p><pre><code>        class SaveMe implements Serializable {        private static final long serialVersionUID = 1L;        static final int test = 1234;        private int user;        private String name;        private double score;        public SaveMe() {}    }</code></pre><p>And I put it in Bundle </p><pre><code>Bundle bundle = new Bundle();bundle.putSerializable(""serializable"", new SaveMe());</code></pre><p>HOW can I send this information to Activity class ?</p><p>I try with this code :</p><pre><code>Intent mapIntent = new Intent(INTENT_MAP);     mapIntent.putExtras(bundle);</code></pre><p>And than I want to send to BroadcastReciver using:</p><pre><code> sendBroadcast(mapIntent);</code></pre><p>But I receive force error!</p><p>Should I use BroadcastReceiver to pass this data structure to my activity?</p><p>How to send to another activity?</p><p>Thanks</p>","432848","","","","","2012-06-27 01:49:36","Android: Pass complex data structures through activities or services","<android>","2","2","","",""
"3678458","1","3678780","","2010-09-09 16:18:45","8","7862","<p>I have a ViewFlipper with 3 children.</p><p>I want to be able to display any of these children initially. So for example, maybe I want the ViewFlipper to load initially with the 2nd child and not the 1st. </p><p>EDIT:I know I can use the getChildAt(int index) method.</p><p><strong>When a child in a ViewFlipper is shown, how can I get that child's index?</strong></p>","19875","","","","","2011-07-13 09:50:25","How can I programmatically display a ViewFlipper's second child?","<android><viewflipper>","2","0","","",""
"3678461","1","","","2010-09-09 16:19:06","1","342","<p>I have a for loop that dynamically creates imageviews and then i am assigning an onclicklistener to the imageviews, i have assigned these onclicklisteners but the event wont fire. why is this? Here is the code:</p><p>Note: BlockState is extended by the ImageView Class. The location to where the ImageViews (BlockState) are created is in the CreateLevelStorage Method(int level).</p><pre><code>package com.trik.pushover;import java.util.ArrayList;import android.content.Context;import android.util.AttributeSet;import android.util.Log;import android.view.*;import android.view.View.OnTouchListener;import android.widget.ImageView;import android.os.*;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Rect;import android.graphics.RectF;public class PushOverView extends SurfaceView implements SurfaceHolder.Callback{private PushOverThread _PushOverThread; /*private Levels _Level;*//*private final int _BlockHeight = 25;private final int _BlockWidth = 6;*/private ArrayList _ArrayList;private final int _BlockGap = 10;private Context _Context;public PushOverView(Context context, AttributeSet attrs){    super(context,attrs);    SurfaceHolder holder = this.getHolder();    holder.addCallback(this);    this._Context = context;    /*this._Level = new Levels(1,context);*/    this._PushOverThread = new PushOverThread(holder,context, new Handler(),this);}public void surfaceCreated(SurfaceHolder holder){    this.CreateLevelStorage(1);    this._PushOverThread.start();}public void surfaceChanged(SurfaceHolder holder, int format, int width, int height){}public void surfaceDestroyed(SurfaceHolder holder){}public void onDraw(Canvas canvas){    //super.onDraw(canvas);    this.DrawLevel1(canvas);}public void CreateLevelStorage(int level){    if(level == 1 &amp;&amp; this._ArrayList == null)    {    this._ArrayList = new ArrayList();    BlockState blockstate1 = new BlockState(this._Context,R.drawable.standard);    this._ArrayList.add(blockstate1);    blockstate1.setOnClickListener(btnDoneOnClick);    this._ArrayList.add(null);    BlockState blockState2 = new BlockState(this._Context,R.drawable.standard);    this._ArrayList.add(blockState2);    blockState2.setOnClickListener(btnDoneOnClick);    BlockState blockState3 = new BlockState(this._Context,R.drawable.standard);    this._ArrayList.add(blockState3);    blockState3.setOnClickListener(btnDoneOnClick);    this._ArrayList.add(null);    BlockState blockState4 = new BlockState(this._Context,R.drawable.standard);    this._ArrayList.add(blockState4);    blockState4.setOnClickListener(btnDoneOnClick);    BlockState blockState5 = new BlockState(this._Context,R.drawable.standard);    this._ArrayList.add(blockState5);    blockState5.setOnClickListener(btnDoneOnClick);    }}public void DrawLevel1(Canvas canvas){    Paint paint = new Paint();    paint.setStyle(Paint.Style.FILL);    paint.setColor(Color.BLUE);    int x = 50;    int y = 50;    int width = 100;    int height = 10;    canvas.drawRect(new RectF(50,y,50+x,y+height),paint);    for(int i = 0; i &lt; this._ArrayList.size(); i++)    {    if(this._ArrayList.get(i) != null)    {        BlockState blockState = (BlockState) this._ArrayList.get(i);        blockState.SetX(x);        blockState.SetY(y-blockState.GetImage().getHeight());        blockState.draw(canvas);        x += this._BlockGap + 6;    }    else    {        x += 6 + this._BlockGap;    }    }}private final OnClickListener btnDoneOnClick = new OnClickListener() {    public void onClick(View v) {    Log.d(""some_identifying_log_string"", ""Clicked"");      }};public class PushOverThread extends Thread{    private SurfaceHolder _Holder;    private Canvas _Canvas;    private Context _Context;    private PushOverView _PushOverView;    public PushOverThread(SurfaceHolder holder, Context context, Handler handler, PushOverView pushOverView)    {    this._Holder = holder;    this._Context = context;    this._PushOverView = pushOverView;    }    public void run()    {    while(true)    {        //Canvas c = null;        try        {        this._Canvas = this._Holder.lockCanvas(null);        this._PushOverView.onDraw(this._Canvas);        //doDraw(this._Canvas);        }        finally         {        if (this._Canvas != null)         {            this._Holder.unlockCanvasAndPost(this._Canvas);        }        }    }    }    /*public void doDraw(Canvas canvas)    {    //this._Level.doDraw();    }*/}}package com.trik.pushover;import com.trik.pushover.R;import android.widget.*;import android.content.Context;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Bitmap;import android.graphics.Matrix;import android.graphics.drawable.BitmapDrawable;import android.util.Log;import android.view.GestureDetector;import android.view.MotionEvent;import android.view.SurfaceHolder;import android.view.View;public class BlockState extends ImageView { private int _x; private int _y; private Context _Context; private int _Drawable; private Bitmap _Image; private boolean _RotateImage = false; public BlockState(Context context, int drawable) {  super(context);  this._Context = context;  this._Drawable = drawable;  this._Image = BitmapFactory.decodeResource(this._Context.getResources(), R.drawable.standard); } public void onDraw(Canvas canvas) {  super.onDraw(canvas); if(this._RotateImage) {   canvas.save();   canvas.rotate(60, this._x+6,this._y+25);   canvas.drawBitmap(this._Image, this._x, this._y, null);  canvas.restore(); } else {   canvas.drawBitmap(this._Image, this._x, this._y, null); } } public void SetRotateIamge(boolean isRotate) {  this._RotateImage = isRotate; } public void SetX(int x) {  this._x = x; } public void SetY(int y) {  this._y = y; } public Bitmap GetImage() {  return this._Image; }}</code></pre>","443626","","80714","","2010-09-10 09:06:20","2010-09-10 09:06:20","Why my dynamically created imageviews wont assign a click event","<java><android>","0","3","","",""
"3678472","1","3678789","","2010-09-09 16:20:13","2","1309","<p>I have a textview, I set it as clickable and focusable - how do I get it to highlight to orange (like a button) when the user focuses it with the trackwheel etc?:</p><pre><code>TextView tv = ...;tv.setClickable(true);tv.setFocusable(true);</code></pre><p>Thanks</p>","246114","","","","","2010-09-09 17:18:45","Make TextView turn orange when focused?","<android>","2","0","1","",""
"3678647","1","3678870","","2010-09-09 16:43:18","3","1086","<p>Using this library, <a href=""http://code.google.com/p/zxing/"" rel=""nofollow"">ZXing</a>, we have a project at school in which we'll implement a inventory system using Android phones.</p><p>We aim to use an Android phone to be a inexpensive replacement to this:</p><p><img src=""http://i.stack.imgur.com/LD8DR.jpg"" alt=""Scanner... thing""></p><p>I've read some of the warnings on the FAQ for certain phones. <strong>Is there a specific phone that Android developers prefer</strong> (with use of the ZXing library in mind)? We have to buy the phone ourselves, so we would prefer not to buy the wrong phone!</p>","269694","","","","","2010-12-22 00:32:41","Preferred Developer Android Phone for using the ZXing library","<android><camera><barcode><zxing>","3","0","0","",""
"3678707","1","","","2010-09-09 16:50:31","0","223","<p>I need to use Cygwin to compile C++ code for an Android project.  I'm having trouble compiling even a basic ""hello world"" program.  The console gives me this message:</p><p>/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: unrecognized -a option `ware'</p><p>I've googled the error and the only result I've found was an issue with one of the programs (I think it was binutils) being out of date, and was resolved when that program was updated.  I downloaded the entirety of the Cygwin package at once, so I don't think that's the problem.  The compiler and linker aren't communicating properly.  How do I fix it without changing compilers?</p>","443643","","","","","2010-09-20 22:16:42","Link error using Cygwin toolchain","<c++><android><cygwin>","1","2","","",""
"3678733","1","","","2010-09-09 16:53:26","0","387","<p>I have two drawables that are used as backgrounds to indicate state (pressed or selected) of my list items.  The Pressed drawable is a selector, but with no state specified; it is wired up via XML to be the android:listSelector for the list.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item        android:drawable=""@drawable/my_actual_drawable"" /&gt;&lt;/selector&gt;</code></pre><p>The Selected drawable, however, is applied by code, because it's complicated and more than one simple background drawable change needs to happen when an item is selected.</p><p>If I click very quickly between two list items, one item can have (and keep) the Selected highlight while a different item has (and keeps) the Pressed highlight.  I believe this is because the press happens so quickly that it is not interpreted by the underlying framework as a click, so no <code>onItemClick</code> reaches my list.</p><p>One solution is to use the selector with state (that's what selectors are for!):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true""        android:drawable=""@drawable/my_actual_drawable"" /&gt;&lt;/selector&gt;</code></pre><p>but this has the unfortunate effect of turning off the Pressed highlight before my code can apply the Selected highlight, so there is a flash of unhighlightedness between the two states, no matter how early in the <code>onItemClick</code> handler I put the <code>setBackgroundResource</code> call.</p><p>Another solution would be to monitor not only <code>onItemClick</code> events, but also <code>onTouch</code> events, and handle everything in code; that appears to make things too slow.</p><p>What can I do to avoid both the flash and the double-selection state?</p>","82118","","","","","2010-09-10 01:39:30","Avoiding highlight flash in Android","<android><background><drawable>","1","0","1","",""
"3678959","1","","","2010-09-09 17:23:45","2","2481","<p>I've been trying to make a test case extending  intstrumentationtestcase, and whenever I call getinstrumentation() it returns a null instance of Instrumentation instead of an Instrumentation, rendering any of the automation I'm wanting to do useless. I have the permission set in the manifest as well even though I'm only testing the automation on the same app this case is going to run on...any ideas?</p>","443675","","918414","","2012-06-30 04:09:15","2012-06-30 04:09:15","android instrumentation test case - getinstrumentation() returning null","<android><instrumentation>","1","0","0","",""
"3679120","1","3679137","","2010-09-09 17:45:31","2","1780","<p>Is there a unique ID that is given to Android handests that is available through the SDK? </p><p>I want to provide a web-service with actions that can only be performed once per resource per user.  Maybe there is a different way to go about this. Any ideas?</p>","13688","","","","","2010-09-09 18:07:08","Uniquely Identify an Android Handset","<android>","2","0","3","",""
"3679127","1","","","2010-09-09 17:46:09","2","624","<p>Hello I want to log application activity information on my android phone, I just need 2 things, the start time of the application and the end time of the application.</p><p>I just want to know for how much time a particular application/activity was running. </p><p>Say for example a user launched music player and after some time closed it? I just want to know how long the music player opened, or if he is talking on phone how long that activity to took after finishing?</p><p>My application will run as service, logging all this information is sqlLite. Once my application started it should log all the above information for each activity triggered there after.</p><p>Please let me know how can i do this??</p><p>I know about logcat but i want to know how they log this things or how can i code something similar??</p><p>ThanksPranay</p>","443694","","","","","2010-09-09 17:46:09","How to log each application activity in android?","<android>","0","0","1","",""
"3679330","1","","","2010-09-09 18:11:55","4","5372","<p>I'm writing a live wallpaper that creates an effect over a background.  I want the user to be able to choose the background from any of the system wallpapers and camera photos.  What I would like is for the user to be able to press a button in the Settings menu, have the list of options show up just like setting the wallpaper from the home screen, minus the Live Wallpapers options.  Once the user navigates the choices and picks an actually image I would load it to my canvas.</p><p>How do I do this?</p><p>I can't find an API anywhere for getting a list of wallpapers.</p><p>I've been able to come up with a list of wallpaper providers using Intents.  I then get a list of live wallpaper providers also using Intents and remove those from my first list.  The gives me a list of wallpaper providers that are not live.</p><p>Now what?  Are there other ways to do this that I'm missing?</p><p>Please help.</p>","24854","","19750","","2011-03-30 21:53:15","2012-12-06 00:33:13","Choosing background for Live Wallpaper","<android><live-wallpaper>","2","0","13","",""
"3679379","1","3679745","","2010-09-09 18:19:09","5","5414","<p>I am using the following class to connect to my web service. I would like to make this asynchronous. How can I do this?</p><pre><code>package org.stocktwits.helper;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.DefaultHttpClient;import org.json.JSONException;import org.json.JSONObject;import android.util.Log;public class RestClient{    private static String convertStreamToString(InputStream is) {        /*         * To convert the InputStream to String we use the BufferedReader.readLine()         * method. We iterate until the BufferedReader return null which means         * there's no more data to read. Each line will appended to a StringBuilder         * and returned as String.         */        BufferedReader reader = new BufferedReader(new InputStreamReader(is));        StringBuilder sb = new StringBuilder();        String line = null;        try {            while ((line = reader.readLine()) != null) {                sb.append(line + ""\n"");            }        } catch (IOException e) {            e.printStackTrace();        } finally {            try {                is.close();            } catch (IOException e) {                e.printStackTrace();            }        }        return sb.toString();    }    /* This is a test function which will connects to a given     * rest service and prints it's response to Android Log with     * labels ""Praeda"".     */    public static JSONObject connect(String url)    {        HttpClient httpclient = new DefaultHttpClient();        // Prepare a request object        HttpGet httpget = new HttpGet(url);         // Execute the request        HttpResponse response;        try {            response = httpclient.execute(httpget);            // Examine the response status            Log.i(""Praeda"",response.getStatusLine().toString());            // Get hold of the response entity            HttpEntity entity = response.getEntity();            if (entity != null) {                // A Simple JSON Response Read                InputStream instream = entity.getContent();                String result= convertStreamToString(instream);                // A Simple JSONObject Creation                JSONObject json=new JSONObject(result);                // Closing the input stream will trigger connection release                instream.close();                return json;            }        } catch (ClientProtocolException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (JSONException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return null;    }}</code></pre>","19875","","19875","","2010-09-09 19:00:03","2013-09-04 06:00:51","How can I make asynchronous URL connections on Android?","<java><android><asynchronous><android-asynctask>","2","1","","",""
"3679432","1","20830973","","2010-09-09 18:26:02","5","2911","<p>Is it possible to add drawables to the <em>positive</em>, <em>negative</em> and <em>neutral</em> buttons of an AlertDialog? If yes, then how?</p>","421372","","","","","2014-03-22 18:48:03","Images for AlertDialog buttons","<android><user-interface><controls>","6","0","","",""
"3679461","1","3680823","","2010-09-09 18:29:07","2","173","<p>It seems as if every Android application I really want to make is impossible to make with the current SDK.  It doesn't give me access to certain things I would like to work with.  <a href=""http://stackoverflow.com/questions/3571814/accessing-the-android-media-stream-for-audio-visualization"">This</a> is an example of one of these things.</p><p>I know it is possible since I've seen apps in the market that do things that the SDK cannot do.  My basic question is can someone point me in the direction of how to create such an application.  I've searched around, but all of the links I've found are for developing with the SDK.  A simple link to a tutorial that can show me how to access Android elements that aren't available through the SDK would be great.</p><p>Thanks.</p>","302118","","","","","2010-09-09 21:49:03","Developing Android outside of the SDK","<java><android>","1","5","","",""
"3679625","1","3679748","","2010-09-09 18:49:34","3","2397","<p>To keep it simple I am using a hard coded key and IV for now.AesWriter (below) encrypts and writes the original plaintext, <code>Abc\t1234\t\t\t\t\n</code>, to a file as <code>11,87,-74,122,-127,48,-118,39,82,-83,68,-30,-84</code>.But AesReader (also below) decrypts the contents of the file consistently as <code>zW?D?4?rc?~???~?_=p?J</code>. Any ideas where I am going wrong?</p><pre><code>public class AesWriter extends Activity {    ...    private void writeConfig() {        ...        try {            Cipher cipher = Cipher.getInstance(AesReader.AES_ALGORITHM,                     AesReader.PROVIDER);            cipher.init(Cipher.ENCRYPT_MODE, AesReader.getSecretKeySpec(),                    AesReader.getIvParameterSpec());             byte[] encrypted = cipher.doFinal(config.getBytes());            OutputStreamWriter out =                new OutputStreamWriter(openFileOutput(fileName, 0));            out.write(AesReader.asHex(encrypted));            out.close();            ...public class AesReader extends Activity {    public static final String AES_ALGORITHM = ""AES/CTR/NoPadding"";    public static final String PROVIDER = ""BC"";     private static final byte[] aesKey128 = { // Hard coded for now        78, -90, 42, 70, -5, 20, -114, 103,         -99, -25, 76, 95, -85, 94, 57, 54};    private static final byte[] ivBytes = { // Hard coded for now        -85, -67, -5, 88, 28, 49, 49, 85,         114, 83, -40, 119, -65, 91, 76, 108};    private static final SecretKeySpec secretKeySpec =         new SecretKeySpec(aesKey128, ""AES"");    private static final IvParameterSpec ivSpec =         new IvParameterSpec(ivBytes);        ...    private void readConfig() {        String fileName = configuration.getFileName();        try {            InputStream is = openFileInput(fileName);            Cipher cipher = Cipher.getInstance(AES_ALGORITHM, PROVIDER);            cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivSpec);            CipherInputStream cis = new CipherInputStream(is, cipher);            InputStreamReader isr = new InputStreamReader(cis);            BufferedReader reader = new BufferedReader(isr);            String s;            while ((s = reader.readLine()) != null) {                configuration.modify(s);            }            is.close();            ...    public static SecretKeySpec getSecretKeySpec() {        return secretKeySpec;    }    public static IvParameterSpec getIvParameterSpec() {        return ivSpec;    }    public static String asHex(byte buf[]) {        StringBuffer strbuf = new StringBuffer(buf.length * 2);        int i;        for (i = 0; i &lt; buf.length; i++) {            if (((int) buf[i] &amp; 0xff) &lt; 0x10) {                strbuf.append(""0"");            }            strbuf.append(Long.toString((int) buf[i] &amp; 0xff, 16));        }        return strbuf.toString();    }</code></pre><p>Working code based on suggestion by erickson:</p><pre><code>public class FileIO {    public final static String EOL = ""\n"";    public static final String AES_ALGORITHM = ""AES/CTR/NoPadding"";    public static final String PROVIDER = ""BC"";     private static final byte[] AES_KEY_128 = { // Hard coded for now        78, -90, 42, 70, -5, 20, -114, 103,         -99, -25, 76, 95, -85, 94, 57, 54};    private static final byte[] IV = { // Hard coded for now        -85, -67, -5, 88, 28, 49, 49, 85,         114, 83, -40, 119, -65, 91, 76, 108};    private static final SecretKeySpec secretKeySpec =         new SecretKeySpec(AES_KEY_128, ""AES"");    private static final IvParameterSpec ivSpec =         new IvParameterSpec(IV);    public String readAesFile(Context c, String fileName) {        StringBuilder stringBuilder = new StringBuilder();        try {            InputStream is = c.openFileInput(fileName);            Cipher cipher = Cipher.getInstance(AES_ALGORITHM, PROVIDER);            cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, ivSpec);            CipherInputStream cis = new CipherInputStream(is, cipher);            InputStreamReader isr = new InputStreamReader(cis);            BufferedReader reader = new BufferedReader(isr);            String line;            while ((line = reader.readLine()) != null) {                stringBuilder.append(line).append(EOL);            }            is.close();        } catch (java.io.FileNotFoundException e) {            // OK, file probably not created yet            Log.i(this.getClass().toString(), e.getMessage(), e);        } catch (Exception e) {            Log.e(this.getClass().toString(), e.getMessage(), e);        }        return stringBuilder.toString();    }    public void writeAesFile(Context c, String fileName, String theFile) {        try {            Cipher cipher = Cipher.getInstance(AES_ALGORITHM, PROVIDER);             cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivSpec);            byte[] encrypted = cipher.doFinal(theFile.getBytes());             OutputStream os = c.openFileOutput(fileName, 0);            os.write(encrypted);            os.flush();            os.close();        } catch (Exception e) {            Log.e(this.getClass().toString(), e.getMessage(), e);        }    }}</code></pre>","398460","","398460","","2010-09-10 12:41:11","2010-09-10 12:41:11","Why is AES/CTR/NoPadding broken?","<java><android><aes>","1","0","","",""
"3679664","1","3681831","","2010-09-09 18:55:21","9","6553","<p>We're designing an Android app that has a lot of data (""customers"", ""products"", ""orders""...), and we don't want to query sqlite every time we need some record. We wanna avoid to query database as most as we can, so we decided to keep certain data allways in memory.</p><p>Our initial idea is to create 2 simple classes:</p><ol><li><p>""MemoryRecord"": a class that will contain basically an array of objects (string/int/double/datetime/etc...), that are the data from a table record, and all methods to get those data in/out from this array.</p></li><li><p>""MemoryTable"": a class that will contain basically a Map of [Key,MemoryRecord] and all methods to manipulate this Map and insert/update/delete record into/from database.</p></li></ol><p>Those classes will be derived to every kind of table we have in database. Of course that there are other usefull methods not listed above, but they are not important at this point.  </p><p>So, when starting app, we will load those tables from SQLite database to memory using those classes, and every time we need to change some data, we will change in memory and post it into database right after.</p><p>But, we want some help/advice from you. Can you suggest something more simple or efficient to implement such thing? Or maybe some existing classes that already do it for us?</p><p>Thanks in advance.</p><p><strong>Update:</strong></p><p>I understand what you guys are trying to show me, and I thank you for that. </p><p>But, let's say we have a table with 2000 records, and I will to list those records. For each one, I have to query other 30 tables (some of them with 1000 records, others with 10 records) to add additional info in the list, and this while it's ""flying"" (and as you know , we must be very fast at this momment).</p><p>Now you'll gonna say: ""just build your main query with all those 'joins', and bring all you need in one step. SQLite can be very fast, if your database is well designed, etc..."". </p><p>OK, but this query will become very complicated and sure, even SQLite be very fast, it will be ""too"" slow (2 a 4 seconds, as I confirmed, and this isn't a acceptable time for us). </p><p>Another complicator is that, depending of user interaction, we need to ""re-query"" all records, because the tables involved are not the same, and we have to ""re-join"" with another set of tables.</p><p>So, an alternative is bring only the main records (this will never change, no matter what user does or wants) with no join (this is very fast!) and query the others tables every time we want some data. Note that on the table with 10 records only, we will fetch the same records many and many times. In this case, it is a wast of time, because no matter fast sqlite be, it will allways be more expensive to query/cursor/fetch/etc... than just grab the record from a kind of ""memory cache"". I want to make clear that we don't plan to keep all data in memory allways, just some tables we query very offten. </p><p>And we came to the original question: what is the best way to ""cache"" those records. I really like to focus the discussion on that and not ""why do you need to cache data?""  </p><p>Thanks again.</p>","112670","","112670","","2010-09-10 13:56:05","2011-09-09 22:17:15","Android: Best practice for keeping data in Memory and Database at same time","<android><performance><memcached><architecture><design-guidelines>","2","5","7","",""
"3679728","1","3680671","","2010-09-09 19:05:10","0","807","<p>I have a TextView with location data that I want to Linkify. When link will be clicked an Intent should be fired that will start Maps. How should I achieve this effect?</p><p>UPDATE:</p><p>I have something like ""My street 9, My city"". Now I want to have all this text to appear like a link and have intent fired with URI: <code>geo:0,0?q=My+street+9,+My+city</code></p><p>Using just <code>Linkify.ALL</code> doesn't work.</p>","296427","","296427","","2010-09-23 12:46:07","2010-09-23 12:46:07","Linkify custom location in textView?","<android><google-maps><geolocation><textview><android-intent>","1","0","","",""
"3679936","1","","","2010-09-09 19:32:44","1","240","<p>I am trying to catch media key event from a headphones that have media controls. I registered a BroadcastReceiver for the MEDIA_BUTTON intent. This code generally works on devices that doesn't have the default android music player, I could catch all the MEDIA_BUTTON intents on my Sony X10. It doesn't work on my friend's HTC, it seems I could never receive any of the intents.</p><p>I know in 2.2 there is a new API, registerMediaButtonReceiver but I don't have access to 2.2.</p><p>Please help!</p>","410951","","","","","2010-09-09 19:32:44","Catching MEDIA_BUTTON intent on pre-2.2 OS","<android><music>","0","0","2","",""
"3680211","1","","","2010-09-09 20:10:35","14","9110","<p>Is there any way to define a top and bottom stroke for a gradient, or create a compound shape drawable?:</p><pre><code>// option1:&lt;shape  xmlns:android=""http://schemas.android.com/apk/res/android""  android:shape=""rectangle""&gt;  &lt;gradient    android:startColor=""#f00""    android:endColor=""#0f0""    /&gt;  &lt;stroke    top=1dip, yellow    bottom=1dip, purple    /&gt;&lt;/shape&gt;// option2&lt;shape  xmlns:android=""http://schemas.android.com/apk/res/android""  android:shape=""rectangle""&gt;  &lt;shape    android:shape=""rectangle""    height=1dip, color=yellow /&gt;  &lt;gradient    android:startColor=""#f00""    android:endColor=""#0f0""    /&gt;  &lt;shape    android:shape=""rectangle""    height=1dip, color=purple /&gt;&lt;/shape&gt;</code></pre><p>I don't think either are possible?</p><p>Thanks</p>","246114","","","","","2013-07-29 12:02:30","Rectangle shape drawable, specify top and bottom stroke colors?","<android>","3","1","1","",""
"3680357","1","4974585","","2010-09-09 20:34:38","27","27740","<p>I'm trying to provide an in-app Activity which displays thumbnails of photos in thedevice's media store, and allow the user to select one.  After the user makes aselection, the application reads the original full-size image and does things with it.</p><p>I'm using the following code to create a <code>Cursor</code> over all the images on the externalstorage:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView( R.layout.image_select );    mGridView = (GridView) findViewById( R.id.image_select_grid );    // Query for all images on external storage    String[] projection = { MediaStore.Images.Media._ID };    String selection = """";    String [] selectionArgs = null;    mImageCursor = managedQuery( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,                                 projection, selection, selectionArgs, null );    // Initialize an adapter to display images in grid    if ( mImageCursor != null ) {        mImageCursor.moveToFirst();        mAdapter = new LazyCursorAdapter(this, mImageCursor, R.drawable.image_select_default);        mGridView.setAdapter( mAdapter );    } else {        Log.i(TAG, ""System media store is empty."");    }}</code></pre><p>And the following code to load the thumbnail image (Android 2.x code is shown):</p><pre><code>// ...// Build URI to the main image from the cursorint imageID = cursor.getInt( cursor.getColumnIndex(MediaStore.Images.Media._ID) );Uri uri = Uri.withAppendedPath( MediaStore.Images.Media.EXTERNAL_CONTENT_URI,                                Integer.toString(imageID) );loadThumbnailImage( uri.toString() );// ...protected Bitmap loadThumbnailImage( String url ) {    // Get original image ID    int originalImageId = Integer.parseInt(url.substring(url.lastIndexOf(""/"") + 1, url.length()));    // Get (or create upon demand) the micro thumbnail for the original image.    return MediaStore.Images.Thumbnails.getThumbnail(mContext.getContentResolver(),                        originalImageId, MediaStore.Images.Thumbnails.MICRO_KIND, null);}</code></pre><p>And the following code to load the original image from the URL once the user makes a selection:</p><pre><code>public Bitmap loadFullImage( Context context, Uri photoUri  ) {    Cursor photoCursor = null;    try {        // Attempt to fetch asset filename for image        String[] projection = { MediaStore.Images.Media.DATA };        photoCursor = context.getContentResolver().query( photoUri,                                                     projection, null, null, null );        if ( photoCursor != null &amp;&amp; photoCursor.getCount() == 1 ) {            photoCursor.moveToFirst();            String photoFilePath = photoCursor.getString(                photoCursor.getColumnIndex(MediaStore.Images.Media.DATA) );            // Load image from path            return BitmapFactory.decodeFile( photoFilePath, null );        }    } finally {        if ( photoCursor != null ) {            photoCursor.close();        }    }    return null;}</code></pre><p>The problem I'm seeing on some Android devices, including my own personal phone, is that thecursor I get from the query in <code>onCreate()</code> contains a few entries for which the actual full-sized image file (JPG or PNG) is missing. (In the case of my phone, the images had been imported and subsequently erased by iPhoto).</p><p>The orphaned entries may or may not have thumbnails, depending upon whether thumbnails where generated before the actual media file when AWOL.  The end result is that the app displays thumbnails for images that don't actually exist.</p><p>I have a few questions:</p><ol><li>Is there a query I can make to the <code>MediaStore</code> content provider that will filter outimages with missing media in the returned <code>Cursor</code>?</li><li>Is there a means, or an API to force the <code>MediaStore</code> to rescan, and eliminate the orphan entries? On my phone, I USB-mounted then unmounted the external media, which is supposed to trigger a rescan. But the orphan entries remain.</li><li>Or is there something fundamentally wrong with my approach that's causing this problem?</li></ol><p>Thanks.</p>","384831","","384831","","2010-09-09 20:41:37","2011-08-25 08:33:01","How to query Android MediaStore Content Provider, avoiding orphaned images?","<android><image><media><android-contentprovider>","2","0","22","",""
"3680391","1","3680550","","2010-09-09 20:38:29","2","995","<p>I'm writing an app, that lets users subscribe to notification for TV transmissions. Currently the user can choose email, sms or push, but it all feels a bit overkill for a simple timed notification.</p><p>I wonder if I can tell Android to simply ""show this Notification at 11:30""?</p>","205521","","","","","2010-09-09 21:00:02","Android Timed Notification","<android><notifications>","1","0","3","",""
"3680590","1","3680619","","2010-09-09 21:06:25","2","484","<p>With the Android 2.2 update came a new car dock app. If my app is in the foreground when I dock my phone, my app gets killed or paused or something, and when I try to re-open my app, it's all messed up. It has lost its state information. </p><p>Does anybody know what the car dock app is doing? At very least, it seems to be force killing all running applications or some other destructive behavior. </p><p>I guess once we identify what it is doing, I'll be able to go about coding around it. </p>","268803","","356","","2010-09-10 01:50:39","2010-09-10 01:50:39","Why does car dock mess up my app?","<android><crash><docking>","2","0","","",""
"3680732","1","3713547","","2010-09-09 21:31:05","0","1195","<p>I tried posting this before, but can't find it now; apologies if this is a double post.</p><p>Hello all,</p><p>I'm creating a custom theme for my application, in the hopes of being able to allow the user to change the theme later on down the road. I've got the theme implemented, and it's default values for things like textviews are working swimmingly, but I'm having a trouble in 3 different activities where I've applied a style tag to an element (linearlayout for instance), and the style is simply ignored.</p><p>in layout xml for activity:</p><pre><code>&lt;LinearLayout android:layout_height=""wrap_content""   android:layout_width=""fill_parent""   android:orientation=""horizontal""   style=""?header_background""&gt;</code></pre><p>in themes.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""cleansheets"" parent=""android:Theme""&gt;        &lt;item name=""header_background""&gt;@style/cleansheets_header&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>in styles.xml:</p><pre><code>&lt;style name=""cleansheets_monthtable_background""&gt;   &lt;item name=""android:background""&gt;@color/cleansheets_monthtable_background&lt;/item&gt;&lt;/style&gt;</code></pre><p>in colors.xml:</p><pre><code>&lt;color name=""cleansheets_header_background""&gt;#ff8FA7C1&lt;/color&gt;</code></pre><p>I've triple-checked to make sure there isn't anything in the code that overrides that and sets a different color. The only other thing I can think of worth mentioning at the moment is that the view the linearlayout is in, is inflated by a custom view class later.</p><p>If you can lend any insight as to what may be going on, it would be hugely appreciated.</p><p>In response to Fred's question, here's the custom class that uses the layout:</p><pre><code>import java.util.Date;import android.content.Context;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.os.Parcelable;import android.view.LayoutInflater;import android.view.View;import android.view.View.OnClickListener;import android.widget.TableLayout;import android.widget.TextView;import com.clearsync.android.data.AndroidCsDate;import com.clearsync.android.viewer.Bug;import com.clearsync.android.viewer.PreferenceHelper;import com.clearsync.android.viewer.R;import com.clearsync.android.viewer.ui.gcalendar.CalendarActivity;public class MonthView extends TableLayout implements OnClickListener {    //Array that holds the amount of days in each month, in order    int[] daysInMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};    String[] monthName = {""January"", ""February"", ""March"", ""April"", ""May"", ""June"", ""July"", ""August"", ""September"", ""October"", ""November"", ""December""};    AndroidCsDate selectedDate = new AndroidCsDate(0);    private Context context = null;    public static AndroidCsDate today = new AndroidCsDate(new Date());    MonthTile[] tiles = new MonthTile[42];    Handler modeSwitchHandler = null;    private int monthcell_current_background = -1;    private int monthcell_outside_background = -1;    private int monthcell_today_background = -1;    private int monthcell_selected_background = -1;    private int cleansheets_text_today_cell = -1;    //TableLayout layout = (TableLayout) findViewById(R.id.month_table_layout);    public MonthView(Context context, Handler modeSwitchHandler) {        super(context);        this.context = context;        getThemeColors();        this.modeSwitchHandler = modeSwitchHandler;        LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        layoutInflater.inflate(R.layout.monthlayout, this, true);        findViewById(R.id.monthlayout_viewswitcher).setOnClickListener(this);        //(R.layout.monthlayout);        //20100610 atraudes assign date to create this from to variable. We don't want the current date changing while we're        //working, do we?        //selectedDate = UIRenderingDelegate.getCurrentdate();    }    private void getThemeColors(){        monthcell_current_background = CalendarActivity.getThemeColors(R.attr.monthcell_current_background);        monthcell_outside_background = CalendarActivity.getThemeColors(R.attr.monthcell_outside_background);        monthcell_today_background = CalendarActivity.getThemeColors(R.attr.monthcell_today_background);        monthcell_selected_background = CalendarActivity.getThemeColors(R.attr.monthcell_selected_background);        cleansheets_text_today_cell = CalendarActivity.getThemeColors(R.attr.cleansheets_text_today_cell);    }    public void fillTile(int pos, int count){        MonthTile t = tiles[pos];        if(t!=null){            t.setCount(count);            t.setListeners();        }    }    @Override    protected void onRestoreInstanceState(Parcelable state) {        super.onRestoreInstanceState(state);        if(Bug.debug_Turn_On_For_Development)Bug.printInfo(""running onrestore"");        for(int x=0; x&lt;42; x++)tiles[x].setListeners();    }    public void setTitle(String title){        TextView tv = (TextView) findViewById(R.id.month_table_title);        tv.setText(title);    }    public void fillTiles(int[] counts){        if(counts!=null&amp;&amp;counts.length==42){            for(int x=0; x&lt;counts.length; x++){                if(Bug.debugUIFlip)Bug.printDebug(""Filling tile: ""+x+"" with ""+counts[x]);                fillTile(x, counts[x]);            }        }    }    private MonthTile createTile(int pos, AndroidCsDate calendar) {        MonthTile retthis = (MonthTile) findViewById(context.getResources().getIdentifier(""month_cell_""+pos, ""id"", ""com.clearsync.android.viewer""));        retthis.monthcell_current_background = monthcell_current_background;        retthis.monthcell_outside_background = monthcell_outside_background;        retthis.monthcell_selected_background = monthcell_selected_background;        retthis.monthcell_today_background = monthcell_today_background;        retthis.cleansheets_text_today_cell = cleansheets_text_today_cell;        retthis.buildTile(calendar.cloneDate(), MonthTile.HIDE_EVENTS, calendar.getMonth() == selectedDate.getMonth(), PreferenceHelper.getInstance(context).getGuid(), modeSwitchHandler);        tiles[pos] = retthis;        return retthis;    }    public AndroidCsDate buildIt(AndroidCsDate gregcalendar){        if(Bug.debug_Turn_On_For_Development)Bug.printInfo(""date passed is: ""+gregcalendar);        selectedDate = gregcalendar.cloneDate();        setTitle(gregcalendar.getMonthString()+"" ""+(gregcalendar.getYear()));        //20100615 atraudes subtract number of days before current month        gregcalendar.addDays(-1 * (gregcalendar.getDayOfWeek() - 1));        AndroidCsDate retthis = gregcalendar.cloneDate();        for(int x=0; x&lt;42; x++){            createTile(x, gregcalendar);            gregcalendar.addDays(1);        }        return retthis;    }    private void initGestureDetecture() {        this.setOnTouchListener(ListenerManager.getInstance(context).getOnTouchListener());        //FlipView.getInstance(getApplicationContext()).getFlipView().setOnTouchListener(ListnerManager.getInstance(getApplicationContext()).getOnTouchListener());    }    public void onClick(View v) {        Bundle retthis = new Bundle();        retthis.putInt(""mode_switchto"", CalendarActivity.MODE_DAY);        retthis.putInt(""switchto_date"", 0);        Message sendme = Message.obtain();        sendme.setData(retthis);        modeSwitchHandler.sendMessage(sendme);    }}</code></pre><p>and here's the full xml file that gets inflated (the full xml file that includes the linearlayout snippet I posted earlier)</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:gravity=""top""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        style=""?monthtable_background""        android:stretchColumns=""*""        android:id=""@+id/month_table_layout""&gt;        &lt;TableRow&gt;            &lt;LinearLayout android:layout_height=""wrap_content""                 android:layout_width=""fill_parent""                android:layout_span=""7""                android:orientation=""horizontal""                style=""?header_background""&gt;                &lt;TextView android:gravity=""center""                     android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                     android:textSize=""18.0px""                    android:padding=""3.0px""                    android:layout_weight=""1""                    android:id=""@+id/month_table_title"" /&gt;                &lt;Button android:layout_height=""wrap_content""                     android:layout_width=""30px""                    android:id=""@+id/monthlayout_viewswitcher""                    android:text="" ""/&gt;            &lt;/LinearLayout&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_0""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_1""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                android:id=""@+id/month_cell_2""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_3""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_4""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_5""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_6""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_7""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_8""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_9""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_10""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_11""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                android:id=""@+id/month_cell_12""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_13""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                android:minHeight=""50px""                 android:id=""@+id/month_cell_14""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_15""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_16""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_17""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_18""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_19""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_20""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_21""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                android:id=""@+id/month_cell_22""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_23""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_24""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_25""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_26""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_27""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_28""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_29""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_30""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_31""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                android:minHeight=""50px""                 android:id=""@+id/month_cell_32""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_33""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_34""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_35""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_36""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                android:id=""@+id/month_cell_37""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_38""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_39""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_40""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;            &lt;com.clearsync.android.viewer.ui.calendar.MonthTile                 android:minHeight=""50px""                 android:id=""@+id/month_cell_41""                style=""?monthcell_current_background""                 android:layout_margin=""1px"" /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;</code></pre><p>As you can see, I tried the style tags in two places, and neither of them are taking.</p>","443659","","443659","","2010-09-10 16:52:14","2010-09-14 23:03:50","Android style tags from custom theme are being ignored","<android><themes>","1","3","","",""
"3680738","1","3680809","","2010-09-09 21:31:46","2","4385","<p>I have a class (RestClient.java) that extends AsyncTask:package org.stocktwits.helper;</p><pre><code>import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.http.impl.client.DefaultHttpClient;import org.json.JSONException;import org.json.JSONObject;import android.os.AsyncTask;import android.util.Log;public class RestClient extends AsyncTask&lt;String, Void, JSONObject&gt;{    public JSONObject jsonObj = null;    private static String convertStreamToString(InputStream is) {        /*         * To convert the InputStream to String we use the BufferedReader.readLine()         * method. We iterate until the BufferedReader return null which means         * there's no more data to read. Each line will appended to a StringBuilder         * and returned as String.         */        BufferedReader reader = new BufferedReader(new InputStreamReader(is));        StringBuilder sb = new StringBuilder();        String line = null;        try {            while ((line = reader.readLine()) != null) {                sb.append(line + ""\n"");            }        } catch (IOException e) {            e.printStackTrace();        } finally {            try {                is.close();            } catch (IOException e) {                e.printStackTrace();            }        }        return sb.toString();    }    /* This is a test function which will connects to a given     * rest service and prints it's response to Android Log with     * labels ""Praeda"".     */    public static JSONObject connect(String url)    {        HttpClient httpclient = new DefaultHttpClient();        // Prepare a request object        HttpGet httpget = new HttpGet(url);         // Execute the request        HttpResponse response;        try {            response = httpclient.execute(httpget);            // Examine the response status            Log.i(""Praeda"",response.getStatusLine().toString());            // Get hold of the response entity            HttpEntity entity = response.getEntity();            if (entity != null) {                // A Simple JSON Response Read                InputStream instream = entity.getContent();                String result= convertStreamToString(instream);                // A Simple JSONObject Creation                JSONObject json=new JSONObject(result);                // Closing the input stream will trigger connection release                instream.close();                return json;            }        } catch (ClientProtocolException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (JSONException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return null;    }    @Override    protected JSONObject doInBackground(String... urls) {        return connect(urls[0]);    }    @Override    protected void onPostExecute(JSONObject json ) {        this.jsonObj = json;    }    public void setJSONObject(JSONObject jsonFromUI){        this.jsonObj = jsonFromUI;    }    public JSONObject getJSONObject(){        return this.jsonObj;    }}</code></pre><p>I am trying to execute the AsyncTask on my Main class (Main.java):</p><pre><code>    RestClient rc = new RestClient();    JSONObject json = new JSONObject();    rc.setJSONObject(json);    rc.execute(buildQuery());    json = rc.getJSONObject();//do some stuff with the json objecttry { JSONObject query = json.getJSONObject(""query"");//...}</code></pre><p>json is null because it is called before onPostExecute(). How can I get my JSON?</p><p>UPDATE:I need to run this try block in onPostExecute():</p><pre><code>try {            JSONObject query = json.getJSONObject(""query"");            JSONObject results = query.getJSONObject(""results"");            if (query.getString(""count"").equals(""1"")) { // YQL JSON doesn't                // return an array for                // single quotes                JSONObject quote = results.getJSONObject(""quote"");                Quote myQuote = new Quote();                myQuote.setName(quote.getString(""Name""));                myQuote.setSymbol(quote.getString(""Symbol""));                myQuote.setLastTradePriceOnly(quote                        .getString(""LastTradePriceOnly""));                myQuote.setChange(quote.getString(""Change""));                myQuote.setOpen(quote.getString(""Open""));                myQuote.setMarketCapitalization(quote                        .getString(""MarketCapitalization""));                myQuote.setDaysHigh(quote.getString(""DaysHigh""));                myQuote.setYearHigh(quote.getString(""YearHigh""));                myQuote.setDaysLow(quote.getString(""DaysLow""));                myQuote.setYearLow(quote.getString(""YearLow""));                myQuote.setVolume(quote.getString(""Volume""));                myQuote.setAverageDailyVolume(quote                        .getString(""AverageDailyVolume""));                myQuote.setPeRatio(quote.getString(""PERatio""));                myQuote.setDividendYield(quote.getString(""DividendYield""));                myQuote.setPercentChange(quote.getString(""PercentChange""));                quotesAdapter.add(myQuote);}</code></pre>","19875","","19875","","2010-09-10 00:28:10","2011-05-29 20:14:13","Problem returning an object from an AsyncTask","<java><android><asynchronous><android-asynctask>","4","0","3","",""
"3680824","1","3680839","","2010-09-09 21:49:08","1","331","<p>I am just learning application development using Android platform. I want to know how if we post something in twitter app will go to twitter..how do they integrate these two ? </p><p>Thanks,Ananth.</p>","255650","","","","","2011-04-05 06:21:38","how to integrate an existing web application with an android App","<android>","2","0","","",""
"3680830","1","3681434","","2010-09-09 21:50:05","4","2499","<p>I don't want my app to crash if the user doesn't have wifi or 3g connectivity. How can I catch this at runtime in my app?</p>","19875","","","","","2010-11-30 19:50:30","How to detect if user has 3G/Wifi on before making URL connection?","<java><android><android-wifi>","1","1","1","",""
"3680833","1","3681304","","2010-09-09 21:50:13","3","2364","<p>I'm working on developing a native android application to retrieve data for a user from my company's website.</p><p>Because the data is specific to the user, I need to authenticate with our web server, but I'm unsure of the best way to go about this.  I've been reading about REST/SOAP/HTML form auth, but I can't really find any definite 'this is how its done' anywhere.  I know mobile apps do this kind of thing all the time - just look at facebook/skype/any email app - you have to login before you can do anything.</p><p>My question is - <strong>how should I architect the server side code (php) to easily allow me to authenticate a user from my android device?</strong></p><p>I'm fairly new to the 'web service' arena - does this fall into that category?  Are there any tutorials you guys would recommend looking at?</p><p>Thanks!</p>","443839","","","","","2013-03-20 12:55:24","How to have a native android app authenticate with web backend?","<php><android><authentication><mobile>","3","0","1","",""
"3680836","1","3680926","","2010-09-09 21:50:22","6","6010","<p>The problem is that the following method gets called one time when the Menu button is pressed:</p><pre><code>public boolean onCreateOptionsMenu(Menu menu)</code></pre><p>How can I recreate the menu at a later time in order to change some options, disable some options, etc?</p>","242904","","","","","2010-09-09 22:20:02","How to make a dynamic options menu?","<android>","1","0","1","",""
"3680846","1","","","2010-09-09 21:52:33","1","162","<pre><code>package com.FlickrView;import android.app.Activity;import android.os.Bundle;import java.net.*;import java.io.*;public class FlickrView extends Activity {     /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            URL flickr = new URL(""http://api.flickr.com/services/feeds/photos_public.gne?id=39350419@N06&amp;lang=en-us&amp;format=rss_200"");            URLConnection flickrConnect = flickr.openConnection();            BufferedReader in = new BufferedReader(new InputStreamReader(flickrConnect.getInputStream()));            String inputLine;            while ((inputLine = in.readLine()) != null)                 System.out.println(inputLine);            in.close();        }         catch (MalformedURLException e) {          System.out.println(""Unable to load URL"");          e.printStackTrace();        } catch (IOException e) {          // TODO Auto-generated catch block          e.printStackTrace();        }     }}</code></pre>","443865","","119549","","2010-09-09 21:57:14","2010-09-09 22:01:52","Why is this displaying Hello World when I run it?","<java><android>","2","0","","",""
"3681358","1","3684470","","2010-09-09 23:41:04","2","707","<p>Is it possible to implement a custom way to lock/unlock an android mobile phone?</p><p>I know that in versions 2.1 from android and before, there was only the locking pattern available, and that in version 2.2 it is now possible to set a password as well, but what if i want to make a custom way of locking/unlocking it myself (such as recognizing handwriting, or making some different alternative method for the locking and unlocking process) ?</p><p>Is it possible to achieve this through an application? or would it be necessary to make a version of the Android OS based in the same source code but with changes within it?</p><p>If it would be necessary to make a different custom version of Android, can anyone give me any hints or tips as to how and where in the source code files are the blocking options considered?</p><p>Thanks in advance.</p>","371388","","","","","2010-09-10 12:10:02","How to implement a custom way to lock/unlock an android mobile phone","<android><security>","1","1","","",""
"3681406","1","3681475","","2010-09-09 23:54:33","3","315","<p>I have a lengthy (20K) text file I need to display (the terms and conditions document written by an obviously overpaid lawyer).</p><p>What's the best/simplest way to show this to a user? I loaded the text from a raw resource and added it as the message to an AlertDialog, but the text is cut off about half way. I couldn't find any obvious limits to the alert dialog text or the TextView it uses.</p>","398469","","398469","","2010-09-10 02:43:41","2010-09-10 02:43:41","What's the best way to show a long file","<android>","2","0","1","",""
"3681665","1","","","2010-09-10 01:06:41","3","2006","<p>I'd like to use the RandomAccessFile class to access a file that ships with my application. However, that class only accepts a String which is the path to the file. If I place my file somewhere like the assets directory, how do I construct a path to that file? I know I can use the getAssets methods to read up resources, but those only return InputStreams which cannot be seeked.</p><p>Thanks!</p>","430890","","","","","2010-09-15 23:13:58","How to get a path to resources?","<android>","3","1","0","",""
"3681681","1","3691109","","2010-09-10 01:09:10","2","1749","<p>Having little experience in Opengl es (or opengl) I was hoping somebody could help me out with this.</p><p>I'm creating an opengl es application and I would like to be able to dynamically create the text of my buttons etc.</p><p>The 2 obvious reasons for that are: </p><p>-to be modular (changing the text quickly without using photoshop)</p><p>-to be able to add languages later down the line</p><p>can anybody point me to a tutorial or at least give me the basic steps/functions to:</p><ul><li><p>create textures form text</p></li><li><p>load custom fonts to display text textures  with the chosen custom font</p></li><li><p>indicate if I can use this for loading Kanji ?</p></li></ul><p>Best regards </p><p>Jason Rogers</p>","440336","","","","","2010-09-20 12:29:40","Text textures with Custom Fonts OpenGL ES","<android><fonts><opengl-es><textures>","2","0","","",""
"3681714","1","3681727","","2010-09-10 01:19:12","7","5365","<p>I would like to make an ImageView display an image on a website. So I create a new ImageView and execute <code>imgView.setImageURI(uri);</code></p><p>When I launch the app the image does not appear and I get the error, ""resolveUri failed on bad Bitmap Uri (uri)"".</p><p>Any ideas on how to solve this?</p>","414122","","226008","","2011-06-05 18:01:17","2012-05-30 02:09:35","bad bitmap error when setting Uri","<android>","3","0","","",""
"3681762","1","3683293","","2010-09-10 01:35:52","0","3781","<p>How to <code>drawText</code> when button click? How can I <code>setContentView(R.layout.main)</code> to see the button and draw the text when button click? I cannot make it, and below is my code for drawing text.<pre><code>public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     drawView = new DrawView(this);      setContentView(drawView); }public DrawView(Context context) {      super(context);      textpaint.setColor(Color.WHITE);}public void onDraw(Canvas canvas) {     canvas.drawText(""Testing"", 20, 55, textpaint);}</code></pre></p>","427722","","1765573","","2013-07-15 13:07:09","2013-07-15 13:07:09","Android: Canvas.drawText when button click","<android><button><canvas><drawtext>","1","0","","",""
"3681784","1","3681826","","2010-09-10 01:40:59","13","2236","<p>I'd like to start creating Android apps but I don't like Java. I read that scala can be used to do it. Are there another option?(Clojure?)</p><p>I'm a Python/Django developer so it would be great to learn a pretty different language. </p>","289264","","289264","","2010-09-10 01:48:18","2012-01-12 02:40:55","Creating Android apps without Java","<android><scala><programming-languages><clojure>","7","1","2","",""
"3681976","1","3684148","","2010-09-10 02:46:44","2","1523","<p>I've got an Activity with two views set up in a ViewFlipper. One of the views is a layout with a GLSurfaceView and a few other widgets, the other just has a layout with a TextView and a VideoView. When I click on something in the GLSurfaceView, the ViewFlipper swaps so the video can play. In this screenshot, you can see the plain GLSurfaceView rendering a map on the left. On the right is what it looks like after the ViewFlipper has flipped and the video starts playing.</p><p><img src=""http://i.stack.imgur.com/Ho2RZ.png"" alt=""Screenshot""></p><p>The empty transparent area where the GLSurfaceView shows through is where the video is supposed to be. I can hear it playing through the speaker and the timeline is moving forward, so I know it's playing.</p><p>I can post code if you need it, but there's a lot involved so it could get rather complicated.</p><p>Any ideas as to what's going on here?</p>","1384","","","","","2010-09-10 11:14:24","VideoView in ViewFlipper is transparent when video is playing","<android><viewflipper><videoview><glsurfaceview>","1","2","","",""
"3682083","1","","","2010-09-10 03:27:39","4","14978","<p>I am new to git and repo. I am in window 7 so I use cygwin. I have installed git from cygwin setup. After that I try to repo with the following command in cygwin. </p><p>$ repo init-u git://android.git.kernel.org/platform/manifest.git </p><p>error  like these> bash : repo: command not found</p><p>I think I need to make setup in cygwin for repo. What do I need next to get repo.Thanks in advance,hope for help!</p>","393422","","65977","","2010-09-10 07:43:53","2013-04-14 05:46:47","repo: command not found?","<android><git><repository>","4","0","","",""
"3682139","1","3684043","","2010-09-10 03:47:28","4","2265","<p>I'm trying to implement a custom MapView. Inside my MapActivity (named mainmap) I have an inner class which extends MapView:</p><pre><code>private class Lmapview extends MapView{    public Lmapview(Context context, AttributeSet attrs) {        super(context, attrs);        gestures = new GestureDetector(mainmap.this, new GestureListener(this));    }    public boolean OnTouchEvent(MotionEvent event){        return gestures.onTouchEvent(event);    }}</code></pre><p>I have my main.xml formatted to find the inner class like so:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;view    xmlns:android=""http://schemas.android.com/apk/res/android""    class=""com.mondo.tbuddy.mainmap$Lmapview""    android:id=""@+id/mapview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:clickable=""true""    android:apiKey=*****/&gt;</code></pre><p>Also, in Androidmanifest.xml, I have the appropriate <code>&lt;uses-library android:name=""com.google.android.maps""/&gt;</code> entry.</p><p>When I try to run my app, I get (amongst other things) in logcat:</p><blockquote>  <p>ERROR/AndroidRuntime(14999): Caused  by: android.view.InflateException:  Binary XML file line #2: Error  inflating class  com.mondo.tbuddy.mainmap$Lmapview</p></blockquote><p>This is caused by this entry I find in logcat:</p><blockquote>  <p>ERROR/AndroidRuntime(14999): Caused  by: java.lang.NoSuchMethodException:  Lmapview(Context,AttributeSet)</p></blockquote><p>If I understand correctly, my app is crashing because Android is saying it doesn't find the appropriate constructor for my custom MapView (the Lmapview class). As you can see above, however, it is defined and it matches the signature it is looking for.</p><p>Can anyone give me some insight?</p><p>Thanks.</p>","436528","","","","","2010-09-10 11:00:15","Custom MapView throwing NoSuchMethodException, but it's there!","<android><android-mapview><nosuchmethoderror>","1","0","","",""
"3682149","1","3723157","","2010-09-10 03:51:40","2","1482","<p>I'm trying to write a basic augmented reality app in Android, but I'm running into some trouble doing platform-uncoupled calculations because I don't know how to interpret the zoom levels on Android.    </p><p>The zoom levels range from 0 - params.getMaxZoom(), but I can't find any documentation about what those zoom levels actually mean (for example, zoom level 0 is obviously 0% zoomed in, but is zoom level 1 like 10% zoomed in?)  </p><p>Are the zoom levels totally undefined and arbitrary abstractions?  I hope not - that would make zoomed-in AR pretty hopeless.</p>","440630","","353410","","2010-09-10 04:08:17","2010-09-16 01:49:43","What do the Android camera zoom numbers mathematically represent?","<android><camera><zoom>","1","0","","",""
"3682210","1","","","2010-09-10 04:11:59","1","1414","<p>I'm trying to create a basic AlertDialog using an activity with a theme of Theme.Dialog. However, I'm having an issue with the size of the dialog. My XML is currently this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;TableRow&gt;            &lt;View                android:background=""@drawable/divider_gradient""                android:layout_width=""fill_parent""                android:layout_height=""1dip"" /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;TextView                android:id=""@+id/message""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:padding=""8dip"" /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>What I want is for there to be a horizontal bar between the title and the message. However, the bar is not being resized correctly. Rather than being the width of the activity, the bar is the width of the message text. This means that if the activity is being expanded by the message, then the bar will fill the whole activity, so it looks correct. However, if the message width is less than the activity width, the bar only displays above the part of the activity with the text. I've tried every single combination of ""fill_parent"" and ""wrap_content"" that I can think of, and none of those work.</p><p>I've also tried using RelativeLayout and placing the bar above the message text, but that also doesn't work. If I use the RelativeLayout approach and set the bar to fill_parent, it causes the activity to expand to fill the whole screen width, which is also undesirable. Ideally, I want the text placed, the activity width computed, and the bar resized to that width (without affecting it). Is there some way to flag a view to fill the parent view but not to affect its size?Thanks.</p>","435463","","435463","","2010-09-10 04:31:20","2010-09-10 04:31:20","Theme.Dialog view size problems","<android><dialog><themes><activity>","1","0","","",""
"3682224","1","","","2010-09-10 04:17:21","5","8177","<p>I created button with some shadow using a style:</p><pre><code>&lt;style name=""test""&gt;  &lt;item name=""android:shadowColor""&gt;#FFFFFF&lt;/item&gt;  &lt;item name=""android:shadowRadius""&gt;1&lt;/item&gt;  &lt;item name=""android:shadowDx""&gt;1&lt;/item&gt;  &lt;item name=""android:shadowDy""&gt;1&lt;/item&gt;&lt;/style&gt;</code></pre><p>This applies a white shadow on the button's text in its normal state.  I was just wondering if anyone knows if there is a way to remove this shadow when the button is a pressed state.  In other words, is there a way to apply another style when the button is in another (pressed) state?</p><p>Thanks in advance!</p><p><strong>edit</strong></p><p>bold.xml:</p><pre><code>&lt;resources&gt;    &lt;style name=""bold_text""&gt;        &lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>button.xml:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:drawable=""@drawable/test_pressed""              style=""@style/bold_text""          android:state_pressed=""true""/&gt;    &lt;item android:drawable=""@drawable/test_focused""          android:state_focused=""true""/&gt;    &lt;item android:drawable=""@drawable/test_normal""/&gt;&lt;/selector&gt;</code></pre><p>my layout:</p><pre><code>&lt;Button        ...        android:background=""@drawable/button""/&gt;</code></pre>","440308","","440308","","2010-09-12 03:38:37","2013-12-24 20:20:10","custom button: change style when pressed","<android><button><coding-style><state>","2","0","","",""
"3682256","1","","","2010-09-10 04:30:00","2","2541","<p>I am developing an application of Twitter -Client. i got lots of hint form this site. i write some come that is  </p><pre><code>import oauth.signpost.OAuthProvider;import oauth.signpost.basic.DefaultOAuthProvider;import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer;import twitter4j.Status;import twitter4j.Twitter;import twitter4j.TwitterFactory;import twitter4j.http.AccessToken;import android.app.Activity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.util.Log;import android.widget.Button;import android.widget.Toast;public class TwitterConnetcion extends Activity {     private static final String APP =""OAUTH"";     private Twitter twitter;     private OAuthProvider provider;     private CommonsHttpOAuthConsumer consumer;     private String CONSUMER_KEY =""MyConsumerKey"";     private String CONSUMER_SECRET =""MyConsumersecrete"";     private String CALLBACK_URL =""SoftDroidbyDhrumil://twitterconnetcion"";///SoftDroid is my twitter //Apllication that i registered in Twitter site      public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        try {            consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);            provider = new DefaultOAuthProvider(""https://api.twitter.com/oauth/request_token"",""https://api.twitter.com/oauth/access_token"",""https://api.twitter.com/oauth/authorize"");            String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);            Log.i(""Dhrumil"",authUrl);            Toast.makeText(this, ""Please authorize this app!"", Toast.LENGTH_LONG).show();            this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));            Log.i(""Dhrumil"",""Browser Start""); } catch (Exception e) {            Log.i(""Dhrumil""+APP, e.toString());            Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();    }    protected void onNewIntent(Intent intent) {        // TODO Auto-generated method stub        super.onNewIntent(intent);        Uri uri = intent.getData();        if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACK_URL)) {                String verifier = uri.getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);                Log.i(""Dhrumil verifier"",verifier);                try {                        // this will populate token and token_secret in consumer                        provider.retrieveAccessToken(consumer, verifier);                        // TODO: you might want to store token and token_secret in you app settings!!!!!!!!                        AccessToken a = new AccessToken(consumer.getToken(), consumer.getTokenSecret());                        Log.i(""Dhrumil AccessToken"",a.toString());                        // initialize Twitter4J                        twitter = new TwitterFactory().getInstance();                        twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);                        twitter.setOAuthAccessToken(a);                        // create a tweet                        Date d = new Date(System.currentTimeMillis());                        String tweet = ""#OAuth working! "" + d.toLocaleString();                        // send the tweet                        twitter.updateStatus(tweet);                        // feedback for the user...                        Toast.makeText(this, tweet, Toast.LENGTH_LONG).show();                } catch (Exception e) {                        Log.e(APP, e.getMessage());                        Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();                }    }    }}</code></pre><p>I compile fine and run this application it will redirect me at Twitter site for ""Allow"" permission. Then I want to come back to my android application but i got error"" could not found ""SoftDroidbyDhrumil://twitterconnetcion?OuathToken=somoething""</p><p>What do I write at my CallBack URL so i can come back from android browser to my application?</p>","439506","","476681","","2012-02-03 08:35:07","2012-02-03 08:35:07","What to put at CALLBACK_URL in twitter using Oauth from my android application?","<android><url><twitter><callback><oauth>","1","0","1","",""
"3682308","1","3682349","","2010-09-10 04:46:57","4","3600","<p>I have valid JPG files and now I want to load them into a layout containing an ImageView.  I have code to findViewId(R.id.myimage).  I followed some sample code using File but it did not work.  The file is stored at /data/data/com.myapp/files/someimage.jpg.</p><p>What is the easiest and efficient way to load and display?</p>","157804","","","","","2012-02-23 14:09:11","What is the most efficient way to load my stored JPG file into the ImageView?","<android><load><imageview><jpeg>","1","2","3","",""
"3682317","1","","","2010-09-10 04:51:38","4","4736","<p>I would like to know how to intercept incoming calls and also how to forward them. I know there are several questions regarding this topic here and elsewhere on the net, but all the answers use the android.intent.action.PHONE_STATE action which is broadcast always after the phone begins to ring and the call screen is shown.<br>That's why I'm looking for a solution where i could intercept the call in an early stage before any notification (ringing etc..) has been done. I would like to know if maybe this is possible on a platform level in native code and if yes how ? Or perhaps with some kind of trick with the SDK ?</p>","1205130","","244296","","2010-09-10 05:07:33","2012-12-08 16:56:32","Android incoming call interception , call forwarding","<android><android-ndk>","3","0","2","",""
"3682430","1","3682470","","2010-09-10 05:29:44","1","4660","<p>We are developing plugins which convert media file as the source and convert in to other format that can be used by DLNA compatible device in android.</p><p>Any help on how to deal with media and its file format and convert into DLNA file format..</p><p>Any idea will be appreciable...</p><p>Thank you</p>","1386533","","127938","","2010-09-10 05:41:25","2011-07-27 02:43:51","Android: Developing Plugins for media sharing","<android><dlna>","2","0","1","",""
"3682445","1","3689490","","2010-09-10 05:34:09","3","3564","<p>I have a GridView inside of a LinearLayout inside of a ScrollView that pages in data from the server. Beneath the GridView is a button to load more data. My GridView will have an ultimate height that is larger than the screen. If I set the height of my GridView to either wrap_content or parent_fill, it sizes itself to the exact available on-screen height and does not scroll at all, cropping out the extra rows. If I explicitly set the layout_height to something large, like 1000dip, scrolling behaves properly, however I cannot predict the final height of my scroll view apriori.</p><p>How do I programmatically determine the necessary height of a GridView to get the desired behaviour? </p><p>Here is my layout below. As you can see I set the height to 1000dip, but that is bogus, I need that value to get set automatically/programmatically: </p><pre><code>        &lt;ScrollView    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:fillViewport=""true""            android:layout_weight=""1""           &gt;           &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:orientation=""vertical""                &gt;            &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""                 android:id=""@+id/grid""                android:layout_width=""fill_parent""                 android:layout_height=""1000dip""                android:columnWidth=""70dp""                android:numColumns=""auto_fit""                android:verticalSpacing=""0dp""                android:horizontalSpacing=""0dp""                android:stretchMode=""columnWidth""                android:gravity=""center""                android:background=""#000000""                android:layout_weight=""1""            /&gt;            &lt;Button            android:id=""@+id/load_more""            android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            android:text=""Load More Foo""             /&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;</code></pre>","61072","","","","","2013-10-31 10:25:03","How do I calculate the required height of a GridView that is inside of a ScrollView on Android?","<android><gridview><android-linearlayout>","3","0","","",""
"3682485","1","","","2010-09-10 05:44:37","0","355","<p>I'd like to create a list of buttons that depend on device supported parameters ; for example, if the device's camera supports setting white balance and antibanding, then 2 corresponding buttons are displayed to allow the user to changes these settings; but if I run the same App on a device that supports only setting for white balance, then only one button is displayed.</p><p>I know how to create a list of buttons in the layout .xml file and I know how to test for supported parameters in the activity .java file, but I don't seem to find a way how to link these together.</p><p>Any help is greatly appreciated.</p><p>FWIW, here are the relevant pieces of my code so far</p><h1>activity .java file</h1><pre><code>package com.MyProject;import java.util.List;import android.app.Activity;import android.hardware.Camera;import android.hardware.Camera.Size;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;public class CameraSettingActivity extends Activity {    private static final String TAG = ""CameraSettingActivity"";    private Object mCameraView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.camera_setting);        Camera mCamera = Camera.open();        /* View mCameraView;*/        Camera.Parameters params = mCamera.getParameters();        // Get supported white balance modes        List&lt;String&gt; white_balance = params.getSupportedWhiteBalance();        if (white_balance!=null) {            String mString = white_balance.get(0);            Log.i(TAG, ""CAMERA WHITE BALANCE : ("" + mString + "")"");        }        // Get supported antibanding modes        List&lt;String&gt; antibanding = params.getSupportedAntibanding();        if (antibanding!=null) {            String mString = antibanding.get(0);            Log.i(TAG, ""CAMERA ANTIBANDING : ("" + mString + "")"");        }        mCamera.setParameters(params);        mCamera.release();    }}</code></pre><h1>layout .xml file</h1><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""center_vertical|center_horizontal""    android:background=""@color/green_background""    &gt;    &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:gravity=""center_vertical|center_horizontal""        android:text=""@string/under_construction""    /&gt;    &lt;Button        android:id=""@+id/white_balance_button""        android:layout_width=""100dip""        android:layout_height=""wrap_content""        android:text=""@string/white_balance""    /&gt;    &lt;Button    android:id=""@+id/antibanding_button""        android:layout_width=""100dip""         android:layout_height=""wrap_content""         android:text=""@string/antibanding""        /&gt;&lt;/LinearLayout&gt;</code></pre>","436672","","20862","","2010-09-10 05:50:05","2010-09-10 06:42:02","buttons conditioned by supported parameters","<android><button><conditional>","1","0","","",""
"3682644","1","7164466","","2010-09-10 06:30:02","2","2341","<p>I see a couple of threads on this topic, but none of them seem to answer the question, so, I'm giving it another go...</p><p>Very simple idea... I want to some portion of the screen to preview (and shoot) the camera and the other portions of the screen to add my own graphical elements (buttons, colorful frame around the camera preview, etc).</p><p>The example that comes with Android fills the screen.  The obvious solution (that doesn't seem to be working) is to use my own SurfaceView (rather than the one they do in the example) and have it sitting in my XML.  The code (beneath) doesn't crash and reports that it's firing up the camera... it just never renders on the screen.</p><p>I have no idea what I'm doing incorrectly.  My guess is that it has something to do with the display thread never having the urge to redraw anything after it renders the initial screen, but I even tried adding a button and initiating the camera to render on the surface view upon button click, but that has not provoked it any further.(most of this code is pulled directly out of the Android sample code, so, I'm sure it's correct.  I'm just doing something wrong in how I pull my View in after the fact, I think).</p><p>Any and all help greatly appreciated.</p><pre><code>public class TakePhoto extends Activity implements SurfaceHolder.Callback{    /** Called when the activity is first created. */    SurfaceHolder mHolder;    Camera mCamera;@Overrideprotected void onCreate(Bundle savedInstanceState) {                super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,    WindowManager.LayoutParams.FLAG_FULLSCREEN);    setContentView(R.layout.take_photo);            try{        SurfaceView sv = (SurfaceView) findViewById(R.id.camera_surface);        mHolder = sv.getHolder();        mHolder.addCallback(this);             mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);          toast(""added callback"");    }catch(Exception e){        toast(""push: "" + e);    }       }public void surfaceCreated(SurfaceHolder holder) {    mCamera = Camera.open();    try {       mCamera.setPreviewDisplay(mHolder);    } catch (IOException exception) {        mCamera.release();        mCamera = null;        toast(""error:"" + exception);    }}public void surfaceDestroyed(SurfaceHolder holder) {    mCamera.stopPreview();    mCamera.release();    mCamera = null;}private Size getOptimalPreviewSize(List&lt;Size&gt; sizes, int w, int h) {    final double ASPECT_TOLERANCE = 0.05;    double targetRatio = (double) w / h;    if (sizes == null) return null;    Size optimalSize = null;    double minDiff = Double.MAX_VALUE;    int targetHeight = h;    for (Size size : sizes) {        double ratio = (double) size.width / size.height;        if (Math.abs(ratio - targetRatio) &gt; ASPECT_TOLERANCE) continue;        if (Math.abs(size.height - targetHeight) &lt; minDiff) {            optimalSize = size;            minDiff = Math.abs(size.height - targetHeight);        }    }    if (optimalSize == null) {        minDiff = Double.MAX_VALUE;        for (Size size : sizes) {            if (Math.abs(size.height - targetHeight) &lt; minDiff) {                optimalSize = size;                minDiff = Math.abs(size.height - targetHeight);            }        }    }    return optimalSize;}public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {    Camera.Parameters parameters = mCamera.getParameters();    List&lt;Size&gt; sizes = parameters.getSupportedPreviewSizes();    Size optimalSize = getOptimalPreviewSize(sizes, w, h);            parameters.setPreviewSize(optimalSize.width, optimalSize.height);            mCamera.setParameters(parameters);    mCamera.startPreview();}private void toast(String str){    Context context = getApplicationContext();           int duration = Toast.LENGTH_SHORT;    Toast toast = Toast.makeText(context, str, duration);    toast.show();}</code></pre><p>}</p>","59947","","","","","2011-08-23 16:40:23","How do I put graphics on top of my camera preview in Android?","<android>","2","0","3","",""
"3682700","1","3682736","","2010-09-10 06:42:57","-1","1082","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1782743/twitter-integration-on-android-app"">twitter integration on android app</a>  </p></blockquote><p>How can I integrate Twitter with my Android application?</p>","2624806","","496830","","2011-09-21 17:40:16","2011-09-21 17:40:16","Twitter Integration in Android","<android>","1","4","","2010-09-11 02:09:49",""
"3682746","1","3697283","","2010-09-10 06:56:41","0","753","<p>I am working on an Android application where I would want to switch between 3 activities (say Home, Map and Photo). Right now the flow is like 'Home>Map>Photo'. I would like to allow the user to switch between these 3 activities. Say if he wants to go from Photo to Map or from Photo to Home without destroying the Photo activity. What is the best way in Android to achieve this? </p><p>I went through other answers on SO but it seems like caching the data somewhere is the only feasible way which does not break other functionality (For ex. back button).</p><p>-- Edit --</p><p>I want this to work exactly like the way TabHost works. Will appreciate any ideas about how to achieve that.</p>","48066","","48066","","2010-09-12 10:08:52","2010-09-13 00:37:16","Switching between Android activities","<android>","2","1","","",""
"3682819","1","","","2010-09-10 07:12:00","0","179","<p>in my Android program I am trying to draw a table. For some odd reason the first field per row is drawn using a smaller font size then the other columns. I boiled this down to the below example which one can easily copy into a layout file and then preview it in the Eclipse Android layout editor.</p><p>Does anyone have an idea, WHY the first field is using a different font size? IMHO I don't do anything in that layout to trigger this.</p><p>Any ideas or hints welcome! What would I have to add to make all cells using the same font size?</p><p>Michael</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""    android:paddingLeft=""1dip""    android:paddingRight=""1dip""    android:paddingBottom=""1dip""    android:background=""#00F""    &gt;    &lt;ScrollView        android:id=""@+id/ScrollView01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:scrollbars=""vertical""        &gt;        &lt;HorizontalScrollView            android:id=""@+id/HorizontalScrollView01""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:scrollbars=""horizontal""            &gt;            &lt;TableLayout                android:id=""@+id/ItemPane""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:background=""#FF0""            &gt;                &lt;TableRow                    android:id=""@+id/HeaderRow""                    android:layout_width=""wrap_content""                    android:layout_height=""wrap_content""                        android:background=""#0F0""                &gt;                    &lt;TextView                        android:id=""@+id/NameField1""                        android:text=""First field""                        android:layout_margin=""2dp""                         android:background=""#FFF""                        android:textColor=""#000""                    /&gt;                    &lt;EditText                        android:id=""@+id/DataField11""                        android:text=""some field""                        android:layout_margin=""2dp""                         android:background=""#FFF""                        android:textColor=""#000""                    /&gt;                    &lt;EditText                        android:id=""@+id/DataField11""                        android:text=""another field""                        android:layout_margin=""2dp""                         android:background=""#FFF""                        android:textColor=""#000""                    /&gt;                &lt;/TableRow&gt;                     &lt;/TableLayout&gt;        &lt;/HorizontalScrollView&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","423411","","","","","2010-09-10 07:12:00","Font size mystery: why are two fields drawn using different font size?","<android>","0","2","","",""
"3682890","1","3683134","","2010-09-10 07:29:20","3","2776","<p>We are making an application that needs to convert one file format to another.I am not sure whether we can add a JAR file in which we develop the code to convert the file format to our required file format, to our android project.</p>","1386533","","114066","","2010-09-10 08:19:54","2010-09-10 08:21:45","android: Adding external JAR file in to android","<android><jar><external>","1","0","","",""
"3682998","1","3683532","","2010-09-10 07:50:18","1","3166","<p>Do the Android users have the chance to reset the NetworkProvider, so that the location will be null? I came up with the idea, that its only possible to have that location null, after starting the device the very first time. But also than google will check the location right away for my opinion.</p><p>Sure, I'm implementing a default location for this rare case. I just want to know how seldom this case is.</p>","433718","","","","","2013-05-23 19:57:05","Android: How often does getLastKnownLocation(LocationManager.NETWORK_PROVIDER) return null in real life?","<android><geolocation><android-location>","4","0","","",""
"3683097","1","","","2010-09-10 08:12:30","2","184","<p>can you advice me a book or something else containing good practices about how to build/structure a web application in a way that will be easy to extend it with an Android/iPhone version later.<br>I am currently trying to get into Django so it will be nice if the practices are related to it, but every hint will be appreciated.</p>","423283","","","","","2011-04-10 04:08:19","Good practices for building web application that can later have and mobile(Android/iPhone) version","<iphone><android><architecture>","2","0","1","2012-12-07 13:42:04",""
"3683126","1","4178691","","2010-09-10 08:20:53","2","1193","<p>I'm facing problems using PieChart from the achartengine library. According to the demo, the PieChart extends <code>AbstractChart.java</code>, not <code>AbstractChart.class</code> in the library. Hence, the functions <code>buildCategoryRenderer(int[] args)</code> and <code>buildCategoryDataset(String arg0, double[] arg1)</code> don't exist in the library.</p><p>How does one initiate a PieChart and show it as an separate intent?</p>","433640","","56338","","2010-11-14 09:18:29","2012-09-20 13:38:58","Problems using PieChart of achartengine","<android><achartengine>","2","0","","",""
"3683133","1","3684271","","2010-09-10 08:21:34","0","142","<p>I'm looking for a way to easily port content driven applications from one mobile platform to another. Currently HTML5+js seems to be the only language that can be easily reused.</p><p>Can you share your experience? I'm looking for a way to go forward.</p>","80869","","","","","2010-09-10 13:44:05","Any idea how to write code that can be easily ported to iphone, android and blackberry?","<iphone><android>","2","0","1","","2010-09-10 08:21:34"
"3683179","1","3683215","","2010-09-10 08:31:34","13","39718","<p>i know how to set image/icon from our res/drawable </p><pre><code>&lt;ImageView android:id=""@+id/ImageSearch""     android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/android_green_3d""/&gt;</code></pre><p>If we set it directly from the code:imageView1.setImageResource(R.drawable.android_green_3d);</p><p>But we can also get the icon from android.R.drawable like this:imageView1.setImageResource(android.R.drawable.ic_menu_more);</p><p>How to set image/icon in xml id the source is android.R.drawable? Anyone know?Thanks in advance.</p>","430926","","180538","","2011-09-13 13:05:57","2011-09-13 13:05:57","Set image from android.R.drawable in image view android","<android><imageview>","1","0","0","",""
"3683363","1","4103171","","2010-09-10 09:02:51","2","17577","<p>Hi  can anybody tell how to reduce the height of tab bar and display tab bar in bottom</p><p>Thanks</p>","426344","","","","","2013-09-27 09:45:15","How to reduce the tab bar height and display in bottom","<android>","8","1","9","",""
"3683407","1","3683469","","2010-09-10 09:08:45","0","991","<p>In my application I use an AsyncTask on start up of my Activity to fetch the ringtone of a particular contact.</p><p>It works normally but I have noticed that if the application is stopped twice before the AsyncTask gets to the doInBackground method then when the Activity starts again the AsyncTask fails to run properly, only getting to the onPreExecute() method.</p><p>Here is my code:</p><p>The AsyncTask itself:</p><hr><pre><code>private class SelectRingtoneTask extends AsyncTask&lt;String, Void, Void&gt; {          // can use UI thread here             protected void onPreExecute() {              Log.d(""cda"", ""Into selectRingToneTask - onPreExecute() - "" + selectRingtoneFinished);          }          // automatically done on worker thread (separate from UI thread)          protected Void doInBackground(final String... args) {              Log.d(""cda"", ""Into selectRingToneTask - !!!!!!!!!!!!!!!"");             getRingTone();             return null;          }          // can use UI thread here          protected void onPostExecute(final Void unused) {           selectRingtoneFinished = true;           Log.d(""cda"", ""Into selectRingToneTask - onPostExecute - "" + selectRingtoneFinished);          }       }</code></pre><hr><p>Where I call the AsyncTask on start up:</p><hr><pre><code>if(srtt == null){srtt = new SelectRingtoneTask();Log.d(""cda"", ""RingTone - "" + srtt.getStatus());}srtt.execute();</code></pre><hr><p>The problem occur's when I start the activity and close the Activity before the AsyncTask finishes, if this happens once, it seems to be fine but after it happens a second time the AsyncTask will only ever get to the onPreExecute() method and will never complete again until the application is force stopped and restarted.</p><p>Has anybody got any idea why this would be happening?</p>","243999","","","","","2011-05-27 15:21:00","AsyncTask doesn't run sometimes despite state being RUNNING?","<android><android-asynctask>","2","0","","",""
"3683433","1","","","2010-09-10 09:14:49","1","1319","<p>I am new to Android Dev, and this is my first widget.</p><p>What is supposed to happen is when the user clicks the widget, it turns off or on the Master Sync option.</p><p>However the widget does not do anything when clicked, and appears to not be clickable.</p><p>This is the body of the .java code, if it helps to post any of the other code please let me know.</p><pre><code>public class MasterSync extends AppWidgetProvider {    /** Called when the activity is first created. */    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {     final int N = appWidgetIds.length;        // now label the property of the button     boolean sync = ContentResolver.getMasterSyncAutomatically();  if (sync){      ContentResolver.setMasterSyncAutomatically(false);}  else  if (!sync){     ContentResolver.setMasterSyncAutomatically(true);    }    }}</code></pre>","444186","","1288","","2010-10-13 13:12:44","2010-12-04 07:51:09","Android Widget, not clickable","<android><android-widget>","3","2","","",""
"3683451","1","3683578","","2010-09-10 09:18:04","2","313","<p>I'm population my listView using Cursor, but when I navigate away from my activity and then return back my listview is empty. Here is my code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {...DBAdapter db = new DBAdapter(context);db.open();Cursor c = db.getAll();db.close();startManagingCursor(c);String[] columns = new String[] { ... };int[] to = new int[] { ... };SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, R.layout.list_item, c, columns, to);this.setListAdapter(mAdapter);...}</code></pre><p>I've seen here questions about saving position of Cursor, but not the Cursor itself. Probably I just missing something, shall I save my cursor (how can I do it?) or it's better(faster, cheaper) to create new cursor every time using my DBadapter?  </p><p>Thanks</p>","386817","","386817","","2010-09-10 09:37:24","2010-09-10 09:40:05","How to save cursor in activity?","<java><android><sqlite><listview><cursor>","1","2","0","",""
"3683494","1","","","2010-09-10 09:25:23","7","2248","<p>I'm trying to <em>redirect outgoing calls to a different phone number</em> on an Android device. So, I use a BroadcastReceiver ""listening"" for the NEW_OUTGOING_CALL intent, on his onReceive() method I use the setResultData() method to change the phone number.</p><p>Like this:</p><pre><code>public void onReceive(Context arg0, Intent arg1) {    setResultData(""351978923221"");}</code></pre><p>In the emulator all goes well, but on my real device (a crappy ZTE X850 with Android 2.1 I believe) it doesn't if the calling Intent originates in an Activity wich is part of the same application. After the dialing screen appears, the phone terminates the call.</p><p>Any thoughts out there on why this happens?</p><p><strong>Note:</strong> I know my question is basically the same as <a href=""http://stackoverflow.com/questions/3493287/android-capture-new-outgoing-call"">this one</a> but I chose to ask it again anyway to provide additional details about what goes wrong.</p><hr><p><strong>Manifest File</strong></p><p>An excerpt...</p><pre><code>    &lt;receiver android:name="".OutgoingCallDetection"" android:exported=""true""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.NEW_OUTGOING_CALL""                    android:priority=""9999"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;&lt;/application&gt;&lt;uses-permission android:name=""android.permission.CALL_PHONE"" /&gt;&lt;uses-permission android:name=""android.permission.PROCESS_OUTGOING_CALLS"" /&gt;</code></pre>","440854","","440854","","2010-09-11 09:00:13","2012-03-14 14:11:04","Android: Redirect outgoing calls","<java><android><redirect><emulator>","1","4","7","",""
"3683570","1","4685424","","2010-09-10 09:38:23","2","3031","<p>Hello I am trying to build sipdroid under eclipse,I have downloaded the source from the svn found on the site and I followed the instructions found on the build.txt file. In the second step saying to execute ant debug the ant script fails this is the output of the console: </p><p><code>[maxsap@localhost sipdroid-read-only]$ ant debug</code></p><blockquote>  <p>Buildfile: build.xml       [setup] Android SDK Tools Revision 6       [setup] Project Target: Google APIs       [setup] Vendor: Google Inc.       [setup] Platform Version: 1.5       [setup] API level: 3       [setup] Importing rules file: platforms/android-3/ant/   ant_rules_r2.xml   -compile-tested-if-test:   -dirs:        [echo] Creating output directories if needed...   -resource-src:        [echo] Generating R.java / Manifest.java from the resources...        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:26: error: No  resource identifier found for   attribute 'installLocation' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:31: error: No  resource identifier found for   attribute 'targetSdkVersion' in  package 'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:32: error: No  resource identifier found for   attribute 'normalScreens' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:32: error: No  resource identifier found for   attribute 'smallScreens' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:32: error: No  resource identifier found for   attribute 'largeScreens' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:32: error: No  resource identifier found for   attribute 'anyDensity' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:37: error: No  resource identifier found for   attribute 'required' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:38: error: No  resource identifier found for   attribute 'required' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:39: error: No  resource identifier found for   attribute 'required' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:40: error: No  resource identifier found for   attribute 'required' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:41: error: No  resource identifier found for   attribute 'required' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:42: error: No  resource identifier found for   attribute 'required' in package  'android'        [null] /home/maxsap/Documents/progrs/maxsapSipDroid/sipdroid-read-  only/AndroidManifest.xml:43: error: No  resource identifier found for   attribute 'required' in package  'android'  BUILD FAILED   /home/maxsap/Documents/progrs/android/android-sdk-linux_86/platforms/  android-3/ant/ant_rules_r2.xml:220:  null returned: 1  note that when I do  ant, the script successfully   completes.  but then when I import the  project in eclipse doing file->import-  existing project into workspace</p></blockquote><p>The project contains errors (seems like the R.java class isn't present). </p><p>any suggestions? I have posted it for some days at the discussion group of sipdroid but no luck,I haven't got any reply.thanks in advanced maxsap</p>","234898","","55093","","2011-06-09 16:11:11","2014-01-16 07:39:08","yet another sipdroid build question","<android>","3","0","","",""
"3683727","1","3684065","","2010-09-10 10:02:39","5","2883","<p>I have a layout which might be a bit unusual. The structure is the following:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;org.CustomSurfaceView        android:id=""@+id/page_flip""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_marginBottom=""20dip"" /&gt;    &lt;org.customRelativeLayout        android:id=""@+id/note""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:visibility=""gone"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>My customRelativeLayout at the bottom of the XML has a XML layout too:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""200dp""    android:layout_height=""200dp""    android:background=""@drawable/my_background""    android:id=""@+id/note_layout""&gt;    &lt;TextView android:id=""@+id/note""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:singleLine=""false""        android:layout_margin=""5dp""        android:textColor=""#000000"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>My CustomRelativeLayout:</p><pre><code>public class CustomRelativeLayout extends RelativeLayout implements OverlayView {    private TextView mNoteText;    private LinearLayout mLinearLayout;    public int mX = 0;    public int mY = 0;    public boolean mShow;    public CustomRelativeLayout(Context context, AttributeSet attrs) {        super(context, attrs);        LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        li.inflate(R.layout.note, this);        mNoteText = (TextView) findViewById(R.id.note);        mLinearLayout = (LinearLayout) findViewById(R.id.note_layout);        mLinearLayout.setOnTouchListener(new OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                Log.e(""touched"");                mX = (int) event.getX() - 100;                mY = (int) event.getY() - 100;                invalidate();                return false;            }        });    }    @Override    public void hide() {        mShow = false;        setVisibility(View.GONE);    }    @Override    public boolean isVisible() {        return isVisible();    }    @Override    protected void onDraw(Canvas canvas) {        Log.e(""Drawing the postit"");        Matrix matrix = new Matrix();        matrix.postTranslate(mX, mY);        canvas.setMatrix(matrix);        super.onDraw(canvas);    }    @Override    public void setContent(Object content) {        if (content != null &amp;&amp; content instanceof Content) {            Content noteContent = (Content) content;            if (noteContent.getText() != null) {                mNoteText.setText(noteContent.getText());            } else {                mNoteText.setText("""");            }        }        mNoteText.invalidate();        mLinearLayout.invalidate();    }    @Override    public void show() {        mShow = true;        setVisibility(View.VISIBLE);    }}</code></pre><p>What I want to do: I want to be able to change the position of my CustomRelativeLayout. It should be follow my touch. Its smaller than the SurfaceView and should ""slide"" above following my touch...</p><p>There are two problems:</p><ol><li>The onTouchListener bind to mLinearLayout (in CustomRelativeLayout) is only triggered once and only for ACTION_DOWN. I see the log output only once</li><li>The note never changes the position, it is never redrawn with the changed matrix... I see the output stated in <code>onDraw</code> never after the touch happened.</li></ol><p>First might be because the SurfaceView also handles touch events. But I thought if the CustomRelativeLayout handles it first, it should work.</p><p>Some ideas?</p><p><strong>Edit for solution</strong></p><p>Thanks to Xil3 I was able to remove the wall I was run into... here is my solution:</p><p>my note xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@android:color/transparent""&gt;    &lt;LinearLayout android:layout_width=""200dp""        android:layout_height=""200dp""        android:background=""@drawable/postit""        android:id=""@+id/textnote_layout""&gt;        &lt;TextView android:id=""@+id/textnote_content""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:singleLine=""false""            android:layout_margin=""5dp""            android:textColor=""#000000"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is my constructor:</p><pre><code>public TextNoteOverlay(Context context, AttributeSet attrs) {    super(context, attrs);    LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    li.inflate(R.layout.textnote, this);    mNoteText = (TextView) findViewById(R.id.textnote_content);    mLinearLayout = (LinearLayout) findViewById(R.id.textnote_layout);    setOnTouchListener(new OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            mLinearLayout.getHitRect(mNoteRect);            if (mNoteRect.contains((int) event.getX(), (int) event.getY())) {                if (event.getAction() == MotionEvent.ACTION_DOWN) {                    mStartX = (int) event.getX() - mLinearLayout.getLeft();                    mStartY = (int) event.getY() - mLinearLayout.getTop();                    return true;                }                mX = (int) event.getX() - mStartX;                mY = (int) event.getY() - mStartY;                mLinearLayout.layout(mX, mY, mX + mLinearLayout.getWidth(), mY + mLinearLayout.getHeight());                return true;            }            return false;        }    });}</code></pre><p>I also found a bug/feature/issue, which is absolutely new for me: When I remove the background in my note root element (which is currently transparent) the note is only visible within the 200dp width/height I have set in the inner LinearLayout. So its not <code>fill_parent</code>, its <code>wrap_content</code> even as I set it to <code>fill_parent</code>. So <code>layout_width</code> and <code>layout_height</code> only use the given <code>fill_parent</code> when a background is set... weired...</p>","180538","","180538","","2010-09-10 12:08:21","2010-09-10 12:08:21","Layout with dynamic position","<android><layout><surfaceview><ontouchlistener>","1","0","","",""
"3683967","1","","","2010-09-10 10:46:36","1","1013","<p>Can someone let me know how to add <code>RelativeLayout</code> or <code>listview</code> inside <code>GalleryView</code>. I have tried by returning <code>listview</code> or <code>RelativeLayout</code> from the adapter of Gallery but it gives <code>ClassCastException java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams.</code></p><p>Can someone let me know how to go about it?</p>","261566","","469983","","2011-03-30 17:24:03","2011-03-30 17:24:03","Add RelativeLayout or ListView inside Gallery View in Android?","<android><listview><gallery><relativelayout>","1","2","1","",""
"3684194","1","","","2010-09-10 11:22:06","0","464","<p>I have a class the extends relativelayout. This class is inflated and added to a view by an activity. This class needs information from a service that I've created. What I'd like to do is bind the class to the service on its own thread but I'm not sure how to do it. When I try and call bindservice in the class I get a ""method is not applicable"" error. If I run bindService from the calling activity's context it does accept it but I get all sorts of problems from that. </p><p>I could simply have the calling activity bind to the service and act as a go-between but that's extra work and I can't help but think there's a better solution. Plus I would like to be able to imbed this class wherever I want to and it will work as its own entity. </p><p>Thanks in advance</p>","405993","","","","","2010-09-10 12:05:24","android: how to bind a sub-class to a service","<android><binding><service>","1","0","","",""
"3684379","1","","","2010-09-10 11:54:31","0","414","<p>In my android app, i have a particular scenario, for one of the screens.</p><p>I require 2 button,one on each side of the corner(left and right).Below this i want to populate data in a control.</p><p>If left button is clicked, the control should be a gridview.If right button is clicked , the control should be a listview.</p><p>And accordingly the data should be populated.</p><p>How should i approach this scenario.Should i create controls dynamically, or use xml instead</p><p>Rgds</p>","419685","","","","","2011-03-15 14:59:47","Populating data on gridview","<android>","1","1","","",""
"3684489","1","3684556","","2010-09-10 12:13:10","3","2749","<p>I working on a chat app. Whenever I submit or receive a text message, I append them to the chatbox. When the list get longer, I need to scroll down to see them.How can I make it to autoscroll to the newly append text?</p><pre><code>&lt;ScrollView    android:id=""@+id/scrollView01""    android:layout_width=""fill_parent""    android:layout_height=""100px"" &gt;        &lt;TextView            android:id=""@+id/txtChat""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""""            /&gt;      &lt;/ScrollView&gt;</code></pre><p>//</p><pre><code>SendMsg.setOnClickListener(new View.OnClickListener() {    public void onClick(View v)     {                       String name = txtName.getText().toString();        String message = txtMessage.getText().toString();    if (message.length() &gt; 0) {            sendMsg(name, message);            String myMessage = message + ""\n"";            tvChat.append(myMessage);        }        else            Toast.makeText(getBaseContext(),                 ""Please enter both name and message."", Toast.LENGTH_SHORT).show();    }});  </code></pre>","79311","","","","","2010-09-13 06:43:58","How can I show the latest append text on textview?","<android><append><textview>","1","0","2","",""
"3684504","1","3696054","","2010-09-10 12:15:14","2","1701","<p>I'm trying to list the system default bookmarks but when I run the app, it list not only the bookmarks but also show History URLs and Most Visited URLs.</p><p>How can I avoid this and show only the bookmarks?</p><p>here is the method: (imported everything necessary + permissions valid) </p><pre><code>public class CLASSNAME extends ListActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        String[] projection = new String[] {Browser.BookmarkColumns._ID,                                      Browser.BookmarkColumns.TITLE,                                      Browser.BookmarkColumns.URL};        String[] displayFields = new String[] {Browser.BookmarkColumns.TITLE,                                      Browser.BookmarkColumns.URL};        int[] displayViews = new int[] { android.R.id.text1,                                      android.R.id.text2 };        Cursor cur = managedQuery(android.provider.Browser.BOOKMARKS_URI,                        projection, null, null, null);        setListAdapter(new SimpleCursorAdapter(this,                        android.R.layout.simple_list_item_2, cur,                        displayFields, displayViews));   }}</code></pre>","444324","","","","","2010-09-12 18:40:20","Trying to list Android Bookmarks showing History as well","<android>","1","3","2","",""
"3684538","1","","","2010-09-10 12:20:01","0","794","<p>There's a decent amount of information out there on the Activity lifecycle.  But I'm surprised how difficult it is to find a comprehensive description of the rendering lifecycle.  By that I mean the order and rules by which a tree of nested activities, views, and drawables get to be sized and drawn to the screen, and the points at which a developer can modify rendering behavior. </p>","369722","","","","","2010-09-10 13:22:03","What is the Android rendering lifecycle?","<android><drawing><rendering><override><lifecycle>","1","0","","",""
"3684678","1","3684855","","2010-09-10 12:42:54","15","16673","<p>in my android app I use a DB with multiple tables, I have an XML parser which needs to write data to 2 tables while parsing. I created 2 DBadapters for 2 tables, but now I have a problem. </p><p>When working with one table it's easy, I can do:</p><pre><code>FirstDBAdapter firstTable = new FirstDBAdapter(mycontext);firstTable.open(); // open and close it every time I need to insert something                   // may be hundreds of times while parsing                   // it opens not a table but whole DB     firstTable.insertItem(Item);        firstTable.close(); </code></pre><p>Or as it a SAX parser, in my opinion (may be I'm wrong) even better will be:</p><pre><code>FirstDBAdapter firstTable = new FirstDBAdapter(mycontext);@Overridepublic void startDocument() throws SAXException {    firstTable.open(); // open and close only once}...firstTable.insertItem(Item);...@Overridepublic void endDocument() throws SAXException {    firstTable.close();}</code></pre><p>But how can I do it if I need to insert data to second table? e.g. if I have second adapter, I think that this will be wrong:</p><pre><code>FirstDBAdapter firstTable = new FirstDBAdapter(mycontext);SecondDBAdapter secondTable = new SecondDBAdapter(mycontext);@Overridepublic void startDocument() throws SAXException {    firstTable.open();    secondTable.open(); }</code></pre><p>Any thoughts will be very appresiated</p><p>thanks</p>","386817","","1841194","","2014-02-19 15:26:20","2014-02-19 15:26:20","Best practices of working with multiple sqlite DB tables in Android","<android><database><android-sqlite>","3","3","14","",""
"3684744","1","4071721","","2010-09-10 12:53:03","4","4919","<p>I've got some trouble with the media backend (mostly Stagefrightplayer) in Android, and I'd like to understand why it throws the errors it does.  The errors are usually device spesific, so debugging on an emulator wouldn't be sufficient.</p><p>Example:</p><pre><code>I/AwesomePlayer(  147): mConnectingDataSource-&gt;connect() returned -1004V/MediaPlayerService(  147): [332] notify (0x272830, 100, 1, -1004)E/MediaPlayer(24881): error (1, -1004)E/MediaPlayer(24881): Error (1,-1004)W/PlayerListener(24881): Received error: what = 1, extra = -1004</code></pre><p>Example 2:</p><pre><code>E/MediaPlayer(  941): error (1, -2147483648)</code></pre><p>I've also gotten the player to bork completely and spit out a traces.txt.</p><p>Is there a way to debug what's happening, just like I debug Java code?  Thanks.</p>","13365","","387076","","2011-09-12 16:29:54","2011-09-12 16:29:54","How to debug Android native code on a real device","<android><c++><debugging><android-source><android-music-player>","6","2","4","",""
"3684833","1","","","2010-09-10 13:10:28","0","186","<p>I have a problem with blocking buffer with the following code on my android application:</p><pre><code> else if (tcpdumpButton.isChecked())           {              try              {                 Process process1 = Runtime.getRuntime().exec(""tcpdump"");                                      BufferedReader osRes = new BufferedReader(new InputStreamReader(process1.getInputStream()));                 StringBuffer output = new StringBuffer();                 String line="""";                                      while ((line = osRes.readLine()) != null)                 {                      output.append(line);                    output.append(""\n"");                    tv.setText(output);                    setContentView(tv);                 }                 }              catch (Exception e)              {                 throw e;              }           }</code></pre><p>Since the tcpdump process is running continuously and never terminated i am unable to print the buffer contents on the screen.Can anybody tell me what i should do or give an example on how to read the buffer and print it on the screen without waiting for the process to terminate??</p>","275674","","","","","2010-09-10 14:40:04","Android: buffer blocked until process exited","<android><java>","1","0","","",""
"3684983","1","3733846","","2010-09-10 13:35:16","0","2043","<p>I have an activity that after some user interaction calls finish() on itself. From time to time it gets into a loop where when it calls finish() it finishes but immediately restarts again. </p><p>Any idea why android tries to restart my activity?</p>","251077","","","","","2010-09-17 08:43:51","Why is android restarting my activity when I call finish() on it?","<android><activity>","3","2","","",""
"3685019","1","","","2010-09-10 13:39:44","3","382","<p>I want to make my app free on the Android Market, also the country I live it, is not allowed to upload paid apps yet, neither to download it. </p><p>But also I want to charge the users somehow for using it, without Android Market as that opts out the usage.  Probably it would be an annual fee.</p><p>So I am wondering, if I have a website where users can register, and pay for the membership. Can I use this on the app? So the app will require the user to provide a login for the website, and there will be a credit check, if it allowed to use it it will continue.</p><p>What do you say, is this legal according to Android Market rules, and is this possible?<br>Are outthere similar apps that does this kind of model I described?<br>This is my idea, but I am wondering if there is some other way to charge for the service?</p>","243782","","","","","2011-05-02 07:12:26","Ways to offer app as free, and still charge users to pay for the service/usage?","<android><google-play>","2","0","0","","2010-09-10 13:39:44"
"3685058","1","","","2010-09-10 13:44:18","2","784","<p>Is there any way out for mapping the Done button to the button on the screen in Android. What I want is that I have one login screen user enters username and presses the next button on the soft keyboard which brings the focus on password field. AFter entering password when the user presses done button then the action which is performed on login button should be called.</p><p>Let me know if this is possible.</p>","261566","","13793","","2012-05-01 01:25:57","2012-05-01 01:25:57","How to map Soft Keyboard button to button on screen in Android?","<android><android-softkeyboard>","1","1","1","",""
"3685340","1","3699776","","2010-09-10 14:20:49","6","7867","<p>I am writing to a canvas from a thread.</p><pre><code>public void draw(Canvas canvas) {  Paint p = new Paint();  p.setAntiAlias(true);  p.setTextSize(30);  p.setColor(Color.WHITE);  p.setTextAlign(Paint.Align.CENTER);  canvas.drawText(""Centered"", xCentre, yCentre, p);}</code></pre><p>My problem start when I have a multi colored SpannableStringBuilder which I want to write to the canvas, and I have no idea how to do this. SpannableStringBuilder has a drawText() method which I have been unable to use. Or is there some other method to write a string to a canvas where some of the letters have a different color?</p>","12126","","","","","2010-09-13 15:05:51","How to write centered multi-colored text to a canvas","<android><canvas>","1","0","5","",""
"3685450","1","","","2010-09-10 14:33:32","1","1313","<p>I need to made an activity (without layout) that on start check if a service is running. if it is true it starts Activity2, if it false it starts Activity1. I tried with this code:</p><pre><code>public class FirstActivity extends Activity{    private final Intent serviceIntent = new Intent(ServiceConnected.class                    .getName());    private ServiceConnected serviceConnected;    private final ServiceConnection serviceConnection = new ServiceConnection() {            @Override            public void onServiceConnected(ComponentName name, IBinder service) {                    serviceConnected = ServiceConnected.Stub.asInterface(service);                    Log.e(""Connessione al Servizio"", ""onServiceConnected"");                    Toast.makeText(FirstActivity.this, ""Connessione con il Service Effettuata"", Toast.LENGTH_SHORT).show();            }            @Override            public void onServiceDisconnected(ComponentName name) {                    Log.e(""Disconnessione dal servizio"", ""onServiceDisconnected"");                    Toast.makeText(FirstActivity.this, ""Scollegamento effettuato"", Toast.LENGTH_SHORT).show();            }    };    @Override    public void onCreate(Bundle savedInstanceState){            setContentView(R.layout.firstactivity);            super.onCreate(savedInstanceState);            bindRemoteService();            Log.e(""Dopo Bind onCreate"",""FirstActivity"");            if(serviceConnected!=null)                    try {                            boolean temp=serviceConnected.getConnected();                            Log.e(""ServiceConnected"",Boolean.toString(temp));                            if(temp==true){                                    Log.e(""Salto alla seconda"",""FirstActivity"");                                    step2();                            }                            else{                                    Log.e(""Salto alla prima"",""FirstActivity"");                                    step1();                            }                    } catch (RemoteException e) {                            // TODO Auto-generated catch block                            Log.e(""Errore Step"",""FirstActivity"");                    }    }    public void bindRemoteService() {            if (serviceConnected == null) {                    if( bindService(serviceIntent, serviceConnection,                                    Context.BIND_AUTO_CREATE) ){                            Log.e(""Bind Effettuato"", ""bindRemoteService"");                            Toast.makeText(this, ""Service Binded"", Toast.LENGTH_SHORT).show();                    }            }    }    private void step2(){            Intent intent;            intent=new Intent(getApplicationContext(), Activity2.class);            startActivity(intent);    }    private void step1(){            Intent intent;            intent=new Intent(getApplicationContext(), Activity1.class);            startActivity(intent);    }enter code here</code></pre><p>but when I check, in the onCreate method, if serviceConnect!=null I receive sometime a NullPointerExcption.</p><p>I tried also to insert the operation in the method onCreate in an Async Task:</p><pre><code>private class BackgroundWorker extends AsyncTask&lt;Void,Integer, Void&gt; {    @SuppressWarnings(""unchecked"")    @Override    protected void onPreExecute () {        Log.e(""BackgroundWorker"",""onPreExecute"");        super.onPreExecute();    }    @Override    protected Void doInBackground ( Void... params ) {        Log.e(""Dentro Background Worker"", ""DOIN"");        bindRemoteService();        publishProgress(1);        //publishProgress(2);        return null;    }    @SuppressWarnings(""unchecked"")    @Override    protected void onProgressUpdate ( Integer... values ) {        try{                do{                try {                    if (serviceConnected!=null&amp;&amp;checked==true){                        boolean temp=serviceConnected.getConnected();                        if(temp==true){                            Log.e(""Salto alla seconda"",""FirstActivity"");                            Log.e(""ServiceConnected"",Boolean.toString(temp));                            step2();                        }                        else if(temp==false){                            Log.e(""Salto alla prima"",""FirstActivity"");                            Log.e(""ServiceConnected"",Boolean.toString(temp));                            step1();                        }                    }                } catch (RemoteException e) {                    // TODO Auto-generated catch block                    Log.e(""Errore Step"",e.toString());                }            }while(checked==false);        }catch(Exception e){Log.e(""Errore do"",e.toString());};    }}</code></pre><p>But I have the same problem. Someone knows how I can fix this?Thanks </p>","444442","","","","","2010-09-12 18:14:06","Android Activity check service to start another activity","<android><service><activity>","2","0","","",""
"3685525","1","","","2010-09-10 14:42:37","0","1519","<p>I have some problem and I cannot solve that.In my code I add dynammically ImageButtons( I dynamically create TableRow and add in row), they shows up but I cannot click on them ( I try all, set clickable to true, enabled to true and nothing). If I use Button instead ImageButton all works fine except when I set background for buttons same problem again.</p><p>Also I add TextView from code but TextView doesn't show up at all.Any solution pls ?</p>","444451","","","","","2012-05-26 13:08:20","ANDROID - DYNAMMICALLY ADDVIEW PROBLEM","<android>","1","2","","",""
"3685562","1","","","2010-09-10 14:45:26","1","433","<p>I am trying to get my xml to lay this out properly.  How it is now, the video is mooshed.  If I take away the </p><pre><code>android:layout_below=""@id/day_scroller""</code></pre><p>in the VideoView tag and add</p><pre><code>android:layout_centerHorizontal=""true""</code></pre><p>the video size is now proportioned, but I lose my content that is display in my </p><pre><code>android:id=""@+id/day_container""</code></pre><p>I did not create this layout, but am trying to understand how layouts work and to get this one to work properly.  Any help or leads to where I can gain a better understanding is greatly appreciated!</p><p>Here is what I want:<img src=""http://i.stack.imgur.com/34LEB.jpg"" alt=""alt text""></p><p>And here is the XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p><pre><code>&gt;   &lt;com.accuweather.wordweather.SnapHorizontalScrollView android:id=""@+id/day_scroller""    android:layout_width=""fill_parent""    android:layout_height=""200dip""    android:scrollbars=""none""    android:fadingEdge=""none""    &gt;    &lt;LinearLayout android:id=""@+id/day_container""        android:orientation=""horizontal""        android:layout_height=""fill_parent""        android:layout_width=""wrap_content""        android:paddingTop=""45dip""        /&gt;       &lt;/com.accuweather.wordweather.SnapHorizontalScrollView&gt;   &lt;TextView     android:id=""@+id/location""    android:layout_width=""fill_parent""    android:gravity=""center""     android:layout_height=""wrap_content""    android:background=""@drawable/background""    android:textSize=""20dip""    /&gt;      &lt;ImageView android:id=""@+id/current_alert_icon""       android:layout_width=""wrap_content""       android:layout_height=""wrap_content""       android:src=""@drawable/alert_icon""       android:visibility=""gone""       /&gt;&lt;VideoView android:id=""@+id/videoview""     android:layout_height=""wrap_content""     android:layout_width=""fill_parent""    android:layout_centerHorizontal=""true""    /&gt; &lt;ProgressBar android:id=""@+android:id/progress_large""    style=""?android:attr/progressBarStyleLarge""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:layout_centerInParent=""true""    /&gt;&lt;LinearLayout     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:orientation=""horizontal""     android:layout_alignParentBottom=""true""     android:layout_marginBottom=""4dip""     &gt;     &lt;ImageView android:id=""@+id/scroll_page_1""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/scrollview_page_on""         /&gt;     &lt;ImageView android:id=""@+id/scroll_page_2""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/scrollview_page_off""         /&gt;     &lt;ImageView android:id=""@+id/scroll_page_3""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/scrollview_page_off""         /&gt; &lt;/LinearLayout&gt; &lt;ImageView    android:id=""@+id/logo""     android:scaleType=""fitXY""    android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""    android:layout_marginRight=""10dip""    android:src=""@drawable/logo""    android:layout_marginBottom=""10dip""    android:layout_width=""150dip""    android:layout_height=""13dip""    /&gt;&lt;Button    android:id=""@+id/logo_mask""    android:layout_alignParentBottom=""true""    android:layout_alignParentRight=""true""    android:layout_marginRight=""5dip""    android:layout_marginBottom=""5dip""    android:layout_width=""180dip""    android:layout_height=""50dip""    android:background=""@drawable/trans""    /&gt; </code></pre><p></p>","2186261","","","","","2011-03-10 03:33:00","Help with Android XML layout","<android><xml>","1","1","","",""
"3685790","1","3685867","","2010-09-10 15:11:25","19","15168","<p>Is there a clever way to let the user switch between hide and view password in an android EditText?A number of PC based apps let the user do this.</p>","398460","","","","","2013-01-03 17:54:06","Android: How to switch between hide and view password","<android><passwords>","3","0","7","",""
"3685817","1","","","2010-09-10 15:14:15","0","483","<p>I want to send files  (.csv) from android  to the  MS SQL Server 2008 .  Shoud I use HTTPClient ?  </p><p>How can I do that? </p>","366494","","","","","2010-09-10 15:51:22","Sending files from android to the MS SQL Server 2008","<sql-server><android>","1","0","","",""
"3685844","1","","","2010-09-10 15:17:46","5","1553","<p>I'm sure this is fairly basic, but I don't know quite what to search on to get a concise tutorial.  I want to create an app and make it downloadable on the Android Market for free.  Then, I want to create one or more apps which are just license keys which open up certain functionality on the free app.  What's the best way for the free app to check if the paid apps are present on the device?  Is there an easy way to check by package name or do I need to create a content provider in the paid apps which the free app can call to check validity?</p><p>Or maybe there's some global memory space (like preferences within an app) which all apps can read/write.</p><p>I know one solution that would work, and that I could implement easily - have each paid app call a web service when it first starts and register that phone's IMEI.  This would work, but requires internet access, which may or may not be convenient for my app.</p><p>As with most Android problems - more than one way to skin a cat.  I'm looking for what you guys think is the best (and most secure) approach.</p>","434574","","99834","","2010-09-27 07:25:06","2011-03-15 09:54:45","How to create a license key as a downloadable, and check for it on Android","<android><package><copy-protection><apk><license-key>","1","3","","",""
"3686048","1","","","2010-09-10 15:41:22","0","714","<p>I start service using bindService method.</p><p>But when I click on back button on android emulator  my service is destroyed.</p><p>How can I keep service live in whole application (I must use bindService for communitacion with activities)?</p><p>Thanks</p><p><strong>Update</strong>Here is error log</p><pre><code>09-10 18:28:18.352: ERROR/ActivityThread(905): Activity com.flax.trainer.RunOnly has leaked ServiceConnection com.flax.trainer.RunOnly$1@43e3fb40 that was originally bound here09-10 18:28:18.352: ERROR/ActivityThread(905): android.app.ServiceConnectionLeaked: Activity com.flax.trainer.RunOnly has leaked ServiceConnection com.flax.trainer.RunOnly$1@43e3fb40 that was originally bound here09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.app.ActivityThread$PackageInfo$ServiceDispatcher.&lt;init&gt;(ActivityThread.java:1121)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.app.ActivityThread$PackageInfo.getServiceDispatcher(ActivityThread.java:1016)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.app.ContextImpl.bindService(ContextImpl.java:863)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.content.ContextWrapper.bindService(ContextWrapper.java:347)09-10 18:28:18.352: ERROR/ActivityThread(905):     at com.flax.trainer.RunOnly.butonStartClickHandler(RunOnly.java:85)09-10 18:28:18.352: ERROR/ActivityThread(905):     at java.lang.reflect.Method.invokeNative(Native Method)09-10 18:28:18.352: ERROR/ActivityThread(905):     at java.lang.reflect.Method.invoke(Method.java:521)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.view.View$1.onClick(View.java:2067)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.view.View.performClick(View.java:2408)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.view.View$PerformClick.run(View.java:8816)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.os.Handler.handleCallback(Handler.java:587)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.os.Handler.dispatchMessage(Handler.java:92)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.os.Looper.loop(Looper.java:123)09-10 18:28:18.352: ERROR/ActivityThread(905):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-10 18:28:18.352: ERROR/ActivityThread(905):     at java.lang.reflect.Method.invokeNative(Native Method)09-10 18:28:18.352: ERROR/ActivityThread(905):     at java.lang.reflect.Method.invoke(Method.java:521)09-10 18:28:18.352: ERROR/ActivityThread(905):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-10 18:28:18.352: ERROR/ActivityThread(905):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-10 18:28:18.352: ERROR/ActivityThread(905):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","432848","","432848","","2010-09-10 16:28:33","2012-09-28 20:24:29","Keep android service alive using bindService","<android>","1","3","","",""
"3686131","1","3686929","","2010-09-10 15:52:09","1","322","<p>I'm creating a method that will see if a column in a database row is populated; and if so, it returns the varchar in that row, else it calls a web service to return that data.</p><p>My question is: What is the standard way of simply selecting a column with Android?  (select mycolumn from mytable where _id = x;)</p><p>I've created a ContentProvider around my database. Should I just call 'query' directly?  Note: This method is in a Service</p>","406790","","","","","2010-09-10 17:47:03","Querying Android db for specific piece of data","<android><sqlite><android-contentprovider>","1","0","","",""
"3686151","1","","","2010-09-10 15:53:53","1","804","<p>I have an image of a pattern and I want to create a larger image from this by tilling it so that the user can apply it as a wallpaper. How would I go about doing this?</p><p>The pattern tile can be of varying dimensions.</p><p>I also want to be doing this with a color palette so I have 5 different colours and I want to make a wallpaper that consisted of thick stripes of these colors...not too sure how I should be doing this.</p><p>Thanks!</p>","362476","","362476","","2010-09-10 16:09:26","2011-05-15 15:43:40","Android how to create tiling wallpaper image?","<java><android><image>","1","0","","",""
"3686161","1","","","2010-09-10 15:54:57","1","4314","<p>I am trying to write an app that cannot be killed by a user or another application.  I understand this goes against what Android has designed for its platform, this is more of a proof of concept.  The plan is two have two apps, app1 and app2.  When app1 starts it will start app2 and then bind onto app2, when app2 starts it will make sure app1 is started if not, then start it and bind onto app1.  The point of app1 binding on app2 and app2 binding on app1 is so when one of them gets killed a method will be called that the binding has been disconnected and the app can then be restarted.  I currently have the apps starting each other when they start up but I cannot seem to get them to restart when I force close one of them.  </p><p>For App1 service I have and app2 very similar:</p><pre><code>    @Overridepublic void onCreate(){    this.setForeground(true);    this.startService((new Intent()            .setComponent(new ComponentName(""com.app2"",                    ""com.app2.App2Service""))));    this.bindService((new Intent()            .setComponent(new ComponentName(""com.app2"",                    ""com.app2.App2Service""))), mConnection,            BIND_DEBUG_UNBIND);</code></pre><p>And for my class that implements ServiceConnection I have:</p><pre><code>    @Overridepublic void onServiceDisconnected(ComponentName name){    Log.d(TAG, ""onServiceDisconnected:"" + name.getClassName());    mContext.startService((new Intent()            .setComponent(new ComponentName(""com.app2"",                    ""com.app2.App2Service""))));}</code></pre><p>I think the issue I am having is that onServiceDisconnected never gets called when app1 or app2 is killed.  I think this may be because I am not correctly binding to a service.</p><pre><code>W/JavaBinder(  884): ibinderForJavaObject: 0x436274a0 is not a Binder objectW/JavaBinder(  891): ibinderForJavaObject: 0x43621d30 is not a Binder object</code></pre><p>So my question would be, how can I bind services together so when one gets force closed that I will get a notice on the other?</p>","444509","","321731","","2014-02-21 04:34:07","2014-02-21 04:34:07","Creating an Android Service that cannot be killed","<android><service>","4","2","1","",""
"3686237","1","","","2010-09-10 16:04:08","0","1388","<p>Animations affect only the drawing of widgets, which means after the animation is done, my FrameLayout screenMain is still at its previous location, y need set the FrameLayout in the next location.</p><pre><code>screenMain.setOnClickListener(new View.OnClickListener() {        int i = 0;        @Override        public void onClick(View view) {            if (i % 2 == 0) {                screenMain.startAnimation(translate);                sh.startAnimation(translate);                sg.startAnimation(translate);                i++;            } else {                screenMain.startAnimation(translateb);                sh.startAnimation(translateb);                sg.startAnimation(translateb);                i++;            }        }    });</code></pre><p>Code animation</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set&gt;&lt;translate xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromXDelta=""0.0""        android:toXDelta=""0.0""        android:fromYDelta=""0.0""        android:toYDelta=""180.0""        android:duration=""200""        android:fillAfter=""true""        android:fillEnabled=""true""        /&gt;&lt;/set&gt;</code></pre><p>Code animationb</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set&gt;&lt;translate xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromXDelta=""0.0""         android:toXDelta=""0.0""         android:fromYDelta=""180.0""    android:toYDelta=""0.0""         android:duration=""200""         android:fillAfter=""true""    android:fillEnabled=""true"" /&gt;&lt;/set&gt;</code></pre>","444463","","244296","","2010-09-10 16:06:52","2012-06-14 03:03:08","Android Animations do not affect layout","<android><animation><layout>","1","0","","",""
"3686343","1","3686380","","2010-09-10 16:18:08","7","1073","<p>I am writing an application for Android and am using worker threads to process certain information. Having read through my code I am now unsure if it is thread safe.</p><p>I have written a simplified version of my code, I have omitted the <code>Handler</code> object used to communicate with the main thread and obviously the process itself.</p><pre><code>public class myClass implements Runnable{    private String myString;    @Override    public void run()    {        myString = ""Some Value"";    }}</code></pre><p>This is called by running something similar to this.</p><pre><code>myClass class = new myClass();Thread thread = new Thread(class);thread.start()</code></pre><p>So, is this code not thread safe because I am modifying <code>myString</code> (declared in the main thread) in the <code>run()</code> function?</p>","444538","","444538","","2010-09-11 16:45:20","2010-09-11 16:45:20","Is this thread safe?","<android><multithreading><thread-safety><runnable>","2","1","","",""
"3686399","1","3686589","","2010-09-10 16:26:21","2","963","<p>I am using an AsyncTask to fetch the ring tone for a contact when my application starts, it works fine until after my Activity closes a couple of times during the AsyncTask, after this happens the AsyncTask will only ever get to onPreExecute() and never doInBackground, so I can never fetch the ringtone then until either a force stop or device restart.</p><p>Can anyone explain why this might be happening?</p><p>Why the AsyncTask would get to onPreExecute but then never run doInBackground()?</p><p>Here is my code: (Following the Shelves source code)</p><pre><code>public void getRingTone(){Log.d(""cda"", ""Into getRingTone"");  if (audio_service.getStreamVolume(AudioManager.STREAM_RING) &gt; 0) {     if(aRingTone != null){         oRingtone = RingtoneManager.getRingtone(this,               Uri.parse(aRingTone));    }    this.setVolumeControlStream(AudioManager.STREAM_RING); }}</code></pre><hr><pre><code>private void saveRingToneTask(Bundle outState) {final SelectRingtoneTask task = srtt;if (task != null &amp;&amp; task.getStatus() != AsyncTask.Status.FINISHED) {    task.cancel(true);    srtt = null;}}</code></pre><hr><pre><code>private void restoreRingToneTask(Bundle savedInstanceState) {        srtt = (SelectRingtoneTask) new SelectRingtoneTask().execute();}</code></pre><hr><pre><code>private void onAddRingTone() {srtt = (SelectRingtoneTask) new SelectRingtoneTask().execute();}</code></pre><hr><pre><code>private void onCancelAddRingTone() {if (srtt != null &amp;&amp; srtt.getStatus() == AsyncTask.Status.RUNNING) {    srtt.cancel(true);    srtt = null;}}</code></pre><p>--</p><pre><code>@Overrideprotected void onRestoreInstanceState(Bundle savedInstanceState) {super.onRestoreInstanceState(savedInstanceState);restoreRingToneTask(savedInstanceState);}</code></pre><hr><pre><code>@Overrideprotected void onSaveInstanceState(Bundle outState) {super.onSaveInstanceState(outState);if (isFinishing()) {    saveRingToneTask(outState);}}</code></pre><hr><pre><code>private class SelectRingtoneTask extends AsyncTask&lt;String, Void, Void&gt; {@Overridepublic void onPreExecute() {    Log.d(""cda"", ""Into selectRingToneTask - onPreExecute() - "" + selectRingtoneFinished);    findViewById(R.id.answercallimage).setOnClickListener(new OnClickListener() {        public void onClick(View v) {            try {                    serviceBinder.answer(lineId);                    onCancelAddRingTone();                } catch (RemoteException e) {                    e.printStackTrace();                }        }});    findViewById(R.id.declinecallimage).setOnClickListener(new OnClickListener() {        public void onClick(View v) {            mNotificationManager.cancel(2);            callConnected = false;            try {                serviceBinder.reject(lineId);                onCancelAddRingTone();            } catch (RemoteException e) {                e.printStackTrace();            }        }});}public Void doInBackground(String... params) {    Log.d(""cda"", ""Into selectRingToneTask - !!!!!!!!!!!!!!!"");    if(!this.isCancelled()){    getRingTone();    }    return null;}@Overridepublic void onCancelled() {    Log.d(""cda"", ""Into selectRingToneTask - onCancelled() - "");}@Overridepublic void onPostExecute(final Void unused) {     selectRingtoneFinished = true;       Log.d(""cda"", ""Into selectRingToneTask - onPostExecute - "" + selectRingtoneFinished);       if(oRingtone != null &amp;&amp; playRingTone){            Log.d(""cda"", ""Into getRingTone - PLAY RINGTONE"");             oRingtone.play();        }}}</code></pre><hr><p>And onAddRingtone() is used in onCreate and onCancelRingTone() is used in onDestroy() as well as where you can see if in the code above.</p><p>I have spent 3 days on this and I haven't been able to find a solution? Am I taking the wrong approach? Using cancel wrong? Is there a bug?</p>","243999","","","","","2010-09-10 16:53:57","AsyncTask to run on Activity start fails after previously getting cancelled","<android><android-asynctask><android-1.6-donut>","1","2","","",""
"3686430","1","3686528","","2010-09-10 16:31:05","3","11814","<p>I want to use a Button in my android app but I want to customize how it looks. However, I want the highlight and selected colors of the button to be the same as the default colors (i.e. the dark and light orange gradients, or whatever the theme color supplies).</p><p>Is there anyway to get the default highlight/selected drawables and to use that as the fill for my buttons on the selected and highlighted states?</p><p>Thanks!</p>","440889","","","","","2012-10-05 15:54:26","Android: Use default highlight colors in a custom button","<android><button><colors><themes>","3","0","1","",""
"3686431","1","","","2010-09-10 16:31:09","1","801","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/821085/technology-to-write-iphone-blackberry-and-android-phone-at-the-same-time"">Technology to write iPhone, BlackBerry and Android phone at the same time?</a>  </p></blockquote><p>Is there any common language to develop a same application for iphone, blackberry, windows mobile and android?</p>","444548","","","","","2010-09-10 17:37:55","Is there any common language to develop a same application for iphone, blackberry, windows mobile and android?","<iphone><android><windows-mobile><blackberry>","3","0","","2010-09-11 21:45:33",""
"3686450","1","","","2010-09-10 16:35:29","6","11123","<p>I'm developing an Android application and I would really like to deploy it for the iPhone as well.</p><p>However, I do not know Objective-C and I think it would take an annoyingly long time to figure that and the Apple framework out.</p><p>Is there a recommended way to port an Android application to iOS? Would the best bet be to hire a freelancer?</p>","439836","","96531","","2010-09-10 16:39:50","2011-10-09 13:09:36","How to port Android application to iOS platform?","<java><objective-c><android><ios4>","3","6","5","2013-01-29 21:13:03",""
"3686576","1","3686596","","2010-09-10 16:52:25","2","123","<p>I want to check for someone placing their finger on the center of the screen and dragging to the right, how could this be accomplished?</p><p>SOLUTION:<a href=""http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/"" rel=""nofollow"">http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/</a></p>","431204","","991737","","2012-01-12 18:57:42","2012-01-12 18:57:42","How do you check for someone touching the screen and dragging in a specific direction?","<android><screen>","2","0","","",""
"3686729","1","7040645","","2010-09-10 17:15:59","18","10211","<p>I have a VideoView that takes up the top half of the Activity in portrait orientation with the bottom half of the screen showing some images and text.  I am playing a rtsp video stream in the video view when the Activity starts.  I have attached a MediaController to the VideoView via the following code:</p><pre><code>    MediaController controller = new MediaController(this);    controller.setAnchorView(this.videoView);    controller.setMediaPlayer(this.videoView);    this.videoView.setMediaController(controller);</code></pre><p>When I tap the VideoView to bring up the MediaController on the screen I expected the playback controls to appear overlaying the bottom area of the VideoView (the bottom of the MediaController even with the bottom of the VideoView).  Instead the MediaController pops up lower down on the screen, overlaying some of the graphics and text I have below the VideoView.  </p><p>Are there some additional steps I need to take to get the MediaController to appear where I want it to on the screen?</p>","13070","","","","","2013-12-04 10:39:30","MediaController positioning over VideoView","<android>","4","4","7","",""
"3686742","1","3686915","","2010-09-10 17:17:52","1","877","<p>I want to build a data structure in my  application to store many entries indexed by keys. Each entry has several parameters to retrieve and update.</p><p>Could you suggest me which structure is most efficient among these following ones:</p><ul><li>hashmap </li><li>SQL Lite</li><li>hashtable</li><li>others</li></ul><p>Thanks in advance.</p>","306103","","","","","2010-09-10 20:18:17","Best efficient data structure to store object in Android application","<sql><android><database>","2","4","","",""
"3686766","1","","","2010-09-10 17:22:21","1","1326","<p>The following code produces a list with no entries:</p><pre><code> AssetManager am = getContext().getAssets();    try {        String[] xmls = am.list(""assets/images"");        //Do something...    }    catch(IOException e)    {    }</code></pre><p>There are plenty of files in my assets/images directory. What's wrong here?</p>","430890","","","","","2010-09-10 18:15:04","AssetManager list not Returning anything","<android>","1","0","","",""
"3686788","1","3686823","","2010-09-10 17:25:50","4","4433","<p>I am currently facing the following problem: whenever my Android application is started, it needs to execute some time consuming initialization code. Without this code all my activities/services within the application won't work correctly.</p><p>So far, I have put this initialization code into a SplashScreen activity, which I declared as MAIN activity in the manifest. Once the initialization code has been executed, I finish() the splash screen and start the actual main activity, i.e. an activity consisting of several tabs, from where the user can reach several other activities.</p><p>The problem is now the following: when my app is put in the background, after some time and after launching other apps, my app/process is killed. When I re-launch it from the homescreen, Android restores the activity stack (task) and invokes onCreate() on them. However, the splash screen activity and hence the initialization code aren't executed, which results in an exception.</p><p>I could put now the initialization code in the application's onCreate(), however this results in a black screen until the method finishes.</p><p>Does anybody have an idea, where and how I can properly initialize my app on startup?</p><p>Initialization code:</p><pre><code>public void init() {    if (initialized) {        return;    }    // Initialize terms    List&lt;Tag&gt; tags= DynamicDao.loadAll(Tag.class);    int numTags = tags.size();    terms = new String[numTags];    for (int i = 0; i &lt; numTags; i++) {        terms[i] = tags.get(i).getTag();    }    // Initialize document-term matrix    List&lt;Item&gt; items = DynamicDao.loadAll(Item.class);    createDocumentTermMatrix(items);    initialized = true;}</code></pre><p>Note: An Item has several associated tags, from which I need to create a document vector. </p>","441370","","441370","","2010-09-10 19:34:53","2010-09-10 19:56:17","Initializing an Android application","<java><android><sdk><activity>","3","0","0","",""
"3686974","1","3687104","","2010-09-10 17:51:24","2","3987","<p>I am using Environment.getExternalStorageDirectory() to create a file and I will need to know if there is enough space available before I create and store the file.</p><p>If you can cite the Android Ref doc, that would be helpful too.</p>","157804","","","","","2010-12-02 18:37:46","How to get the available space on Android sdcard?","<android><environment><sd-card>","3","0","2","",""
"3687065","1","3687385","","2010-09-10 18:02:25","40","29937","<p>Calling TextView.setTextSize is working abnormally. Right after the call to setTextSize if we get a getTextSize its returning a much higher value that what we set it to earlier. </p><p>Here's what we're doing:</p><pre>        zoomControl.setOnZoomInClickListener(new OnClickListener() {            public void onClick(View view) {                float size = mViewShabad.getTextSize() + 1;                textView.setTextSize(size);            }        });</pre><p>Has anyone seen this before?</p>","368416","","903469","","2014-03-28 07:09:38","2014-03-28 07:09:38","TextView.setTextSize behaves abnormally - How to set text size of textview dynamically for diffrent screens","<android><textview>","2","1","11","",""
"3687200","1","6636893","","2010-09-10 18:18:39","8","17227","<p>I want to implement the <code>startForeground()</code> method in the <code>Service</code> class for prevent service self kill.</p><p>Can anybody sent me code for implementing this method?</p>","432848","","71421","","2011-06-15 22:54:17","2013-08-23 11:11:39","Implement startForeground method in Android","<android>","4","0","7","",""
"3687272","1","3687591","","2010-09-10 18:28:50","1","3810","<p>In my Android app, when a user tries to transition from one activity to another, there may be some global state that indicates they need to complete some other action first.</p><p>To accomplish this, I've written a class with the following code:</p><pre><code>private static WeakReference&lt;Activity&gt; oldActivityReference;private static Intent waitingIntent;public static void pushActivity(Activity currentActivity, Intent newActivityIntent) {    Intent blockingIntent = ThisClass.getBlockingActivity();    if (blockingIntent != null) {        ThisClass.oldActivityReference = new WeakReference&lt;Activity&gt;(currentActivity);        ThisClass.waitingIntent = newActivityIntent;        currentActivity.startActivity(blockingIntent);        return;    }    currentActivity.startActivity(newActivityIntent);}</code></pre><p>When the blocking activity finishes, it calls ThisClass.blockingActivityFinished().  That will check to see if the weak reference to the old activity still exists and, if so, launch the original intent from that activity.  If not, it will launch the original intent from my application's context.</p><p>My question is,<br/><strong>Does this sound sane?  Are there any potential memory leak issues with this technique?  Is there a better way to accomplish this?</strong></p><p>EDIT -To be clear, the types of events that might trigger an interruption are 1) a server ping indicating that the current app version is deprecated 2) any server RPC indicating that the user's credentials are no longer valid.  I do <em>not</em> want to add logic to every Activity to handle checking for these, and resuming business as usual once they complete.  That is a violation of DRY, and error-prone in a team environment.</p>","205192","","205192","","2010-09-10 19:35:29","2010-09-10 19:35:29","WeakReference to Activity (Android)","<android><memory-leaks><activity><weak-references>","1","0","","",""
"3687315","1","3687333","","2010-09-10 18:34:52","75","44139","<p>How do I delete SharedPreferences data for my application?</p><p>I'm creating an application that uses a lot of web services to sync data. For testing purposes I need to wipe out some SharedPreferences values when I restart the app.</p>","406790","","","","","2014-03-26 13:22:50","Deleting shared preferences","<android><sharedpreferences>","9","0","20","",""
"3687393","1","3688245","","2010-09-10 18:42:52","1","392","<p>I have a service setup to receive a PACKAGE_ADDED and a PACKAGE_REMOVED intent from all <code>&lt;data android:scheme=""package"" /&gt;</code></p><p>I receive the intent correctly, but I need to know how to use the Intent and Context classes from onReceive to get the name and label of the application that was added or removed.</p><p>I have been able to use Intent.getDataString() to get the uri string of the package, but don't really know where to go from there.</p><p>Thanks.</p>","333525","","","","","2010-09-10 20:50:30","how do you get the name of a package that dispatched an intent in android?","<android><android-intent><package><broadcastreceiver>","1","1","","",""
"3687413","1","3687467","","2010-09-10 18:44:53","3","1601","<p>I'm getting more and more requests about being able to use an App to SD feature that must be part of Android 2.2, but I really have no experience with it.  I also don't know where to find any documentation regarding how to make my apps compatible with this feature.  People have told me my apps cannot be moved to the SD card.</p><p>My mind is also telling me that this is a really bad idea for paid apps that don't have license protection of any kind.</p><p>Has anyone had any experience with this, know of any documentation, or have any tips regarding what would stop an app from being compatible with this feature?</p><p>Note: I do not use copy protection on my apps.</p>","179518","","","","","2010-09-10 19:00:54","App to SD functionality on Android","<android><android-sdcard>","3","0","2","",""
"3687442","1","","","2010-09-10 18:48:39","3","1100","<p>I am having problems with nine patch images ( **.9.png ). I have a widget layout and would like to use nine patch images for the widget's backgroud. Here is my background.xml</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true"" android:state_pressed=""true"" android:drawable=""@drawable/appwidget_bg"" /&gt;    &lt;item android:state_focused=""false"" android:state_pressed=""true"" android:drawable=""@drawable/appwidget_bg"" /&gt;    &lt;item android:state_focused=""true"" android:drawable=""@drawable/appwidget_bg"" /&gt;    &lt;item android:state_focused=""false"" android:drawable=""@drawable/appwidget_bg"" /&gt;&lt;/selector&gt;</code></pre><p>The drawbales name is ""appwidget_bg.9.png"". This stuff works fine. But I would like to use different images for the focused and pressed states.</p><p>So I make it look like this:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_focused=""true"" android:state_pressed=""true"" android:drawable=""@drawable/appwidget_bg_pressed"" /&gt;    &lt;item android:state_focused=""false"" android:state_pressed=""true"" android:drawable=""@drawable/appwidget_bg_pressed"" /&gt;    &lt;item android:state_focused=""true"" android:drawable=""@drawable/appwidget_bg_pressed"" /&gt;    &lt;item android:state_focused=""false"" android:drawable=""@drawable/appwidget_bg"" /&gt;&lt;/selector&gt;</code></pre><p>The problem: As soon as I add the additional drawable ""appwidget_bg_pressed.9.png"" I get the following error message:</p><p>.../res/drawable/widget_bg.xml:21: ERROR Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_bg').</p><p>.../AndroidManifest.xml:6: ERROR Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon').</p><p>It seems like I can only add one nine patch drawable to the drawables folder. Why is that?</p>","268125","","","","","2010-11-01 18:19:51","Android: Not more than 1 nine patch image at a time?","<android><xml><widget><drawable><nine-patch>","1","0","1","",""
"3687476","1","3688175","","2010-09-10 18:52:23","3","5066","<p>I see posts saying that FrameLayout is the alternative, and that I should use margins to position things (this strikes me as wildly counter intuitive, but ok... if it works, I'll take it). However, I can't get it to work, so, I'm looking for assistance. </p><p>here's my code</p><pre><code>    FrameLayout layout = new FrameLayout(this);    layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    Button btn = new Button(this);    btn.setBackgroundResource(R.drawable.btn);    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);    lp.setMargins(100,100,100,100);    btn.setLayoutParams(lp);   //i've tried with and without this line, no change    layout.addView(btn , lp);</code></pre><p>The button is drawn at 0,0 no matter what I do.  When I change the lp's LayoutParam to FILL_PARENT the button is then stretched to take up the entire screen (which makes sense).</p><p>HOW do you get it to draw somewhere else on the screen, irrespective of what else is there? </p><p>As always, super grateful in advance.</p><p>[EDIT]It seems my question isn't entirely clear (given the answers) so...</p><p>In the code above, the intent is to create a button, pass it to a layout and have it draw at 100,100 on the screen.</p><p>I'm aware of the fact that this may mean different things on different devices. I'm ok with that.  I simply need a way to, programatically, and at run time, place an item at a SPECIFIC location. I don't want to rely on gravity (or the laws of thermodynamics). I just want to specify a location and have the element appear there :)</p>","59947","","59947","","2010-09-10 20:05:41","2010-09-10 20:39:12","What is the alternative to AbsoluteLayout in Android?","<android>","3","2","2","",""
"3687543","1","3688351","","2010-09-10 19:03:56","0","521","<p>I've an app that uses Android accounts - GoogleLoginService on (&lt; 2.1) and AccountManager on 2.1 or greater. the app works fine on phones, but doesn't work on any of the emulators.</p><p>When I try adding accounts in emulator, it fails. In 1.6, option doesn't even exist.</p><p>Is there a workaround? I heard that there is a custom system.img that has Accounts inbuilt, but cant find one. I need it for 1.6, 2.1, 2.2</p>","389161","","","","","2010-09-10 21:07:21","Missing Accounts in Android Emulator","<android><android-emulator>","1","1","1","",""
"3687661","1","5225324","","2010-09-10 19:23:17","4","2405","<p>In my thread I create an inner activity 'B' at one point in order to launch another activity for result. I need to declare this  in my Android manifest file but can not work out what the name of it is as the standard "".B"" does not work as it says that activity does not exist. How can I declare this activity?</p><p>Thanks</p>","300037","","","","","2011-03-07 21:13:22","Declare Inner Activity In The Android Manifest","<android><activity>","3","3","","",""
"3687813","1","","","2010-09-10 19:46:18","0","1217","<p>I am trying to change the locale programmatically on Android. The code I have below works fine on the Incredible(2.2) and Droid(2.2). However, it doesn't on the DroidX(2.1 Update 1)</p><p>Anyone here have encountered similar problem ?? Any insight would be helpful.</p><pre><code>public void overrideLocale(String languageToLoad) {     Locale locale = new Locale(languageToLoad);    Locale.setDefault(locale);    Configuration config = new Configuration();    config.locale = locale;     getBaseContext().getResources().updateConfiguration(config, null);    Intent intent = new Intent(this, ActivityB.class);    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);    startActivity(intent); }</code></pre>","444174","","390177","","2012-05-26 13:00:18","2012-05-26 13:00:18","Changing locale programmatically on DroidX(2.1 Update 1) does not work?","<android><locale>","2","0","0","",""
"3687858","1","","","2010-09-10 19:52:39","1","1019","<p>I've been struggling with the runOnFirstFix() method for quite a long time. And maybe the problem is in that first line that says <code>Running deferred on first fix</code>.</p><p>The thing is, when the first fix gets executed and I am displaying some dialog in that moment, it crashes quite frequently.</p><p>I've extracted the following from the logcat:</p><pre><code>I/Maps.MyLocationOverlay( 2425): Running deferred on first fix: com.MyApp.Map$2@43aef8e8W/dalvikvm( 2425): threadid=23: thread exiting with uncaught exception (group=0x4001e170)E/AndroidRuntime( 2425): Uncaught handler: thread Thread-24 exiting due to uncaught exceptionE/AndroidRuntime( 2425): java.lang.NullPointerExceptionE/AndroidRuntime( 2425):  at com.google.android.maps.MapController.animateTo(MapController.java:232)E/AndroidRuntime( 2425):  at com.google.android.maps.MapController.animateTo(MapController.java:203)E/AndroidRuntime( 2425):  at com.MyApp.Map$2.run(Map.java:129)E/AndroidRuntime( 2425):  at java.lang.Thread.run(Thread.java:1096)</code></pre><p>I haven't found any reference to anything similar and that makes me suspect I am doing something wrong in a very basic level. Has anyone seen this before?</p>","444696","","","","","2011-03-31 16:29:43","Android's maps library throws NullPointerException when animateTo is executed while a dialog is shown","<android><dialog><android-mapview>","2","1","","",""
"3688058","1","3688092","","2010-09-10 20:19:54","3","1474","<p>I have two activities, activity 1 and activity 2 for example. Activity 1 will call activity 2 and send an arraylist which will then be modified. This I have already done using an intent. What I now want to do, is when activity 2 calls finish() I want that modified arraylist to be sent back to activity 1 so that it has the most upto date version of that arraylist.</p><p>Activity 1:</p><pre><code>Bundle b = new Bundle();b.putParcelableArrayList(""com.Woody.RingerSchedule"", schedules);Intent i = new Intent(this, addSchedule.class);i.putExtras(b);startActivity(i);</code></pre><p>Activity 2 so far:</p><pre><code>Bundle b = getIntent().getExtras();final ArrayList&lt;Schedule&gt; schedules = b.getParcelableArrayList(""com.Woody.RingerSchedule"");//modify arraylist//need code here to return arraylist to activity 1finish();</code></pre><p>Any help appreciated.</p>","444707","","","","","2010-09-10 20:31:02","Return an arraylist from an activity in android","<android>","1","0","1","",""
"3688077","1","3688419","","2010-09-10 20:22:45","2","1091","<p>I want to be able to automatically unpause my app when the user exits from the options menu. (unless, of course, they have selected <em>pause</em>...)</p><p>Handling it <code>onOptionsMenuClosed</code> works fine for the top level menu but is not called for a submenu. The higher level <code>onPanelClosed</code> does not appear to be called either.</p><p>I can detect when they enter the menu and if they make a selection but not if they just hit the menu button to exit.</p><p>I could rewrite the whole submenu to use a dialog but I'd rather not if it can be avoided.</p><p>Does anyone have any suggestions?</p>","444709","","","","","2010-09-10 21:59:55","android onOptionsMenuClosed not being called for submenu","<android><submenu>","2","2","","",""
"3688300","1","","","2010-09-10 20:59:48","2","837","<p>I'm trying to create a ""select-multiple"" contact list where I can allow a user to check more than one contact. What I'm looking for is effectively the same thing as the native activity that appears when composing a message to multiple contacts. Thanks!</p>","145279","","","","","2013-10-31 12:33:42","Android Contact Picker Checklist","<android><contacts>","1","2","","",""
"3688657","1","3689856","","2010-09-10 21:58:35","1","556","<p>I m developing android apps.</p><p>I have to connect android market in my application.</p><p>So ,kindly suggest me how to connect android market.</p><p>Thanks in adv.</p>","412168","","","","","2011-10-24 15:53:40","How to connect android market in an application?","<android>","1","1","1","",""
"3688674","1","","","2010-09-10 22:01:44","1","389","<p>I have an application with many forms implemented as separate activities.  The form variables are dynamically built based on a database, and there are a ton of variables in the C++ side of the application (accessed via JNI).  I don't see how saving out all of this data to persistent storage each time the onPause() or the onSaveInstanceState() of one of these many activities goes into the background is a smart use of processor time.  And I don't see how even if I save the local variables for each activity during that time I'd be able to restore a single activity within the context of all the others.  </p><p>I have set up a service that auto saves the files when I detect that the app has gone into the background.  (I set a time stamp when onPause() is called in any activity and then clear the time stamp when onResume() is called on any other activity.  If the time elapsed is more than a few seconds, I know I'm not the top activity any longer and the service saves the files).  </p><p>What I'd like to do is continue on as normal unless the OS kills one of my activities.  Since we don't always get notified of this, I thought it would be nice if there were a way to tell the OS that I'd rather you kill the whole app than just one activity.  </p><p>Thanks in advance!</p>","444788","","","","","2010-09-10 22:13:35","How to stop an application if any of the activities were killed by the OS","<android><lifecycle>","1","0","","",""
"3688806","1","","","2010-09-10 22:21:40","3","1536","<p>On froyo, when I get a Link exception while loading a library, it does not give the symbol that it could not find! On eclair, there used to be a helper message saying ""cannot locate xyz symbol'. Without, this information, how do I debug this library load error on Froyo? I am using <strong>System.load</strong> to load libabcjni.so.</p><p>When I build the testapp, I can see the following line for libabcjni.so:  </p><p>adding: lib/armeabi/libabcjni.so (deflated 75%)</p><p>Android log:</p><pre><code>D/BLURDAEMON( 3653): onCreate()D/DaemonManager( 3653): Going to load native libD/BlurMbus::Loader( 3653): File: /data/data/com.abc.testapp/files/libabcjni.soD/BlurMbus::Loader( 3653): Size: 1012148D/BlurMbus::Loader( 3653): Going to System.loadD/dalvikvm( 3653): Trying to load lib /data/data/com.abc.testapp/files/libabcjni.so 0x449214a8I/dalvikvm( 3653): Unable to dlopen(/data/data/com.abc.testapp/files/libabcjni.so): Cannot load library: link_image[1995]: failed to link libabcjni.soI/dalvikvm( 3653):D/BlurMbus::Loader( 3653): Link Exception Library /data/data/com.abc.testapp/files/libabcjni.so not foundE/BlurMbus::NativeInterface( 3653): Error loading ----&gt;libabcjni &lt;----</code></pre>","442903","","995926","","2012-05-05 13:51:17","2012-05-05 13:51:17","How do I debug System.load link exception on Android Froyo?","<android><load><android-2.2-froyo>","1","0","1","",""
"3688898","1","","","2010-09-10 22:42:22","7","1068","<p>I've been learning Android and have come across an issue with launchMode=""singleTask"". The documentation states that when this attribute is used, the Activity is always launched into a new task as the root Activity. Secondly, the documentation states that if an Intent is targeted at such an Activity when there are Activities sitting above it in its task stack, such Intents are discarded (although the task is still brought to the foreground).</p><p>I've been playing around with this, and the behaviour I observe is completely different. In particular:- Activities with launchMode=""singleTask"" are not always the root Activity in a task stack. They are just plonked ontop of the existing stack with the same affinity.- When an Intent is targeted at such an Activity and there are other Activities above it in the stack, the Intent is not discarded. Instead the Activities above it in the stack are discarded. The Intent is then delivered via onNewIntent to the Activity as normal.</p><p>Can someone confirm that this is the actual behaviour? If so, why are the documents incorrect? If not what have I done wrong. . .</p><p>EDIT:</p><p>An example demonstrating this behaviour can be found here:<a href=""http://groups.google.co.uk/group/android-developers/browse_thread/thread/fd8f249803b4688a#"">http://groups.google.co.uk/group/android-developers/browse_thread/thread/fd8f249803b4688a#</a>Sorry for the cross-post, however I was unable to get the example in a decent format to post here...</p>","442816","","442816","","2010-09-10 23:10:22","2013-03-13 22:22:30","Android: Behaviour of launchMode=""singleTask"" not as described?","<android>","3","1","2","",""
"3688922","1","3689085","","2010-09-10 22:48:55","1","787","<p>I have a custom list adapter contains a layout with controls in it.  I was wondering how I can get each individual controls id?  I am planning on changing the color of some textviews.</p><pre><code>private void UpdateDisplay() {    // define the list which holds the information of the list    List&lt;Map&lt;String, Object&gt;&gt; resourceNames = new ArrayList&lt;Map&lt;String, Object&gt;&gt;();    // define the map which will hold the information for each row    Map&lt;String, Object&gt; data;    if (appts.size() &gt; 0) {        for (int i = 0; i &lt; appts.size(); i++) {            data = new HashMap&lt;String, Object&gt;();            data.put(""apptListType"", appts.get(i).getType().getName());            data.put(""apptListTime"", DateFormat.getTimeInstance(                    DateFormat.SHORT).format(appts.get(i).getStartDate())                    + "" - ""                    + DateFormat.getTimeInstance(DateFormat.SHORT).format(                            appts.get(i).getEndDate()));            data.put(""apptListContactName"", appts.get(i).getContact()                    .getFullName());            data.put(""apptListContactCompany"", appts.get(i).getContact()                    .getCompany());            resourceNames.add(data);        }    } else {        data = new HashMap&lt;String, Object&gt;();        data.put(""apptListType"", ""No appointments found for today."");        data.put(""apptListTime"", """");        data.put(""apptListContactName"", """");        data.put(""apptListContactCompany"", """");        resourceNames.add(data);    }    apptDescription = new SimpleAdapter(this, resourceNames,            R.layout.apptlistitem, new String[] { ""apptListType"",                    ""apptListTime"", ""apptListContactName"",                    ""apptListContactCompany"" }, new int[] {                    R.id.apptListType, R.id.apptListTime,                    R.id.apptListContactName, R.id.apptListContactCompany });    ListView apptList = (ListView) findViewById(R.id.apptsList);    apptList.setAdapter(apptDescription);    apptList.setOnItemClickListener(AppointmentDailyView.this);    apptList.setItemsCanFocus(true);</code></pre><p>and here is my xml file for each listitem:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;TextView android:id=""@+id/apptListType"" android:textSize=""20px""    android:textColor=""#333"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content"" android:textStyle=""bold"" /&gt;&lt;TextView android:layout_below=""@+id/apptListType"" android:id=""@+id/apptListTime""    android:textSize=""15px"" android:textColor=""#666"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" &gt;&lt;/TextView&gt;&lt;TextView android:layout_below=""@+id/apptListTime"" android:id=""@+id/apptListContactName""    android:textSize=""20px"" android:textColor=""#333"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;TextView android:layout_toRightOf=""@+id/apptListContactName""    android:layout_below=""@+id/apptListTime"" android:id=""@+id/apptListContactCompany""    android:textSize=""15px"" android:textColor=""#666""    android:layout_height=""wrap_content"" android:layout_width=""wrap_content""    android:paddingLeft=""5px"" android:layout_marginTop=""3px""&gt;&lt;/TextView&gt;</code></pre><p></p><p>Any help is appreciated, thanks.</p>","408079","","","","","2010-09-10 23:37:26","How to get a controls id from a custom List adapter in android?","<android><list><controls><listadapter>","1","0","","",""
"3688925","1","3689662","","2010-09-10 22:50:22","6","14085","<p>Greetings all.I've got a little problem...Well, let me first state what I'm trying to accomplish.I had a spinner that pulls strings out of a stored array. Like so, you dont need to read it though:</p><pre>ArrayAdapter healthadapter = ArrayAdapter.createFromResource(                    this, R.array.health, android.R.layout.simple_spinner_item);            mHealthSpin = (Spinner) findViewById(R.id.health_spin);healthadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);mHealthSpin.setAdapter(healthadapter);</pre><p>Simple and almost sufficient. I would like to add an image to the spinner.. the radio button is not necessary. So the spinner should pop up and have a list: </p><pre>TEXT     *IMAGE*TEXT2    *IMAGE*TEXT3    *IMAGE*</pre><p>So far I've got a custom SimpleAdapter. <strong>Here is the Problem!!</strong> : the text comes up but not the image. Heres the code:</p><pre>public class stageadapter extends SimpleAdapter {private Context localContext;private ArrayList> localList;public stageadapter(Context context,    ArrayList> list, int resource,    String[] from, int[] to) {super(context, list, resource, from, to);localContext = context;localList = list;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {if (null == convertView) {    LayoutInflater inflater = (LayoutInflater) localContext            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);    convertView = inflater.inflate(R.layout.stagerow, null);}TextView name = (TextView) convertView.findViewById(R.id.stage_name);name.setText((String)localList.get(position).get(""Name""));ImageView icon = (ImageView) convertView.findViewById(R.id.stage_icon);icon.setImageResource(R.drawable.icon);return convertView;}@Override public View getDropDownView(int position, View convertView,             ViewGroup parent) { if (null == convertView) {    LayoutInflater inflater = (LayoutInflater) localContext            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);    convertView = inflater.inflate(R.layout.stagerow, null);}TextView name = (TextView) convertView.findViewById(R.id.stage_name);name.setText((String)localList.get(position).get(""Name""));ImageView icon = (ImageView) convertView.findViewById(R.id.stage_icon);icon.setImageResource(R.drawable.icon);return convertView;}}</pre><p>I plan to use a switch statement to set different images to each name. however i stopped here until i can get any image to show.</p><p>How i'm calling</p><pre>   ArrayList> list = new ArrayList>();            HashMap map = new HashMap();            map.put(""Name"", ""One"");            map.put(""Icon"", R.drawable.icon);            list.add(map);            map = new HashMap();            map.put(""Name"", ""Two"");            map.put(""Icon"", R.drawable.icon);            list.add(map);            mStageSpin = (Spinner) findViewById(R.id.stage_spin);                                   stageadapter adapter = new stageadapter(getApplicationContext(), list, R.layout.stagerow, new String[] {                                                 ""Name"", ""Icon""}, new int[] {                                                     R.id.stage_name, R.id.stage_icon });           mStageSpin.setAdapter(adapter);</pre><p>The answer for me is in the comments</p>","393328","","393328","","2010-09-11 19:20:41","2013-02-18 14:39:50","Simple Adapter problem, Text + Image in spinner. Java, Android","<java><android>","4","0","7","",""
"3688932","1","5183983","","2010-09-10 22:51:19","3","2795","<p>My app is using this Intent to take photos:<br><code>startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE),TAKE_PICTURE);</code><br>But the resolution is really low...</p><p>Is there any way to improve the resolution? or I have to create my own Camera Activity?</p>","419921","","419921","","2010-09-10 23:06:21","2012-07-18 07:44:58","Intent to take photo with better resolution?","<android>","2","4","2","",""
"3688993","1","5669446","","2010-09-10 23:06:42","28","9685","<p>How can I create a video file from a series of images/photos on Android?Can this be done with the current SDK? or do I need a codec library?</p><p>Thanks.</p>","203111","","","","","2013-07-30 03:05:44","Encode a series of Images into a Video","<android><video-encoding>","4","0","16","",""
"3689068","1","","","2010-09-10 23:32:16","0","299","<p>I have an activity with 5 buttons. I want to use the switch option. How can I detect which button is clicked?</p>","381479","","899344","","2012-08-20 05:00:00","2012-08-20 05:00:00","Switch and case option ","<android>","1","0","","",""
"3689274","1","3689288","","2010-09-11 00:38:40","0","413","<p>I have a very tough problem I can't solve.  I have an app which I can put into airplane mode remotely to save power.  I have a thread running which gets the power-save message, removes callbacks for all other threads, puts the phone into airplane mode, and waits a specified number of minutes before waking the phone back up.</p><p>When the phone is plugged into my laptop (USB debugging enabled, etc) then this functionality is fine.  The phone goes into airplane mode, the screen locks, and then after a specific number of minutes the app ""wakes up"" and continues as normal.</p><p>When the phone is plugged into a car charger, the phone phone goes into airplane mode, but the thread never wakes up the phone.  This problem only occurs when the screen is also set to timeout...when I set the screen to ""never timeout"" and have the phone plugged into a car charger, the app wakes up just fine.</p><p>It appears that some combination of power source and the screen timing out kills my power-save thread at a system level.  I know this post is very specific to my application, but has anyone encountered a problem similar to this before?</p>","355663","","418613","","2012-06-12 13:02:14","2012-06-12 13:02:14","Android screen lock/car charger is killing my thread","<android><multithreading><power-management><airplane>","1","0","","",""
"3689380","1","3689896","","2010-09-11 01:09:04","1","742","<p>I have some 34 checkboxes on one Activity which i have to mark and unmark. and I want to save the status of the each checkbox. </p><p>I want this persistently. So should i have a sqlite table or preferences ?</p><p>If sqlite table is recommended, then what should be the ideal table structure design?</p>","255721","","244296","","2010-09-11 05:17:35","2010-09-13 13:43:10","what is Best way to save the large number of Checkboxes state in Android?","<android><checkbox><savestate>","1","0","","",""
"3689416","1","3689620","","2010-09-11 01:20:59","3","1252","<p>This should be easy, but I'm having trouble figuring out how to zoom an <code>ImageView</code>. I have an <code>ImageView</code> inside of a <code>ScrollView</code> and a <code>HorizontalScrollView</code>. I floated a <code>ZoomControls</code> over the ImageView and now I'm trying to figure out how to actually zoom the image.</p><p>I was thinking I would just scale the <code>Drawable</code> inside of the <code>ImageView</code>, but I can't figure out an easy way to do this.</p><p>How should I be going about displaying an image that I can both zoom and scroll?</p><p>(And yes, I know about WebViews, but it seems wasteful to load an entire WebView just to display one image.)</p>","118391","","","","","2010-09-11 02:56:09","Zooming an ImageView","<android><imageview>","1","0","","",""
"3689460","1","","","2010-09-11 01:47:04","6","2908","<p>I want to create Service using <code>bindService</code>  method.But when I close one Activity my Service is destroyed, I don't want that.</p><p>I try to put service foreground using  <code>startForeground(NOTIFICATION_ID, notification);</code> service onCreate , but service still destroy.</p><p>Now I try with call two methods for starting Service at same time :</p><pre><code>    Intent bindIntent= new Intent(this, ServiceC.class);    startService(bindIntent);    bindService(bindIntent, onService, BIND_AUTO_CREATE);</code></pre><p>With calling this two methods Service not destroyed. My app work fine at this method.</p><p>Can someone explain to me whether this is a good way or if is not  can you please give me idea why <code>startForeground(NOTIFICATION_ID, notification);</code> not work ?</p><p>Who is the best way to use bindService  but in same time I don't want to service self destroy.</p><p>Thanks!!!</p>","432848","","185655","","2012-01-17 10:57:47","2014-01-18 17:57:13","Android bindService or/and startService ","<android>","2","1","4","",""
"3689473","1","","","2010-09-11 01:54:05","3","3355","<p>With ThreadSafeClientConnManager.requestConnection(HttpRoute route, Object state), what is the second item ""state"" supposed to be?</p><p>Ultimately I'm trying to ThreadSafeClientConnManager.releaseConnection(ManagedClientConnection conn, long validDuration, TimeUnit timeUnit) to release the connection. But I need the ManagedClientConnection, which is only available from the requestConnection method (via the returned ClientConnectionRequest)</p>","444887","","444887","","2010-09-14 06:14:01","2013-07-17 07:06:46","How to use ThreadSafeClientConnManager.requestConnection(HttpRoute route, Object state)","<android><apache>","2","0","","",""
"3689535","1","3744612","","2010-09-11 02:23:24","2","961","<p>I have an MP3 file that I can play outside of Android and stored on the sdcard.  I did the call to                     </p><pre><code>MediaScannerConnection.scanFile(mContext, ...</code></pre><p>so it has been discovered.  In Froyo, the ringtone shows up in the <code>**Sound -&gt; Phone ringtone**</code> list.  In Eclair it does not list (I expected it in the <code>User add ringtones</code> dialog.)</p><p>In Froyo, the ringtone plays in preview mode when selected.  However, when the phone receives an incoming call, it is silent -- but not in the ""silent mode"" sense (i.e., the phone does not vibrate).  If I change the ringtone, it plays during ringing.</p><p>Any magical clues?</p><p>More information .... I think it is the format ...</p><p>If I do a Unix ""file"" command, it shows two file types for my ringtones.  Only one of the six work.</p><pre><code>/Volumes/sd1/Ringtones/ringtone09.mp3:  Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v2,  64 kbps, 22.05 kHz, JntStereo/Volumes/sd1/Ringtones/ringtone02.mp3:  Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v2,  64 kbps, 22.05 kHz, JntStereo/Volumes/sd1/Ringtones/ringtone12.mp3:  Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v2,  64 kbps, 22.05 kHz, JntStereo/Volumes/sd1/Ringtones/ringtone44.mp3:  Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v2,  64 kbps, 22.05 kHz, JntStereo/Volumes/sd1/Ringtones/ringtone04.mp3:  Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1,  64 kbps, 44.1 kHz, Monaural/Volumes/sd1/Ringtones/ringtone37.mp3:  MPEG ADTS, layer III, v1,  64 kbps, 44.1 kHz, Monaural</code></pre><p>The last one that is MPEG ADTS, layer III, v1, 64 kbps, 44.1 kHz Monaural works!The JntStereo ones do not!</p><p>Another discovery today.  All of the ringtones work as expected on Eclair once I switched to setting the Media Content Resolver instead of relying on the scan.  The Froyo device still behaves as described above.</p>","157804","","168868","","2012-05-06 03:08:09","2012-05-06 03:08:09","My custom ringtone previews but is silent during incoming call?","<android><ringtone><android-2.2-froyo><android-2.0-eclair>","1","0","1","",""
"3689544","1","3689572","","2010-09-11 02:26:04","5","9983","<p>How to restore the dialog etc after rotating the screen? For example, pop up an alertDialog to tell user some information. then the user rotate the screen to another orientation. How to restore the alertDialog? Can any one guide me to do it? Thanks!</p><p>Appended later:</p><p>I looked into the android source code and find these things:</p><p>Dialogs are stored in <code>mManagedDialogs</code>, and the related information is:</p><pre><code>mManagedDialogs = new SparseArray&lt;ManagedDialog&gt;();</code></pre><p><code>onSaveInstanceState</code> related:</p><pre><code>final void performSaveInstanceState(Bundle outState) {    onSaveInstanceState(outState);    saveManagedDialogs(outState);}</code></pre><p>In <code>saveManagedDialogs</code>, it has something to do with <code>mManagedDialogs</code>.</p><p><code>onRestoreInstanceState</code> related:</p><pre><code>final void performRestoreInstanceState(Bundle savedInstanceState) {    onRestoreInstanceState(savedInstanceState);    restoreManagedDialogs(savedInstanceState);}</code></pre><p>In <code>restoreManagedDialogs</code>, it has something to do with <code>mManagedDialogs</code>.</p><p>As you can see, for advanced feature, you must do the saving and restoring job by yourself. It may be a night mare when you have tons customized dialogs. I have not tried the complex dialog (has input EdiText, listView, say). In this way, I'd like to warn users: Never rotate the screen when inputing your info in the dialog... OR, lock the rotation dynamically when showing the dialog. </p><p>Thanks for all the people who answered me. Hope my information help you too.</p>","414787","","227536","","2013-06-28 11:38:50","2013-06-28 11:38:50","Android: Dialog etc restore after rotation changed","<android><dialog><rotation><restore>","3","1","2","",""
"3689581","1","","","2010-09-11 02:42:40","55","45709","<p>I'm using an <code>AlarmManager</code> to trigger an intent that broadcasts a signal. The following is my code:</p><pre><code>AlarmManager mgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE);Intent i = new Intent(this, Wakeup.class);try{    PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, 0);    Long elapsed +=  // sleep time;    mgr.set(AlarmManager.RTC_WAKEUP, elapsed, pi);}catch(Exception r){    Log.v(TAG, ""RunTimeException: "" + r);}</code></pre><p>I'm calling this code from an <code>Activity</code>, so I don't know how I could be getting the following error...</p><blockquote>  <p>ERROR/AndroidRuntime(7557): java.lang.RuntimeException: Unable to start receiver com.wcc.Wakeup: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?</p></blockquote>","355663","","904365","","2014-01-11 07:03:21","2014-01-11 07:03:26","Calling startActivity() from outside of an Activity?","<android><alarmmanager><android-pendingintent><runtimeexception>","4","0","14","",""
"3689617","1","","","2010-09-11 02:54:39","1","59","<p>Say I want to ask the Phone app to dial a number, or the Maps app to display a particular location, or the Navigator app to navigate to a particular place, etc....</p><p>Obviously I need to broadcast or send an intent.  But what actions/categories/data URI's do I use?  What will each app recognize and respond to?  This seems like basic information that should be documented somewhere obvious.  But so far I haven't been able to find it.</p><p>I did find the PackageManager class, which looks like it could tell me everything I might want to know.  If I take the time to write a package browser app to query it.  Which I quite ready to do, but something so insanely useful must have been written by somebody already.  Why can't I find one?  Am I looking in the wrong places?</p><p>Thanks</p>","444907","","","","","2010-09-11 11:30:00","How can I find out what kinds of actions and URI's a given app package will respond to?","<android><package><android-intent>","1","0","1","",""
"3689797","1","","","2010-09-11 04:29:47","3","1232","<p>I am getting the following error in Eclipse:</p><blockquote>  <p>No resource identifier found for attribute 'class' in package 'android'</p></blockquote><p>Can any one help me in solving this?</p>","444934","","69802","","2011-05-28 22:25:31","2012-08-19 03:49:09","Aapt problem: no resource identifier found for attribute 'class' in package 'android'","<android>","1","3","1","",""
"3689878","1","3690778","","2010-09-11 05:09:05","1","2680","<p>I have a signal that puts my app to sleep for a given number of minutes (using AlarmManager) and then wakes it back up.</p><p>Everything is working except the screen doesn't ever come on.  I'm using a wakelock like so from a BroadcastReceiver class:</p><pre><code>     KeyguardManager key = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);     KeyguardLock lock = key.newKeyguardLock(TAG);     lock.disableKeyguard();     Log.v(TAG, ""alarm: disabled keyguard."");     PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);     gpsMain.wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, TAG);     gpsMain.wl.acquire();     Log.v(TAG, ""alarm: acquired wakelock"");     Intent i = new Intent();     i.setAction(CUSTOM_INTENT);     context.sendBroadcast(i);</code></pre><p>I then release the wakelock when I'm sure that my app is up and running and connected again.  However, the screen never comes on!  The app only actually comes back to life when I hit the power button to wake up the screen manually.</p><p>I'm developing on an HTC Hero.  Any assistance would be GREATLY appreciated..</p>","355663","","","","","2010-12-27 21:34:49","Wakelock is not turning on the screen? Help?","<android><screen><power-management><wakeup>","1","0","1","",""
"3690046","1","","","2010-09-11 06:20:06","6","1357","<p>Using Ubuntu 10.04 64 bits for Android development and everything goes well except sound.</p><p>I've using -audio option and -audio-out one with alsa as backend parameter, but without luck.</p><p>¿Any idea?</p>","406222","","149841","","2011-12-07 11:40:16","2012-11-08 17:20:46","Android emulator sound - ubuntu","<android><audio><android-emulator><alsa><qemu>","3","2","2","",""
"3690085","1","3753714","","2010-09-11 06:38:10","6","9245","<p>Here is what i want to do.</p><p>Lets say i have a parent linear layout and 3 childs in it.</p><p>{ ----------------  ++++++++++++++++ -------------- }</p><p>""+""/""-"" are the layouts. What i want to do is this:</p><p>{------ ++++++++++++++++++++++++++++ -------} //1st step</p><p>{ ++++++++++++++++++++++++++++++++++++ } //2nd step..</p><p>Animate the layout ""+"" taking over the layouts - . The same end result as having  these 3 layout height ""fill_parrent"" with weights andSetvisibility to ""Gone"" for the ""-"" layouts but <strong>animated</strong></p>","348058","","","","","2010-09-20 17:06:41","Is there a way to animate layouts?[Android]?","<android><layout>","1","2","6","",""
"3690102","1","","","2010-09-11 06:44:32","0","420","<p>For years now I've maintained a Tandy Color Computer Emulator applet on my home page. With the purchase of an Incredible I decided to do a port. Getting it going in Android didn't take long but I'm really surprised how slow it runs. You can literally see the pixels painting. I know there are other successful Android emulators so I must be doing something wrong.</p><p>My approach was to use a SurfaceView for rendering. There's a separate thread that runs a virtual 6809 CPU. Whenever that thread updates the emulated video memory, it calls SurfaceHolder.lockCanvas() with a Rect describing the part of the screen requiring a repaint. Then it calls the gfx routines with the resulting Canvas...this is where I did a repaint() in AWT/Swing. The gfx routines are smart enough to just render what's in the clipRect. Perhaps I'm still stuck in AWT but I can't think of any way to make this thing run at an acceptable speed. I tried to coalesce the gfx calls but that didn't work either. Any thoughts?</p>","444969","","","","","2010-09-11 18:52:16","SurfaceView Fast Enough For Emulation?","<android>","1","0","","",""
"3690181","1","","","2010-09-11 07:27:04","0","2375","<p>Like I asked in the title, I'm creating the ToDo_List app as per instructions given in Professional Android Application Development 2 and after clearing a few bugs I managed to compile and run the Emulator. </p><p>After waiting a few minutes for the emulator to load I go to the menu and I can't seem to locate my app. Any ideas?</p><p>Thanks</p><p>Edit:After a little checking this is the error I get</p><p>[2010-09-11 13:11:05 - ToDo_List] ERROR: Application requires API version 7. Device API version is 6 (Android 2.0.1).</p>","301873","","301873","","2010-09-11 07:51:00","2010-09-11 09:02:59","Can't seem to find app icon in Android Emulator","<android><android-emulator>","1","0","","",""
"3690219","1","3690772","","2010-09-11 07:44:04","0","375","<p>i want to generate Key Keypresses programmatically in android. i had gone through sample codes but they are using ServiceManager and IWindowManager which are removed from present SDK.</p><p>can any one sugget me how to do it or post sample code.please am need of it..thanks in advance</p>","399046","","","","","2010-09-11 11:19:18","Generating Keypresses Programmatically in android","<android>","1","0","","",""
"3690272","1","3691095","","2010-09-11 08:05:59","0","1067","<p>I'm writing a plugin-enabled android application here.I have 2 applications(2 apk), one is main program and another is a plugin.</p><p>Now I want the plugin constructs it's own interface in main program's Activity. But I found the R.java in 2 applications has the same values:</p><p>The R.java in plugin:</p><pre><code>public final class R {    public static final class attr {    }    public static final class drawable {        public static final int icon=0x7f020000;    }    public static final class id {        public static final int button1=0x7f050000;        public static final int button2=0x7f050001;    }    public static final class layout {        public static final int widget=0x7f030000;    }    public static final class string {        public static final int app_name=0x7f040000;        public static final int button1text=0x7f040001;        public static final int button2text=0x7f040002;    }}</code></pre><p>And, R.java of main program:</p><pre><code>public final class R {    public static final class attr {    }    public static final class drawable {        public static final int icon=0x7f020000;    }    public static final class id {        public static final int mainWidgetLayout=0x7f050000;    }    public static final class layout {        public static final int main=0x7f030000;    }    public static final class string {        public static final int app_name=0x7f040001;        public static final int hello=0x7f040000;    }}</code></pre><p>Just as you can see, there are a lot of same values in these 2 R.java, this makes chaos. In plugin, if I wanna construct the interface via resource defined in R.java, it may refer to the same value in main program resource.</p><p>So, how to handle this? Is it possible to make the 2 R.java in 2 applications have different values?Thanks a lot. Any suggestions are appreciated.</p>","444994","","","","","2010-09-11 13:07:41","How to make the R.java has different values in 2 android application?","<android>","1","1","0","",""
"3690448","1","3690592","","2010-09-11 09:25:00","0","621","<p>I use code from <a href=""http://mobiforge.com/developing/story/sms-messaging-android"" rel=""nofollow"">http://mobiforge.com/developing/story/sms-messaging-android</a> as reference.I added scrollview and it show the append text upon sms send out.</p><p>however i have problem append incoming sms text in the same scrollview.how can i solve it? do i need to use thread, service?</p>","79311","","","","","2010-09-11 17:05:18","Update UI upon received SMS","<android><sms><broadcastreceiver>","1","0","","",""
"3690541","1","","","2010-09-11 09:55:57","0","1742","<p>I need to get the selected Item from a ListView in android .</p>","436765","","981049","","2012-05-26 22:15:41","2012-05-26 22:15:41","How i can get selected item from ListView?","<java><android>","1","1","","",""
"3690574","1","","","2010-09-11 10:13:43","0","763","<p>I have this code in my app</p><pre><code>Alarm1 = Settings.System.getString(getContentResolver(),                Settings.System.NEXT_ALARM_FORMATTED);</code></pre><p>Its working on htcs,motorolas,but  not on galaxy s phones.The application crashes.Would the following  catch the error without crashing the application service?</p><pre><code> String Alarm1=null; try{     Alarm1 = Settings.System.getString(getContentResolver(),                Settings.System.NEXT_ALARM_FORMATTED);    }     catch (Exception e) {     Log.i(""Exception"", ""Exception next alarm not found = "" + e);     }   if (TextUtils.isEmpty(Alarm1)) {      //if i am i here either no alarm is set or couldn't read it from the phone      //do something else    }</code></pre><p>Unless there is a different code for the galaxy s, and can i find it.How can i make it throw an exception on a phone that works, for testing purposes?Thanks.</p>","364418","","","","","2011-03-04 17:04:59","Getting next alarm information when there is no such function","<android><exception><error-handling><alarm>","1","1","","",""
"3690735","1","","","2010-09-11 11:07:15","0","1144","<p>my perpose is to set headers for related items of  griv view and for this i am thinking about to set the width of gridview diffrent for header and sectional view's .......</p><p>if any other way 2 set sectional header for related items is possible ???</p>","445055","","","","","2011-06-23 16:02:42","is it possible to set number of colums different for diffrent rows of a grid view?","<android><gridview>","1","0","1","",""
"3690851","1","3693641","","2010-09-11 11:40:31","15","48156","<p>Easy one.</p><p>I've gone through a few guides and tutorials, and they're quite clear on how to start an activity (with intent).</p><p>However, how do I create a new activity in Eclipse? I can probably do this by hand, but then I have to modify the <code>R</code> file, which is auto-generated, and add a new xml layout.</p>","181098","","865972","","2013-03-20 07:29:06","2013-09-13 18:17:06","Android - Creating a new activity in Eclipse","<android><eclipse>","7","2","11","2013-12-23 09:24:40",""
"3690893","1","3691054","","2010-09-11 11:58:36","1","1920","<p>This is my code:</p><pre><code>public class Alarm extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Intent intent = new Intent(this, AlarmReceiver.class);        PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0,        intent, PendingIntent.FLAG_ONE_SHOT);        AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);        alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (10 * 1000), pendingIntent);        Toast.makeText(this, ""Alarm set"", Toast.LENGTH_LONG).show();    }}</code></pre><p>and</p><pre><code>public final class AlarmReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Toast.makeText(context, ""Alarm worked."", Toast.LENGTH_LONG).show();    }}</code></pre><p>By the above code i am able to get the <code>Toast</code>. Instead of <code>Toast</code> I want the <code>Dialog</code> to be appear after the alarm is set. Also I want to play the sound.</p><p>Any one help me please?</p>","399046","","70393","","2010-09-11 15:46:59","2012-10-18 09:40:27","Android AlarmManager","<android>","3","1","4","",""
"3690964","1","","","2010-09-11 12:20:17","1","336","<p>I m designing a big android application, where there are XMLs to store temporary data, images captured by camera and other details. Which is the best way to protect them from outer access from phone or from PC. XMLs can be encrypted. And images too, however there are times when they need to be accessed very often and encrypting-decrypting is very heavy operation. XML encryption is manageable but images cause memory problems. Is there any alternative way, something at folder level ?</p>","368084","","","","","2010-09-11 13:46:36","Please suggest a good way to protect application files in android 1.6?","<android>","2","6","2","",""
"3690980","1","","","2010-09-11 12:26:35","12","5990","<p>I am using <code>AsyncTask</code> to perform some background calculations but I am unable to find a correct way to handle exceptions. Currently I am using the following code:</p><pre><code>private class MyTask extends AsyncTask&lt;String, Void, String&gt;{    private int e = 0;    @Override    protected String doInBackground(String... params)    {        try        {            URL url = new URL(""http://www.example.com/"");        }        catch (MalformedURLException e)        {            e = 1;        }        // Other code here...        return null;    }    @Override    protected void onPostExecute(String result)    {        if (e == 1)            Log.i(""Some Tag"", ""An error occurred."");        // Perform post processing here...    }}</code></pre><p>I believe that the variable e maye be written/accessed by both the main and worker thread. As I know that <code>onPostExecute()</code> will only be run after <code>doInBackround()</code> has finished, can I omit any synchronization?</p><p>Is this bad code? Is there an agreed or correct way to handle exceptions in an <code>AsyncTask</code>?</p>","444538","","444538","","2010-09-12 18:57:12","2010-09-12 18:57:12","Asynctask Error Handling","<android><exception-handling><thread-safety><android-asynctask>","3","1","2","",""
"3691086","1","3691104","","2010-09-11 13:02:49","2","1600","<p>i am having one xml file and i want to parse it to get Student-ids and student-names only.</p><pre><code>&lt;students&gt;    &lt;student&gt;        &lt;id type=""integer""&gt;101&lt;/id&gt;        &lt;name&gt;James&lt;/name&gt;           &lt;degree&gt;                &lt;id type=""integer""&gt;1978271&lt;/id&gt;                &lt;name&gt;SCJP&lt;/name&gt;           &lt;/degree&gt;    &lt;/student&gt;    &lt;student&gt;        &lt;id type=""integer""&gt;102&lt;/id&gt;        &lt;name&gt;Joseph&lt;/name&gt;           &lt;degree&gt;                &lt;id type=""integer""&gt;1978272&lt;/id&gt;                &lt;name&gt;MCST&lt;/name&gt;           &lt;/degree&gt;    &lt;/student&gt; &lt;/students&gt;</code></pre><h2>Code:</h2><pre><code>while (eventType != XmlPullParser.END_DOCUMENT){      parser.next();      eventType = parser.getEventType();      switch (eventType)      {      case XmlPullParser.START_TAG:            tag_name = parser.getName();        if(tag_name.equalsIgnoreCase(""ID"")){          stud_id = parser.nextText().toString();          Log.i(""Id = "", pid);        }         else if (tag_name.equalsIgnoreCase(""name"")){                  stud_name = parser.nextText().toString();        }         break;      }} </code></pre><h2>My Problem:</h2><p>when i am parsing the XML file using the above code, i am getting both the IDs(i.e. student-id, degree-id), so <strong><em>Using Pull-parser,</em></strong> <em><strong>what way i should parse the XML file to get list of only Student-id</em></strong> ?</p>","379693","","","","","2010-09-11 13:10:23","Android - Pull Parser","<android><xml><xml-parsing><android-pullparser>","1","0","1","",""
"3691099","1","","","2010-09-11 13:09:43","5","2130","<p>I have copied Android's NumberPicker widget to my own application, but I'm having one problem...</p><p>When someone manually clicks the EditText and changes it via the keyboard, the selection is not saved. Is there some listener that I can implement to check and see if the user manually changes the EditText to set it as current? Or something?</p>","439836","","","","","2012-11-16 02:36:05","Android NumberPicker not saving EditText changes","<android><android-widget>","6","0","2","",""
"3691106","1","3692327","","2010-09-11 13:11:27","0","202","<p>there is a protected method <strong>replaceText</strong> for <strong>autocompletetextview</strong> in Android.</p><p>I have no idea how to use it and need some examples.</p><p>Is it possible at all to use this method?!</p><p>Mur</p>","408780","","","","","2010-09-11 19:22:35","How to use replaceText","<android>","1","0","","",""
"3691269","1","","","2010-09-11 14:05:26","1","935","<p>Code:</p><pre><code>final int port = 5060;byte[] inviteBytes = sipInvite.getBytes();DatagramPacket packet = new DatagramPacket(inviteBytes, inviteBytes.length, toInetAddress, port);DatagramSocket serverSocket = new DatagramSocket(port);serverSocket.send(packet);</code></pre><p>Which throws:</p><pre><code>09-10 19:18:00.107: WARN/System.err(5408): java.net.SocketException: Operation not permitted09-10 19:18:00.117: WARN/System.err(5408):   at org.apache.harmony.luni.platform.OSNetworkSystem.sendDatagramImpl(Native Method)09-10 19:18:00.117: WARN/System.err(5408):   at org.apache.harmony.luni.platform.OSNetworkSystem.sendDatagram(OSNetworkSystem.java: 571)09-10 19:18:00.117: WARN/System.err(5408):   at org.apache.harmony.luni.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java: 275)09-10 19:18:00.117: WARN/System.err(5408):   at java.net.DatagramSocket.send(DatagramSocket.java:463)09-10 19:18:00.117: WARN/System.err(5408):   at com.icast.mypie.sip.SipClient.doConnect(SipClient.java:71)09-10 19:18:00.117: WARN/System.err(5408):   at com.icast.mypie.sip.SipClient.run(SipClient.java:43)</code></pre><p>Nexus 2.2, device connects via wifi. Port not blocked. Datagram send works from android 1.5 moto blur.</p>","445115","","14302","","2010-09-28 11:45:19","2011-06-14 11:23:21","java.net.SocketException: Operation not permitted","<android><sip><udpclient>","1","4","","",""
"3691295","1","3693020","","2010-09-11 14:17:47","1","3846","<p>i want to show image in imageview without using id.</p><p>i will place all images in raw folder and open </p><pre><code>     try {            String ss = ""res/raw/images/inrax/3150-MCM.jpg"";             in = new FileInputStream(ss);        buf = new BufferedInputStream(in);        Bitmap bMap = BitmapFactory.decodeStream(buf);        image.setImageBitmap(bMap);        if (in != null) {         in.close();        }        if (buf != null) {         buf.close();        }    } catch (Exception e) {        Log.e(""Error reading file"", e.toString());    }</code></pre><p>but this is not working i want to access image using its path not by name</p>","182699","","302328","","2010-09-11 14:40:49","2010-09-11 23:02:03","Android Show image by path","<android><assets>","3","0","","",""
"3691414","1","3691637","","2010-09-11 14:49:18","4","3130","<p>I need to start an activity when the user chooses an item in an alert dialog. How do I get the context to pass to the intent constructor in the following code...</p><pre><code>builder.setItems(items, new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int item) {                Intent i = new Intent(&lt;WHAT DO I PUT HERE?&gt;, &lt;new activity&gt;.class);                    startActivity(i);      }});</code></pre><p>Is it the use of the inner class?? Any thoughts?</p>","440854","","","","","2012-06-03 20:21:07","Android: How to start an Activity from an alert dialog","<android><events><dialog><activity><click>","2","0","3","",""
"3691424","1","6416095","","2010-09-11 14:52:38","6","6401","<p>I'm trying to develop an app which uses the Camera. So far it's been working well, except that I'm unable to force the orientation to be ""portrait"". It seems to work well if I force all activities to ""landscape"", because the camera preview seems to fit in landscape.</p><p>Is there anyway to use the Camera in portrait mode?</p>","433640","","","","","2012-10-14 06:13:42","Using Camera in Portrait Orientation","<android>","3","2","3","",""
"3691579","1","3698565","","2010-09-11 15:39:18","9","2147","<p>I wrote a widget for Android and I'm trying to get the battery level.I've tried using</p><pre><code>Intent batteryIntent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));</code></pre><p>but I get the error:""IntentReceiver components are not allowed to register to receive intents""</p><p>Why? the ACTION_BATTERY_CHANGED is a sticky intent and I don't register a receiver (null in the first parameter).</p><p>Any workaround?</p><p>Thanks.</p>","445114","","","","","2010-09-13 13:11:25","getting battery level at android widget","<android><android-widget><battery><receiver>","2","1","2","",""
"3691726","1","","","2010-09-11 16:21:21","1","4639","<p>I need some advice about animation. I have an animated GIF, but how to put in Android app to be animation. When I put it doesn't move at all. I read something about animation in Android and I need to have pictures for animation. Is there any solution for this ?</p>","445173","","313758","","2010-09-11 16:23:46","2012-02-08 20:24:55","Problem with Animated gif on Android","<android><animated-gif>","1","0","","",""
"3691764","1","3692175","","2010-09-11 16:33:01","0","260","<p>I have managed to create a menu with four options.  I would now like to create four sub menus of the same style for each option.</p><p>In my infinite nooby-ness I have created four classes for the sub menus but I cannot figure out how to move between the menus(Classes).  For instance I have four options <code>Prem</code>, <code>Champ</code>, <code>L1</code>, <code>L2</code>--I have created the <code>Prem</code> sub menu.</p><p>How do I get the program to move to the class(SubMenu) when the <code>Prem</code> option is selected, and how do I get it to move back?</p>","445174","","879199","","2012-07-18 01:37:36","2012-07-18 01:37:36","How to create working menus","<java><android><eclipse>","1","1","","",""
"3691805","1","","","2010-09-11 16:47:18","0","239","<p>How to create a layer menu? I want to create a custom menu,but I do not know how to create a layer,For example, a Imagebutton is pressed to display a list of menu.like this:</p><p><a href=""http://ss12.sinaimg.cn/orignal/5d8cb30ag8f47eca43a5b&amp;690"" rel=""nofollow"">http://ss12.sinaimg.cn/orignal/5d8cb30ag8f47eca43a5b&amp;690</a></p>","364112","","364112","","2010-09-12 02:54:12","2010-09-12 02:54:12","How to create a layer menu?","<android>","0","2","","",""
"3691864","1","","","2010-09-11 17:10:10","3","939","<p>As you already know, in Twiiter application,  twitt content stays in the right hand side of the Username, and in second line, the twitt content stays back to the left of the parent layout.(which is similar to the Listview item's layout of Facebook Application)</p><p>My problem is the username and twitt content <strong>belong to 2 different columns</strong> :(</p><p>Could you please tell me the way to fix the problem?</p>","445191","","445191","","2010-09-11 17:45:32","2011-12-19 17:36:44","Layout for Android ListView item like Twitter","<android>","1","1","1","",""
"3691959","1","","","2010-09-11 17:41:23","1","1082","<p>I have two classes, my main class and another for handling sqlite. The problem I have is that it crashes when it gets to db.open() in the main class and I have no idea why.</p><p>main class:</p><pre><code>public class RingerSchedule extends Activity {     public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                DBAdapter db = new DBAdapter(this);        db.open(); //crash!        //more stuff    }}</code></pre><p>sqlite class:</p><pre><code>public class DBAdapter{    public static final String KEY_ROWID = ""id"";    public static final String KEY_TO = ""to"";    public static final String KEY_FROM = ""from"";    public static final String KEY_DAY = ""day"";        public static final String KEY_FUNCTION = ""function"";        private static final String TAG = ""DBAdapter"";    private static final String DATABASE_NAME = ""myDB"";    private static final String DATABASE_TABLE = ""schedules"";    private static final int DATABASE_VERSION = 1;    private final Context context;     private DatabaseHelper DBHelper;    private SQLiteDatabase db;    public DBAdapter(Context ctx)     {        this.context = ctx;        DBHelper = new DatabaseHelper(context);     }    private static class DatabaseHelper extends SQLiteOpenHelper     {        DatabaseHelper(Context context)         {            super(context, DATABASE_NAME, null, DATABASE_VERSION);        }        @Override        public void onCreate(SQLiteDatabase db)         {            db.execSQL(""CREATE TABLE ""                + DATABASE_TABLE                + "" (id INT PRIMARY KEY AUTOINCREMENT, to TEXT,""
                + "" from TEXT, day TEXT""                + "" function TEXT);"");         }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)         {            Log.w(TAG, ""Upgrading database from version "" + oldVersion + "" to "" + newVersion + "", which will destroy all old data"");            db.execSQL(""DROP TABLE IF EXISTS titles"");            onCreate(db);        }    }        //opens the database    public DBAdapter open() throws SQLException     {        this.db = DBHelper.getWritableDatabase();        return this;    }    //closes the database    public void close()     {        DBHelper.close();    }    //insert a schedule into the database    public long insertSchedule(String from, String to, String day, String function)     {        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_TO, to);        initialValues.put(KEY_FROM, from);        initialValues.put(KEY_DAY, day);        initialValues.put(KEY_FUNCTION, function);        return db.insert(DATABASE_TABLE, null, initialValues);    }    //deletes a particular schedule    public boolean deleteSchedule(long Id)     {        return db.delete(DATABASE_TABLE, KEY_ROWID + ""="" + Id, null) &gt; 0;    }    //retrieves all the schedules    public Cursor getAllSchedules()     {        return db.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TO, KEY_FROM, KEY_DAY, KEY_FUNCTION}, null, null, null, null, null, null);    }    //updates a schedule    public boolean updateSchedule(long Id, String to, String from, String day, String function)     {        ContentValues args = new ContentValues();        args.put(KEY_TO, to);        args.put(KEY_FROM, from);        args.put(KEY_DAY, day);        args.put(KEY_FUNCTION, function);        return db.update(DATABASE_TABLE, args, KEY_ROWID + ""="" + Id, null) &gt; 0;    }}</code></pre>","444707","","","","","2011-11-20 12:20:07","Android sqlite opening database crashes","<android>","2","5","","",""
"3692252","1","6701740","","2010-09-11 19:03:44","5","12466","<p>I have a video file on a website in .MP4 format and I want to allow the user to be able to download the video to their SD card by clicking a link.  Is there an easy way to do this. I currently have this code but its not working...not sure what I am doing wrong. THanks for any help!</p><pre><code>import java.io.BufferedInputStream;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.URL;import java.net.URLConnection;import org.apache.http.util.ByteArrayBuffer;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class VideoManager extends Activity { /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);}        private final String PATH = ""/sdcard/download/"";  //put the downloaded file here        public void DownloadFromUrl(String VideoURL, String fileName) {  //this is the downloader method                try {                        URL url = new URL(""http://www.ericmoyer.com/episode1.mp4""); //you can write here any link                        File file = new File(fileName);                        long startTime = System.currentTimeMillis();                        Log.d(""VideoManager"", ""download begining"");                        Log.d(""VideoManager"", ""download url:"" + url);                        Log.d(""VideoManager"", ""downloaded file name:"" + fileName);                        /* Open a connection to that URL. */                        URLConnection ucon = url.openConnection();                        /*                         * Define InputStreams to read from the URLConnection.                         */                        InputStream is = ucon.getInputStream();                        BufferedInputStream bis = new BufferedInputStream(is);                        /*                         * Read bytes to the Buffer until there is nothing more to read(-1).                         */                        ByteArrayBuffer baf = new ByteArrayBuffer(50);                        int current = 0;                        while ((current = bis.read()) != -1) {                                baf.append((byte) current);                        }                        /* Convert the Bytes read to a String. */                        FileOutputStream fos = new FileOutputStream(PATH+file);                        fos.write(baf.toByteArray());                        fos.close();                        Log.d(""VideoManager"", ""download ready in""                                        + ((System.currentTimeMillis() - startTime) / 1000)                                        + "" sec"");                } catch (IOException e) {                        Log.d(""VideoManager"", ""Error: "" + e);                }        }}</code></pre>","411224","","827530","","2011-05-04 06:53:27","2013-12-23 12:36:30","ANDROID: How do I download a video file to SD card?","<android><url><video><download>","2","1","8","",""
"3692316","1","3692343","","2010-09-11 19:18:55","0","1042","<p>Been trying to create a layout similar to the Android Facebook app (top bar with app name and 2 buttons aligned right).</p><p>Tried everything :( the closest I got made one of the buttons disappear...</p><p>Here is the code: (using relatives on top to create sticky header and footer)</p><p>the ""Add"" button disappears while the ""Search"" button aligns to the right.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""vertical""&gt; &lt;RelativeLayout android:layout_width=""fill_parent""  android:layout_height=""50dip"" android:id=""@+id/top_control_bar""&gt;  &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent""   android:layout_height=""fill_parent"" android:src=""@drawable/top_background""&gt;   &lt;TextView android:layout_width=""wrap_content"" android:layout_height=""20dip""     android:text=""APP"" android:layout_gravity=""left|center"" android:layout_alignParentLeft=""true"" android:layout_toLeftOf=""@+id/add_bookmark"" /&gt;   &lt;Button android:id=""@+id/add_bookmark"" android:layout_width=""wrap_content""    android:layout_height=""fill_parent"" android:text=""Add"" android:layout_gravity=""right|center"" android:layout_alignParentRight=""true"" /&gt;   &lt;Button android:id=""@+id/search_bookmark"" android:layout_width=""wrap_content""    android:layout_height=""fill_parent"" android:text=""Search"" android:layout_gravity=""right|center"" android:layout_alignParentRight=""true""  /&gt;  &lt;/RelativeLayout&gt; &lt;/RelativeLayout&gt; &lt;LinearLayout android:id=""@+id/bottom_control_bar""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""  android:layout_alignParentBottom=""true""&gt;  &lt;Button android:layout_width=""wrap_content""   android:layout_height=""fill_parent"" android:text=""Backup"" /&gt;  &lt;Button android:layout_width=""wrap_content""   android:layout_height=""fill_parent"" android:text=""Restore"" /&gt; &lt;/LinearLayout&gt; &lt;ListView android:id=""@android:id/list"" android:layout_width=""fill_parent""  android:layout_height=""0dip"" android:layout_below=""@id/top_control_bar""  android:layout_above=""@id/bottom_control_bar""&gt;&lt;/ListView&gt; &lt;TextView android:id=""@android:id/empty"" android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:text=""No Bookmarks found. You can add one by clicking the star.""  android:layout_below=""@id/top_control_bar"" android:layout_above=""@id/bottom_control_bar"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Would appreciate any help! :)</p>","444324","","","","","2010-09-11 19:56:30","Android RelativeView - button disappears","<android>","2","0","","",""
"3692363","1","3693851","","2010-09-11 19:34:37","23","24799","<p>I am an Android Newbie! please help.</p><p>I have been following googles introduction tutorial and managed to install everything with no problems. but whenever i try to run the HelloAndroid example the avd launches but doesnt show anything.</p><p>cone somebody help please?</p>","445245","","2256325","","2013-09-08 19:03:58","2013-10-28 19:52:02","Android AVD not showing anything. only ""ANDROID"" in the middle of the screen","<android><eclipse><avd>","7","1","2","",""
"3692378","1","3692409","","2010-09-11 19:39:10","0","409","<p>Is it possible to use Google Maps Android library in my app in a way, that the app can be installed even on phones without Google Maps? On phones without Google Maps, the maps feature would be disabled.</p>","243225","","","","","2013-01-12 16:46:21","Android app using Google Maps library, installable everywhere","<android><google-maps>","2","0","","",""
"3692437","1","","","2010-09-11 19:53:38","1","1297","<p>All of a sudden I cannot export a signed application in eclipse</p><p>Right Click -> Android Tools -> Export Signed Application Package</p><p>Nothing happens, I can still install it on the emulator and export an Unsigned package</p><p>What is going wrong?</p><p>I get the following in the error log when I press the ""Export Signed Application Package"" menu item</p><blockquote>  <p>!ENTRY org.eclipse.ui.workbench 4 0  2010-09-12 02:50:14.734 !MESSAGE  WARNING: Blocked recursive attempt to  close part  org.eclipse.ui.DefaultTextEditor while  still in the middle of activating it  !STACK 0 java.lang.RuntimeException:  WARNING: Blocked recursive attempt to  close part  org.eclipse.ui.DefaultTextEditor while  still in the middle of activating it   at  org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1300)   at  org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1435)   at  org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:61)   at  org.eclipse.ui.internal.PartStack.close(PartStack.java:543)   at  org.eclipse.ui.internal.EditorStack.close(EditorStack.java:206)   at  org.eclipse.ui.internal.PartStack$1.close(PartStack.java:122)   at  org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:83)   at  org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:270)   at  org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:279)   at  org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)   at  org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$1.closeButtonPressed(DefaultTabFolder.java:70)   at  org.eclipse.ui.internal.presentations.PaneFolder.notifyCloseListeners(PaneFolder.java:626)   at  org.eclipse.ui.internal.presentations.PaneFolder$3.close(PaneFolder.java:206)   at  org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2199)   at  org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:327)   at  org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)   at  org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)   at  org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)   at  org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)   at  org.eclipse.jface.window.Window.runEventLoop(Window.java:825)   at  org.eclipse.jface.window.Window.open(Window.java:801)   at  org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:327)   at  org.eclipse.ui.texteditor.AbstractTextEditor.handleEditorInputChanged(AbstractTextEditor.java:4632)   at  org.eclipse.ui.texteditor.StatusTextEditor.handleEditorInputChanged(StatusTextEditor.java:233)   at  org.eclipse.ui.texteditor.AbstractTextEditor.sanityCheckState(AbstractTextEditor.java:4784)   at  org.eclipse.ui.texteditor.StatusTextEditor.sanityCheckState(StatusTextEditor.java:223)   at  org.eclipse.ui.texteditor.AbstractTextEditor.safelySanityCheckState(AbstractTextEditor.java:4762)   at  org.eclipse.ui.texteditor.AbstractTextEditor$ActivationListener.handleActivation(AbstractTextEditor.java:987)   at  org.eclipse.ui.texteditor.AbstractTextEditor$ActivationListener.partActivated(AbstractTextEditor.java:944)   at  org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72)   at  org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)   at  org.eclipse.core.runtime.Platform.run(Platform.java:888)   at  org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57)   at  org.eclipse.ui.internal.PartListenerList.firePartActivated(PartListenerList.java:70)   at  org.eclipse.ui.internal.PartService.firePartActivated(PartService.java:187)   at  org.eclipse.ui.internal.PartService.setActivePart(PartService.java:306)   at  org.eclipse.ui.internal.WWinPartService.updateActivePart(WWinPartService.java:131)   at  org.eclipse.ui.internal.WWinPartService.access$0(WWinPartService.java:122)   at  org.eclipse.ui.internal.WWinPartService$WWinListener.partDeactivated(WWinPartService.java:50)   at  org.eclipse.ui.internal.PartListenerList2$4.run(PartListenerList2.java:115)   at  org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)   at  org.eclipse.core.runtime.Platform.run(Platform.java:888)   at  org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:55)  at  org.eclipse.ui.internal.PartListenerList2.firePartDeactivated(PartListenerList2.java:113)   at  org.eclipse.ui.internal.PartService.firePartDeactivated(PartService.java:242)   at  org.eclipse.ui.internal.PartService.setActivePart(PartService.java:300)   at  org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:57)   at  org.eclipse.ui.internal.PartList.setActivePart(PartList.java:136)   at  org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3531)   at  org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3071)   at  org.eclipse.ui.internal.PartPane.requestActivation(PartPane.java:279)   at  org.eclipse.ui.internal.EditorPane.requestActivation(EditorPane.java:98)   at  org.eclipse.ui.internal.presentations.PresentablePart.setFocus(PresentablePart.java:192)   at  org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:94)   at  org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:270)   at  org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:275)   at  org.eclipse.ui.internal.presentations.util.AbstractTabFolder.handleMouseDown(AbstractTabFolder.java:345)   at  org.eclipse.ui.internal.presentations.util.AbstractTabFolder$3.mouseDown(AbstractTabFolder.java:79)  at  org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179)   at  org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)   at  org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)   at  org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)   at  org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)   at  org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)   at  org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)   at  org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)   at  org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)   at  org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)   at  org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)   at  org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)   at  org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)   at  org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)   at  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)   at  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)   at  org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)   at  org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)   at  sun.reflect.NativeMethodAccessorImpl.invoke0(Native  Method)  at  sun.reflect.NativeMethodAccessorImpl.invoke(Unknown  Source)  at  sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  Source)  at  java.lang.reflect.Method.invoke(Unknown  Source)  at  org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)   at  org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)   at  org.eclipse.equinox.launcher.Main.run(Main.java:1311)</p>    <p>!ENTRY com.android.ide.eclipse.adt 4 0  2010-09-12 02:50:27.661 !MESSAGE  Failed to load properties file for  project 'MainMenuActivity'</p>    <p>!ENTRY org.eclipse.ui 4 0 2010-09-12  02:50:27.662 !MESSAGE Unhandled event  loop exception !STACK 0  java.lang.NullPointerException  at  com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper$NonLibraryProjectOnlyFilter.accept(Unknown  Source)  at  com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.getAndroidProjects(Unknown  Source)  at  com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.getAndroidProjects(Unknown  Source)  at  com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper.getAndroidProjects(Unknown  Source)  at  com.android.ide.eclipse.adt.internal.wizards.export.ProjectCheckPage.handleProjectNameChange(Unknown  Source)  at  com.android.ide.eclipse.adt.internal.wizards.export.ProjectCheckPage.access$0(Unknown  Source)  at  com.android.ide.eclipse.adt.internal.wizards.export.ProjectCheckPage$1.modifyText(Unknown  Source)  at  org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:167)   at  org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)   at  org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)   at  org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)   at  org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)   at  org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2526)   at  org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:4082)   at  org.eclipse.swt.widgets.Control.windowProc(Control.java:3949)   at  org.eclipse.swt.widgets.Display.windowProc(Display.java:4589)   at  org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native  Method)  at  org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2313)   at  org.eclipse.swt.widgets.Text.callWindowProc(Text.java:255)   at  org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)   at  org.eclipse.swt.widgets.Text.windowProc(Text.java:2170)   at  org.eclipse.swt.widgets.Display.windowProc(Display.java:4589)   at  org.eclipse.swt.internal.win32.OS.SetWindowTextW(Native  Method)  at  org.eclipse.swt.internal.win32.OS.SetWindowText(OS.java:3264)   at  org.eclipse.swt.widgets.Text.setText(Text.java:1961)   at  com.android.ide.eclipse.adt.internal.wizards.export.ProjectCheckPage.onShow(Unknown  Source)  at  com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$ExportWizardPage.setVisible(Unknown  Source)  at  org.eclipse.jface.wizard.WizardDialog.showStartingPage(WizardDialog.java:1199)   at  org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:551)   at  org.eclipse.jface.window.Window.create(Window.java:431)   at  org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)   at  org.eclipse.jface.window.Window.open(Window.java:790)   at  com.android.ide.eclipse.adt.internal.wizards.actions.ExportWizardAction.run(Unknown  Source)  at  org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)   at  org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)   at  org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)   at  org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)   at  org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)   at  org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)   at  org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)   at  org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)   at  org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)   at  org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)   at  org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)   at  org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)   at  org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)   at  org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)   at  org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)   at  org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)   at  org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)   at  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)   at  org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)   at  org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)   at  org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)   at  sun.reflect.NativeMethodAccessorImpl.invoke0(Native  Method)  at  sun.reflect.NativeMethodAccessorImpl.invoke(Unknown  Source)  at  sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown  Source)  at  java.lang.reflect.Method.invoke(Unknown  Source)  at  org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)   at  org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)   at  org.eclipse.equinox.launcher.Main.run(Main.java:13</p></blockquote><p>11)</p>","248521","","","","","2013-07-27 18:43:34","Android & Eclispe - Export Signed application no longer works","<android>","2","0","","",""
"3692528","1","3692847","","2010-09-11 20:23:26","3","4289","<p>In my app I'd like to show a warning when using a certain preference in my application. I've tried using the PreferenceActivity.onPreferenceTreeClick and the onPreferenceClickListener, but neither seems to work. I've got the latter example below. Could anyone shed some light on this please?</p><pre><code>@Overrideprotected void onCreate(Bundle saved) {    super.onCreate(saved);    addPreferencesFromResource(R.xml.prefs);    Preference gridview = findPreference(""fcngrid"");    gridview.setOnPreferenceClickListener(overrider);}public OnPreferenceClickListener overrider = new OnPreferenceClickListener() {    public boolean onPreferenceClick(Preference pref) {        if (pref.getTitle() == ""Default as grid"")            showDialog(0);        return false;    }};protected Dialog onCreateDialog(int id) {    AlertDialog.Builder b = new AlertDialog.Builder(this);    b.setTitle(""Warning"")     .setMessage(""Unfortunately, this feature is currently unstable, and will be"" +             "" fixed soon."")     .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            dialog.cancel();        }     });    return b.create();}</code></pre>","428665","","","","","2011-12-22 02:58:27","Override click in android preferenceactivity","<android><dialog><override><preferenceactivity>","1","2","1","",""
"3692557","1","","","2010-09-11 20:31:54","1","395","<p>I've been trying to figure out how to do a HTTP authentication and then use the session to display pages in a webview in my android app. Could someone please provide som guidance (I would very much appretiate some sample code if possible).</p><p>I use Zend ACL on the server side.</p><p>Thanks in advance.</p>","439781","","168868","","2011-03-30 21:57:20","2011-04-15 05:40:13","HTTP authentication and sessions","<android><zend-framework><http-authentication><zend-acl>","1","0","","",""
"3692562","1","3692652","","2010-09-11 20:33:09","1","504","<p>I have too many MediaPlayers. What is the accepted method to remove them from memory so that I can create more? Changing the filesource doesn't seem to work, I need rid of them.</p>","420617","","","","","2011-07-14 09:06:56","How does one remove a MediaPlayer?","<android><media-player>","1","0","","",""
"3692717","1","3722697","","2010-09-11 21:24:51","5","320","<p>Recently I came across a few apps (such as Clockworkmod's Rom Manager) where in order to get the pro version you had to download another APK. However once this APK was downloaded Rom Manager automatically knew this APK existed and added new functionality's. For example another app is the Astro app in which you can extend it by downloading modules from the Market.</p><p>Now I know how to check for the existence of another app, and I also know how to interact between apps via services. However my question is,it seemed like Clockwork and these other apps are using different apks for a plug-in type architecture. How does one do that? Have they predefined an entire plugin architecture and service model so whenever a new apk is installed the main app can check if its a module and call commands on it? Or is there something else going on?</p>","117691","","117691","","2010-09-13 17:13:45","2010-09-15 23:46:07","Multiple APK's Interacting with each other","<android><plugins><module>","1","0","4","",""
"3692732","1","","","2010-09-11 21:29:40","1","653","<p>In an Android application I am writing, the styling for my various <code>TextView</code> elements is defined in an xml resource. I would like enable the user to change certain styles such as <code>android:typeface</code> using a <code>PreferenceActivity</code>.</p><p>Is there a way to modify a style resource programmatically such that all associated widgets will update correctly? If not, must I manually select all widgets by id and change their styling?</p>","444538","","444538","","2010-09-11 21:37:09","2010-09-11 22:02:49","Modifying styles programmatically","<android><coding-style><android-preferences>","1","1","1","",""
"3692776","1","3693445","","2010-09-11 21:46:28","5","1954","<p>The code is like below. If I don't set any timeout parameters, what is the default time out for ""new DefaultHttpClient().execute(mConnection)""?</p><pre><code>mConnection = new HttpGet(mURL);mResponse = new DefaultHttpClient().execute(mConnection);</code></pre><p>Thanks.</p>","445302","","","","","2010-09-12 02:02:44","What's the default timeout of using HttpGet and DefaultHttpClient?","<java><android>","1","0","","",""
"3692908","1","3693042","","2010-09-11 22:25:12","0","2469","<p>I am working with a countdown timer and have it set so that it is able to be set by the user. When the timer gets to 00:00 its supposed to say ""done!"". For some reason I'm getting the ""done!"" right after I start the timer. After hitting pause and resume it shows my counter counting down but I'm not so sure that customers are gonna be cool with this. Can anyone tell why I'm having this problem? Thanks. </p><pre><code>        package score.keeper.basketball;import android.app.Activity;import android.app.Dialog;import android.os.Bundle;import android.os.CountDownTimer;import android.view.View;import android.view.View.OnLongClickListener;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.Spinner;import android.widget.TextView;import android.widget.AdapterView.OnItemSelectedListener;public class Score extends Activity implements AdapterView.OnItemSelectedListener {    private Button Button01;    private Button Button02;    private Button Button03;    private Button Button04;    private TextView TextView01;    private TextView TextView02;    private TextView TextView03;    private TextView TextView06;    private Spinner Spinner01;    private Spinner Spinner02;    private TextView Team01;    private TextView Team02;    TextView timeDisplay;    int state = 0;    int length;    long startTime = 0;    long currentTime = 0;    long timeElapsed = 0;    long timeRemaining = 0;    long prevTimeRemaining = 0;    Button control;    MyCount counter;    String[] goal={""Three"", ""Foul"", ""Two""};    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        Button01 = (Button) findViewById(R.id.Button01);        Button02 = (Button) findViewById(R.id.Button02);        Button03 = (Button) findViewById(R.id.Button03);        Button04 = (Button) findViewById(R.id.Button04);        TextView01 = (TextView) findViewById(R.id.TextView01);        TextView02 = (TextView) findViewById(R.id.TextView02);        TextView03 = (TextView) findViewById(R.id.TextView03);        TextView06 = (TextView) findViewById(R.id.TextView06);        Team01 = (TextView) findViewById(R.id.TextView04);        Team02 = (TextView) findViewById(R.id.TextView05);        Team01.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                    final Dialog dialog = new Dialog(Score.this);                    dialog.setContentView(R.layout.setteamname);                    dialog.setTitle(""Team Name"");                    dialog.setCancelable(true);                    final EditText teamName = (EditText) dialog.findViewById(R.id.teamName);                    Button btn = (Button) dialog.findViewById(R.id.setText);                    btn.setOnClickListener(new View.OnClickListener() {                        @Override                        public void onClick(View v) {                            String teamName2 = teamName.getText().toString();                            Team01.setText("""" + teamName2);                            dialog.dismiss();                                    }                        });                         dialog.show();            }});        Team02.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                final Dialog dialog = new Dialog(Score.this);                dialog.setContentView(R.layout.setteamname);                dialog.setTitle(""Team Name"");                dialog.setCancelable(true);                final EditText teamName = (EditText) dialog.findViewById(R.id.teamName);                Button btn = (Button) dialog.findViewById(R.id.setText);                btn.setOnClickListener(new View.OnClickListener() {                    @Override                    public void onClick(View v) {                        String teamName3 = teamName.getText().toString();                        Team02.setText("""" + teamName3);                        dialog.dismiss();                                }                    });                     dialog.show();        }});        Spinner spin = (Spinner) findViewById(R.id.Spinner01);        spin.setOnItemSelectedListener((OnItemSelectedListener) this);        ArrayAdapter&lt;String&gt; aa=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, goal);        aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        spin.setAdapter(aa);        Button01.setOnLongClickListener(subtractLeft);        Button02.setOnClickListener(new Button.OnClickListener() {public void onClick(View v){my_func1();}});        Button03.setOnLongClickListener(subtractRight);        Button04.setOnClickListener(new Button.OnClickListener() {public void onClick(View v){my_func2();}});        timeDisplay = (TextView) findViewById(R.id.timer);        timeDisplay.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                final Dialog dialog = new Dialog(Score.this);                dialog.setContentView(R.layout.custom_dialog);                dialog.setTitle(""Set Time"");                dialog.setCancelable(true);                final EditText min = (EditText) dialog.findViewById(R.id.min);                final EditText sec = (EditText) dialog.findViewById(R.id.sec);                Button btn = (Button)dialog.findViewById(R.id.positive);                btn.setOnClickListener(new View.OnClickListener() {                    @Override                    public void onClick(View v){                        int min2 = Integer.parseInt(min.getText().toString());                        int sec2 = Integer.parseInt(sec.getText().toString());                        {length = (((min2 * 60) + sec2) * 1000);                        dialog.dismiss();}                    }});                dialog.show();}                 });        counter = new MyCount(length, 100);         control = (Button) findViewById(R.id.control);      }      public void control(View view) {        switch (state) {        case 0:          startTime = System.currentTimeMillis();          counter.start();          control.setText(R.string.pause);          state = 1;          break;        case 1:          // pause          currentTime = System.currentTimeMillis();          timeElapsed = currentTime - startTime;          if (prevTimeRemaining == 0)            timeRemaining = length - timeElapsed;          else            timeRemaining = prevTimeRemaining - timeElapsed;          counter.cancel();          timeDisplay.setText(formatTime(timeRemaining));          control.setText(R.string.resume);          prevTimeRemaining = timeRemaining;          // resume          counter = new MyCount(timeRemaining, 100);          state = 0;          break;        case 2:          prevTimeRemaining = 0;          counter = new MyCount(length, 100);          control.setText(R.string.start);          timeDisplay.setText(R.string.timer);          state = 0;        }      }      public class MyCount extends CountDownTimer {        public MyCount(long millisInFuture, long countDownInterval) {          super(millisInFuture, countDownInterval);        }        public void onFinish() {          timeDisplay.setText(""done!"");          state = 2;          control.setText(R.string.restart);        }        public void onTick(long millisUntilFinished) {          timeDisplay.setText(formatTime(millisUntilFinished));        }      }      public String formatTime(long millis) {          String output = ""00:00"";          long seconds = millis / 1000;          long minutes = seconds / 60;          // long hours = minutes / 60;          seconds = seconds % 60;          minutes = minutes % 60;          // hours = hours % 60;          String secondsD = String.valueOf(seconds);          String minutesD = String.valueOf(minutes);          // String hoursD = String.valueOf(hours);           if (seconds &lt; 10)            secondsD = ""0"" + seconds;          if (minutes &lt; 10)            minutesD = ""0"" + minutes;          // if (hours &lt; 10)            // hoursD = ""0"" + hours;          output = minutesD + "" : "" + secondsD;          return output;        }    public void setSpinner02(Spinner spinner02) {        Spinner02 = spinner02;    }    public Spinner getSpinner02() {        return Spinner02;    }    public void setSpinner01(Spinner spinner01) {        Spinner01 = spinner01;    }    public Spinner getSpinner01() {        return Spinner01;    }    public void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position, long id)    {    if (""Three"".equals(goal[position]))    {TextView03.setText(""3"");}    if (""Foul"".equals(goal[position]))    {TextView03.setText(""1"");}    if (""Two"".equals(goal[position]))    {TextView03.setText(""2"");}    }    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {        // TODO Auto-generated method stub        TextView03.setText(""2"");        TextView06.setText(""2"");    }    void my_func1() {        int scoreLeft;         int addOne;        int scoreLeftTotal;        addOne = Integer.parseInt(TextView03.getText().toString());        scoreLeft = Integer.parseInt(TextView01.getText().toString());        scoreLeftTotal = (scoreLeft + addOne);        TextView01.setText("""" + scoreLeftTotal);        }   void my_func2() {            int scoreRight = Integer.parseInt(TextView02.getText().toString());            int addOne = Integer.parseInt(TextView03.getText().toString());            {int scoreRightTotal = (scoreRight + addOne);            TextView02.setText("""" + scoreRightTotal);            }    }    private OnLongClickListener subtractLeft = new OnLongClickListener() {         public boolean onLongClick(View v) {        int scoreLeft = Integer.parseInt(TextView01.getText().toString());        int addOne = Integer.parseInt(TextView03.getText().toString());        {int scoreLeftTotal = (scoreLeft - addOne);        TextView01.setText("""" + scoreLeftTotal);        }        return true;         }};private OnLongClickListener subtractRight = new OnLongClickListener() {     public boolean onLongClick(View v) {    int scoreRight = Integer.parseInt(TextView02.getText().toString());    int addOne = Integer.parseInt(TextView03.getText().toString());    {int scoreLeftTotal = (scoreRight - addOne);    TextView02.setText("""" + scoreLeftTotal);    }    return true;     }};public void OnClick(View view) {    if (view==Team01){        Dialog dialog = new Dialog(Score.this);        dialog.setContentView(R.layout.setteamname);        dialog.setTitle(""Team Name"");        dialog.setCancelable(true);        final EditText teamName = (EditText) dialog.findViewById(R.id.teamName);        teamName.setText(R.id.TextView04);        Button btn = (Button)dialog.findViewById(R.id.setText);        btn.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                teamName.getText().toString();                Team01.setText("""" + teamName);                }            });        dialog.show();}         };}</code></pre>","288437","","288437","","2010-09-11 23:27:23","2010-09-11 23:27:23","Countdown Timer Problem","<android><timer><countdown>","1","1","1","",""
"3692915","1","3692966","","2010-09-11 22:27:14","12","7018","<p>How can I make sure that only one instance of Service is created?</p><p>I have checked some functions with logging (WeatherService is the class who extends Service):</p><pre><code>Log.i(TAG, ""Start  Id:"" + WeatherService.this.hashCode());Log.i(TAG, ""End Id:"" + WeatherService.this.hashCode());</code></pre><p>It gives different hash codes even when I am sure that the same function is running twice (downloading):</p><pre><code>09-12 01:00:55.195: INFO/WeatherService(7222): Start  Id:113765320809-12 01:00:57.235: INFO/WeatherService(7222): Start  Id:113765429609-12 01:00:59.035: INFO/WeatherService(7222): Start  Id:113880653609-12 01:01:39.085: INFO/WeatherService(7222): End Id:113765429609-12 01:01:39.265: INFO/WeatherService(7222): Start  Id:113765429609-12 01:02:22.175: INFO/WeatherService(7222): End Id:113765320809-12 01:02:24.815: INFO/WeatherService(7222): End Id:113880653609-12 01:02:24.836: INFO/WeatherService(7222): Start  Id:113880653609-12 01:02:40.275: INFO/WeatherService(7222): End Id:1137654296</code></pre><p>I am binding a Activity to the service with:</p><pre><code>bindService(new Intent(getApplicationContext(),  WeatherService.class)                               ,mServiceConnection, BIND_AUTO_CREATE);</code></pre><p>And the service can run for minutes until it is completed, therefore the service can be binded to/created by many Activities</p>","382023","","382023","","2010-09-11 23:07:11","2014-04-16 03:19:06","Create only one instance of Service (Android)","<android><android-service>","2","1","1","",""
"3693060","1","4245024","","2010-09-11 23:13:55","23","22724","<p>I am loading a bitmap from a resource like so:</p><pre><code> Bitmap mBackground = BitmapFactory.decodeResource(res,R.drawable.image);</code></pre><p>What I want to do is make some changes to the bitmap before It gets drawn to the main canvas in my <em>draw</em> method (As it would seem wasteful to repeat lots of drawing in my main loop when it isn't going to change). I am making the changes to the bitmap with the following:</p><pre><code>Canvas c = new Canvas(mBackground);c.drawARGB(...); // etc</code></pre><p>So naturally I get an exception</p><pre><code>java.lang.IllegalStateException: Immutable bitmap passed to Canvas constructor</code></pre><p>So to avoid that I made a copy of the bitmap so that it is mutable</p><pre><code>Bitmap mBackground = BitmapFactory.decodeResource(res,R.drawable.image).copy(Bitmap.Config.ARGB_8888, true);</code></pre><p>Which avoid the problem however it sometimes causes OutOfMemoryExceptions, do know any better ways of achieving what I want?</p>","315998","","881229","","2013-12-09 03:50:54","2014-01-05 09:01:19","Loading a resource to a mutable bitmap","<android><bitmap><out-of-memory><android-canvas><mutable>","4","0","5","",""
"3693078","1","","","2010-09-11 23:21:56","16","10231","<p>I am trying to create a custom status bar notification in Android that has a button in addition to the text. The button can do a different thing than when you click the notification itself.Is this possible at all? I'd also be ok putting an image of a button there instead. I know how to put an image, but not sure how to handle OnClick for an image embedded in RemoteViews. Your help is sincerely appreciated.</p><p>Thanks a lot in advance.</p>","192629","","","","","2012-07-17 17:03:56","Android: Adding a button on a status bar notification","<android>","3","2","5","",""
"3693098","1","3693134","","2010-09-11 23:30:55","2","1330","<p>I have three tabs and each one is its own activity.  When I switch tabs I want my Spinner to update but I don't know what method gets called on tab switch.  Any help?</p>","445342","","23897","","2010-09-11 23:35:17","2010-09-12 01:01:17","When switching tabs in Android, what does it constitute?","<android><activity><tabs>","2","0","","",""
"3693100","1","","","2010-09-11 23:31:40","0","313","<p>I have some problem with my Android code. I need to put camera preview in my app but just on small part of screen. I found on net example with inheritance of SurfaceView but that example cover all space on screen. Can anyone help?</p>","444451","","23897","","2010-09-11 23:34:37","2011-07-12 10:05:16","Camera preview problem in Android","<android>","1","0","","",""
"3693194","1","3693248","","2010-09-12 00:02:44","0","73","<p>For example, say the main Activity has an custom object <em>foo</em> with a method called <em>bar</em>.  When foo.bar() is called via the activity, it does a bunch of things on a thread and when it is finished it would somehow alert the main ui thread, the activity, it's parent that it is finished.  </p><p>I imagine this working the same way an event like a OnClickListener works.  The bar() method would trigger an event saying ""Hey I'm finished"" and that would trigger the listener on the main activity.</p><p>Hope that makes sense.</p><p>Thanks for your help!</p>","445348","","","","","2010-09-12 00:33:35","What is the best method for an object to send a message to another for Android?","<java><android><events><listeners>","1","0","","",""
"3693234","1","4405209","","2010-09-12 00:18:54","58","55816","<p>Okay, I've been reading and searching around, and am now banging my head against the wall trying to figure this out. Here's what I have so far:</p><pre><code>package com.pockdroid.sandbox;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.graphics.Rect;import android.widget.ImageView;public class ShadowImageView extends ImageView {private Rect mRect;private Paint mPaint;public ShadowImageView(Context context){    super(context);    mRect = new Rect();    mPaint = new Paint();    mPaint.setAntiAlias(true);    mPaint.setShadowLayer(2f, 1f, 1f, Color.BLACK);}@Overrideprotected void onDraw(Canvas canvas) {    Rect r = mRect;    Paint paint = mPaint;    canvas.drawRect(r, paint);    super.onDraw(canvas);}@Overrideprotected void onMeasure(int w, int h){    super.onMeasure(w,h);    int mH, mW;    mW = getSuggestedMinimumWidth() &lt; getMeasuredWidth()? getMeasuredWidth() : getSuggestedMinimumWidth();    mH = getSuggestedMinimumHeight() &lt; getMeasuredHeight()? getMeasuredHeight() : getSuggestedMinimumHeight();    setMeasuredDimension(mW + 5, mH + 5);}</code></pre><p>}</p><p>The ""+5"" in the measurements are there as temporary; From what I understand I'll need to do some math to determine the size that the drop shadow adds to the canvas, right? </p><p>But when I use this:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    ShadowImageView sImageView;    if (convertView == null) {        sImageView = new ShadowImageView(mContext);        GridView.LayoutParams lp = new GridView.LayoutParams(85, 85);        sImageView.setLayoutParams(lp);        sImageView.setScaleType(ImageView.ScaleType.CENTER);        sImageView.setPadding(5,5,5,5);    } else {        sImageView = (ShadowImageView) convertView;    }    sImageView.setImageBitmap(bitmapList.get(position));    return sImageView;}</code></pre><p>in my ImageView, I still get just a normal ImageView when I run the program. </p><p>Any thoughts? Thanks.</p><p>EDIT: So I spoke with RomainGuy some in the IRC channel, and I have it working now for plain rectangular images with the below code. It still won't draw the shadow directly to my bitmap's transparency though, so I'm still working on that.</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.omen);    Paint paint = new Paint();    paint.setAntiAlias(true);    paint.setShadowLayer(5.5f, 6.0f, 6.0f, Color.BLACK);    canvas.drawColor(Color.GRAY);    canvas.drawRect(50, 50, 50 + bmp.getWidth(), 50 + bmp.getHeight(), paint);    canvas.drawBitmap(bmp, 50, 50, null);       }</code></pre>","321697","","321697","","2010-09-18 06:44:49","2013-07-19 11:24:06","Custom ImageView with drop shadow","<android><override><imageview><dropshadow>","7","2","80","",""
"3693414","1","","","2010-09-12 01:45:43","2","564","<p>I have a ViewFlipper setup where my setInAnimation() and setOutAnimation() are referring to classes that I've extended from Animation. This is all working fine, but what I have noticed is that after all the visual animation has finished ( ie. flip completed ) and whenever I click on the layouts inside my ViewFlipper area, I am still getting calls to my applyTransformation() in my animation classes with interpolatedTime = 1. </p><p>Does this mean the animation never ends properly ? I've tried to add an animation listener to my animation class and it is telling me that it ended. I am just wondering why it is calling applyTransformation() for no good reasons ( wasting CPU and battery ?? ), is there a way to stop this ? More importantly, I suspect this is the reason why I can getting a flicker whenever I touch the layout inside the ViewFlipper area. Any ideas ??</p><p>Thanks</p>","445370","","","","","2010-09-12 01:45:43","ViewFlipper animation never ends?","<android><animation><viewflipper>","0","2","","",""
"3693462","1","4687439","","2010-09-12 02:08:28","1","2280","<p>The CSS for my webapp gets completely misaligned when the mobile device is rotated to landscape (target devices are iphone and android). I tried using the javascript solution explained <a href=""http://stackoverflow.com/questions/2313194/can-i-trigger-a-css-event-in-mobile-safari-upon-iphone-orientation-change"">here</a> in order to get my app to switch between a portrait.css and a landscape.css file on orientation change, but that still didn't work. It even messed up the portrait.css once they were both posted to the live server (although it worked on my local machine).</p><p>The url for the app is <a href=""http://mobile.geekstats.com/"" rel=""nofollow"">http://mobile.geekstats.com/</a></p><p>Does anyone know how I can fix the landscape css? Thanks!</p>","445320","","","","","2011-05-13 20:31:58","mobile webapp CSS breaks on orientation change","<iphone><android><css><web-applications><mobile>","1","0","1","",""
"3693480","1","4403051","","2010-09-12 02:15:07","2","1360","<p>I wrote a small app to allow the user to choose which language he uses the Voice Search via a button, rather than relying on the user's language preference (sometimes you want to voice search in Japanese without switching your whole UI to Japanese).</p><p>I am testing the app on my HTC Desire /Android 2.1 (Softbank-x06ht). However, when I call the voice api, I get a ""Connection Failed"" dialog box [retry/cancel], and LogCat shows this warning:</p><pre><code>09-12 11:26:13.583: INFO/RecognitionService(545): ssfe url=http://www.google.com/m/voice-search09-12 10:49:45.683: WARN/RecognitionService(545): required parameter 'calling_package' is missing in IntentAPI request</code></pre><p>Note that I can use the Google Voice Search app and it works with no problems.</p><p>According to the API Docs <a href=""http://developer.android.com/reference/android/speech/RecognizerIntent.html#EXTRA_CALLING_PACKAGE"" rel=""nofollow"">http://developer.android.com/reference/android/speech/RecognizerIntent.html#EXTRA_CALLING_PACKAGE</a> the calling_package parameter is not to be used by developers. Well, if that is the case, why does the log say it is missing?</p><p>I tried to provide the parameter myself but it didnt change the outcome at all.</p><pre><code> private static final String TRIVOICE_CALLING_PACKAGE = ""calling_package""; private void callSpeechWebSearch (String language) {    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,            RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,            language);    intent.putExtra(TRIVOICE_CALLING_PACKAGE,            ""org.filsa.trivoice"");    //intent.putExtra(RecognizerIntent.EXTRA_PROMPT, ""Speech recognition demo"");    try {        startActivity(intent);             } catch (ActivityNotFoundException anfe) {     makeToast(""ANFE:"" +anfe.getMessage());    }}</code></pre>","119671","","119671","","2010-09-12 02:29:08","2013-05-10 11:25:50","Calling android.speech.RecognizerIntent API results in Connection Error dialog, shows 'calling_package' warning in log","<android><htc><voice-recognition>","2","0","","",""
"3693547","1","","","2010-09-12 02:43:32","2","3782","<p>I've got an app that responds to an Alert - and I really need to show an alert with a password entry before going on to the next screen; the trouble is I don't seem to be able to show a dialog from a broadcast receiver -- so how can I show a dialog password entry upon receiving an alert?</p>","445394","","","","","2012-04-13 21:36:33","Android Broadcast Receiver showing a dialog?","<android><dialog><broadcastreceiver>","1","0","","",""
"3693566","1","3693993","","2010-09-12 02:58:01","3","2507","<p>I wanted to run a helloworld application with the AOSP and see it in emulator.[ Not through Android SDK setup]</p><p>I followed the steps in <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">http://source.android.com/source/download.html</a>and compiled successfully the full code from / directory.</p><p>I could see contacts.apk, camera.apk all applications apk in ~/mydroid/out/target/product/generic/system/app.</p><p>I tried two things.</p><p>1 - Went to /package/apps folder. Took a helloworld application( helloworld folder which was created in android-sdk), and copied a 'Android.mk' file from Launcher2 folder, kept my new name for application and placed the folder in packages/app folder and compiled at /.     I couldnt see .apk file created for ~/mydroid/out/target/product/generic/system/app.</p><p>2 - I changed the package name for Launcher2 in packages/app folder in 'Android,mk' file and compiled at root. I couldnt see a new apk created on the new packaged name under     ~/mydroid/out/target/product/generic/system/app. </p><p>I tried several times with changes in activity names, application names in manifest.xml file. Nothing reflects.But it is sure, both helloworld, and change in package name is getting picked up while compiling. I could see intermediate classes getting created.~/mydroid/out/target/common/obj/APPS/manifirst_intermediates/src/com/android/mani    --> manifirst is like a helloworld which i created and run.~/mydroid/out/target/common/obj/APPS/Launcher2_intermediates/src/com/android/launcher </p><p>Could anyone please share the steps of compiling a simple Helloworld program in AOSP.?</p><p>Thanks,Mani</p>","436689","","648313","","2011-07-13 21:00:30","2011-07-13 21:00:30","How to compile Helloworld with Android source code","<android><android-source>","1","0","","",""
"3693672","1","3694670","","2010-09-12 03:56:35","0","1497","<p>I use an <code>AlarmManager</code> to run a Service which tries to download a file from the web. If it fails I'd like to retry that Service in 5 minutes.</p><p>Inside the Service I run an <code>AsyncTask</code> to run my code. As far as I know the only way I can tell if it failed or not is from the <code>onPostExecute()</code>.</p><p>What is the best way of implementing a retry of that Service again?</p>","149166","","","","","2010-09-12 11:33:17","How to run a retry when download fails in AsyncTask using AlarmManager","<java><android><service><android-asynctask><alarmmanager>","1","6","2","",""
"3693702","1","3693710","","2010-09-12 04:08:01","2","13209","<p>I would like to have a button in my android application trigger a slide down view of a form.  I want to have a view at the top of the screen, a list at the bottom of the screen, and I want to have the slide down form view appear between the two when a button is clicked.  </p><p>I have no problem showing the view, but can't seem to animate it from hidden to shown on the screen.  </p><p>Any ideas on how this could work?</p>","462052","","127880","","2011-07-15 14:18:38","2013-07-05 13:06:14","Slide down view in android","<android><list><animation><slide>","2","0","6","",""
"3693758","1","3695293","","2010-09-12 04:34:45","1","1016","<p>I want to use an Non Blocking IO to read a stream/output from a background process.Can anyone give me an example on how to use the Non Blocking IO on Android?</p><p>Thanks for the help.</p>","275674","","275674","","2010-09-12 05:38:48","2011-12-18 16:40:47","Android: Unbuffered IO","<java><android>","2","1","1","",""
"3693790","1","","","2010-09-12 04:50:15","1","1121","<p>How to implement a layer above a layout? like this pic:<a href=""http://ss12.sinaimg.cn/orignal/5d8cb30ag8f47eca43a5b&amp;690"" rel=""nofollow"">http://ss12.sinaimg.cn/orignal/5d8cb30ag8f47eca43a5b&amp;690</a></p>","364112","","","","","2010-09-12 08:52:50","How to implement a layer above a layout?","<android>","2","1","","",""
"3694046","1","","","2010-09-12 07:04:45","0","291","<p>I'm using eclipse helios to design a simple android application, however I'm having issues with tidying up the user interface by editing the XML after writing the rest of the application.  However none of the edits to the XML file (I've checked it's the right one) are showing when I send the application to the onscreen emulator. </p><p>For example, if I change this segment:""      ""to""      ""and click on the green arrow, the radio button remains ""Female"".</p><p>Can anyone help?</p>","445460","","","","","2011-04-29 14:07:40","XML in eclipse not updating?","<android><xml><emulator>","2","0","","",""
"3694055","1","","","2010-09-12 07:10:17","1","461","<p>My Application downloads a file from a server and stores it in:<code>/mnt/sdcard/Android/data/com.test/files</code>. (the /mnt/sdcard is derived from <code>Environment.getExternalStorageDirectory();</code> )</p><p>Everytime I redeploy the Application from eclipse(run menu) to the emulator it deletes the file.The Checkbox 'target/wipe user data' in the run configuration is unchecked.I close all the <code>BufferedOutputStreams</code> properly so I don't think it is my application itself.Am I using the right directory for persistent data storage? (my Files are around 70-100M)</p><p>Any hints?</p>","445464","","404469","","2010-09-12 13:37:25","2010-09-12 13:37:25","android emulator/eclipse deletes application files on redeployment","<android><eclipse><emulator>","1","1","","",""
"3694058","1","","","2010-09-12 07:11:51","0","1193","<p>I am trying to parse RSS feeds from a news website but I am unable to fetch the images from the rss feeds. Can someone suggest me some easy implementation for parsing RSS feeds with images in Android.</p>","445461","","","","","2012-11-23 04:49:33","Image parsing in rss in android","<android><rss>","1","3","","",""
"3694267","1","3694549","","2010-09-12 08:51:49","9","2924","<p>I'm working on an app that extends the functionality of another, existing app. I want to know what the easiest way is to determine, through code, whether the first app is installed, preferably by referencing it by com.whoever.whatever but almost any criteria would be helpful.</p>","429040","","","","","2012-02-07 16:17:09","Android - check for presence of another app","<android>","2","0","2","",""
"3694306","1","3694332","","2010-09-12 09:13:17","3","4951","<p>I want to do the following:</p><p>I want to make a very simple gallery application. So I'd like to select a path for the images and set it as a resource. I set it in String.xml.</p><p>So I have another class, which needs the selected path to load all the images from it. </p><pre><code>class ImageHolder{     public ImageHolder()    {    this(R.string.image_dir);    //problem is here - R.string.image_dir returns a unique int, while what I really need is the string. How can I get it...    }    public ImageHolder(String path)    {    .........standart procedure.....    }}</code></pre>","346583","","","","","2010-09-12 09:25:54","android - get a resource (a string) from its unique integer","<android>","1","0","2","",""
"3694494","1","3694527","","2010-09-12 10:32:32","0","402","<p>I want to make a simple image viewing program, that just takes the images from a certain folder, and loads them from it.</p><p>I did some coding with less thinking, so I did stumble upon this:</p><pre><code>Button btn = (Button) this.findViewById(R.id.buttonNext);        btn.setOnClickListener(new OnClickListener() {   public void onClick(View v)    {    View rootView = (View)v.getParent();    ImageView im = (ImageView) rootView.findViewById(R.id.imageView);    //and here comes the problem...   }</code></pre><p>I have all my images from the folder loaded and have a collection, containg of all their absolute paths. Now, I want my imageView to switch its picture src with one from my collection. But how can I do that ? </p>","346583","","346583","","2010-09-12 10:43:46","2010-09-12 10:54:31","Android - How can I load an image to a ImageView?","<android><image-processing>","2","2","","",""
"3694657","1","4955047","","2010-09-12 11:28:53","1","961","<p>I will like to use gallery view to add listview or relativelayout. Most of the examples that I have seen are of adding images in gallery and that is quite simple. Can someone let me know how to add other layouts inside gallery view.</p>","445541","","","","","2011-02-10 08:57:35","Add Relativelayout or listview in Gallery in android?","<android><layout><gallery>","1","0","","",""
"3694830","1","","","2010-09-12 12:33:35","16","19149","<p>I am a bit confused on creating an image which will be acting as a background for my activities. So, in short, my aim is that my application should be able to fit the different screen sizes. Therefore, what size in pixel should my three images be to be able to fill the screen of the device in ldpi, mdpi and hdpi?</p><p>Thank you for any response.</p>","439002","","","","","2014-04-03 14:01:02","Android activity image background size","<android><image><background><size><screen>","3","0","18","",""
"3694859","1","5556198","","2010-09-12 12:44:12","2","444","<p>A quick Google search hasn't yielded any answers to this:</p><p>Are there any factors that would prevent me from developing on Android using <code>MT4J</code>?</p>","194982","","119895","","2010-09-12 13:26:28","2011-04-05 17:52:02","MT4J on Android?","<java><android><multi-touch><mt4j>","2","2","1","",""
"3694874","1","","","2010-09-12 12:47:06","2","1073","<p>I've tried to use the new license service of Android and I am facing some troubles. My code in the main activity looks like this:</p><pre><code>  mLicenseCheckerCallback = new MyLicenseCheckerCallback();  String deviceId = Secure.getString(MainTabActivity.this.getContentResolver(), Secure.ANDROID_ID);    mChecker = new LicenseChecker(            MainTabActivity.this, new ServerManagedPolicy(MainTabActivity.this,                new AESObfuscator(SALT, getPackageName(), deviceId)),            BASE64_PUBLIC_KEY              );        mChecker.checkAccess(mLicenseCheckerCallback);</code></pre><p>(basically just the shown code of the Android online documentation. The callback passes through if it's allowed and if it's not it displays a message and quits the app. So far so good.</p><p>The problem is that it works fine in the debugger, but when I publish it to the market and upgrade my app (I've purchased a version of my app with my personal gmail-accout, so I am a legitimate user) I get the error that the my app is not licensed. I've even added my personal gmail address to the whitelist in my market-profile and set the status to ""LICENSED"" but it still comes up with the error. Do you have any suggestions ?</p>","424514","","","","","2011-07-02 18:48:49","Trouble with Android Licensing Server","<android><licensing>","2","4","1","",""
"3695038","1","3739845","","2010-09-12 13:37:52","3","510","<p>I have a html page with some links. When you click on a link, some jQuery code hides the div container, and shows another div. The originals links, in the first div, are no longer visible.</p><p>From the browser (webkit on android) point of view, everything works perfectly.</p><p>But if I touch the screen, the hidden links react as if they were visible. If I touch the screen, where the hidden links would be, I see an orange rectangle. The browser does nothing it is only showing the link as clicked.</p><p>How is it possible to synchronize touch screen and jquery hide/show functions?</p><p>My test is on webkit, android, and sony ericson xperia phone.</p><p>I've realised a test page with the phenomen. See it <a href=""http://www.diaam.com/stacko/stacktest.html"" rel=""nofollow"">here</a> or with this qr code:</p><p><img src=""http://i.stack.imgur.com/jWlz6.png"" alt=""alt text""></p><p>When you touch the link, you go to a div without any links, but, on my phone, if I touch the first line I see an effect on the non visible link.</p><p>Here is the html :</p><pre><code>&lt;!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN""&gt;&lt;html&gt;  &lt;head&gt;    &lt;title&gt;Test for Stackoverflow&lt;/title&gt;    &lt;meta http-equiv=""Content-Type"" content=""text/html; charset=UTF-8""&gt;    &lt;script type=""text/javascript"" src=""jquery-1.4.2.min.js""&gt;&lt;/script&gt;    &lt;script type=""text/javascript""&gt;$(document).ready(function (){  $(""#with-link a"").click(function()  {    $(""#with-link"").hide(""slow"");    $(""#after-touch"").show(""slow"");    return false;  });});    &lt;/script&gt;  &lt;/head&gt;  &lt;body&gt;    &lt;div id=""with-link""&gt;      Oh... &lt;a href=""http://stackoverflow.com""&gt;It's a link !&lt;/a&gt;    &lt;/div&gt;    &lt;div id=""after-touch""style=""display:none""&gt;      But it's not go to stackoverflow :-)&lt;br&gt;      To Touch Or Not To Touch that is the question.    &lt;/div&gt;  &lt;/body&gt;&lt;/html&gt;</code></pre>","312025","","114066","","2010-09-16 07:38:38","2010-09-18 00:08:59","Touch screen reacts on hidden links","<jquery><android><webkit>","1","8","1","",""
"3695224","1","12997900","","2010-09-12 14:44:58","30","16637","<p>I don't know if I'm wierd, but I haven't found any topic about the subject. The thing is, I have data with lat and lng stored in my SQLite database, and I want to get the nearest locations to the parameters I put in (ex. my current location - lat, lng).</p><p>I know that this is possible in MySql, and I've done quite some research that SQLite needs a custom external function for the Haversine formula (calculating distance on a sphere), but I haven't found nothing yet, that is written in Java and is functioning.</p><p>Also, if I want to add custom functions, I need the org.sqlite .jar (for org.sqlite.Function) and that adds unnecessary size to the app.</p><p>The other side of this is - i need the Order by function from sql, because displaying the distance alone isn't that much of a problem - I already did it in my custom SimpleCursorAdapter, but I can't sort the data, because i don't have the distance column in my DB. That would mean updating the DB everytime the location changes and that's a waste of battery and performance. So if someone has any idea on sorting the cursor with a column that's not in the database, I'd be grateful too!</p><p>I know there are tons of Android apps out there that use this function, but can someone please explain the magic :)</p><p>Thanks!</p><p>Btw: found this alternative: <a href=""http://stackoverflow.com/questions/3126830/query-to-get-records-based-on-radius-in-sqlite"">http://stackoverflow.com/questions/3126830/query-to-get-records-based-on-radius-in-sqlite</a></p><p>It's suggesting to make 4 new columns for cos and sin values of lat and lng, but is there any other, not so redundant way?</p>","445613","","445613","","2010-09-12 16:06:40","2014-04-15 19:28:23","Android - SQlite Getting nearest locations (with latitude and longitude)","<java><android><sqlite><geolocation>","6","4","46","",""
"3695229","1","","","2010-09-12 14:46:13","1","120","<p>I have code which has one activity which passes information to  a second activity. I can use this information to pass to a third activity with additional information from the result of the second activity.</p><p>I want to use gestures as a method of going back to a previous activity, but if I go back from the third to the second activity I need the information initially passed from the first to the second activity to still be present. </p><p>i.e.</p><p>First Acticity</p><p>what is Y? </p><p>answer y = 5</p><p>Second activity</p><p>User said Y = 5</p><p>what is X?</p><p>Third Activity</p><p>User said Y = 5X = 6</p><p>Go back to Second activity but maintain the input of </p><p>User said Y = 5.</p><p>To do this I have used a bundle to pass the information between activities, but I can only access the info in the bundle from within a method within the class started by the intent.</p><p>the gesture controls are within another class, so I cannot access the bundle information from within this class as the getIntent command produces a not defined error.</p><p>What I need to do is to be able to pass the information from the bundle from the first activity to the gesture class so that I can pass it back when I go back using the gestures.</p>","445614","","","","","2010-09-12 15:00:06","?Sending a String created inside a method to another class","<android><variables><gestures>","1","0","","",""
"3695470","1","","","2010-09-12 15:50:58","0","450","<p>I need to list the 'Display name' of all the contacts belonging to a single account.</p><p>I am planning to use a cursor adapter for populating the list and hence would require the corresponding fields (Display name, Account info) to be fetched in a single content provider query.</p><p>Looking at the Contacts Database Structure a single table among Raw Contacts, Contacts and Data wont be able to provide these two parameters and hence a join is necessary.</p><p>As far as i know join wont be possible to fetch the data from the content provider.</p><p>Can you please let me know the solution to the problem?</p><p>Thanks in advance.</p>","366053","","13302","","2013-06-27 20:38:16","2013-06-27 20:38:16","Need to fetch the Contact Account name and Contact Display name from the content provider using a single cursor in Android","<android>","2","1","","",""
"3695484","1","3701352","","2010-09-12 15:54:04","10","4748","<p>I am showing a <code>ProgressDialog</code> in the <code>onPreExecute</code> method of an AsyncTask object and canceling the ProgressDialog in the <code>onPostExecute</code> method.  In the <code>doInBackground</code> method I am making an HTTP request for user registration.  I wish to allow screen orientation changes. When I change the orientation while the <code>doInBackground</code> method is still running, i get all sorts of fun errors like 'IllegalArgumentException: View not attached to window manager' and 'RegisterScreen has leaked window...'</p><p>How can I properly continue to show the <code>ProgressDialog</code> after an orientation change? Or maybe, how can I disable orientation change after the user requests to submit their registration?</p>","416412","","","","","2014-03-18 10:34:08","How to deal with orientation change with a ProgressDialog showing?","<android><orientation><progressdialog>","7","1","2","",""
"3695491","1","","","2010-09-12 15:56:18","0","1465","<p>I am trying to play media player in android.But after some time it is giving following errors and the songs stop.</p><pre><code>09-12 21:15:37.265: ERROR/PlayerDriver(31): Command PLAYER_PREPARE completed with an error or info PVMFErrResource09-12 21:15:37.275: ERROR/MediaPlayer(333): error (1, -17)09-12 21:15:37.295: WARN/PlayerDriver(31): PVMFInfoErrorHandlingComplete09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333): Error updating to newly loaded content.09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333): java.io.IOException: Prepare failed.: status=0x109-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at android.media.MediaPlayer.prepare(Native Method)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at com.calmradio.radio.StreamingMediaPlayer.createMediaPlayer(StreamingMediaPlayer.java:225)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at com.calmradio.radio.StreamingMediaPlayer.transferBufferToMediaPlayer(StreamingMediaPlayer.java:254)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at com.calmradio.radio.StreamingMediaPlayer.access$3(StreamingMediaPlayer.java:234)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at com.calmradio.radio.StreamingMediaPlayer$2.run(StreamingMediaPlayer.java:175)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at android.os.Handler.handleCallback(Handler.java:587)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at android.os.Handler.dispatchMessage(Handler.java:92)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at android.os.Looper.loop(Looper.java:123)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at android.app.ActivityThread.main(ActivityThread.java:4203)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at java.lang.reflect.Method.invokeNative(Native Method)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at java.lang.reflect.Method.invoke(Method.java:521)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)09-12 21:15:37.345: ERROR/com.calmradio.radio.StreamingMediaPlayer(333):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Then it starts giving this following error.</p><pre><code>09-12 21:15:37.915: ERROR/MediaPlayer(333): Error (-38,0)09-12 21:15:37.915: ERROR/com.calmradio.radio.StreamingMediaPlayer$3(333): Error in MediaPlayer: (-38) with extra (0)09-12 21:15:37.926: ERROR/MediaPlayer(333): Attempt to call getDuration without a valid mediaplayer09-12 21:15:37.926: ERROR/MediaPlayer(333): error (-38, 0)</code></pre><p>But though the media player stop,the buffering is still on.</p><p>These two errors are giving alternately.Could anyone please give any solution for how to play the media player without these errors.</p>","444277","","65977","","2010-09-12 23:52:26","2010-10-15 11:04:33","Android Media Player Error","<android>","0","2","1","",""
"3695566","1","3695658","","2010-09-12 16:16:55","1","9541","<p>I tried so much tutorials, and read a lot here at SO, but i cant solve my problem:</p><p>When a button is clicked, the user can choose the mobile number of a contact. Actual I can get the name of the selected contact, but i can't find a way, to get/chose the mobile number..</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    /** Layouting */    this.mGetMobileNumberButton = (Button)findViewById(R.id.getMobileNumberButton);    this.mNameTextView = (TextView)findViewById(R.id.nameTextView);    this.mMobileNumberTextView = (TextView)findViewById(R.id.mobileNumberTextView);    /** onClick getContactInfos*/   this.mGetMobileNumberButton.setOnClickListener(new OnClickListener() {      public void onClick(View v){           Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);          startActivityForResult(intent, 1);              }     });}@Overridepublic void onActivityResult(int reqCode, int resultCode, Intent data) {    super.onActivityResult(reqCode, resultCode, data);    if (resultCode == Activity.RESULT_OK) {        Uri contactData = data.getData();        Cursor c = managedQuery(contactData, null, null, null, null);        if (c.moveToFirst()) {            String name = c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));            mNameTextView.setText(name);        }    }}</code></pre><p>Hope anyone can help :)</p>","395135","","","","","2012-03-07 10:49:48","Android Api - get mobile number from contacts","<android><api><contacts>","2","0","1","",""
"3695587","1","3695595","","2010-09-12 16:21:48","9","5559","<p>Iam trying to connect my App to a WCF service that I created in asp.net.The service runs on my localmachine: <a href=""http://localhost:8080/Service.svc/"">http://localhost:8080/Service.svc/</a></p><p>But for some reasons my Android can not connect to this http-adress.</p><p>This is the error:</p><p>09-12 14:50:44.540: WARN/System.err(593): org.apache.http.conn.HttpHostConnectException: Connection to <a href=""http://127.0.0.1:8080"">http://127.0.0.1:8080</a> refused<br/>this is the method in wcf, Iam trying to return a collection with some values.</p><pre><code>        /// &lt;returns&gt;An enumeration of the (id, item) pairs. Returns null if no items are present&lt;/returns&gt;    protected override IEnumerable&lt;KeyValuePair&lt;string, SampleItem&gt;&gt; OnGetItems()    {        // TODO: Change the sample implementation here        if (items.Count == 0)        {            items.Add(""A"", new SampleItem() { Value = ""A"" });            items.Add(""B"", new SampleItem() { Value = ""B"" });            items.Add(""C"", new SampleItem() { Value = ""C"" });        }        return this.items;    }</code></pre><p><br />And this is how the connection in the android looks like:</p><pre><code>public void getData(String url){    HttpClient httpClient = new DefaultHttpClient();    HttpGet httpGet = new HttpGet(url);    HttpResponse response;    try    {        response = httpClient.execute(httpGet);        Log.i(TAG,response.getStatusLine().toString());} catch (ClientProtocolException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }/* catch (JSONException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } */catch (Exception e){        e.printStackTrace();    }finally{        httpGet.abort();    }}</code></pre>","371301","","","","","2012-08-26 13:56:28","Android app connecting to a webservice - not working","<c#><java><android><wcf>","1","0","4","",""
"3695634","1","3695844","","2010-09-12 16:36:14","11","16472","<p>I managed to get the map shown on the screen. Now the user will move around the map and press on it. After pressing on a point I need to add a push pin on screen on the pressed location. If the user decides to go for another point, when pressing on the chosen point, the first pushpin would disapear  and a new one will be drawn on the new location</p><p>I did like this:</p><pre><code>public class LocationSelectionActivity extends MapActivity {         GeoPoint p;     List&lt;Overlay&gt; listOfOverlays;     MapOverlay mapOverlay;    private MapView mapView;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.locationselection);        mapView = (MapView) findViewById(R.id.mapView);        mapView.setSatellite(false);        final MapController mc = mapView.getController();        String coordinates[] = {""46.540606"", ""22.454542""};        double lat = Double.parseDouble(coordinates[0]);        double lng = Double.parseDouble(coordinates[1]);         p = new GeoPoint(            (int) (lat * 1E6),             (int) (lng * 1E6));        mc.animateTo(p);        mc.setZoom(10);         ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols);        zoomControls.setOnZoomInClickListener(new View.OnClickListener() {                public void onClick(View v) {                        mc.zoomIn();                }        });        zoomControls.setOnZoomOutClickListener(new View.OnClickListener() {                public void onClick(View v) {                        mc.zoomOut();                }        });      //---Add a location marker---        mapOverlay = new MapOverlay();        listOfOverlays = mapView.getOverlays();        listOfOverlays.clear();        listOfOverlays.add(mapOverlay);        mapView.invalidate();    }   class MapOverlay extends com.google.android.maps.Overlay    {        @Override        public boolean draw(Canvas canvas, MapView mapView,         boolean shadow, long when)         {            super.draw(canvas, mapView, shadow);                               //---translate the GeoPoint to screen pixels---            Point screenPts = new Point();            mapView.getProjection().toPixels(p, screenPts);            //---add the marker---            Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.map_flag);                        canvas.drawBitmap(bmp, screenPts.x, screenPts.y-48, null);            return true;        }        @Override        public boolean onTouchEvent(MotionEvent event, MapView mapView)         {               //---when user lifts his finger---            if (event.getAction() == 1) {                                GeoPoint p = mapView.getProjection().fromPixels(                    (int) event.getX(),                    (int) event.getY());                    Toast.makeText(getBaseContext(),                         p.getLatitudeE6() / 1E6 + "","" +                         p.getLongitudeE6() /1E6 ,                         Toast.LENGTH_SHORT).show();            }                                        return false;        }            } </code></pre><p>This draws the initial pushpin (the map_flag resource). When clicking on the map I get the Toast with the coordonates... all is left to do is on a new click, erase the old pin and add a new one.</p><p>But how to do it ?</p>","379865","","","","","2012-01-04 11:57:35","MapView adding pushpins on touch","<android><android-mapview><pushpin>","3","0","2","",""
"3695724","1","","","2010-09-12 17:08:27","0","850","<p>I have  problem, in my Android app, I have <code>ImageView</code> and I implemented <code>onClick</code> event but when I click on <code>ImageView</code> it looks like that it doesn't run <code>onClickListener</code> at all.</p><p>Any help?</p>","445173","","119895","","2010-09-12 17:14:16","2010-09-12 17:14:48","Problem with ImageView onClickListener on Android","<android>","1","1","","",""
"3695814","1","3696142","","2010-09-12 17:37:19","0","1495","<p>I'm writing an android app and in it I want to have a sort of title bar including the name of the game, the score, and things like that. Then below that I want to have an grid of image views, which will kind of be like tiles on which I can display different characters in my game.</p><p>I have the following xml layout, but when I run it and I get a black screen:</p><p><code></p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:orientation=""horizontal""&gt;    &lt;TextView android:id=""@+id/title""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:text=""@string/app_name""            /&gt;    &lt;TextView android:id=""@+id/score""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:text=""@string/score""            /&gt;    &lt;TextView android:id=""@+id/score""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:text=""0""            /&gt;    &lt;TextView android:id=""@+id/robotsLeft""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:text=""@string/robots""            /&gt;    &lt;TextView android:id=""@+id/score""            android:layout_width=""wrap_content""            android:layout_height=""fill_parent""            android:text=""0""            /&gt;&lt;/LinearLayout&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridview""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:columnWidth=""90dp""    android:numColumns=""auto_fit""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:stretchMode=""columnWidth""    android:gravity=""center""/&gt;</code></pre><p></code></p><p>GridView is initialized as per this tutorial:</p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-gridview.html</a></p><p>ie. in my main activity's onCreate():</p><pre><code>super.onCreate(savedInstanceState);  setContentView(R.layout.main);          GridView gridview = (GridView) findViewById(R.id.gridview);gridview.setAdapter(new ImageAdapter(this));</code></pre><p>Can anyone see anything I've done wrong?</p><p>Thanks!</p>","395986","","1544250","","2012-04-09 15:17:46","2012-04-09 15:17:46","Android layout not showing properly","<android><xml><gridview><android-layout>","2","0","1","",""
"3695827","1","3696148","","2010-09-12 17:40:47","12","10080","<p>This might be a simple question, but i've been looking around and can't find the answer,well, as my title said, is there any code to show the context menu on the android from a code, instead press the menu button? eg. when i touch the screen then it'll call the context menu?</p><p>Regards,AnD</p>","286080","","","","","2014-02-01 22:06:15","android show context menu from code behind","<android><menu><context><show><code-behind>","3","0","1","",""
"3695856","1","3695881","","2010-09-12 17:48:45","16","19314","<p>Is there any way to make the drawer slide from top to bottom?</p>","379594","","","","","2014-02-11 16:44:13","Android SlidingDrawer from top?","<android>","4","0","8","",""
"3695867","1","3695887","","2010-09-12 17:51:45","1","2101","<p>When I press back or home in my application, it hides, but the MediaPlayer keeps going. Is there a way to know when these buttons have been pressed and stop playback before closing?</p>","420617","","","","","2013-01-07 23:44:37","Android: Stop playback on Home or Back button","<android><stop><back><home>","3","0","2","",""
"3695993","1","3696007","","2010-09-12 18:22:43","0","3245","<p>Right now I am using the following code to update a <code>TextView</code></p><pre><code>txtMain.setText(""new text"");</code></pre><p>After that code executes, the screen does not update with the new text. Is there a way I can force the text to update right then and there?</p>","386680","","421372","","2013-01-02 08:47:17","2014-04-02 20:24:31","How do you update the screen after you change the text with a setText?","<android><refresh>","1","0","","",""
"3696031","1","","","2010-09-12 18:33:26","10","11796","<p>I've seen specialized Android UI libraries like for charting, but none for alternate implementations of controls and containers.  Are there any?</p>","369722","","","","","2011-08-06 00:27:11","Are there any 3rd party UI libraries for Android?","<android><user-interface><view><components>","2","3","1","2012-01-09 02:14:30",""
"3696067","1","3696289","","2010-09-12 18:44:18","5","2650","<p>i tried since many hours to launch navigation from my app.I want navigation without destination.</p><p>i tried with </p><pre><code>        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(""google.navigation:q=""));        startActivity(i);</code></pre><p>That launches navigation but with destination not found</p><p>I tried too to launch processName, packageName with startIntent with <strong>com.google.android.apps.maps</strong>,<strong>com.google.android.apps.maps:driveabout and **com.google.android.maps.driveabout.app.DestinationActivity</strong></p><p>with no succes too :/</p><p>an idea ?</p>","431652","","","","","2012-05-22 22:39:11","Problem launching Google Navigation","<android><navigation><launch>","5","0","1","",""
"3696082","1","3696233","","2010-09-12 18:47:30","6","9837","<p>I want my app to access database every hour and read next record from the table then update desctop widget and send notification. I know that there is AlarmManager which I can use to register my Intents but they are deleted when the phone is turned off or rebooted. </p><p>Is there any other android class/service that I would update my application continuously even when I reboot my phone?</p><p>Thanks,</p>","400493","","","","","2010-09-12 19:28:36","How to schedule my android app to do something every hour","<java><android><schedule><alarm><alarmmanager>","2","0","4","",""
"3696103","1","","","2010-09-12 18:53:17","2","2837","<p>how can I create java events from an new input device on an android device?</p>","445721","","","","","2012-11-09 01:13:43","android: pass kernel input event /dev/input/event* to java","<android>","2","0","","",""
"3696245","1","","","2010-09-12 19:29:21","4","16963","<p>I want to display a table with some fields being editable - see this example:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:orientation=""vertical"" android:paddingLeft=""1dip"" android:paddingRight=""1dip"" android:paddingBottom=""1dip"" android:background=""#F00"" &gt; &lt;ScrollView  android:id=""@+id/ScrollView01""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:scrollbars=""vertical""  &gt;  &lt;HorizontalScrollView   android:id=""@+id/HorizontalScrollView01""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:scrollbars=""horizontal""   &gt;   &lt;TableLayout    android:id=""@+id/ItemPane""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:background=""#EEE""   &gt;    &lt;TableRow     android:id=""@+id/DataRow""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""         android:background=""#888""     android:layout_margin=""0dp""      android:gravity=""left""     &gt;     &lt;TextView      android:id=""@+id/NameField""      android:text=""Fieldname""      android:background=""#EEE""      android:textSize=""14dp""      android:layout_margin=""1dp""       android:layout_marginBottom=""0dp""       android:paddingLeft=""3dp""      android:paddingRight=""3dp""     /&gt;     &lt;EditText      android:id=""@+id/DataField""      android:text=""some field""      android:background=""#EEE""      android:textSize=""14dp""      android:layout_margin=""1dp""       android:layout_marginBottom=""0dp""       android:paddingLeft=""3dp""      android:paddingRight=""3dp""      android:singleLine=""true""     /&gt;     &lt;EditText      android:id=""@+id/DataField2""      android:text=""some longish field content...""      android:background=""#EEE""      android:textSize=""14dp""      android:layout_margin=""1dp""       android:layout_marginBottom=""0dp""       android:paddingLeft=""3dp""      android:paddingRight=""3dp""      android:singleLine=""true""     /&gt;    &lt;/TableRow&gt;      &lt;/TableLayout&gt;  &lt;/HorizontalScrollView&gt; &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p>Why is the textSize attribute ignored in EditText-fields? How can I make the text in those fields smaller, so that ALL cells have the same font size? Why does Android not honor that attribute, even if explicitly set?</p><p>Michael</p>","423411","","","","","2013-10-22 11:43:50","Android: How to change the textsize in an EditText field?","<android><android-widget>","2","3","","",""
"3696352","1","3696395","","2010-09-12 19:54:38","2","583","<p>I have two Activities that both list items in a table. For the time being both currently use the same layout and then inflate it at runtime. </p><p>However, to cleanly and strictly separate the two and also allow me to later maybe have slightly different layouts for each, I would like to have two different layout names but simply alias (is that a verb?) one layout to point to the other.</p><p>Can that be done? I tried to define an alias id in the strings.xml file but that only yields errors.</p><p>Michael</p>","423411","","","","","2011-12-23 11:23:55","Android: can one alias a layout?","<android><android-layout>","2","0","","",""
"3696415","1","3749216","","2010-09-12 20:09:14","4","5979","<p>I have the following code to add an Overlay</p><pre><code>myMapView.getOverlays().add(sites);myMapView.invalidate();</code></pre><p>I also have the following remove code where sites is a global variable.</p><pre><code>if (sites != null) {                // myMapView.getOverlays().clear();                myMapView.getOverlays().remove(sites);                myMapView.invalidate();                sites = null;            }</code></pre><p>Sometimes I am left with duplicates so would like a way to remove all overlays from a map, is this possible?</p>","103999","","103999","","2010-09-13 17:55:32","2011-06-29 10:25:36","Remove all Overlays","<android><overlay><android-mapview><itemizedoverlay>","1","1","4","",""
"3696440","1","3697441","","2010-09-12 20:17:23","1","881","<p>What is best way for services error handling?For example, I have service which get some information from Internt, I want show to user some dialog with message when connectivity is bad. Or if I have some Util class for parse HTML that used by my service and exception occures in this Util class. How to show dialog? As I know DialogBuilder needs some Activity context, but Service context is wrong for this. Right?Thanks.</p>","423868","","","","","2010-09-13 01:34:09","Android service error handling","<android><exception><error-handling><android-service>","1","0","","",""
"3696489","1","3696813","","2010-09-12 20:30:14","2","6287","<p>The TelephonyManager.getLine1Number() works on GSM phones, but not CDMA phones. Is it possible to get the phone number of a CDMA phone through android API calls at all? thanks</p>","91063","","","","","2010-10-21 14:03:18","How to get phone number of an android CDMA phone?","<android><api><cdma>","2","0","1","",""
"3696506","1","","","2010-09-12 20:35:01","3","13121","<p>Hey all - this code might be a bit messy in the way I'm trying to clean up the handler as I've been trying to track down where the crash happens...</p><p>I've got a dialog activity that is showing a password entry with a progressbar being animated by a thread and handler...</p><p>It seems that when I'm attempting to see if the progressbar is done, and trying to kill the thread, the way I'm doing this is messing something up when I try to go to a new activity - ie in a way calling a function and not having anything to return <em>to</em> or something...</p><pre><code>public class RMO_Dialog extends Activity {    private ProgressBar progbar;    private Button dialogOK;    private EditText dialogPass;    private SharedPreferences prefs;    private String pass;    private int increment=10;    private Thread background;    private Boolean commCalled=false;    public void callCommunications(){        progbar.setVisibility(0);        progbar.setProgress(0);        background.stop();        Toast.makeText(getApplicationContext(), ""Call communication should happen once."", Toast.LENGTH_LONG).show();//      Intent i = new Intent();//      i.setClass(RMO_Dialog.this, RMO_Comm.class);//      i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//      startActivity(i);//          finish();    }    public void buzzUser(){        Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);        int dot = 200;        int dash = 500;        int short_gap = 200;        int medium_gap = 500;        int long_gap = 1000;        long[] pattern = {0,dot, short_gap, dot, short_gap, dot, medium_gap, dash, short_gap, dash, short_gap, dash, medium_gap, dot, short_gap,                 dot, short_gap, dot, long_gap};        v.vibrate(pattern, -1);    }    public void killCountdown(){        progbar.setVisibility(0);        progbar.setProgress(0);        background.stop();    }    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.dialogpassword);        buzzUser();        prefs = this.getSharedPreferences(""RMO"", MODE_WORLD_READABLE);        pass = prefs.getString(""password"", """");        dialogOK = (Button) findViewById(R.id.dialogOK);        dialogPass = (EditText) findViewById(R.id.dialogPass);        progbar = (ProgressBar) findViewById(R.id.progress);        progbar.setProgress(0);        background = new Thread(new Runnable(){            @Override            public void run() {                try{                    while(progbar.getProgress()&lt;=progbar.getMax()){                        Thread.sleep(300);                        progressHandler.sendMessage(progressHandler.obtainMessage());                    }                }catch(java.lang.InterruptedException e){                    Toast.makeText(getApplicationContext(), ""Error thrown."", Toast.LENGTH_LONG).show();                }            }        });        background.start();        dialogOK.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                if(dialogPass.getText().toString().equals(pass.toString())){                    killCountdown();                    Toast.makeText(getApplicationContext(), ""Guardian Angel next alert has been disengaged."", Toast.LENGTH_LONG).show();                    Intent intent = new Intent();                    intent.setClass(RMO_Dialog.this, RMO.class);                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                    startActivity(intent);                    finish();                }else{                    callCommunications();                }            }        });    }    Handler progressHandler = new Handler(){        public void handleMessage(Message msg){            progbar.incrementProgressBy(increment);            if(progbar.getProgress()==progbar.getMax()){                Toast.makeText(getApplicationContext(), ""commcalled: ""+ commCalled, Toast.LENGTH_LONG).show();                if(commCalled==false){                    commCalled=true;                    callCommunications();                }            }        }    };}</code></pre>","445394","","28760","","2010-09-12 20:44:01","2012-07-22 15:46:26","How to kill a thread and handler before going to new activity","<android><multithreading><handler>","2","1","","",""
"3696587","1","","","2010-09-12 20:56:21","1","933","<p>I have hosted some videos for Mobile-Learning on Internet (for direct or progressive download, not video streaming service) and I want them to be playable in most of the mobile devices, especially the ones with Android 1.6 and higher.</p><p>The video container is MP4 with H264/AVC and AAC LC which is compatible with Symbian, Android, Windows Mobile and iPhone/IPad.</p><p>I have checked the videos with SonyEricsson X10 and Samsung (both of them, Android 1.6 based) and you get an error when the videos have a size higher than 1,7 MB. You can't either download or play them.</p><p>However, if I save the videos on the SD cards using the USB connection, they work regardless of the file size.</p><p>The same videos in the same server work perfectly using SonyEricsson Symbian based, HTC Windows Mobile based and iPhone and iPad.</p><p>I saw some posts for this situation but not solved. Has anyone found out the reason of this and the solution? For me it is vital that the videos mp4 and located on the Internet and played automatically, progressive streamed or when downloaded.</p><p>Thank you for your help!!</p>","445752","","","","","2010-12-13 15:14:20","MP4 videos hosted on Internet cannot be dowloaded and played on Android OS When size bigger than 1,7MB","<android><video-streaming><mp4>","1","0","3","",""
"3696664","1","3696729","","2010-09-12 21:21:34","0","1745","<p>Iam connecting my Android app to a wcf service, and in my Log.i I can see that it return data correct, The only thing I want to handle it as JSON but my service sends as XML-(I think): this is how the code in the app looks like:</p><pre><code>if (entity != null) {    InputStream instream = entity.getContent();      BufferedReader reader = new BufferedReader(new InputStreamReader(instream));      StringBuilder sb = new StringBuilder();    String line = null;    while ((line = reader.readLine()) != null){        sb.append(line + ""n"");      }          String result = sb.toString();      Log.i(TAG,result);      instream.close();      JSONObject json=new JSONObject(result);      JSONArray nameArray=json.names();      JSONArray valArray=json.toJSONArray(nameArray);  </code></pre><p>and my example method looks like this, I don't know how to return correct JSON data from the WCF webserivce:</p><pre><code>/// &lt;returns&gt;An enumeration of the (id, item) pairs. Returns null if no items are present&lt;/returns&gt;protected override IEnumerable&lt;KeyValuePair&lt;string, SampleItem&gt;&gt; OnGetItems(){    // TODO: Change the sample implementation here    if (items.Count == 0)    {        items.Add(""A"", new SampleItem() { Value = ""A"" });        items.Add(""B"", new SampleItem() { Value = ""B"" });        items.Add(""C"", new SampleItem() { Value = ""C"" });    }    return this.items;}</code></pre><p>This is the error I get:09-12 17:11:04.924: WARN/System.err(437): org.json.JSONException: Value &lt;ItemInfoList of type java.lang.String cannot be converted to JSONObject</p>","371301","","12502","","2010-09-12 21:30:33","2010-10-17 19:15:01","Android connecting - WCF Service should return JSON","<c#><android><json><wcf>","3","0","","",""
"3696687","1","","","2010-09-12 21:26:30","2","447","<p>If you compare how the map looks in MapView and how it looks in Google Maps, you'll notice that in Google Maps the map is ""bigger"". The texts are bigger, roads wider etc. Can I achieve this in my MapView?</p>","243225","","243225","","2010-09-12 21:36:47","2010-09-15 08:04:18","MapView with maps that have the same resolution as Google Maps","<android><google-maps><android-mapview>","1","2","","",""
"3696843","1","3697798","","2010-09-12 22:01:52","2","9440","<p>I am desperately trying to set TextView attributes of cells within a table programmatically but can't get this to work! Whenever I set layout properties, the field will simply not appear (but not give any error or exception). I boilded this down to this simple example:</p><pre><code>package mmo.application.listpro;import android.app.Activity;import android.os.Bundle;import android.widget.LinearLayout;import android.widget.TableLayout;import android.widget.TableRow;import android.widget.TextView;public class Test extends Activity{    @Override    public void onCreate(final Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TableLayout table = new TableLayout(this);        TableRow row = new TableRow(this);        for (String label: new String[] {""field1"", ""field2"", ""field3""}) {            TextView tv = new TextView(this);            tv.setText(label);//          LinearLayout.LayoutParams lp = //              new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, //                                            LinearLayout.LayoutParams.WRAP_CONTENT);//          lp.setMargins(2, 2, 2, 2);  // left/top/right/bottom//          tv.setLayoutParams(lp);            row.addView(tv);        }        table.addView(row);        setContentView(table);    }}</code></pre><p>This will show three fields, but when you uncomment the five commented line, then NOTHING will appear. Why is that so? Why does setting layout parameters cause my TextView's to not appear? I'm stuck! What am I missing?</p><p>Michael</p><p>PS.: here's the manifest, if some kind soul quickly wants to try this out:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""mmo.application.listpro"" android:versionCode=""1"" android:versionName=""Development""&gt;    &lt;application         android:icon=""@drawable/icon""         android:label=""@string/app_name""        android:debuggable=""true""&gt;        &lt;activity            android:label=""test""             android:name="".Test""            android:screenOrientation=""portrait""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:targetSdkVersion=""8"" android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre>","423411","","126562","","2010-09-13 04:19:52","2010-09-13 04:19:52","How to set (Text)View attributes programmatically?","<android>","2","2","","",""
"3696922","1","","","2010-09-12 22:26:57","3","1757","<p>For something like a 'help I can't get up' app -- is there a way for a user to set a contact number, and then for the app to call that number in the future WITHOUT the user initiating the dialout?  I've tried the below but there seems to be a problem:</p><pre><code> private void callPhone(){            if(phoneNumber.length()&gt;0){                try {                       Intent intent = new Intent(Intent.ACTION_CALL);                       intent.setData(Uri.parse(""tel:""+phoneNumber));                       startActivity(intent);                    } catch (Exception e) {                        Toast.makeText(getApplicationContext(), ""Problem calling number."", Toast.LENGTH_LONG).show();                    }                //startActivityForResult(new Intent(Intent.ACTION_CALL, Uri.parse(""tel:+""+phoneNumber)), 1);            }        }</code></pre>","445394","","234039","","2010-09-12 23:04:49","2010-09-12 23:04:49","Android: calling number without user init?","<android><call><phone>","1","0","3","",""
"3696978","1","3715976","","2010-09-12 22:50:25","4","2829","<p>I am writing an android game that involves some c++.<br>I have a fairly repeatable crash that seems to be due to my c++ code</p><p>Looking at the page:<a href=""http://source.android.com/porting/debugging_native.html#Debug_Scenarios"" rel=""nofollow"">http://source.android.com/porting/debugging_native.html#Debug_Scenarios</a>(right at the end)</p><p>it says to run the output through the ""stack tool"" - which I can find no trace of.. nor aproto - any help would be fantastic!<br>Thanks<br>-Alex</p>","445831","","","","","2010-10-09 17:33:53","Where is the ""stack tool"" for android dev? (to help debug native c++ code)","<android><stack><android-ndk>","3","1","5","",""
"3697011","1","","","2010-09-12 23:05:00","3","677","<p>This is very naive... but how do you stream certain bits of information from a website. From what I understand webview launches a web page, but what if I want to only stream a paragraph that was published on a site. </p><p>Example: Yahoo! Fantasy Football... Updates on players and the news feed about them.</p><p>This is obviously a lot more complicated than my question.  I would be interested in a tutorial that could walk me through this. Does this also take programming on the server side to send this out? Thank you in advance. </p>","413926","","","","","2010-09-13 01:52:38","How to stream data and resources from a website","<android><website>","2","1","1","",""
"3697063","1","3697161","","2010-09-12 23:19:21","11","10376","<p>I defined an EditText-field and I want to be informed when the user edits that fields.So I thought: simple - I add an OnKeyListener and so I did. But even though the text field gets edited (and even displays the entered/modified text) I don't get any callback, i.e. the LOG-output doesn't show up. </p><pre><code>    TextView text = new TextView(this);    text.setText(...);    ...    text.setOnKeyListener(new OnKeyListener()    {                                   public boolean onKey(View v, int keyCode, KeyEvent event) {            TextView tv = (TextView)v;            CharSequence val = tv.getText();            Log.v(TAG, ""value: "" + val);            // ... rest omitted for brevity        }    });</code></pre><p>Any idea, why that callback is never called?</p><p>Michael</p><p>PS.: Sigh! Android is really full of oddities! It seems that almost nothing I touched so far worked immediatly as one would expect. And - believe it or not - I have LOTS of experience with GUIs, esp. in Java (AWT, Swing, SWT, you name it...) But Android is a really tough beast!</p>","423411","","","","","2012-07-14 18:45:07","Android: why is my OnKeyListener() not called?","<android>","3","2","2","",""
"3697069","1","","","2010-09-12 23:20:54","7","234","<p>I am finishing development of an application for Android to stream music from your personal music collection using DAAP and UPnP as well as other protocols at time permits.</p><p>My question is:     How do I enable my app to respond to the new ""Listen To"" voice command in Android?</p><p>I have searched all over the place and can't figure it out.</p><p>I assume it's a broadcast receiver, but for the life of me, I can't find which one.</p><p>Any help is much appreciated.</p>","445846","","574131","","2011-09-02 11:52:40","2011-09-08 20:24:53","Developing for the new ""Listen To"" action in Android","<android><voice-recognition>","1","2","","",""
"3697129","1","3718891","","2010-09-12 23:38:59","1","555","<p>My MySQL DB table holds a BLOB image with image_id as key. I am trying to do the following.</p><p>1.HttpPost(""http://example.com/RetrieveImage.php"") from Android App with the image_id in name value pairs.</p><p>The PHP Script is as follows:</p><pre><code>&lt;?phpmysql_connect(""host"",""userid"",""password"");mysql_select_db(""database"");$q=mysql_query(""SELECT image FROM testblob WHERE image_id ="".$_REQUEST['image_id']."""");$e=mysql_fetch_assoc($q);print($e);mysql_close();?></code></pre><ol><li><pre><code>httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));InputStream is = entity.getContent(); response = httpclient.execute(httppost);HttpEntity entity = response.getEntity();is = entity.getContent();</code></pre></li><li><p>Store the BLOB data in Inputstream object is to byte array</p></li></ol>   <pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream();            byte[] buf = new byte[10240];            int n = 0;            try {                while ((n=is.read(buf))>=0)                {                baos.write(buf, 0, n);                }  is.close();  byte[] bytes = baos.toByteArray();</code></pre><ol><li>Convert the byte array to bitmap and set ImageView of the Android widget to the Image</li></ol>   <pre><code>Bitmap bitmap;   RemoteViews updateViews = null;   bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);   updateViews = new RemoteViews(context.getPackageName(), R.layout.tuwidget);   updateViews.setImageViewBitmap(R.id.tuwidget_img_btn, bitmap);   return updateViews;</code></pre><p>Once this is run, I dont know why the widget does not even show up on the emulator and cannot even add the widget anymore to the screen. What am I doing wrong? Any help is much appreciated.</p><p>Oh and here is my widget layout.<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?>&lt;AbsoluteLayoutxmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/tuwidget""android:layout_width=""fill_parent""android:layout_height=""wrap_content"">&lt;ImageViewandroid:id=""@+id/tuwidget_img_btn""android:layout_width=""wrap_content""android:layout_height=""wrap_content"">&lt;/ImageView>&lt;/AbsoluteLayout></code></pre></p>","447886","","195802","","2010-09-13 03:47:35","2011-01-27 20:42:13","Android widget vanishes from emulator on remoteviews update","<php><mysql><android><widget><blob>","3","3","1","",""
"3697367","1","3697411","","2010-09-13 01:05:37","2","69","<p>What class/web service will give me business information for a latitude/longitude combination in Android?</p>","445884","","","","","2010-09-13 01:24:29","What class/service will give me business information for a latitude/longitude combination on Android?","<android>","1","0","0","",""
"3697404","1","3700310","","2010-09-13 01:22:58","4","1407","<p>I got a strange problem, that my app's SharedPreference seems lost some specific keys (not all) when the phone reboot.</p><p>Have you ever meet this problem? I used that key to store a serialized object and I did that in my own Application class.</p><pre><code>public class Application extends android.app.Application {static String key = ""favs"";SharedPreferences settings;public Favs favs;@Overridepublic void onCreate() {    super.onCreate();    settings = PreferenceManager.getDefaultSharedPreferences(this);    String value = settings.getString(key, """");    if (value != null &amp;&amp; value.length() &gt; 0) {        try {            Favs = (Favs ) deSerialize(value.getBytes());        } catch (Exception ex) {        }    }    if(favs == null)        favs = new Favs ();}public void storeFavss() {    if (favs == null)        return;    try {        byte[] bytes = serialize(favs );        if(bytes != null)        {            String s = new String(bytes);            settings.edit().putString(key, s);            settings.edit().commit();        }    } catch (Exception ex) {    }}</code></pre>","238061","","","","","2012-08-18 08:38:08","Android, SharedPreference lost when phone reboot","<android>","2","1","1","",""
"3697539","1","","","2010-09-13 02:18:37","0","543","<p>I want to create a browser to view as an administration. </p><p>My project is about ferry booking using an android phone. The application is connected to the server. The ferry timing and other info are retrieved via server connection. The database is currently in Microsoft Access. </p><p><strong>My question</strong> is how do I create a browser to view data (e.g view users, delete users, create notification etc etc)? I want to create so called a 'website' that have access to the same database as the android application. Do I use Microsoft Visual Studio? How am I suppose to create a connection to Microsoft Access so that I can edit the database appropriately?</p><p>Thank you. I hope to have replies soon.</p><p>-Dayne</p>","380770","","","","","2010-09-13 13:36:18","Android app and website(server) connection","<android><visual-studio><ms-access><jsp>","1","4","","",""
"3697576","1","3697714","","2010-09-13 02:34:08","3","2541","<p>I found this code:</p><pre><code>Uri u =             Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI,             ""1"");             i.setData(url);             startActivity(i); </code></pre><p>That plays a sound with the default media player. I want to call the same media playerwith a URI that contains a URL.</p><p>How can I target the default player?</p>","348058","","23897","","2010-09-13 02:37:41","2010-09-13 03:34:37","Calling the default media player with an URI on Android","<android><media-player>","1","0","2","",""
"3697653","1","","","2010-09-13 03:06:43","2","20131","<p>Gotta problem.  My employer won't allow anybody access to run / line command tools on our computers.  No way to run ADB (Android Debug Bridge) without that control.  I'm using windows, no way to access the registry, no way to manually add cmd.exe, i've tried..)  Screwing the staff is a sure way to reduce IT costs though, sigh.</p><p>I notice that sometimes when testing thru Eclipse with a real device plugged in via USB, that the application shows up on my android device..   and other times not.</p><p>Is there any way to use the Eclipse tools with Android plug in to 'install' the applications that I'm writing onto my real, physical device?  They test fine as long as I'm USB plugged in. but don't remain after I disconnect.</p><p>I know, getting a new employer is probably the best answer here, but that's not in the cards right now.  Good suggestion though  : )</p><p>Anyone know of a work around for program installation to hardware?</p><p>Many thanks in advance,zip</p>","445925","","","","","2013-04-30 20:01:44","How do I transfer .apk files to device using Eclipse","<android><eclipse><install><apk>","6","2","","",""
"3697866","1","","","2010-09-13 04:43:46","3","1998","<p>How to get all filenames inside a folder in my assets folder in android?Please help.Thanks in advance.</p>","655814","","","","","2010-12-13 03:59:24","How to get all filenames inside a folder in assets folder in android?","<android>","1","0","1","",""
"3697879","1","","","2010-09-13 04:47:05","4","721","<p>I want to make an android application which has two tap in one view ,i.e, has upper tab and lower tab.</p><p>According to selection of lower tab, I add the new tab host(for upper tab) in the tapcontent part of lower tab. But, upper tap doesn't go up, it stick to the lower tab.</p><p>The implementation of upper tab is,</p><pre><code>import android.app.TabActivity;import android.content.Intent;import android.os.Bundle;import android.widget.TabHost; public class uppertab extends TabActivity { @Override protected void onCreate(Bundle savedInstanceState) {  // TODO Auto-generated method stub  super.onCreate(savedInstanceState);  setContentView(R.layout.upperlayout);  TabHost tabHost = getTabHost();  TabHost.TabSpec spec;  Intent intent;  intent = new Intent().setClass(this, recommend_friend_simillar.class);    spec = tabHost.newTabSpec(""upper1"").setIndicator(""Upper1"").setContent(intent);  tabHost.addTab(spec);  intent = new Intent().setClass(this, recommend_friend_new.class);    spec = tabHost.newTabSpec(""upper2"").setIndicator(""Upper2"").setContent(intent);  tabHost.addTab(spec);  intent = new Intent().setClass(this, recommend_friend_favorite.class);    spec = tabHost.newTabSpec(""upper3"").setIndicator(""Upper3"").setContent(intent);  tabHost.addTab(spec); }}</code></pre><p>xml for upper tap is,</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/uppertabhost""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;TabWidget        android:id=""@+id/uppertabs""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;    &lt;FrameLayout        android:id=""@+id/uppertabcontent""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        /&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>xml for lower tab is,</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutxmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  &gt;  &lt;TabHost android:id=""@android:id/tabhost""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""&gt;  &lt;RelativeLayout     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;   &lt;TabWidget android:id=""@android:id/tabs""       android:layout_alignParentBottom=""true""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""       /&gt;      &lt;FrameLayout android:id=""@android:id/tabcontent""           android:layout_above=""@android:id/tabs""            android:layout_width=""fill_parent""              android:layout_height=""fill_parent""&gt;     &lt;/FrameLayout&gt;  &lt;/RelativeLayout&gt;  &lt;/TabHost&gt;&lt;/LinearLayout&gt;</code></pre><p>The result is shown below.</p><pre><code>???????????????????????????                        ??                        ??                        ??                        ??                        ????????????????????????????       ?        ?       ??upper1 ? upper2 ? upper3???????????????????????????? lower1?lower2  ? lower3???????????????????????????</code></pre><p>Of course, upper 3 taps should be stick to ceilling, like,</p><pre><code>???????????????????????????       ?        ?       ??upper1 ? upper2 ? upper3????????????????????????????                        ??                        ??                        ??                        ??                        ???????????????????????????? lower1? lower2 ? lower3???????????????????????????</code></pre><p>(I got an advice that using activitygroup, but it doesn't work.)</p><pre><code>import android.app.ActivityGroup;import android.content.Intent;import android.os.Bundle;import android.widget.TabHost;public class uppertab extends ActivityGroup { private TabHost tabHost; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.upperlay); tabHost = (TabHost)findViewById(R.id.friendtabhost); tabHost.setup(getLocalActivityManager());tabHost.addTab(tabHost.newTabSpec(""tab1"").setIndicator(""tab1"").setContent(new Intent(this, tab1.class)));     tabHost.addTab(tabHost.newTabSpec(""tab2"").setIndicator(""tab2"").setContent(new Intent(this, tab2.class)));     tabHost.addTab(tabHost.newTabSpec(""tab3"").setIndicator(""tab3"").setContent(new Intent(this, tab3.class)));</code></pre><p>}</p><p>}</p><p>DDMS says that </p><p>tabHost.setup(getLocalActivityManager());</p><p>has a problem.</p><p>What can I do :(?</p>","445961","","614285","","2011-08-08 12:38:44","2011-08-17 08:27:53","How to implement double Tabbed Activity in android?","<android><android-tabhost>","1","1","1","",""
"3697887","1","","","2010-09-13 04:49:12","1","9899","<p>I'm attempting <a href=""http://sites.google.com/site/androidcoursearchive/labs/lab-1"" rel=""nofollow"">Google University Android lab1</a> you are asked to change a TextView's text content according to the value passed via the Intent from another activity.</p><p>I tried out the rest of my code but...why does my app force close when I add the ""tv.settext(...) line""?</p><pre><code>public class HelloWorld extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        /*         * Fetch and display passed string.         */        TextView tv = (TextView) findViewById(R.id.HelloTV);        Bundle extras = this.getIntent().getExtras();        if (extras != null) {            String nameStr = extras.get(""Username"").toString();            if (nameStr != null) {                tv.setText(""Hello ""+nameStr);                     }        }        setContentView(R.layout.main);    }}</code></pre>","445966","","","","","2014-04-16 00:28:57","Android TextView.setText force closes","<android><textview>","2","11","","",""
"3697899","1","3698165","","2010-09-13 04:54:04","95","71557","<p>I have an Android project created in eclipse.I want to modify the package name and application of the project.How to do that in eclipse?</p><p>Thanks,Dheepak</p>","434708","","","","","2014-02-19 10:25:11","Package renaming in eclipse android project","<android><eclipse><package><project-rename>","12","1","25","",""
"3697921","1","3706661","","2010-09-13 05:02:11","2","263","<p>I want to make application that gives me the list of audio files available in my SDCard and then i should be able to play that audio file from my application. And even pause resume audio playback etc. and  function..</p><p>Any help on that?</p>","1386533","","","","","2010-09-14 06:49:59","android : use of media","<android>","2","0","","",""
"3697946","1","","","2010-09-13 05:12:43","8","11790","<p>I used webview to visit https link. the page always show blank. i found the way to dill with it </p><pre><code>public class WebViewClient extends Object{public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {     handler.proceed();}}</code></pre><p>That's work fine.</p><p>But i used API Android 2.1, the above method is belongs to Android 2.2. Can anyone give me some suggestion?</p>","404112","","41956","","2010-09-28 18:20:39","2010-09-28 18:20:39","webView with https loadUrl shows blank page","<android><ssl><webview>","1","0","5","",""
"3698034","1","3698747","","2010-09-13 05:41:11","4","4843","<p>HI all,I am using simple socket communication between android(as client) and PC(as server). I am using EditText for Ip address. I want to Validate the IP address that is being entered in EditText field. Can please some one help me.. I am need of it. Thanks in advance.</p>","399046","","","","","2012-07-18 15:45:18","Validating IP in android","<android>","2","0","4","",""
"3698059","1","3698490","","2010-09-13 05:48:02","2","3788","<p>[edit]I've removed my convoluted and badly malformed question so that it doesn't detract from the very neat and correct answer beneath. Given the (surprising) difficulty of finding an on-line example for doing this incredibly common task, I hope Yoni gets a few more up-ticks for his response.</p><p>So... the question in a nutshell...</p><p>How do I use Apache.Commons to upload a file to some destination.  I'm using it in Android and uploading to a PHP script, but obviously it can work from any Java program and to any HTTP based listener. </p>","59947","","59947","","2010-09-13 08:22:31","2010-09-13 08:22:31","Concise example of file upload via Java lib Apache Commons","<java><android><file-upload><apache-commons>","1","0","3","",""
"3698082","1","","","2010-09-13 05:56:01","1","2750","<p>I am new to android.I am trying to play a video from sdcard.</p><p>this is the sample code I have used..</p><pre><code>  public class videoa extends Activity { /** Called when the activity is first created. */@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    this.setContentView(R.layout.main);    VideoView videoView = (VideoView)this.findViewById(R.id.videoView);    MediaController mc = new MediaController(this);    videoView.setMediaController(mc);    // (1) Web    //videoView.setVideoURI(Uri.parse(    //""http://www.bogotobogo.com/Video/sample.3gp""));    //""http://www.bogotobogo.com/Video/sample.mp4""));    //""http://www.bogotobogo.com/Video/sample.mov""));    /* (2) SD card */    //videoView.setVideoPath(""/sdcard/sample.3gp"");    videoView.setVideoPath(""/sdcard/robot.avi"");    //videoView.setVideoPath(""/sdcard/sample.mov"");   // videoView.setVideoURI(Uri.parse(        //""file:///sdcard/sample.mov""));    videoView.requestFocus();    videoView.start();}</code></pre><p>}</p><p>I have launched manually And set the target as -sdcard C:/android-sdk-windows/tools/sdcard.img.</p><p>When i have launched the emulator it shows Video Cannot be Displayed.</p><p>Please help me out.</p>","366916","","","","","2010-09-14 07:01:06","Android-Media Player","<android>","1","0","0","",""
"3698166","1","4181114","","2010-09-13 06:15:12","1","989","<p>I want to do SAS Parsing of the Humidity and the Temperature by Lat - Long using a Web Service in my Application. I don't have a clear idea regarding how to do that actually.So, can anybody please help me with an example if possible.</p><p>Thanks,david</p>","422859","","","","","2010-11-15 03:08:07","SAX Parsing in Android Programming","<android><xml>","2","0","","",""
"3698207","1","","","2010-09-13 06:26:02","0","536","<p>How can i do On-Device(Sony Ericcson XPERIA) debudding by using Net Beans ?</p><p>Thanks and Regards...</p>","406631","","","","","2011-07-20 16:07:13","On-Device debugging + Net Beans + Android","<android>","1","0","","",""
"3698288","1","5099563","","2010-09-13 06:43:20","0","275","<p>What is the limitation of developing Android application with Adobe Flash CS5?</p>","188331","","","","","2011-02-24 01:58:00","Limitation of developing Android application with Adobe Flash CS5","<android><flash-cs5>","1","0","","",""
"3698365","1","","","2010-09-13 07:02:32","1","2007","<p>I really dont know why is this android code not working.. It shows unknown host exception:</p><pre><code>String requestTpServer = ""www.google.com"";HttpClient client = new DefaultHttpClient();HttpResponse response = null ;try {   HttpGet get = new HttpGet(requestToServer);  get.setHeader(""Accept"", ""application/json"");  get.setHeader(""content-type"", ""application/json"");  response = client.execute(getm);  Log.i(""Hit Success... in get deals response"", ""going to rendernow"");  if (response != null ) {    Log.i(""responsecode---"", """"+response.getStatusLine().getStatusCode());    String jsonResponseFromServer = response.toString();    Log.i(""json Response From Server"", jsonResponseFromServer);  }  else {   Log.i(""blank "", ""reply "");  }} catch (ClientProtocolException e) {  e.printStackTrace();} catch (IOException e) {  e.printStackTrace();}String res = response.toString();return res;</code></pre>","446031","","50846","","2010-09-13 07:19:54","2010-09-13 10:02:10","Unknown host exception in HTTP request json-android","<android><json>","2","0","","",""
"3698457","1","4859970","","2010-09-13 07:18:06","9","3189","<p>I have a webview in my activity. Now when I use <code>WebView.findAll()</code> method to search text in webview it is not highlighting the matching words.</p><p>It works fine in Android 1.6 but is not working in 2.2.</p>","356158","","50846","","2010-09-13 07:21:03","2012-09-21 13:51:50","Android 2.2 webview search problem","<android><android-webview>","2","4","2","",""
"3698488","1","3699723","","2010-09-13 07:24:09","1","855","<p>Hi (this is my first post on StackOverflow :), </p><p>every time i increase my database version and push the upgraded app to the users, something weird happens.. For some it works perfectly fine, and some report crashes (including through the Market's reporting system) caused by the lack of table columns i just added in onUpgrade. </p><p>If you want to see the method: <a href=""http://code.google.com/p/tag-todo-list/source/browse/trunk/Donut/src/com/android/todo/data/ToDoDB.java#136"" rel=""nofollow"">http://code.google.com/p/tag-todo-list/source/browse/trunk/Donut/src/com/android/todo/data/ToDoDB.java#136</a></p><p>I can't spot any exceptions that appear in onUpgrade. What i'm currently doing to bypass these problems is intercepting the exceptions where the new fields are invoked for the first time and then calling onUpgrade 'manually', which is kind of dirty.</p><p>Also, the app sometimes generates a 'no such table' SQLiteException when accessing the main table (again, only for some users) which is incredibly strange... Does someone know why these things happen? Or can you spot something wrong in my code?</p><p>Thanks, Teo</p>","439719","","","","","2010-09-13 10:52:26","Why would SQLiteOpenHelper.onUpgrade fail?","<android><exception><sqlite>","1","0","1","",""
"3698523","1","","","2010-09-13 07:31:45","2","1142","<p>i'am trying to load an url in background using the default browser. So the user can switch to the browser whenever he finished reading the current activity and the page is already loaded.</p><p>Is there a way to fire an Intent (Browser) but stay in the original Activity?</p><p>I'am aware of the FrameLayout approach with setting the visibilty but this is not possible with the default browser.</p><p>Thx in advance.</p>","288324","","","","","2014-02-12 12:05:21","Open Browser in Background - loading web page in background","<android><url><browser><background><loading>","2","0","1","",""
"3698528","1","3699259","","2010-09-13 07:32:33","4","2232","<p>I'm using Eclipse 3.5.2 and when I followed the steps on this tutorial(<a href=""http://developer.android.com/guide/developing/tools/adt.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/adt.html</a>). I got an error message during the last steps.</p><blockquote>  <p>An error occurred while installing the  items   session context  was:(profile=PlatformProfile,  phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Install,  operand=null --> [R]org.eclipse.cvs  1.0.400.v201002111343, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).  The artifact file for  osgi.bundle,org.eclipse.cvs,1.0.400.v201002111343  was not found.was not found.</p></blockquote><p>would be grateful if anyone can help me out :)</p><p>Thanks.</p><p>P.S. I'm running Ubuntu Lucid Lynx with kernel 2.6.32-24-generic on x86_64. I have the ia32libs installed as well.</p>","446051","","446051","","2010-09-13 07:51:46","2012-04-02 02:41:36","Error when installing the ADT plugins in Eclipse","<android><eclipse><adt>","1","0","","",""
"3698732","1","16125109","","2010-09-13 08:10:59","1","704","<p>I am using Eclipse and running the App in debug mode.I have a class - AAStartsHere, derived from TabActivity. This derived class launches a service (AAservice). AAService setups a Timer/TimerTask AACallback. From inside this callback I setup a Toast using Notification. When AAcallback calls the Toast, the parameters passed to Toast seem OK but nothing appears or shows up on the screen, instead a new tab (titled Timer.class) shows up...</p><p>Here is the code fragment<br><pre> <code>AAStartsHere extends TabActivity {  :<br>  Intent serviceIntent = new Intent (this, AAservice,...);  :  startservice(serviceIntent);  :}TimerTask execAACallback = newTimerTask { run() {AAcallback(); } };AAService extends Service{    onCreate() {      :      AANotifcation = new Notification(....);      :      AATimer.scheduleAtFixedRate(execAACallback, ...)   }   AACallback() {    :     String svcName = Context.NOTIFICATION_SERVICE;    NotificationManager notiMgr = (NotificationManager) getSystemService(svcName);     Context context = getApplicationContext();     String text = ""text goes here"";     String title  = ""Title goes here"";     Intent AAIntent = new Intent(AAService.this,  AAStartsHere.class);     PendingIntent AAPendingIntent =  PendingIntent.getActivity(context, 0, AAIntent, 0);     AANotification.setLatestEventInfo(context, title, text, AAPendingIntent);     AANotification.when = java.lang.System.currentTimeMillis();     notiMgr.notify(AA_NOTIFICATION_ID, AANotification);     Toast.makeText(context, title, Toast.LENGTH_LONG).show();     :  }}</pre> </code></p><p>The new tab that shows up (in Eclipse/debug Mode) has the following textClass File Editorsource not foundThe JAR of this class file belongs to container 'Android 2.1"" which does not allow modifications to source attachments //Compiled from timer.java (version 1.5:49.0, super bit):</p><p>Please let me know your thoughts - what am I missing? Thank you for the help and effort.Abhi</p>","446006","","446006","","2010-09-13 15:48:51","2013-04-20 20:57:00","When I call Toast from inside a service -a new tab with the message ""Source not found"" and ""Timer.class"" in tab title shows up","<android><service><notifications><toast>","2","0","","",""
"3698811","1","3699060","","2010-09-13 08:27:28","2","571","<p><strong>The specifics of the Nexus One Dev Phone compared to a regular N1 Phone</strong></p><p>I'd like to buy a N1 Dev Phone for dev purposes but also for ordinary everyday usage. So are there any specifics in the Dev Version of N1 I should care about? Is there anything that would inhibit a regular day to day usage and what are the differences to the regular retail version of the Phone?</p><p>Apart from:  </p><ul><li>SIM unlocked - Put any SIM in the device </li><li>Test out your apps on real hardware before publishing them to the world </li><li>Ability to see copy protected Android Market apps </li></ul>","159679","","","","","2010-10-09 09:49:08","Nexus One Dev Phone vs. a regular Nexus One Phone (retail version)","<android><phone><dev-phone>","2","0","1","",""
"3698838","1","3702607","","2010-09-13 08:33:29","0","1255","<p>I have a songs list-view and I want to show pop-up media player when item in list-view clicked. A pop-up is a activity. But I don't know how to show pop-up activity on list-activity.Please can anybody help me ?</p>","446094","","446094","","2010-09-13 09:16:35","2010-09-13 16:53:42","How to create popup media player on listview in android?","<android><listview><popup>","1","0","","",""
"3698856","1","","","2010-09-13 08:36:16","4","972","<p>I have an application that plays back AMR audio files that it has downloaded and cached locally.<br>This works fine &mdash; the basic <a href=""http://developer.android.com/reference/android/media/MediaPlayer.html"" rel=""nofollow""><code>MediaPlayer</code></a> does its job.</p><p>However, the audio volume is generally very low, and manually increasing the volume with the hardware keys still doesn't make the playback quite loud enough.</p><p>The behaviour seems to vary across devices &mdash; Sony Ericssons are particularly low, HTC devices are reasonable, and the Samsung Galaxy S is actually very loud when the volume is turned up to the maximum.</p><p>Are there any relatively simple approaches, using the Android SDK, that could, say, double the volume while playing back from the AMR file?</p><p>I note that <a href=""http://developer.android.com/reference/android/media/AudioTrack.html"" rel=""nofollow""><code>AudioTrack</code></a> allows you to manipulate audio, but this seems to be for raw PCM streams.</p>","234938","","","","","2013-01-11 16:01:10","Amplifying playback volume from a local AMR file","<android><audio><volume><amr>","0","3","","",""
"3698893","1","3699483","","2010-09-13 08:44:01","2","4046","<p>I, i have a service and i want that once it started, it performs is work every 30 seconds. How can i do that?</p><p>TnkValerio</p>","314554","","","","","2010-09-13 15:46:21","How to wait periods of 30 second to run a service","<android><service><timer><sleep>","2","1","","",""
"3699013","1","3767840","","2010-09-13 09:03:51","1","4329","<p>I am using below code from one of my activity to start another</p><pre><code>Intent viewIntent = new Intent(getApplicationContext (), landingPage.class);Bundle b = new Bundle();b.putString(""ApplicationName"", a_Bean.getApplicationName());if (landingPage.getInstanceCount() &lt; 1)    bp.landingPage_ProgressDialog = ProgressDialog.show(ViewAllApp.this, ""Please wait..."", ""Retrieving data..."", true, false);viewIntent.putExtras(b);viewIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);startActivityForResult(viewIntent,10);Thread background = new Thread(new Runnable() {    public void run() {        Progresshandler.sendMessage(handler.obtainMessage());//finishes progressDialog}});background.start();</code></pre><p>but after startactivity it shows a black screen &amp; then displays new activity.Can I make progressdialog to be shown while the black screen is displayed??</p>","437703","","436938","","2012-05-12 11:47:56","2012-05-12 11:47:56","black screen switching between activity","<android><progressdialog>","2","5","0","",""
"3699172","1","","","2010-09-13 09:30:07","1","1342","<p>What is the difference between these two ways of interaction between applications on Android:</p><ol><li>Implementing service in app #1 and using it in app #2</li><li>Handling intents and posting answers to the intents.</li></ol><p>Interactions are supposed to be asynchronous.</p><p>What are pros and contras for each?</p>","446142","","858626","","2014-03-28 14:20:56","2014-03-28 14:20:56","What is the preferred way to communicate between applications on Android (service vs. intents)","<android><service><ipc><aidl>","1","0","2","",""
"3699260","1","","","2010-09-13 09:40:11","0","1040","<p>friend's    I wanna need to know the difference between tabhost setOnTabChangedListener and OnTabClickListenerin what cases,these both are fired,is't both are same or different.</p><p>Thanks in advance.</p>","446136","","","","","2010-11-18 17:09:39","difference between tabHost setOnTabChangedListener and setOnTabClickListener","<android>","1","0","","",""
"3699418","1","","","2010-09-13 10:07:52","2","820","<p>i have class used with android frameworks, it calls icu4j's Arabicshaping. now i'v merged this class with another android branch that uses icu4c ( c implementation). but build process gives me error saying cannot find Arabicshaping...</p><p>searching in icu4c files shows me that it has both ArabicShaping.c and ushape.c</p><p>but i don't know how to call them from framewoks java code .</p><p>any idea?  thanks</p>","86169","","","","","2010-09-23 23:20:10","android, moving from icu4j to icu4c","<android><icu>","0","0","1","",""
"3699453","1","","","2010-09-13 10:13:50","1","328","<p>Hi      I am displaying superscript text view in android    private TextView triangle;</p><p>triangle=((TextView)findViewById(R.id.triangle));</p><pre><code>  triangle.setText(Html.fromHtml(""triAngle&lt;sup&gt;TM&lt;/sup&gt;Quarterly Backtest""));     triangle.setTextColor(getResources().getColor(R.color.red)); triangle.setTypeface(myTypeface);</code></pre><p>T is not displaying properly if i increase the font size </p>","426344","","","","","2010-09-13 10:13:50","sup textview not displaying properly if i increase font size","<android>","0","0","","",""
"3699455","1","3699761","","2010-09-13 10:13:54","2","1426","<p>I am porting a c++ library code into android(which was initially written for linux).</p><p>The library is built and is used by a java application. </p><p>In the previous linux code, library used to create and update a log file in /tmp folder of the system...  But unfortunately, there is no such temp dir in android. </p><p>Seems I cannot use use applications cache to save the file due to a few reasons. </p><pre><code>1. User need to view the file after exiting the app2. The library need to be reused by different applications in future. 3. The log file is created by the native library(and not the java app)</code></pre><p>(pls correct me if some/all of my understanding is wrong)</p><p>Also I found most of the directories are write protected in the default setting..    </p><p>How can i tackle the issue, without 'rooting' the os?Pls help..  </p>","180908","","180908","","2010-09-13 10:35:42","2010-09-13 10:57:28","Temp folder in android","<android>","1","0","","",""
"3699583","1","","","2010-09-13 10:34:49","0","1557","<p>I want to display image in textview,is it possible?anybody knows,please give sample code for me..Thanks All</p>","410757","","410757","","2010-09-13 11:23:52","2011-02-03 14:52:07","How to load image in textview?","<android>","2","0","0","",""
"3699710","1","3700581","","2010-09-13 10:50:51","0","2610","<p>I have an animation specified in xml like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""&gt;·       &lt;translate android:fromXDelta=""0"" android:toXDelta=""100%p"" android:duration=""300"" android:interpolator=""@android:anim/anticipate_overshoot_interpolator"" /&gt;·       &lt;alpha android:fromAlpha=""1.0"" android:toAlpha=""0.0"" android:duration=""300"" /&gt;&lt;/set&gt;</code></pre><p>This file is res/anim/push_right_in.xml</p><p>Then in Java code I try to load it like this:</p><pre><code>mAnimationRightIn = AnimationUtils.loadAnimation(this, R.anim.push_right_in);</code></pre><p>It works perfectly fine on 1.6, 2.1, 2.2, but throws an exception on 1.5:</p><pre><code>clock.ClockSelectActivity}: java.lang.RuntimeException: Unknown interpolator name: setE/AndroidRuntime(  682):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)E/AndroidRuntime(  682):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)E/AndroidRuntime(  682):        at android.app.ActivityThread.access$1800(ActivityThread.java:112)E/AndroidRuntime(  682):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)E/AndroidRuntime(  682):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  682):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  682):        at android.app.ActivityThread.main(ActivityThread.java:3948)E/AndroidRuntime(  682):        at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  682):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  682):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)E/AndroidRuntime(  682):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)E/AndroidRuntime(  682):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  682): Caused by: java.lang.RuntimeException: Unknown interpolator name: setE/AndroidRuntime(  682):        at android.view.animation.AnimationUtils.createInterpolatorFromXml(AnimationUtils.java:321)E/AndroidRuntime(  682):        at android.view.animation.AnimationUtils.loadInterpolator(AnimationUtils.java:270)E/AndroidRuntime(  682):        at android.view.animation.Animation.setInterpolator(Animation.java:290)E/AndroidRuntime(  682):        at android.view.animation.Animation.&lt;init&gt;(Animation.java:213)E/AndroidRuntime(  682):        at android.view.animation.TranslateAnimation.&lt;init&gt;(TranslateAnimation.java:54)E/AndroidRuntime(  682):        at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:115)E/AndroidRuntime(  682):        at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:107)E/AndroidRuntime(  682):        at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:84)E/AndroidRuntime(  682):        at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:64)E/AndroidRuntime(  682):        at com.the7art.rockclock.ClockSelectActivity.onCreate(ClockSelectActivity.java:46)E/AndroidRuntime(  682):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)E/AndroidRuntime(  682):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)E/AndroidRuntime(  682):        ... 11 more</code></pre><p>Any idea on what causes this and how to fix?I checked some examples xml-defined animations in Android's API samples and they contain almost the same code, with different parameters, so I guess it really should work. </p><p>I see one way would be to stop defining them in xml and create animations in code, but I'd like to know if there is a way to still do it in xml :)</p>","258848","","258848","","2010-09-13 12:55:35","2011-09-10 04:56:20","Loading animation from xml fails on Android 1.5: ""Unknown interpolator name: set"". How to fix?","<android>","2","0","","",""
"3699840","1","3699990","","2010-09-13 11:09:09","1","128","<p>I've been messing with Android for a couple of weeks, i found many tutorials to follow, but i didnt find anywhere some ""Style rules"" to make the code looks better.</p><p>I would like to know if its possible (im sure that it is, but dont know how to make it xD) to use more .java files to organize the functions. I mean, right now, i have myApp.java where i coded all my application, but is starting to grow so much, so i would like to separate some functions into another .java file.</p><p>As i told before, im almost sure that this is possible, but i dont know how to link that second file so, can anybody help me?</p><p>Thank you in advance :)</p>","446234","","","","","2010-09-13 11:39:29","Encapsulating functions in a second .java file?","<java><android><coding-style>","2","0","0","",""
"3699875","1","3700235","","2010-09-13 11:15:03","4","3604","<p>Have someone got any tutorials for how to do testing on Android in Intellij? I am looking for  resources similar to what you find for Eclipse with the ability to create a test project for my android project.</p>","11672","","","","","2011-06-29 16:09:06","Set up Android testing in Intellij IDEA","<android><testing><intellij-idea>","2","0","3","",""
"3699883","1","3699907","","2010-09-13 11:17:01","0","746","<p>I have one application in android when i run that application it shows that exception</p><pre><code>09-13 16:38:25.049: WARN/dalvikvm(269): VFY: arbitrarily rejecting large method (regs=132 count=21332)09-13 16:38:25.049: WARN/dalvikvm(269): VFY:  rejected Lcom/ExtraCharge/Calc;.onClick (Landroid/view/View;)V09-13 16:38:25.059: WARN/dalvikvm(269): Verifier rejected class Lcom/ExtraCharge/Calc;09-13 16:38:25.059: WARN/dalvikvm(269): Class init failed in newInstance call (Lcom/ExtraCharge/Calc;)09-13 16:38:34.883: WARN/ActivityManager(64): Launch timeout has expired, giving up wake lock!09-13 16:38:34.999: WARN/ActivityManager(64): Activity idle timeout for HistoryRecord{43f8da58 com.ExtraCharge/.Calc}</code></pre><p>Do you have any solution for that problem?</p>","441224","","50846","","2010-09-13 11:21:20","2010-09-13 11:21:20","Android limitation","<android>","1","0","","",""
"3699965","1","3700068","","2010-09-13 11:30:48","1","570","<p>Would it be possible for me to build an application that enables people to encrypt call coming to me with my public key and then for me to decrypt the call data at my end using my own private key. This way I basically have a more secure communication channel which I am assuming because RSA is hard to crack would be difficult to monitor.</p><p>I am asking this question from a research point of view and have absolutely not considered the factor as to how computationally feasible would such an application be. I would just like to know if there is a way for me to intercept my outgoing data using any built functions.</p><p>Thanks</p>","441145","","441145","","2010-09-13 12:27:23","2010-09-13 12:27:23","Encrypt outgoing data? (any mobile platform)","<android><security><mobile-phones><bada>","2","0","1","",""
"3699969","1","","","2010-09-13 11:32:00","1","699","<p>I'm trying to develop on android's platform. I'm working with netbeans and using this tutorial: <strong><a href=""http://wiki.netbeans.org/IntroAndroidDevNetBeans"" rel=""nofollow"">Introducing Android Development with NetBeans</a></strong>. I seem to have everything installed properly, and have no trouble creating android projects, but when I try to debug I get several error messages like,</p><pre><code>W/ResourceType( 3449): Bad string block: string #0 extends to 1029, past end at 60</code></pre><p>followed by several which look like</p><pre><code>AndroidManifest.xml:5: error: No resource identifier found for attribute 'label' in package 'android'</code></pre><p>Does anyone know what might be causing this or how I could fix it?</p>","91748","","1288","","2010-10-22 14:39:07","2012-07-26 12:44:40","android development on netbeans","<android><netbeans>","1","2","","",""
"3700039","1","3735084","","2010-09-13 11:40:29","4","3796","<p>I have generated on my android application a pair of RSA Keys.</p><p>I receive from a web service- an AES Key, encrypted with my RSA public key - a String encoded with the AES key.</p><p>So I must do the following:- decrypt the AES Key- decrypt the string with the obtained AES Key.</p><p>To generate the RSA Keys I did:</p><pre><code> keyGen = KeyPairGenerator.getInstance(""RSA"");  keyGen.initialize(size);  keypair = keyGen.genKeyPair();  privateKey = keypair.getPrivate();  publicKey = keypair.getPublic();</code></pre><p>On RSA decrypt I use :</p><pre><code>public static byte[] decryptRSA( PrivateKey key, byte[] text) throws Exception      {           byte[] dectyptedText = null;          Cipher cipher = Cipher.getInstance(""RSA/ECB/PKCS1Padding"");          cipher.init(Cipher.DECRYPT_MODE, key);          dectyptedText = cipher.doFinal(text);          return dectyptedText;      }</code></pre><p>On AES decrypt I use:</p><pre><code>public static byte[] decryptAES(byte[] key, byte[] text) throws Exception {               SecretKeySpec skeySpec = new SecretKeySpec(key, ""AES"");               Cipher cipher = Cipher.getInstance(""AES/ECB/PKCS1Padding"");               cipher.init(Cipher.DECRYPT_MODE, skeySpec);               byte[] decrypted = cipher.doFinal(text);               return decrypted;           }</code></pre><p>So, in my code, to obtain the decrypted AES Key I do</p><pre><code>byte[] decryptedAESKey = sm.decryptRSA(key, Base64.decode(ReceivedBase64EncryptedAESKey));byte[] decryptedString = sm.decryptAES(decryptedAESKey, Base64.decode(ReceivedEncryptedAESString));</code></pre><p>On the end I get a null for decryptedString.What am I doing wrong ? </p>","379865","","238704","","2010-09-13 12:36:03","2010-09-17 11:56:35","RSA and AES Decrypt and Encrypt problem","<java><android><rsa><aes>","2","0","1","",""
"3700063","1","3701084","","2010-09-13 11:44:22","2","647","<p>They do not write anything about licenses at <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#menuapx"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#menuapx</a> (Menu Icons)</p><p>I guess they want to have standard icons look the same in all apps, so users dont get confused. Right?</p><p>Now I would love to use the Menu-Icon ""see map"" (a folded map) from the Google Places App. Where can I get it for a commercial project? (Its not in <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/res/res/drawable-hdpi;h=6e54b40a4b136aaa68016fd6ea1da16d9a9f8724;hb=HEAD"" rel=""nofollow"">here</a>)</p>","433718","","433718","","2010-09-13 15:48:50","2010-09-13 15:48:50","Does Android encourage reusing their Menu-Icons? Where to get them all?","<android><icons><drawable>","1","1","","",""
"3700262","1","3701926","","2010-09-13 12:14:12","2","5857","<p>I would like to know if there is a way to lock (prevent) an application from starting. </p><p>And i also would like to know if there is a way to prevent a service(application) from starting at boot of the device</p><p>...i would like to know because i would like to create an anti-malware app.</p>","1205130","","","","","2012-11-05 09:46:18","How to Lock(Block) an android application from starting / How to stop an android application (service) from starting at boot","<android>","2","2","2","",""
"3700312","1","","","2010-09-13 12:21:31","0","2276","<p>This is py struggling about installation of apk file in my android phone.</p><p>I am using htc android phone in that i am trying to install my application.</p><p>I developed application using eclipse ADT plugin and taken apk file and copied in my phone SD card -> Android folder.</p><p>After that i installed Astro file manager in my phone and trying to browse my apk file but still i unable to find Android folder and my apk file in the Astro file manager.</p><p>I just stuck up there.</p><p>Can anybody fix my problem?</p><p>Thanks and Regards,</p><p>Py</p>","416143","","","","","2013-04-10 03:50:36","Unable to install apk file in my android mobile","<android>","3","3","","",""
"3700314","1","","","2010-09-13 12:22:05","2","1370","<p>I am beginner in Android development.  At the moment, I am working a calculator. I want to use <code>GridView</code> in button part, but i have one error: </p><pre><code>Caused by:java.lang.IllegalArgumentException: can't have a viewTypeCount &lt; 1</code></pre><p>First i make class <code>ButtonAdapter</code> and implements <code>ListAdapter</code>. But i cant understand this error.</p><p>Please help me</p>","446298","","180538","","2011-02-06 20:54:18","2011-02-24 08:41:53","Android:GridView","<android><gridview>","2","0","1","",""
"3700356","1","6280580","","2010-09-13 12:29:30","0","632","<p>Can any one help me to give some hint about </p><p>How can i implement OSGI framewok i.e. Remotely installation of application,transfer of media, etc in android.</p><p>I have some idea on OSGI framework, I want to make application that should be able to install some media dynamically from remote location...</p><p>Any idea will be appreciated...THanks</p>","1386533","","","","","2011-06-08 14:39:48","android: Implementation of OSGI framework in android","<android>","1","0","1","",""
"3700363","1","","","2010-09-13 12:30:33","4","3964","<p>I want to show a simple toast, when exiting an application. The problem is, that the toast is not shown. I assume it is because the acitivity is finished or because of <code>System.exit(0)</code>, but I don't know how to solve it. Does anyone have a tip? Thanks!!</p><p>In my activity I have the following code:</p><pre><code>Toast.makeText(this,""Exit application."",Toast.LENGTH_SHORT).show();exitApp();public void exitApp (){  App.getInstance().exit();  finish();}</code></pre><p>And the mehod exit in App:</p><pre><code>public void exit() {   System.exit(0);}</code></pre>","446306","","302328","","2010-09-13 13:01:48","2011-06-03 08:38:00","Android: Show toast after finishing application / activity","<android><toast><system.exit>","2","0","","",""
"3700486","1","3701188","","2010-09-13 12:46:49","1","676","<p>At the moment the LEDs that light up the keyboard of the G1 (HTC Dream) are very quick to turn off, I time it at six seconds. This is a pain when using the phone in the dark as you must press a button in order to turn the lights back on if you look away even for a very short time.</p><p>Since my G1 is rooted I have access to the system files and when using adb to open a shell (<code>adb shell</code>) to the USB connected phone I can set the brightness file to a positive value using</p><pre><code>echo 1 &gt; /sys/class/leds/keyboard-backlight/brightness</code></pre><p>This keeps the keyboard on, until the screen is set to turn off (two minutes on my phone).</p><p>When I attempt the same using a Terminal Emulator or writing a simple app which should execute the same it does nothing despite both having root access. Why is this?</p>","446257","","225647","","2012-10-29 20:45:44","2012-10-29 20:45:44","adb controls G1 keyboard LEDs, terminal emulator doesn't?","<android><adb>","1","0","","",""
"3700496","1","","","2010-09-13 12:47:52","0","890","<p>I'm trying to use either Calendar or Gregorian Calendar to iterate and create a date grid.  However, both of them seem to think that August, 2010 has 30 days, and that September 2 and 3 are weekends.  It's as if the calendar has the wrong year, but I've tripple-checked that parameter.  Here are some excerpts.</p><pre><code>startDate.set(2010, 8, 28);SchedulerCalendar currentDate = (SchedulerCalendar) startDate.clone();   for(int i = 0; i&lt;daysDisplayed; i++){    newDate = new TextView(this);    String dateString = currentDate.get(Calendar.MONTH)+""/""+currentDate.get(Calendar.DATE);   //+""/""+currentDate.get(Calendar.YEAR);   newDate.setText(dateString);   newDate.setId(i+1);   newDate.setWidth(blockWidth);   newDate.setHeight(DATE_HEIGHT);   dateBar.addView(newDate);   currentDate.add(Calendar.DATE, 1);  } private class SchedulerCalendar extends GregorianCalendar {  @Override  public void add(int field, int value) {   super.add(field, value);   if(this.get(Calendar.DAY_OF_WEEK)==Calendar.SATURDAY) {    if(value&gt;=0) super.add(Calendar.DATE, 2);    if(value&lt;0) super.add(Calendar.DATE, -1);   }   if(this.get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY) {    if(value&gt;=0) super.add(Calendar.DATE, 1);    if(value&lt;0) super.add(Calendar.DATE, -2);   }  } }</code></pre>","434252","","157882","","2010-09-13 13:19:13","2010-09-13 14:31:14","Java GregorianCalendar and Calendar misplace weekends, days in a month for August and September, 2010","<java><android><gregorian-calendar>","3","0","","",""
"3700512","1","","","2010-09-13 12:49:52","2","816","<p>Has anyone managed to invoke a pdf viewer to display pdf files upon clicking a hyperlink inside webview? If so, can you share some idea how you accomplish that?</p>","446331","","114066","","2010-10-11 11:34:51","2011-06-27 20:39:07","load pdf viewer from a hyperlink of pdf file inside webview","<android><pdf><webview>","1","0","","",""
"3700622","1","3700791","","2010-09-13 13:03:57","2","673","<p>Trying to understand the Android framework model.  I have an application that needs to have several threads running.  On thread gets GPS fixes, another picks up GPS fixes and pushes them to server, and yet another occasionally polls a server for dispatched orders.  Some of these threads update status Views as well.</p><p>Since I am new to Android, the application framework model hasn't clicked for me. Where are these threads started?  Right now I start the threads in the initial Activity, but if I understand it right, once that Activity goes invisible it is stopped.  Furthermore, I have to track GPS and network statistics so that I can have a View which may (or may not) be the active View.</p><p>Just looking for a little guidance from folks who have tackled these issues on this platform.</p><p>Thanks.</p>","446347","","302328","","2010-09-13 13:17:15","2010-09-13 13:24:06","Keep threads and views alive between Activities","<android><multithreading>","1","0","1","",""
"3700827","1","","","2010-09-13 13:28:25","0","830","<p>I am having two activities, say activity A and B. Activity A is an ListActivity, and when the items in the list is selected, it will call startActivity() to bring up B. The problem here is that when I am in B and click the home key, and then go to the application launcher to resume my application, A will be brought up again. This time when I click a different item in A, it will bring up B with the old data of the previously selected item before the home key was clicked.</p><p>After examinzing the code, I found that the startActivity does not update the intent of B. I found a post here about the similar question, and the answer was to overwrite the onNewIntent. However, I found that it doesn't work, because this method never get called when the second time I call startActivity. I am sure that this is the same instance, because I've printed out the instance number. Is there any other ways to update the intent of the activity? Or I need some other settings to make the onNewIntent get called? I didn't set any flags or launch modes, so everything is default. </p>","412759","","","","","2012-08-20 20:25:26","How to update the intent of an existing activity while calling startActivity?","<android>","1","4","","",""
"3700974","1","3701284","","2010-09-13 13:43:28","2","864","<p>I have some ideas about running some anti-piracy measures for my app so I wondered if I could do this to sign the application on install. Running the code on first launch is no good, because someone could still copy out the apk without running it.</p>","434731","","434731","","2010-09-13 13:50:42","2010-09-13 14:21:27","Is there a way to make my Android app run some custom code upon installation?","<android><installation>","1","0","","",""
"3701106","1","3701166","","2010-09-13 13:57:52","3","6794","<p>I have one activity. OnCreate the activity gets the source (html) of a web page to a string and presents the result (after parsing it a bit) in a textview.</p><p>I would like the activity to reload/refresh periodically to always present the latest information.</p><p>What is the best solution for this?</p>","446413","","244296","","2010-09-13 14:09:40","2010-09-13 14:09:40","Periodically refresh/reload activity","<android>","1","2","1","",""
"3701182","1","","","2010-09-13 14:06:23","1","362","<p>i've got this Tabhost:</p><pre><code>        TabHost tabHost = getTabHost();        TabHost.TabSpec spec;        Intent intent;        /** Initialization Tab1 */        intent = new Intent(this, Tab1.Class);        spec = tabHost.newTabSpec(""Tab1"").setIndicator(""Tab1"").setContent(intent);        tabHost.addTab(spec);        /** Initialization Tab2 */              intent = new Intent(this, Abstand.class);        spec = tabHost.newTabSpec(""Tab2"").setIndicator(""Tab2"").setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(0); </code></pre><p>The content of Tab2 has some buttons, when one of these is clicked, it starts a SubActivity with:</p><pre><code>    final Intent i = new Intent(this, SubActivity.class);    final Bundle b = new Bundle();    this.mButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            b.putString(""key"", ""value"");            i.putExtras(b);            startActivityForResult(i, REQUEST_CODE);        }    });</code></pre><p>Within the SubActivity, the Tabhost isnt available anymore... so how can the Code be changed, showing the Tabhost in a SubActivity?</p>","395135","","","","","2010-09-13 14:06:23","How to keep the header of a Tab in a SubActivity?","<android><subactivity><android-tabhost>","0","0","0","",""
"3701297","1","3714370","","2010-09-13 14:23:41","0","1181","<p>Hello In my android application i need to insert an array into an array and access its values.Is there any way that i can get this done.</p><p>Please share your valuable suggestionsThanks in advance :)</p>","420261","","243782","","2010-09-13 15:22:06","2010-09-15 03:01:46","insert array into an array","<java><android>","3","2","1","",""
"3701337","1","","","2010-09-13 14:30:01","0","379","<p>When I first load my app, I get to load the webview. But when I push the back button and ""finish"" the activity(I know this doesn't really kill it) and navigate to other apps and come back to my first app; it never loads again.</p><p>Any idea what could be going wrong?</p><hr><p>My Bad, I wasn't returning the WebView object in the super class if it was defined once, removd the if loop and it worked fine!</p><p>No use of restart/resume/onstart methods. Simple plain onCreate method worked fine.</p>","402637","","402637","","2010-09-13 19:36:37","2010-09-13 19:36:37","WebView doesn't load up for the second time","<android>","0","3","0","",""
"3701530","1","3875815","","2010-09-13 14:50:09","4","1420","<p>I'm running into an issue with my program when trying to crop an image selected by the user from their gallery. The issue so far only appears when running on a Droid X, as running on the original moto Droid works fine. </p><p>Basically the issue occurs as the cropping intent is being run. Once the user crops the photo and clicks the save button, it replaces the wallpaper on the main screen with the cropped image that was saved! It does not do this on the moto droid, or emulators. Below is the code for cropping and saving the picture to the SD card:</p><pre><code>@Overridepublic void onActivityResult(int requestCode,int resultCode,Intent data) {super.onActivityResult(requestCode, resultCode, data);if (requestCode ==1){if (resultCode == Activity.RESULT_OK) {  Intent i = new Intent(""com.android.camera.action.CROP"");  i.setData(data.getData());  i.putExtra(""noFaceDetection"", true);  i.putExtra(""outputX"", 80);  i.putExtra(""outputY"", 80);  i.putExtra(""aspectX"", 1);  i.putExtra(""aspectY"", 1);  i.putExtra(""scale"", true);if(selectedImageString == null){      ContentValues values = new ContentValues();      values.put(android.provider.MediaStore.Images.Media.TITLE, ""Temp_Icon1"");      values.put(android.provider.MediaStore.Images.Media.BUCKET_ID, ""Temp_Icons"");      values.put(android.provider.MediaStore.Images.Media.BUCKET_DISPLAY_NAME,""Temp_Icons"");      values.put(android.provider.MediaStore.Images.Media.IS_PRIVATE, 1);      selectedImageString = getContentResolver().insert(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values).toString();  }  i.putExtra(""output"", Uri.parse(selectedImageString));  startActivityForResult(i, 2);}} if(requestCode == 2){ if (resultCode == Activity.RESULT_OK){  uriPath = Uri.parse(selectedImageString);  imageView.setImageURI(uriPath); }}}</code></pre><p>Can someone please help me with this?</p>","412396","","85950","","2013-03-05 03:42:52","2013-07-08 11:27:41","Cropping Picture on Droid X sets resulting image as wallpaper","<android><image><crop><wallpaper>","3","2","2","",""
"3701784","1","3705883","","2010-09-13 15:19:59","0","1088","<p>I have a scene that contains a bunch of objects, for example lets say it's a simple grid of tiles.  So there's a main ""border"" object, and then (<em>rows x columns</em>) cells.</p><p>For simplicity, assume each cell is a simple four-segment line consisting of a four-node GL_LINE_LOOP.</p><p>Currently, my frame rate is awefull, and it seems to sit in all the glVertexBuffer() calls that I'm making, as each cell has it's own set of vertices, so it's own call to glVertexPointer:</p><pre><code>class MyModel extends Model {  ...  public void onDrawFrame(GL10 gl) {    gl.glVertexPointer(0, GL10.GL_FLOAT, 0, mBuffer);    gl.glDrawArrays(GL10.GL_LINE_LOOP, 0, 4);  }}</code></pre><p>Should I instead track all of my distinct primitive models in a world super-object, and keep a copy of all the vertices in memory?  I could then perform a single glVertexPointer call at the start of each frame, and use offsets for the DrawArrays.</p><pre><code>class MyModel extends Model {  public MyModel() {    // do something clever in parent Model class to track total verts    this.offsetId = somethingFromSuper();  }  public void onDrawFrame(GL10 gl) {    // super's vertices should all have been already sent to GL    gl.glDrawArrays(GL10.GL_LINE_LOOP, this.offsetId, 4);  }}</code></pre>","138033","","","","","2010-09-14 03:17:57","On Android with opengl-es, should I put all glVertexPointer data into one buffer?","<android><opengl-es>","1","0","","",""
"3701966","1","","","2010-09-13 15:39:12","6","756","<p>This is a weird one. I am seeing this crash report on some devices:</p><pre><code>android.content.ActivityNotFoundException:   No Activity found to handle Intent {     act=android.intent.action.PICK dat=content://com.android.contacts/contacts }</code></pre><p>The intent that generates this error is:</p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); // pre-Eclair</code></pre><p>Or:</p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); // post-Eclair</code></pre><p>The device is simply reported as ""Droid"" but I don't know the OS version.</p>","104181","","","","","2013-07-16 10:04:41","ActivityNotFoundException trying to load Contacts ContentProvider?","<android><android-intent>","1","2","","",""
"3702000","1","3702533","","2010-09-13 15:43:13","2","11577","<p>How can I set the max width of my horizontal <code>LinearLayout</code>? So if the contents are short (say, some text), the layout shrinks and if the contents are longer, it will not expand more than some max width value.</p><p>I prefer doing this at the XML level.</p>","367677","","603977","","2012-03-05 06:53:45","2012-03-05 14:27:35","Setting a max width for LinearLayout","<android><gui><layout>","2","1","","",""
"3702292","1","","","2010-09-13 16:17:59","0","670","<p>I have a TextWatcher set on an EditText that changes the input type after a user types a number followed by a space. </p><p>If the user types two numbers the input type switches and accepts the next character, but if the user types only one number and presses space the input type still changes but it won't accept the first character the user tries to input.</p><p>I've tested this on Froyo and 1.6, it only happens on Froyo, 1.6 works like it should.</p><p>Here's the code: </p><pre><code>    TextWatcher watcher = new TextWatcher() {    @Override    public void afterTextChanged (Editable s) {    }    @Override    public void beforeTextChanged (CharSequence s, int start, int count, int after) {    }    @Override    public void onTextChanged (CharSequence s, int start, int before, int count) {                  // Parsed text holder is a class that just parses the EditText and pulls out various parts.        ParsedTextHolder th = parseTextHolder(s);        String newText = """";        Boolean setTextKeyListener = false;        String tGetTextString = mQuery.getText().toString();        if (!th.pFullMatch.equals("""")) {            if (th.pFullMatch.length() == 2) {                mQuery.setKeyListener(new                TextKeyListener(TextKeyListener.Capitalize.SENTENCES, true));                newText = tGetTextString + "" for "";                setTextKeyListener = true;            }        }        if (setTextKeyListener) {            Log.i(""setTextKeyListener"", ""true"");            if (mQuery.getKeyListener().getClass() != TextKeyListener.class) {                    mQuery.setKeyListener(new TextKeyListener(TextKeyListener.Capitalize.SENTENCES, true));            } else {                    Log.d(""setTextKeyListener"", ""skipped. already was text."");            }            if (!newText.equals("""")) {                    int position = newText.length();                    String ttext = newText;                    newText = """";                    mQuery.setText(ttext, TextView.BufferType.EDITABLE);                    mQuery.setText(ttext);                    Editable text = mQuery.getEditableText();                    Log.w(""setting selectiont to text: "", text.toString());                    Log.w(""setting selectiont to position: "", Integer.toString(position));                    Selection.setSelection(text, position);                    mQuery.setKeyListener(new TextKeyListener(TextKeyListener.Capitalize.SENTENCES, true));            }        }    }};</code></pre><p>Also, here's an APK if you want to see what the bug is like: <a href=""http://endlesswhileloop.com/files/KeyboardBug.apk"" rel=""nofollow"">http://endlesswhileloop.com/files/KeyboardBug.apk</a></p>","215056","","995926","","2012-05-05 13:52:15","2012-05-05 13:52:15","Keyboard doesn't accept first character when changing inputs","<android><edittext><textwatcher><android-2.2-froyo>","1","0","1","",""
"3702311","1","","","2010-09-13 16:20:28","9","26461","<p>I couldn't even find a developer site for Samsung.  Is it possible to get a galaxy emulator?  I do not want a skin; I want the full emulation including the Samsung TouchWiz.</p>","446534","","488433","","2011-06-21 13:07:37","2013-08-26 10:43:17","samsung galaxy emulator?","<android><android-emulator>","2","1","6","2013-08-27 14:52:25",""
"3702314","1","3702356","","2010-09-13 16:20:55","1","192","<p>I have numerous activites in my Android app., and most should contain the same, relatively complex set of UI widgets on the screen's top area (lets say that its a kind of toolbar that you can find on most screens).</p><p>Right now, every screen's layout contains the markup for this toolbar, along with its logic inside every Activity's source, so it's damn redundant. Could you recommend a more efficient / less redunant way to do this?</p>","446529","","","","","2010-09-13 16:25:54","Effective way to handle redundant UI elements in Android?","<android><user-interface>","2","0","","",""
"3702415","1","","","2010-09-13 16:31:56","2","967","<p>I am getting the following error when loading TTS on some devices (I don't know what they are because this is coming from a remote stacktrace from clients).</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.droidprofessor.android.mmm/com.droidprofessor.android.mmm.ActivityGame}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.speech.tts.engine.CHECK_TTS_DATA }       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)       at android.app.ActivityThread.access$2200(ActivityThread.java:119)       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)       at android.os.Handler.dispatchMessage(Handler.java:99)       at android.os.Looper.loop(Looper.java:123)       at android.app.ActivityThread.main(ActivityThread.java:4363)       at java.lang.reflect.Method.invokeNative(Native Method)       at java.lang.reflect.Method.invoke(Method.java:521)       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)       at dalvik.system.NativeStart.main(Native Method) Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.speech.tts.engine.CHECK_TTS_DATA }       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)       at android.app.Activity.startActivityForResult(Activity.java:2749)       at com.droidprofessor.android.mmm.ActivityTTS.onCreate(ActivityTTS.java:29)       at com.droidprofessor.android.mmm.ActivityGame.onCreate(ActivityGame.java:96)       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)       ... 11 more</code></pre><p>AND</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.droidprofessor.android.mmm/com.droidprofessor.android.mmm.ActivityGame}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.speech.tts.engine.CHECK_TTS_DATA }       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)       at android.app.ActivityThread.access$2200(ActivityThread.java:119)       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)       at android.os.Handler.dispatchMessage(Handler.java:99)       at android.os.Looper.loop(Looper.java:123)       at android.app.ActivityThread.main(ActivityThread.java:4363)       at java.lang.reflect.Method.invokeNative(Native Method)       at java.lang.reflect.Method.invoke(Method.java:521)       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)       at dalvik.system.NativeStart.main(Native Method)Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.speech.tts.engine.CHECK_TTS_DATA }       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)       at android.app.Activity.startActivityForResult(Activity.java:2749)       at com.droidprofessor.android.mmm.ActivityTTS.onCreate(ActivityTTS.java:29)       at com.droidprofessor.android.mmm.ActivityGame.onCreate(ActivityGame.java:96)       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)       ... 11 more</code></pre><p>In my previous post (http://stackoverflow.com/questions/3674362/getting-error-when-loading-tts) I made the changes as described.  I added the following</p><pre><code>                PackageManager pm = getPackageManager();                Intent installIntent = new Intent();                installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                ResolveInfo resolveInfo = pm.resolveActivity( installIntent, PackageManager.MATCH_DEFAULT_ONLY );                if( resolveInfo == null ) {                   // Not able to find the activity which should be started for this intent                    Toast.makeText(getApplicationContext(), R.string.unable_to_access_the_android_market, Toast.LENGTH_LONG).show();                } else {                   startActivity( installIntent );                }</code></pre><p>Here is the full source of the TTS activity</p><pre><code>public abstract class ActivityTTS extends Activity implements OnInitListener {    //TEXT TO SPEECH SERVICE    public static final int CHECK_TTS_AVAILABILITY = 0;    private static final String TAG = ""ActivityTTS"";    private TextToSpeech mTts; //Text to speech library    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        //TTS Service        Intent checkIntent = new Intent();        checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);        startActivityForResult(checkIntent, CHECK_TTS_AVAILABILITY);    }    /**     * For TTS     */    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        try {            if(Logging.DEBUG_LOG) Log.d(TAG, ""TTS Response: ""+requestCode);            if (requestCode == CHECK_TTS_AVAILABILITY) {                if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {                    // success, create the TTS instance                    mTts = new TextToSpeech(this, this);                            } else {                    // missing data, install it                    Toast.makeText(getApplicationContext(), R.string.install_audio_data, Toast.LENGTH_LONG).show();                    PackageManager pm = getPackageManager();                    Intent installIntent = new Intent();                    installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);                    ResolveInfo resolveInfo = pm.resolveActivity( installIntent, PackageManager.MATCH_DEFAULT_ONLY );                    if( resolveInfo == null ) {                       // Not able to find the activity which should be started for this intent                        Toast.makeText(getApplicationContext(), R.string.unable_to_access_the_android_market, Toast.LENGTH_LONG).show();                    } else {                       startActivity( installIntent );                    }                    finish();                }            }        }catch (Exception e) {            if(Logging.ERROR_LOG) Log.e(TAG, ""Unable to access service"");            finish();        }    }    /**     * Loads when the TTS is ready     */    @Override    public void onInit(int status) {        mTts.setLanguage(Locale.getDefault());    }    /**     * Speak text     */    final void speak(String text) {        try{            mTts.stop(); //Stop speaking            mTts.speak(text, TextToSpeech.QUEUE_FLUSH, null);        }        catch(Exception e) {            if (Logging.ERROR_LOG) Log.e(TAG, ""TTS Failed - cannot say: ""+text );        }    }    @Override    protected void onDestroy() {        super.onDestroy();        //Close the Text to Speech Library        if(mTts != null) mTts.shutdown();     }}</code></pre>","248521","","248521","","2010-09-13 16:44:49","2010-09-13 16:44:49","TTS crashing on some devices","<android>","0","8","","",""
"3702473","1","3702584","","2010-09-13 16:38:53","0","836","<p>In Java, is it possible to associate some object (i.e. a String) with a function to be called ?</p><p>I have two similar menus and both have a onClickListener with some code like this:</p><pre><code>if (item.id==0) { doSomeFunction(argument);}else if (item.id==1) { doSomeOtherFunction();}else if (item.id==2) { doStuff(arg2);}else {}</code></pre><p>I would just like to have an object (i.e. Hashtable) that would allow me to define associations between ""item.id"" -> ""code to execute"". </p><p>Example: </p><pre><code>0 -&gt; doSomeFunction(argument);1 -&gt; doSomeOtherFunction();2 -&gt; doStuff(arg2);</code></pre><p>As a result I could skip these conditionals and just perform a function call of the function stored for a given item.id.</p><p>For example, with Lisp I could associate the item.id with a function and then use Lisp's ""funcall"" to call that function.</p><p>Is there a standard way to do something like this in Java?</p><p>Are there alternative solutions to skip the conditionals?</p><p>Please note that the called functions may need to receive parameters.</p><p>Thanks.</p>","425749","","425749","","2010-09-15 12:17:58","2010-09-15 12:17:58","Defining a callback function for a given value","<java><android><refactoring><callback>","4","0","","",""
"3702601","1","3719228","","2010-09-13 16:53:06","2","1015","<p>I have an Activity that will query a RESTful API every x seconds (polls using a handler).  The results of the GET are used to update a ListView.  This is done using an AsyncTask.</p><p>I want to put a Notification in the Notification bar when certain criteria are met in the new data.  Everything I have read up to this point has suggested that notifications should be created and updated using a service so that the notifications can be made even when the application isn't in focus.  I see the positive aspects of this.</p><p>However, I'm unsure if I should just create a service from within my activity or if I need to do something more complex than that.  I'm undecided on if I should scrap my AsyncTask model in favor of using the Service to update my list view.</p><p>So, my questions are:</p><p><strong>1)  Is there a good tutorial showing how to make a local service from an activity?</strong></p><p>The tutorial doesn't need to show how to make them communicate, the service could be isolated from the main activity.</p><p><strong>2)  Will #1 provide me with the notification benefits I'm looking for? (Notifications are generated even when the main app isn't visible)</strong></p><p><strong>3)  Should I use this same service to update my listview?</strong></p><p>The service would basically be making the same query that the AsyncTasks are, just doing different things with the results.  The app would seem to make more sense to have the Service query, do notification processing, then give the results to the activity, but I haven't found a good resource that clearly demonstrates how to do something like this.</p><p>I can add any necessary code or explain further if need be.</p>","253412","","","","","2010-09-15 15:31:48","How to handle notifications in an Android Activity","<android><listview><activity><android-asynctask><android-service>","1","0","2","",""
"3702627","1","4945943","","2010-09-13 16:56:39","5","5347","<p>For some reason the onPageFinished is firing before the WebView has finished loading - I can't figure out why...</p><pre><code>public class WebViewClientTest extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    final WebView webview = (WebView) findViewById(R.id.webview);    webview.setWebViewClient(new WebViewClient() {          @Override          public void onPageFinished(WebView view, String url) {            super.onPageFinished(webview, url);            webview.scrollTo(0, 500);        }      });    webview.loadUrl(""http://www.google.co.uk/search?sourceid=chrome&amp;ie=UTF-8&amp;q=lala"");}}</code></pre><hr><p>OK, well it looks like this isn't fixed. I think there's a race condition going on when loading the page, but can't get a reproducible behaviour. </p><p>I'm storing the HTML content of a webpage in a SQLite database for viewing when offline. I reload the content into the WebView with:</p><pre><code>webView.loadDataWithBaseURL(""fake://fake.com/"", htmlBody, ""text/html"", ""utf-8"", null);</code></pre><p>It seems that sometimes when the WebView loads it fires the WebViewClient.onPageFinished() method correctly, and other times it does not. Sometimes it appears to fire before the page has finished loading, producing a contentHeight of 0 and ignoring any scrollTo calls. </p><p>Anyone have any experience with this? </p>","421808","","1288","","2012-03-24 00:32:40","2013-07-04 16:21:16","onPageFinished not firing correctly when rendering web page","<java><android><webkit>","4","0","2","",""
"3702768","1","","","2010-09-13 17:14:57","1","109","<p>Is it possible to find the modified versions of //android/framework/base/core/res/res/values/styles.xml that phone manufactures provide (HTC Sense, Motorola Motoblur, Samsung TouchWiz, etc)?  We have a partner developing an android app for us so I do not know how they implemented it, but we have seen issues on the Sense and Motoblur with colors being wrong, etc.  If I had copies of those files I can try again to make the case that different phones may have different style values.</p>","446534","","","","","2010-09-13 17:14:57","styles.xml from device providers","<android><android-manifest><android-sdk-2.2>","0","0","1","",""
"3702805","1","","","2010-09-13 17:20:28","8","9777","<p>When a user clicks in an input field or textarea, the application zooms in.Is there a simple way to disable it?</p><p>Currently have the meta tag:meta name=""viewport"" content=""width=device-width; height=device-height; initial-scale=1.0; maximum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi;""</p><p>Everything looks great till I look at it on a device with Android 2.2Specifically HTC Evo 4G.</p>","356967","","","","","2012-12-29 23:25:16","Is there a way to disable the zoom feature on input fields in webview?","<android><webview><textinput>","7","3","4","",""
"3702827","1","","","2010-09-13 17:24:09","2","1477","<p>Is there a performance impact, especially with regard to battery performance, if we switch from the default black theme of android to white or another colour?</p>","356580","","418613","","2012-06-08 12:32:10","2012-06-08 12:32:10","Android Black Theme vs White Theme","<android><themes><power-management><electronics><lcd>","2","2","","",""
"3702837","1","3702952","","2010-09-13 17:26:13","0","260","<p>Why do I kee[ getting null errors at setOnClickListener?<br>R.layout.dataentry is the ContentView.  It has the addRecord (a button) and it loads and displays fine.It looks as though R.id.addRecord gets an ID when I look in the debugger).I'm sure it has something to do with the ContentView not being loaded correctly resulting in a null pointer exception when I try to add the listenter, but I've tried preloading it several ways (here, earlier) and I can't figure out how to do it.  I guess I'd prefer to have all my views cached so that I can add listeners early.  Can someone help?</p><p>Thanks.</p><pre><code>      exercise = (RadioGroup)this.findViewById(R.id.exerciseType);         addRecord = (Button)this.findViewById(R.id.addRecord);         amount = (TextView)this.findViewById(R.id.amount);         datePerformed = (DatePicker)this.findViewById(R.id.datePerfomed);public void loadAddEntry() {            setContentView(R.layout.dataentry);            addRecord.setOnClickListener(                 new View.OnClickListener(){                     public void onClick(View view) {                         addRecordClicked();                    }                    ;});            }</code></pre>","446588","","446588","","2010-09-14 13:14:01","2010-09-14 13:14:01","why do I keep getting null exceptions at setOnClickListener","<android>","1","0","1","",""
"3702897","1","3708555","","2010-09-13 17:34:20","0","785","<p>Hai dude,         I developed an application which intially displayed Games Listview , suppose if the user clicks the football elemnet in that games listview, then the football listview opens ,in that if user selected the particular player listview, then it is displayed, my problem is i want 2 know which listview is in active.</p><p>Can any one help me regarding on this?</p><pre><code>if(tabHost.getCurrentTab() == 2)                    {                          Log.v(""I m Here Boss"",""0"");                        if(findViewById(R.id.bars_school_details).getVisibility() == View.VISIBLE)                        {                            Log.v(""I m Here Boss"",""1"");                            findViewById(R.id.bars_school_details).setVisibility(View.GONE);                            findViewById(R.id.bars_list).setVisibility(View.GONE);                            findViewById(R.id.bars).setVisibility(View.VISIBLE);                        }                        else if(findViewById(R.id.bars_list).getVisibility() == View.VISIBLE)                        {                            Log.v(""I m Here Boss"",""2"");                            findViewById(R.id.bars_school_details).setVisibility(View.VISIBLE);                            findViewById(R.id.bars_list).setVisibility(View.GONE);                            findViewById(R.id.bars).setVisibility(View.GONE);                        }                    }</code></pre>","424413","","234039","","2010-09-13 18:57:29","2010-12-27 11:59:11","How to know whether the List View is Active or not?","<android>","1","6","0","","2010-09-13 18:24:26"
"3702948","1","3703205","","2010-09-13 17:42:45","0","475","<p>I am checking to see if my app has a network connection:</p><pre><code>public boolean isOnline(){        ConnectivityManager conMgr =  (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);        if ( conMgr.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED             ||  conMgr.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTING  ) {            return true;        }        else if ( conMgr.getNetworkInfo(0).getState() == NetworkInfo.State.DISCONNECTED             ||  conMgr.getNetworkInfo(1).getState() == NetworkInfo.State.DISCONNECTED) {            return false;        } else {return false;}    }</code></pre><p>Whenever I rotate my screen between landscape and portrait this method returns false. It makes me wonder if Network connections are getting killed during the rotation?</p>","19875","","","","","2010-10-23 13:07:50","Network connection lost every time an Activity is created?","<android><networking><activity>","1","0","","",""
"3702998","1","","","2010-09-13 17:49:21","7","11624","<p>I'm pretty new to Android development and I'm looking for a means of including calendar in my Android application, but I'm striking out pretty bad when googling.</p><ol><li><p>Is there any way to use a default calendar kind of view in my application? (would be ideal since the UI would be familiar)</p></li><li><p>Failing at a built-in option, are there any good libraries out there with a calendar control that I could use?</p></li></ol><p>I'm not looking to sync and all of that (at least, at this point), just looking to have a calendar view that I can display information to the user.</p>","446605","","85950","","2013-11-06 00:19:21","2014-02-20 09:06:06","Android calendar view","<android><calendarview>","7","0","4","",""
"3703071","1","3715514","","2010-09-13 17:58:49","9","23982","<p>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?</p>","1507543","","1507543","","2010-09-15 07:15:39","2013-04-05 07:54:39","How to hook into the Power button in Android?","<android>","7","0","14","",""
"3703283","1","3704545","","2010-09-13 18:27:53","15","22475","<p>I want to dynamically  add image in <code>EditText</code>. Is it possible? </p><p>if anyone knows please give sample code for that.</p>","410757","","3395743","","2014-03-10 11:29:38","2014-03-10 11:29:38","How can I add an image on EditText","<android><image><edittext>","7","1","11","",""
"3703285","1","","","2010-09-13 18:28:11","0","436","<p>I have a class which inflates linearlayout. The inflated xml contains a textview. </p><p>I want to change the height of that textview dynamically as per the content.</p>","215399","","","","","2010-09-13 19:20:44","Android: Increasing the height of textview dynamically","<java><android>","1","0","","",""
"3703329","1","3703339","","2010-09-13 18:36:08","1","2695","<p>Are there any app built with html5 feature (such as canvas, video playback...) available in Android marketplace? </p><p>I'm looking for html5 web apps wrapped as a native android app.</p>","436323","","436323","","2010-09-13 22:56:06","2010-09-13 22:56:06","HTML5 apps available in Android Marketplace?","<android><html5>","1","0","4","",""
"3703446","1","3703505","","2010-09-13 18:53:08","0","242","<p>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! </p><p>But I want the More button to display the extra items both in their text AND icon, how do I do that?</p>","223876","","","","","2010-09-13 18:59:38","How to Display Menu Icons after clicking the More item in Android","<java><android><eclipse>","1","0","","",""
"3703513","1","","","2010-09-13 19:00:18","1","367","<p>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?</p>","19875","","","","","2010-09-13 22:12:28","How can I do a fade animation when the user rotates the phone?","<java><android><animation><orientation>","1","0","1","",""
"3703558","1","3704746","","2010-09-13 19:06:49","9","3049","<p>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.</p><p>I'm using intellij and this is Android 2.2.</p><p>Steps I took:</p><ol><li>Download the Joda-time jar from the <a href=""http://www.joda.org/joda-time/"" rel=""nofollow"">website</a>.</li><li>Intellij > File > Project Structure > Attach Classes</li><li>Build</li></ol><p>I then get this error:</p><blockquote>  <p>warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)</p></blockquote><p>I have no idea where to go from here. Help would be appreciated!</p>","57414","","38896","","2013-08-16 18:25:27","2013-08-16 18:25:27","Having trouble getting Joda-time to run on Android.","<android><time><jodatime><dalvik>","2","0","1","",""
"3703674","1","3703759","","2010-09-13 19:26:42","3","856","<p>I try to display a Toast inside a AsyncTask. This first piece of code is placed in an activity that we may call <code>MyActivity</code>, and works fine:</p><pre><code>Toast.makeText(this, ""Toast!"", Toast.LENGTH_SHORT).show();</code></pre><p>Then I create a new instance of <code>MyObject</code> and calls <code>method()</code>. This code is also placed in <code>MyActivity</code>.</p><pre><code>MyObject obj = new MyObject(this);obj.method();</code></pre><p>This is the definition of <code>MyObject</code>. The ProgressDialog works fine, but no toast is showed. </p><pre><code>public class MyObject {   Context cxt;   public MyObject(Context cxt) {      this.cxt = cxt;   }   public void method() {      new MyAsyncTask().execute();   }   private class MyAsyncTask extends AsyncTask&lt;Object, Integer, Boolean&gt; {      protected void onPreExecute() {         Toast.makeText(cxt, ""Toast!"", Toast.LENGTH_SHORT).show(); // works fine    }        protected Boolean doInBackground(Object... params) {           Looper.prepare();           Toast.makeText(cxt, ""Toast!"", Toast.LENGTH_SHORT).show(); // doesn't work        }   }}</code></pre><p>I believed I was doing exactly the same thing in my first example and below, but appearently, I'm missing something. I've also tried <code>getApplicationContext()</code> and <code>cxt.getApplicationContext()</code> instead of <code>cxt</code>, but with the same result.</p>","404691","","404691","","2010-09-14 16:42:48","2010-09-14 16:42:48","Problems with context when trying to display Toast","<java><android><context><toast>","2","2","","",""
"3703698","1","3704018","","2010-09-13 19:29:20","1","2823","<p>I am building a list and the list contain for every contact acheckbox to chose which one to modify for example, the problem is thatwhen the list became longer than the phone screen and the scrolling isactive; when i select a check box , a second one is automaticallyselected in the bottom of the list.</p><p>the problem is the automatic selection of the second checkbox;please let me know how can i fix it ??</p><p>below is the code i am using for getView method</p><pre><code>   public View getView(int position, View converView, ViewGroup parent){   View row = converView;   if(row == null){   LayoutInflater inflater = getLayoutInflater();   row = inflater.inflate(R.layout.edit, parent, false);   }   TextView label = (TextView)row.findViewById(R.id.label);   label.setText(items[position]);   CheckBox cb = (CheckBox)row.findViewById(R.id.del);   ImageView icon = (ImageView)row.findViewById(R.id.icon);   icon.setImageResource(images.get(position));   Log.i(""Pos"", """"+position);   return row;     } }</code></pre>","497235","","664512","","2011-04-17 08:32:49","2012-10-02 15:41:54","Automatic selection of checkboxes inside listview - android","<android><listview><checkbox><scrolling>","4","0","3","",""
"3703763","1","3703800","","2010-09-13 19:36:47","0","135","<p>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?</p><p>The newNoteButton that starts the Activity:</p><pre><code>    newNoteButton.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            final Intent i = new Intent(Typy.this, TypyEdit.class);            startActivityForResult(i, 1);        }    });</code></pre><p>And the beginning of the TypyEdit Activity:</p><pre><code>public class TypyEdit extends Activity {private TextView mTitleText;private TextView mBodyText;private Long mRowId;private NotesDbAdapter mDbHelper;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);</code></pre>","365807","","","","","2010-09-13 19:40:36","Why won't my Activity start?","<java><android>","1","1","","",""
"3703990","1","","","2010-09-13 20:07:40","0","65","<p>Is there a way to know what digits (digit by digit) are entered via an Android phone's native dialer?</p>","420008","","","","","2010-09-13 20:07:40","Is there a way to know the what digits are being entered via the native dialer?","<android>","0","2","","",""
"3704058","1","3704087","","2010-09-13 20:16:39","1","1471","<p>I'm trying to make a timeout gauge bar animation effect:</p><p>The width of a lengthy colorful bitmap image is decreasing, but not x-scaling.</p><p>so the image looks not changing and the visible area shrinks.</p><p>I couldn't find the sole ImageView clipping or masking support in android.</p><p>And I managed to get the clipping effect by surrounding the ImageView in ViewGroup like:</p><pre><code>&lt;FrameLayout android:id=""@+id/shrink_box"" ...&gt;  &lt;ImageView android:src=""@drawable/still_image"" ...&gt;&lt;/FrameLayout&gt;</code></pre><p>then changing the shrink_box's width will clip the portion of the still_image.</p><p>But I failed to change the width of the view smoothly.I tried to change the LayoutParam.width in applyTransformation() but got an Exception, it seems not allowed.</p><p>How can I make an Animation that changes the width of the view. OR is there a proper method to achieve the above effect?</p>","2556909","","","","","2010-09-13 20:20:44","Android, View width change animation?","<android><animation>","1","0","","",""
"3704166","1","","","2010-09-13 20:32:35","2","2357","<p>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. </p><p>Some code samples to play swf in android that works for as many users as possible?</p>","446752","","","","","2011-05-06 16:11:56","The best way to play swf-files (flash) in my android-program?","<java><android><flash><swf>","3","0","1","",""
"3704639","1","3705104","","2010-09-13 21:43:09","4","3763","<p>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 </p><p>all the best .</p>","401663","","","","","2013-07-07 08:22:33","Android newline in my EditText","<android><json><utf-8><edittext>","2","0","1","",""
"3704661","1","","","2010-09-13 21:45:59","5","7976","<p>The end result is that I want to upload selected photos from and Android phone  to a php website.</p><p>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 not private to my application. Use FileInputStream generates an error that the file contains a path separater.</p><p>Does anyone know how to get the filestream running?  Do I have to copy the file into a private file store?</p>","445116","","212218","","2012-07-02 08:26:05","2012-12-03 13:46:05","Upload a photo from camera to PHP server","<php><android><image><upload>","1","4","5","",""
"3704854","1","","","2010-09-13 22:21:12","1","2151","<p>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.</p><p>Here is the code which should be wrapping the text inside of the TableRow. Notice the setSingleLine is being set to false.</p><pre><code>            TextView value = new TextView(this);    ![alt text][1]value.setLayoutParams(new TableRow.LayoutParams(            LayoutParams.FILL_PARENT,            LayoutParams.WRAP_CONTENT));    value.setSingleLine(false);    value.setEllipsize(TruncateAt.END);    value.setHorizontallyScrolling(false);    value.setText(txt);    value.setTextColor(Color.BLACK);    value.setTextSize(12);    value.setTypeface(generalFont);</code></pre><p>The documentation doesn't say by setting it to false will make it multiline, it says it will restore it to the defaults.</p><blockquote>  <p>setSingleLine(boolean singleLine)  If true, sets the properties of this field (lines, horizontally scrolling, transformation method) to be for a single-line input; if false, restores these to the default conditions.</p></blockquote><p>Does anybody have a code snippet or URL which points to a multiline TextView being created programmatically?</p><p>TEXT IN TEXT VIEW</p><blockquote>  <p>Lorem ipsum dolor sit amet,  consectetur adipiscing elit. Phasellus  tempus porttitor diam, sit amet rutrum  nunc laoreet at. Mauris sit amet  tristique e</p></blockquote><p>IMAGE SHOWING THE ISSUE</p><p><img src=""http://i.stack.imgur.com/jl8Hs.png"" alt=""TextView not wrapping""></p>","308987","","308987","","2010-09-14 17:03:15","2010-09-14 19:32:49","Android :: TextView :: Programitic Creation with setSingleLine(false) - Not wrapping","<android><textview>","3","0","","",""
"3704885","1","3705169","","2010-09-13 22:26:48","7","3020","<p>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. <code>inSampleSize == 1</code>)</p><p>Is there a way to load/draw just the part I want given a <code>Rect</code> specifying the area without loading the entire bitmap content?</p>","3055","","3055","","2010-09-14 03:30:46","2014-01-05 08:46:38","Is there a way to load and draw partially a bitmap from file in Android?","<android><bitmap>","4","0","7","",""
"3704912","1","3705026","","2010-09-13 22:33:21","0","369","<p>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':</p><pre><code>app_37    12107 1870  125356 16932 ffffffff afe0da04 S fishnoodle.aquarium_freeapp_50    12196 1870  109620 16804 ffffffff afe0da04 S com.geekyouup.android.snowpaper</code></pre><p>My own one that I'm building also does this... is there something I'm not understanding about the lifecycle of android apps?</p><p>(In my own one, code the service thread finishes, but the it still shows in ps).</p>","62709","","19750","","2011-03-31 15:43:45","2011-03-31 15:43:45","Android live wallpaper doesn't seem to quit?","<android><memory><live-wallpaper><application-lifecycle>","1","0","0","",""
"3704994","1","3705637","","2010-09-13 22:50:15","5","1260","<p>I have an application installed on phones sitting in locked boxes in different states.  It runs 24/7 and has little to no user interaction.</p><p>I know how to push updates to the marketplace...can I have a thread running in my application that sees an app update, installs the apk, and opens the new apk, replacing the currently running version with it?</p>","355663","","","","","2010-09-14 01:51:37","Is it possible for an Android App to Auto-Install and Run an Update?","<android><installation><auto-update>","1","4","1","",""
"3705047","1","3705379","","2010-09-13 23:02:55","4","1837","<p>What is it called ( what term should i google) when flipping/tilting the phone, <strong>so that the view rotates</strong> when running android?</p><p>My (OpenGL) application crashes when I do this, are there some certain steps you should do when handling OpenGL when this occures? </p><p>Is there something else I might want to think about?</p>","333361","","44729","","2010-09-14 13:25:14","2011-02-16 18:02:47","OpenGL when turning Android Phone","<android><opengl-es><rotation>","4","2","1","",""
"3705144","1","3706820","","2010-09-13 23:30:42","13","20622","<p>How do I pass the current AttributeSet to a custom View class? If I use a constructor that only has Context in the arguments, I lose all themes and the ability to use ""style"" tags in the xml for that custom View. </p><p>What I've done is create an activity that contains my custom view already in the xml file, and then programmatically create a new one and add it to the layout. What I find is the one that is made in the xml has the proper styling, and the one I create programmatically doesn't. </p><p>The difference between the two as far as I can tell is that the system uses the <code>CustomLayout1(Context context, AttributeSet attrs)</code> constructor. The problem is I can't figure out how to get the AttributeSet for the application to pass to this custom view when I create it programmatically.</p><p>Here's the Activity:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.LinearLayout;public class ThemeOne extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LinearLayout layout = (LinearLayout) findViewById(R.id.mainlayout);        layout.addView(new CustomLayout1(getApplicationContext()));    }}</code></pre><p>Here's the main xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical""  android:id=""@+id/mainlayout"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt; &lt;com.clearsync.test.theme1.CustomLayout1 android:id=""@+id/maincustom""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The custom view class:</p><pre><code>import com.clearsync.test.theme1.R;import android.content.Context;import android.util.AttributeSet;import android.view.LayoutInflater;import android.widget.LinearLayout;public class CustomLayout1 extends LinearLayout { private Context context = null; public CustomLayout1(Context context) {  super(context);  this.context = context;  create(); } public CustomLayout1(Context context, AttributeSet attrs) {  super(context, attrs);  this.context = context;  create(); } private void create(){  LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);  layoutInflater.inflate(R.layout.inflateme, this, true); }}</code></pre><p>and finally, the custom view xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical""  android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt; &lt;TextView android:layout_width=""wrap_content""  android:layout_height=""wrap_content""   android:text=""Oh, Hewroh...""  style=""?textview_style1"" /&gt;&lt;/LinearLayout&gt;</code></pre>","443659","","","","","2011-07-21 13:22:04","How to pass AttributeSet to custom View","<android>","3","0","1","",""
"3705190","1","","","2010-09-13 23:39:38","0","433","<p>I have an app which consists of a simple GUI and a few Broadcast receivers.I found somewhere on here how to start an app on boot of the device but cant seem to locate it atm.However i need more i need it to start in the background and just listen using the broadcast receivers and then return to this state after the Gui(the visible part of the app) has been used.Is there a way of doing this?Thanks.</p>","446870","","","","","2010-09-13 23:49:49","Android, running an app in the background","<android>","1","0","","",""
"3705198","1","","","2010-09-13 23:43:31","1","2082","<p>I have been battling an ANR happening in one of my services for a while now.  It is very hard to reproduce and the UI seems to have full functionality right before it happens 100% of the time there is never any noticeable lag or freezing.   My service has a TimerTask and a few AsyncTask's that it runs and that is it.  </p><p>The stack traces I get when you report it with the Android Market in 2.2 are hard to read, there doesn't seem to be a reference to any of my code directly but only from classes in the SDK. Can anyone take a look at the stacktrace and see if you can tell what is going on. </p><p>The print out is so large I opted to post it to pastebin, I hope that isn't against the rules.<a href=""http://pastebin.com/KHUD0UHW"" rel=""nofollow"">http://pastebin.com/KHUD0UHW</a></p><p>Here is the Logcat log as well<a href=""http://pastebin.com/V5xSey36"" rel=""nofollow"">http://pastebin.com/V5xSey36</a></p>","384306","","21234","","2011-06-30 18:08:09","2011-06-30 18:08:09","Help reading ANR stack traces in Android","<android><stack-trace><android-anr-dialog>","1","4","","",""
"3705246","1","4066074","","2010-09-13 23:55:16","12","3672","<p>Oh Android. How I love your verbiage.</p><p>I have a workspace with a few projects in it. App1 and App2 are Android applications. Common is an Android library project. App1 and App2 depend upon Common (linked via the Android tab). </p><p>Common has some external dependencies, namely httpmime &amp; apache-mime4j, which exist as jar files.</p><p>For some reason, it appears that I need to add my mime jars to the build path of App1 and App2 for compilation to succeed. This seems really dumb. In normal Java, I would add Common to the build path of App1 and App2 and things would work. Is this expected that I have to add my jars to every Android application?</p><p>-Andy</p><p>Note: If I don't configure the build path as described above, I get ""The type org.apache.james.mime4j.message.SingleBody cannot be resolved. It is indirectly referenced from required .class files | DataCallUtil.java | /App1/Common/util | line 364""</p>","446878","","446878","","2010-09-14 00:19:42","2010-11-01 01:15:14","How to reference an external jar in an Android Library project in Eclipse","<android>","3","2","3","",""
"3705346","1","","","2010-09-14 00:24:59","1","12498","<p>Is the android:divider attribute under the TabWidget working?  I tried the Tab Layout tutorial from android just to test (http://developer.android.com/resources/tutorials/views/hello-tabwidget.html) and set the android:divider to some image (for now I used the android vertical scrollbar as the drawable to really emphasize if its getting picked up (copied it from frameworks), but when I ran it on the emulator, it doesn't appear to be working.  According to the docs, the TabWidget does seem to support this attribute: ""Drawable used to draw the divider between tabs.""</p><p>Can anyone help?  I am using a nine-patched drawable as my divider image drawable.</p><p>MB</p>","425916","","425916","","2010-09-16 19:08:53","2013-04-25 07:02:23","dividers between TabWidgets","<android><layout><tabs><tabwidget><divider>","4","2","2","",""
"3705357","1","","","2010-09-14 00:26:25","2","3515","<p>Everytime I start the emulator from eclipse, I get the following error in my console.</p><p>[2010-09-13 17:04:51 - DeviceMonitor]Sending jdwp tracking request failed![2010-09-13 17:18:49 - DeviceMonitor]Sending jdwp tracking request failed!</p><p>The application works fine, but I am concerned as to why I see this error. Please help</p>","446890","","404469","","2010-09-14 00:30:56","2011-09-02 22:07:07","Eclipse android error","<android><eclipse><android-emulator>","3","1","","",""
"3705394","1","","","2010-09-14 00:40:04","0","897","<p>I'm trying to create a particular effect where I have a bunch of particles on the screen which leave trails that slowly fade. I was hoping that I could simply use glClear with a small alpha value to do  this but that doesn't seem to be working.My second idea was to draw a black face on the front of the screen but this doesn't seem to be giving me the right effect, the particles are faded but the background doesn't really fade. My next idea is to render to a texture and fade that texture but that's a lot of extra work and I'm not sure if it will solve my problem. Can anyone think of a way to do this? Am I missing something?</p><p><strong>Edit</strong> Also I'm having trouble finding information about rendering to a texture on android. If anyone has some links to articles that would be great.</p>","304795","","304795","","2010-09-14 00:51:12","2010-09-15 03:14:34","openGL fading background","<android><opengl-es>","1","0","","",""
"3705469","1","3705614","","2010-09-14 00:59:07","1","352","<p>I'm working in a Java-oriented shop and we're starting to adapt our products to mobile devices now (mainly focusing on smart phones). A separate native app is already in the works for the iPhone, but we would like to make a generic Java/J2ME version for any other devices.</p><p>My question is, how feasible is this? And where is the divergence point generally? ie We don't mind if each device has some variation in it's specific Java toolkit and they require separate builds, and thus all we can have is just have some basic framework stuff in common underneath. We're just trying to architect this in such a way that as much of the basic framework can be re-used as possible.</p><p>The main target platforms we're looking at are Android, Symbian, and generic Java-enabled mobile devices.</p><p>Anyone have any advice, pointers, or good links they can point me at?</p>","446905","","","","","2011-01-09 02:03:50","Generic Java mobile development","<java><android><java-me><mobile><symbian>","3","1","0","",""
"3705557","1","","","2010-09-14 01:24:30","4","816","<p>Has anyone had any success with <code>TabWidget.setDivider()</code>? I'm not sure it does what I'm assuming: gives you a chance to supply a drawable to be drawn between each tab instance?</p><pre><code>mTabHost.getTabWidget().setDividerDrawable(R.drawable.dividerDrawable);</code></pre><p>this does not appear to do anything. Looking at the tab drawable resources in the android project shows that the dividers are actually drawn into the tab images themselves - is this supposed to work or is it not supported?</p>","291701","","810368","","2012-10-15 09:10:15","2012-10-15 09:10:15","Using TabWidget.setDividerDrawable()?","<android><android-tabhost><android-tabs>","0","1","1","",""
"3705646","1","3705752","","2010-09-14 01:54:53","3","4461","<p>official android dev website says that:?You can implement your tab content in one of two ways: use the tabs to swap Views within the same Activity,.....?</p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p><p>i just wanna use tabs to swap views, no more than one activity.</p><p>could someone teach me how to do that?? is there any sample code?? thx ~</p>","422405","","","","","2011-09-22 18:28:19","how to implement tab layout using only one activity?","<android>","2","0","3","",""
"3705651","1","4512077","","2010-09-14 01:58:01","0","928","<p>I've been trying to get my ads to display in this type of layout.Tabs -> LinearLayout -> ListView -> header. The header is set via <code>addHeaderView</code> and is displaying normally. If I were to move the ads anywhere else they display normally (so its not a setup issue). Using ads in the header of a listview works fine in my other projects.</p><p>So this seems to be a very specific problem, the ads simply refuse to display when placed in the header of a listview inside a tabhost.</p><p>My logs show no activity from admob at all. There is either a bug here or limitation of the sdk. Does anyone have any experience or insight into this issue?</p><p>EDIT</p><p>I found the solution. It actually had to do with padding that was in the root of my Tabview. For more checkout my answer <a href=""http://stackoverflow.com/questions/3576812/admob-ad-never-displays-in-view/3721410#3721410"">here</a></p>","413575","","413575","","2010-09-15 20:33:46","2010-12-22 17:52:14","Admob ads will not display when placed inside a tabview","<android><listview><admob><android-tabhost>","1","0","","",""
"3705711","1","3706706","","2010-09-14 02:21:44","6","3969","<p>Hi AllThis should be simple but I can't find any info on this...</p><p>I simply want to read the package value in the android manifest...</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""THIS""</code></pre><p>the reason is simple I have to call context.getResources().getIdentifier(...)and I need the package.</p><p>since this code will be reused in other apps I want to make it fool proof when I export it and therefore not have to change the value each time.</p><p>anybody knows how to do this ? </p>","440336","","","","","2010-09-14 06:58:28","Getting Package string from Android manifest","<android><android-manifest>","2","0","1","",""
"3705748","1","3723477","","2010-09-14 02:35:36","0","999","<p>Hi I want to make VCard manager in android for 1.5 and above . This application will be able to perform following functions:1 <strong>Send and receive contact</strong> . I want that when i send a contact to any mobile it should get the save option to save the contact and if some send me a business card then i should be able to save it in my contacts.   </p><p>Can you please suggest me how to do it. Is there any particular format for sending a VCard . For eg in nokia phones we are able to send a contact and its details(email etc) in form of business card and the other person can save it . </p><p>Can the same thing be achieved in android ?</p><p>RegardsGaurav Gupta</p>","1484525","","1484525","","2010-09-14 02:47:22","2010-09-16 03:24:31","vcard manager in android","<android><android-sdk-1.6><android-contacts>","1","2","1","",""
"3705809","1","3706679","","2010-09-14 02:56:40","2","4973","<p>I am trying to add an animated spinner <strong>inside</strong> a EditText view to the right. And programmatically show/hide it.</p><p>I have created the animated spinner by introducing a linear interpolation rotation:</p><p>*<strong>res/anim/rotate_forever.xml*</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;rotate    xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromDegrees=""0""    android:toDegrees=""360""    android:pivotX=""50%""    android:pivotY=""50%""    android:repeatCount=""infinite""    android:interpolator=""@anim/linear_interpolator""    android:duration=""1200"" /&gt;</code></pre><p><em><strong>res/layout/main.xml</em></strong></p><pre><code> &lt;LinearLayout android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:paddingRight=""6dip""      android:paddingLeft=""6dip""      android:orientation=""horizontal""       android:background=""@drawable/header_gradient"" &gt;  &lt;EditText android:id=""@+id/search_text""       android:layout_height=""fill_parent""       android:layout_width=""fill_parent""       android:layout_weight=""1""       android:singleLine=""true""       android:focusable=""true"" /&gt;  &lt;ImageView android:id=""@+id/search_spinner""      android:gravity=""center_vertical|right""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:src=""@drawable/spinner_black""/&gt; &lt;/LinearLayout&gt;</code></pre><p>The way I trigger an animation is programmatically which works, I see the EditView on the left and the ImageView spinning on the right (because I have no idea otherwise)</p><pre><code>ImageView searchSpinner = (ImageView) findViewById(R.id.search_spinner);Animation spinnerAnimation = AnimationUtils.loadAnimation(this, R.anim.rotate_forever);searchSpinner.startAnimation(spinnerAnimation);</code></pre><p>My questions are this:</p><ol><li><strong>How can I place the ImageViewinside the EditText on the farright. So it will appear inside notoutside.</strong> (I thought I can just placea android:drawableRight, but thatdidn't work.</li><li><strong>How can Ihide/show the ImageView (spinner),</strong> Itried setting the View'sinvisibility, by doing<code>searchSpinner.setVisibility(View.INVISIBLE);</code>but that didn't work.</li></ol><p>Thanks, if you have any better ideas how to approach this, I am listening :)</p>","130515","","","","","2013-05-06 06:29:48","Android: How to place an animated image inside an EditText that we can show and hide","<android><android-widget>","3","0","1","",""
"3706019","1","3707684","","2010-09-14 03:54:47","3","3046","<p>I am having a weird issue. I have an ArrayAdapter which I am sorting. This displays properly on my screen, however when I check the actual data source, the contents have not been sorted. How can I ensure that sorting my ListAdapter will also sort my data source?</p><pre><code>Collections.sort(quotes, new PercentChangeComparator()); //sort my data source (this isn't necessary)quotesAdapter.sort(new PercentChangeComparator()); //sort my ListAdapterToast toast = Toast.makeText(getApplicationContext(),quotes.get(0).getSymbol(), Toast.LENGTH_SHORT);toast.show(); //this shows that my data source hasn't been updated, even though my ListAdapter presents my ListView in the correctly sorted order.</code></pre><p>For example:If my data source is <code>[10,9,1,20]</code></p><p>after sorting my ListView will show <code>[1,9,10,20]</code></p><p>but the data source will still be <code>[10,9,1,20]</code></p><p>How can I resolve this?</p>","19875","","19875","","2010-09-14 04:07:10","2010-09-14 09:58:17","Sorting my ArrayAdapter doesn't change my data source","<java><android><sorting><android-arrayadapter>","1","0","1","",""
"3706025","1","","","2010-09-14 03:56:14","1","3454","<p>I am using WebView in an ActivityGroup and it will throw an exception if WebView show Dialog and complain the activity is not valid. But it's okay if I set the context of the WebView to the TOP activity. So I wish to know how to set the context in the layout xml ?</p>","446965","","244296","","2010-09-14 04:58:23","2011-01-25 13:24:43","Android : how to set context to a view in layout xml?","<android><layout><webview><context>","2","0","","",""
"3706235","1","","","2010-09-14 05:04:57","0","319","<p>for example,in a website or software on the pc,you could write some news or other things,and then it will update in your android</p><p>is there any example of this,or tutorial related about it</p>","415712","","127880","","2013-02-17 18:15:24","2013-02-17 18:15:24","How to write message to client from server","<android>","1","1","","",""
"3706370","1","3711032","","2010-09-14 05:45:21","7","13314","<p>In my onCreate() I do this check:</p><pre><code>//// check if we have a PDF viewer, else bad things happen//Intent intent = new Intent(Intent.ACTION_VIEW);intent.setType(""application/pdf"");List&lt;ResolveInfo&gt; intents = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);if (intents == null || intents.size() == 0) {       // display message then...       finish();}</code></pre><p>On my HTC Desire, this doesn't return a match, even though I have Adobe's PDF viewer. An answer to this question <a href=""http://stackoverflow.com/questions/2916108/android-open-a-pdf-from-my-app-using-the-built-in-pdf-viewer"">http://stackoverflow.com/questions/2916108/android-open-a-pdf-from-my-app-using-the-built-in-pdf-viewer</a> mentions that Adobe may not have any public Intents, so the above check will obviously return nothing.</p><p>Can anyone verify whether you should be able launch Acrobat from an intent, or is there some other method or PDF viewer to use.</p><p>The actual use case is downloading copies of invoices and storing them on local storage using code such as:</p><pre><code> URL url = new URL(data); InputStream myInput = url.openConnection().getInputStream(); FileOutputStream fos = openFileOutput(fname, Context.MODE_WORLD_READABLE); // transfer bytes from the input file to the output file byte[] buffer = new byte[8192]; int length; while ((length = myInput.read(buffer)) &gt; 0) {    fos.write(buffer, 0, length);    progressDialog.setProgress(i++); } fos.close();</code></pre><p>and then to show</p><pre><code>// read from disk, and call intentopenFileInput(fname);   // will throw FileNotFoundExceptionFile dir = getFilesDir();       // where files are storedFile file = new File(dir, fname);   // new file with our nameIntent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));intent.setType(""application/pdf"");startActivity(intent);</code></pre>","428216","","","","","2010-09-14 16:46:39","Show PDF in Android","<android><pdf>","1","0","3","",""
"3706512","1","","","2010-09-14 06:17:21","0","385","<p>I'd like to bring out an Android app in the near future, so I was wonderinghow to support a couple of funcitonalities I have got used whilstdeveloping for J2ME and iPhone</p><ul><li>first the versioning. With J2ME (using NetBeans as IDE) I had theoption to auto-increment the softwwares version every time I compiledit. I was wondering if something like this is available for Eclipseand if so how to use it ?</li><li>secondly a common code base. Is it possible to have a common codebase for several projects ? For example I might have a game whichactually uses the same code but needs different graphic resources. I'dhate to have a different project for every game/app and have tomanually edit every project's source every time I want to submit a newcode-change. Any solution for  this ?</li></ul><p>Thanks in advance for every kind of help/hints/tips ! </p>","162147","","","","","2010-09-14 12:19:53","Versioning and common code-bases with Eclipse","<android><eclipse><versioning><codebase>","1","1","","",""
"3706515","1","3708997","","2010-09-14 06:18:20","4","5698","<p>I have searched alot on JSON Parsing in Android, but couldn't quite convinced. Actually got a brief idea but not so clear yet regarding JSON Parsing.</p><p>How to implement the JSON Parsing in the Application?</p>","422859","","92837","","2011-10-20 09:04:33","2014-04-01 14:53:04","JSON Parsing in Android","<android><json><parsing>","7","0","1","",""
"3706678","1","3707135","","2010-09-14 06:52:20","2","3821","<p>m trying fetch all photos from perticular album from facebook in android , i am using facebook android sdk to do the task but the problem is , i don't know what url request is required to access the photos inside album ?</p>","405383","","","","","2012-11-22 14:14:21","fetch photos from facebook album in android","<android><facebook>","2","0","2","",""
"3706786","1","","","2010-09-14 07:15:38","2","1363","<p>I am trying to get a quite simple openGL ES 1 program run a smooth solid 60fps on a couple devices out there, and I get stuck on HTC desire. The phone itself is quick, snappy, powerful, and overall a breeze to use ; however, I can't seem to display <em>anything</em> fullscreen at 60fps with OpenGL. After getting stuck for a long time with my app, I decided to make a test app with code right out the sample code from the documentation.</p><p>Here is what I am doing. Simple initialization code with GLSurfaceView. I have three versions of onDrawFrame, all dead simple. One is empty. One contains only glClear. One contains just enough state to only draw a fullscreen quad. Trace times before, and after. There is no view other than my GLSurfaceView in my program. I can't explain the times I get.</p><p>In all cases, the onDrawFrame function itself always finishes under 2ms. But very often, onDrawFrame does not get called again before 30~40ms, dropping my frame rate all the way to 30fps or less.I get around 50fps with an empty onDrawFrame, 45 with glClear and 35 with a quad.The same code runs at 60 fps on the HTC Magic, on the Samsung Galaxy S, on the Sharp ISO1. Sony Experia X10 caps at a solid 30fps because of its screen. I have been doing much more complicated scenes at a solid 60fps on the HTC Magic which is <em>very</em> underpowered compared to the Desire. I don't have a Nexus One in handy to test.Sure, I except buffer swapping to block for a couple milliseconds. But it just jumps over frames all the time.</p><p>Trying to find out what the phone is doing <em>outside</em> of the onDrawFrame handler, I tried to use Debug.startMethodTracing. There is no way I can get the trace to reflect the actual time the phone spends out of the loop.At the end of onDrawFrame, I use startMethodTracing then save the current time (SystemClock.uptimeMillis) in a variable. At the start of the next one I Log.e the time difference since the function last exited, and stopMethodTracing. This will get called over and over so I arrange for stopping once I get a trace for an iteration with a 40+ ms pause.The time scale on the resulting trace is under 2ms time, as if the system was spending 38ms outside of my program.</p><p>I tried a lot of things. Enumerating EGL configs and try them all one after the other. Just to see if it changed anything, I switched to a render when dirty scheme requesting a redraw at each frame. To no avail. Whatever I do, the expected gap of 14~16ms to swap buffers will take 30+ms around half the time, and no matter what I do it seems like the device is waiting for two screen refreshes. ps on the device shows my application at around 10% cPU, and System_server at 35%. Of course I also tried the obvious, killing other processes, rebooting the device... I always get the same exact result.</p><p>I do not have the same problem with canvas drawing.</p><p>Does anyone know why the Desire (and afaict the Desire only) behaves like this ?</p><p>For reference, here is what my test code looks like :</p><pre><code>public class GLTest extends Activity {      @Override      protected void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          mGLView = new GLSurfaceView(this);          mGLView.setRenderer(new ClearRenderer());          setContentView(mGLView);      }      @Override      protected void onPause() {          super.onPause();          mGLView.onPause();      }      @Override      protected void onResume() {          super.onResume();          mGLView.onResume();      }      private GLSurfaceView mGLView;  }  class ClearRenderer implements GLSurfaceView.Renderer {      public void onSurfaceCreated(GL10 gl, EGLConfig config) {}      public void onSurfaceChanged(GL10 gl, int w, int h) { gl.glViewport(0, 0, w, h); }      long start;      long end;      public void onDrawFrame(GL10 gl)      {      start = System.currentTimeMillis();      if (start - end &gt; 20)          Log.e(""END TO START"", Long.toString(start - end));      //        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);      end = System.currentTimeMillis();      if (end - start &gt; 15)          Log.e(""START TO END"", Long.toString(end - start));      }  }  </code></pre>","440355","","387076","","2012-05-12 20:19:30","2012-12-09 16:54:05","HTC Desire specific OpenGL ES 1 frame rate - can't get it right","<opengl-es><android>","2","0","","",""
"3706790","1","3706807","","2010-09-14 07:17:02","0","3954","<p>How to read and write strings in text file in android which is kept in raw folder and also how to clear contents of that file in android?</p><p>I have done this way and my ""temp.txt"" file is in /raw folder. But i am not getting any output in file. Also I am not getting any error for this. </p><pre><code>       FileOutputStream fos = openFileOutput(""temp"", Context.MODE_APPEND);                 fos.write(""Example Text in a file"".getBytes());        fos.flush();        fos.close();</code></pre>","363503","","363503","","2010-09-14 12:15:09","2010-09-15 02:54:01","How to ReadWrite into textfile in android?","<android><file>","2","0","0","",""
"3706821","1","3707884","","2010-09-14 07:23:25","1","3043","<p>I want to Parse the XML Response in my Application using a SAX PArser, I don't know how to do that, So Can anybody please giude me to the right path.</p><p>An example with a little coding or a link will be OK.Thanks,david</p>","422859","","","","","2010-09-14 10:06:53","Parsing the XML Response in an Android Application","<android><xml><xml-parsing>","2","0","","",""
"3706837","1","","","2010-09-14 07:26:44","2","1153","<p>... like ""Swype settings"" in <a href=""http://i.stack.imgur.com/q8nP2.png"" rel=""nofollow"">this picture</a>.  Been searching for hours on how to do this.  Going to go insane.  Help appreciated.</p>","447068","","49246","","2010-11-13 10:40:12","2011-06-04 15:32:31","I'm making an Android IME. How do I add a ""Settings"" list item in the ""Language & Keyboard"" settings screen?","<android><input><keyboard><ime><android-input-method>","2","0","3","",""
"3706913","1","3709725","","2010-09-14 07:41:37","3","7245","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3579693/android-tutorials"">android tutorials</a>  </p></blockquote><p>Can you please share a good Android tutorial with step by step basic programs. </p>","246963","","3171","","2010-09-14 09:53:24","2011-01-18 03:32:12","Recommend a good Android tutorial with Step by Step examples","<android><mobile>","5","0","4","2011-12-18 07:10:16",""
"3707016","1","","","2010-09-14 07:57:22","0","348","<p>Given i have compiled linux exe file in my resources/raw directory.Can i execute it using Process.execute(""./resources/raw/filename"") or i have to have special permissions (like ROOT or smth) ?</p>","446142","","","","","2010-09-14 08:03:27","security - Process.execute() on android","<android><security><process><execute>","1","0","","",""
"3707180","1","","","2010-09-14 08:21:52","2","816","<p>Is it possible to read an audio stream during (GSM) phone call? I would like to write an encoding application, and I do not want to go with SIP&amp;VoIP. Thank you.</p>","447106","","","","","2011-07-04 14:19:47","Read an audio stream during (GSM) phone call","<android><audio><gsm>","1","0","2","",""
"3707251","1","3707649","","2010-09-14 08:35:47","0","1689","<p>I am developing form design for share image through email,so i am developing  form for compose mail,i want to display some image in edit text dynamically ,how can i add image in edit text dynamically?</p>","410757","","","","","2011-02-03 14:46:32","How can i adding image on edittext dynamically?","<android>","2","0","","",""
"3707256","1","","","2010-09-14 08:36:29","0","8780","<p>I am trying to read a file ""words.txt"" from a resource. It is a very simple, but large (2 MB), text file that I want to read line by line. I have put the file into /res/raw/words.txt, and try to open it with the following code:</p><pre><code>    try     {           BufferedReader in =             new BufferedReader(            new InputStreamReader(getResources().openRawResource(R.raw.words)));        String line=in.readLine();        T.append(line); T.append(""\n"");        in.close();    }    catch (Exception e) { T.append(e.toString()); }</code></pre><p>However, I get a java.io.IOException. This is not a ""resource not found"" exception, so the resource is opened correctly, but the readLine() produces the error.</p><p>I tried using the InputStream itself, with the result that read() produces -1, which stands for EOF, as if the file was empty.</p><p>Any help for me?</p><hr><p>Till now I am still splitting up long files. So this is the best answer I can give. Anyone a better idea?</p>","447111","","59303","","2013-05-15 20:28:39","2014-01-25 00:08:04","Read text file as resource","<android>","2","0","","",""
"3707690","1","3759839","","2010-09-14 09:39:04","2","2042","<p>For a fest at my college, we are planning a quiz contest.<br/>For the buzzer round, I was thinking of writing 2 app for android (we have a few handsets), one for the quiz master and the other for the contestants <br/>The contestants will be connected to the quiz master through bluetooth.</p><p>After reading the question, the quiz-master clicks a button in his/her app, the button in the contestant apps will be enabled for X seconds. As soon as a contestant clicks his/her button, the quiz master's app will flash the name of that contestant.</p><p>My questions:</p><p>Is it even possible to have multiple connections and accept concurrent (or multiplexed) messages from them in bluetooth (something similar to select() in unix/c)?</p><p>If possible, where should I look for any examples? What kind of problems will I face trying to develop this (I know reliability is an issue here) and how to avoid them?</p><p>I had tried this on laptops before and failed. But maybe I gave-up very early. Please help.</p><p><B>EDIT:</B><br/>I gave-up the project (too many connection drops). I'm keeping the question open though.</p>","432622","","432622","","2010-09-22 08:28:57","2010-09-22 10:20:04","Bluetooth concurrent connections","<android><bluetooth>","2","4","1","",""
"3707694","1","3708079","","2010-09-14 09:39:38","7","1400","<p>How large can be the database of my Android app? Is there a limit?</p><p>For performance reasons, I don't want to store the database on the SD card.</p>","226958","","","","","2010-12-14 19:38:43","Max size of an Android app's in-memory SQLite database?","<android><sqlite>","1","0","1","",""
"3707744","1","","","2010-09-14 09:45:41","1","810","<p>When the user zooms my MapView, I want the my markers (OverlayItems) to zoom too (during the animation!). After the animation they would return to normal size. This is how markers behave in Google Maps. In MapView, OverlayItems in ItemizedOverlay have always the same size even during the zoom animaion, which looks odd.</p>","243225","","","","","2011-02-03 03:14:02","Map markers in MapView - scale them in the zoom animation","<android><google-maps>","1","0","","",""
"3707764","1","3707926","","2010-09-14 09:48:20","1","2713","<p>i want to send email from my application,how can write code for send email from my application,have any setup for email?,anybody knows,please give sample code for me..</p><p>Thanks All</p>","410757","","410757","","2010-09-14 10:27:36","2010-09-14 15:01:36","How to send email from android using java mail","<android>","1","0","3","",""
"3707788","1","","","2010-09-14 09:51:59","0","823","<p>My Android app lets users write <code>HTML</code> fragments.</p><p>WYSIWYG would be nice, but is there a <a href=""http://en.wikipedia.org/wiki/WYSIWYG"" rel=""nofollow"">WYSIWYG</a> widget available for the Android UI?<br>Or do you know a JavaScript-based WYSIWYG component that works in an Android <code>WebView</code>?</p><p>Preferably usable in an Open Source app. Ideally Open Source itself.</p>","226958","","226958","","2010-09-14 11:29:30","2011-04-04 11:32:19","Wysiwyg component to use inside my Android app?","<android><wysiwyg>","1","0","","",""
"3707797","1","3711985","","2010-09-14 09:53:19","46","12978","<p>I am unable to find out this information in the db file. where does exactly android store database version info?</p>","195802","","19746","","2010-09-14 10:08:01","2013-09-12 05:55:15","where does android store sqlite database version?","<android><database><sqlite>","1","0","8","",""
"3707870","1","3707891","","2010-09-14 10:05:08","1","311","<p>I wish to execute the following query on my application'sSQliteDatabase.</p><pre><code>String sql = ""Select col_1,row_id from Table1 where row_id IN(Selectrow_id from Table2 where key = 'key')"";</code></pre><p>I am using the <code>rawQuery</code> function of the <code>SQLiteDataBase</code> class for thesame. The problem is when the inner query returns 0 objects the queryruns and returns 0 results. But when the inner query returns a Set, thequery is not executed.</p><p>Can we have nested queries like these in rawQuery? What is it that Iam missing here?</p><p>Please help.</p><p>Thanks. </p>","236128","","","","","2010-09-14 10:07:45","SQLite: ""IN"" comparison question","<android><sqlite3>","1","0","","",""
"3707880","1","","","2010-09-14 10:06:15","7","13729","<p>when I'm using the Android emulator I can do ""adb logcat"" to see output messages (log / system.out.println) originated from my code. It also shows the stack trace of exceptions which happen during execution.</p><p>But, when I'm using a real phone, ""adb logcat"" does not do / show anything. </p><p>I also tried ""adb -d logcat"" which also does not display anything.</p><p>Is there any way to get it working with the real phone? </p><p>Thanks.</p><p><strong>UPDATE:</strong></p><p>I just tried  ""adb -s ? logcat"" ('?' is the serial number of the device) and also got no results.</p><p>I tried another ""adb"" command to see if anything was working: ""adb -s ? bugreport"". This printed a lot of stuff. Example: ""Memory Info"", ""CPU Info"" and some Java specific things. So it seams that some stuff is working.</p>","425749","","425749","","2010-09-21 14:20:57","2012-11-27 15:11:02","Using adb logcat with a real phone (and not the emulator)","<android><adb><logcat>","8","0","3","",""
"3707923","1","3829582","","2010-09-14 10:13:22","21","20486","<p>I can't beleive there's no easy way to do such a basic thing like this... I want to show a popup/baloon (a LinearLayout) after user clicks on a map marker (something smilar to what is in Google Maps app). It should move with the map, when the user scrolls the map. What is the best way to do this?</p><p>One idea is to have the LinearLayout in my Activity's root layout and show it when needed. But how to make it move with the map?</p><p>Another way to do that may be to create an Overlay that draws the LinearLayout in onDraw and gives the layout touch events. Is this possible?</p>","243225","","","","","2011-01-31 07:31:36","Show popup above map marker in MapView","<android><google-maps>","2","0","21","",""
"3708030","1","","","2010-09-14 10:31:06","0","344","<p>I am new to android.You have seen When u r playing a video in android or in any phones the video controller like play,pause will disappear automatically when the video is running.once we touch the screen only the media controller will come to visible mode.i just what some guide to do this in my application.Please Help me out.Thanks in advance...</p>","366916","","","","","2010-09-14 12:03:02","Android-Media Player","<android>","1","0","","",""
"3708058","1","3708835","","2010-09-14 10:34:49","1","774","<p>I have a layout which contains a <code>TextView</code>. The content of the <code>TextView</code> might change on runtime. (discussed on a different issue here: <a href=""http://stackoverflow.com/questions/3683727/layout-with-dynamic-position"">Layout with dynamic position</a> )I can position the layout by drag&amp;drop. If the size of the layout doesn't change, the position stays, but as soon as the size of the layout changes (because more text inside the <code>TextView</code>) the position is reseted.I use the <code>layout(left, top, right, bottom)</code> to position the layout.</p><p>Now I don't know where I should add my <code>layout()</code> call to make sure it stays at the right position...</p><p>Here is my class</p><pre><code>public class TextNoteOverlay extends FrameLayout implements OverlayView {    private TextView mNoteText;    private LinearLayout mLinearLayout;    public static int mX = 0;    public static int mY = 0;    public static int mStartX = 0;    public static int mStartY = 0;    public boolean mShow;    private Rect mNoteRect = new Rect();    public TextNoteOverlay(Context context, AttributeSet attrs) {        super(context, attrs);        LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        li.inflate(R.layout.textnote, this);        mNoteText = (TextView) findViewById(R.id.textnote_content);        mLinearLayout = (LinearLayout) findViewById(R.id.textnote_layout);        setOnTouchListener(new OnTouchListener() {            @Override            public boolean onTouch(View v, MotionEvent event) {                mLinearLayout.getHitRect(mNoteRect);                if (mNoteRect.contains((int) event.getX(), (int) event.getY())) {                    if (event.getAction() == MotionEvent.ACTION_DOWN) {                        mStartX = (int) event.getX() - mLinearLayout.getLeft();                        mStartY = (int) event.getY() - mLinearLayout.getTop();                        return true;                    }                    mX = (int) event.getX() - mStartX;                    mY = (int) event.getY() - mStartY;                    mLinearLayout.layout(mX, mY, mX + mLinearLayout.getWidth(), mY + mLinearLayout.getHeight());                    return true;                }                return false;            }        });    }    @Override    public void hide() {        mShow = false;        setVisibility(View.GONE);    }    @Override    public boolean isVisible() {        return mShow;    }    @Override    public void setContent(Object content) {        if (content != null &amp;&amp; content instanceof Content) {            Content noteContent = (Content) content;            if (noteContent.getText() != null) {                mNoteText.setText(noteContent.getText());            } else {                mNoteText.setText("""");            }        }        mNoteText.invalidate();        mLinearLayout.invalidate();    }    @Override    public void show() {        if (mNoteText.getText().toString().length() &gt; 0) {            mShow = true;            setVisibility(View.VISIBLE);        }    }}</code></pre><p>My layout</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@android:color/transparent""&gt;    &lt;LinearLayout android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:background=""@drawable/postit""        android:id=""@+id/textnote_layout""&gt;        &lt;TextView android:id=""@+id/textnote_content""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:maxWidth=""200dp""            android:maxHeight=""200dp""            android:minWidth=""100dp""            android:minHeight=""100dp""            android:singleLine=""false""            android:layout_margin=""5dp""            android:textColor=""#000000"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","180538","","1806193","","2013-01-17 12:53:52","2013-01-17 12:53:52","Layout should stay at a specific position after content change","<android><layout><position>","1","0","","",""
"3708076","1","","","2010-09-14 10:36:59","1","421","<p>I'm trying to update email address of a contact from phonebook.But I'm not able to update and getting an <strong>empty values error</strong> on :</p><pre><code>    updateValues.put(People.ContactMethods.KIND,android.provider.Contacts.KIND_EMAIL);  updateValues.put(People.ContactMethods.DATA, newEmail);  updateValues.put(People.ContactMethods.TYPE,ContactMethods.TYPE_HOME);  updateValues.put(People.ContactMethods.ISPRIMARY, 1);   quickToast(updateValues.toString());  getContentResolver().update(People.CONTENT_URI, updateValues, People.ContactMethods._ID+""=?"", new String[] {this.personIndex});</code></pre><p>where updateValues is ContentValuesand personIndex is index of person for whom I have to update.and I have also called <strong>updateValues.clear();</strong> before putting al these values.With the same personIndex values I have updated phone number of the contact succesfully.But not able to update email address.</p>","447238","","447238","","2010-11-12 11:37:26","2010-11-12 11:37:26","Updating contact email address android","<android><contacts><android-contentresolver>","0","1","","",""
"3708118","1","3708274","","2010-09-14 10:44:04","3","609","<p>How to make website that should compatibility with desktop browser as well as mobile browser?</p>","1746300","","759866","","2014-02-04 16:06:32","2014-02-04 16:06:32","website mobile compatibility","<java><iphone><android><website>","2","0","1","",""
"3708177","1","","","2010-09-14 10:53:48","2","2190","<p>I've read up quite a bit on the exception thrown while using BaseAdapter, but i can't seem to find an alternative solution:<strong>Make sure the content of your adapter is not modified from a background thread</strong></p><p>What i want to achieve is to keep a copy of a message queue in memory, and use this message queue to populate the BaseAdapter for my ListView. The reason im doing this is that the message queue will keep getting messages from a socket even when the ListView is not currently present (for example a chat window). </p><p>The problem comes when i have the <strong>Activity</strong> with the <strong>ListView</strong> in foreground, <strong>BaseAdapter</strong> binded to the message queue's data, and a message comes in the socket. Adding the new message into the queue will throw the exception mentioned above. Unless i pre-populate my <strong>BaseAdapter</strong> with the message queue (as in the BaseAdapter having its own message queue) and updating both of them when a new message come in, i can't really find a way around this issue.</p><p>I don't really want to double up the effort on keeping those 2 queues up-to-date like this, surely there is a better way of doing this? Send broadcasts around doesn't work either because of the potential delay in the adapter serving a scroll and the notifyDataSetChanged call is made.</p>","377844","","","","","2012-11-01 18:42:40","Android: Modifying adapter content from a background thread","<android><listview><activity>","2","2","","",""
"3708262","1","3724816","","2010-09-14 11:04:09","1","2304","<p>From the Android SDK and AVD Manager it is possible to add an extra Add-on Site URL. </p><p>I'd like to have some starting point or documentation about developing and distributing add-ons so I can distribute an SDK for my own target device.</p>","447276","","","","","2010-12-03 22:24:27","Add custom target to Android SDK and AVD Manager","<android><sdk>","1","2","","",""
"3708282","1","5943001","","2010-09-14 11:07:32","14","5865","<p>I want to access open API through ajax in mobile application, its work fine in iphone but does not working in Android phonegap application:</p><p><code>returning error-&gt;""error message-null,typeerror-Result of expression 'data'[null] is not an object and error status-parsererror""</code></p><p>Is there any browser setting need to follow.</p><p>I want to call the web service in android-phonegap application:</p><pre><code>$.ajax({     url:'stringURL',     beforeSend: function(x) {           x.setRequestHeader('Authorization','username/pwd');     },     dataType:""xml"",     contentType:'application/xml',     timeout:10000,     type:'POST',     success:function(data) {       alert(data);     },     error:function(XMLHttpRequest,textStatus, errorThrown) {          alert(""Error status :""+textStatus);       alert(""Error type :""+errorThrown);       alert(""Error message :""+XMLHttpRequest.responseXML);     }});</code></pre>","304839","","304839","","2012-12-04 08:26:44","2012-12-04 08:26:44","jQuery's ajax function does not work in Android PhoneGap application","<javascript><jquery><android><ajax><phonegap>","1","16","10","",""
"3708345","1","3708901","","2010-09-14 11:19:22","1","2105","<p>I want to make application which gives me the list of all the devices that are connected to my current network connection.</p><p>For eg. When i press on search button in bluetooth application gives me the list of bluetooth device that are in range , Similarly i need to develop application in when when i click on search button then it should able to give the list of all the devices that are connected to my network.I am familiar with the Networkmanager and the NetworkInfo Api. </p><p>If u have any idea how can i do this,please guide me.</p><p>Thank you   </p>","1386533","","1386533","","2010-09-14 11:34:59","2012-04-19 10:57:27","Android: Findout list of devices connected to network","<android>","2","0","","",""
"3708353","1","3708388","","2010-09-14 11:20:36","0","350","<p>How can I achieve the following layout in Android?</p><p>What I would like, is to have the 3 blue boxes top aligned in their view, and then I'd like to have the red box centered underneath the blue boxes, but so that when I animate the red box up, it slides underneath the blue box.</p><p>I have tried placing the blue and red boxes in different layouts, but as soon as I animate the red box up, if it goes outside the border of its layout, it disappears (I don't want the red box's layout to clip the red box, I want the red box to slide under the blue box so that the blue box occludes the red box.)</p><p>I have also managed to create this layout using a series of nested layouts, but because of the draw order, the red box always appears on top of the blue box.  I attempted to use the bringToFront() method, but I found out that this only works on sibling views within the same layout.  Unfortunately I can't get this type of layout while keeping all 4 views within the same layout.  Any suggestions? (also, if anyone has better suggestions for the title of this question I'm all ears)</p><p><img src=""http://i.stack.imgur.com/VHwTc.jpg"" alt=""alt text""></p>","107459","","","","","2010-09-14 11:26:49","How can I achieve this basic layout in android with the proper z-ordering of views","<android><animation><layout><view><z-order>","1","0","","",""
"3708379","1","3709282","","2010-09-14 11:25:49","0","1171","<p>how to show  two dialog  at the  same time? i donot to use Multiple Select at one dialog,thank you.</p>","233618","","","","","2010-09-14 13:24:57","how to show two dialog at the same time?","<android>","2","2","","",""
"3708420","1","3708716","","2010-09-14 11:31:07","-4","3327","<p>Hai dudes,       Cany anyone tell me how to Create a ProgressDialog in Android?</p>","424413","","","","","2010-09-14 14:12:17","Need Help on Creating a ProgressDialog in Android?","<android>","2","0","0","",""
"3708453","1","3709363","","2010-09-14 11:36:04","0","185","<p>I have an Android 1.6 project. Can I directly convert it to 2.0?</p>","441224","","106","","2010-09-14 13:37:49","2010-09-14 13:37:49","Can I convert an Android 1.6 project to 2.0?","<android>","1","0","","",""
"3708471","1","3709555","","2010-09-14 11:38:35","0","522","<p>Well, the question is pretty clear. I wanna grab the form-element and everything inside it from a web site and then load it to my own WebView. I have looked around, but since I'm quite new to parsing overall, I really need help. I've looking at some solutions; but I don't get it. Help is appreciated.</p><p>Thank you in advance and tell me if my question is unclear!</p>","386562","","386562","","2010-09-14 11:43:37","2010-09-14 13:58:39","Parse everything inside <form></form> using Android from HTML code?","<java><android>","1","0","1","",""
"3708583","1","3709039","","2010-09-14 11:52:34","0","391","<p>I found that if I want to use the searchable options using the search key I have to create a content provider. Content provider is used to share data across applications. </p><p>But I do not want to allow access to my content provider (as well as my data) except/outside my own application. I want to use it only for search suggestion. Because my app data is kind of restricted. </p><p>Is there any way to implement local search without content provider? OR is is possible to apply restriction so that except my own app no other app can use my content provider?Thanks.</p>","312627","","1288","","2011-07-19 18:29:40","2011-07-19 18:29:40","Apply access restriction on Content Provider","<android><search><content><provider>","1","0","","",""
"3708588","1","","","2010-09-14 11:53:07","1","1146","<p>Please Help me for getting the selected Item from a ListView. Items for the ListView are getting from a xml file. Elements of the ListView are filled up by the adapter(adpter contains ImageView and textView). I only need the TextView content from the ListView.By using the onItemClick i get only the index of the item.</p><p>Thank You </p>","436765","","","","","2012-07-13 16:19:43","Getting the selected item from a ListView","<android>","2","0","","",""
"3708633","1","","","2010-09-14 11:59:38","0","5765","<p>This is a post to an answer that I could not really find a good solution to.  I searched quite a bit and I couldn't find anything decent. I don't know if the method I'm using is the best way, but it works and i feel that it is a fairly clean solution.</p><p>Were going to make a few assumptions here.  </p><ol><li>that you know what a JSONArray is and have already somehow populated the JSONArray with some data.</li></ol><pre><code>{""result"":    [      {""ACTIVE"":""1"",""ID"":""1"",""MAX_POPULATION"":""1000"",""NAME"":""Server 1"",""URL"":""http://local.orbitaldomination.com/""},      {""ACTIVE"":""1"",""ID"":""2"",""MAX_POPULATION"":""1000"",""NAME"":""Server 2"",""URL"":""http://server2.orbitaldomination.com/""}    ]}</code></pre><p>This is my JSON code that is populated into my JSONArray.</p><ol><li>You have already created a ListActivity with a ListView element inside it, and that you have created a layout. If you need more information on how to do that you can reference to <a href=""http://www.higherpass.com/Android/Tutorials/Creating-Lists-Using-The-Android-Listactivity/"" rel=""nofollow"">Creating Lists Using the ListActivity</a></li></ol><p>Okay, so here is where the real magic is.. </p><pre><code>    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Pretty much ignore this .. it won't have anything to do with the example.    // Your setContentView should be your layout with your list element.    setContentView(R.layout.server_selection);    //psuedo code     //JArrayServers = JSONArray that has my data in it.    //Create a blank ( for lack of better term ) ArrayAdapter    ArrayAdapter&lt;String&gt; servers = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1);    //Loop though my JSONArray    for(Integer i=0; i&lt; jArrayServers.length(); i++){        try{            //Get My JSONObject and grab the String Value that I want.            String obj = jArrayServers.getJSONObject(i).getString(""NAME"");            //Add the string to the list            servers.add(obj);        }catch(JSONException e){        }    }    //Add my Adapter via the setListAdapter function.    setListAdapter(servers);    //Display the listView    ListView lv = getListView();    lv.setTextFilterEnabled(true);}</code></pre><p>I am creating a blank ArrayAdapter from what I can tell.  I then loop though the array getting my string and inserting it into the adapter as I move along.  Finally, at the end of the loop, I am inserting the adapter via the setListAdapter() function.  </p><p>Pretty simple I think, but took a lot of research to come up with this, from a rookie.  I'm sure all you experts out there will have a better way.  If you do, post it somewhere easy to find please!  </p>","447127","","23199","","2011-03-26 03:11:09","2012-01-26 15:13:50","How to get a JSONArray to populate into a ListActivity's ListView","<android><listview>","2","0","2","",""
"3708683","1","","","2010-09-14 12:05:57","0","670","<p>I have implemented the onPreferenceClick(Preference) callback interface</p><pre><code>    public boolean onPreferenceClick(Preference arg0) { if (arg0 instanceof ListPreference){  addListPreferenceEntriesFromStore((ListPreference) arg0, getSharedPreferences(""cfn_preferences"", MODE_PRIVATE)); } else if (arg0 instanceof EditTextPreference){  ((EditTextPreference)arg0).setTitle(""Hallabalooo"");  ((EditTextPreference)arg0).setDialogTitle(""Tjillevipp""); } return true;}</code></pre><p>When I tap the EditTextPreference for the first time the title, in the PreferenceScreen, is changed as expected but the dialog title isn't. The second time I tap the EditTextPreference the dialog title is also updated.</p><p>I experience the same behaviour with the ListPreference. The addListPreferenceEntriesFromStore() method updates the contents of the ListPreference, but the change isn't visible the first time the ListPreference is displayed.</p><p>It seems like changes made to the dialog part of a preference during the context of the onPreferenceClick() callback doesn't show.</p><p>What is it I do wrong here? Or is there a workaround?</p><p>Thankful for any help</p><p>/Mathias</p>","441299","","","","","2011-03-09 19:31:33","How do I change the contents of a preference dialog when it is tapped?","<android>","1","0","","",""
"3708695","1","","","2010-09-14 12:07:43","2","10649","<p>First of all I am completely new to animation on android but would like to include it in my next application. The application will be as follows:</p><p>For example, I will be having 2 layers, each one containing their own data.</p><p>Layer 1 will contain data 1</p><p>Layer 2 will contain data 2</p><p>And layer 1 will be superimposed on layer 2; that is on top of layer 2.</p><p>Layer 1 will be over layer 2 and thus masking/hiding layer 2</p><p>When a button is clicked (with intention to show layer 2), layer 1 will slide out and revealing layer 2. And another button will allow layer 1 to slide back in again.</p><p>Note that I used the word layers to give a general image of what I am trying to achieve. I do not really know which elements are used in animation for android since I did not come across any layout elements that can be superimposed on each over yet.</p><p>Also, how I am thinking it right now is that those so called layers will be in a linearlayout.</p><p>So my question is how can I achieve this?What elements/objects/library should I be using?And of course links to some documentation and tutorials are more than welcomed.</p><p>Thank you.</p>","439002","","","","","2014-03-28 20:51:19","Android sliding effect animation","<android><animation><button><layer><sliding>","2","0","2","",""
"3708737","1","3709285","","2010-09-14 12:13:54","0","589","<p>I had written an simple program in android to show an notification..By click on notification msg i have to go to inbox. I am using the following code.</p><pre><code>Intent notifyIntent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(""content://sms/inbox""));PendingIntent intent = PendingIntent.getActivity(SimpleNotification.this, 0,                     notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);</code></pre><p>I am able to recieve notification but by clicking on notification i am not able to go to inbox..</p><p>Please any help..thanks in advance</p>","399046","","38883","","2010-09-14 12:20:32","2010-09-14 14:30:11","Go to Inbox in Android","<android>","1","1","","",""
"3708823","1","3708873","","2010-09-14 12:25:56","3","2773","<p>I'm pretty new to Android development, but I  have some experience with Java and Eclipse. I'm looking for ways to create re-usable libraries (controls, helpers, ""standard"" activities, etc.) that I could use in my own projects, but that could also be distributed to other developers without disclosing the source code.</p><p>Normally, I'd package the class files into a JAR file and any other developer could add it to the classpath and use the packaged classes.</p><p>How can I do that with Android projects? I've read about Android Library Projects, but as the documentation states they can not be packaged into a JAR, but will be compiled along with the project that references the library project. This means I also have to distribute the source code.</p><p>I've also read <a href=""http://stackoverflow.com/questions/3252552/differences-between-jar-android-library-and-android-library-project"">this post</a>, which asks about the same question but didn't provide a satisfying answer.</p><p>So: Is there a way of compiling and packaging a set of classes and other files (including XML layouts, resources and stuff) and distribute only that package without any source codes so that it can be ""referenced"" and used like a JAR file by any other developer?</p>","117362","","","","","2013-09-17 04:40:47","Create library for Android development?","<android><packages><adt>","3","0","4","",""
"3709009","1","3709053","","2010-09-14 12:50:15","4","19268","<p>i have been trying to set a image on a button using the following code but it doesn't seem to work...i think what i am doing wrong is the path of the image i am using but i tried different paths and it wont work...i have copied my image to the drawable folder in res folder...what am i doing wrong here??</p><pre><code>final Button next = (Button) findViewById(R.id.Button02) ; Drawable d = Drawable.createFromPath(""@drawable/finalarrow1"");  next.setBackgroundDrawable(d);</code></pre>","410451","","","","","2013-01-25 19:53:39","set image on a button in android?","<android><button><android-emulator>","2","0","4","",""
"3709322","1","3709447","","2010-09-14 13:30:53","2","1373","<p>Hey I seem to be having some kind of memory leak issue with my listview. The list view activity is in a tab and each row downloads an image and displays it in an ImageView (tiling it as a backgroiund). I am using a cache similar to droidfu <a href=""http://github.com/kaeppler/droid-fu/blob/master/src/main/java/com/github/droidfu/imageloader/ImageCache.java"" rel=""nofollow"">http://github.com/kaeppler/droid-fu/blob/master/src/main/java/com/github/droidfu/imageloader/ImageCache.java</a></p><p>Everything seems to work fine as I'm completely clearing the memory cache when it gets past 20 items and also completely clearing the disk cache when it gets past 0.5mb just to be safe. The problem occurs when I have a large list of items in the list (say 100) and I keep scrolling back and forth this list as fast as I can. Eventually I get these messages in Logcat:</p><blockquote>  <p>Heap Massage needed (59892-byte external allocation too big)</p>    <p>Full GC (don't collect SoftReferences)</p>    <p>Clamp target GC heap from 16.277MB to 16.000MB</p>    <p>Try and trim Heap Source</p>    <p>Full GC (collect SoftReferences)</p></blockquote><p>And a whole bunch of those which lead to a force close. I'm not too sure what the problem is or how to go about fixing it :S</p><p>Thanks!</p><p>Here is the full log: <a href=""http://pastebin.com/MghMdbxS"" rel=""nofollow"">http://pastebin.com/MghMdbxS</a></p><p>Turns out its the problem is with too many AsyncTask/Thread objects being created. I am using the code from <a href=""http://code.google.com/p/android-imagedownloader/"" rel=""nofollow"">http://code.google.com/p/android-imagedownloader/</a> and not sure how to get this fixed...</p>","362476","","157882","","2010-09-15 13:27:16","2010-09-15 13:27:16","ListView Memory leak?","<java><android><memory><listview><caching>","1","2","","",""
"3709466","1","3710113","","2010-09-14 13:48:56","0","821","<p>Hi I am trying to create a Custom View that takes as well as deletes a picture and looks like the following:</p><p><img src=""http://i.stack.imgur.com/gDUW9.png"" alt=""alt text""></p><p>Following operations a view can perform:</p><ul><li>Take a picture (by clicking on the No Image Available sign)   -- works</li><li>Delete a picture  (by clicking on the red cross) -- works</li><li>Preview a picture</li></ul><p>How do I create a listener to find out when the image has been taken by the camera? The location of the image that needs to be taken is known before.</p><pre><code>public class artooPicture extends RelativeLayout {    ImageView preview, delete;    String value = Environment.getExternalStorageDirectory() + ""/99006796""            + ""_"" + "".jpg"", suffix;    boolean clicked = false;    public artooPicture(Context context) {        this(context, null);    }    public artooPicture(Context context, AttributeSet attrs) {        this(context, attrs, 0);    }    public artooPicture(Context context, AttributeSet attrs, int defStyle) {        super(context, attrs, defStyle);        ((Activity) getContext()).getLayoutInflater().inflate(R.layout.picture,                this, true);        delete = (ImageView) findViewById(R.id.scan_delete);        preview = (ImageView) findViewById(R.id.scan_preview);        File f = new File(value);        if (f.exists()) {            clicked = true;            preview.setImageDrawable(BitmapDrawable.createFromPath(value));        } else {        }        delete.setOnClickListener(deleteListener);        preview.setOnClickListener(previewListener);    }    View.OnClickListener deleteListener = new OnClickListener() {        @Override        public void onClick(View v) {            if(clicked){                File f = new File(value);                f.delete();                preview.setImageResource(R.drawable.no_image);            }            clicked = false;        }    };    View.OnClickListener previewListener = new OnClickListener() {        @Override        public void onClick(View v) {            Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);            i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(value)));            getContext().startActivity(i);        }    };}</code></pre>","356580","","","","","2010-09-14 15:10:35","Custom View that takes & delete a Camera Picture","<android><view><camera>","2","0","1","",""
"3709505","1","4614905","","2010-09-14 13:53:39","0","1356","<p>I want to build an XMPP client on android, I've got it running perfect with authentication using Digest-MD-5, however when I try to convert it to X-FACEBOOK-PLATFORM it keeps failing. </p>","311001","","311001","","2011-01-10 09:41:50","2011-06-29 09:27:35","Facebook chat - X-FACEBOOK-PLATFORM authentication","<android><facebook><xmpp>","2","1","0","",""
"3709607","1","3710197","","2010-09-14 14:03:48","2","3129","<p>I'm having Facebook for Android on my phone which automatically synces the FB profile pictures of the people in my contact list to my phone.</p><p>I'd like to use those pictures within my app where I access <code>ContactsContract.PhoneLookup</code>. </p><p>Do I really need the Facebook SDK to do that? I guess not, but I cannot find any evidence of the pictures being saved somewhere around <code>ContactsContract</code></p>","419501","","114066","","2010-12-03 09:53:40","2011-05-07 19:26:16","How to use the contact pictures synced by Facebook for Android","<android><facebook><image><contactscontract>","2","0","2","",""
"3709684","1","3710356","","2010-09-14 14:12:06","2","2379","<p>Right now, I get my Models in a nice object-oriented form. In order to bind them to my List, I have to use the listAdapter. Can I only fill this listAdapter with stupid ArrayLists? Because that means, I have to iterate over my ModelCollection and pull all the data out of my Models again. </p><p>So, I detach my data from the models and I cant easily refresh the data in my listView, if something chances in the modelCollection (like becoming bigger through new Items / pagination).</p><p>Does a more intelligent way exist, than I use right now? Can I bind my ModelCollection more driectly to the listView? </p><pre><code>    ModelCollection modelCollection = ModelCategory.findAll();    /*     * Prepare Data for Adapter     */    ArrayList&lt;String&gt; itemTitles = new ArrayList&lt;String&gt;();    // Iterate over my ModelCollection and pull all the Data from each Model    for (int i = 0; i &lt; modelCollection.items.size(); i++) {      if (modelCollection.items.get(i) != null) {        // TODO: Cant I bind my Models directly to the List without creating this ArrayList?         itemTitles.add(((ModelCategory) modelCollection.items.get(i)).getTitle());             }    }    /*     * Create Adapter and bind Array     */    adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, itemTitles  );    setListAdapter(adapter);</code></pre><p>One more question aside: How do I have to extend my code, when I want to add small subtitles underneath the title to the list?</p>","433718","","","","","2010-09-14 15:25:58","Android: Bind data to a ListView without preparing ArrayLists for the ListAdapter?","<android><listactivity><listadapter><android-listview><expandablelistadapter>","1","0","","",""
"3709689","1","3709740","","2010-09-14 14:12:34","3","701","<p>I have a table which has an unique key with 2 constraints in it. I want to alter the table such that i can remove one of the constraint in unique field there.</p><p><strong>My current db schema :</strong></p><p><code>CREATE TABLE testtable(test1 TEXT, test2 TEXT, test3 TEXT, test4 TEXT DEFAULT FALSE,UNIQUE (test1,test2))</code></p><p>I already have this table populated with data and do not want to drop and recreate this table in my next release. Is there a way to alter the table's unique field. I did not set a constraint for my this table. </p><p>I want my database schema to be like this after update.</p><p><code>CREATE TABLE testtable(test1 TEXT, test2 TEXT, test3 TEXT, test4 TEXT DEFAULT FALSE,UNIQUE (test1))</code></p>","302328","","302328","","2010-09-14 15:38:37","2010-09-14 15:38:37","Altering table's unique field","<android><sqlite><sqlite3>","1","0","","",""
"3709694","1","3710616","","2010-09-14 14:13:15","3","3557","<p>I want to attach an image with email, that image is stored in <code>/data/data/mypacke/file.png</code>. How can I attach that image file programmatically? What would sample code look like?</p>","410757","","63550","","2010-09-18 12:10:58","2010-09-28 22:52:18","How can I attach an image file in email?","<android>","2","0","2","",""
"3709736","1","3710874","","2010-09-14 14:18:12","0","656","<p>When i am using Graph API of facebook in android ( with facebook android sdk )to access albums m  using following url</p><pre><code>https://graph.facebook.com/me/albums?access_token=XXXXXXXXXXXXXX</code></pre><p>but unfortunately it is returning {""data"":[]}</p><p>other urls like </p><pre><code>  https://graph.facebook.com/me?access_token=XXXXXXXXXXXXXX  https://graph.facebook.com/me/friends?access_token=XXXXXXXXXXXXXX</code></pre><p>are working totally fine.</p><p>so i don't know for what reason its returning {""data"":[]}. I tried accessing my own account on facebook and use example url provided on Graph API &amp; over there if i use following url then its giving me all necessary data. but not working in facebook android sdk </p><pre><code>https://graph.facebook.com/me/albums?access_token=XXXXXXXXXXXXXX</code></pre>","405383","","","","","2010-09-14 16:26:50","returning blank json data while accesing album in facebook","<android><facebook>","1","1","","",""
"3709906","1","3710002","","2010-09-14 14:37:07","1","1500","<p>I'm trying to mimic the layout of the icons in Facebook android app.</p><p><img src=""http://i.stack.imgur.com/eA6sY.png"" alt=""alt text""></p><p>As you can see, this is a 2x3 layout, but if you flip it it becomes 3x2 layout. How to accomplish this?</p>","73010","","","","","2010-09-15 04:17:03","Facebook for Android icons layout","<android><facebook>","1","0","1","",""
"3710080","1","3897933","","2010-09-14 14:53:58","4","1863","<p>I built an Android application that requires OAuth. All was working well using a custom scheme call back which is intercepted by Android.  It seems that Yahoo have changed the goal posts and now the custom scheme is not accepted by Yahoo.</p><p>I am now looking at possible alternate approaches.  My first attempt is to use a normal http scheme and modify my intent filter to intercept the new URL.  I have the following in my AndroidManifest.xml :</p><pre><code>  &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;     &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;     &lt;category android:name=""android.intent.category.BROWSABLE""&gt;&lt;/category&gt;    &lt;data android:host=""www.test.com"" android:scheme=""http""&gt;&lt;/data&gt;   &lt;/intent-filter&gt;</code></pre><p>Where www.test.com will be substituted with a domain that I own. It seems :</p><ul><li>This filter is triggered when I click on a link on a page.</li><li>It is not triggered on the redirect by Yahoo, the browser opens the website at www.test.com</li><li>It is not triggered when I enter the domain name directly in the browser.</li></ul><p>So can anybody help me with</p><ul><li>When exactly this intent-filter will be triggered?</li><li>Any changes to the intent-filter or permissions that will widen the filter to apply to redirect requests?</li><li>Any other approaches I could use?</li></ul><p>Thanks for your help.</p>","294123","","967945","","2013-05-09 09:12:06","2013-05-09 09:12:06","Android intent-filter for http scheme","<android><android-manifest>","1","1","3","",""
"3710151","1","3711200","","2010-09-14 15:03:23","8","6907","<p>Suppose I have code in the onStart() handler of my Service to launch a thread to do some stuff and then call stopSelf().</p><p>stopSelf() gets called before the thread finishes.  What exactly happens?</p><p>I've tested this out myself and my thread continues to execute until it is finished.  Does Android hear the stopSelf() call, but postpone it until the thread is finished?</p><pre><code> @Override public void onStart(Intent intent, int startid) {  new Thread(new Runnable() {      public void run() {        // TODO some long running operation      }    }).start();  stopSelf(); }</code></pre>","406790","","406790","","2010-09-14 18:10:32","2011-12-01 15:21:58","Calling stopSelf() in Service while thread is running","<android><multithreading><service>","2","3","2","",""
"3710222","1","3710314","","2010-09-14 15:10:26","5","5845","<p>I'm following the example here:</p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p><p>Everything works fine.  The first time I click on each tab, the <code>oncreate</code> method for Activity bound to that particular tab is called.  However, subsequent selections of the tab's do not call this oncreate method.  </p><p>I need to be able to execute oncreate (or another method) on the Activity that is bound to each Tab, when that tab is selected.  I know I can use a <code>setOnTabChangedListener</code>, but I am unsure how to get access to the Activity that is bound to the tab, so that I can call the oncreate (or another) method.</p>","447494","","331473","","2011-11-23 19:46:08","2014-02-25 08:46:12","TabHost setCurrentTab only calls oncreate method for Activity in Tab once","<android><tabs>","4","1","","",""
"3710383","1","3878121","","2010-09-14 15:28:50","1","4455","<blockquote>  <p><code>SQLiteOpenHelper.getWriteableDatabase()</code></p></blockquote><p>The error message I receive is:</p><blockquote>  <p>Failed to setLocale() when  constructing, closing the database</p></blockquote><p>The only way I have found to get around it is to clear the application's data cache (i.e. delete all of it's database files) and start over. I would like to know a) Why this is happening and b) What can be done to avoid having to reset the application's data cache.</p>","349179","","244296","","2010-09-14 15:31:26","2010-10-07 01:39:48","Android's SQLiteDatabase: Failing to Open a Writeable Instance of a DB Because Could not setLocale()","<android><sqlite>","1","1","0","",""
"3710727","1","3711685","","2010-09-14 16:10:31","2","940","<p>this is my getView method:</p><pre><code>    public View getView(final int position, View convertView, final ViewGroup parent) {        ViewHolder holder;        if(convertView == null){            holder = new ViewHolder();            convertView = inflater.inflate(R.layout.propviewlistrow, null);            holder.title = (TextView) convertView.findViewById(R.id.propviewlistrow_t1);            holder.content = (EditText) convertView.findViewById(R.id.propviewlistrow_e1);            convertView.setTag(holder);        }        else{            holder = (ViewHolder)convertView.getTag();        }        holder.title.setText(names.get(position));        holder.content.setText(values.get(position));               holder.content.addTextChangedListener(new TextWatcher(){            public void afterTextChanged(Editable s) {                      values.set(position, s.toString());            }            public void beforeTextChanged(CharSequence s, int start,                    int count, int after) {            }            public void onTextChanged(CharSequence s, int start,                    int before, int count) {                    }        });        return convertView;    }}</code></pre><p>But this does not work.The edittexts do not display the proper text, the displayed text switches while scrolling.The next issue is, I have set android:windowSoftInputMode=""adjustPan"" in the manifest.If you click the into the last edittext, the listview won't scroll up enough so that you can see what you are typing.</p>","433732","","244296","","2010-09-14 16:14:43","2010-09-14 18:11:15","Android: Many Edittexts in ListView","<android><listview><edittext>","1","0","","",""
"3710781","1","","","2010-09-14 16:17:11","1","562","<p>I am trying to change the content of the tab header but am struggling. I can see that it is possible to pass a View to the setIndicator() method. I tried this and got a removeParent() warning which I dont understand. Has anyone managed to do this successfully. If so can you explain how you did it please?</p><p>Clive</p>","447549","","","","","2012-12-05 21:45:04","Custom tabs in Android","<android>","2","0","","",""
"3711017","1","3712153","","2010-09-14 16:44:53","0","670","<p>Good day, could you please help me look and this code and tell me what am doing wrong. I have a listview from a Cursor Adapter but when i click on a row, it returns back the row above it and not the target row clicked. which leads to if you click on the first row, it crashes with a ""cursor out of bound exception"". But when i add the c.moveToFirst() just before the intent invocation and i click on the first row, it just does nothing. Please here is the code: </p><pre><code>public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long rowId) {   c = adapter.retrieveRow(rowId); Intent edit = new Intent(this,Item.class); edit.putExtra(DBAdapter.KEY_ID, rowId);edit.putExtra(DBAdapter.NAME, c.getString(c.getColumnIndex(DBAdapter.NAME)));edit.putExtra(DBAdapter.START_DATE, c.getString(c.getColumnIndex(DBAdapter.START_DATE)));startActivityForResult(edit, ACTIVITY_EDIT);}</code></pre><p>and here is the database method that is being called: </p><pre><code>public Cursor retrieveRow(long rowId) { String[] resultColumns = new String[] {NAME,START_DATE};             Cursor row = db.query(true,DATABASE_TABLE, resultColumns, KEY_ID +""="" +rowId, null, null, null, null,null);   if(row != null){             row.moveToFirst();   }    return row;   }</code></pre><p>i tried changing it to a OnListItemSelected() but nothing happened, it did not return anything at all.I am using the new view and bind view method on the cursor adapter. thanks in advance.</p>","447570","","","","","2010-09-14 19:19:38","Cursor not returning current row clicked in android listview","<android>","1","0","","",""
"3711126","1","3711251","","2010-09-14 16:56:44","2","743","<p>I having an issue from my HTTP Post.</p><p>The code I'm using are working (have tested to post data to a guestbook form and it worked).</p><p>Now what I want. I have created two EditText forms, that holds values. I have a submit button there I post this data (like the test I wrote about before), but now I want to post it into a login.php page (that in a normal browser redirects me to the member.php page). </p><p>Although I know the forms are correctly filled in and it successfully posted on the ""test"" site, I wanna get the response from login.php and check if the user is successfully logged in or if it failed, if succeeded -> redirect me to member.php page.</p><p>All I know is this:</p><pre><code>HttpResponse response = httpclient.execute(httppost); </code></pre><p>that executes the command. But how should I achieve the login check? Any further use of the response variable?</p>","386562","","244296","","2010-09-15 12:05:52","2010-09-15 12:05:52","Open WebView with result from Http post","<java><android>","1","0","","",""
"3711161","1","","","2010-09-14 17:01:53","1","1796","<p>I have a widget that when clicked opens an activity from same app as the widget. When the activity is closed/dismissed via a button, the user will see the full app window IF the app was previously open/in memory. Is there a way for the activity to finish and return to the home screen and not to an existing instance of the app?</p><pre><code>Intent i = new Intent(this,RateIt.class);i.putExtra(""com.sporadicsoftware.NetQ.movie_id"",aMovie.title_id);i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET|Intent.FLAG_ACTIVITY_NO_HISTORY|Intent.FLAG_ACTIVITY_CLEAR_TOP);            PendingIntent pendingIntent = PendingIntent.getActivity(context,                    0, i, PendingIntent.FLAG_UPDATE_CURRENT);            updateViews.setOnClickPendingIntent(R.id.movie_one_title, pendingIntent);</code></pre>","447590","","","","","2010-09-14 18:55:36","Android - How to launch an activity from a widget and return to home screen","<android><widget>","1","0","","",""
"3711192","1","","","2010-09-14 17:05:56","1","6462","<p>Im kinda new on developing for Android, and i've only completed apps like - hello world, paint pot etc.</p><p>I know how to design the layout, but when it comes to the ""activity"" I alwats messes things up..</p><p>So now to my question - I'm creating a app to show my school schedule so I have 5 buttons (monday tuesday wednesday etc.)Then when I click each button I want to get to another screen with todays schedule..</p><p>How to I create new screens in an easy way?Be kind</p>","447595","","","","","2010-09-14 17:24:17","Eclipse - ButtonCLick --> new screen with text?","<android><eclipse><htc><legend>","1","0","","",""
"3711288","1","","","2010-09-14 17:18:31","0","796","<p>thanks again for all the help I have received here!</p><p>I have written a Listener that detects when a call has ended.Furthermore I want to detect wheter the receiver picked up or I ended up on the mailbox.</p><p>However, I just can't figure out how to it and can't find anything on the internet (probably searching for the wrong term, as is the case most of the time).</p><p>Help would be much appreciated.</p><p>Thanks again!Chr0n</p>","435128","","","","","2010-11-16 21:57:00","TelephonyManager detect voicemail on outgoing call","<android><broadcast><voicemail>","1","0","3","",""
"3711348","1","","","2010-09-14 17:26:07","4","4646","<p>I am trying to debug an android app on nexus one with an hierarchy viewer. I start hierarchy view on desktop, Under 'Devices', I see my phone, but when I click 'Start Server', I see'version = 2protocol = 2version = 2' on the terminal of when I start hierarchy viewer. </p><p>But nothing else happens, 'Load View Hierarchy' remains disabled.</p><p>Can you please tell me how can I get hierarchy viewer to work?</p>","286802","","1406","","2011-03-29 20:18:59","2011-07-11 12:09:10","How can I run hierarchy view with Nexus One","<android>","3","0","1","",""
"3711712","1","3747229","","2010-09-14 18:14:30","0","4072","<p>I want to have a configurable language settings in my app.</p><p>So, in onCreate of my activity, I call Resources.updateConfigurationwith the new locale.</p><p>However, after onCreate (at some time, I can't find it when), thelocale is set back to the default locale.</p><p>On the code example below, the strings shown in the main layout (asinflated by setContentView) shows the""in"" language version, BUT when I press the menu button, on whichonCreateMenu is called, the strings istaken from the ""en"" (default) locale.</p><p>The log shows this:</p><pre><code> 18337               oncreate  D  { scale=1.0 imsi=525/1 loc=intouch=3 keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=143} 30430        ActivityManager  I  Displayed activity yuku.coba.locale/.CobaLocaleActivity: 266 ms (total 266 ms) 18337        KeyCharacterMap  W  No keyboard for id 65540 18337        KeyCharacterMap  W  Using default keymap: /system/usr/keychars/qwerty.kcm.bin 18337                 onmenu  D  { scale=1.0 imsi=525/1 loc=en_GB touch=3 keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=143}</code></pre><p>Between ""oncreate"" and ""onmenu"", the locale magically changes.</p><p>Please help, I have been tinkering with this with no luck.</p><p>Code snippet:</p><pre><code>   @Override   public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       Configuration c = new Configuration();       c.locale = new Locale(""in"");       getResources().updateConfiguration(c, null);       setContentView(R.layout.main);       Log.d(""oncreate"", getResources().getConfiguration().toString());   }   @Override   public boolean onCreateOptionsMenu(Menu menu) {       Log.d(""onmenu"", getResources().getConfiguration().toString());       new MenuInflater(this).inflate(R.menu.utama, menu);       return true;   }</code></pre>","11238","","","","","2014-02-12 13:14:38","Android user-set Locale always get reset after onCreate?","<android><configuration><locale>","4","2","2","",""
"3711811","1","3711826","","2010-09-14 18:28:40","0","695","<p>I am very new to Android Development. I am trying a sample application and it is generating a button dynamically using Java and it is working fine.</p><pre><code>    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);    btn=new Button(this);    btn.setOnClickListener(this);    updateTime();    setContentView(btn);    }</code></pre><p>This works fine in my emulator. However when i try do with an XML based layout, my app crashes in the emulator.</p><p><code>Main.XML</code> contents</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;Button xmlns:android=""com.testing""    android:id=""@+id/button""    android:text=""""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;</code></pre><p>Code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        btn=(Button)findViewById(R.id.button);        btn.setOnClickListener(this);        updateTime();    }   </code></pre><p>Does anyone know why this simple application is crashing because of the XML layout?Thanx a lot in advance :) </p>","286204","","","","","2010-09-14 18:36:09","Why does this XML-Layout based Android Application crash?","<xml><android><layout><crash>","2","0","","",""
"3711918","1","","","2010-09-14 18:44:33","1","732","<pre><code>Intent emailIntent = new Intent(Intent.ACTION_SEND);Uri U=Uri.parse(""c:/logo.png""); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,""sivafarshore@yahoo.com"");emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""Test"");emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""This is email's message"");emailIntent.setType(""image/png"");emailIntent.putExtra(android.content.Intent.EXTRA_STREAM,U);startActivity(Intent.createChooser(emailIntent, ""Email:""));</code></pre><p>I am using this kind of coding for attach image file,this code sent attach with email,but that attach file dose not contain no image,what can i do for display attach image file.</p>","410757","","244296","","2010-09-14 18:51:36","2010-09-14 18:51:36","how to display attach image from mail","<android>","1","0","","",""
"3711967","1","5013009","","2010-09-14 18:50:14","38","11173","<p>I already have a free app in the Android Market, but I want to add a paid-for version with better features. I can't upload the same up with some changed constants to unlock those features as the Market tells me I already have an app with that package name in the market. </p><p>What's the cleanest way of doing this?</p>","421808","","","","","2014-04-18 20:55:11","Best way to have paid and free version of an Android app","<android>","7","2","21","",""
"3711998","1","","","2010-09-14 18:54:39","1","76","<p>Updated Android SDK tools 7 (for Eclipse, windows 7 32 bits). But Igot some problems:</p><ol><li>Android looks changed some package name, For example, the""android.intent…""was changed to “android.content.intent…”; the“android.permission…” was changed to “android.Manifest.permission…”.If I change the old package name to the new one, the emulator will notwork for the application.</li><li>The tools 7 replaceed some drop-down list selection to Browserselection, for example, the IntentFilter Attributes selection andpermission attributes selection no longer have drop-down listselection instead of a “Browser”.</li></ol><p>Did I make anything wrong? Please help me!</p>","447685","","244296","","2010-09-14 18:56:47","2010-09-14 22:40:44","Some problems for Android SDK tool revision 7","<android>","1","0","2","",""
"3712049","1","3712747","","2010-09-14 19:02:25","9","8556","<p>I'm am working on a basic augmented reality application on Android. What I did so far is detect a square with opencv and then using cvFindExtrinsicCameraParams2() I calculated a rotation and translation vector. For this I used 4 object points, which are just the corners of a square around (0,0,0) and the 4 corners of the square in the image. </p><p>This yields me a pretty good rotation and translation matrix. I also calculated the rotation matrix with cvRodrigues2() since using this is easier than the rotation vector. As long as I use these to draw some points in the image everything works fine. My next step is however to pass these vectors and the matrix back to java and then use them with OpenGL to draw a square in an OpenGLView. The square should be exactly around the square in the image which is displayed behind the OpenGLView. </p><p>My problem is that I cannot find the correct way of using the rotation matrix and translation vector in OpenGL. I started of with exactly the same object points as used for the openCV functions. Then I applied the rotation matrix and translation vector in pretty much any possible way I could think of. Sadly none of these approaches produce a result which is anyway near what I hoped for. So my question is can anyone tell me how to use them correctly? </p><p>So far the ""closest"" results I have gotten, was when randomly multiplying the whole matrix with -1. But most of the time the squares still look mirror inverted or rotated for 180 degrees. So I guess it was just a lucky hit, but not the right approach.</p><p>I hope someone can help, thanks already!</p>","410647","","398460","","2010-11-19 15:19:43","2012-08-22 11:41:57","How to use an OpenCV rotation and translation vector with OpenGL ES in Android?","<android><opengl-es><opencv><augmented-reality>","2","1","9","",""
"3712112","1","3712739","","2010-09-14 19:13:50","13","13856","<p>In my app, user writes a phone number, and I want to find the contact name with that phone number?</p><p>I usually search the contacts like this:<br><code>Cursor cur = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,                null, null, null, null);</code></p><p>But I do this to access all contacts... In this app I only want to get the contact name of the given phone number... How can I restrict the query?</p><p>Or do I have to go trough all contacts and see if any has the given phone number? But I believe that this can be very slow this way...</p>","419921","","","","","2011-11-01 13:28:57","Search contact by phone number","<android>","2","2","8","",""
"3712195","1","","","2010-09-14 19:25:08","1","668","<p>I have a parent activity (as ACTIVITY GROUP) and some child activity of this parent activity (as ACTIVITY).I am just calling child1 now i want to move from child1 to child2 and just want to finish() child1.But when i am calling finish() it is also finishing the parent activity.</p><p>Plz send me a solution for it.</p>","447710","","","","","2010-09-14 20:31:17","Finishing Child Activity from another child activity in android","<android>","1","0","","",""
"3712245","1","3712736","","2010-09-14 19:32:53","3","1712","<p>I have an application and I would like to be able to restart it on the event of an error or a crash/app shutdown.  I am familiar with how to register <code>BroadcastReceivers</code>, use alarms, etc.</p><p>Is there any signal I could intercept that the app sends out when it shuts down?  Or that the OS sends out when any app shuts down?</p>","355663","","244296","","2010-09-14 19:38:05","2010-10-18 12:28:33","Android: BroadcastReceiver to restart killed/crashed app","<android><operating-system><android-intent><broadcastreceiver>","1","0","","",""
"3712360","1","3712459","","2010-09-14 19:52:15","0","4217","<p>Given a horizontal LinearLayout in Android, I'd like to create:</p><p>(1) a textbox which fills nearly the width of the screen, except leaving enough space for...</p><p>(2) a button on the right</p><p>So I create an EditText and a Button and they're both very small.</p><pre><code> &lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt; &lt;EditText android:text=""""    android:id=""@+id/Text01""   android:layout_height=""wrap_content""   android:layout_width=""wrap_content""&gt; &lt;/EditText&gt; &lt;Button android:text=""+""   android:id=""@+id/Button01""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_gravity=""right""&gt; &lt;/Button&gt; &lt;/LinearLayout&gt;</code></pre><p>I can't set the EditText to android:layout_width=""fill_parent"" otherwise it would obliterate the button.  So how to make the EditText expand as much as it can?</p>","46478","","404469","","2010-09-14 19:55:17","2010-09-15 12:37:45","Android layout - making certain objects expandable","<android><android-widget>","1","0","","",""
"3712480","1","","","2010-09-14 20:09:09","0","171","<p>friend's     i have to set an image has background for an linear layout,the background has been set well,but here the problem is the image has been shrinked its appearance.   here my xml code </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:background=""@drawable/directory_bg_new""    android:orientation=""vertical"" android:gravity=""fill_vertical""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt; &lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/myGrid"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:padding=""10dp""  android:verticalSpacing=""10dp"" android:horizontalSpacing=""10dp""  android:numColumns=""4"" android:columnWidth=""60dp"" android:stretchMode=""columnWidth""  android:tag=""@string/temp"" android:gravity=""center""  android:listSelector=""@drawable/corner_orange"" android:layout_weight=""1.0"" /&gt; &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""  android:paddingTop=""8dip"" android:id=""@+id/poweredby""  android:layout_gravity=""center_horizontal"" android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;  &lt;ImageView android:id=""@+id/poweredby1"" android:src=""@drawable/power""   android:layout_width=""wrap_content"" android:layout_height=""15dp"" /&gt;  &lt;ImageView android:id=""@+id/poweredby2"" android:src=""@drawable/i_icon""   android:layout_width=""wrap_content"" android:layout_height=""wrap_content""   android:layout_toRightOf=""@+id/poweredby1"" /&gt; &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>how can i avoid it,what attribute i need to add in the layout not to shrink the original image.thanks in advance.</p>","446136","","","","","2012-02-06 15:14:03","need help to avoid shrinking of actual image while setting has a linearlarlayout backaground","<android>","1","2","","",""
"3712623","1","","","2010-09-14 20:26:19","16","10562","<p>I want to use Adobe Flash in the development of Android applications. But how do I install flash on the emulator so that I can test my software with flash?</p>","447759","","","","","2013-05-22 08:12:13","How can I install adobe flash on the android emulator","<android><flash><swf><android-emulator>","6","0","3","",""
"3712643","1","3741501","","2010-09-14 20:29:01","1","1372","<p>I followed example as <a href=""http://www.androidpeople.com/android-custom-dynamic-listview/"" rel=""nofollow"">http://www.androidpeople.com/android-custom-dynamic-listview/</a></p><p>However I bump into problem applying autoscroll to bottom as</p><pre><code>listview.setTranscriptMode(ListView.TRANSCRIPT_MODE_DISABLED);</code></pre><p>Where should I apply it?</p>","79311","","","","","2010-09-18 11:25:00","Autoscroll to bottom on custom dynamic listview","<android><listview>","1","0","","",""
"3712710","1","3713354","","2010-09-14 20:38:23","18","27459","<p>I'm writing my first app, and I have a question about <code>DatePicker</code>.</p><p>My app requires the user to input a date. The most user-friendly way would be to popup a calendar-like widget that displays the current month like a calendar grid - something like this:</p><p><img src=""http://i.stack.imgur.com/Zwkyl.png"" alt=""enter image description here""></p><p>I want to use that in place of the <code>DatePicker</code> interface - which has Month, Day, and Year fields, each with an up and down button to increment/decrement.</p><p>Is this type of functionality built into any Android widget or view, or would I have to design my own custom component to do this? I figured this would already exist, seeing how much this type of UI is used so frequently in non-mobile apps and web pages.</p><p>Thanks!</p>","447744","","2390083","","2013-11-18 14:12:07","2014-03-05 19:48:31","Android Calendar View for Date Picker","<android><calendar><android-datepicker>","6","1","11","",""
"3712758","1","","","2010-09-14 20:45:18","5","6207","<p>I am trying to exercise a little control over the state of an icon in the status bar.  I want to be able to do the following:</p><ol><li>Keep the iconvisible in the status bar, as longas the app is running, EVEN IF the user chooses to clear the status bar.</li><li>Clear the icon from the status barif the app is exited, even (especially) if it is killed?  I realize I can remove it when the app is exited explicitly, but I want to make sure it goes away if the app is killed.  I have to admit I have not tried this yet.</li></ol><p>I have not been able to get some good info on this, although I have seen apps that appear to be doing this.</p>","447774","","981787","","2012-06-03 12:46:06","2012-06-03 12:46:06","controlling the android status bar icon","<android><statusbar>","2","0","2","",""
"3712779","1","","","2010-09-14 20:47:22","0","116","<p>I am attempting to write an app for the Android platform which is similar to a lot of code I have written in VB and C++. I plan on using sensor data from the device and doing calculations on that data. I am still working a lot of this, but wanted to know since I was going to need access to the motion sensors of the phone, where would be a good place to start reading? Specifically, is there some sort of predefined API, class or method already in place devoted to this? Are there places where clear documentation can be found? I am just trying to make sure I am not reinventing the wheel here.</p><p>General Idea is to pull movement sensor data very rapidly, and calculate average moves or ""twitches"" of the phone while in use for a phone call. (Obviously, when not on speaker phone.) This data is collected for the length of the call at intervals, then sent to an offsite storage server where it is mapped for average, and peak movement patterns. This will then be used to generate visual patterns from the elderly or neurological patients with tremors. This is similar to Intel's research on data from home phones, but applied with a targeted algorithm for discerning specific twitches and tremors from others over time, thus helping with diagnoses. </p><p>Please be gentle. Thanks! </p>","444038","","","","","2010-09-14 21:25:47","Android General Programming","<android><data><sensor><movement><medical>","1","0","","",""
"3712862","1","","","2010-09-14 20:58:56","1","4298","<p>I want to setup an Android app that will connect to a backend database (web/database server that I maintain).  What are some good resources for doing so?</p><p>Thanks in advance.</p>","447782","","","","","2010-09-15 03:18:34","Android app to connect to backend database / website","<android><database>","1","0","1","",""
"3712883","1","3745969","","2010-09-14 21:02:58","5","2050","<p>I have developed android application. Now it is time to give it to the beta testers.</p><p>Is there the standalone application witch will collect LogCat output? I do not want to force testers to install whole android development environment. I was thinking about application witch will collect logs through usb port and display them to the PC console (logging to the SD card is not convenient), so that tester could provide crash trace or some debugging info.</p>","361832","","","","","2012-04-15 13:08:35","Logcat standalone client","<android><testing><stack-trace><logcat>","2","2","1","",""
"3712958","1","3713239","","2010-09-14 21:12:45","5","1481","<p>I feel as if I'm missing something.</p><p>In my application, I decided to provide alternative drawable resources and alternative layout files. My structure is as follows:</p><p>res/drawable-hdpi/filename.png<br>res/drawable-mdpi/filename.png<br>res/drawable-ldpi/filename.png  </p><p>res/layout-small/layout.xml<br>res/layout-large/layout.xml<br>res/layout/layout.xml  </p><p>I created three different emulators: one with the default HVGA, one with QVGA, and one with WVGA800</p><p>It doesn't seem to pick up those alternative resources/layouts based on screen size/density, or maybe i just can't tell?</p><p>Is there some way, other than using a device for each specific size, to test this? Or am I just missing something important?</p><p>Another question, how well does Android scale drawables if no alternative resource exist?</p>","356615","","","","","2013-08-20 05:02:54","Android- Providing Alternative Resources not working?","<android><layout>","2","0","1","",""
"3713094","1","5053721","","2010-09-14 21:36:29","6","5898","<p>1) Is there any way that I can send a raw SMS PDU from an Android device? </p><p>Or,</p><p>2) are there any classes available that can give me access to the PDU headers (for example TP-DCS) so that I can construct the PDU as I like?</p><p>I have searched the net and found: <a href=""http://www.androidjavadoc.com/1.0_r1_src/com/android/internal/telephony/gsm/ISms.html"">http://www.androidjavadoc.com/1.0_r1_src/com/android/internal/telephony/gsm/ISms.html</a> but the above classes are private and as such are not available to me(haven't actually understood why).</p><p>Is what I'm asking possible in any way or not? If not then why can't I have that kind of functionallity?</p><p>Thanx</p>","447810","","447810","","2014-04-10 21:28:06","2014-04-10 21:28:06","SMS raw pdu in Android","<java><android><mobile><sms><pdu>","1","0","4","",""
"3713246","1","","","2010-09-14 22:01:28","0","634","<p>I would like to get only active calls from PhoneStateListener.I have created the listener with method   onCallStateChanged.Once I dial (and the call is picked up) the state is already off-hook.</p><p>Well, it doesn't really surprise me, because of the text in the <a href=""http://developer.android.com/reference/android/telephony/TelephonyManager.html#CALL_STATE_OFFHOOK"" rel=""nofollow"">API</a>:Device call state: Off-hook. At least one call exists that is dialing, active, or on hold, and no calls are ringing or waiting. </p><p>But is there a possibility to get only active calls?Thnx!</p>","447811","","","","","2011-02-01 10:54:14","how to get only active calls from PhoneStateListener","<android>","1","0","2","",""
"3713375","1","3713451","","2010-09-14 22:27:31","1","1527","<p>Been trying to find out what is the bookmark id the user clicked on...Tried everything, many force closes... and now an empty toast (no error marks in eclipse):</p><pre><code>public class Dmarks extends ListActivity {    protected Context context;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final TextView selection;        String[] projection = new String[] {                                    Browser.BookmarkColumns._ID,                                    Browser.BookmarkColumns.FAVICON,                                     Browser.BookmarkColumns.TITLE,                                     Browser.BookmarkColumns.URL                                    };        String[] displayFields = new String[] {                                    Browser.BookmarkColumns.TITLE,                                     Browser.BookmarkColumns.FAVICON,                                    Browser.BookmarkColumns.URL                                    };        final int[] displayViews = new int[] {                                    android.R.id.text1,                                     android.R.id.text2                                    };        Cursor cur = managedQuery(android.provider.Browser.BOOKMARKS_URI, projection, android.provider.Browser.BookmarkColumns.BOOKMARK, null, null);        setListAdapter(new ImageCursorAdapter(this, android.R.layout.simple_list_item_2, cur, displayFields, displayViews));        selection = (TextView)findViewById(R.id.btitle);        ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {                Context context = getApplicationContext();                TextView text = selection;                int duration = Toast.LENGTH_SHORT;                Toast.makeText(context, (CharSequence) text, duration).show();          }        });   }</code></pre><p>ImageCursorAdapter is another class showing bookmarks favicon and title (it works).</p><p>Really would appreciate help with what am I doing wrong here.</p><p>Thanks!</p>","444324","","","","","2010-09-14 22:45:29","Android onItemClick -> Toast bookmark id","<android>","1","0","","",""
"3713433","1","3713505","","2010-09-14 22:40:11","2","331","<p>I have a listview populated by a text file hosted on my website that is parsed and made into seperate list items. Each list item sends the user to a new activity to view more information on that item. My question is - how do I go about tracking the following data about my application..</p><ul><li># of views of the whole listview</li><li># of unique views of the listview</li><li># of times each list item is clicked </li><li># of unique clicks of each list item</li></ul>","407775","","","","","2010-09-14 22:54:37","data/statistic tracking for users in android application","<android><usage-statistics>","1","0","","",""
"3713509","1","","","2010-09-14 22:55:46","2","879","<p>I am trying to code an app where you can paint (Finger paint) free hand on a running video in a VideoView.I have the two things running sepaerately but not together.I can draw my paint on a blanc screen and i can play my video on my videoView, which is implementet in an xml layout.</p><p>Is there a way to overlay the xml videoview View with an other View which can be drawable?</p>","447863","","","","","2010-09-14 23:48:54","Paint on a VideoView","<android>","1","0","","",""
"3713623","1","","","2010-09-14 23:19:35","0","816","<p>In android selection dialog, like this example,<a href=""http://labs.makemachine.net/2010/03/android-multi-selection-dialogs/"" rel=""nofollow"">http://labs.makemachine.net/2010/03/android-multi-selection-dialogs/</a></p><p>How can I specific the color of the text in the dialog? e.g. the color of the text ""Mars"", ""Jupiter""?</p>","286802","","244296","","2010-09-14 23:39:15","2010-09-15 01:13:41","How can I configure the color of the text in a dialog","<android>","2","0","","",""
"3714148","1","4875062","","2010-09-15 01:51:07","1","1837","<p>all.  I'm working on setting up a home screen layout for an Android app in which there is a 4x4 grid of launch icons.  My current structure for this is like this:</p><pre><code>&lt;TableLayout&gt;  &lt;TableRow&gt;    &lt;LinearLayout android:orientation=""vertical""&gt;      &lt;ImageButton&gt;      &lt;TextView&gt;    &lt;/LinearLayout&gt;  &lt;/TableRow&gt;  ...  ...  ...&lt;/TableView&gt;</code></pre><p>When I run this, I get a force-close immediately.  If I remove the LinearLayout from the equation, it works, but I don't get the alignment I want.  Is there something inherently wrong with putting a linearlayout inside of a tablerow?  Or is there probably something else going on here?  As far as I can tell, my xml is all valid and I think I have all the required attributes I need. This is kind of driving me nuts, as there does not appear to be any documentation about this setup.</p>","447934","","","","","2011-02-02 13:34:51","<TableLayout><TableRow><LinearLayout> hates me. Force close on run. Android","<android><xml><tablelayout><android-linearlayout>","2","3","0","",""
"3714371","1","","","2010-09-15 03:02:12","1","1115","<p>I'm looking for a alternative method to reading the /proc/PID/exe symbolic link in which to obtain the <strong>full path</strong> of a process in <strong>Android</strong>/Linux. </p><p>The reason being is that on Android, /proc/PID/exe for any process other than your own or 'self' seem to have restricted (permission denied) access.</p><p>I have looked into the following as well - they are readable, but don't seem to work:</p><ul><li>/proc/PID/cmdline: Rarely contains the full path</li><li>/proc/PID/stat: Contains only the executable name (no path)</li></ul><p>Failing code due to permission denied:</p><pre><code>#include &lt;unistd.h&gt;// ...char buf[2048];// ""/proc/1234/exe"" is of course replaced with a proper PIDssizet_t len = readlink(""/proc/1234/exe"", buf, sizeof(buf) - 1);if(-1 != len) {  buf[len] = '\0';  // buf should contain full path} else {  // this path always reached for PID's other than my own or  // /proc/self/exe}</code></pre><p>There has to be a alternative method? In Windows, there is of course GetModuleFileNameEx, QueryFullProcessImageName(), etc.</p>","132064","","","","","2010-09-15 04:52:53","Alternative to /proc/PID/exe symlink for retrieving another processes full path via PID","<android><linux><path><pid>","1","0","1","",""
"3714394","1","","","2010-09-15 03:10:54","10","15854","<p>I am New to this Android platfrom.   In one application, there is a memory leak.  But i couldn't able to find in which actiity or class the memory leak is happening.</p><p>I am using MAT to get the infirmation that the memory leak is there or not.  But not able to find which activity is leaking.</p><p>Please tell me how to find the which activity is leaking.</p><p>Thanks.</p>","388269","","","","","2014-01-31 23:14:27","How to find Memory Leak Class/Activity in Android","<android><memory-leaks>","4","2","8","",""
"3714582","1","","","2010-09-15 04:03:26","0","1643","<p>I have an activity that calls a custom view when a button is pressed.  The custom view runs fine until I try to add an ImageView to it.  I have tried this in my xml that is called in my main activity with setContentView:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;com.mypackage.mycustomview android:id=""@+id/fbv""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    &gt;        &lt;ImageView android:id=""@+id/pistolView""              android:src=""@drawable/pistol""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""/&gt; &lt;/com.mypackage.mycustomview&gt; </code></pre><p></p><p>I get a ClassCastException when I click on the button in my main activity which initiates this custom view.  All I want to do is make a clickable image inside of my custom view.</p><p>The ImageView displays fine and clicks if I put it in my main activity and main.xml like this:</p><p></p><pre><code>&lt;Button android:id=""@+id/button""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Play Vs CPU"" /&gt;        &lt;ImageView android:id=""@+id/pistolView""              android:src=""@drawable/pistol""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""/&gt; </code></pre><p></p><p>I really am not good with the xml layouts in android, so I have no idea what I'm missing here.  Any help is greatly appreciated.</p><p>here is the mycustomview class:</p><pre><code>       package com.mypackage;    import java.util.ArrayList;    import android.app.Activity;    import android.content.Context;    import android.content.res.Resources;    import android.graphics.Bitmap;    import android.graphics.BitmapFactory;    import android.graphics.Canvas;    import android.graphics.Paint;    import android.graphics.Point;    import android.graphics.drawable.Drawable;    import android.os.Handler;    import android.os.Message;    import android.text.format.Time;    import android.util.AttributeSet;    import android.util.Log;    import android.view.KeyEvent;    import android.view.LayoutInflater;    import android.view.View;    import android.widget.ImageView;    import android.widget.LinearLayout;    import android.widget.TextView;    public class mycustomview extends View{            final Paint mPaint = new Paint();            private Context mContext;            private Resources res = getResources();            private GameControls _controls;            private GameJoystick _joystick;            private GameJoystick Rjoystick;            Paint paint = new Paint();            private long currTime;            private Time time = new Time();            private Hero mHero;            private Gun mGun;            private Bitmap heroBit;            private float possibleX;            private float possibleY;            private float lazerX;            private float lazerY;            public ArrayList&lt;Wall&gt; wallList = new ArrayList&lt;Wall&gt;();            private Canvas mCanvas;            private Bitmap splat;            private Bitmap pistolBit;            private Bitmap building;            private ImageView pistol;            private int i = 0;            private int w = 0;            Wall wall;            private RefreshHandler mRedrawHandler = new RefreshHandler();        class RefreshHandler extends Handler {            @Override            public void handleMessage(Message msg) {                    //Log.d(""3"", ""here3"");                FanBoyView.this.update();                FanBoyView.this.invalidate();            }            public void sleep(long delayMillis) {                    this.removeMessages(0);                sendMessageDelayed(obtainMessage(0), delayMillis);            }        };        @Override        public boolean onKeyDown(int keyCode, KeyEvent event) {            //Log.d(""--------------------&gt;code"", Integer.toString(keyCode));            if (keyCode == KeyEvent.KEYCODE_FOCUS) {                    //Log.d(""--------------------&gt;cam"", ""pressed"");              fireGun();              return true;            }            return false;         }            public mycustomview(Context context, AttributeSet a) {                    super(context, a);                    mContext = context;                    time.setToNow();                    currTime = time.toMillis(false);                    this.setFocusable(true);                    this.setFocusableInTouchMode(true);                    this.requestFocus();                    final Paint paint = mPaint;            paint.setColor(0xffffffff);            paint.setAntiAlias(true);            paint.setStrokeWidth(1);            paint.setStrokeCap(Paint.Cap.ROUND);            paint.setStyle(Paint.Style.STROKE);                    setFocusable(true);                    _joystick = new GameJoystick(mContext.getResources());                    Rjoystick = new GameJoystick(mContext.getResources());                    _controls = new GameControls();                    setOnTouchListener(_controls);                    Drawable bg = res.getDrawable(R.drawable.street);                    this.setBackgroundDrawable(bg);            setWalls();            }            @Override            protected void  onFinishInflate(){                    //ImageView img = (ImageView) findViewById(R.id.pistolView);                    /*img.setOnClickListener(new OnClickListener() {                        public void onClick(View v) {                            Log.d(""pistol"",""clicked"");                        }                    });*/            }...</code></pre>","447986","","447986","","2010-09-15 20:16:36","2011-11-07 05:15:18","How to display an ImageView in a custom view in Android","<android><view><imageview>","1","4","","",""
"3714586","1","","","2010-09-15 04:04:32","0","519","<p>This question is basic for Java, not android. If the code that is inside listener interface does some complex calculations, what happens for callbacks given by the system. In Android accelerometer readings are collected in onSensorChanged(SensorEvent event).If I want to process ""event"" data and that its called around 30-40 times a second. What happens ? </p><p>Does this reduces the calls to function? Or Does this lags the output but all call will finally get executed ?</p><p>I know this should be handled in separate thread, but if large number of threads keep generating , this may be a problem. Also I cannot rely on Java System.currentTimeMillis(); for pinging every say 500 milliseconds as this is never reliable (in a way it guarantees the function will not called before 500 ms but not maximum time like it may be even after 1000 second, which in my case would be a problem as I need data atleast in 500ms).</p><p>Or should I consider TimerTask instead for collecting data every 500 ms?</p>","315619","","315619","","2010-09-15 04:10:37","2010-11-12 06:01:24","How does Android accelerometer (Java in general) handles call back listeners?","<java><android>","2","0","","",""
"3714623","1","","","2010-09-15 04:13:47","0","226","<p>I can't get the thumb img through MediaStore..Are there some tips?</p>","398646","","","","","2011-09-09 12:38:21","How to load local Images rapidly?","<android><image><local>","0","3","1","",""
"3714641","1","","","2010-09-15 04:18:03","2","2091","<p>Can one buy a used device with no phone service and use it for testing apps?</p><p>Second question:  can wifi be used on such a phone, to connect to the internet?</p>","699618","","","","","2010-09-15 07:44:17","Can I test android apps on a phone with no phone service","<android>","2","0","","",""
"3714813","1","","","2010-09-15 05:05:20","2","2607","<p>Hi it is possible in android to show pop-up dialog from background running service?and answer is positive than how can i do that</p>","193583","","288773","","2011-09-20 12:24:21","2011-09-20 12:24:21","show pop-up from background service in android","<android><service><dialog><background>","1","0","1","",""
"3714894","1","3714931","","2010-09-15 05:26:44","1","249","<p>I have created two classes: <code>Example1</code> and <code>Example2</code>, which extends activity.<code>Example1</code> contains a UI of buttons, while Example2 contains UI of TextEdit. I want to call Example2 when a button is clicked, so this code is in an <code>onclick</code> method</p><pre><code>Intent i = new Intent();i.setClassName(""com.a.ui"", ""com.a.ui.Example2"");startActivity(i);</code></pre><p>So I am able to get the UI of Example2 successfully. What's an alternate way of calling intent?</p><p>Is there any alternate way to start an activity?</p>","111988","","23199","","2010-09-15 05:40:54","2010-12-02 15:07:46","How to start an activity","<android><android-intent>","3","3","","",""
"3715014","1","4217653","","2010-09-15 05:55:48","5","2141","<p>I've been attempting to utilize the plurals resource with Android but have not had any luck.</p><p>Here is my resource file for my plurals:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;resources xmlns:xliff=""urn:oasis:names:tc:xliff:document:1.2""&gt;        &lt;plurals name=""meters""&gt;            &lt;item quantity=""one""&gt;1 meter&lt;/item&gt;            &lt;item quantity=""other""&gt;                &lt;xliff:g id=""count""&gt;%d&lt;/xliff:g&gt;                meters            &lt;/item&gt;        &lt;/plurals&gt;        &lt;plurals name=""degrees""&gt;            &lt;item quantity=""one""&gt;1 degree&lt;/item&gt;            &lt;item quantity=""other""&gt;                &lt;xliff:g id=""count""&gt;%d&lt;/xliff:g&gt;                degrees            &lt;/item&gt;        &lt;/plurals&gt;    &lt;/resources&gt;</code></pre><p>...and then here is the code I am using when I attempt to extract the quantity string from my resources:</p><pre><code>Resources res = this.getResources();tTemp.setText(res.getQuantityString(R.plurals.degrees, this.mObject.temp_c.intValue()));</code></pre><p>...but the text in the TextView remains to be <code>%d degrees</code> and <code>%d meters</code>.</p><p>Does anyone know what is happening?  I've debugged the code and the res.getQuantityString(...) call is returning a String whose value is <code>%d degrees</code> or <code>%d meters</code>.  Though when the quantity happens to be 1 it does correctly evalute to <code>1 degree</code> or <code>1 meter</code>.</p><p>Thanks in advance for any help!</p><p>Regards, celestialorb.</p>","384386","","","","","2011-03-20 11:05:40","Android Pluralization not working, need help","<android><xml><resources><pluralize>","3","0","4","",""
"3715098","1","3715508","","2010-09-15 06:12:56","2","6533","<p>Does anyone of you friendly coders know how to change the text on the return key of the android keyboard. I am catching the return event of an EditText element to start an action. So I would like to show the user, that he can start the action with that key. Some applications do that. E.g. they replace the key with a search symbol.</p><p>I am also wondering why apps always have an additional button aside the text field. Clearly, this takes away screen space. But it may be necessary for some purpose I am not aware off. The one problem I could imagine is task switching. After switching back, the user would have to call the keyboard before he could start the action. The other is a hardware keyboard, but anyone will assume that the return key will start the action.</p><p>R.G.</p>","447111","","15168","","2010-09-15 06:15:52","2012-08-20 23:56:02","Setting the Return key on the Android keyboard","<android>","2","0","","",""
"3715179","1","3716376","","2010-09-15 06:29:35","3","2729","<p>I am fetching an XML data from the web using HTTP GET/POST.Right now i have done it in simple way (i.e. without threaed).</p><p>According to the below link, i tried to implement it with Progress bar dialog with Thread<a href=""http://www.ceveni.com/2009/09/sample-progress-bar-dialog-in-android.html"" rel=""nofollow"">http://www.ceveni.com/2009/09/sample-progress-bar-dialog-in-android.html</a></p><p>But how do i come to know about the finish time  of fetching XML from the web.(i.e. <strong>what should be the sleep time and also when to dismiss the progress bar dialog box</strong>)</p><p>Let me clear more about my problem =>  In activity,when the user click on ""Fetch data"" button,the ""Progress bar"" dialog box should be appeared and it should be disappear only when the fetching is completedsuccessfully.</p><p>I think this can be done with ""<strong>AsyncTask</strong>"" but dont know how to use that concept for this problem.</p><p>So how do i do it ?</p>","379693","","379693","","2010-09-15 09:34:43","2010-09-15 09:35:37","Android - Fetching XML Data from web(Using AsyncTask) and Progressbar related problem","<android><android-progressbar>","2","0","1","",""
"3715206","1","3715596","","2010-09-15 06:33:42","0","217","<p>Can we use j2me packages in android development? I just mean to say like for eg: sax parser is supported in both the platforms. So can we code the business logic in j2me platform and use that class in android platforms and vice-versa?</p><p>Just like this other components which are common in both platforms? </p>","448057","","114066","","2010-09-15 07:33:09","2010-09-15 07:42:05","Can we use j2me packages in android and vice-versa?","<android><java-me>","1","0","0","",""
"3715284","1","","","2010-09-15 06:47:41","2","992","<p>I am relatively new to Android but have some experience with Java. This may be more of a Multithreading/handler issue as apposed to Bluetooth. </p><p>I am writing an Application that has multiple layouts with buttons. I have set up onClickListners for the buttons. Some buttons will change the activity and bring up a new layout with new buttons, and others will send outgoing SPP strings over Bluetooth. The strings will be defined in an XML file and will not change (serial commands).I can hard code the MAC address of the Bluetooth Server and only need to send data, not receive. </p><p>I am looking for some general guidance on the direction to go as far as setting up my Bluetooth connection and outgoing transmissions. I have looked at the BluetoothChat example extensively but do not have any good resources in the case of multiple activities.</p><p>-Do I use a separate activity to manage all Bluetooth transmissions and connections and create handlers for every case where I would send a Bluetooth message?-Should I add Bluetooth connection+transmission threads in every activity (seems like i would run into issues losing the connection when changing activities)?-Can I use handlers that are not class specific where the BluetoothService Activity could send whatever was prompted by the active/current activity?-Could I just hard code all strings to be sent in the BluetoothService Activity and the UI activity could prompt the BluetoothService Activity to send the requested string based on the button click?</p><p>Any information would be greatly appreciated. Just a general direction, small sample, or class suggestions would get me going in the right direction.</p><p>Thanks,</p><p>Jonathan</p>","448067","","","","","2013-03-31 18:07:13","Android: General Direction for Bluetooth SPP App with Multiple UI Activities (Multithreading/Handlers)","<android><multithreading><bluetooth><handler><rfcomm>","1","0","","",""
"3715296","1","3717269","","2010-09-15 06:49:10","0","678","<p>I am working on an Android Application where I need to open an MS_Word foramt file.How can this be possible in android? The context is the file should be viewed in the same way as if we view msword document in desktop.can anyone help me in sorting out this issue?</p><p>Thanks in Advance,</p>","448037","","","","","2011-01-30 19:47:06","How to open MSWord document in our Android App","<android><android-widget>","2","4","","",""
"3715337","1","3715792","","2010-09-15 06:56:12","3","6142","<p>I have get a correct login using HttpRequest to work. It prints the correct html form of the logn page in my toast (just for testing). Now I want to set a cookie from that request. How is this possible?If it necessary I can provide some code. </p><p>I already know about the CookieManager class, but how can I successfully do it?</p><p>Thanks in advance!</p><p>My code:</p><pre><code>    public String getPostRequest(String url, String user, String pass) {    HttpClient postClient = new DefaultHttpClient();    HttpPost httpPost = new HttpPost(url);    HttpResponse response;    try {        List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);        nameValuePairs.add(new BasicNameValuePair(""login"", user));        nameValuePairs.add(new BasicNameValuePair(""pass"", pass));        httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, HTTP.UTF_8));              response = postClient.execute(httpPost);        if(response.getStatusLine().getStatusCode() == 200) {            HttpEntity entity = response.getEntity();            if (entity != null) {                InputStream instream = entity.getContent();                  String result = convertStreamToString(instream);                                   instream.close();                             return result;                  }        }    } catch (Exception e) {}    Toast.makeText(getApplicationContext(),            ""Connection failed"",            Toast.LENGTH_SHORT).show();    return null; }private String convertStreamToString(InputStream is) {    BufferedReader reader = new BufferedReader(new InputStreamReader(is));    StringBuilder sb = new StringBuilder();    String line = null;    try {        while ((line = reader.readLine()) != null) {            sb.append(line);        }    } catch (IOException e) {        e.printStackTrace();    } finally {        try {            is.close();        } catch (IOException e) {            e.printStackTrace();        }    }    return sb.toString();}           </code></pre><p>Well, this is pretty much it. convertStreamToString() function converts the InputStream into a String (plain HTML code), which I ""toast"" out to just test it (so it work), so the code is working though. Now to set the cookie. :-)</p><p>This is what I've reached for now:</p><pre><code>// inside my if (entity != null) statementList&lt;Cookie&gt; cookies = postClient.getCookieStore().getCookies();String result = cookies.get(1).toString();                    return result;</code></pre><p>When I have logged in, the CookieList id 1 contains a value, otherwise the value is standard. So for now I know the difference in value, but how can I continue?</p>","386562","","386562","","2010-09-15 10:40:39","2010-09-15 10:40:39","Set cookie from HTTP Request","<java><android>","1","0","1","",""
"3715458","1","","","2010-09-15 07:16:10","1","2643","<p>I want to show Error(log) messages from catch block. How can I show all messages(stack) on a single Screen, so that user can get an idea ?</p><p>Thanks...</p>","406631","","","","","2010-11-13 18:23:32","Display Error messages on Screen(view)","<android>","1","0","","",""
"3715482","1","","","2010-09-15 07:21:57","11","10167","<p>i have a WebView in my app with wrap_content width and height</p><p>before i use webview.loadData  , the width and height of the it was 0 , </p><p>after i load a url(or i use webview.loadData) , it'll display a web page.</p><p>my question is , how can i clear the webview to recover it back to the original state,  just as </p><p>before it loadData??</p>","422405","","","","","2014-02-01 20:24:32","clear WebView content","<android>","5","0","1","",""
"3715515","1","","","2010-09-15 07:29:10","4","727","<p>I need to find the list of DLNA compliant devices in my network from my Android application.</p><p>I'm using the API's from org.cybergarage.</p><p>They're available in Java, I want to make them Android capable i.e. Porting APis</p><p>Any help on this.</p><p>Thanks</p>","1386533","","856202","","2011-08-24 15:44:10","2013-05-07 16:05:25","Android : DLNA compliant devices","<android><dlna>","1","0","1","",""
"3715544","1","3715573","","2010-09-15 07:33:14","0","2570","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3633439/handlers-in-android"">Handlers in Android</a>  </p></blockquote><p>I am working on Android projects. I need to use a background thread that should use handlers. My doubt is when we are using a new thread , what is the need to have handler associated with it . I am very much confused of using Handlers in my program. I did n't find any good tutorials or sample programs that deal with Hanlders.Can any one post me a sample program on Android Handlers? I will be waiting for reply.</p><p>thanks in Advance,</p>","448037","","","","","2010-09-15 07:38:19","usage of Handlers in Android and sample program on Handlers","<android><android-widget>","1","0","","2012-08-02 12:29:48",""
"3715547","1","","","2010-09-15 07:33:24","1","1553","<p>So I have an ImageView sitting on a FrameLayout. I want to move this image view when user taps on it and drags it somewhere. This is what I tried to do:</p><p>FrameLayout.LayoutParameters params = new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);</p><p>params.setMargin(marginLeft, marginTop, 0, 0);view.setLayoutParams(params);</p><p>This does not work however. The imageView does not move. Do I need to refresh the view somehow after I set new layout parameters?</p>","448091","","","","","2010-09-15 07:40:12","How do I move and Image View while program is running","<android><move><margin><imageview>","1","0","","",""
"3715571","1","","","2010-09-15 07:37:32","0","1253","<p>I did log in form in android , </p><p>How to add the event functionality for this login form,</p><p>Now login form display, </p><p>I want to add the java code , </p><p>That is When user enter his username and password , </p><p>Get the value into variable and page redirect and system should show , you have enter this username and password ..chk the scrren shot..<img src=""http://i.stack.imgur.com/Ncnee.gif"" alt=""alt text""></p><p>My Thread is , What is the java code for log in form , </p><p>In general , </p><p>How to get the textfield  values and how to process It,</p>","246963","","246963","","2010-09-15 07:46:56","2013-03-15 13:49:32","android Java code for form action","<android><android-emulator>","1","0","","",""
"3715619","1","3715674","","2010-09-15 07:46:56","1","529","<p>For example, I want to parse the string below:</p><pre><code>Tue Sep 28 18:02:24 GMT+08:00 2010</code></pre><p>And I use the pattern for the <code>SimpleDateFormat</code>:</p><pre><code>new SimpleDateFormat(""EEE MMM dd HH:mm:ss zzzzzzzzz yyyy"");</code></pre><p>But I keep getting the <code>ParseException</code>.How to fix this?</p><p>Thanks a lot.</p>","428022","","","","","2010-09-15 07:59:08","How to parse the ""GMT+hours:minutes"" or ""GMT-hours:minutes"" using SimpleDateFormat in Java (Android)","<java><android><simpledateformat>","3","1","","",""
"3715776","1","3871309","","2010-09-15 08:12:29","15","9492","<p>I have a TextView which I fill with text from a string resources in strings.xml. The string resource contains &lt; li > elements to create a bullet list inside the TextView. My problem is that I want to control the indention of lines in the bullet list that span over more than one line. Default the text isn't indented past the bullet so it looks kind of ugly. Is it possible to do this with style parameters or to create bullets in some other way?</p><p>Thanks in advance.</p><p>edit:Is it really answered? I don't have any problems producing the bullet list, as described in those links but I'm having problems getting the layout correct. The indentation is like this:</p><ul><li>text that go beyond the width<br/>of the line.<br/></li></ul><p>And I want the ""of the line"" to at least start indented as far as the text after the bullet. That's what I try to achieve.</p>","287170","","287170","","2010-09-15 11:30:34","2013-05-17 11:40:29","Indent bullet list in TextView","<android><user-interface><textview>","4","2","1","",""
"3715836","1","3758652","","2010-09-15 08:21:04","1","1412","<p>I'd like to test an application on a variety of screen configurations so I know that it'll work (and the layouts will look right) on tablets and other oddly sized devices. Does anyone have any tips or configuration settings that would be helpful?</p>","82895","","","","","2010-09-21 08:49:15","Good avd settings for testing large screen devices with Android SDK?","<android><eclipse>","2","0","","",""
"3715877","1","","","2010-09-15 08:26:15","0","1082","<p>I have spent the last two days trying to figure this out.  I have a service that I am creating to practice with services and IPC.  I have checked the code against the book that I am reading it is almost exact only difference being identifiers.  I get a ResourcesNotFoundException thrown in the mainwindow.java file.  It is thrown when I try to use my IBinder.  Any tip in the right direction will be much appreciated.mainwindow.java</p><p><pre> [code]package com.evilOrion;import com.evilOrion.R;import android.app.Activity;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.content.ServiceConnection;import android.os.Bundle;import android.os.DeadObjectException;import android.os.IBinder;import android.os.RemoteException;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.TextView;</p><p>public class mainwindow extends Activity { TextView tView = null; Button tButton = null; private adder service; private boolean bound;</p><p>private ServiceConnection connection = new ServiceConnection(){  public void onServiceConnected(ComponentName className, IBinder iservice){   service = adder.Stub.asInterface(iservice);   bound = true;  }  public void onServiceDisconnected(ComponentName className){   bound = false;   service = null;  } };</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tView = (TextView)findViewById(R.id.TextView);    tView.setText(""hi"");   tButton = (Button)findViewById(R.id.Button01);    tButton.setOnClickListener(new OnClickListener(){     public void onClick(View v){     if(v.equals(tButton)){     try{      int result = service.add(5, 7);// crashes on this line with no exception      tView.setText(result);     }catch(DeadObjectException e){     Log.i(""DeadObjectException"", ""found the problem"");      }     catch(RemoteException e){      Log.i(""Exception: "" , ""shoot!"");     }      //tView.setText(""What a wonderful day it is"");    }     }    });}public void onStart(){ super.onStart(); if(!bound){  this.bindService(new Intent(mainwindow.this, AdderService.class), connection, Context.BIND_AUTO_CREATE); }}public void onPause(){ super.onPause(); if(bound){  bound = false;  this.unbindService(connection); }}</code></pre><p>}[/code]<code>AdderService.java[code]package com.evilOrion;</p><p>import android.app.Service;import android.content.Intent;import android.os.IBinder;import android.os.RemoteException;</p><p>public class AdderService extends Service {</p><p>private final adder.Stub binder = new adder.Stub() {</p><p>@Override  public int subtranct(int a, int B) throws RemoteException {   // TODO Auto-generated method stub   return  a - b;  }</p><p>@Override  public String echo(String input) throws RemoteException {   // TODO Auto-generated method stub   return ""echo"" + input;  }</p><p>@Override  public int add(int a, int B) throws RemoteException {   // TODO Auto-generated method stub   return  a + b;  } };</p><p>public IBinder onBind(Intent it){  return this.binder; }</p><p>}[/code]Manifest[code]                                                                                    </p>&lt;/application&gt;</code></pre><p> [/code]main.xml[code]android:id=""@+id/TextView""android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    />    <blockquote>  <p>    [/code]  My Manifest file does have the  so I am sure it is not there.  I have gone literally line by line between my book and the code and I see 0 differences.  I just don't understand what I am doing wrong.  One other odd side question.  What creates the connection?  I get ServiceConnection holds the information on my connection with the two methods onServiceConnected and onServiceDisconnected, but the only place I use connection is in onStart(), does onStart() automatically get called after all other methods are complete.  Essentially, I am lost I usually avoid asking questions but I haven't been able to find this answer.  </p></blockquote><p>int result = service.add(5, 7); in the mainwindow.java file causes: No package identifier when getting value for resource number 0x0000000c09-14 20:36:08.684: INFO/Exception!!!(12446): android.content.res.Resources$NotFoundException: String resource ID #0xc</p><p>is thrown in the mainwindow.java</p>","448146","","448146","","2010-09-15 08:45:08","2010-09-16 07:54:25","Android Service with IPC","<android>","1","0","","",""
"3715881","1","3715917","","2010-09-15 08:26:46","3","1433","<p>I have one edittextEditText et1=(EditText)findViewById(R.id.EditText01);</p><p>when i want to clear edittext i use et1.setText("""");but if i have to clear edittext one by one character from the last for this i have no solution can u pls give me solution</p>","441224","","","","","2012-04-01 16:21:11","android edittext","<android>","3","1","2","",""
"3715885","1","","","2010-09-15 08:27:15","0","1322","<p>I want update my widget every seconds. So I use Service and Alarm Manager, but it doesn't update exactly every second.</p><p>This my log list:</p><pre><code>  09-15 11:16:08.876: INFO/REPEAT(2850): time=11:16:08am  09-15 11:16:09.970: INFO/REPEAT(2850): time=11:16:09am  **09-15 11:16:11.025: INFO/REPEAT(2850): time=11:16:11am  09-15 11:16:11.978: INFO/REPEAT(2850): time=11:16:11am**  09-15 11:16:13.118: INFO/REPEAT(2850): time=11:16:12am  09-15 11:16:14.048: INFO/REPEAT(2850): time=11:16:13am  09-15 11:16:15.900: INFO/REPEAT(2850): time=11:16:15am  09-15 11:16:16.533: INFO/REPEAT(2850): time=11:16:16am  09-15 11:16:17.595: INFO/REPEAT(2850): time=11:16:17am  09-15 11:16:17.845: INFO/REPEAT(2850): time=11:16:17am  09-15 11:16:18.892: INFO/REPEAT(2850): time=11:16:18am  09-15 11:16:20.212: INFO/REPEAT(2850): time=11:16:19am  09-15 11:16:21.025: INFO/REPEAT(2850): time=11:16:20am  09-15 11:16:21.861: INFO/REPEAT(2850): time=11:16:21am</code></pre><p>This is my code:</p><pre><code>public static final int INTERVAL = 1000; // 1 secpublic static final int FIRST_RUN = 0; // 0 seconds  private void startService() {    Intent intent = new Intent(this, RepeatingAlarmService.class);    PendingIntent pendingIntent = PendingIntent.getBroadcast(this, REQUEST_CODE, intent, 0);    alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);    alarmManager.setRepeating(            AlarmManager.ELAPSED_REALTIME_WAKEUP,            SystemClock.elapsedRealtime() + FIRST_RUN,            INTERVAL,            pendingIntent);    Toast.makeText(this, ""Service Started."", Toast.LENGTH_LONG).show();    Log.v(this.getClass().getName(), ""AlarmManger started at "" + new java.sql.Timestamp(System.currentTimeMillis()).toString());}</code></pre><p>RepeatingAlarmService.class:</p><pre><code> public class RepeatingAlarmService extends BroadcastReceiver {public static final String CUSTOM_INTENT = ""time to write"";@Overridepublic void onReceive(Context context, Intent intent) {    Log.i(""REPEAT"",""time=""+getTimeString());    Intent i = new Intent();    i.setAction(CUSTOM_INTENT);    context.sendBroadcast(i);}public static String getTimeString() {    String result = null;    Calendar cal = Calendar.getInstance();    if(cal.get(Calendar.AM_PM) == Calendar.AM)        result = new String(String.format(""%02d:%02d:%02dam"", cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE),cal.get(Calendar.SECOND)));    else        result = new String(String.format(""%02d:%02d:%02dpm"", cal.get(Calendar.HOUR), cal.get(Calendar.MINUTE),cal.get(Calendar.SECOND)));    return result;}</code></pre><p>}</p><p>How can I solve this problem? I need update all exactly every seconds</p>","448147","","","","","2010-09-15 09:06:58","How update data exactly every seconds? AlarmManager","<android><alarmmanager>","1","0","0","",""
"3715888","1","","","2010-09-15 08:28:01","0","2635","<p>While I was diving into the Android kernel. I had a question about audio device driver.</p><p>People say that...- Android uses ALSA audio driver.- HAL layer is C/C++ library- ALSA driver runs in user space, not in kernel space</p><p>Then, questions:1. What is the Audio Drivers(I guess it's ALSA driver) in the picture below?ALSA driver should exist in the library portion, isn't it?(http://developer.android.com/guide/basics/what-is-android.html)</p><p>2.There should be nothing about audio driver in Android Kernel, if it conforms to the ALSA driver?</p><ol><li>I have a wm8994.c codec source file which drives codec h/w actually.who's going to call the functions in wm8994.c? I think ALSA HAL will. Am I wrong?</li></ol><p>I'm very confused... </p><p>Thank youilgimae</p>","334038","","","","","2011-03-18 10:31:22","related to Android audio driver","<android>","1","0","","",""
"3715909","1","3716086","","2010-09-15 08:30:39","0","2588","<p>My application has the following components:<br><strong>2 Activities</strong><br>A <strong>Service</strong> and a<br><strong>BroadcastReceiver</strong></p><p>Whenever the user updates the system time, my broadcast receiver receives the <strong>Intent.ACTION_TIME_CHANGED</strong>. Now when this happens I want to reschedule a <strong>Handler</strong> in my <strong>Service</strong>. How do I bind to a Service within my <strong>BroadcastReceiver</strong>?</p>","421372","","","","","2010-09-15 08:54:17","Binding to a local Service from a BroadcastReceiver","<java><android>","1","0","1","",""
"3716071","1","3716211","","2010-09-15 08:53:01","1","805","<p>what is the use of xmlns:android ? could you explain little bit more? Thanks in advance</p><p><em>Note :xmlns:androidDefines the Android namespace. This attribute should always be set to ""http://schemas.android.com/apk/res/android"".</em></p>","430278","","","","","2010-09-15 09:10:33","Android Manifest file","<android>","1","0","1","",""
"3716105","1","3717245","","2010-09-15 08:56:09","0","2527","<p>i want to mount sdcard programmatic,how can i check?</p>","410757","","","","","2012-03-28 10:32:44","how can i mount sdcard programmatic?","<android>","2","2","0","2012-08-21 11:01:09",""
"3716116","1","3716302","","2010-09-15 08:58:32","3","5438","<p>I'm happy reading and writing to a pre-set file, and could manually populate a listview, but I'm hoping there is an official(or not) filebrowser I missed, or other more elegant solution to present the user with a directory listing, and let them select a file.</p>","445831","","","","","2013-08-26 14:16:52","What is a good way to get a list of files from (a directory on) the sd card?","<android>","2","1","0","",""
"3716142","1","","","2010-09-15 09:02:12","6","1912","<p>I was wondering what the feasibility would be for creating a custom Android build and deploying it on a currently available device on the market. Are there any documents or guidelines that describe the process?</p><p>Thank you in advance,Sammy</p>","243302","","","","","2012-05-08 18:42:27","Custom Android OS Build","<android>","2","0","2","",""
"3716157","1","3722698","","2010-09-15 09:03:49","0","4645","<p>here is the deal.</p><p>i was looking over this code about extending an ImageView:</p><p><a href=""http://marakana.com/forums/android/examples/98.html"" rel=""nofollow"">http://marakana.com/forums/android/examples/98.html</a></p><p>and i was wondering how can i add the new View to an existing xml layout file, along with some other views.</p><p>already i did this inside my main linear layout: </p><pre><code>&lt;FrameLayout android:id=""@+id/FrameLayout01"" android:layout_width=""300dp"" android:layout_height=""300dp""&gt;        &lt;com.marakana.Rose android:layout_height=""wrap_content"" android:layout_width=""wrap_content""/&gt;</code></pre><p>but the problem is that this way the onDraw method doesn't get called.</p><p>can anyone suggest a solution for this? maybe some examples where you combine CustomViews with xml layout.</p><p>tnx.</p>","448192","","","","","2013-12-07 19:04:44","Adding a Custom ImageView to main layout","<android><layout><custom-view>","2","0","1","",""
"3716241","1","3727990","","2010-09-15 09:15:08","-2","3304","<p>HI all,</p><p>I want to develop an fake call application in android. After clicking on button i have to receive a fake call with in a given time period. Is there any way to do this..any clues or sample code...? Please let me know..Thanks in advance.</p>","399046","","","","","2013-10-22 12:45:00","Fake call in android","<android>","1","2","","",""
"3716310","1","3720902","","2010-09-15 09:25:16","2","781","<p>Is there any need to use something other than a http POST for small files? (&lt;1mb)</p><p>With large files anyone know of an existing lib to handle them (and preferably show a progress bar in a dialog)</p>","445831","","445831","","2010-09-15 15:21:08","2010-09-15 19:05:03","how to upload a file to server from android device?","<android>","1","0","1","",""
"3716346","1","3716544","","2010-09-15 09:30:21","0","375","<p>Basically i dont know the mobile file / setup exe extension and all ,</p><p>Now i did some basic sample, it working fine in my simulator, </p><p>Before i proceed , i want to test these codes in my mobile , the code working or not, </p><p>What should i do now ,</p><p>I want to install my sample application into my iphone, how to install this application,</p><p>Please guide me , </p><p>Thanks</p>","246963","","","","","2010-09-15 09:56:06","How to install android code into mobile","<android><android-emulator>","3","1","","",""
"3716562","1","3717715","","2010-09-15 09:59:06","0","3909","<p>can any body give example of multicolumn custom list view in android</p><p>Thanks</p>","426344","","","","","2011-09-27 13:07:40","multicolumn custom list view in android","<android>","1","3","","",""
"3716640","1","3827983","","2010-09-15 10:11:28","0","870","<p>I have created a custom view by extending Relative Layout and it looks like this:<img src=""http://i.stack.imgur.com/wnPr4.png"" alt=""alt text""></p><p>The layout for the view:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;RelativeLayout android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" android:gravity=""center_horizontal""&gt;        &lt;ImageView android:id=""@+id/type_picture_preview""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:src=""@drawable/type_picture_noimage"" android:layout_alignParentRight=""true""            android:paddingTop=""15dip"" android:paddingRight=""15dip"" /&gt;        &lt;ImageView android:id=""@+id/type_picture_delete"" android:src=""@drawable/type_picture_delete""            android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_alignParentRight=""true"" /&gt;    &lt;/RelativeLayout&gt;&lt;/merge&gt;</code></pre><p>I am struggling to get two or more layouts on a single line. Any ideas where I am going wrong?</p>","356580","","","","","2010-09-30 05:23:06","Multiple Custom View (derived from RelativeLayout) in one line","<android><layout><relativelayout><custom-view>","2","0","","",""
"3716674","1","","","2010-09-15 10:16:21","2","1459","<p>Is there any way of applying styles defined in styles.xml to views created </p><p>programatically? I need to display textviews on the screen, and align them to different </p><p>positions on the screen. I am able to apply color and text size using </p><p>setTextAppearance() method, but I'm not able to apply other attributes like alignment </p><p>and padding. The styles i've user are : </p><pre><code>&lt;style name=""style1""&gt;    &lt;item name=""android:background""&gt;#00FFFF&lt;/item&gt;    &lt;item name=""android:layout_gravity""&gt;left&lt;/item&gt;    &lt;item name=""android:textSize""&gt;70dip&lt;/item&gt;    &lt;item name=""android:padding""&gt;67dip&lt;/item&gt;       &lt;/style&gt;&lt;style name=""style2"" parent=""@android:style/TextAppearance""&gt;    &lt;item name=""android:textColor""&gt;#2F4F4F&lt;/item&gt;    &lt;item name=""android:layout_gravity""&gt;bottom&lt;/item&gt;&lt;/style&gt;</code></pre><p>And the java code is like...</p><pre><code>TextView t = new TextView(this);t.setText(""Hello"");t.setTextAppearance(this, R.style.style1);</code></pre><p>Can someone please help me with this... :)</p>","437842","","","","","2010-09-15 10:16:21","How to use android styles in styles.xml in programmatic design of views","<android><stylesheet>","0","1","1","",""
"3716680","1","3732663","","2010-09-15 10:17:24","0","947","<p>I  try to execute shell commands, this does work as it should. Even the result comes back (as is see on LogCat). The problem ist the last line of the result. Every time a readLine() on the last line occurs (which shouldn't occur, temp should be null), the app hangs forever and doesn't come back from the readLine call. Maybe you find the error. I tried readUTF and standart read(), all the same problem. And yes, the app got su-rights.</p><pre><code>try                {                    Process process = Runtime.getRuntime().exec(""su"");                    DataOutputStream os = new DataOutputStream(process.getOutputStream());                    DataInputStream osRes = new DataInputStream(process.getInputStream());                    for (String single : commands) {                       os.writeBytes(single + ""\n"");                       os.flush();                       String temp = new String();                       while(  (temp = osRes.readLine()) != null)                       {                                                                 Log.v(""NITRO"", temp);                           result2 += temp + ""\n"";                                                   }                                          }                    os.writeBytes(""exit\n"");                    os.flush();                    process.waitFor();                } catch (IOException e)                {                    Toast.makeText(Main.this, ""Error"", Toast.LENGTH_LONG);                } catch (InterruptedException e)                {                    Toast.makeText(Main.this, ""Error"", Toast.LENGTH_LONG);                }</code></pre><p>That is the StackTrace where it hangs when i stop debugger when hanging:</p><pre><code>OSFileSystem.readImpl(int, byte[], int, int) line: not available [native method]    OSFileSystem.read(int, byte[], int, int) line: 118  ProcessManager$ProcessInputStream(FileInputStream).read(byte[], int, int) line: 312 ProcessManager$ProcessInputStream(FileInputStream).read() line: 250 DataInputStream.readLine() line: 309    Main$2$1.run() line: 84 ViewRoot(Handler).handleCallback(Message) line: 587 ViewRoot(Handler).dispatchMessage(Message) line: 92 Looper.loop() line: 123 ActivityThread.main(String[]) line: 4627    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 868  ZygoteInit.main(String[]) line: 626 NativeStart.main(String[]) line: not available [native method]  </code></pre>","142405","","142405","","2010-09-15 10:44:00","2010-09-17 04:38:32","Getting result of executed shell command fails/hangs","<android><shell><iostream>","1","3","","",""
"3716688","1","3716793","","2010-09-15 10:18:03","1","137","<p>I'm having great problems with getting subactivities to work properly.I've read several tutorials on the subject, none of which work, or seem to leave out important info on how to setup the call to the sub activity.</p><p>All I want to do is launch a sub-activity. The calling activity doesn't need to get any info back from the called activity.</p><p>What I've got so far:</p><p>Calling code:</p><pre><code>final Intent intent = new Intent();    intent.setClass(this, voltageDivider.class);    startActivity(intent);</code></pre><p>Code called:</p><pre><code>static public class voltageDivider extends Activity { public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState); setContentView(R.layout.voltagedivider);</code></pre><p>Manifest.xml:</p><pre><code>&lt;activity android:name=""main$voltageDivider""&gt;    &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>The code that's called is within the 'main' class of the program. This works as I want, as it starts a new activity which, when pressing back goes back to the calling activity, but each sub-activity is being compiled as a seperate application. It means I'll end up having about 20 icons in the program launcher screen, which I don't want. I just want one which is the main screen.</p><p>What am I doing wrong? How do I sort it out?The code I've ended up with is a result of it being the only way it will compile. For instance, final, static modifiers and the way the subactivity is defined in the manifest</p>","448270","","448270","","2010-09-15 12:47:21","2010-09-15 12:47:21","Sub activity confusion. Multiple programs being compiled","<android>","1","0","","",""
"3716745","1","","","2010-09-15 10:26:55","0","1124","<p>HI to every one...</p><p>I'm working on a Application and I would like to start or call an external application from it by pressing for example a button...on my application.</p><p>the application I would like to call is an open source application.</p><p>I've read on the official android website it is possible to do it but haven't found any suggestion on how to do it.</p><p>MY APPROACH:</p><p>So trying on my own I've used an Intent Action and a button...like this</p><pre><code> Intent i=new Intent(android.content.Intent.ACTION_VIEW);   startActivity(i); (when the button is pressed...with onClickListener)</code></pre><p>RESULT:</p><p>when the button is pressed, A window appears which invites me to complete the Action I guess by choosing one of the Listed programs such as:</p><pre><code>-Gstr -Import Ics-Market-Music-Mail (com.htc.android.mail) and so on...but not the API I was looking for...</code></pre><p>when I choose Gstr(I guess is the application manager) then opens another window </p><p>which shows a list of Installed Applications. From there I find the Application I was </p><p>looking for and starts it (by long pressing on it's Icon...)</p><p>ISSUE:</p><p>I would like to start the external Application directly by clicking on a button on my </p><p>application without passing through hundreds of others... Is there a way to achieve</p><p>this purpose coding?</p><p>THANKS for Your suggestions... </p>","448245","","243782","","2010-09-15 11:40:20","2010-09-15 13:09:11","Call or start external Application Android","<android>","2","0","","",""
"3716804","1","6694368","","2010-09-15 10:38:51","0","459","<p>When I create HTML code by myself , and use <code>webview.loadData</code> to display the HTML , </p><p>I click <code>&lt;a&gt;</code> on the webview , why there was no orange rectangle appeared?</p>","422405","","2961","","2010-09-15 10:49:48","2011-07-14 14:00:00","android webview link .... click orange rectangle","<android>","1","0","","",""
"3716891","1","3716948","","2010-09-15 10:49:58","1","662","<p>I am having a static method .In the method when I decalare a variable , it was showing an error in eclipse saying that the variable should be decalared as final.Can I know the reason for this , y should a variable in a static method be declared as final?  I am writng an Android application where I should pass as an argument current Context of that application. So, when I pass the current context to the method and trying to copy it in a local variable , I am getting this error saying that the variable should be declared as final.my method is like this:</p><pre><code>public static void myfunc(Context ctx, int a)  {                                       Context myctx=ctx;                      }     </code></pre><p>error is showing at line where Context myctx=ctx;   is declared and asking me to declare it as final.</p>","448037","","448037","","2010-09-15 10:57:40","2011-10-14 06:06:20","why should a variable in a static method be declared as final in java","<java><android><eclipse>","4","2","","",""
"3717054","1","","","2010-09-15 11:15:38","2","7002","<p>I am trying to use custom fonts in a textview:</p><pre><code>tv=(TextView)findViewById(res);Typeface font = Typeface.createFromAsset(this.getAssets(), ""fonts/font.ttf""); tv.setTypeface(font); </code></pre><p>But when I run I get the following error:</p><pre><code>W/System.err(  542): java.lang.RuntimeException: native typeface cannot be made</code></pre><p>Whats the issue?</p>","215399","","","","","2013-03-05 11:16:38","Custom fonts in android","<java><android>","6","4","2","",""
"3717156","1","","","2010-09-15 11:30:13","1","911","<p>I'm trying to implement a small mp3 player on android. So far so good, but I cant implement the following feature:</p><p>When playback of the file starts, check the file, get the artwork and display it.(the artwork is embedded)</p><p>I've seen several libraries which claim to be capable of doing so, but I did not manage to implement it. (jaudiotagger, jid3)</p><p>Did somebody ever implement this and can show me some code?</p><p>Thank, Nico</p>","257387","","","","","2011-03-03 12:38:28","extract and show album art of mp3 file in android","<java><android>","1","0","1","",""
"3717227","1","3717295","","2010-09-15 11:42:12","0","75","<p>I have elseif statement in which i declare  flag is false and i declare</p><pre><code>Resources r = getResources();String refrigerant;String[] refrigerant1 = r.getStringArray(R.array.refrigerant);</code></pre><p>in my program want to set flag=true but my for loop is not executed and flag remains false pls give me solution.</p><p>is there any problem in array declaration?</p><pre><code>else if (ref_flg == true &amp;&amp; ptflg == false){for (int i1 = 0; i1 &lt; refrigerant1.length; i1++){    if (refrigerant == """")    {        if (et1.getText().toString()== refrigerant1[i1])        {            flag = true;            System.out.println(""flag""+flag);        }    }    else    {        if (refrigerant == refrigerant1[i1])        {            System.out.println(""refrigerant""+refrigerant);            flag = true;            System.out.println(""flag""+flag);        }    }}if (flag == true){    if (refrigerant == """")    {        if (et1.getText().toString() != """")        {            refrigerant = et1.getText().toString();        }    }    temp_flg = true;    et1.setText("""");}else{    System.out.println(""flag""+flag);    alertDialog.setTitle(""Reset..."");    alertDialog.setMessage(""Enter Valid REF"");    alertDialog.setButton2(""OK"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {            // here you can add functions            dialog.dismiss();        }    });    alertDialog.setIcon(R.drawable.icon);    alertDialog.show();     ref_flg = false;}  }</code></pre>","441224","","441224","","2010-09-15 12:10:22","2010-09-15 12:57:51","about android project","<java><android>","2","0","","",""
"3717236","1","3717322","","2010-09-15 11:44:13","3","2682","<p>I have saved a cookie in android. Now I want to pass it into my browser intent. Look at my current code:</p><pre><code>Intent browser = new Intent(""android.intent.action.VIEW"",                            Uri.parse(""http://mypage.php/memberpagethatrequireacookie.php""));//putExtra cannot take these arguments -&gt; browser.putExtra(""org.apache.http.cookie.Cookie"", cookie);startActivity(browser);</code></pre><p>I want it to store temporarily in my browser so my member page loads successfully. My cookie are successfully created from the HTTP request and I assign it to a <code>List&lt;Cookie&gt; cookie;</code>Tell me if I should provide some more code.</p><p>Any ideas? Thanks in advance!</p>","386562","","","","","2013-06-27 15:13:17","Pass cookie to browser via Intent","<java><android>","3","0","3","",""
"3717293","1","3717457","","2010-09-15 11:50:31","1","902","<p>I am a beginner in Android game development, while searching i found Rokon, a framework for android game development. It has very nice five tutorials for beginning, done that all now i need some  more tutorials so that i can learn more, some more complicated tasks.</p><p>Now where to find other resources to continue on Rokon, or if there exists some other framework with more available tutorials ?.</p>","405521","","","","","2010-09-15 12:14:08","Android game development framework Rokon","<android><rokon>","1","0","0","",""
"3717332","1","3896904","","2010-09-15 11:56:15","2","3863","<p>I am making application in which i want to find the list of the UPnP devices that are connected to my network from my android application . Any idea how can i do this..</p><p>I am using the API of the cybergarage...here is the link of the repository...</p><p><a href=""https://cgupnpjava.svn.sourceforge.net/svnroot/cgupnpjava/trunk/cyberlink/upnp-stack/src/main/java/org/cybergarage/"" rel=""nofollow"">https://cgupnpjava.svn.sourceforge.net/svnroot/cgupnpjava/trunk/cyberlink/upnp-stack/src/main/java/org/cybergarage/</a></p><p>Any one who has work or has been working on UPnP Complianted Application development, can help me out.</p><p>Thank you</p>","1386533","","21234","","2010-10-09 16:57:06","2011-12-29 22:23:13","android : Find UPnP devices from network","<android><upnp>","1","1","1","",""
"3717360","1","","","2010-09-15 12:01:12","0","721","<p>Can anyone let me know Android SDK 2.0 supports A2DP and AVRCP or not.</p><p>Regards,John </p>","2431815","","404469","","2010-09-15 12:11:49","2010-11-22 11:13:02","Android SDK 2.0 supports A2DP and AVRCP or not","<android><android-emulator>","1","0","","",""
"3717379","1","","","2010-09-15 12:03:57","0","622","<p>In my search activity I am pulling data from 4 <code>Cursors</code> (each with a tag saying what it contains) placed in a <code>MergeCursor</code>. What I'd like to is create a section indexer which allows the user to move between these sections, instead of the usual alphabetical one. How should I go about doing this? </p><p>Thanks</p>","428665","","","","","2010-09-15 12:22:10","How to make a non-alphabetical sectionindexer","<android><listview>","1","0","","",""
"3717388","1","3717951","","2010-09-15 12:04:30","3","725","<p>Why should a static method in java accept only final or non final variables within its method, but not static?</p><p>For example I have the following method:</p><pre><code>public static void myfunc(int somethig){                                        int a=10;                              final int b=20;                        static int c=30;   //gives Error why?}</code></pre>","448037","","82118","","2010-09-16 14:50:37","2011-10-25 15:46:07","Why should a static method in java accept only final or non final variables within its method, but not static?","<java><android>","5","1","1","",""
"3717460","1","","","2010-09-15 12:14:12","0","655","<p>Here's the flow. I have a button in a layout along with a form as view stub. On click of that button, view stub is inflated and brought to focus. When I change the orientation, the activity gets restarted and goes to main screen with button. Can someone please tell me how to handle orientation change ? I mean, I want the screen to be in view stub itself with previously entered values but in different mode (landscape or portrait). I know I have to add android:configChanges=""orientation"" in AndroidManifest.xml. However, I dont know what to do in onConfiguationChanged method. Thanks.</p>","368084","","404469","","2010-09-15 12:19:00","2010-09-15 12:19:00","Restoring view after orientation change in android 1.6","<android><orientation>","0","2","","",""
"3717685","1","","","2010-09-15 12:47:17","0","415","<p>main.xml:<br></p><pre><code> &lt;tabwidget android:id=""@android:id/tabs"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt;    &lt;framelayout android:id=""@android:id/tabcontent"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" &gt;        &lt;linearlayout android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;listview android:id=""@+id/list1"" android:layout_width=""fill_parent"" android:layout_height=""0dip"" android:layout_weight=""1""/&gt;        &lt;/linearlayout&gt;        &lt;linearlayout android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;listview android:id=""@+id/list2"" android:layout_width=""fill_parent"" android:layout_height=""0dip"" android:layout_weight=""1""/&gt;        &lt;/linearlayout&gt;    &lt;/framelayout&gt;</code></pre><p></p><pre><code>public class TabbedListListActivity extends TabActivity implements OnTabChangeListener {private static final String LIST1_TAB_TAG = ""List1"";private static final String LIST2_TAB_TAG = ""List2"";// The two views in our tabbed exampleprivate ListView listView1;private ListView listView2;private TabHost tabHost;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);  setContentView(R.layout.main);    tabHost = getTabHost();    // LayoutInflater.from(this).inflate(R.layout.main, tabHost.getTabContentView(), true);    tabHost.setOnTabChangedListener((OnTabChangeListener) this);    // setup list view 1    listView1 = (ListView) findViewById(R.id.list1);    // create some dummy strings to add to the list    List&lt;String&gt; list1Strings = new ArrayList&lt;String&gt;();    list1Strings.add(""Item 1"");    list1Strings.add(""Item 2"");    list1Strings.add(""Item 3"");    list1Strings.add(""Item 4"");    listView1.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, list1Strings));    // setup list view 2    listView2 = (ListView) findViewById(R.id.list2);    // create some dummy strings to add to the list (make it empty initially)    List&lt;String&gt; list2Strings = new ArrayList&lt;String&gt;();    listView2.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, list2Strings));    // add an onclicklistener to add an item from the first list to the second list    listView1.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {            String item = (String) listView1.getAdapter().getItem(position);            if(item != null) {                ((ArrayAdapter&lt;String&gt;) listView2.getAdapter()).add(item);                Toast.makeText(TabbedListListActivity.this, item + "" added to list 2"", Toast.LENGTH_SHORT).show();            }        }    });    // add views to tab host    tabHost.addTab(tabHost.newTabSpec(LIST1_TAB_TAG).setIndicator(LIST1_TAB_TAG).setContent(new TabContentFactory() {        public View createTabContent(String arg0) {            return listView1;        }    }));    tabHost.addTab(tabHost.newTabSpec(LIST2_TAB_TAG).setIndicator(LIST2_TAB_TAG).setContent(new TabContentFactory() {        public View createTabContent(String arg0) {            return listView2;        }    }));}/** * Implement logic here when a tab is selected */public void onTabChanged(String tabName) {    if(tabName.equals(LIST2_TAB_TAG)) {    }    else if(tabName.equals(LIST1_TAB_TAG)) {        //do something    }} }</code></pre><p>but this code not mistake but i canot  run this code,it give me java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.TabbedListListActivity/com.test.TabbedListListActivity.TabbedListListActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class tabhost</p><p>i donot want o use inflate,every one can hlpe me ,i donot know where is midtake</p>","233618","","233618","","2010-09-18 00:52:10","2010-09-19 10:20:54","tabactivity cannot work,but my code not mistake","<android><android-tabhost>","1","1","","2013-05-04 16:42:28",""
"3717730","1","","","2010-09-15 12:52:22","1","749","<p>Peace upon you ,I searched more  but didn't get the answer. Currently I have 2 mobilenetworks for my mobile say they are A and B.Is there a way to automatically detect the mobile networks if thereare A and B then choose A? Or just simplely choose A no matter whetherthere is B availible? I want to search for gsm networks operatorsavailable and select the preferred one.</p><p>Thanks.</p>","448398","","","","","2012-08-04 04:45:14","How to switch the mobile network in program?","<android>","0","0","","",""
"3717740","1","3789737","","2010-09-15 12:53:49","1","2631","<p>Anybody can please help in Android + Twitter Integration using OAuth.</p><p>I already worked on <a href=""http://github.com/brione/Brion-Learns-OAuth"" rel=""nofollow"">http://github.com/brione/Brion-Learns-OAuth</a> and getting the error listed below, when I am posting status update...</p><pre><code>WARN/System.err(190): org.apache.http.client.HttpResponseException: UnauthorizedWARN/System.err(190):     at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:71)WARN/System.err(190):     at org.apache.http.impl.client.BasicResponseHandler.handleResponse(BasicResponseHandler.java:59)WARN/System.err(190):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657)WARN/System.err(190):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:627)WARN/System.err(190):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:616)WARN/System.err(190):     at com.test.twitter.BLOA$PostTask.doInBackground(BLOA.java:343)WARN/System.err(190):     at com.test.twitter.BLOA$PostTask.doInBackground(BLOA.java:1)WARN/System.err(190):     at android.os.AsyncTask$2.call(AsyncTask.java:185)WARN/System.err(190):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)WARN/System.err(190):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)WARN/System.err(190):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)WARN/System.err(190):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)WARN/System.err(190):     at java.lang.Thread.run(Thread.java:1060)</code></pre><p>I succeed with OAuth Authentication and getting user_secret and user_token and stored in preferences...</p><p>So the issue is with http posting using OAuth header... </p><p>and My Http Post Method is as :</p><pre><code>private class PostTask extends AsyncTask&lt;String, Void, JSONObject&gt; {  ProgressDialog postDialog;  @Override  protected void onPreExecute() {   postDialog = ProgressDialog.show(BLOA.this,     getText(R.string.tweet_progress_title),     getText(R.string.tweet_progress_text), true, // indeterminate                 // duration     false); // not cancel-able  }  @Override  protected JSONObject doInBackground(String... params) {   JSONObject jso = null;   try {    HttpPost post = new HttpPost(      ""http://twitter.com/statuses/update.json"");    LinkedList&lt;BasicNameValuePair&gt; out = new LinkedList&lt;BasicNameValuePair&gt;();    out.add(new BasicNameValuePair(""status"", params[0]));    post.setEntity(new UrlEncodedFormEntity(out, HTTP.UTF_8));    post.setParams(getParams());    // sign the request to authenticate    mConsumer.sign(post);    String response = mClient.execute(post,      new BasicResponseHandler());    jso = new JSONObject(response);   } catch (UnsupportedEncodingException e) {    e.printStackTrace();   } catch (OAuthMessageSignerException e) {    e.printStackTrace();   } catch (OAuthExpectationFailedException e) {    e.printStackTrace();   } catch (OAuthCommunicationException e) {    e.printStackTrace();   } catch (ClientProtocolException e) {    e.printStackTrace();   } catch (IOException e) {    e.printStackTrace();   } catch (JSONException e) {    e.printStackTrace();   } finally {   }   return jso;  }  // This is in the UI thread, so we can mess with the UI  protected void onPostExecute(JSONObject jso) {   postDialog.dismiss();   if (jso != null) { // authorization succeeded, the json object     // contains the user information    mEditor.setText("""");    mLast.setText(getCurrentTweet(jso));   } else {    mLast.setText(getText(R.string.tweet_error));   }  } }</code></pre>","206809","","1173341","","2012-03-12 10:29:45","2012-03-12 10:29:45","Twitter + OAuth Integration","<android><twitter><oauth><twitter-api><twitter-oauth>","4","1","3","","2010-09-15 12:53:49"
"3717752","1","3719530","","2010-09-15 12:54:46","0","1163","<p>I'm planning to release a nice clock widget and I'd like to include a pretty wallpaper with it (want to do this because previously got some comments like ""can i get the matching wallpaper? ;)"")</p><p>So I tried to google on how to put some image file inside apk so that it would appear in wallpapers selection list after installation. I mean the list which appears when doing Home=>Menu=>Wallpaper=>Wallpaper Gallery or Pictures - whatever.</p><p>So far didn't find any hints, so decided to try to ask here.</p><p>Any hints on how to do that?</p>","258848","","244296","","2010-09-15 13:04:55","2010-09-15 16:01:30","How to put a wallpaper inside an apk file?","<android><wallpaper><apk>","1","0","1","",""
"3717866","1","3718612","","2010-09-15 13:07:37","0","3334","<p>I'm relatively new to java and android, in my android application I need to get xml file, transform it and show to user. </p><p>I know how to parse xml, but I don't want to parse it and generate view after. I'd like to transform it to html and display in WebView.</p><p>I'm trying to find something on the Internet but can't find anything((</p><p>How can I do it? Any ideas or links will be appreciated,</p><p>thanks</p>","386817","","","","","2013-10-16 11:35:33","How can I transform xml to html on android?","<java><html><android><xml><transform>","3","0","1","",""
"3717876","1","","","2010-09-15 13:08:19","0","992","<p>I have an application with a WebView. The WebView opens a page and there is a input field on the page. If the users clicks on the input field and presses for long some of the submission buttons, a ""input method"" popup appears (from Android).</p><p>How can I remove this popup? I tried override-ing the onTouch, onKeyLongPress and some other methods to return false, but it doesn't seem to work.</p>","346583","","49246","","2010-11-13 10:16:20","2010-11-13 10:16:20","Android - how to remove the ""input method"" popup?","<android><android-input-method>","1","2","","",""
"3717888","1","","","2010-09-15 13:09:48","-1","254","<p>Hey looking out for theme development for various Mobile Devices &amp; Platform:</p><p>Nokia and Sony have official Themes Creators/Preview and Manual. look for others also.</p><p>LG,HTC,Blackberry, Android,iPhones,Windows Mobile etc. </p>","448174","","","","","2010-09-15 15:46:27","Theme Design & Development For Mobile Phones","<iphone><android><windows><mobile><themes>","1","0","1","",""
"3717930","1","","","2010-09-15 13:15:56","1","738","<p>Good day, please kindly help me review this code and tell me what i am doing wrong. My listview is not returning the correct row position. it keeps giving me the previous row entry and not the one clicked and it gives me the error ""android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0"" when i try to click on the first entry in the list. </p><pre><code>import android.app.ListActivity;import android.content.ContentValues;import android.content.Context;import android.content.Intent;import android.database.Cursor;import android.graphics.Color;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.ListView;import android.widget.SimpleCursorAdapter;import android.widget.TextView;import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;public class ViewItems extends ListActivity implements OnItemClickListener{ DBAdapter adapter; Cursor cursor; ListView list; static final int ACTIVITY_EDIT = 0; public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.view_list);  adapter = new DBAdapter(this);  adapter.open();  fillData();  list = (ListView)findViewById(android.R.id.list);  list.setOnItemClickListener(this); } protected void fillData() {  Cursor cursor = adapter.retrieveItems();  startManagingCursor(cursor);    String[] from = new String[]{DBAdapter.NAME, DBAdapter.DATE, DBAdapter.TIME};    int[] to = new int[]{R.id.viewNameId, R.id.viewDateId, R.id.viewTimeId};    customCursorAdapter items = new customCursorAdapter(this, R.layout.view_items, cursor, from, to);    setListAdapter(items);    } public class customCursorAdapter extends SimpleCursorAdapter {  private int layout;  Context context;  public customCursorAdapter(Context context, int layout, Cursor cursor, String[]from, int[] to) {   super(context, layout, cursor, from, to);   this.layout = layout;   this.context = context;  }  @Override  public void bindView(View view, Context context, Cursor cursor) {   ViewHolder holder;   if(view != null){    holder = new ViewHolder();    holder.viewName = (TextView)view.findViewById(R.id.viewNameId);    holder.viewStartDate = (TextView)view.findViewById(R.id.viewDateId);    holder.viewStartTime = (TextView)view.findViewById(R.id.viewTimeId);    view.setTag(holder);   }else{    holder = (ViewHolder)view.getTag();   }   int namecol = cursor.getColumnIndex(DBAdapter.NAME);    String name = cursor.getString(namecol);   if(holder.viewName != null){   holder.viewName.setText(name);   holder.viewName.setTextColor(Color.RED);   }   String startDate = cursor.getString(cursor.getColumnIndex(DBAdapter.DATE));   holder.viewStartDate.setText(startDate);   String startTime = cursor.getString(cursor.getColumnIndex(DBAdapter.TIME));   holder.viewStartTime.setText(startTime);  }  @Override  public View newView(Context context, Cursor cursor, ViewGroup parent) {   LayoutInflater inflater = LayoutInflater.from(context);   final View view = inflater.inflate(layout, parent, false);   return view;  }  @Override  public long getItemId(int id){   return id;  } @Override  public Object getItem(int position){   return position;  } } static class ViewHolder{  TextView viewName;  TextView viewStartDate;  TextView viewStartTime; } public void onItemClick(AdapterView parent, View view, int position, long rowId) {   cursor = adapter.retrieveRow(rowId);  Intent edit = new Intent(this,AddItem.class);   edit.putExtra(DBAdapter.KEY_ID, rowId);   edit.putExtra(DBAdapter.NAME, cursor.getString(cursor.getColumnIndex(DBAdapter.NAME)));   edit.putExtra(DBAdapter.DATE, cursor.getString(cursor.getColumnIndex(DBAdapter.DATE)));   edit.putExtra(DBAdapter.TIME, cursor.getString(cursor.getColumnIndex(DBAdapter.TIME)));   startActivityForResult(edit, ACTIVITY_EDIT); } }</code></pre><p>I have tried and reviewed examples but no success. I have also tried to use OnListItemClick() method but that gives me a ""NullPointerException"", i don't know why. Its been so frustrating for some time now. Thanks in advance for your time.</p>","316843","","","","","2010-09-15 13:15:56","Problems with rows in ListView","<android>","0","3","","",""
"3717971","1","3718976","","2010-09-15 13:20:42","3","768","<p>I just want to group 4 buttons like this...</p><p>Portrait mode:</p><pre><code>[1][2][3][4]</code></pre><p>Landscape mode:</p><pre><code>[1][2][3][4]</code></pre><p>I dont want to hardcopy my Portrait mode xml-File and put it into the ""layout-land"" folder for this minor difference. Then, I have to modify two file when implementing new stuff.</p><p>Isnt that achievable through wraping it  up intelligently in some LinearLayouts? Something like this? ({} represent LinearLayouts)</p><pre><code>{{[1][2]}{[3][4]}}</code></pre>","433718","","433718","","2010-09-15 13:53:08","2010-09-15 15:07:30","Android: Making landscape view without layout-land?","<android><android-layout><android-linearlayout><android-xml>","1","1","","",""
"3718381","1","3750265","","2010-09-15 14:03:56","0","1860","<blockquote>  <p>Here is links to my files <a href=""http://www.leafonlineservices.com/xslt/default.xml"" rel=""nofollow"">XML</a>, <a href=""http://www.leafonlineservices.com/xslt/products.xslt"" rel=""nofollow"">XSLT</a>, <a href=""http://www.leafonlineservices.com/xslt/html.xslt"" rel=""nofollow"">Include XSLT</a></p></blockquote><p>Hi</p><p>I am transforming xml into html. My xml file is about 10kb big and my xslt 70kb and output html about 10kb big.</p><pre><code>Transformer xformer = StylesheetCache.newTransformer(templateFile);xformer.transform(new DOMSource(outlineDoc),new StreamResult(out));</code></pre><p>The creating of the transformer takes about 10s to create thats why i created cache that bring it down to 300ms if its cached. The transform line takes 3s to execute. Now is this long. I have written similar transforms on windows mobile and it execution time is about &lt;=1s</p><p>I changed the TransformerFactory to Saxon but the result was about the same.</p><p>thanks</p>","106955","","918472","","2013-10-18 09:30:01","2013-10-18 09:30:01","XSLT Transforming performance","<java><android><xml><xslt>","3","7","","",""
"3718413","1","3725844","","2010-09-15 14:07:04","-2","2149","<p>I have an <code>AbsoluteLayout</code> which has an <code>OnTouchListener</code>. Inside this layout there is a much smaller <code>LinearLayout</code> positioned dynamically. The OnTouchListener works as expected.</p><p>Now the problem comes when I add a <code>LongClickListener</code> to my <code>LinearLayout</code>. That disables my <code>OnTouchListener</code> if the touch hits the <code>LinearLayout</code> but it is still triggered, if the <code>LinearLayout</code> was <em>not</em> hit by the touch.</p><p>My listeners:</p><pre><code>// listener on parent (AbsoluteLayout)setOnTouchListener(new OnTouchListener() {    @Override    public boolean onTouch(View v, MotionEvent event) {        Log.e(""LOOOOGING"");        mLinearLayout.getHitRect(mNoteRect);        mNoteRect.left += mX;        mNoteRect.top += mY;        mNoteRect.right = mNoteRect.left + mLinearLayout.getWidth();        mNoteRect.bottom = mNoteRect.top + mLinearLayout.getHeight();        if (mNoteRect.contains((int) event.getX(), (int) event.getY())) {            if (event.getAction() == MotionEvent.ACTION_DOWN) {                mStartX = (int) event.getX() - mNoteRect.left;                mStartY = (int) event.getY() - mNoteRect.top;                return true;            }            mX = (int) event.getX() - mStartX;            mY = (int) event.getY() - mStartY;            setPadding(mX, mY, 0, 0);            return true;        }        return false;    }});// listener on child (LinearLayout)mLinearLayout.setOnLongClickListener(new OnLongClickListener() {    @Override    public boolean onLongClick(View v) {        // do something...        return true;    }});</code></pre><p>How can I delegate the touch on the <code>LinearLayout</code> where the <code>OnLongClickListener</code> is registered, to the parent?</p>","180538","","","","","2010-09-16 10:41:54","OnLongClickListener on childView disables OnTouchListener on parentView","<android><gui><ontouchlistener><onlongclicklistener>","2","0","","",""
"3718465","1","3718553","","2010-09-15 14:14:20","3","7612","<p>I am trying to download a file from the net and write it to the SD card. I have the WRITE_EXTERNAL_STORAGE permission enabled. The code fails here:</p><pre><code>OutputStream output = new FileOutputStream(filePath);09-15 19:40:31.630: WARN/System.err(7933): java.io.FileNotFoundException: /sdcard/artoo/Customerv08.apk09-15 19:40:31.630: WARN/System.err(7933):     at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:231)09-15 19:40:31.630: WARN/System.err(7933):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:96)09-15 19:40:31.630: WARN/System.err(7933):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:169)09-15 19:40:31.630: WARN/System.err(7933):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:147)09-15 19:40:31.640: WARN/System.err(7933):     at com.artoo.settings.InstallerActivity$ProgressDialogAsyncTask.doInBackground(InstallerActivity.java:148)09-15 19:40:31.640: WARN/System.err(7933):     at com.artoo.settings.InstallerActivity$ProgressDialogAsyncTask.doInBackground(InstallerActivity.java:1)09-15 19:40:31.640: WARN/System.err(7933):     at android.os.AsyncTask$2.call(AsyncTask.java:185)09-15 19:40:31.640: WARN/System.err(7933):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)09-15 19:40:31.640: WARN/System.err(7933):     at java.util.concurrent.FutureTask.run(FutureTask.java:122)09-15 19:40:31.640: WARN/System.err(7933):     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)09-15 19:40:31.640: WARN/System.err(7933):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)09-15 19:40:31.651: WARN/System.err(7933):     at java.lang.Thread.run(Thread.java:1060)09-15 19:40:31.670: WARN/InputManagerService(53): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43868480</code></pre><p>I am trying to write the file and it doesn't exists from before. Any ideas on how to do this?</p>","356580","","356580","","2010-09-16 07:57:14","2013-06-14 11:29:19","FileNotFoundException + Writing a File to SD Card","<android><file-io><sd-card>","2","4","2","",""
"3718473","1","","","2010-09-15 14:15:15","3","271","<p>When my app is installed from Google Play, it causes a the Application Manager on Android 2.1-update1 to force close (Android settings, Applications, Manage applications). When installed through Eclipse/ADB, however, the problem doesn't occur.</p><p>Here the exception:</p><pre><code>Uncaught handler: thread main exiting due to uncaught exceptionjava.lang.ArrayIndexOutOfBoundsException    at com.android.settings.ManageApplications$AppInfoAdapter.bulkUpdateLabels(ManageApplications.java:1197)    at com.android.settings.ManageApplications$1.handleMessage(ManageApplications.java:404)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4595)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:521)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>It appears to go paired with many warnings from the ResourceType and PackageManager:</p><pre><code>W/ResourceType(  696): No package identifier when getting name for resource number 0x00000000W/PackageManager(  696): Failure retrieving text 0x0 in package com.android.providers.drmW/PackageManager(  696): android.content.res.Resources$NotFoundException: String resource ID #0x0W/PackageManager(  696):        at android.content.res.Resources.getText(Resources.java:200)W/PackageManager(  696):        at android.app.ApplicationContext$ApplicationPackageManager.getText(ApplicationContext.java:2306)W/PackageManager(  696):        at com.android.settings.ManageApplications$ResourceLoaderThread.run(ManageApplications.java:771)</code></pre>","395135","","154306","","2013-01-05 01:02:06","2013-01-05 01:02:06","App causing Force Close in Application Manager","<android><google-play>","0","9","1","",""
"3718474","1","","","2010-09-15 14:15:21","9","411","<p>According to the ""Application Fundamentals"" article, section ""component lifecycle"", onResume() is always called when a View becomes active, independent of the previous state.</p><p>In the Notepad tutorial, Exercise 3, I have found something confusing in NoteEdit.java:<br>There is a call to populateFields() in onCreate() as well as in onResume().<br>Wouldn't it be enough (or even better) to have it only in onResume() ?</p><p>In such a small example, it will not do any harm if populateFields() is performed twice, but in a bigger App, things can be different ...</p><p>Thanks and Regards,<br>Markus N.</p>","448506","","1228","","2013-08-14 15:55:04","2013-08-14 15:55:04","Android - Notepad tutorial - lifecycle - some work done twice?","<android><lifecycle>","2","3","2","",""
"3718523","1","","","2010-09-15 14:20:19","7","16852","<p>Hi I am new in Android. Could anyone tell me pls whats the wrong with the following code:</p><pre><code>public class ListApp extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        TextView lText = new TextView(this);        lText.setId(0);               ListView lView = new ListView(this);        String[] lStr = new String[]{""AA"",""BB"", ""CC""};        ArrayAdapter lAdap = new ArrayAdapter(this,lText.getId(),lStr);        lView.setAdapter(lAdap);        lView.setFocusableInTouchMode(true);                setContentView(lView);    }}</code></pre>","404333","","111988","","2011-05-20 11:52:22","2011-06-03 19:21:47","Create ListView programmatically","<android><listview>","5","2","1","",""
"3718687","1","3725544","","2010-09-15 14:38:00","12","4792","<p>How can I get the number of unread sms in android?</p>","419921","","","","","2013-08-10 18:56:50","Get number of unread sms","<android>","2","0","5","",""
"3719006","1","","","2010-09-15 15:09:51","0","487","<p>How does Helix Server work with android application? In android developers site i found that we can assign the url to MediaPlayer to stream the audio/video. But there is no specification about buffer size.. do i need to do any more coding on server side or in android application to get the streaming work for a specific buffer rate?</p><p>I am new to streaming.. Please enlighten me regarding this.. Thank you in advance.. </p>","365184","","102937","","2013-04-08 18:40:26","2013-04-08 18:40:26","How to stream Audio from Helix Server?","<android><audio-streaming><helix-server>","1","0","1","",""
"3719113","1","","","2010-09-15 15:20:29","4","6900","<p>The screen displays four buttons. When a button is pressed, a media player plays a sound. The problem I'm having is implementing setClickable for all buttons at the same time.</p><p>Once a button is clicked, I want all buttons to be unclickable until the media player is finished playing the sound associated with the button click. Then I want all buttons to be set back to clickable.</p><p>The code runs fine until I enable the setClickable code--the code for buttonOne is disabled in my code sample below. The test phone locks up and tells me the application has stopped and to try again.</p><p>Unfortunately, without setClickable, the user could press any button and hear any sound before the first selected sound is finished playing. </p><p>Thank you for your time and help.</p><pre><code>import android.app.Activity;import android.app.AlertDialog;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.widget.ImageButton;import android.media.MediaPlayer;import android.media.MediaPlayer.OnCompletionListener;public class hipsterdoofus  extends Activity{ private int asoundfilenumber;//integer id of sound file to be played public ImageButton buttonOne; public ImageButton buttonTwo; public ImageButton buttonThree; public ImageButton buttonFour; public void myClickHandler(View v) {    switch (v.getId())       {        case R.id.buttonOne:         asoundfilenumber=0x7f040000;         break;        case R.id.buttonTwo:         asoundfilenumber=0x7f040001;         break;        case R.id.buttonThree:         asoundfilenumber=0x7f040002;         break;        case R.id.buttonFour:         asoundfilenumber=0x7f040003;         break;           }//closes switch test    freezeButtonsAndPlaySoundThenUnfreezeButtons();  }//closes onClick  public void freezeButtonsAndPlaySoundThenUnfreezeButtons() {  **//buttonOne.setClickable( false );//sets buttonOne to unclickable**  MediaPlayer mp = MediaPlayer.create(getBaseContext(), asoundfilenumber);  mp.start();  mp.setOnCompletionListener(new OnCompletionListener()//listens for player to finish then releases player   {   @Override   public void onCompletion(MediaPlayer mpalmost)     {    mpalmost.release();    }   });  **//buttonOne.setClickable( true ); //sets buttonOne to clickable** } public void onCreate(Bundle savedInstanceState) {     super.onCreate( savedInstanceState );        setContentView( R.layout.main );    }</code></pre>","351300","","","","","2010-12-15 12:38:00","Android. How do I set all buttons clickable or unclickable at same time using setClickable?","<android><button><click><clickable>","1","0","1","",""
"3719127","1","3719590","","2010-09-15 15:22:24","2","2237","<p>In my Android app I want to have an input field with autocomplete. The number of items will be about 300000. The best solution seems to be to put the items into a file (on sdcard), one item per line, each line would have the same number of characters so that I can seek to specific line number. If the user enters something in the text field, I would binary search (via RandomAccessFile) the file and show suggestions.</p><p>I want the autocomplete to be super fast (ideally under 100ms but I guess it's impossible), what optimizations I can do?</p><p><strong>Update 1:</strong>I will convert the users input to lowercase english characters (a-z) with spaces. So 'A/b' would be converted to 'a b' and then searched.</p><p><strong>Uodate 2:</strong>I now realized I need additional thing - to search for word-starting substrings.</p>","243225","","243225","","2010-09-15 21:34:31","2012-04-30 12:44:12","Super fast autocomplete using binary search in sorted file (300000 lines)","<java><android><optimization><binary-search>","11","0","3","",""
"3719147","1","3719189","","2010-09-15 15:24:09","12","1123","<p>I'm looking for ways to reduce what I would call ""id pollution"" in my apps.  From what I can tell, <code>R.id</code> is global to the application, so in every Activity I usually create unique resource id values for elements, even if I have many of the same thing.  For example, if I have three Activity classes, each with a save and cancel button, I would define six unique id's for <code>R.id</code> like:</p><pre><code>R.id.actOne_saveR.id.actOne_cancelR.id.actTwo_saveR.id.actTwo_cancelR.id.actThree_saveR.id.actThree_cancel</code></pre><p>This seems unnecessary to me, as I should really only need two running on any Activity.  What are some of the practices that you all use when generating resource ids?  Do you reuse them between activites?  Is that OK if an id exists on two Activites (maybe one paused and one foreground) at the same time?  I'm afraid of weird behavior like a button click hitting too many listeners!</p>","246461","","","","","2010-09-15 17:09:38","Scope of R.id values","<android><resources>","3","0","1","",""
"3719311","1","3719427","","2010-09-15 15:39:36","1","184","<p>I have an unlockable mode in my game that is only available once the story mode has been completed. This works perfectly if the story mode is completed during a test play through, because upon returning to the main menu the bonus mode is unlocked and selectable. However when I shut down the app and relaunch it, none of the previous state information is retained and it requires you to beat the story mode again to access the bonus mode.</p><p>I use the onSaveInstanceState method to create a bundle that stores this information (ie. a boolean whether the mode is unlocked or not), but this information seems to be lost between ending the app, and relaunching it. The onCreate method takes the parameter of a savedInstanceState but yet this seems to be null.</p><p>Is there a step that I'm missing out, or doing incorrectly somewhere along the line? On a PC game I would just serialize the state into a text file and look for a special string/symbol upon initialization but I cant do that here so i thought the outState bundle you create in SIS was how you retained information for use upon next launching the app again?</p>","300037","","","","","2010-09-15 15:54:50","Android - Storing Game State Information That Is Retained And Used Upon Next Start-Up","<android>","2","0","","",""
"3719327","1","3719533","","2010-09-15 15:40:34","0","2453","<p>So I have this code in my main activity to start a new one:</p><pre><code>public class MainActivity extends Activity{    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        findViewById(R.id.GoButton).setOnClickListener(new View.OnClickListener()        {            public void onClick(View v)            {                                   Intent myIntent = new Intent(MainActivity.this, NewActivity.class);                MainActivity.this.startActivity(myIntent);                //finish();            }        });    }}</code></pre><p>My new activity extends ListActivity and when I call this code by pressing the button it crashes the application. However if I make the MainActivity extend ListActivity then it works great (although I have to replace the button with a List!). Does anyone know why this happens, and how can I make it work using the code above?</p><p>Thanks</p>","143979","","","","","2010-09-15 16:01:41","Starting new activity in the Android SDK","<java><android><activity><listactivity>","1","4","","",""
"3719352","1","3728771","","2010-09-15 15:42:01","0","963","<p>Whats the best way to create a dart board game on Android. Is it possible to determine where a dart hit and in which area it is using a canvas or do I need to use a diffenrent approach?</p><p><strong>Edit</strong></p><p>Sorry I dont think I have explained my problem very well.</p><p>In svg in html5 I can create a dart board using shapes and assign an id to each shape. When a dart lands on a shape the code knows which shape it has landed on, gets its id and calculates the score. e.g id=""20"" id=""60"" id=""40"" for all 20 areas on a dart board.</p><p>How would I do this on the Android?</p>","128327","","128327","","2010-09-15 20:55:43","2010-09-20 15:37:47","How to select shape on canvas in Android","<android><canvas>","2","0","","",""
"3719423","1","3719509","","2010-09-15 15:49:01","1","2329","<p>I am styling a Button whose width can change in the program through different Content. I got the png files from the designer like this: </p><pre><code>[Left Border] [Background (just a strip with the gradient)] [Right Border]</code></pre><p>I thought I'm fine with assigning the Properties of the Button like this:</p><pre><code>Background: Background.pngDrawable left: LeftBorder.pngDrawable right: RightBorder.png</code></pre><p>BUT it shall not be like that ;) Right now the Background.png begins where the Drawable Left begins and ends at the end of Drawable Right. Is using those Drawable Properties not the right way in this case?</p><p>Here is the Code:</p><pre><code>&lt;Button  android:text=""@+id/Button01""  android:id=""@+id/Button01""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:drawableLeft=""@drawable/top_loaction_left""  android:drawableRight=""@drawable/top_loaction_right""  android:background=""@drawable/top_loaction_bg""&gt;&lt;/Button&gt;</code></pre><p>..</p>","433718","","433718","","2010-09-17 07:37:50","2010-09-17 07:37:50","Android / Styling a Button: Background also behind Drawable left and Drawable right","<android><button><android-layout><nine-patch><android-xml>","1","0","","",""
"3719446","1","4141646","","2010-09-15 15:52:26","1","374","<p>I have two Uris.  Suppose they are:</p><pre><code>content://myprovider/messagescontent://myprovider/messages/#</code></pre><p>In my extended ContentProvider I have declared the following:</p><pre><code>    private static final int MESSAGES = 1;    private static final int MESSAGES_ID = 2;    private static final UriMatcher sUriMatcher;    static {        sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);        sUriMatcher.addURI(""myprovider"", ""messages"", MESSAGES);        sUriMatcher.addURI(""myprovider"", ""messages/#"", MESSAGES_ID);    }</code></pre><p>When I use the... </p><pre><code>content://myprovider/messages/#</code></pre><p>...Uri when calling any ContentProvider method, say insert, and my ContentProvider method does a...</p><pre><code>sUriMatcher.match(uri)</code></pre><p>...and I get back 1 (MESSAGES).</p><p>Why???</p>","406790","","","","","2012-07-24 00:40:22","UriMatcher handing back wrong value","<android><uri><android-contentprovider>","1","1","","",""
"3719544","1","3719805","","2010-09-15 16:02:49","3","2591","<p>I have some problem with the injecting of my cookie into login.php page. This is the code:</p><pre><code>LinearLayout lLayout = (LinearLayout)findViewById(R.id.linearlayoutIdLogin);lLayout.setVisibility(View.GONE); //make my standard layout inivisibleLinearLayout lWeb = (LinearLayout)findViewById(R.id.webviewId); lWeb.setVisibility(View.VISIBLE); //make my webview visibleWebView browse = (WebView)findViewById(R.id.webViewBrowse);</code></pre><p>The code above is correct. I got my WebView to load but then the page says I need to login.</p><p>This is the cookie injection that doesn't work for me.</p><pre><code>Cookie setcookie = cookie.get(1);Cookie othercookie = cookie.get(0);/* I assign my two cookies from a List&lt;Cookie&gt;. cookie.get() brings the element I need. The cookies overall contains two fields. Therefore the get 1 and get 0. All this works, I have tested to make a Toast toprint out the cookies *///Here it must be anything I'm doing wrong?CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptCookie(true);cookieManager.setCookie(""http://www.thedomain.com"", setcookie.getValue());browse.setWebViewClient(new WebViewClient(){ });browse.loadUrl(""mypagewhenloggedin.php"");</code></pre><p>Any ideas? Have been stuck on this for a several hours. Thanks in advance!</p><p>Edited code:Forgot to say I added this cookie too.</p><p><code>cookieManager.setCookie(""http://www.thedomain.com"", othercookie.getValue());</code></p>","386562","","386562","","2010-09-15 16:37:38","2010-09-15 16:40:20","Inject cookie into WebView doesn't work","<java><android>","2","0","1","",""
"3719607","1","3720328","","2010-09-15 16:11:35","1","402","<p>I'm binding to a local <code>Service</code> (that is, not using IPC and AIDL) from several activities. I want to ensure that I'm not holding references to this service from activities that the user isn't using.</p><p>My options are: 1.) to bind to the service in <code>onCreate()</code> and unbind in <code>onDestroy()</code>.2.) bind in <code>onStart()</code> and unbind in <code>onStop()</code>.3.) bind in <code>onResume()</code> and unbind in <code>`onPause()</code>. Or some combination of these.</p><p>Which is the best-practice way of binding and unbinding to a local service? Do I not need to be concerned with holding local connections from stopped activities?</p><p>Additionally, once bound to this particular service I am retrieving a <code>Cursor</code> which is attached to my <code>ListActivity</code> via a <code>CursorAdapter</code>. The data retrieved by the Cursor may have changed while the Activity was out of view so I want to requery it when the Activity is shown again. If I bind in <code>onCreate()</code> I can requery in <code>onRestart()</code>. If I bind in <code>onResume()</code> each time the data will be fresh because I'll query it in the Service's connected callback.</p><p>Thoughts, comments, critiques or suggestions?</p>","300368","","","","","2010-09-15 17:53:38","Using Activtiy lifecycle methods, what's the best strategy for binding and unbinding to a local service?","<android>","1","0","","",""
"3719632","1","","","2010-09-15 16:15:45","2","2130","<p>HI,</p><p>I have array list of geopoints</p><pre><code>List&lt;GeoPoint&gt; geoPointsArray = new ArrayList&lt;GeoPoint&gt;();</code></pre><p>I want to put geoPointsArray array in to SQLite database and then fetch the data back as an array. </p><p>If anyone has a solution I would be greatly appreciated. </p><p>P.S.</p><p>Now I use ContentValues  for insert into array as:</p><pre><code>        ContentValues initialValues = new ContentValues();        initialValues.put(KEY_TIME, time);        db.insert(tableName, null, initialValues);</code></pre>","432848","","404469","","2010-09-15 19:52:07","2010-09-15 19:52:07","Insert ArrayList in to Android SQLite database?","<android><sqlite>","2","0","","",""
"3719689","1","","","2010-09-15 16:23:34","2","650","<p>When I am doing the project editing works, I have deleted the AndroidManifest.xml file.</p><p>Is any   way to recover the AndroidManifest.xml file? </p>","442245","","1630201","","2012-06-11 09:08:14","2012-06-11 18:29:19","How to Retrieve the AndroidManifest.xml file ?","<android>","2","2","","",""
"3719736","1","","","2010-09-15 16:29:37","3","2786","<p>I'm currently writing an android side-scrolling game and am having trouble filling a path with a repeating bitmap image. I'm creating a path from a number of coordinates to make up the ""ground"" area. I have a character who is fixed in the middle of the canvas and screen and am moving the path to represent the movement of the character. I've been able to fill the path with a repeating image using a BitmapShader. Also I can move the path shape from side to side on the screen. However, the Bitmapshader seems to be using a default origin of 0,0 which means the shader is always drawing the ground repeating image in the same place. This means that even though the path is moving the ground repeated image never appears to move. Does anyone have any idea how to change the origin of the shader or know of a better way to fill the path with a repeating image?</p><p>Alternatively, can anyone suggest a better solution for filling a drawable shape with an image?</p><p>ThanksAndy</p>","448635","","","","","2010-09-15 20:25:17","moving a path with a repeating Bitmap image in android","<android><path><bitmap><fill><repeating>","2","0","","",""
"3719774","1","3719850","","2010-09-15 16:36:01","1","522","<p>I am working with a ListActivity, and I'm trying to add images/backgrounds, ext to make everything look nice. However i have run into a little snag.</p><p>The layout for the activity defines a background image, but the list items are not always transparent, and therefore cover up the background. If i am scrolling, or have otherwise touched a list item, the list item's backgrounds are transparent (as desired) but if i touch anything else they get a black background which covers up the Activity's background.</p><p>Is there some value i can set like, android:background=""invisible"" or something else to fix this problem?</p><p>TIA</p>","339428","","","","","2010-09-15 16:47:48","Android: how do i make a View's background invisible?","<android><layout><background>","2","0","","",""
"3719933","1","3722451","","2010-09-15 16:59:13","3","140","<p>I have a simple Android OpenGL-ES app, and as all the models are very simple (&lt;10 vertices!) I have implemented a global ""world"" class that tracks all the vertices, and performs a single pair of GL commands on the frame rendering.</p><p>Each model object adds it's vertices to the global buffers, and these these are 'sent' to GL in one operation:</p><pre><code>gl.glVertexBuffer(...);gl.glDrawElements(...);</code></pre><p>My question (perhaps an obvious answer, but I want to be sure) is, does this mean I have to do all my own rotations manually?</p><p>My base objects just define a bunch of vertices that get added to the cache, for example a triangle, a square, a pentagram, etc.  My World object then takes the big array of vertices, and dumps them out to GL.  If I want to rotate all those, am I correct in thinking I have to perform my own vertex coordinate manipulations (trigonometry!)?</p><p>I guess it's not the end of the world to have to create some utility functions to rotate all the vertices in my models, but I'd rather not if it's not necessary.</p>","138033","","","","","2010-09-15 22:55:11","Using a global vertex cache and still take advantage of glRotate?","<android><opengl-es>","2","2","","",""
"3720315","1","3723920","","2010-09-15 17:52:00","1","2233","<p>Is it possible to have a callout attached to an ItemizedOverlay item like in the iPhone and Google maps?</p>","103999","","","","","2010-09-16 05:22:37","Callout MapView Android","<android><google-maps><map><overlayitem>","1","0","1","",""
"3720334","1","3721069","","2010-09-15 17:54:05","1","1912","<p>I know this is a long post. Pls don't mind.</p><pre><code>Leak foundE/Database( 4549): java.lang.IllegalStateException: mPrograms size 1E/Database( 4549):  at android.database.sqlite.SQLiteDatabase.finalize(SQLiteDatabase.java:1668)E/Database( 4549):  at dalvik.system.NativeStart.run(Native Method)E/Database( 4549): Caused by: java.lang.IllegalStateException: /data/data/com.rjblackbox.droid.fvt/databases/fvt.db SQLiteDatabase created and never closedE/Database( 4549):  at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1694)E/Database( 4549):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738)E/Database( 4549):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:760)E/Database( 4549):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:753)E/Database( 4549):  at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473)E/Database( 4549):  at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)E/Database( 4549):  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)E/Database( 4549):  at com.rjblackbox.droid.fvt.FVTDataHelper.&lt;init&gt;(FVTDataHelper.java:37)E/Database( 4549):  at com.rjblackbox.droid.fvt.FVTNotificationService.getNextEntry(FVTNotificationService.java:91)E/Database( 4549):  at com.rjblackbox.droid.fvt.FVTNotificationService.access$2(FVTNotificationService.java:90)E/Database( 4549):  at com.rjblackbox.droid.fvt.FVTNotificationService$1.run(FVTNotificationService.java:53)E/Database( 4549):  at android.os.Handler.handleCallback(Handler.java:587)E/Database( 4549):  at android.os.Handler.dispatchMessage(Handler.java:92)E/Database( 4549):  at android.os.Looper.loop(Looper.java:123)E/Database( 4549):  at android.app.ActivityThread.main(ActivityThread.java:4363)E/Database( 4549):  at java.lang.reflect.Method.invokeNative(Native Method)E/Database( 4549):  at java.lang.reflect.Method.invoke(Method.java:521)E/Database( 4549):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/Database( 4549):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/Database( 4549):  at dalvik.system.NativeStart.main(Native Method)</code></pre><p>This is the stack trace of my memory leak. Below is the source code for my data Helper. In addition to an <strong>Activity</strong>, I also have a <strong>Service</strong> accessing the data. This must be a piece of cake for experienced developers.</p><pre><code>public class FVTDataHelper {    private static final String DB_NAME = ""fvt.db"";    private static final int DB_VERSION = 1;    private static final String TABLE_TIMERS = ""timers"";    private static final String[] TABLE_TIMERS_COLUMNS = {""id"", ""name"", ""added"", ""expires""};    private static final String TIMER_INSERT = ""INSERT INTO "" +     TABLE_TIMERS + ""('name', 'added', 'expires') VALUES (?, ?, ?)"";    private SQLiteDatabase db;    private Cursor c;    private SQLiteStatement timerInsert;    //Constructor    public FVTDataHelper(Context ctx) {        OpenHelper oh = new OpenHelper(ctx);        db = oh.getWritableDatabase();        timerInsert = db.compileStatement(TIMER_INSERT);    }    public void addTimerEntry(TimerEntry entry) {        String name = entry.getName();        long added = entry.getAdded();        long expires = entry.getExpires();        timerInsert.bindString(1, name);        timerInsert.bindString(2, Long.toString(added));        timerInsert.bindString(3, Long.toString(expires));        timerInsert.executeInsert();    }    public List&lt;TimerEntry&gt; getTimerEntries() {        ArrayList&lt;TimerEntry&gt; entries = new ArrayList&lt;TimerEntry&gt;();        c = db.query(TABLE_TIMERS, TABLE_TIMERS_COLUMNS, null, null, null, null, ""expires asc"");        if(c.moveToFirst()) {            int id;            String name;            long added;            long expires;            do {                id = c.getInt(0);                name = c.getString(1);                added = c.getLong(2);                expires = c.getLong(3);                if((System.currentTimeMillis() - added) &gt;= 0) {                    entries.add(new TimerEntry(id, name, added, expires));                }            } while(c.moveToNext());        }        c.close();        return entries;    }    public void deleteTimerEntry(int id) {        db.delete(TABLE_TIMERS, ""id="" + id, null);    }    //Helper class for creating and updating database     private static class OpenHelper extends SQLiteOpenHelper {        private Context ctx;        public OpenHelper(Context ctx) {            super(ctx, DB_NAME, null, DB_VERSION);            this.ctx = ctx;        }        @Override        public void onCreate(SQLiteDatabase db) {            String sqlDump = getSQLDump();            String[] statements = sqlDump.split(""\n"");            for(String statement : statements) {                if(DEBUG) Log.d(TAG, statement);                db.execSQL(statement);            }        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            onCreate(db);        }        //Helper: Returns SQL statements from the dump        private String getSQLDump() {            StringBuilder sb = new StringBuilder();            try {                InputStream is = ctx.getAssets().open(""dump.sql"");                int c;                while((c = is.read()) != -1) {                    sb.append((char) c);                }                is.close();            } catch (IOException e) {                Log.d(TAG, e.getMessage());            }            return sb.length() &gt; 0 ? sb.toString() : "";"";        }    }}</code></pre>","421372","","","","","2010-09-15 19:25:49","Android SQLite memory leak","<sql><android><sqlite>","1","2","2","",""
"3720530","1","6164521","","2010-09-15 18:19:50","5","8779","<p>I am displaying images and some text in a list view with an adapter.  The images are pulled from the web, then cached locally and displayed.  The images are already small (60px square), and I know their size, so I'm using the <a href=""http://www.helloandroid.com/tutorials/how-avoid-outofmemory-oom-exception-using-bitmaps-solved"">advice from here suggesting I use setImageURI instead of decoding the bitmap</a>.  </p><p>The class that does the work is a modified version of Fedor's <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">ImageLoader</a></p><p>The code attaches a stub drawable to the ImageView until the desired image is downloaded from the web, then loads the cached file from the sdcard.  In Android 2.2 this works just fine.  It's fast, and I don't get OOM crashes.  On 2.1, though, I get the following error:</p><pre><code>09-15 11:04:52.993: INFO/System.out(240): resolveUri failed on bad bitmap uri: file:///sdcard/android/data/com.example.myapp/cache/4164137</code></pre><p>The ImageLoader class is as follows:</p><pre><code>/*Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements.  See the NOTICE filedistributed with this work for additional informationregarding copyright ownership.  The ASF licenses this fileto you under the Apache License, Version 2.0 (the""License""); you may not use this file except in compliancewith the License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing,software distributed under the License is distributed on an""AS IS"" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, either express or implied.  See the License for thespecific language governing permissions and limitationsunder the License.    */public class ImageLoader {    //the simplest in-memory cache implementation. This should be replaced with something like SoftReference or BitmapOptions.inPurgeable(since 1.6)    private HashMap&lt;String, Uri&gt; cache=new HashMap&lt;String, Uri&gt;();    private File cacheDir;    public ImageLoader(Context context){        //Make the background thead low priority. This way it will not affect the UI performance        photoLoaderThread.setPriority(Thread.NORM_PRIORITY-1);        //Find the dir to save cached images        if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))            cacheDir=new File(android.os.Environment.getExternalStorageDirectory(),""Android/data/com.droidicon.launcherproicons/cache/"");        else            cacheDir=context.getCacheDir();        if(!cacheDir.exists())            cacheDir.mkdirs();    }    final int stub_id=R.drawable.loading;    public void DisplayImage(String url, Activity activity, ImageView imageView, int scaleSize)    {        if(cache.containsKey(url))            imageView.setImageURI(cache.get(url));        else        {            queuePhoto(url, activity, imageView, scaleSize);            imageView.setImageResource(stub_id);        }        }    private void queuePhoto(String url, Activity activity, ImageView imageView, int scaleSize)    {        //This ImageView may be used for other images before. So there may be some old tasks in the queue. We need to discard them.         photosQueue.Clean(imageView);        PhotoToLoad p=new PhotoToLoad(url, imageView, scaleSize);        synchronized(photosQueue.photosToLoad){            photosQueue.photosToLoad.push(p);            photosQueue.photosToLoad.notifyAll();        }        //start thread if it's not started yet        if(photoLoaderThread.getState()==Thread.State.NEW)            photoLoaderThread.start();    }    private Uri getUri(String url, int scaleSize){        if(url != """"){            //I identify images by hashcode. Not a perfect solution, good for the demo.//          try{            String filename=String.valueOf(url.hashCode());            File f=new File(cacheDir, filename);            //from SD cache            if(f.exists()){                Uri b = Uri.fromFile(f);                System.out.println(f.toString());                return b;            }            //from web            try {                Uri bitmap=null;                InputStream is=new URL(url).openStream();                OutputStream os = new FileOutputStream(f);                Utils.CopyStream(is, os);                os.close();                bitmap = Uri.fromFile(f);                System.out.println(f.toString());                return bitmap;            } catch (Exception ex){               ex.printStackTrace();               return null;            }            } else {                return null;            }    }    //Task for the queue    private class PhotoToLoad    {        public String url;        public ImageView imageView;        public int scaleSize;        public PhotoToLoad(String u, ImageView i, int ss){            url=u;             imageView=i;            scaleSize=ss;        }    }    PhotosQueue photosQueue=new PhotosQueue();    public void stopThread()    {        photoLoaderThread.interrupt();    }    //stores list of photos to download    class PhotosQueue    {        private Stack&lt;PhotoToLoad&gt; photosToLoad=new Stack&lt;PhotoToLoad&gt;();        //removes all instances of this ImageView        public void Clean(ImageView image)        {            for(int j=0 ;j&lt;photosToLoad.size();){                if(photosToLoad.get(j).imageView==image)                    photosToLoad.remove(j);                else                    ++j;            }        }    }    class PhotosLoader extends Thread {        public void run() {            try {                while(true)                {                    //thread waits until there are any images to load in the queue                    if(photosQueue.photosToLoad.size()==0)                        synchronized(photosQueue.photosToLoad){                            photosQueue.photosToLoad.wait();                        }                    if(photosQueue.photosToLoad.size()!=0)                    {                        PhotoToLoad photoToLoad;                        synchronized(photosQueue.photosToLoad){                            photoToLoad=photosQueue.photosToLoad.pop();                        }                        Uri bmp=getUri(photoToLoad.url, photoToLoad.scaleSize);                        cache.put(photoToLoad.url, bmp);                        if(((String)photoToLoad.imageView.getTag()).equals(photoToLoad.url)){                            UriDisplayer bd=new UriDisplayer(bmp, photoToLoad.imageView);                            Activity a=(Activity)photoToLoad.imageView.getContext();                            a.runOnUiThread(bd);                        }                    }                    if(Thread.interrupted())                        break;                }            } catch (InterruptedException e) {                //allow thread to exit            }        }    }    PhotosLoader photoLoaderThread=new PhotosLoader();    class UriDisplayer implements Runnable    {        Uri uri;        ImageView imageView;        public UriDisplayer(Uri u, ImageView i){uri=u;imageView=i;}        public void run() {            File f = new File(uri.getPath());            if(f.exists()){                imageView.setImageURI(uri);            } else {                imageView.setImageResource(stub_id);            }        }    }    public void clearCache() {        //clear memory cache        cache.clear();        //clear SD cache        File[] files=cacheDir.listFiles();        for(File f:files)            f.delete();    }}</code></pre><p>Here is one of the adapters that implements this ImageLoader:</p><pre><code>public class ColorAdapter extends ArrayAdapter&lt;Color&gt; {    private Activity activity;    private int resource;    private String response;    private Context context;    public ImageLoader imageLoader;    public ColorAdapter(Activity a, Context context, int resource, List&lt;Color&gt; items){        super(context, resource, items);        this.resource=resource;        imageLoader=new ImageLoader(context);        activity = a;    }    @Override    public View getView(int position, View convertView, ViewGroup parent){        Color color =  getItem(position);        String minflater = Context.LAYOUT_INFLATER_SERVICE;        LayoutInflater inflater;        inflater = (LayoutInflater)getContext().getSystemService(minflater);        ViewHolder holder;        if(convertView==null){            convertView = inflater.inflate(R.layout.listcolors, parent, false);            holder=new ViewHolder();            holder.txtName=(TextView)convertView.findViewById(R.id.txtName);            //holder.txtUser=(TextView)convertView.findViewById(R.id.txtUser);            holder.imgColorImg=(ImageView)convertView.findViewById(R.id.imgColorImg);            convertView.setTag(holder);        }        else            holder=(ViewHolder)convertView.getTag();        holder.txtName.setText(color.getName());        //holder.txtUser.setText(dock.getUser());        holder.imgColorImg.setTag(color.getIconURL());        imageLoader.DisplayImage(color.getIconURL(), activity, holder.imgColorImg, 84);        return convertView;    }    class ViewHolder{        TextView txtName;        //TextView txtUser;        ImageView imgColorImg;    }}</code></pre>","241204","","241204","","2010-09-16 18:11:20","2011-05-28 21:43:08","Why would ImageView.setImageURI() work in Android 2.2 but not 2.1?","<android><uri><imageview>","2","0","4","",""
"3720581","1","3720647","","2010-09-15 18:25:09","1","903","<p>I am a beginner in programming with Java Android. I am currently confused with how to start an activity in Android 2.1. My current project requires a lot of different activities to work together in one program. Let's say I have a button inside the main.xml and assume the function inside ButtonAdroid.class is the one below: </p><pre><code>public class ButtonAndroid extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         final Button button = (Button) findViewById(R.id.button_id);         button.setOnClickListener(new View.OnClickListener() {             public void onClick(View v) {                 // Perform action on click             }         });    }}</code></pre><p>My goal is to make a connection between the ButtonAndroid.class to another class, let's say its name is NextPage.java. Do you guys know what kind of commands do I need to put inside <code>public void onClick(View v)</code> that will enable the current activity to switch to NextPage.java?</p><hr><p>After using your answer, apparently there is still an error. I have 2 classes named HelloRelativeLayout and HelloRelativeLayout2.</p><p>The error says the application has stopped unexpectedly. Does this mean I have to add intent-filter or something inside the XML?</p><pre><code>public class HelloRelativeLayout extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final Button button = (Button) findViewById(R.id.signIn);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                // Perform action on click             Intent i = new Intent(HelloRelativeLayout.this, HelloRelativeLayout2.class);             startActivity(i);            }        });    }}</code></pre>","448732","","741249","","2012-05-02 13:29:21","2012-12-03 10:48:55","How to start activity in Android 2.1","<android><button><android-activity>","3","1","","",""
"3720744","1","","","2010-09-15 18:46:38","0","407","<p>I'm developing an Android app with NetBeans, and I'm trying to play a sound with</p><pre><code>MediaPlayer mp;mp = MediaPlayer.create(this, R.raw.a);mp.start();</code></pre><p>There is a file named ""a.mp3"" in the res/raw directory, but for some reason I'm getting a file not found exception on line 2. What's the problem?</p>","448759","","122607","","2011-02-01 16:18:04","2012-11-30 18:50:30","File not found exception while trying to play sound with MediaPlayer","<android><netbeans><audio>","2","2","","",""
"3720804","1","","","2010-09-15 18:54:32","3","8632","<p>Is there a way for a button to call a submenu?  </p><p>I currently have a menu where if they select one of the options it opens a submenu, however I want to be able to start the submenu from the Button widget instead of the Menu object.</p><p>Thanks!</p>","448768","","703019","","2012-04-17 03:23:47","2012-04-17 03:23:47","Android Open Menu from a button","<android><button><menu><submenu>","3","0","2","",""
"3720943","1","3721032","","2010-09-15 19:09:22","1","147","<p>For example, the flash platform provides the flash.debugger.enterDebugger() API call that does the job:</p><pre><code>if (some_cond()){    ...}else{   enterDebugger();}</code></pre><p>In that case, if some_cond() evaluates to false and we're in a debug session (it does nothing if we're in a normal session), then the execution will be halted at the line where enterDebugger is invoked and control given to the debugger, as if a breakpoint was set at that line.</p><p>I've looked at the android.os package but found nothing like it. Throwing an exception does the job of giving the control to the debugger, but then the code execution cannot be resumed at the spot where the exception was thrown.</p>","448783","","229044","","2010-09-15 19:22:24","2010-09-15 19:22:24","Is there a function call to enter the debugger?","<android>","2","0","","",""
"3721033","1","","","2010-09-15 19:20:17","1","148","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2302867/android-how-to-determine-character-index-of-a-touch-events-position-in-textvie"">Android: How to determine character index of a touch event&#39;s position in TextView?</a>  </p></blockquote><p>I have an application that shows a textview occupying most of the screen.  When the user clicks on a portion of the textview I want to find the closest character to where they clicked so I can show them information about that part of the text in detail.  I have the OnTouchListener and I can get the x,y of the click but does anyone have any idea how I can use that to get the closest character in the textview?</p><p>Thanks,Jeff</p>","448799","","","","","2011-04-13 11:59:15","Android TextView pinpointing closes character","<android><textview><ontouchlistener>","0","0","","2012-04-05 12:36:35",""
"3721119","1","3844242","","2010-09-15 19:31:06","6","2425","<p>Does anyone know how to accomplish adding to my application's launcher icon the circular badge with a number inside of it (indicating number of unread emails) like the HTC mail application does?  I know how to do this for notifications, but not for the launcher icon.</p><p>To clarify, it's <strong>not</strong> a widget, but an application icon.</p>","403455","","168868","","2013-02-18 06:39:53","2013-02-18 06:39:53","How do I add a number to the launcher icon like HTC mail Does?","<android><icons>","2","5","","",""
"3721164","1","","","2010-09-15 19:36:46","0","1116","<p>I have a Layout which contains a ListView some buttons below it.</p><p>What I want is for the buttons to be fixed to the bottom of the screen.</p><p>When the ListView has several items (more than what fits the screen) the code is working properly and the buttons appear in the bottom of the screen.</p><p>However, when the ListView is empty or does not require scrolling, the buttons are coming up the screen (they are not staying fixed in the bottom).</p><p>Here's the layout (some details omitted but I can add them if necessary):</p><pre><code>&lt;LinearLayout&gt;  &lt;LinearLayout      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:orientation=""vertical"" &gt;   &lt;TextView /&gt;   &lt;ListView      android:width=""fill_parent""     android:height=""wrap_parent""     android:layout_weight=""1"" /&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center_horizontal|bottom""     android:orientation=""horizontal""    android:layout_weight=""0"" /&gt;    &lt;Button       android:layout_weight=""1"" /&gt;    &lt;Button       android:layout_weight=""1"" /&gt;  &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>I expected setting the ""gravity"" of the second LinearLayout to ""bottom"" to make the buttons fixed to the bottom of the screen, but it's not working in the mentioned case.</p><p>Any ideas?</p><p>Thanks.</p>","425749","","307260","","2013-10-01 23:08:57","2013-10-01 23:08:57","Buttons below ListView are not fixed to the bottom of the screen when the ListView is empty","<android><listview><button>","1","0","","",""
"3721358","1","3755608","","2010-09-15 20:04:16","27","16505","<p>Using a simple <code>EditTextPreference</code> in my preferences activity:</p><pre><code>&lt;EditTextPreference    android:key=""SomeKey""    android:title=""@string/some_title""    android:summary=""...""    android:numeric=""integer""    android:maxLength=""2""/&gt;</code></pre><p>Is there a way that this configuration value would be saved as integer? Seems now it just allows to enter numbers, but the value is still saved as string:</p><p>Calling:</p><pre><code>SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);int value = preferences.getInt(""SomeKey"", -1);</code></pre><p>throws me <code>java.lang.ClassCastException: java.lang.String</code>, and:</p><pre><code>SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);String value = preferences.getString(""SomeKey"", ""-1"");</code></pre><p>retrieves the value successfully.</p><p>How to make <code>PreferenceActivity</code> to save value as integer by default?</p>","283037","","","","","2010-09-20 21:22:11","PreferenceActivity: save value as integer","<android><sharedpreferences><preferenceactivity>","2","0","14","",""
"3721424","1","","","2010-09-15 20:12:10","1","1843","<p>Alright, so I would like to have a custom dialog, but I cannot figure out for the life of me how to make it appear when the function is called.</p><pre><code>public void addHomework() {    final Dialog alert = new Dialog(this);      alert.setTitle(""Add Homework"");    alert.setContentView(R.layout.homework_item_entry);    Button add_button = (Button) findViewById(R.id.add_homework_button);    Button cancel_button = (Button) findViewById(R.id.cancel_homework_button);    add_button.setOnClickListener( new OnClickListener() {        public void onClick(View v) {            Toast.makeText(ClassHomeworkList.this, ""Adding homework"", Toast.LENGTH_SHORT).show();        }    });    cancel_button.setOnClickListener( new OnClickListener() {        public void onClick(View v) {            alert.dismiss();        }    });    alert.show();}</code></pre><p>What could I do?</p>","362857","","","","","2012-07-11 22:35:42","Displaying custom dialog","<android>","4","4","2","",""
"3721445","1","3721956","","2010-09-15 20:15:04","7","2005","<p>I am doing a simple chat application and I want to show balloons similar to the <code>iphone</code>'s <a href=""http://www.gearlive.com/blogimages/gallery/iphone-unboxing/24-iphone-sms_medium.jpg"">sms app</a>.</p><p>So I am doing an <code>Activity</code> with a <code>ListView</code> with a certain layout.This are my layouts:</p><pre><code>/* Activity Layout */  &lt;LinearLayout android:orientation=""vertical""       android:layout_width=""fill_parent""       android:layout_height=""fill_parent""    &gt;     &lt;ListView android:id=""@+id/chat_log""         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:stackFromBottom=""true""         android:layout_marginTop=""50dp""         android:transcriptMode=""alwaysScroll""         android:layout_weight=""1""         android:cacheColorHint=""#00000000""         android:clickable=""false""     /&gt;     &lt;LinearLayout android:orientation=""horizontal""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""     &gt;   &lt;EditText android:id=""@+id/chat_input_text""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:layout_weight=""1""             android:layout_gravity=""bottom""         /&gt;         &lt;Button android:id=""@+id/chat_send_button""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:text=""@string/chat_send_button""         /&gt;     &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>Other:</p><pre><code>/* Row Layout */&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/userprofile_view"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:background=""@drawable/chat_ballon_left"" &gt; &lt;TextView  android:id=""@+id/chat_message""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:paddingLeft=""2dp""  android:text=""haasdasdasdasdasdasdasdoo"" /&gt;&lt;/FrameLayout&gt;</code></pre><p>Here's the <a href=""http://i.stack.imgur.com/LMr91.png"">result</a>.</p><p>My issues:</p><ul><li>The gray line which I would like to remove.</li><li>Text is not using the whole space.</li><li>Somehow even thought I've added <code>android:clickable=""false""</code> the balloons are clickable.</li></ul>","119895","","1318946","","2014-01-24 05:26:58","2014-01-24 05:26:58","Balloon chat application issues","<android><android-layout>","1","4","1","",""
"3721750","1","","","2010-09-15 20:59:34","1","95","<p>Shorter version of the problem now that I've had a Droid user run some tests for me.</p><p>My app is mainly a webview with thing's like image uploading that require more than that.  </p><p>In the webview's onPageStarted I call a method to show the image picker if the user is at a specific URL.  In the onActivityResult I get the filename that they want to upload and pass that along with the url they are at (it contains important querystrings) to another method in a new thread.</p><p>For some reason for Droid users the url is null or an empty string.  I've tried settings a global variable of the url before showing the image picker, but in the onActivityResult that value is an empty string.  I've tried doing a webView.getUrl(), but again, no value.</p><p>This is working fine for everyone except Droid users.</p><p>Any ideas why this is happening or where I can put the url so it isn't lost?</p>","448864","","448864","","2010-09-16 01:37:15","2010-09-16 04:33:05","Droid Losing Values (Android SDK)","<android>","0","0","","",""
"3721865","1","","","2010-09-15 21:15:33","0","275","<p>I am developing an app that is gonna be like a ""comicApp"", but so far I've just created 2 buttons and then I got 2 .jpgs.</p><p>So when I click the first button I want to show a .jpg file in a new screen.I got 2 layout XML's (Main and the one with the ImageView on it.)</p><p>How do I create a new screen in the activity?</p><p>This is what I got so far - </p><pre><code>package com.comics;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.ImageView;public class Comics extends Activity {    ImageView iv;    Button btn;        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            // setContentView              setContentView(R.layout.main); /main.xml            iv = (ImageView)this.findViewById(R.id.ImageView01); android:id=""@+id/image""            btn = (Button)this.findViewById(R.id.ButtonKalleAnka);   android:id=""@+id/button""            btn.setOnClickListener(new OnClickListener(){                     @Override                    public void onClick(View v) {                         iv.setImageResource (R.drawable.ka1);  filnamnet. Du skall inte skriva .jpg ex R.drawable.bild.jpg                     }            });        }}</code></pre>","447595","","199122","","2010-09-15 21:18:31","2010-09-15 21:55:29","ButtonClick -> ImageView on new screen?","<android><eclipse><htc><legend>","1","0","","",""
"3721950","1","3724233","","2010-09-15 21:27:25","3","13706","<p>I am having trouble with the Android HelloViews Spinner Tutorial. The error in HelloSpinner.java states that ""R.id cannot be resolved"" and ""R.array cannot be resolved"". The error in AndroidManifest.xml states that there is ""No resource found that matches the given name (at 'label' with value '@string/app_name')"" and ""No resource found that matches the given name (at 'label' with value '@string/app_name')"".</p><p>Here is my complete code:</p><p>HelloSpinner.java</p><pre><code>package net.brianwolf.hellospinner;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Spinner;import android.widget.Toast;import android.widget.AdapterView.OnItemSelectedListener;public class HelloSpinner extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        //Spinner spinner = (Spinner) findViewById(R.id.spinner);        android.widget.Spinner spinner = (android.widget.Spinner) findViewById(R.id.spinner);        ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(                this, R.array.planets_array, android.R.layout.simple_spinner_item);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        spinner.setAdapter(adapter);        spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());    }    public class MyOnItemSelectedListener implements OnItemSelectedListener {        public void onItemSelected(AdapterView&lt;?&gt; parent,            View view, int pos, long id) {          Toast.makeText(parent.getContext(), ""The planet is "" +              parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();        }        public void onNothingSelected(AdapterView parent) {          // Do nothing.        }    }}</code></pre><p>res/layout/main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:padding=""10dip""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_marginTop=""10dip""        android:text=""@string/planet_prompt""    /&gt;    &lt;Spinner         android:id=""@+id/spinner""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:prompt=""@string/planet_prompt""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>res/layoutvalues/strings.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""planet_prompt""&gt;Choose a planet&lt;/string&gt;    &lt;string-array name=""planets_array""&gt;        &lt;item&gt;Mercury&lt;/item&gt;        &lt;item&gt;Venus&lt;/item&gt;        &lt;item&gt;Earth&lt;/item&gt;        &lt;item&gt;Mars&lt;/item&gt;        &lt;item&gt;Jupiter&lt;/item&gt;        &lt;item&gt;Saturn&lt;/item&gt;        &lt;item&gt;Uranus&lt;/item&gt;        &lt;item&gt;Neptune&lt;/item&gt;    &lt;/string-array&gt;&lt;/resources&gt;</code></pre><p>AndroidManifest.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""net.brianwolf.hellospinner""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".HelloSpinner""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>Thank you!</p>","448887","","","","","2011-09-28 10:55:35","Android HelloViews Spinner Tutorial R.id and R.array can not be resolved","<android><android-widget><android-manifest>","5","0","1","",""
"3721963","1","3722554","","2010-09-15 21:29:01","66","65276","<p>I'm just getting up to speed on Android, and today in a project meeting someone said that Android has no native calendar app so users just use whatever calendar app they like.</p><p>Is this true, and if so how do I programmatically add an event to the user's calendar? Is there a common API they all share? </p><p>For what it's worth, we're probably targeting Android 2.x.</p>","424690","","63550","","2011-12-18 11:28:34","2014-03-30 16:59:15","How to add calendar events in Android?","<android><calendar>","8","1","51","",""
"3722179","1","","","2010-09-15 21:59:05","0","581","<p>Does anyone know of an animation/method that can rotate an image around smoothly to face a point, such as where the user is touching?</p>","420617","","","","","2010-11-07 14:54:22","Android: Rotate to face","<android>","1","0","1","",""
"3722322","1","","","2010-09-15 22:25:21","0","526","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6685027/good-tutorial-for-sqlite-and-listview"">Good Tutorial for SQLite and ListView</a>  </p></blockquote><p>Hi how to access existing data from sqlite and how to implement the data in list view  in android.</p>","448928","","244296","","2010-09-16 03:49:55","2011-07-18 19:05:26","How to access data from sqlite","<android>","3","1","","2011-12-17 23:03:10",""
"3722363","1","","","2010-09-15 22:32:58","1","560","<p>I have a repeating alarm setting, I have the activity being launched, the piece I'm missing is having this triggered after x minutes of inactivity.</p><p>I'm considering keying off of SCREEN_OFF in a service and then setting an alarm and canceling it on SCREEN_ON, does anyone have an intent or other suggestion for this.  I've considering polling for tasks, all kinds of pieces but I'm stuck.</p><p>Requirement:- App launches, alarm is set to relaunch app after 5 minutes, user exits/app exits after one minute- alarm triggers, detects phone is in use, resets alarm to trigger in fives minutes- if phone is idle relaunches app for one minute</p>","448924","","448924","","2010-09-16 03:00:53","2010-09-16 03:00:53","Detecting Android usage inactivity and setting a future alarm/intent to trigger","<android>","1","0","1","",""
"3722374","1","3722882","","2010-09-15 22:36:27","7","866","<p>I would like to know whether there is a way to insert/inject a <code>&lt;string&gt;</code> element defined in an XML file into another <code>&lt;string&gt;</code> element, doing that just with XML.</p><p>For example I could have:</p><pre><code>&lt;string name=""author""&gt;Francesco&lt;/string&gt;`</code></pre><p>and I am looking for something like:</p><pre><code>&lt;string name=""about_application""&gt;Author: @string/author&lt;/string&gt;`</code></pre><p>so that <code>getString(R.string.about_application)</code> would result in ""Author: Francesco"".</p><p>I know that I could combine the two elements in Java code using <code>String.format(string, formatArgs)</code>like for example:</p><pre><code>&lt;string name=""author""&gt;Francesco&lt;/string&gt;&lt;string name=""about_application""&gt;Author: %1$s&lt;/string&gt;`</code></pre><p>and then in code use </p><pre><code>String.format(getString(R.string.about_application), getString(R.string.author))</code></pre><p>but I would like to do it in XML directly.  </p><p>Can anyone suggest me a way to do it?</p>","448915","","648313","","2012-04-12 13:01:26","2012-04-12 13:01:26","Android: How to inject a <string> element into another <string> element in XML?","<android><xml><string><injection>","2","0","6","",""
"3722380","1","3729992","","2010-09-15 22:37:04","12","24028","<pre><code> lv.setOnItemClickListener(new OnItemClickListener() {             @Override          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {              TextView text = (TextView) view.findViewById(R.id.btitle);              registerForContextMenu(text);              view.showContextMenu();              }            });       }     @Override     public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {       super.onCreateContextMenu(menu, v, menuInfo);       TextView text = (TextView) v.findViewById(R.id.btitle);       CharSequence itemTitle = text.getText();       menu.setHeaderTitle(itemTitle);       MenuInflater inflater = getMenuInflater();       inflater.inflate(R.menu.context_menu, menu);     }</code></pre><p>Hello,</p><p>I'm trying to open a contextMenu on short item click.I've managed to do so only if I add  registerForContextMenu(getListView()); somewhere but this also triggers contextMenu on long click (which I don't want to happen).</p><p>Tried view.showContextMenu() but it doesn't do anything unless i add the registerForContextMenu(getListView()); . tried registering the clicked item first and then call the showContextMenu() but didn't do anything as well...</p><p>Also, I want to get the clicked item image + text so I can use them in the contextMenu.</p><p>Appreciate the help!</p>","444324","","","","","2014-04-17 07:33:13","Android open ContextMenu on short click + pass item clicked details","<android>","4","0","4","",""
"3722413","1","","","2010-09-15 22:44:35","0","690","<p>I followed the instructions and examples on Android website to create a context menu but mine shows up completely black and i cannot change any options in it ; anyone out there had the same experience and can help me solve this issue.</p><p>FWIW, here are my class .java and the menu .xml files</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;group android:checkableBehavior=""single""&gt;        &lt;item android:id=""@+id/red""              android:title=""@string/red""              android:checked=""true"" /&gt;        &lt;item android:id=""@+id/blue""              android:title=""@string/blue"" /&gt;        &lt;item android:id=""@+id/green""              android:title=""@string/green"" /&gt;        &lt;item android:id=""@+id/yellow""              android:title=""@string/yellow"" /&gt;        &lt;item android:id=""@+id/black""              android:title=""@string/black"" /&gt;        &lt;item android:id=""@+id/white""              android:title=""@string/white"" /&gt;        &lt;item android:id=""@+id/orange""              android:title=""@string/orange"" /&gt;    &lt;/group&gt;&lt;/menu&gt;</code></pre><p>&nbsp;</p><pre><code>package com.MyProject;import android.view.MenuInflater;import android.view.MenuItem;import android.app.Activity;import android.view.ContextMenu;import android.view.View;import android.view.ContextMenu.ContextMenuInfo;public class ColorsActivity extends Activity {    @Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {          super.onCreateContextMenu(menu, v, menuInfo);          MenuInflater inflater = getMenuInflater();          inflater.inflate(R.menu.context_menu, menu);          registerForContextMenu(v);    }    public boolean onContextItemSelected(MenuItem item) {        switch (item.getItemId()) {            case R.id.red:                if (item.isChecked()) item.setChecked(false);                else item.setChecked(true);                return true;            case R.id.blue:                if (item.isChecked()) item.setChecked(false);                else item.setChecked(true);                return true;            case R.id.green:                if (item.isChecked()) item.setChecked(false);                else item.setChecked(true);                return true;            case R.id.yellow:                if (item.isChecked()) item.setChecked(false);                else item.setChecked(true);                return true;            case R.id.black:                if (item.isChecked()) item.setChecked(false);                else item.setChecked(true);                return true;            case R.id.white:                if (item.isChecked()) item.setChecked(false);                else item.setChecked(true);                return true;            case R.id.orange:                if (item.isChecked()) item.setChecked(false);                else item.setChecked(true);                return true;            default:                return super.onContextItemSelected(item);        }    }}</code></pre>","436672","","54680","","2010-09-15 23:04:57","2010-09-15 23:26:32","Context menu shows up completely black","<java><android><menu><context>","1","0","","",""
"3722653","1","","","2010-09-15 23:37:32","13","2619","<p>I have an Android Eclipse project and an associated Android Test Eclipse project checked into a subversion repository.  Given a checked out working copy, how do I bring the Android Test project into an Eclipse workspace?</p><p>It's easy to add the Android project to the workspace (just File->New Project->Android Project->From Existing Source and point it at the directory in the svn working copy).  But, the 'New Android Test Project' does not have an option to create from existing source.</p>","448970","","448970","","2010-09-16 09:17:33","2014-01-26 21:20:21","Import Android Test Project into Eclipse from Version Control","<android><eclipse><svn><version-control>","4","0","2","",""
"3722869","1","4019925","","2010-09-16 00:27:06","2","774","<p>I've seen a few places where this was asked but I haven't seen where it's been resolved. </p><p>I've just installed the tools needed to develop Android applications. This includes, of course, Eclipse. When I try to open the res/main.xml file, I get the error 'could not initialize class java.awt.font'. </p><p>I'm running the newest version of Eclipse and all the software required for Android development. I'm running on Ubuntu 10.04 32bit.</p><p>Sun JDK and JRE are installed.</p><p>Any ideas?</p>","284147","","244296","","2010-09-16 03:48:06","2010-10-26 00:45:41","Error loading java.awt.font in Eclipse Android project?","<java><android><eclipse>","1","0","1","",""
"3723116","1","3723127","","2010-09-16 01:37:35","0","446","<p>The situation is that I have my listener constructed using an anonymous inner class, as is typical, but the way of deregistering a [PhoneStateListener][1] in Android requires me to pass the listener object to the this same function that I used to register it, but use the LISTEN_NONE flag. The problem is that I can't do this with an anonymous inner class because it's, well, anonymous. Do I have to instantiate my class with a name to be able to de-register it, or can I just ignore this problem and my listener will disappear by itself when my service terminates?</p><p>[1]: <a href=""http://developer.android.com/reference/android/telephony/TelephonyManager.html#listen(android.telephony.PhoneStateListener"" rel=""nofollow"">http://developer.android.com/reference/android/telephony/TelephonyManager.html#listen(android.telephony.PhoneStateListener</a>, int)</p>","434731","","234039","","2010-09-16 01:44:23","2010-09-16 01:44:23","Do I need to bother deregistering my phone state change listener if it's tied to a service and the service terminates?","<android><listener>","1","2","","",""
"3723117","1","","","2010-09-16 01:38:06","1","2316","<p>Is there a way to force GridView to only be a single row? Right now by default it will extend its height to accommodate all views supplied by its adapter</p>","291701","","244296","","2010-09-16 03:01:24","2013-06-23 09:37:29","Force GridView to only a single row?","<android>","2","2","","",""
"3723208","1","","","2010-09-16 02:05:00","0","2654","<p>guys. I am new to android and i am using android 2.2 for some sms_receive thing: when an sms received, just a notification. but it won't work...  Nothing happens when sms received, seems like the receiver has not been registered.help! </p><p>Code for <code>androidmanifest.xml</code>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.happyto.tracker""  android:versionCode=""1""  android:versionName=""1.0""&gt; &lt;uses-permission android:name=""android.permission.RECEIVE_SMS""/&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:label=""@string/app_name"" android:name="".Track""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;receiver android:name="".SMSReceiver"" android:enabled=""true""&gt;        &lt;intent_filter&gt;            &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED""/&gt;        &lt;/intent_filter&gt;    &lt;/receiver&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre><p>my receiver class : <code>SMSReceiver.java</code>:</p><pre><code>package com.happyto.tracker;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.telephony.SmsMessage;import android.widget.Toast;import android.util.Log;public class SMSReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        String smsReceived = ""android.provider.Telephony.SMS_RECEIVED"";        Log.e(""tracker"", intent.getAction());        if (intent.getAction().equals(smsReceived)) {            // ---get the SMS message passed in---            Bundle bundle = intent.getExtras();            SmsMessage[] msgs = null;            String str = """";            if (bundle != null) {                // ---retrieve the SMS message received---                Object[] pdus = (Object[]) bundle.get(""pdus"");                msgs = new SmsMessage[pdus.length];                for (int i = 0; i &lt; msgs.length; i++) {                    msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);                    str += ""SMS from "" + msgs[i].getOriginatingAddress();                    str += "" :"";                    str += msgs[i].getMessageBody().toString();                    str += ""\n"";                }                // ---display the new SMS message---                Toast.makeText(context, str, Toast.LENGTH_SHORT).show();            }        }    }}</code></pre>","449034","","1716542","","2013-08-14 09:16:13","2013-08-14 09:16:13","android 2.2 sms receiver wont work","<android><sms>","1","1","4","",""
"3723392","1","","","2010-09-16 02:56:40","1","494","<p>I have 2 apps, a free version and a paid version. Each version allows the user to backup their database data to the SD card. The databases being saved are exactly the same (i.e. they have the same columns defined).</p><p>If the user wants to import the data from the free version to the paid version, I can do this easily if the user hasn't saved any data in the paid version, because I can just grab the free version's database files from the SD Card and use those files for the paid version by copying them into the app.</p><p>I need information about importing the database information from the free version into the paid version, after the user has already saved information in the paid version. In this case, I can't simply overwrite the files. I think I need to manually grab each row from the tables of the free version on the SD card, and add each row one at a time into the databases of the paid version.</p><p>My questions are: </p><ol><li><p>what options are available to me to accomplish this? Is there a good or easy way to pull in the information from the database files on the SD Card, and then append each row into the database of my app?`</p></li><li><p>If there are multiple options available to me, of the options available, would one option be considered the best option to pursue?</p></li></ol>","449070","","244296","","2010-09-16 03:31:55","2010-09-16 03:31:55","Import and Append Android Database from SD Card","<android><database>","0","0","1","",""
"3723450","1","","","2010-09-16 03:16:34","8","11993","<p>I'm using Windows 7 and installed the 64 bit version of Eclipse 3.5.2.  I then installed the Android ADT plugin, but when I try to configure it in the Windows > Preferences dialog, the Android Plugin doesn't show up in the left pane.  Instead I see DDMS.  This prevents me from specifying the location of the Android SDK (unless there is another way) to give me the appropriate templates and such.</p><p>Someone posted a fix to this that includes setting the permissions of Eclipse, but that didn't work for me.  I tried installing the Android Plugin from both online installation (thru the URL install) and the offline Archive method.  </p>","449082","","449082","","2010-09-17 13:33:22","2013-01-15 22:07:41","Android ADT Plugin doesn't show up in Eclipse","<android><windows-7><eclipse-plugin><preferences><adt>","4","2","","",""
"3723535","1","3724005","","2010-09-16 03:40:19","4","713","<p>I am using a ContentProvider for caching results from a web-service query.  It is an HTTP request and the response content is XML.  Most of the data is cached, so I simply query the DB, if not found, request from webservice, insert in DB and requery the DB.  Thus the response is always a Cursor from SQLiteDatabaseHelper.</p><p>I have one result set that is not stored in the DB and since it is 100% transient, but I would like to provide the appearance of it coming from the DB's Cursor.  Is there an easy way to do this?  For example, if I could project it onto the cursor with a cursor.setValue(""string"", objectValue) or some other existing implementation.</p><p>If not, I will either bypass the DB for this content result, or stuff it into a trivial table that is constantly reused.</p>","157804","","","","","2010-09-16 05:47:24","Is it possible to mock the sqlite3 Cursor in Android when no db or table exists?","<android><sqlite3><mocking><android-contentprovider>","1","1","2","",""
"3723545","1","3735663","","2010-09-16 03:41:53","21","7629","<p>Android newb here, so I'm trying out the android graphics classes.I wanted to draw some arcs/circles with a fill color and black outline.The Paint class has a style for FILL_AND_STROKE, but there doesn't seem to be a way to set the fill color vs. stroke color.  So as far as I can tell it's the same as FILL?</p><p>So what's the point of FILL_AND_STROKE if you can't set a separate fill and stroke color?I haven't managed to find a good explanation.</p><p>(I solved my simple problem by doing a fill first, then a stroke, naturally)</p><p>Edit:I ran into this bug report: <a href=""http://code.google.com/p/android/issues/detail?id=4086"">http://code.google.com/p/android/issues/detail?id=4086</a></p><p>Comment 4 and 5 seem to imply that FILL_AND_STROKE is basically the same as FILL and it will be 'fixed' in 2.2.  I guess they'll add a new color?</p>","141437","","141437","","2010-09-17 13:13:28","2010-09-17 13:22:02","What's the point of FILL_AND_STROKE?","<android>","1","0","","",""
"3723634","1","3723649","","2010-09-16 04:06:56","71","48286","<p>How do I prevent an Android device from going to sleep programmatically?</p>","655814","","427763","","2012-10-04 20:00:24","2014-01-08 17:23:00","How do I prevent an Android device from going to sleep programmatically?","<android>","5","0","26","",""
"3723823","1","3723830","","2010-09-16 04:52:49","58","35600","<p>I want my android application to be only run in portrait mode?How can I do that?</p>","655814","","1796105","","2014-01-21 19:31:08","2014-03-13 10:33:26","I want my android application to be only run in portrait mode?","<android>","5","0","15","",""
"3723915","1","","","2010-09-16 05:21:24","2","417","<p>new to android/java programming. Quick question. In php/mysql I use 1=1 a lot when building dynamic select queries. It saves some extra steps (i can append AND onto each part of the select query and finish it with 1=1). Doing this with managedQuery gives me an empty cursor when querying the calllog. Is this something managedQuery is not allowing or is it sqlite or what? I realize I can write smarter code but it was such a nice short cut in php, wondering if its possible in this case. Thanks.</p>","449133","","","","","2010-09-16 05:21:24","1=1 in a managedQuery","<android><sqlite>","0","5","","",""
"3723994","1","","","2010-09-16 05:44:50","0","126","<p>HelloIn my android application i want to load a gzip file along with my application into device.I tried placing it in /data/data/mypackage but its not getting loaded into the device.I also tried placing in raw folder but still not working.</p><p>Is there any way that i can get this done?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2010-09-16 08:05:15","Insert gzip files into android device","<android>","1","0","","",""
"3724082","1","","","2010-09-16 05:58:50","1","8487","<p>This is the sequence part of this question: <a href=""http://stackoverflow.com/questions/3674441/combining-2-images-overlayed"">http://stackoverflow.com/questions/3674441/combining-2-images-overlayed</a></p><p>so the problem is: if the image size is too big - it'll got an exception (out of memory exception)what i want is, to handle even if the handset got the lower spec hardware, it doesn't go to that exception (but it'll take a longer time to process the image)</p><p>is it possible to do that?</p><p>the code snippet is like this:</p><pre><code>public static Bitmap overlay(Bitmap bmp1, Bitmap bmp2) {    Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(), bmp1.getConfig());    Canvas canvas = new Canvas(bmOverlay);    canvas.drawBitmap(bmp1, new Matrix(), null);    canvas.drawBitmap(bmp2, 0, 0, null);    return bmOverlay;}</code></pre><p>and that block of code is inside the async task.</p><p>I really appreciate if someone can help me on this matter.</p><p>Thank you and Regards,AnD</p>","286080","","","","","2010-12-06 10:32:45","Android handling out of memory exception on image processing","<android><image-processing><out-of-memory><bitmapimage>","2","0","","",""
"3724162","1","","","2010-09-16 06:17:07","1","747","<p>Is there any simple way to close the current tab or single tab in androids?I don't want to do clearing all tabs and adding the required tabs?</p><p>Please suggest me.Thanks in advance.</p><p>With regardsKavya </p>","428231","","","","","2010-09-16 07:50:34","deleting/closing current tab","<android><tabs><android-tabhost><tabwidget>","1","0","","",""
"3724333","1","3725797","","2010-09-16 06:52:38","1","1227","<p>I have trouble passing the cookie into the WebView inject. I know how to inject the cookie. When the cookie is injected I want to display a member.php and this page requires a cookie. It shows me the error page even if I've injected the cookie.</p><p>The WebView are correctly loaded and I've tried to set a cookie using the CookieManager class. Alll this is known to me. </p><p>From the CookieStore I have tried to print out the whole cookie itself; which prints this:</p><pre><code>[[version: 0][name:SQMSESSID][value: 9166729532c975f261bda9e6e583bdba][domain: mydomain.com][path: /][expiry: null], [version: 0][name: key][value: vrckNRab][domain: mydomain.com][path: /][expiry: null]]</code></pre><p>Should be mentioned that the code above is the successful CookieStore when I have passed my correct username and password.</p><p>My inject + loadUrl code:</p><pre><code>CookieStore cookie = /* CookieStore cookie takes a CookieStore from my own function that succesful returns the CookieStore */List&lt;Cookie&gt; listcookie = cookie.getCookies(); //Set my CookieStore to a listCookie setcookieOne = listcookie.get(0) //My cookie has two fieldsCookie setcookieTwo = listcookie.get(1) //....and assign these to a cookie CookieManager cookieManager = CookieManager.getInstance(); CookieSyncManager.createInstance(getApplicationContext());cookieManager.setAcceptCookie(true); cookieManager.setCookie(setcookieOne.getDomain(), setcookieOne.getValue());     cookieManager.setCookie(setcookieTwo.getDomain(), setcookieTwo.getValue());   CookieSyncManager.getInstance().sync();browse.setWebViewClient(new WebViewClient(){}); browse.loadUrl(""http://mypagethatwillredirectmeonacorrectcookie.php""); /* Thispage will redirect if the cookie is successful */</code></pre><p>Any ideas why it doesn't show the member.php? </p>","386562","","","","","2010-09-16 10:33:15","The cookie value shows, but doesn't get logged in - WebView inject cookie","<android>","1","0","2","",""
"3724387","1","","","2010-09-16 07:03:24","0","341","<p>Is there a way to change the look and feel of a context menu?<br>I want to add my own background, list item seperator and maybe the selector as well.I want to change it in famework so that i will get the customised menu every where i will use it.</p><p>Can someone point me in the right direction? As far as I could makeout - Context menu is just an alert dialog with a list. Am I right? How can i change the look and feel and from where?</p>","324225","","114066","","2011-06-28 09:56:15","2011-06-28 09:56:15","Customising context menus in Android ","<android>","2","0","1","",""
"3724509","1","3725042","","2010-09-16 07:22:11","32","16666","<p>I want to go to the home screen programmatically in Android when the user clicks on button. How can this be done?</p>","399046","","56285","","2013-12-20 18:59:27","2013-12-20 18:59:27","Going to home screen programmatically","<android><homescreen>","3","1","13","",""
"3724657","1","3724698","","2010-09-16 07:45:07","1","933","<p>can anybody tell me or send me some links if there is any..which tells how Google map draw on canvas in android. what is the logic behind that.</p><p>any help will be highly appreciative.</p><p>thanks alot</p>","397901","","","","","2010-09-16 07:50:08","how google map draw on canvas in android?","<android><google-maps>","1","0","","",""
"3724806","1","","","2010-09-16 08:06:23","0","181","<p>I'm trying to create a settings section for my app. I have a res/xml/settings.xml:</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;ListPreference     android:key=""numberOfYears""    android:title=""Number of Years to Read the Bible""    android:summary=""How many years would you like to take to read through the reading plan?""    android:entries=""@array/numberOfYears""    android:entryValues=""@array/numberOfYears""    android:dialogTitle=""How Many Years?""    /&gt;  &lt;CheckBoxPreference android:key=""ignoreDates""    android:title=""Ignore Dates""    android:summary=""Would you like to use the dates in the plan?""  /&gt;&lt;/PreferenceScreen&gt;</code></pre><p>I have a class called Preferences which extends PreferenceActivity and contains the following:</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.settings);}</code></pre><p>I wasn't sure if this was required but I also added the following to my main activity:</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    menu.add(Menu.NONE, PREFS_MENU, Menu.NONE, ""Preferences"");    return super.onCreateOptionsMenu(menu);}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    Log.d(TAG, ""Menu Item: "" + item.getItemId());    switch (item.getItemId()) {    case PREFS_MENU :        startActivity(new Intent(this, Preferences.class));        return true;    }    return false;}</code></pre><p>This seems to work in that I get a ""Preferences"" menu which, when selected, launches my preferences.  However, when I select anything the values don't seem to stick.  My understanding was that the android:key was enough for the system to set the chosen values in the default shared preferences - is this not the case?</p><p>What am I missing?</p>","398293","","","","","2011-06-02 08:48:30","My preferences aren't 'sticking'","<android>","1","3","","",""
"3724872","1","3725072","","2010-09-16 08:18:09","2","2103","<p>I have an xml file which will be in either assets or res folder which i need to modify by adding some values and then i need to convert the xml into a string to be sent as part of a soap request. What would be the easiest way to achieve this?</p>","289387","","","","","2010-09-16 08:45:22","Load and modify xml file in Android","<android><xml>","1","0","","",""
"3724874","1","3727813","","2010-09-16 08:18:26","45","24579","<p>I have a <code>ListView</code> which displays news items. They contain an image, a title and some text. The image is loaded in a separate thread (with a queue and all) and when the image is downloaded, I now call <code>notifyDataSetChanged()</code> on the list adapter to update the image. This works, but <code>getView()</code> is getting called too frequently, since <code>notifyDataSetChanged()</code> calls <code>getView()</code> for all visible items. I want to update just the single item in the list. How would I do this?</p><p>Problems I have with my current approach are:</p><ol><li>Scrolling is slow</li><li>I have a fade-in animation on the image which happens every time a single new image in the list is loaded.</li></ol>","419625","","403455","","2012-08-17 13:28:33","2014-04-09 09:52:29","How can I update a single row in a ListView?","<android><android-listview><android-arrayadapter>","6","0","45","",""
"3724903","1","3725111","","2010-09-16 08:22:46","0","2498","<p>HiI am trying to populate a ListView in the android app. I have the data in a JsonArray, But it doesn't work to directly use the JsonArray. Any suggestions How to populate the ListView?</p><pre><code>   JSONObject json = null;   try {       json = new JSONObject(client.getResponse());       JSONArray nameArray = json.names();         JSONArray valArray = json.toJSONArray(nameArray);   } catch (JSONException e) {      // TODO Auto-generated catch block      e.printStackTrace();   }    setListAdapter(new ArrayAdapter&lt;String&gt;(this,         android.R.layout.simple_list_item_1, valArray));</code></pre><p>I am trying to have ""valArray"", but it doesn't work.Also I wonder what does valarray contain? (JsonArray, what does it contain)</p>","371301","","620338","","2012-08-10 14:02:03","2012-08-10 14:02:03","How to put a JSONArray into an Android ListView","<java><android><json><listview>","2","0","","",""
"3724919","1","4710622","","2010-09-16 08:24:48","0","939","<p>This is what I want to achieve. When ever a user taps at any point on the screen, I would like to show an image at that point for say 2 seconds. Is it possible ?</p>","266272","","","","","2012-08-29 16:28:14","In Android how to add a view at particular x-y co-ordinates on the screen","<android><layout><view>","2","0","","",""
"3724930","1","3725169","","2010-09-16 08:27:07","1","1409","<p>HelloIn my android application i am using a table inside a scrollview but am not able to scroll horizontally if the length of content is more.Could you please let me know any solution for this?</p><p>Thanks in advance:)</p>","420261","","","","","2010-10-25 19:11:05","Scrollview to scroll table both horizontally and vertically in android","<android>","2","0","","",""
"3724996","1","6084131","","2010-09-16 08:34:50","2","2924","<p>Is there anyway to increase Canvas size more then my screen size in Android? Like if my screen size is 320 x 480 I want to increase my canvas size 3 times bigger then that.</p>","397901","","50846","","2010-09-16 08:38:20","2011-05-21 20:02:50","How to increase Canvas size in Android?","<android><canvas>","1","6","0","",""
"3725147","1","4544055","","2010-09-16 08:57:47","0","519","<p>I am new to Android Programming, I had also asked this question before but didn't got quite satisfactory answers.</p><p>I need to implement parsing in my particular application. Can any body demistify the Parsing regarding the simple parsing of an XML String with an appropriate example.</p><p>Hoping I could get something vital this time.</p><p>Thanks,david</p>","422859","","","","","2012-05-28 10:37:09","XML Parsing in Android Programming","<android><xml-parsing>","3","0","1","",""
"3725148","1","3725701","","2010-09-16 08:57:48","0","355","<p>Hai Frnds,          i want to know to launch a satellite application using Intent, i knew how to launch the map application using Intent, but i want to display satellite view rather than map view, my code is </p><pre><code>   uri = Uri.parse(""geo:0,0?q="" + VALUE_baraddress1[0] + "", ""            + VALUE_baraddress2[0] + "", ""            + VALUE_baraddress3[0]);            Log.v(TAG, VALUE_baraddress1[0] + "", ""            + VALUE_baraddress2[0] + "", ""            + VALUE_baraddress3[0]);  startActivity(new Intent(Intent.ACTION_VIEW, uri));</code></pre>","424413","","424413","","2010-09-16 09:27:19","2010-09-16 10:19:53","How to use Intent to launch the satellite application on android?","<android>","1","0","1","","2010-09-16 08:57:48"
"3725156","1","","","2010-09-16 08:59:17","1","789","<p>I have a problem with missing pixels on QVGA screen on Android (all versions including 2.2). The original problem was with LinearLayout and margin=""1px"". It was OK on the normal screen but on QVGA there was sometimes no space between GUI controls, like if margin=""0px"" and not 1px. So I tried to make the example simple (to be sure that it is not a LinearLayout bug), I have just put transparent (height = 10px) and white (height = 1px) images into ImageViews into the main screen. 25% of the white images are not shown on the QVGA screen. The behaviour on the normal screen is OK. The screenshots are from the emulator but the problem exists on real devices too.</p><p>See screenshots on <a href=""http://jnem6403.sweb.cz/?cache=no"" rel=""nofollow"">my web page</a>.</p><p>Is it an Android bug? Can I do anything with it? Note that my original problem was with LinearLayout and margin=""1px"". Is there something like margin=""1px_that_is_not_hidden""? (pt, dp, dip, ... don't seem to be solution)</p><p>Many thanks for a reply.</p>","449293","","","","","2010-09-16 10:28:01","Android - QVGA screen hides some pixels","<android><screen><resolution><hidden><pixel>","1","0","","",""
"3725174","1","4022481","","2010-09-16 09:03:03","4","1714","<p>Is there a way to replace the standard ListView that pops up when opening a Spinner with a custom one? I would like for my Spinner list to be Filterable (and/or even possibly have two tabs with different lists the user could select options from).</p><p>Is this achievable or do I have to do my own implementation alltogether?</p>","441531","","","","","2010-10-26 09:47:38","Custom spinner popup list in android","<android><listview><popup><spinner>","1","0","4","",""
"3725273","1","4642442","","2010-09-16 09:17:52","0","1122","<p>I am making an application which Streams media from the Internet,it can be from any source like Youtube,or any url. I am able to stream media from my android device.</p><p>Now i want to extend it to be streamed to UPnP devices in my network.</p><p>Any help on how i can find the list of UPnP devices in my network, then share media with that devices..</p><p>I found the little help from <a href=""http://teleal.org/projects/cling/core/manual/cling-core-manual.html"" rel=""nofollow"">http://teleal.org/projects/cling/core/manual/cling-core-manual.html</a> </p><p>They have their own API for using UPnP service.</p><p>Any body who have worked on UPnP service can help me.</p><p>Any help will be much appreciated.Thank you</p>","1386533","","","","","2011-01-11 08:48:15","Developing App To Stream Media to UPnP devices :Android","<android><upnp>","1","0","","",""
"3725313","1","3725334","","2010-09-16 09:23:35","-4","596","<p>How to install and run the Android <code>.apk</code> file in BlackBerry.</p><p>What are the step i should follow?</p>","246963","","1379664","","2012-12-25 12:24:02","2012-12-25 12:24:21","BlackBerry Android installation","<android><blackberry>","2","1","","",""
"3725340","1","","","2010-09-16 09:27:57","1","216","<p>Which is a good android application for study purpose on code.google.com?</p>","396437","","","","","2010-09-16 09:54:42","Android application study","<android>","0","1","","",""
"3725396","1","3727024","","2010-09-16 09:35:53","1","2587","<p>Below is the URL I send to the WS after the handshake is done    </p><pre><code>    ""https://ekp.truefriend.com/COVIWeb/gate/AutoAuthentication.aspx?UserID=DP0001&amp;BackUrl=http%3a%2f%2fgw.truefriendtest.com%2fCOVIWeb%2fApproval%2fForms%2fForm.aspx%3fmobileyn%3dY%26piid%3d96482621-6cc4-401c-a6f9-5ba6cb7ce26f%26wiid%3d425a9bc9-8607-4898-9158-ed9170da1d89%26fmpf%3dWF_A_DRAFT_PAPER01%26fmrv%3d0%26fiid%3d749526BE-B208-4987-B751-2DD0FC03F0F6%26fmid%3d24f6765d-69d1-429f-b0da-b540a064f0e2%26scid%3ddc4378f1-7edd-4d69-8fe4-5867ed32c8b9""</code></pre><p>What it should do is redirecting the browser to BackUrl page given in the url. It display correct result in IE8 despite the certificate problem. In PC version of Chrome it display some code of the HTML. In Android, I get 403 Forbidden error.</p><pre><code>HTTP/1.1 403 Forbidden ( The server denied the specified Uniform Resource Locator (URL). Contact the server administrator.  )</code></pre><p>I use this method to stream data</p><pre><code>try{            URL url = new URL(urlString);            HttpsURLConnection.setDefaultHostnameVerifier(new FakeHostVerifier());            TrustManager[] trustAllCerts = new TrustManager[]{                     new X509TrustManager() {                         public java.security.cert.X509Certificate[] getAcceptedIssuers() {                             Log.d(""SSLDemo"", ""getAcceptedIssuers"");                             return null;                         }                         public void checkClientTrusted(                             java.security.cert.X509Certificate[] certs, String authType) {                             Log.d(""SSLDemo"", ""Check Client Trusted"");                         }                         public void checkServerTrusted(                             java.security.cert.X509Certificate[] certs, String authType) {                             Log.d(""SSLDemo"", ""Check Server Trusted"");                         }                     }                 };    SSLContext sc = SSLContext.getInstance(""TLS""); //""TLS""            sc.init(null, trustAllCerts, new java.security.SecureRandom());            HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());            int port = 443;            SSLSocketFactory factory = HttpsURLConnection.getDefaultSSLSocketFactory();            socket = (SSLSocket)factory.createSocket(url.getHost(), port);            socket.startHandshake();            /**             * Connection Method             */            String method = ""GET"";            String os = method + "" ""+urlString+"" HTTP/1.0\r\n"";            os += ""Content-Length: 0"";            os += ""\r\n\r\n"";            ((SSLWeb)this.caller).updateRequest(urlString, method);            Log.i(""TESTWEB"", os);            BufferedWriter wout = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));            wout.write(os);            wout.flush();            wout.close();            rd = new BufferedReader(new InputStreamReader(socket.getInputStream()));            //*********     Not using thread            StringBuffer buff = new StringBuffer();            char[] buffer = new char[1024];            while(rd.read(buffer) &gt; -1) {                buff.append(buffer);                Log.i(""TESTWEB"", ""read buffer :"" + String.valueOf(buffer));            }            Log.i(""TESTWEB"", ""read line :"" + buff.toString());            //**********        }catch(Exception e){            Log.e(""TESTWEB"", ""Connecting error"", e);            e.printStackTrace();        }</code></pre><p>Is there something wrong with my code? I thought the problem was with the URL parameter, but it work in browser :(</p><p>I've been finding a way around the problem for the last three days now, no luck so far.</p><p>EDIT: This is FakeHostVerifier class that used to skip the certificate validation process. Isn't this correct?</p><pre><code> public class FakeHostVerifier implements HostnameVerifier {    @Override     public boolean verify(String hostname, SSLSession session) {         return true;     }}</code></pre>","271736","","271736","","2010-09-16 10:11:49","2011-06-10 01:53:44","Send GET HTTPS request but get 403 forbidden response, why?","<android><ssl>","2","0","1","",""
"3725487","1","","","2010-09-16 09:52:21","1","953","<p>I would like to build a live streaming and viewer.The streaming is H264/MEPG4 raw data.How to decode these raw data on Android?I can not find usable API in Android SDK to do it.And suggestion is welcome.Thanks in advance.</p><p>Caxton</p>","449332","","","","","2012-12-31 05:45:03","Decode video raw data on Android","<android><video-streaming><decoder>","2","0","1","",""
"3725501","1","3725572","","2010-09-16 09:53:13","6","7666","<p>I am parsing a website to display the contents in a URL, in that some images are there.  I want to crop the images which are parsed from the site.  I'm really struggling on this, can any one help me regarding on this?</p>","424413","","1023248","","2012-07-24 09:27:41","2013-04-30 08:35:22","How to crop the parsed image in android?","<android><crop>","4","0","11","",""
"3725596","1","3725628","","2010-09-16 10:06:54","2","2217","<p>i'm using a variable:-</p><p>String[] string;</p><p>how to append it?</p>","438864","","","","","2010-09-27 10:41:30","How to append a string in android?","<android>","1","3","0","",""
"3725692","1","","","2010-09-16 10:18:56","1","2248","<p>I'm trying to get my tabicon to change when a tab is pressed (i.e. when it changes color when you press the tab, but haven't released yet). I've created a selector as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;!-- Non focused states --&gt;     &lt;item android:state_focused=""false""           android:state_selected=""false""           android:state_pressed=""false""           android:drawable=""@drawable/ic_tab_icon1"" /&gt;     &lt;item android:state_focused=""false""           android:state_selected=""true""           android:state_pressed=""false""           android:drawable=""@drawable/ic_tab_icon2"" /&gt;     &lt;!-- Focused states --&gt;     &lt;item android:state_focused=""true""           android:state_selected=""false""           android:state_pressed=""false""           android:drawable=""@drawable/ic_tab_icon3"" /&gt;     &lt;item android:state_focused=""true""           android:state_selected=""true""           android:state_pressed=""false""           android:drawable=""@drawable/ic_tab_icon4"" /&gt;     &lt;!-- Pressed --&gt;     &lt;item android:state_pressed=""true""           android:drawable=""@drawable/ic_tab_icon5"" /&gt; &lt;/selector&gt; </code></pre><p>However, for some reason only the first two states are reached (only icon1 and icon 2 are used). Can anyone tell me what the correct state is for a ""pressed but not selected"" tab?</p><p>*Edited to clarify new situation</p>","449339","","449339","","2010-09-17 08:12:55","2010-09-17 08:12:55","What's the state of a pressed Tab in Android","<android><state><tabs><android-tabhost><tabwidget>","2","1","2","",""
"3725704","1","","","2010-09-16 10:20:40","0","1891","<p><strong>solved</strong>Never mind. It is the onMenuItemSelectedmethod that messed up with the onContextItemSelected method. I am investigating why it screws it up.</p><p><strong>solved #2</strong> It appears that both methods are actually same in which onMenuItemSelectedmethod is invoked instead of onContextItemSelected (Hence empty response). I must have misread the google doc :-(</p><p>I encounter this strange problem. I have followed the <a href=""http://developer.android.com/guide/topics/ui/menus.html#context-menu"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/menus.html#context-menu</a> exactly. I already tested it on separate dummy application and it worked fine. The problem is ""Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@xxxxxx"" whenever I tried to click any context menu item after pressing-and-holding any list item. ""onContextItemSelected"" method is never called at all time.</p><p>Here're the condensed codes:</p><hr><p><strong>TaskActivity.java</strong></p><pre><code>public class TaskActivity extends Activity{    private ListView task_list;    protected void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_layout);//custom xml file of my GUI        task_list = (ListView) findViewById(R.id.listTasks);        populateTaskList();//snapped method        registerForContextMenu(task_list);     }    @Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {        super.onCreateContextMenu(menu, v, menuInfo);        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.context_menu, menu);        menu.setHeaderTitle(""Options"");        Log.v(""CBC"",""HERE2"");//It logs, yes    }    @Override    public boolean onContextItemSelected(MenuItem item) {        Log.v(""CBC"",""HERE1"");//Not ever logged this message!        AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();        switch (item.getItemId()) {            case R.id.edit_menuitem:                update_task(info.id);                return true;            case R.id.delete_menuitem:                Log.v(""CBC"",""HERE2"");                delete_task(info.id);                return true;        }        return super.onContextItemSelected(item);    }}&lt;snap irrelevant codes that have played no role in this problem&gt;</code></pre><p><strong>activity_layout.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/white_bg""    android:orientation=""vertical""&gt;    &lt;snap irrelvant codes&gt;    &lt;ListView android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:listSelector=""@drawable/list_selectors""        android:id=""@+id/listTasks""/&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>task_row.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""horizontal""    android:background=""@drawable/row_selector""    android:padding=""5dip""&gt;    &lt;TextView android:id=""@+id/body""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""#000000""        android:textSize=""20dip""/&gt;    &lt;TextView android:id=""@+id/mark""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""#000000""        android:textSize=""20dip""/&gt;&lt;/LinearLayout&gt;</code></pre><hr><p>So I am wondering if you have known anything about this such strange problem? Let me know if you need to know more codes else. I assure you they are not relevant.</p><p>P.S. This is my big first application written.P.S.S. I just write this little application for my special needs on my Android phone. (Android market free ones are unsuitable to me).</p>","449358","","449358","","2010-09-17 09:24:48","2011-08-18 11:02:54","<solved> (Android 2.1) ""onContextItemSelected"" and ""window already focused, ignoring focus <snap irrelavant rest>""","<java><android>","1","0","","",""
"3725719","1","3725787","","2010-09-16 10:22:35","12","2735","<p>I have no idea, which files should be versioned for a new android project created in eclipse. Could anyone tell me, what I should add??</p>","98494","","","","","2010-09-16 10:41:23","I have just created small android project in Eclipse, which files I should add to version control?","<android><eclipse><version-control>","1","0","1","",""
"3725730","1","3725774","","2010-09-16 10:23:56","2","970","<p>HI</p><p>I write app that hold route information (array of GeoPoint ) for every race.</p><p>At the end of each race I want to save information about race. They may have 100-200 GeoPoints (70.22222, -20 33333), each race.</p><p>Example for one race:</p><p>70.22212, -20 3325370.25222, -20 3346370.26232, -20 3357370.27242, -20 33683..</p><p>Now I store this information in this array</p><pre><code>List&lt;GeoPoint&gt; race = new ArrayList&lt;GeoPoint&gt;();</code></pre><p>Where to save information for every race  in Android (Database, internal XML ....)?</p><p>Thanks</p>","432848","","539542","","2012-01-15 06:08:28","2012-01-15 06:08:28","Where to store GPS data on Android ","<android>","1","0","1","",""
"3725742","1","3726490","","2010-09-16 10:25:53","0","237","<p>I want to have a persistant taskbar like the status bar of Android. I dont want  it to load with individual activity. i want that taskbar to remain persistant for all activities that too at the bottom of the screen.*(Not on top of screen where status bar is present.)</p><p>Thank you for your help.</p>","396437","","396437","","2010-09-16 10:32:19","2010-09-16 12:07:31","Persistant Taskbar in Android","<android>","2","0","1","",""
"3725783","1","3725910","","2010-09-16 10:31:22","-2","266","<p>Can i create an activity with 2 status bar?</p><p>Can i put the status bar at the bottom of Activity?</p>","396437","","","","","2010-09-16 10:50:56","Android Activity with 2 status bar?","<android>","1","1","","",""
"3725870","1","","","2010-09-16 10:45:17","1","3473","<p>i have a big problem and i did not find a solution for my problem. </p><p>I try to load an url and i use this tutorial: <a href=""http://developer.android.com/reference/android/webkit/WebView.html"" rel=""nofollow"">http://developer.android.com/reference/android/webkit/WebView.html</a></p><p>My Code:</p><p><code>public class HomeView extends Activity</code>{</p><pre><code>WebView mWebView;public void onCreate(Bundle savedInstanceState) {    try    {        super.onCreate(savedInstanceState);        setContentView(R.layout.home);        mWebView = (WebView) findViewById(R.id.webview);        mWebView.getSettings().setJavaScriptEnabled(true);        mWebView.loadUrl(""http://www.google.de"");    }    catch (Exception e) {    }}</code></pre><p>}`</p><p>my home.xml:</p><p><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></p><p><code>&lt;WebView  xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/webview""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;</code></p><p>Now my problem. If i start the program everything works fine. The page is loading and i see it on the screen. but then after everything is loaded, i get the following message (the application has stopped unexpectedly. please try again.) and my programm is terminated.</p><p>Hope somebody can help me.</p><p>Cheers, Roland</p><p>My Log:</p><p>`09-16 12:59:14.154: WARN/cache(1204): Unable to create webviewCache directory</p><p>09-16 12:59:18.432: DEBUG/dalvikvm(1204): GC_FOR_MALLOC freed 1931 objects / 221256 bytes in 195ms</p><p>09-16 12:59:18.522: WARN/dalvikvm(1204): threadid=13: thread exiting with uncaught exception (group=0x4001d800)</p><p>09-16 12:59:18.632: ERROR/AndroidRuntime(1204): FATAL EXCEPTION: WebViewWorkerThread</p><p>09-16 12:59:18.632: ERROR/AndroidRuntime(1204): java.lang.NullPointerException</p><p>09-16 12:59:18.632: ERROR/AndroidRuntime(1204):     at android.webkit.WebViewDatabase.getCacheTotalSize(WebViewDatabase.java:734)</p><p>09-16 12:59:18.632: ERROR/AndroidRuntime(1204):     at android.webkit.CacheManager.trimCacheIfNeeded(CacheManager.java:548)</p><p>09-16 12:59:18.632: ERROR/AndroidRuntime(1204):     at android.webkit.WebViewWorker.handleMessage(WebViewWorker.java:190)</p><p>09-16 12:59:18.632: ERROR/AndroidRuntime(1204):     at android.os.Handler.dispatchMessage(Handler.java:99)</p><p>09-16 12:59:18.632: ERROR/AndroidRuntime(1204):     at android.os.Looper.loop(Looper.java:123)</p><p>09-16 12:59:18.632: ERROR/AndroidRuntime(1204):     at android.os.HandlerThread.run(HandlerThread.java:60)</p><p>09-16 12:59:18.712: WARN/ActivityManager(65):   Force finishing activity de.test.webview/.HomeView</p><p>09-16 12:59:19.283: WARN/InputManagerService(65): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@43ecba70 (uid=10035 pid=1204)</p><p>09-16 12:59:21.976: DEBUG/dalvikvm(263): GC_EXPLICIT freed 65 objects / 2968 bytes in 4365ms</p><p>09-16 13:00:39.013: DEBUG/SntpClient(65): request time failed: java.net.SocketException: Address family not supported by protocol</p><p>09-16 13:04:19.383: INFO/Process(1204): Sending signal. PID: 1204 SIG: 9</p><p>09-16 13:04:19.474: WARN/InputManagerService(65): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43e92c50</p><p>09-16 13:04:19.742: INFO/ActivityManager(65): Process de.test.webview (pid 1204) has died.`</p>","449377","","449377","","2010-09-16 11:13:58","2011-06-04 05:00:31","Android WebView stopped unexpectly after loading an url","<android><android-webview>","2","3","1","",""
"3725884","1","3728602","","2010-09-16 10:47:26","2","3931","<p>friend's ,      I'm facing the problem in map view,initially i have map view with search option in header for searchin up content i'm usinghere my code for search...</p><pre><code>Intent intent = getIntent();        findViewById(R.id.map_search).setOnClickListener(                    new OnClickListener() {                        public void onClick(View v) {                        onSearchRequested();                        }                    });</code></pre><p>after clicking it the code below is executed</p><pre><code>       if (Intent.ACTION_VIEW.equals(intent.getAction())) {            //                          word = intent.getDataString();            Log.v(""Search2"", word);            Cursor c = managedQuery(Constants.CONTENT_URI_MAPS, null,                    Constants.BNAME + ""='"" + word + ""'"", null,                         null);</code></pre><h2>  --------------</h2><p>}where here i fetch search list data  from database.search option provides search map result has well and in search page there again search option in header and have back button ,when click back button either from UI or device it backs well to previous mapview and again back button in first mapview,when click back it throws an Activitythread exception,<strong>09-16 16:04:17.088: ERROR/ActivityThread(425): Activity com.example.brown.Bru_Maps_Result has leaked IntentReceiver android.net.NetworkConnectivityListener$ConnectivityBroadcastReceiver@43898578 that was originally registered here. Are you missing a call to unregisterReceiver()?</strong>i think i have to override Onpause(),OnReceive() methods,but i dont know how to implement it.help me to fix this issue.</p>","393953","","180538","","2010-09-16 10:48:42","2010-09-16 16:18:44","android.app.IntentReceiverLeaked: Activity com.example.brown","<android><android-intent><android-mapview>","1","0","","",""
"3725922","1","3726049","","2010-09-16 10:52:20","0","754","<p>I am trying to develop a custom gallery like application in which, i would like to place Image views along an elliptical path whose size varies with position.</p><p>All ideas are welcomed.</p><p>Thanks &amp; Regards,Sen</p>","449378","","","","","2010-09-16 11:09:43","Place imageviews along a curved path","<android>","1","0","","",""
"3726020","1","3726121","","2010-09-16 11:05:38","0","327","<p>In my program this is one switch case but it is not executed can u give me the solution</p><pre><code>                    Resources r2 = getResources();                String[] strtemp409A=r2.getStringArray(R.array.strtemp409A);                String[] strtemp11=r2.getStringArray(R.array.strtemp11);                String[] strtemp113=r2.getStringArray(R.array.strtemp113);                String[] strtemp114=r2.getStringArray(R.array.strtemp114);                String[] strtemp12=r2.getStringArray(R.array.strtemp12);                String[] strtemp123=r2.getStringArray(R.array.strtemp123);                String[] strtemp124=r2.getStringArray(R.array.strtemp124);                String[] strtemp13=r2.getStringArray(R.array.strtemp13);                String[] strtemp134A=r2.getStringArray(R.array.strtemp134A);                String[] strtemp22=r2.getStringArray(R.array.strtemp22);                String[] strtemp23=r2.getStringArray(R.array.strtemp23);                String[]strtemp401A=r2.getStringArray(R.array.strtemp401A);                String[] strtemp401B=r2.getStringArray(R.array.strtemp401B);                String[] strtemp402A=r2.getStringArray(R.array.strtemp402A);                String[] strtemp402B=r2.getStringArray(R.array.strtemp402B);                String[] strtemp403B=r2.getStringArray(R.array.strtemp403B);                String[] strtemp404A=r2.getStringArray(R.array.strtemp404A);                String[] strtemp407C=r2.getStringArray(R.array.strtemp407C);                String[] strtemp408A=r2.getStringArray(R.array.strtemp408A);                String[] strtemp410A=r2.getStringArray(R.array.strtemp410A);                String[] strtemp414B=r2.getStringArray(R.array.strtemp414B);                String[] strtemp416A=r2.getStringArray(R.array.strtemp416A);                String[] strtemp417A=r2.getStringArray(R.array.strtemp417A);                String[] strtemp500=r2.getStringArray(R.array.strtemp500);                String[] strtemp502=r2.getStringArray(R.array.strtemp502);                String[] strtemp503=r2.getStringArray(R.array.strtemp503);                String[] strtemp507=r2.getStringArray(R.array.strtemp507);                String[] strtemp508B=r2.getStringArray(R.array.strtemp508B);                String[] strtempc409A=r2.getStringArray(R.array.strtempc409A);                String[] strtempc410A=r2.getStringArray(R.array.strtempc410A);                String[] strtempc414B=r2.getStringArray(R.array.strtempc414B);    public void setRefno(int refno)    {        this.refno=refno;    }    public int getRefno()    {        return refno;    }    public void setStr(String str)    {        this.str=str;    }    public String getStr()    {        return str;    }    public double getPrs()    {        switch(refno)         {             case 0:                 for (int i = 0; i &lt; strtemp409A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp409A[i]))                     {                         prs = i;                     }                 }                 break;             case 1:                 for (int i = 0; i &lt; strtemp414B.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp414B[i]))                     {                         prs = i;                     }                 }                 break;             case 2:                 for (int i = 0; i &lt; strtemp416A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp416A[i]))                     {                         prs = i;                     }                 }                 break;             case 3:                 for (int i = 0; i &lt; strtemp404A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp404A[i]))                     {                         prs = i;                     }                 }                 break;             case 4:                 for (int i = 0; i &lt; strtemp507.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp507[i]))                     {                         prs = i;                     }                 }                 break;             case 5:                 for (int i = 0; i &lt; strtemp502.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp502[i]))                     {                         prs = i;                     }                 }                 break;             case 6:                 for (int i = 0; i &lt; strtemp402A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp402A[i]))                     {                         prs = i;                     }                 }                 break;             case 7:                 for (int i = 0; i &lt; strtemp402B.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp402B[i]))                     {                         prs = i;                     }                 }                 break;             case 8:                 for (int i = 0; i &lt; strtemp408A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp408A[i]))                     {                         prs = i;                     }                 }                 break;             case 9:                 for (int i = 0; i &lt; strtemp11.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp11[i]))                     {                         prs = i;                     }                 }                 break;             case 10:                 for (int i = 0; i &lt; strtemp113.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp113[i]))                     {                         prs = i;                     }                 }                 break;             case 11:                 for (int i = 0; i &lt; strtemp114.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp114[i]))                     {                         prs = i;                     }                 }                 break;             case 12:                 for (int i = 0; i &lt;strtemp123.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp123[i]))                     {                         prs = i;                     }                 }                 break;             case 13:                 for (int i = 0; i &lt; strtemp124.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp124[i]))                     {                         prs = i;                     }                 }                 break;             case 14:                 for (int i = 0; i &lt; strtemp500.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp500[i]))                     {                         prs = i;                     }                 }                 break;             case 15:                 for (int i = 0; i &lt; strtemp13.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp13[i]))                     {                         prs = i;                     }                 }                 break;             case 16:                 for (int i = 0; i &lt; strtemp23.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp23[i]))                     {                         prs = i;                     }                 }                 break;             case 17:                 for (int i = 0; i &lt;strtemp503.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp503[i]))                     {                         prs = i;                     }                 }                 break;             case 18:                 for (int i = 0; i &lt; strtemp508B.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp508B[i]))                     {                         prs = i;                     }                 }                 break;             case 19:                 for (int i = 0; i &lt; strtemp403B.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp403B[i]))                     {                         prs = i;                     }                 }                 break;             case 20:                 for (int i = 0; i &lt;strtemp22.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp22[i]))                     {                         prs = i;                     }                 }                 break;             case 21:                 for (int i = 0; i &lt; strtemp407C.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp407C[i]))                     {                         prs = i;                     }                 }                 break;             case 22:                 for (int i = 0; i &lt; strtemp417A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp417A[i]))                     {                         prs = i;                     }                 }                 break;             case 23:                 for (int i = 0; i &lt; strtemp410A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp410A[i]))                     {                         prs = i;                     }                 }                 break;             case 24:                 for (int i = 0; i &lt; strtemp12.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp12[i]))                     {                         prs = i;                     }                 }                 break;             case 25:                 for (int i = 0; i &lt; strtemp134A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp134A[i]))                     {                         prs = i;                     }                 }                 break;             case 26:                 for (int i = 0; i &lt;strtemp401A.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp401A[i]))                     {                         prs = i;                     }                 }                 break;             case 27:                 for (int i = 0; i &lt; strtemp401B.length; i++)                 {                     if (str.equalsIgnoreCase(strtemp401B[i]))                     {                         prs = i;                     }                 }                 break;         }         return prs;    }</code></pre>","441224","","441224","","2010-09-16 13:22:28","2010-09-16 13:22:28","android datatype casting","<android>","4","3","1","",""
"3726035","1","","","2010-09-16 11:07:42","0","954","<p>I would like to create a gridview of images, in which, these images will be downloaded based on a web service response.</p><p>The thumbnails of images will be displayed in a gridview, similar to how iPhone displays photos. </p><p>User can tap on the image and the corresponding full-res image will be shown, sized to fit within the android phone. Upon tapping on the full-res image, it will minimize and return to the gridview.</p><p>So far, following the <a href=""http://mobiforge.com/designing/story/understanding-user-interface-android-part-3-more-views"" rel=""nofollow"">guide</a> here, I had manage to create the gridview of images, but I would like to have it expand to the original size upon tapping and tapping again, return to the gridview. </p>","442658","","","","","2011-03-16 01:22:59","Creating a gridview of images' thumbnails that expands when tapped in Android","<java><android><image><image-processing>","1","0","","",""
"3726083","1","","","2010-09-16 11:14:05","1","7147","<p>I´m working with a lineal layout and I´m trying to change the text of a TextView but it doesn´t refresh. When I debug I´ve checked that the text have changed correctly.</p><p>Thanks</p><pre><code>public class Position extends Activity { Button botonempezar; Button botonsalir; TextView text; @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.position);        botonsalir = (Button) findViewById(R.id.salir);        botonempezar = (Button) findViewById(R.id.Empezar);        text = (TextView) findViewById(R.id.Textoposicion);        botonsalir.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            onDestroy();            finish();           }        });        botonempezar.setOnClickListener(new View.OnClickListener() {                 @Override            public void onClick(View v) {                 // TODO Auto-generated method stub                 searchPosition();                }        });    }    private void searchPosition(){        boolean condition = true;        do{           determinatePosition();        }while(condition == true);    }    private void determinatePosition(){           ....      this.text.setText(""New text"");      //this.text.invalidate();      this.text.postInvalidate();      Toast.makeText(getBaseContext(), ""New text"", Toast.LENGTH_SHORT);// this doesnt work neither.         ....    }</code></pre><p>Here I post the code of the xml file. Its really silly but it could be the problem:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;TextView         android:layout_height=""wrap_content""         android:id=""@+id/Textoposicion""         android:text=""Posición desconocida""         android:layout_width=""fill_parent""         android:layout_marginTop=""20dip""         android:inputType=""text""&gt;    &lt;/TextView&gt;    &lt;Button android:layout_height=""wrap_content""         android:id=""@+id/Empezar"" android:text=""Empezar""         android:layout_width=""fill_parent""         android:layout_marginTop=""20dip""&gt;    &lt;/Button&gt;    &lt;Button         android:layout_height=""wrap_content""         android:id=""@+id/salir""         android:layout_marginTop=""20dip""         android:text=""Finalizar programa""         android:gravity=""center"" android:layout_width=""fill_parent""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>I have edited the post because I omitted part of the code to make it simpler but I think I may suppressed the problem too. It runs in a endless loop, could be this the mistake?</p>","449409","","449409","","2010-09-17 11:47:37","2011-11-30 17:27:08","Android - change textView at run time","<android><runtime><textview>","3","0","","",""
"3726139","1","","","2010-09-16 11:23:45","0","62","<p>I want to know that when the Thread is running then if I press the home key of the emulator/device, then what will happen?Will thread gone be close or pause or any other?</p><p>waiting for your quick reply.</p><p>BR,gsmaker</p>","424854","","","","","2010-09-16 11:41:31","Android thredding problem?","<android>","2","1","","",""
"3726190","1","3726240","","2010-09-16 11:29:54","0","727","<p>As the title says, i have a Spinner with just a couple of options and a button. I didnt declared any Listener for the spinner, instead of that, what i want is use the button and perform different actions depending on the spinner selected option.</p><p>So, i declared a handler in the button option ""android:onClick"", but once there, i dont know how to access the option selected in the Spinner.</p><p>Can anybody help me?</p><p>Thank you!</p>","446234","","446234","","2010-09-16 11:58:18","2012-01-06 02:05:34","Catch a Spinner selection with a Button?","<android><button><spinner>","2","0","","",""
"3726234","1","3726285","","2010-09-16 11:35:00","2","1247","<p>dose any tools existing for our android layout design?I mean just drag the buttons,edittext,layouts...etc and that tool generate the xml file for our layout..anybody know about this tool...please let me know</p>","421645","","","","","2012-08-09 08:37:26","android layout designing tools","<android>","2","0","","",""
"3726282","1","4538857","","2010-09-16 11:40:43","3","7197","<p>I am trying to programmatically add a contact in Android. Here is my code:</p><pre><code>ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();int rawContactInsertIndex = ops.size();ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI)    .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE,""Google"")    .withValue(ContactsContract.RawContacts.ACCOUNT_NAME,""user1@gmail.com"") .build());ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)    .withValueBackReference(Data.RAW_CONTACT_ID,rawContactInsertIndex)    .withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)    .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, name)    .build());ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)    .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, rawContactInsertIndex)    .withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)    .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phone)    .withValue(ContactsContract.CommonDataKinds.Phone.TYPE, phoneType)    .build());ops.add(ContentProviderOperation.newInsert(ContactsContract    .Data.CONTENT_URI)    .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,rawContactInsertIndex)    .withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)    .withValue(ContactsContract.CommonDataKinds.Email.DATA, email)    .withValue(ContactsContract.CommonDataKinds.Email.TYPE, emailType)    .build());try {    getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);    Context ctx = getApplicationContext();    CharSequence txt = ""Contact "" + name +"" added successfully"";    int duration = Toast.LENGTH_LONG;    Toast toast = Toast.makeText(ctx, txt, duration);    toast.show();} catch (Exception e) {    Toast.makeText(getApplicationContext(),""error"",Toast.LENGTH_LONG).show();}</code></pre><p>Am I doing this correctly? How can I add an account name and account type?</p><p><strong>NOTE: I don't have any account created. Is it mandatory to have account in order to add a contact?</strong></p>","430652","","496830","","2011-11-14 12:45:51","2011-11-14 12:45:51","How can I programmatically add a contact?","<android><emulator><android-contacts>","2","0","3","",""
"3726332","1","3726598","","2010-09-16 11:47:50","0","834","<p>is there any way to write data to a sdcard when the card is mounted as a disc via usb? If I unplug it everything is fine.,how to solve this problem?anybody knows,please give sample code for me.</p><p>Thanks All</p>","410757","","410757","","2010-09-16 13:24:25","2010-09-16 13:24:25","How to mount sdcard permentaly?","<android>","1","1","","2011-12-20 05:22:05",""
"3726360","1","","","2010-09-16 11:52:29","0","556","<p>I have this array declaration:</p><pre><code>List&lt;GeoPoint&gt; race = new ArrayList&lt;GeoPoint&gt;();</code></pre><p>I want to store this array in to SQLite database.</p><p>Can some one give me code for converting this array in to byte[] or give me code for  another solution ?</p><p>Thanks</p>","432848","","","","","2011-07-14 03:17:57","Convert list in to byte[] for storing in SQLite in Android","<android>","1","1","","",""
"3726429","1","3726565","","2010-09-16 12:01:13","21","21245","<p>I have problem with fb sdk for Android (downloaded from <a href=""http://github.com/facebook/facebook-android-sdk"">http://github.com/facebook/facebook-android-sdk</a>). Tried to post wall but always get error (permission already set and logged in to fb)</p><p>here is the code snippet onClick function, i made small modifications on their sample code:</p><pre><code>Bundle params = new Bundle();params.putString(""message"", ""Test"");params.putString(""name"", ""American Virgin"");params.putString(""link"", ""http://bit.ly/12345"");params.putString(""description"", ""A Freshman College Girl on a scholarship from an ..."");params.putString(""picture"", ""http://xxx/MOV1026.jpg"");mAsyncRunner.request(""me/feed"", params, ""POST"", new TestRequestListener());</code></pre><p>From DDMS i get the following error:</p><pre><code>    09-16 18:55:28.372: WARN/Bundle(14392): Key picture expected byte[] but value was a java.lang.String.  The default value &lt;null&gt; was returned.09-16 18:55:28.414: WARN/Bundle(14392): Attempt to cast generated internal exception:09-16 18:55:28.414: WARN/Bundle(14392): java.lang.ClassCastException: java.lang.String09-16 18:55:28.414: WARN/Bundle(14392):     at android.os.Bundle.getByteArray(Bundle.java:1220)09-16 18:55:28.414: WARN/Bundle(14392):     at com.facebook.android.Util.openUrl(Util.java:153)09-16 18:55:28.414: WARN/Bundle(14392):     at com.facebook.android.Facebook.request(Facebook.java:295)09-16 18:55:28.414: WARN/Bundle(14392):     at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:209)09-16 18:55:28.422: WARN/Bundle(14392): Key message expected byte[] but value was a java.lang.String.  The default value &lt;null&gt; was returned.09-16 18:55:28.432: WARN/Bundle(14392): Attempt to cast generated internal exception:09-16 18:55:28.432: WARN/Bundle(14392): java.lang.ClassCastException: java.lang.String09-16 18:55:28.432: WARN/Bundle(14392):     at android.os.Bundle.getByteArray(Bundle.java:1220)09-16 18:55:28.432: WARN/Bundle(14392):     at com.facebook.android.Util.openUrl(Util.java:153)09-16 18:55:28.432: WARN/Bundle(14392):     at com.facebook.android.Facebook.request(Facebook.java:295)09-16 18:55:28.432: WARN/Bundle(14392):     at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:209)09-16 18:55:28.452: WARN/Bundle(14392): Key format expected byte[] but value was a java.lang.String.  The default value &lt;null&gt; was returned.09-16 18:55:28.472: WARN/Bundle(14392): Attempt to cast generated internal exception:09-16 18:55:28.472: WARN/Bundle(14392): java.lang.ClassCastException: java.lang.String09-16 18:55:28.472: WARN/Bundle(14392):     at android.os.Bundle.getByteArray(Bundle.java:1220)09-16 18:55:28.472: WARN/Bundle(14392):     at com.facebook.android.Util.openUrl(Util.java:153)09-16 18:55:28.472: WARN/Bundle(14392):     at com.facebook.android.Facebook.request(Facebook.java:295)09-16 18:55:28.472: WARN/Bundle(14392):     at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:209)</code></pre>","431041","","881229","","2014-02-19 19:35:41","2014-02-19 19:35:41","Post message to facebook wall from android fb sdk always error","<android><facebook><facebook-wall>","3","0","9","",""
"3726550","1","","","2010-09-16 12:17:23","0","637","<p>I tried some examples of Rokon graphics library.They are working fine on emulator but not running on device, they are getting installed properly.</p><p>The application opens and then closes without any error message.</p><p>I get the following system errors in emulator, but still application runs properly on it.</p><pre><code>09-16 12:24:03.640: ERROR/Rokon(790): Loading TextureAtlas09-16 12:24:03.681: WARN/System.err(790): java.lang.Exception: Loading TextureAtlas    09-16 12:24:03.700: WARN/System.err(790):     at com.stickycoding.rokon.Debug.error(Debug.java:71)        09-16 12:24:03.720: WARN/System.err(790):     at com.stickycoding.rokon.TextureAtlas.onLoadTexture(TextureAtlas.java:163)    09-16 12:24:03.720: WARN/System.err(790):     at com.stickycoding.rokon.GLHelper.checkTextureValid(GLHelper.java:206)    09-16 12:24:03.740: WARN/System.err(790):     at com.stickycoding.rokon.GLHelper.bindTexture(GLHelper.java:189)    09-16 12:24:03.740: WARN/System.err(790):     at com.stickycoding.rokon.GLHelper.drawNormal(GLHelper.java:366)    09-16 12:24:03.770: WARN/System.err(790):     at com.stickycoding.rokon.DrawableObject.onDrawNormal(DrawableObject.java:382)    09-16 12:24:03.770: WARN/System.err(790):     at com.stickycoding.rokon.DrawableObject.onDraw(DrawableObject.java:360)    09-16 12:24:03.790: WARN/System.err(790):     at com.stickycoding.rokon.background.FixedBackground.onDraw(FixedBackground.java:26)    09-16 12:24:03.790: WARN/System.err(790):     at com.stickycoding.rokon.Scene.onDraw(Scene.java:919)    09-16 12:24:03.810: WARN/System.err(790):     at com.stickycoding.rokon.RokonRenderer.onDrawFrame(RokonRenderer.java:40)    09-16 12:24:03.810: WARN/System.err(790):     at com.stickycoding.rokon.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1112)    09-16 12:24:03.820: WARN/System.err(790):     at com.stickycoding.rokon.GLSurfaceView$GLThread.run(GLSurfaceView.java:946)    09-16 12:24:03.820: VERBOSE/Rokon(790): @@ bind 1    09-16 12:24:04.040: DEBUG/dalvikvm(790): GC_EXTERNAL_ALLOC freed 566 objects / 35088 bytes in 179ms    09-16 12:24:04.450: ERROR/Rokon(790):   addToActive(1)    09-16 12:24:04.460: WARN/System.err(790): java.lang.Exception:   addToActive(1)    09-16 12:24:04.460: WARN/System.err(790):     at com.stickycoding.rokon.Debug.error(Debug.java:71)    09-16 12:24:04.470: WARN/System.err(790):     at com.stickycoding.rokon.TextureManager.addToActive(TextureManager.java:54)    09-16 12:24:04.470: WARN/System.err(790):     at com.stickycoding.rokon.TextureAtlas.onLoadTexture(TextureAtlas.java:190)    09-16 12:24:04.510: WARN/System.err(790):     at com.stickycoding.rokon.GLHelper.checkTextureValid(GLHelper.java:206)    09-16 12:24:04.510: WARN/System.err(790):     at com.stickycoding.rokon.GLHelper.bindTexture(GLHelper.java:189)    09-16 12:24:04.510: WARN/System.err(790):     at com.stickycoding.rokon.GLHelper.drawNormal(GLHelper.java:366)    09-16 12:24:04.530: WARN/System.err(790):     at com.stickycoding.rokon.DrawableObject.onDrawNormal(DrawableObject.java:382)    09-16 12:24:04.530: WARN/System.err(790):     at com.stickycoding.rokon.DrawableObject.onDraw(DrawableObject.java:360)    09-16 12:24:04.530: WARN/System.err(790):     at com.stickycoding.rokon.background.FixedBackground.onDraw(FixedBackground.java:26)    09-16 12:24:04.550: WARN/System.err(790):     at com.stickycoding.rokon.Scene.onDraw(Scene.java:919)    09-16 12:24:04.550: WARN/System.err(790):     at com.stickycoding.rokon.RokonRenderer.onDrawFrame(RokonRenderer.java:40)    09-16 12:24:04.550: WARN/System.err(790):     at com.stickycoding.rokon.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1112)    09-16 12:24:04.550: WARN/System.err(790):     at com.stickycoding.rokon.GLSurfaceView$GLThread.run(GLSurfaceView.java:946)</code></pre>","405521","","405521","","2010-09-16 12:39:30","2010-09-16 12:39:30","Android : apk running on emulator but not on device","<android><rokon>","0","4","","",""
"3726679","1","3726818","","2010-09-16 12:34:45","1","1409","<p>I want to import and compile <a href=""http://www.fbreader.org/FBReaderJ/"" rel=""nofollow"">FBReaderJ</a> on eclipse. I have downloaded the latest source code from their website. Is it necessary to install NDK and cygwin for compiling FBRreaderJ.If you can suggest me any tutorial OR helpful link.</p><p>FYI:</p><p>OS – Windows vista <br>Eclipse – [Helios 3.6] <br>Android OS – 1.6 <br></p>","395661","","40342","","2010-09-16 12:51:14","2011-04-27 11:31:29","How to import and compile Android FBReaderJ source code into Eclipse (Windows)?","<java><android><eclipse>","2","0","1","",""
"3726732","1","","","2010-09-16 12:41:18","0","320","<p>I am trying out an example of OpenCV from <a href=""http://github.com/billmccord/OpenCV-Android"" rel=""nofollow"">http://github.com/billmccord/OpenCV-Android</a> and am stuck at the point where it is mentioned ""Before attempting to run the VideoEmulator application, you must first copy this XML file into the emulator in the following location: /data/data/org.siprop.opencv/files/haarcascade_frontalface_alt.xml ""</p><p>Where in my eclipse workspace do I need to place this haar xml file to be copied to the location /data/data/org.siprop.opencv/files/ of the emulator?</p><p>The library ""libopencv.so"" when placed under libs/amreabi in the eclipse workspace, is picked and appropriately placed under data/data/org.siprop.opencv/lib as seen from the fileexplorer via DDMS</p>","449493","","52626","","2011-03-27 21:21:14","2011-03-27 21:21:14","How can i access a file (say .xml) from a native code,invoked from an android activity class, where do i need to place that XML file?","<android><eclipse>","1","0","","",""
"3726789","1","4970933","","2010-09-16 12:46:57","3","4910","<p>I created an animation in an xml file. I apply it on a textview like this : </p><pre><code>Animation anim = AnimationUtils.loadAnimation(this, R.anim.exit_about); anim.setRepeatMode(Animation.RESTART); anim.setRepeatCount(Animation.INFINITE); v.findViewById(R.id.global_about).startAnimation(anim); // v is my view </code></pre><p>This runs once even if I set a repeat count. Any idea ?</p>","449498","","65977","","2010-09-17 05:48:17","2011-02-11 15:37:47","Android XML animation and looping","<android>","1","0","","",""
"3726794","1","3733030","","2010-09-16 12:47:33","0","2481","<p>I am trying to build android example app by using phonegap. Here are the the system details.Operating System : Windows XPAndroid Sdk : 1.5 ( Previously i had 2.2 but deleted suspecting problem was with that)Ruby : 1.9.1-p430Ant: 1.8.1Java JDK 5PhoneGap 0.9.1</p><p>System Enviroment Variables</p><p>ANDROID_HOME : D:\work\android-sdk_r3-windows\android-sdk-windowsANT_HOME : D:\work\ANT\apache-ant-1.8.1JAVA_HOME : C:\Sun\SDK\jdkCLASSPATH : C:\Sun\SDK\jdk\libPath : D:\work\android-sdk_r3-windows\android-sdk-windows;C:\Ruby191\bin;D:\work\ANT\apache-ant-1.8.1\bin;D:\work\android-sdk_r3-windows\android-sdk-windows\tools;</p><p>I ran ruby script and get output as below$ ruby ./droidgap ""D:/work/android-sdk_r3-windows/android-sdk-windows"" pgtest com.example.android.pgtest example/ ""D:/work/droid_apps/output1""Building the JAR...</p><p>BUILD FAILEDD:\work\android-sdk_r3-windows\android-sdk-windows\tools\ant\ant_rules_r3.xml:283: null returned: 1</p><p>Total time: 1 secondCreating Android project for target level 1Adding www folder to project...Generating manifest...Copying over libraries and assets and creating phonegap.js...c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1265:in <code>initialize': No such file or directory - D:/work/phonegap/phonegap-android/framework/phonegap.jar (Errno::ENOENT)        from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1265:in</code>copy_stream'        from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1265:in `block in copy_file'</p><pre><code>    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1264:in `open'    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1264:in `copy_file'    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:471:in `copy_file'    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:392:in `block in cp'    from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1396:in `block in fu_each_sr</code></pre><p>c_dest'        from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1410:in <code>fu_each_src_dest0'        from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:1394:in</code>fu_each_src_dest'        from c:/Ruby191/lib/ruby/1.9.1/fileutils.rb:391:in <code>cp'        from ./droidgap:82:in</code>copy_libs'        from ./droidgap:20:in <code>run'        from ./droidgap:157:in</code>'</p><p>I even changed ant to ant.bat at one place, android to android.bat at two places in ruby script. I also set target_id = 1 which is for 1.5 sdk.</p><p>In framework/default.properties updatedtarget=android-3Still getting this eror and I googled finding nothing but a hint suggesting that 2.2 might cause this problem so deleted that as well from android sdk manager</p>","395080","","","","","2010-10-28 10:12:27","Problem when building phonegap example android app","<android><phonegap>","3","0","","",""
"3726828","1","","","2010-09-16 12:51:26","1","301","<p>I'm currently working a project to investigate the security inherit with Android. A part of my project is to perform an overflow of the stack and execute a local shell. I've created an exploitable application in native c, that is dynamically linked, installed it and executed it. </p><p>I'm having trouble using GDB. I want to know the location of the system and exit call addresses, using the command ""p system"". GDB keeps giving me an error ""no symbol table"". I've gave GDB the correct paths before attaching to the process and used the ""shared"" command. I'm really struggling, Has anyone got any clue to why this is happening.</p>","429708","","196561","","2011-02-18 19:35:22","2011-02-18 19:36:51","Android Native Debugging","<android><exploit>","1","0","1","",""
"3726831","1","3727303","","2010-09-16 12:51:30","0","1937","<p>I am using TabWidget. It comes with the default grey background color. Is it possible to change this? If it is then please tell me how can I do this??</p><p>Thanks Sankar Ganesh</p>","424413","","","","","2010-09-16 13:48:24","How to change the background color of Tab widget in Android?","<android>","1","0","","",""
"3726977","1","","","2010-09-16 13:10:52","0","576","<p>I want insert the current date and time into my table....I used this query</p><pre><code>insert into tbl_reminder values(""Description"",current_timestamp);</code></pre><p>but it insert the wrong time...actually the timestamp in my emulator is <code>2010-09-16 18:40:06</code>but the inserted timestamp value is <code>2010-09-16 13:10:06</code>what i do to insert the exact time...</p>","421645","","","","","2010-09-16 13:21:56","timestamp problem in android sqlite3","<android>","1","2","","",""
"3727063","1","","","2010-09-16 13:20:58","10","3269","<p>I have an Activity which contains a ListView defined in XML (its not subclassing the ListActivity class).</p><p>I want to display a message when the ListView is empty, so I tried doing so with the setEmptyView method:</p><pre><code>listView = (ListView) findViewById(R.id.list);TextView emptyListText = new TextView(this);// also tried with the following line uncommented// emptyListText.setId(android.R.id.empty);emptyListText.setText(getString(R.string.EmptyList));listView.setEmptyView(emptyListText);</code></pre><p>But it is not working. </p><p>Any ideas? </p><p>Thanks.</p>","425749","","","","","2012-07-12 13:07:49","Call to ListView's setEmpty method not working (nothing is displayed when the list is empty)","<android><listview>","3","0","1","",""
"3727188","1","","","2010-09-16 13:35:37","-1","773","<p>I am developing an application for an image gallery. I am using the share option in my application. The share option function is share image in SDcard, for example particular image I share, that image store in sdcard. When the user clicks the share button that time image will store in SDcard, images are retrieved from a url. Have any idea, anbody knows please give code for anytime can store image in sdcard.</p><p>Thanks All</p>","410757","","391531","","2010-09-16 13:42:33","2010-09-21 08:32:58","How to store image in sdcard at any time","<android>","1","2","1","",""
"3727249","1","3751306","","2010-09-16 13:42:06","2","4349","<p>I am new at android developing.</p><p>The project is about implementing an AbstractAccountAuthenticator with an AbstractThreadedSyncAdapter to sync certain data on a server with a content provider.</p><p>I made everything and both adding accounts and syncing is running without any problems.</p><p>Now I've tried to add a Preference-Screen just like suggested in the android reference (search for AbstractAccountAuthenticator, it is explained there) via xml like this:</p><p><strong>autenticator.xml:</strong></p><pre><code>&lt;account-authenticator xmlns:android=""http://schemas.android.com/apk/res/android""    android:accountType=""typeOfAuthenticator""    android:icon=""@drawable/icon""    android:smallIcon=""@drawable/miniIcon""    android:label=""@string/label""    android:accountPreferences=""@xml/account_preferences"" /&gt;</code></pre><p>The Preference-Screen-xml looks like this:</p><p><strong>account_preferences.xml:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;PreferenceCategory android:title=""@string/pref_cat_general""&gt;  &lt;PreferenceScreen android:key=""@string/pref_cat_scr_keygen"" android:title=""@string/pref_cat_scr_keygen_title"" android:summary=""@string/pref_cat_scr_keygen_summary""&gt;   &lt;intent android:action=""android.intent.action.VIEW"" android:targetPackage=""com.android.clean"" android:targetClass=""com.android.clean.KeygenAct"" /&gt;  &lt;/PreferenceScreen&gt; &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>The screen is promted how it should be, but and that is the problem: When I click on the PreferenceScreen with the intent it leads to a crash of the system (both in the emulator and my HTC-Desire). </p><p>Logcat says: </p><blockquote>  <p>ERROR/AndroidRuntime(18754):  android.util.AndroidRuntimeException:  Calling startActivity() from outside  of an Activity  context requires the  FLAG_ACTIVITY_NEW_TASK flag. Is this  really what you want?</p></blockquote><p>(whole <a href=""http://pastebin.com/cyzkwmYw"" rel=""nofollow"">Logcat on pastebin</a>)</p><p>Here the part of the manifest, where the activity is defined:</p><pre><code>&lt;activity android:name="".KeygenAct""&gt;    &lt;intent-filter&gt;     &lt;action android:name=""android.intent.action.VIEW"" /&gt;     &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;/intent-filter&gt;&lt;/activity&gt;</code></pre><p>The whole test-code (it is my project on the essentials to find the problem) is to find at googlecode (http://code.google.com/p/cleanproject/source/browse/) (Eclipse-Project)</p><p>Thank you already for your help, Esentian</p><p>p.s.: keygen is not a key generator, it means more key_general. A bit inartfully expressed ;)</p>","449567","","449567","","2010-09-16 13:58:44","2010-09-20 12:08:09","PreferenceScreen - <intent .../> - Exception - FLAG_ACTIVITY_NEW_TASK","<android><xml><exception><account-management><preferencescreen>","1","0","1","",""
"3727301","1","3727692","","2010-09-16 13:48:12","1","1189","<p>I have a class that extends ItemizedOverlay.</p><p>In it, I have:</p><pre><code>@Overrideprotected boolean onTap(int index) {  OverlayItem item = mOverlays.get(index);  /*// working below code, just replace */    AlertDialog.Builder dialog = new  AlertDialog.Builder(mContext);  dialog.setTitle(item.getTitle());  dialog.setMessage(item.getSnippet());  dialog.setPositiveButton(""Details"",new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int id) { }  });</code></pre><p>When I click the ""Details"" button, I want to start an Activity or setContentView, but those methods do not exist.</p><p>Any ideas?</p><p>Thanks</p>","442731","","","","","2011-12-01 17:12:33","How can I start and Activity from a class extending ItemizedOverlay?","<android>","3","0","","",""
"3727315","1","3729702","","2010-09-16 13:50:12","1","485","<p>Can I have random file access to a file bundled in my Android aplication? I don't want to copy the file from apk to the sdcard.</p>","243225","","","","","2010-09-16 18:41:47","Random access to file bundled with Android apk","<android>","1","0","","",""
"3727416","1","3735669","","2010-09-16 14:00:02","1","2795","<p>I have the following layout: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout   xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""&gt;   &lt;GridView      android:id=""@+id/grid""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""      android:layout_alignParentTop=""true""      android:numColumns=""auto_fit""      android:verticalSpacing=""5dip""      android:horizontalSpacing=""2.5dip""      android:columnWidth=""100px""      android:stretchMode=""columnWidth""      android:gravity=""center""      android:listSelector=""@drawable/transparent""      android:padding=""5dip""      android:scrollbarStyle=""outsideOverlay""      android:clickable=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Now I use a custom Adapter that inflates my own views and sets them as the items in the gridview and set a listener on the clicks in the gridview.</p><pre><code>GridView grid = (GridView) findViewById(R.id.grid);grid.setAdapter(new ProductAdapter(getApplicationContext(), products));grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {   @Override   public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {       ...   }});</code></pre><p>The problem is that the listener is not firing if I press on one of the cells in the gridview. If I use the trackpad to navigate around in the grid and I press the trackpad the listener is firing. Could it be that there is some other view that is capturing the click? My custom view consists of a LinearLayout with an ImageView and a TextView i read that inflating a layout for the gridview caused a problem at some places. </p><p>How can I make the items of the grid clickable?</p><p><strong>Edit</strong> There is no difference between inflating the layout in my adapter or just instantiating a single view and returning this for the cellview.</p>","114066","","114066","","2010-09-17 07:16:12","2010-09-17 13:23:17","GridView is not clickable","<android><gridview>","2","0","","",""
"3727449","1","","","2010-09-16 14:04:33","0","288","<p>I write file to sdcard using BufferedWriter.After that I want to overwrite header of file,but other data must be without changes( In the header I must add size of file). So I think I must change position where I need write.</p><p>How can I do that?What function should I use?</p>","448147","","","","","2010-09-16 19:44:49","Android Write files","<android><file><bufferedwriter>","1","0","","",""
"3727544","1","","","2010-09-16 14:16:13","3","5096","<p>I'm a relative beginner with Android. Does anybody have a <em>sane</em> explanation for how to listen for keys and soft keys in an EditText/TextView?</p><p>I'd love to see a comprehensive tutorial or set of examples.</p><p>As I understand it, I can add a KeyListener to my Activity, e.g. onKeyDown(), onKeyUp() but when I try this I can't trigger the events for normal keys only HOME and BACK for example.</p><p>I have seen mention of using a TextWatcher but that isn't the same as handling raw key events. </p><p>There seem to be a number of half-solutions here on SO. Hoping you can help clear the mists of confusion...</p>","448639","","","","","2012-07-22 16:13:39","Confused about Android key event handling. Any good explanations?","<android><edittext><keyevent>","3","1","1","",""
"3727838","1","3727914","","2010-09-16 14:48:25","1","920","<p>Im starting my first Android project so im still kind of n00b and not sure about how to organize some things to have a clean code :P</p><p>I have my first screen with a spinner and a button. When you click the button i catch the spinner selection and the app will move to a new screen (Depending on the spinner selection).</p><p>So now, i have 2 more .xml for the layout of the new screens, but i dont know if i must continue coding in the same Activitie/.java file, or if i should make a new Activitie and in that case, if i should create this new Activitie into another .java file os stay using the same..</p><p>Im not sure if i explained myself right xD. Anyway, if anyone need more info, just tell me and i will try to make it better :)</p><p>Thanks!</p>","446234","","","","","2010-09-17 07:28:12","Basic doubts about how ""organize"" my Android code","<android><source-code><activity>","1","0","","",""
"3728137","1","","","2010-09-16 15:21:20","4","338","<p>Well hello guys.</p><p>I am in progress of creating an android app that requires you to register and login.</p><p>Now I was thinking, why register and login? Isn't it possible to automaticly login with the google account that is already on your device? Just like how you can use your google account to login to stack overflow?</p><p>So my question is: is this possible, and how?</p><p>Thanks!</p>","389028","","","","","2010-09-16 18:33:26","Android app: logging in using google ID?","<android><openid>","1","0","3","",""
"3728251","1","3732292","","2010-09-16 15:33:23","0","3253","<p>I am trying to enable users who have linked their Facebook account to be able to post to their wall with one button press as <a href=""http://developers.facebook.com/docs/reference/api/post"" rel=""nofollow"">detailed in their docs</a>.  Specifically, I do not want to use the .dialog methods provided in the <a href=""http://github.com/facebook/facebook-android-sdk"" rel=""nofollow"">Facebook for Android library</a>, as I want the Publish process to be as seamless as possible.</p><p>The specific call looks like this in an HTTP client simulator:<br>HTTP POST<br><a href=""https://graph.facebook.com/me/feed"" rel=""nofollow"">https://graph.facebook.com/me/feed</a><br>Content-type: application/x-www-form-urlencoded<br>access_token=...&amp;link=http://mylink.com/id/1326&amp;name=What do you think?&amp;description=Description of the link  </p><p>This call runs successfully in HTTP Client on OS X.</p><p>I originally tried using the Facebook for Android library's .dialog function with ""stream.publish"" action, but this causes the unwanted dialog to appear.</p><p>Next, I tried using Facebook for Android's .request function with ""POST"" parameter, but this function assumes that the body is a byte array and fails in multiple places in the library.</p><p>Now, I am trying to use the Apache HTTP stack included with Android.Specifically, my code looks like this:</p><pre><code>String url = ""https://graph.facebook.com/me/feed"";ArrayList&lt;NameValuePair&gt; pairs = new ArrayList&lt;NameValuePair&gt;(4);pairs.add(new BasicNameValuePair(""access_token"", App.facebook.getAccessToken()));pairs.add(new BasicNameValuePair(""link"", ""http://mylink.com/id/""+id));pairs.add(new BasicNameValuePair(""name"", question));pairs.add(new BasicNameValuePair(""description"", description));InputStream inputStream = null;HttpResponse response = null;HttpClient client = null;try {    final HttpPost post = new HttpPost(url);    final UrlEncodedFormEntity entity = new UrlEncodedFormEntity(pairs);    post.setEntity(entity);    client = new DefaultHttpClient();    response = client.execute(post);} catch (IOException e) {    // code to handle exceptions}// close streams, etc.</code></pre><p>The problem is that the response from Facebook is consistently the following:</p><pre><code>{""error"":{""type"":""OAuthException"",""message"":""Invalid OAuth access token.""}}</code></pre><p>I know the OAuth access token is not invalid.  When I paste the same OAuth access token into HTTP Client, it works like a champ.  It seems that creating the HttpPost object's parameters is garbling the complex OAuth access token in some way.  Does anyone have suggestions on how to proceed?</p>","449670","","","","","2011-09-26 10:03:05","Posting to Facebook feed from Android app","<android><facebook><rest><oauth>","1","1","3","",""
"3728278","1","3728581","","2010-09-16 15:38:06","1","1551","<p>I want to create a ListView with a RadioButton in every row.I'm using a CursorAdapter and I'm binding it in the right way, but I cannot manage correctly the RadioButton.I want that at any moment only one RadioButton to be checked (so when I check one, I would like the one that was checked before to uncheck).Furthermore, when I put the RadioButton on the row, I cannot manage anymore the setOnItemClickListener.Do you know any tutorial that will work for me? Or can you give me any info?</p>","449689","","","","","2010-09-17 02:15:31","RadioButton in ListView","<android>","1","0","","",""
"3728322","1","11786226","","2010-09-16 15:43:46","2","1696","<p>We're trying to build a SoftKeyboard for an android app. The characters to be shown on the keyboard are asian language characters. </p><p>Any pointers will be helpful. </p>","368416","","","","","2012-08-02 21:42:02","SoftKeyboard with unicode characters or custom font","<java><android><android-keypad>","5","0","1","",""
"3728380","1","","","2010-09-16 15:50:34","0","347","<p>I'm making great progress porting my Color Computer Emulator to Android. It works on a Droid 2 with a hardware keyboard but I'm unable to get the virtual keyboard to send KeyEvents to my SurfaceView subclass. I've included the setFocusable(true), setFocusableInTouchMode(true), requestFocus() and requestFocusFromTouch() in the View per suggestions here. The onKeyUp and onKeyDown methods are not being called when using the virtual keyboard. I tried (although I'm not completely certain it's necessary) implementing onCreateInputConnection and returning a new BaseInputConnection (along with the corresponding onCheckIsTextEditor) without success.</p><p>I'm using an HTC Incredible for testing. Any help or sample code would be appreciated.</p><p>Thanks.</p>","444969","","","","","2010-09-17 05:34:48","SurfaceView KeyEvents","<android><keyboard><surfaceview>","1","0","","",""
"3728682","1","3728761","","2010-09-16 16:28:54","0","4747","<p>Hi im trying to read sqlite file which is placed in assets/databases folder</p><p>i followed this link to read data from sqlite file<a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"" rel=""nofollow"">http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/</a></p><p>im getting error </p><blockquote>  <p>no such table : while compiling  SELECT _id, name, address FROM  stores</p></blockquote><p>Is there any permission i need to write in manifest to read sqlite file data?</p><p>Please let me know how i can solve this issue. Or else please give me any reference link to follow. </p><p>Thanks in advance</p>","341443","","","","","2010-09-16 16:42:27","How to read sqlite file using cursor and display data in a listview","<android>","2","0","","",""
"3728688","1","","","2010-09-16 16:29:05","0","148","<p><a href=""http://www.youtube.com/watch?v=e1qG6z6BbYQ"" rel=""nofollow"">http://www.youtube.com/watch?v=e1qG6z6BbYQ</a></p><p>at 1:22, the way he edits the XML for resources is totally different from mine. Mine is only coding and his is more visual. Does he use a custom plugin?</p>","449759","","","","","2012-01-15 19:54:25","Interface for XML editor","<android><xml><user-interface>","1","1","","",""
"3728716","1","3730022","","2010-09-16 16:32:37","1","830","<p>How to know Android Phone is going to sleep?Please Help me with a sample code.Thanks for reading.</p>","655814","","","","","2010-09-16 19:29:53","How to know Android Phone is going to sleep?","<android>","1","0","","",""
"3728921","1","","","2010-09-16 16:56:59","5","993","<p>How do i go about reading the genre that a song is associated to?  I can read the song, but how do i grab the genre for that song, where is it stored?</p><p>Thanks!</p>","410071","","","","","2013-11-02 14:39:02","Get the genre of a Song","<android>","2","2","","",""
"3728987","1","9298967","","2010-09-16 17:05:36","1","538","<p>From within an <code>Activity</code> I query my database from an <code>AsyncTask</code>, and I pass the result <code>Cursor</code> to <code>startManagingCursor()</code>. From the docs, a managed cursor will automatically invoke <code>requery()</code> when an activity is restarted.</p><p>My question is, is requery() invoked from a background thread? If not and this runs on the UI thread and the query takes a long time to return this could cause a Application Not Responding dialog, right?</p>","300368","","","","","2012-02-15 18:19:08","Does an Activity-managed Cursor invoke requery() on another thread?","<android>","1","0","1","",""
"3728990","1","3736057","","2010-09-16 17:05:57","27","26892","<p>I would like to completely re-skin the default dialogue component in Android.  Specifically I would like to do this:</p><ul><li><p>Change the semi-transparent overlay background from the default black to a semi-transparent white.</p></li><li><p>Change the Dialogue window byremoving the default windowed frame border,and replacing it with a layoutdefined in XML (it's just going to bea borderless graphic with floatingbuttons.  no actual frame.)</p></li></ul><p>I have seen tutorials about creating a custom layout for within the dialogue box (e.g. <a href=""http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application"">http://www.helloandroid.com/tutorials/how-display-custom-dialog-your-android-application</a>), but I haven't seen anything regarding changing the colour of the overlay and/or completely customizing the dialogue window that pops up and turning it more into an overlay with no ""window"".</p>","107459","","107459","","2010-09-17 02:25:58","2012-08-28 11:39:52","How to create a completely custom Dialogue/Popup in Android (change overlay colour and dialogue window layout)","<android><dialog><popup><overlay>","2","0","27","",""
"3729007","1","","","2010-09-16 17:09:54","7","4292","<p>I am adding some basic alarm functionality to my program via the use of AlarmManager and a BroadcastReceiver class (named AReceiver.java).  My problem is that the data I add to the bundle attached to the Intent creating the PendingIntent appears to be lost.  The only bundle data I can access in the AReceiver class is a android.intent.extra.ALARM_COUNT=1.</p><p>Here is the basic code in the main activity class creating the Intent, PendingIntent and the AlarmManager:[Code in main activity - Notepadv3]</p><pre><code>Intent intent = new Intent(Notepadv3.this, AReceiver.class);         intent.putExtra(""teststring"",""hello, passed string in Extra"");               PendingIntent alarmIntent = PendingIntent.getBroadcast(this, pendingPeriodIntentId, intent, 0);     AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);           am.set(AlarmManager.RTC_WAKEUP, timeOfNextPeriod.getTimeInMillis(), alarmIntent);</code></pre><p>[Code in the BroadcastReceiver - AReceiver]</p><pre><code>public void onReceive(Context con, Intent arg1) {Bundle extrasBundle = arg1.getExtras();Log.d(""broadcast"",""contains teststring = "" + extrasBundle.containsKey(""teststring""));Log.d(""broadcast"",""is empty? = "" + extrasBundle.isEmpty());Log.d(""broadcast"",""to string = "" + extrasBundle.toString());    }   </code></pre><p>Debug messages say that contains teststring is FALSE, is empty is FALSE and when outputting the whole bundle, I get the android.intent.extra.ALARM_COUNT=1 value.</p><p>Any help would be greatly appreciated.</p><p>Cheers,Tom</p>","416881","","","","","2010-09-17 14:41:25","Trouble sending Bundle with PendingIntent to a Broadcast Receiver, data lost","<android><bundle><broadcastreceiver>","1","0","2","",""
"3729068","1","","","2010-09-16 17:19:07","2","3717","<p>I'm trying to implement something like a countdown timer that plays an alarm at 0. I want to be able to set the amount of time to wait before the timer goes off and I'm wondering if there's a UI widget or element that provides this kind of selection functionality.</p><p>Basically, does android have something like the iPhone's selection spinwheel? Or is there some type of timepicker that allows selection of an arbitrary number of hours and minutes? The timepicker widget in android has an unnecessary AM/PM label.</p><p>Do I need to implement my own custom UI to achieve this?</p>","449806","","","","","2012-11-23 05:43:48","hour/minute picker for android countdown timer","<android><user-interface><timer><picker><countdown>","2","0","2","",""
"3729181","1","","","2010-09-16 17:34:03","0","1951","<p>I can't get Oauth to work with Twitter. I have tried the following (all result in the same 401 error):</p><ol><li><a href=""http://www.winterwell.com/software/jtwitter.php"" rel=""nofollow"">jTwitter</a> (using the default OauthSignpostClient)</li><li><a href=""http://www.winterwell.com/software/jtwitter.php"" rel=""nofollow"">jTwitter</a> using the commonshttp library (CommonsOauthProvider) instead of the ""DefaultOauthProvider""</li><li><a href=""http://www.winterwell.com/software/jtwitter.php"" rel=""nofollow"">jTwitter</a> using the OauthScribeClient (instead of the OauthSignpostClient)</li><li><a href=""http://code.google.com/p/oauth-signpost/"" rel=""nofollow"">oauth-signpost</a> (by itself... no jTwitter)</li><li><a href=""http://twitter4j.org/en/index.html"" rel=""nofollow"">Twitter4J</a></li><li><a href=""http://code.google.com/p/agirardello/"" rel=""nofollow"">http://code.google.com/p/agirardello/</a></li><li><a href=""http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/"" rel=""nofollow"">http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/</a></li><li><a href=""http://github.com/kaeppler/signpost-examples/blob/master/OAuthTwitterExample/src/TwitterMain.java"" rel=""nofollow"">http://github.com/kaeppler/signpost-examples/blob/master/OAuthTwitterExample/src/TwitterMain.java</a></li></ol><p>I've tried my own implementation and copy/pasted the sample code from each of the sites, and nothing seems to work. I'm also 100% sure I also downloaded and included any dependencies (where needed).</p><p>Here's the interesting part. Using jTwitter and the oauth-signpost library, I can initiate a connection to Twitter, open a browser window for the user, have them log-in and generate a PIN for my app. When the app goes to post a status update however, (using the pin, and the stored access token and token secret), the 401 error pops up. All other things I've tried won't even let me open a browser window and ask the user to generate a PIN (they die with the 401 error on the request for the ""request token"").</p><p>Please help. Thanks</p>","272302","","","","","2010-10-29 08:51:59","Android -- Twitter Oauth -- Many different methods, none seem to work. Help","<android><twitter><oauth><twitter4j><jtwitter>","3","0","1","",""
"3729212","1","3752683","","2010-09-16 17:37:49","1","490","<p>I have a preferences page which is defined by XML - including some default values. I use a PreferenceActivity to display and handle this page. Whenever I use this page to set the preferences the preference file on the file system is updated properly - I can see this via adb.</p><p>However, whenever I go back to the settings page after have changed some of the settings, it's the defaults that are shown.  Worse than that, if I press back without changing any settings, it then sets the, all back to the default.</p><p>Any ideas on how I can get the prefs to actualyl show the current settings?</p><p>My PreferenceActivityis created thus:</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    PreferenceManager.getDefaultSharedPreferences(this)            .registerOnSharedPreferenceChangeListener(this);    setDefaults(this);    super.onCreate(savedInstanceState);    addPreferencesFromResource(R.xml.settings);}</code></pre><p>The XML looks like this:</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;ListPreference     android:id=""@+id/numberOfYearsList""    android:key=""numberOfYears""    android:title=""Number of Years to Read the Bible""    android:summary=""How many years would you like to take to read through the reading plan?""    android:entries=""@array/numberOfYears""    android:entryValues=""@array/numberOfYears""    android:dialogTitle=""How Many Years?""    android:defaultValue=""1""    /&gt;  &lt;CheckBoxPreference android:key=""ignoreDates""    android:id=""@+id/ignoreDatesCheckbox""    android:title=""Ignore Dates""    android:summary=""Would you like to use the dates in the plan?""    android:defaultValue=""false""  /&gt;&lt;/PreferenceScreen&gt;</code></pre>","398293","","398293","","2010-09-16 20:49:02","2013-08-06 04:18:26","Why doesn't my preferences page show the current values?","<android>","1","2","","",""
"3729290","1","","","2010-09-16 17:46:36","2","6234","<p>I'm trying to create an android application using the facebook android SDK (http://github.com/facebook/facebook-android-sdk). I'm trying to figure out if I will be able to use FQL using this SDK. If anyone has any experiences in this regard, please let me know.</p><p>FQL can apparently be used using <a href=""https://api.facebook.com/method/fql.query?query=QUERY"" rel=""nofollow"">https://api.facebook.com/method/fql.query?query=QUERY</a>, the facebook android SDK however doesn't seem to support this.</p><p>Thanks;</p>","442971","","","","","2013-01-27 08:24:15","FQL using facebook android SDK","<android><facebook><sdk><facebook-fql>","4","0","2","",""
"3729502","1","","","2010-09-16 18:15:59","1","1701","<p>I am trying to access picasa from android ,</p><p>i have tried to run following sample code </p><pre><code>http://code.google.com/p/google-api-java-client/source/browse/picasa-atom-android-sample/?repo=samples#picasa-atom-android-sample%3Fstate%3Dclosed</code></pre><p>but i am getting only one thing over here , </p><p><img src=""http://i.stack.imgur.com/oluiX.png"" alt=""alt text""></p><p>and there is no options to select google account.</p><p>in my code i am getting </p><pre><code>    final AccountManager manager = AccountManager.get(this);    final Account[] accounts = manager.getAccountsByType(""com.google"");    final int size = accounts.length;</code></pre><p>size = 0 and no items were there in select google account</p><p>so can you please tell me how to set up google account , to access picasa album or if someone has another idea then also i don't mind.</p>","405383","","83406","","2010-09-21 17:35:18","2012-10-24 15:33:52","accsessing picasa using android","<android><google-api><picasa><google-api-java-client>","1","3","2","",""
"3729643","1","3729895","","2010-09-16 18:31:36","0","284","<p>I'm testing an application I'm working on and I wanted to delete the database my application creates so I could read all the data from my web server back in to a fresh one.</p><p>I launched adb, went to data/data/my.applicaton.package/databases and did a ""rm mydatabase"".  This deleted the database (note: I've done this many many times before without a problem).</p><p>I launched my application again and, to my surprise, a new database wasn't created.  Even more surprising is there was data in my application.  My application is still pulling the data from some where!  It gets a Cursor from my database and uses a CursorAdapter to populate the list.  So, it is obviously reading from <em>a</em> database (seemingly a cached one?).</p><p>Exactly where is it pulling from and why?  It's pointed at a database that is now deleted.</p>","406790","","","","","2010-10-29 02:02:00","Deleting application database from emulator","<android><database><adb>","1","0","","",""
"3729824","1","","","2010-09-16 18:57:22","3","1315","<p>I have an ImageView sitting on a FrameLayout. I want to be able to move this imageView by setting a margin:<br><code>LayoutParams lp = new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);</code><br><code>lp.setMargins(left, top, 0, 0);</code><br><code>imageView.setLayoutParams(lp);</code><br><code>imageView.invalidate();</code><br>However nothing changes and my imageView does not move. <br>What am I doing wrong? <br>Do I need to be doing something different other than <code>imageView.invalidate()</code> after I set new margins?</p>","448091","","","","","2013-06-01 06:53:33","How can I change layout params while program is running","<android><layout><parameters><move><margin>","1","2","1","",""
"3729968","1","","","2010-09-16 19:18:13","10","2569","<p>Anybody has some suggestions to make a webview faster to load the url? </p><p>In my situation, I am using the jQuery's getScript to load the javascript(s) when needed. </p><p>Thanks,Sana.</p>","402637","","641020","","2011-09-22 09:14:58","2014-03-31 06:18:13","How to make a android WebView load faster?","<android><android-webview>","3","0","2","",""
"3729996","1","","","2010-09-16 19:20:44","1","3848","<p>I am beginning developing android application. What I need to know is how to associated a xml layout file with a new class (not the activity). For example the class needs to have a table with an image and some texts.</p><p>thanks!</p>","335518","","","","","2013-02-16 21:27:22","Android: add new view with a XML Layout file","<android><class><layout>","2","1","","",""
"3730217","1","","","2010-09-16 19:48:31","5","10109","<p>Is there a way to apply a style to a button when the button is pressed?</p><p>If I have a style in <strong>style.xml</strong>:</p><pre><code>&lt;resources&gt;    &lt;style name=""test""&gt;        &lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>a selector in <strong>button.xml</strong>:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:drawable=""@drawable/test_pressed""              style=""@style/test""          android:state_pressed=""true""/&gt;    &lt;item android:drawable=""@drawable/test_focused""          android:state_focused=""true""/&gt;    &lt;item android:drawable=""@drawable/test_normal""/&gt;&lt;/selector&gt;</code></pre><p>then how would I reference <strong>button.xml</strong> in my layout?</p><pre><code>&lt;Button        ...        android:???=""button""/&gt;</code></pre><p>Thanks!</p>","440308","","","","","2011-10-09 20:36:14","Apply Different Style to Button When Pressed","<android><button><coding-style><pressed>","5","0","2","",""
"3730258","1","3730394","","2010-09-16 19:52:49","29","7570","<p>I created a widget that when clicked activates a PendingIntent.  The problem is when I have more than one widget on the screen only the latest one will start the PendingIntent.  </p><p>I have read some about a unique request code, but not figured this out. </p><p>Any ideas how I can have multiple widgets and the PendingIntents work for each? </p><p>Here is a snippet of my code:</p><pre><code>Intent openApp = new Intent(context, RunningTally.class);    openApp.putExtra(""widgetId"", appWidgetId);    PendingIntent pendingAppIntent =         PendingIntent.getActivity(context, 0, openApp, PendingIntent.FLAG_CANCEL_CURRENT  );    views.setOnClickPendingIntent(R.id.openFull, pendingAppIntent);</code></pre>","2186261","","3414","","2011-02-05 23:34:51","2012-03-11 07:11:24","Mulitple Instances of Pending Intent","<android><widget>","1","0","7","",""
"3730259","1","3732513","","2010-09-16 19:52:55","4","9476","<p>I'm developing an Android application with a tabbed layout. I've got it to where it doesn't spawn a new activity like <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">Google's tutorial suggested</a>, however I only did this in an effort to get my content to show when clicking on each tab. Currently it just shows black regardless of what tab is active.</p><p>The following is my code in its latest iteration:</p><p><strong>Main.java</strong></p><pre><code>public class Main extends TabActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources();        TabHost tabHost = getTabHost();        TabHost.TabSpec spec;        // add orders tab        spec = tabHost.newTabSpec(""orders"").setIndicator(""Orders"",                          res.getDrawable(R.drawable.flash_36))                          .setContent(R.id.ordersLayout);        tabHost.addTab(spec);        // add positions tab        spec = tabHost.newTabSpec(""positions"").setIndicator(""Positions"",                          res.getDrawable(R.drawable.small_tiles_36))                          .setContent(R.id.positionsLayout);        tabHost.addTab(spec);        // add strategies tab        spec = tabHost.newTabSpec(""strategies"").setIndicator(""Strategies"",                          res.getDrawable(R.drawable.cards_36))                          .setContent(R.id.strategiesLayout);        tabHost.addTab(spec);        // add account tab        spec = tabHost.newTabSpec(""account"").setIndicator(""Account"",                          res.getDrawable(R.drawable.seal_36))                          .setContent(R.id.accountLayout);        tabHost.addTab(spec);        tabHost.setCurrentTab(1);    }}</code></pre><p><strong>Main.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TabHost    android:id=""@android:id/tabhost""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""            xmlns:android=""http://schemas.android.com/apk/res/android""&gt;            &lt;LinearLayout   android:id=""@+id/mainLayout""                             android:layout_width=""fill_parent""                             android:layout_height=""fill_parent""                            android:padding=""5dp""&gt;                &lt;TabWidget  android:id=""@android:id/tabs""                             android:layout_width=""fill_parent""                             android:layout_height=""wrap_content""&gt;                &lt;/TabWidget&gt;                &lt;FrameLayout android:id=""@android:id/tabcontent""                             android:layout_width=""fill_parent""                             android:layout_height=""fill_parent""                            android:background=""#fff""                            android:padding=""5dp""&gt;                            &lt;include layout=""@layout/orders""/&gt;                            &lt;include layout=""@layout/positions""/&gt;                            &lt;include layout=""@layout/strategies""/&gt;                            &lt;include layout=""@layout/account""/&gt;                &lt;/FrameLayout&gt;            &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p><strong>Account.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     android:id=""@+id/accountLayout""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:background=""#fff""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TextView         android:text=""Account Information""         android:id=""@+id/accountLabel""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>Orders.xml</strong></p><p><em>I'm only including these two, they are all the exact same with appropriate ids for the LinearLayout's android:id parameter.</em></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     android:id=""@+id/ordersLayout""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:background=""#fff""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;TextView         android:text=""Working Orders""         android:id=""@+id/ordersLabel""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>And here's a screenshot of what I get when switching between tabs:</p><p><strong>Orders Tab</strong></p><p><img src=""http://i.stack.imgur.com/NVq2e.png"" alt=""alt text""></p><p><strong>Positions Tab</strong></p><p><img src=""http://i.stack.imgur.com/b7OQj.png"" alt=""alt text""></p><p>This is true for both the emulator and a Samsung Galaxy I just got, and I highly reccommend by the way, any ideas?</p>","50391","","","","","2010-09-17 03:34:42","Android Tabbed Layout setContent","<android>","1","0","","",""
"3730312","1","","","2010-09-16 19:58:23","4","4978","<p>can anybody suggest ""How to call a PHP Webservice from Android using KSOAP2?""</p>","412168","","948041","","2012-04-06 13:39:17","2012-12-28 14:16:56","How to call a PHP Webservice from Android using KSOAP2?","<android>","1","0","2","",""
"3730325","1","3730537","","2010-09-16 20:00:30","0","360","<p>I need to setup vertices for a rectangle - I have a square example, how would I modify it to get a rectangle 5 times the width and half the height?</p><pre><code>    /** The initial vertex definition */    private float vertices[] = {                    //Vertices according to faces                    -1.0f, -1.0f, 1.0f, //v0                    1.0f, -1.0f, 1.0f,     //v1                    -1.0f, 1.0f, 1.0f,     //v2                    1.0f, 1.0f, 1.0f,     //v3                    1.0f, -1.0f, 1.0f,     // ...                    1.0f, -1.0f, -1.0f,                     1.0f, 1.0f, 1.0f,                     1.0f, 1.0f, -1.0f,                    1.0f, -1.0f, -1.0f,                     -1.0f, -1.0f, -1.0f,                     1.0f, 1.0f, -1.0f,                     -1.0f, 1.0f, -1.0f,                    -1.0f, -1.0f, -1.0f,                     -1.0f, -1.0f, 1.0f,                     -1.0f, 1.0f, -1.0f,                     -1.0f, 1.0f, 1.0f,                    -1.0f, -1.0f, -1.0f,                     1.0f, -1.0f, -1.0f,                     -1.0f, -1.0f, 1.0f,                     1.0f, -1.0f, 1.0f,                    -1.0f, 1.0f, 1.0f,                     1.0f, 1.0f, 1.0f,                     -1.0f, 1.0f, -1.0f,                     1.0f, 1.0f, -1.0f,                                         };</code></pre><p>Okay so I think I setup the vertices correctly but now I need to setup the normals textures and indices:</p><pre><code>/** The initial vertex definition */    private float vertices[] = {                    //Vertices according to faces                    -1.0f, -.5f, 1.0f, //v0                    4.0f, -.5f, 1.0f,     //v1                    -1.0f, .5f, 1.0f,     //v2                    4.0f, .5f, 1.0f,     //v3                    4.0f, -.5f, 1.0f,     // 2...                    4.0f, -.5f, -1.0f,                     4.0f, .5f, 1.0f,                     4.0f, .5f, -1.0f,                    4.0f, -.5f, -1.0f, //3                    -1.0f, -.5f, -1.0f,                     4.0f, .5f, -1.0f,                     -1.0f, .5f, -1.0f,                    -1.0f, -.5f, -1.0f, //4                    -1.0f, -.5f, 1.0f,                     -1.0f, .5f, -1.0f,                     -1.0f, .5f, 1.0f,                    -1.0f, -.5f, -1.0f, //5                    4.0f, -.5f, -1.0f,                     -1.0f, -.5f, 1.0f,                     4.0f, -.5f, 1.0f,                    -1.0f, .5f, 1.0f, //6                    4.0f, .5f, 1.0f,                     -1.0f, .5f, -1.0f,                     4.0f, .5f, -1.0f,                                         };</code></pre><p>Any suggestions how to set these up:</p><pre><code>private float normals[] = {                        // Normals                        0.0f, 0.0f, 1.0f,                     0.0f, 0.0f, -1.0f,                     0.0f, 1.0f, 0.0f,                     0.0f, -1.0f, 0.0f,                     0.0f, 0.0f, 1.0f,                     0.0f, 0.0f, -1.0f,                     0.0f, 1.0f, 0.0f,                     0.0f, -1.0f, 0.0f,                    0.0f, 0.0f, 1.0f,                     0.0f, 0.0f, -1.0f,                     0.0f, 1.0f, 0.0f,                     0.0f, -1.0f, 0.0f,                    0.0f, 0.0f, 1.0f,                     0.0f, 0.0f, -1.0f,                     0.0f, 1.0f, 0.0f,                     0.0f, -1.0f, 0.0f,                    0.0f, 0.0f, 1.0f,                     0.0f, 0.0f, -1.0f,                     0.0f, 1.0f, 0.0f,                     0.0f, -1.0f, 0.0f,                    0.0f, 0.0f, 1.0f,                     0.0f, 0.0f, -1.0f,                     0.0f, 1.0f, 0.0f,                     0.0f, -1.0f, 0.0f,                                        };/** The initial texture coordinates (u, v) */   private float texture[] = {                    //Mapping coordinates for the vertices                    0.0f, 0.0f,                     0.0f, 1.0f,                     1.0f, 0.0f,                     1.0f, 1.0f,                    0.0f, 0.0f,                    0.0f, 1.0f,                     1.0f, 0.0f,                    1.0f, 1.0f,                    0.0f, 0.0f,                     0.0f, 1.0f,                     1.0f, 0.0f,                     1.0f, 1.0f,                    0.0f, 0.0f,                     0.0f, 1.0f,                     1.0f, 0.0f,                     1.0f, 1.0f,                    0.0f, 0.0f,                     0.0f, 1.0f,                     1.0f, 0.0f,                     1.0f, 1.0f,                    0.0f, 0.0f,                     0.0f, 1.0f,                     1.0f, 0.0f,                     1.0f, 1.0f,                                 };/** The initial indices definition */private byte indices[] = {                    // Faces definition                    0, 1, 3, 0, 3, 2,       // Face front                    4, 5, 7, 4, 7, 6,       // Face right                    8, 9, 11, 8, 11, 10,    // ...                    12, 13, 15, 12, 15, 14,                     16, 17, 19, 16, 19, 18,                     20, 21, 23, 20, 23, 22,                                             };</code></pre>","449950","","449950","","2010-09-16 20:54:45","2010-09-16 20:54:45","How do I setup vertices for a rectangle?","<android><opengl-es>","1","0","","",""
"3730358","1","3761414","","2010-09-16 20:04:23","11","19691","<p>Can Android's addHeaderView() be used to add multiple headers throughout a single ListView? Can someone give an example of how to do this?</p><p>I was able to accomplish what I wanted by manipulating the IconicAdapter Class... is there any reason why I should not do it this way? I feel this could be modified for more advanced implementations. In my case, I know that I will have two sections, with a header + 2 rows in each section.</p><pre><code>class IconicAdapter extends ArrayAdapter&lt;String&gt; {    IconicAdapter() {        super(ContactTabProfileResource.this, R.layout.row_iconic, mArrayList);    }    public View getView(int position, View convertView, ViewGroup parent) {        LayoutInflater inflater = getLayoutInflater();        View row = null;        if(position == 1 || position == 5) { // phone             row = inflater.inflate(R.layout.row_iconic, parent, false);            TextView label =(TextView)row.findViewById(R.id.label);            label.setText(mArrayList.get(position));            ImageView icon = (ImageView)row.findViewById(R.id.rowicon);            icon.setImageResource(R.drawable.icon_phone);        } else if (position == 2 || position == 6) { // email            row = inflater.inflate(R.layout.row_iconic, parent, false);            TextView label =(TextView)row.findViewById(R.id.label);            label.setText(mArrayList.get(position));            ImageView icon = (ImageView)row.findViewById(R.id.rowicon);            icon.setImageResource(R.drawable.icon_email);        } else if (position == 0 || position == 4) { // section header            row = inflater.inflate(R.layout.row_header, parent, false);            TextView label =(TextView)row.findViewById(R.id.label);            label.setText(mArrayList.get(position));            label.setBackgroundColor(Color.GRAY);           } else if (position == 3) { // section divider            row = inflater.inflate(R.layout.row_header, parent, false);            TextView label =(TextView)row.findViewById(R.id.label);            label.setText("" "");        }        return(row);    }}</code></pre><p>Then I created two different XML layouts. row_header.xml is for the header rows and row_iconic.xml is for the non-header rows, which contain an icon. </p><p>row_header.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""horizontal""  android:gravity=""right""&gt;      &lt;TextView    android:id=""@+id/label""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textSize=""20sp""    android:paddingTop=""10dp""    android:paddingBottom=""10dp""    android:paddingRight=""10dp""    android:paddingLeft=""10px""    android:gravity=""left""    android:textStyle=""bold""    /&gt;    &lt;/LinearLayout&gt;</code></pre><p>row_iconic.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""horizontal""  android:gravity=""right""&gt;      &lt;TextView    android:id=""@+id/label""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:textSize=""16sp""    android:paddingTop=""10dp""    android:paddingBottom=""10dp""    android:paddingRight=""10dp""    android:paddingLeft=""44px""    /&gt;      &lt;ImageView    android:id=""@+id/rowicon""    android:layout_width=""40dp""    android:paddingRight=""10dp""    android:paddingTop=""10dp""    android:layout_height=""30dp""            android:src=""@drawable/icon""    /&gt;    &lt;/LinearLayout&gt;</code></pre>","300129","","300129","","2010-09-21 18:21:00","2010-09-25 09:09:18","How to Use Android addHeaderView","<android><listview><header>","4","0","9","",""
"3730708","1","3738890","","2010-09-16 20:50:50","1","4791","<p>I have an application that uses a service to create an ArrayList of custom objects (MyObject) every x seconds.  I then want my Activity to obtain this ArrayList.</p><p>I'm currently planning on having the Service send a message to the Activity's handler every time it finishes the query for the data.  I want the message to the Handler to contain the ArrayList of MyObjects.</p><p>When building the method in the Activity to get this ArrayList out of the message, I noticed that I couldn't.</p><p>If I tried</p><pre><code>msg.getData().getParcelableArrayList(""myObjects"")</code></pre><p>Then the method I was passing it to that expected an ArrayList wouldn't accept it.  If I tried casting the results:</p><pre><code>(ArrayList&lt;MyObject&gt;)msg.getData().getParcelableArrayList(""myObjects"")</code></pre><p>I received the error: <code>Cannot cast from ArrayList&lt;Parcelable&gt; to ArrayList&lt;MyObject&gt;</code></p><p>MyObject implements Parcelable and I have successfully sent an ArrayList from my service to my activity by having my activity call a method on the service to retrieve it.  I'm trying to go away from having my activity poll my service for this data, though.</p><p><strong>1)  How can I send an ArrayList inside the bundle in a message to handler?</strong></p><p><strong>2)  Is there a different model I should be using to have my service update the data in my Activity that may or may not be visible?  I always want the data in my activity to be the latest from the Service.</strong></p>","253412","","","","","2013-09-08 00:42:40","How to send an ArrayList of custom objects in a Bundle","<android><activity><arraylist><android-service><parcelable>","2","0","2","",""
"3730723","1","3731557","","2010-09-16 20:52:29","3","2432","<p>Trying to set ContextMenu title according to the ListView clicked item.The ListView contains Bookmarks list -> FAVICON + BOOKMARK TITLE</p><pre><code>@Override    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {      super.onCreateContextMenu(menu, v, menuInfo);      menu.add(0, EDIT_ID, 0, R.string.menu_edit);      menu.add(0, DELETE_ID, 0, R.string.menu_delete);      menu.add(0, SHARE_ID, 0, R.string.menu_share);      AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;      View itemID = (info.targetView);      menu.setHeaderTitle(""bla"" + itemID);    }</code></pre><p>When I run this code it shows the <code>android.widget.RelativeLayout@423d2389</code> or whatever and if I change the <code>itemID</code> to <code>String itemID = ((TextView) info.targetView).getText().toString();</code> I get force close on long click even though no errors are shown in Eclipse or when I run the app.</p><p>I also want to get the favicon in the same way...</p><p>Appreciate the help!</p>","444324","","1076164","","2012-05-24 16:41:24","2012-05-24 16:41:24","ContextMenu title -> get from clicked listView item","<android>","1","0","","",""
"3730760","1","3732027","","2010-09-16 20:58:02","0","1078","<p>I have an http request that worked as <a href=""http://blah.com"" rel=""nofollow"">http://blah.com</a> and now I have been asked to use <a href=""https://blah.com"" rel=""nofollow"">https://blah.com</a></p><p>The former works and the later fails with a Network I/O error.  Are there any missing parameter settings that I need for the client?</p><p>The URL request:</p><pre><code>D/MyAppWebservice(23142): http-transform :) [https://cdp.mobibob.com:8151/DoTransaction]</code></pre><p>Following is the log:</p><pre><code>E/MyAppContentProvider(23142): com.mobibob.myapp.MyAppExceptions$ParseException: Network or I/O error calling web service.W/System.err(23142): com.mobibob.myapp.MyAppExceptions$ParseException: Network or I/O error calling web service.W/System.err(23142):    at com.mobibob.myapp.MyAppWebservice.queryApi(MyAppWebservice.java:558)W/System.err(23142):    at com.mobibob.myapp.MyAppContentProvider.queryWebservice(MyAppContentProvider.java:751)W/System.err(23142):    at com.mobibob.myapp.MyAppContentProvider.query(MyAppContentProvider.java:440)W/System.err(23142):    at android.content.ContentProvider$Transport.query(ContentProvider.java:130)W/System.err(23142):    at android.content.ContentResolver.query(ContentResolver.java:202)W/System.err(23142):    at com.mobibob.myapp.ui.DownloadActivity.goGenDownloadTransaction(DownloadActivity.java:168)W/System.err(23142):    at com.mobibob.myapp.ui.DownloadActivity$DownloadTransaction.doInBackground(DownloadActivity.java:90)W/System.err(23142):    at com.mobibob.myapp.ui.DownloadActivity$DownloadTransaction.doInBackground(DownloadActivity.java:1)W/System.err(23142):    at android.os.AsyncTask$2.call(AsyncTask.java:185)W/System.err(23142):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)W/System.err(23142):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)W/System.err(23142):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)W/System.err(23142):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)W/System.err(23142):    at java.lang.Thread.run(Thread.java:1096)W/System.err(23142): Caused by: java.io.IOException: SSL handshake failure: I/O error during system call, Unknown error: 0W/System.err(23142):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method)W/System.err(23142):    at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:305)W/System.err(23142):    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)W/System.err(23142):    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:321)W/System.err(23142):    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:129)W/System.err(23142):    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)W/System.err(23142):    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)W/System.err(23142):    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)W/System.err(23142):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)W/System.err(23142):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)W/System.err(23142):    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)W/System.err(23142):    at com.mobibob.myapp.MyAppWebservice.queryApi(MyAppWebservice.java:510)W/System.err(23142):    ... 13 more</code></pre>","157804","","","","","2010-09-17 01:03:31","Https returns 404 with DefaultHttpClient on Android?","<android><ssl><https><http-status-code-404><httpclient>","1","0","","",""
"3731103","1","3731119","","2010-09-16 21:51:15","1","611","<p>I realize the Camera button on the Droid X is not a standard feature across all phones, so, I'm curious how to attach a callback to it.  I have a camera application that I wrote and I want the user to be able to snap the picture by pressing that button, but currently it doesn't work that way, so, I'm wondering how to attach my callback to it.</p><p>TIA.</p>","59947","","","","","2010-09-16 21:53:35","is there a way to detect the pysical button press on a Droid X?","<android>","1","0","","",""
"3731133","1","","","2010-09-16 21:55:28","5","10594","<p>I'm working on an Android program for my senior capstone project, and having trouble getting the correct environment configured.  I'm using a 64-bit windows machine with Eclipse 3.5 and JDK 1.6u21.  From what I've been able to gather, Eclipse 3.5 doesn't play well with update 21 on 64 bit architectures, and it's recommended to use JDK 1.6u20.  Problem is, I can't find update 20 anywhere.  Can anyone point me in the right direction?  Thanks.</p>","450045","","","","","2013-12-13 01:26:34","Where can I download JDK 1.6u20 64-bit?","<java><android><eclipse>","1","1","1","",""
"3731181","1","3731487","","2010-09-16 22:02:23","0","4787","<p>I'm trying to get a simple onClick to fire from an ImageButton - it seems like a simple enough task, but I'm obviously missing something here.</p><p>Here is my java file:</p><pre><code>package com.jlbeard.android.testapp;  import android.app.Activity;  import android.os.Bundle;  import android.view.View;  import android.view.View.OnClickListener;  import android.widget.ImageButton;  import android.widget.Toast;  public class testapp extends Activity {  /** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      //handle the button press    ImageButton mainButton = (ImageButton) findViewById(R.id.mainButton);    mainButton.setOnClickListener(new OnClickListener() {     @Override        public void onClick(View v) {      //show message      Toast.makeText(testapp.this, ""Button Pressed"", Toast.LENGTH_LONG);     }    });}}</code></pre><p>Here is my layout file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;  &lt;ImageView  android:id=""@+id/whereToEat""  android:src=""@drawable/where_to_eat""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_centerHorizontal=""true""  android:layout_marginTop=""8px""  /&gt; &lt;ImageButton  android:id=""@+id/mainButton""  android:src=""@drawable/main_button""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:layout_centerHorizontal=""true""  android:layout_centerVertical=""true""  android:background=""@null""  android:clickable=""true""  android:onClick=""mainButtonClick""  /&gt;&lt;/RelativeLayout&gt;</code></pre><p>It seems to me that I'm missing something simple... but can't seem to figure it out. Thanks!</p>","450050","","","","","2010-09-17 00:39:43","Basic ImageButton onClick event not firing - surely something simple?","<android>","2","0","","",""
"3731260","1","3731823","","2010-09-16 22:16:27","5","3819","<p>I have an Activity and Service that work together in my application.  I've configured the service as a remote service (implemented AIDL) so it will keep running even when the Activity isn't visible.</p><p>The service is responsible for polling a server for data and sending alert notifications when certain criteria are met.  I do not want the Service to send these notifications when the Activity is visible.</p><p><strong>Is there a way for the Service to know the status of any particular activity?  Particularly an activity that is bound to it?</strong></p><p>updated with manifest to troubleshoot permission problem:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.interact.listen.android.voicemail""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".MyAppName""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;        &lt;activity android:name="".MyObjectDetails""/&gt;        &lt;service android:enabled=""true"" android:name="".MyService"" /&gt;        &lt;receiver android:name="".MyReceiver""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""com.foo.bar.EVENT""/&gt;            &lt;/intent-filter&gt;        &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre><p>The error I'm getting in Logcat:</p><pre><code>09-17 15:33:17.881: WARN/ActivityManager(53): Permission Denial: receiving Intent { act=com.foo.bar.myobject.EVENT (has extras) } to ProcessRecord{43928b40 223:com.foo.bar.myobject/10022} (pid=223, uid=10022) requires com.foo.bar.myobject.EVENT due to sender com.foo.bar.myobject (uid 10022)09-17 15:33:48.901: WARN/ActivityManager(53): Permission Denial: receiving Intent { act=com.foo.bar.myobject.EVENT (has extras) } to com.foo.bar.myobject requires com.foo.bar.myobject.EVENT due to sender com.foo.bar.myobject (uid 10022)</code></pre><p>Task that sends the broadcast:</p><pre><code>@Overridepublic void onStart(Intent intent, int startId){    super.onStart(intent, startId);    serviceHandler = new Handler();    serviceHandler.postDelayed(myTask, 100L);    Log.d(TAG, ""onStart()"");}class Task implements Runnable{    public void run()    {        Log.i(TAG, ""Getting myObjects..."");        getMyObjects();        Bundle bundle = new Bundle();        bundle.putLongArray(""ids"", getIdsToUpdate());        Intent i = new Intent();        i.setAction(UPDATE_ACTION_STRING);        i.putExtras(bundle);        sendOrderedBroadcast(i, UPDATE_ACTION_STRING);        serviceHandler.postDelayed(this, 30000L);        }    }}</code></pre>","253412","","253412","","2010-09-17 16:24:31","2010-09-17 16:24:31","Suppress notifications from a service if activity is running","<android><activity><android-service>","1","0","1","",""
"3731419","1","","","2010-09-16 22:46:00","2","1780","<p>I have a public google spreadsheet with some data in tables.</p><p>I'm developing an android app which I want it to read these tables and then make a listview with the fields on the spreadsheet.</p><p>Which will be the best way to do that?</p><p>Thanks!</p>","450083","","","","","2013-08-05 06:12:27","How to read data from a Google spreadsheet for an android app","<html><android><table><spreadsheet>","2","1","","",""
"3731679","1","","","2010-09-16 23:40:56","0","2021","<p>Does anyone knows some convinient method to capture video to file or stream from OpenGL app on Android device? </p><p>For example, can we capture video from a view, opengl view? </p><p>I just found out the following:1) We can get frames using glReadPixels. (No video on this step?)2) MediaRecorder can encode video, but how can we provide it our raw source, if possible?3) Any working ports of ffmpeg(for example) or other encoding libraries? There are some tutorials of portng ffmpeg to use withing NDK. So, having raw frames and working port of ffmeg we can create video? Any issues on this step? Anyone managed to port any encoding library successfully? What components do I need from ffpmeg?</p><p>Preffered formats are mp4 or flv. Target devices > 2.1. NDK is no problem</p>","450110","","44729","","2010-09-16 23:48:51","2010-09-19 16:03:13","Android OpenGL video capture","<android><video><opengl-es><ffmpeg><android-ndk>","1","0","1","",""
"3731871","1","3732858","","2010-09-17 00:22:32","6","14152","<p>I am looking for the WinXP Pro SP 3 ADB driver for the HTC Incredible.  Does anyone have a link to it?</p>","371077","","371077","","2013-03-04 20:59:50","2013-03-04 20:59:50","ADB Driver for HTC Incredible","<android><driver><htc><adb>","3","2","3","2012-11-25 07:34:28",""
"3732095","1","5472441","","2010-09-17 01:25:48","5","1024","<p>Is there any Android browser reference/documentation for Web app developers? Something like Apple's <a href=""http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/Introduction/Introduction.html"" rel=""nofollow"">Safari Web Content Guide</a> would be fantastic.</p><p>I am exploring options to make Android Web app more native-like, so any suggestions would be appreciated.</p>","404033","","404033","","2010-09-18 06:09:22","2011-03-29 12:23:46","Is there any Android browser reference/documentation?","<android><web-applications><browser><mobile><webkit>","3","0","","",""
"3732147","1","3899778","","2010-09-17 01:42:35","0","3556","<p>How to read the device <strong>serial number</strong> (not IMEI) of a <strong>Samsung Android phone</strong> (same value that you get when you call 'adb devices') but from within an app or from the device; not using PC/USB/adb.</p><p>I found a solution for HTC and other devices, which is - to call </p><pre><code>getprop ro.serialno</code></pre><p>in a terminal</p><p>as described here, </p><p><a href=""http://groups.google.com/group/android-developers/browse_thread/thread/3d57b1a214cdf928"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/3d57b1a214cdf928</a></p><p>but it doesn't work on a Samsung Galaxy S.</p>","241475","","","","","2014-03-06 12:49:46","How to read serial number on a Samsung device (from within app / on the device)?","<android>","3","0","","",""
"3732207","1","","","2010-09-17 02:02:06","2","644","<p>I am pretty new to Android and very new to Multithreading.</p><p>I am writing an android application that contains multiple activities that implement onClickListners which sends a Bluetooth message on button click to . I have successfully been able to connect and keep my BluetoothSocket and OutputStream open while in one activity. I do not do any receiving and will always be connected as a client to a known MAC address. When the user wants to go into a submenu, which is also prompted by a button click, how do I keep my BluetoothSocket open?</p><p>I know I will need to have a thread running in the background managing the connection and I will use handlers/messages to exchange data between the BluetoothService thread and the currently active UI thread, but I am not sure what classes and methods I would use to start the BluetoothService thread by the application so that it will accessible by all activities.</p><p>Would it be something I start in the first activity of the program and have to implement it in a way that would prevent it from ending onPause() and onStop() and if so how would I start it and what classes would be recommended?</p><p>Or is it something I could define in the AndroidManifest.xml file so that it starts and runs at all times once the application is started. Run as a service and use messages/handlers to pass data?</p><p>These are just two ideas I had but I know I am probably way off.</p><p>Thanks,</p><p>Jonathan</p>","448067","","","","","2010-09-17 02:02:06","Android: Multithreading-Bluetooth SPP/RFCOMM-How to keep my BluetoothSocket and OutputStream active when changing Activities","<android><multithreading><service><bluetooth><handler>","0","0","","",""
"3732215","1","3732579","","2010-09-17 02:03:30","0","1147","<p>In an Android app I developed, I open a cursor to a query with a fairly large result set (~1k rows) and I keep it open indefinitely. Is this an ok practice? If not, should I close the cursor in the onClose() handler and then re-open it in the onStart() handler?</p><p>The app seems to run fine, however it sometimes randomly crashes after having been idle for a long period of time and I think it might be related to the cursor.</p>","80617","","","","","2010-09-17 03:57:57","Keeping Open a Sqlite Cursor","<android><sqlite><cursor>","1","0","","",""
"3732250","1","3732662","","2010-09-17 02:14:25","2","2170","<p>Im starting to develop for android and i would like to test my aplication in my Dell Streak, its running 1.6 and my OS is Windows 7. </p><p>According to this link <a href=""http://developer.android.com/guide/developing/eclipse-adt.html"" rel=""nofollow"">http://developer.android.com/guide/developing/eclipse-adt.html</a> all that i need to do to deploy on my device is:</p><ul><li>Declare your application asdebuggable in your manifest: i readyhave added that to may application <code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;</code></li><li>Enable USB Debugging on your device:i already activated in application >development > USB debbuging</li><li>Ensure that your development computercan detect your device when connectedvia USB: I already install the driveto de point that i get ""The bestdriver software for the device isalready installed"" and i can see my device conected in windows explorer</li></ul><p>But i dont get have any ADB Interface in computer > device manager, i have it under Portable Devices. Beside that i have everything correct, but Eclipse Device Chooser has no Android device listed.</p><p>What can i do to have my Streak listed</p>","281682","","404469","","2010-09-17 02:24:57","2012-10-16 20:27:59","Eclipse Device Chooser cant find my Dell Streak","<android><eclipse><driver><device><adb>","1","0","","",""
"3732314","1","3732349","","2010-09-17 02:30:55","2","6931","<p>I want to develop an android application without having to purchase an android phone,</p><p>1) Is there an android emulator on the mac? the same as on windows?</p><p>2) is it better to develop on an android app on a pc, or a mac? same?</p>","103264","","28422","","2010-09-17 02:44:54","2012-11-12 16:59:24","Is there an Android Emulator on OS X?","<android><osx><apple><android-emulator>","2","0","","",""
"3732430","1","","","2010-09-17 03:11:18","0","4943","<p>there are 2 activity  A and Screen in A Activity , i made handler and want to pass it to screen activity</p><pre><code>Handler error_handler = new Handler() {public void handleMessage(Message msg) {}};Intent loginButton_intent = new Intent(A.this, Screen.class);loginButton_intent.putExtra(""URL"", URL);loginButton_intent.putExtra(""IP_Addres"", dvr_login_data.IP_Addres);loginButton_intent.(""HAND"", error_handler); &lt;- but this code is error </code></pre><p>how can i pass handler ?plz warm-answer</p>","390365","","390989","","2010-09-17 03:37:46","2013-10-30 21:33:34","how to pass handler using intent","<android><android-intent>","3","4","1","",""
"3732445","1","3732493","","2010-09-17 03:14:26","0","454","<p>i have upload some apps in android market.now i want to  show or redirect users to my other apps.they can easily see and download other apps.please how to open other apps or how to redirect my app in application</p><p>if any sample code that is good for me</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","","","","2012-04-06 09:31:06","open android market","<android>","1","0","","",""
"3732487","1","3732795","","2010-09-17 03:26:29","1","212","<p>I am a new to developing for Android and have been reading up and researching in order to become more familiar with the platform.  My programming knowledge is moderate I have experience with C++ and a fairly proficient with Actionscript 3.0. I picked up programming primary to work on game development but come from a more artistic/design background. </p><p>I have a relatively simple idea for an app that I want to approach from the most practical way possible seeing how it’s my first attempt.  Essentially the core functionality of the app will be drawing information I will be getting from an ephemeris chart.  At a certain time in the day which is based on the data from the chart I want to change an image/display information based on that day. I am trying to wrap my head around the best possible way to do this.  Also I would like to give the user an option of having a notification of some kind when the change occurs, but that is something I have come across in terms of basic implementation.  </p><p>So my question is if you were to approach setting something like this up how would you?  What I am not sure about is setting up a time element so the application knows when to change the image/data to display.If you took the time to even read this I really appreciate it.Wade.</p>","450197","","","","","2010-09-19 15:25:18","New Android developer seeking guidance for structuring app","<android>","1","0","","",""
"3732529","1","","","2010-09-17 03:40:11","2","2810","<p>New to Android and just looked at <a href=""http://developer.android.com/reference/android/util/Log.html"" rel=""nofollow"">http://developer.android.com/reference/android/util/Log.html</a></p><p>My question is regarding everything except debug. How do these Log entries get cleared such as Error so that they don't consume space? Also, Is there a way that the logfile can be queried so that it can be sent to a central web service or something for quality purposes etc.?</p>","437534","","73488","","2010-09-17 03:53:44","2010-09-17 05:11:00","Android Logging - How to clear for better performance","<android><logging>","1","0","","",""
"3732586","1","","","2010-09-17 04:02:21","0","877","<p>I am downloading an array of photos from the net and showing a ProgressDialog with a loading circle. But the loading circle will be lag / hang while the process is not finish. How to make the loading running smoothly?</p><p>Thanks.</p>","446965","","","","","2010-09-17 06:00:35","How to make ProgressDialog non-stop loading circle when I am loading a list of photos?","<android><multithreading><download><progressdialog>","1","0","","",""
"3732607","1","4565258","","2010-09-17 04:10:26","6","2396","<p>I am looking for a way to add more advanced blend modes to my program (ones that I could define myself). How would you suggest going about this with Android? </p><p>Setting pixels individually is too slow to be a viable solution.</p>","118241","","","","","2010-12-30 18:37:48","Android Blend Modes","<java><android><colors><blend>","3","4","3","",""
"3732739","1","4403121","","2010-09-17 04:53:06","7","2634","<p>Is it possible to change the default arrangement of the Android Gallery?What i meant is can we make the Gallery in a curved path, where the images will be along the curved path and the same time it has all the properties of the Android gallery?</p><p>If possible, please tell me your ideas. All ideas are welcome.</p><p>Thanks &amp; Regards,Sen</p>","449378","","","","","2012-05-11 12:03:56","Possibility of a Curved Gallery","<android>","2","1","9","",""
"3732748","1","","","2010-09-17 04:55:22","7","924","<p>We are building a mobile app, specifically an android app, and it needs to connect to the server to get data. It is not like twitter, we do not need to expose some kind of public apis. We just need to keep it simple and safe because user will exchange some private data with the server.</p><p>My questions is mainly on authentication. Our server will have a user database.</p><ol><li>How to register and login in my mobile app ? What kind of mechanism should be implemented in the server side and the client side.</li><li>How to keep the session after login?</li><li>If I need to let user could login without input his username/password next time when he open the app, What should I do? I just think to store his password in the mobile client is not a good idea.</li></ol>","238061","","238061","","2010-09-17 11:47:29","2010-09-17 11:47:29","How to design a web api for mobile app usage?","<iphone><android><authentication>","2","0","5","",""
"3732790","1","3732820","","2010-09-17 05:10:02","51","80734","<p>i have  a string called CurrentString and is in the form of something like this""Fruit: they taste good"". i would like to split up the CurrentString using the : as the delimiter.so that way the word ""Fruit"" will be split into its own string and ""they taste good"" will be another string.and then i would simply like to use SetText and 2 different textviews to display that string. </p><p>what would be the best way to approach this? </p>","326423","","65977","","2010-09-17 05:23:28","2013-12-26 23:54:28","Android Split string","<java><android><string>","4","3","14","",""
"3732853","1","3753129","","2010-09-17 05:31:08","2","963","<p>I am a beginner to android. I am building an application  to work with QR code.i downloaded the source code for zxing1.5 from the link <a href=""http://code.google.com/p/zxing/downloads/list"" rel=""nofollow"">http://code.google.com/p/zxing/downloads/list</a>. When i try to load  application with different devices i found that the framing rectangle to be in various sizes in different place,unfit to the device. please can anyone help me with this!!! Suggestion on this is appreciable. I am in real help, can anyone help me out sooner..</p>","431655","","","","","2010-09-20 15:48:17","unique size of the framing rectangle in zxing QR code scanner","<android><zxing>","1","0","0","",""
"3732876","1","","","2010-09-17 05:37:51","2","14009","<p>I am adding two views to a linearlayout. When I click on the first view it has to occupy second views width also. How do I do that?</p>","446010","","50846","","2010-09-17 05:45:03","2013-01-22 19:01:16","How to resize view width and height dynamically?","<android>","2","0","","",""
"3732935","1","5152452","","2010-09-17 05:53:37","9","4974","<p>There's an Android Application called <code>Smart Taskbar</code> that manages to Pin a small SemiTransparent Icon over the screen...The icon remains visible over <strong>ALL</strong> the activites (including the home screen). The Icon is Clickable (/Touchable), and it does popopen a Small Popup window which the user can interact with.</p><p>I'm very interested in how this is done? I think it's something to with <code>PopupWindow</code>.</p><p>Any ideas? Thanks in Advance.</p>","216517","","","","","2013-04-15 23:00:54","Android : Floating Clickable Icon over Screen?","<android><taskbar>","1","3","8","",""
"3732938","1","3740958","","2010-09-17 05:54:17","0","941","<p>I have the data in the android(Sqlite Database).How to transfer this database data's to the System Database( like Access or SQL Server).After Transfer this data's i have to use the data in the System.I am new to android. Can anyone help me.</p><p>Note:If the android device have the Database db1.I wish to use the db1 data in the Desktop Application . </p>","423037","","423037","","2010-09-19 13:33:19","2011-07-15 07:11:02","how to get data's from sqlite in Android?","<android><sqlite>","2","0","","",""
"3733142","1","","","2010-09-17 06:34:53","6","369","<p><a href=""http://bid.berkeley.edu/cs160-fall10/index.php/Tips_and_Tricks"" rel=""nofollow"">Apparently</a>, eclipse 3.6 doesn't work well with the android sdk, but I'd like to use eclim which requires this version of eclipse. Does anyone have any recent experience developing for android with eclipse 3.6? Recommendations for someone who wants to use vim for android development? I'd appreciate any help.</p>","224428","","224428","","2010-09-17 07:13:29","2011-04-16 19:31:41","What version of eclipse is safe for development for android?","<android><eclipse><vim><eclipse-plugin><eclim>","4","0","","",""
"3733192","1","3733416","","2010-09-17 06:44:41","1","754","<p>I have an input stream which is being converted to XML, and read.  When I get down to some text elements in the XML, they are truncated. I believe the parser is dropping everything after escaped HTML such as &amp;  Here is the code getting the input stream and then getting the text element.</p><pre><code>String hvurl = ""https://www.mysite.com/api/a/"" + answerId;in = OpenHttpConnection(hvurl); Document doc = null;DocumentBuilderFactory dbf =     DocumentBuilderFactory.newInstance();DocumentBuilder db;try {    db = dbf.newDocumentBuilder();    doc = db.parse(in);} catch (ParserConfigurationException e) {    // TODO Auto-generated catch block    e.printStackTrace();} catch (SAXException e) {    // TODO Auto-generated catch block    e.printStackTrace();}     ...//Now when I get the text element, it's truncated//---get the &lt;varietalTitle&gt; elements under the &lt;varietal&gt; // element---NodeList varietalTitleNodes =     (varietalElement).getElementsByTagName(""varietaltitle"");//---convert a Node into an Element---Element varietalTitleElement = (Element) varietalTitleNodes.item(0);//---get all the child nodes under the &lt;varietaltitle&gt; element---NodeList varietalTitleTextNodes =     ((Node) varietalTitleElement).getChildNodes();//---retrieve the text of the &lt;varietalid&gt; element---strVarietalTitle = ((Node) varietalTitleTextNodes.item(0)).getNodeValue();</code></pre>","450317","","342852","","2010-09-17 08:25:44","2010-09-17 08:25:44","How do I replace HTML escapes in an input stream before parsing it to XML?","<java><android>","2","3","","",""
"3733298","1","3733322","","2010-09-17 07:06:28","2","3199","<p>is there off screen drawing possible in android like a imageContext in objective C. if it is kindly tell me the link or some kind of hint.</p><p>thanks a lot.</p>","397901","","","","","2011-07-07 16:56:46","off screen drawing in android","<android><image><graphics>","3","0","","",""
"3733311","1","","","2010-09-17 07:08:37","1","730","<p>In my application I have to fetch the current location. First it correctly fetches the location. But we are moving from the current location to some other location.  It shows the previous address. It is not updating the location. My code is:</p><pre><code>locManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); locListener = new MyLocationListener();  locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,locListener);location = locManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);if(location != null)                                {    latitude = location.getLatitude();longitude = location.getLongitude();}  //My location listener is as followspublic void onLocationChanged(Location loc) {    if (loc != null) {        //Toast.makeText(this.getBaseContext(),         //""Location changed : Lat: "" + loc.getLatitude() +         //"" Lng: "" + loc.getLongitude(),         //Toast.LENGTH_LONG).show();        double lat = loc.getLatitude();        double lon = loc.getLongitude();    }}public void onProviderDisabled(String provider) {    // TODO Auto-generated method stub}public void onProviderEnabled(String provider) {    // TODO Auto-generated method stub}public void onStatusChanged(String provider, int status,     Bundle extras) {    // TODO Auto-generated method stub}</code></pre><p>Please find the mistake and when i launch first time it is not working on second time itself it is working....so check this thing also.....</p>","429152","","429152","","2010-09-17 11:54:18","2010-09-17 11:54:18","Location manager does not detect location correctly even we are moving miles away in android","<android>","1","0","0","",""
"3733370","1","3733426","","2010-09-17 07:22:22","4","1798","<p>I can create an Option Menu for a single Activity. But now I want to create a Logout option in the menu which should be available on all Activities in the App. Is there a possible way to create an Option menu once for an Application?</p>","267269","","213269","","2010-11-16 22:13:42","2010-11-16 22:13:42","OptionMenu for whole App in Android?","<android><options-menu>","1","0","2","",""
"3733382","1","3733957","","2010-09-17 07:24:16","1","3689","<p>friends,</p><p>i want to set layout_marginBottom using java code or dynamically </p><p>in list view or linearlayout</p><p>any one guide me how to achieve this?</p><p>any help would be appreciated.</p>","249991","","","","","2013-05-20 02:19:49","how to set marginBottom in android listview or linearlayout Dynamically?","<android><layout>","2","0","1","",""
"3733407","1","","","2010-09-17 07:26:40","0","188","<p>I am working on the Parsing of the response from a web Service: ""http://www.google.com/ig/api?weather=Ahmedabad""</p><p>Now I am going parallel with an parsing example available on the Internet, This is my Response :</p><pre><code>&lt;?xml version=""1.0"" ?&gt; - &lt;xml_api_reply version=""1""&gt; - &lt;current_conditions&gt;  &lt;condition data=""Haze"" /&gt;   &lt;temp_f data=""84"" /&gt;   &lt;temp_c data=""29"" /&gt;   &lt;humidity data=""Humidity: 74%"" /&gt;   &lt;icon data=""/ig/images/weather/haze.gif"" /&gt;   &lt;wind_condition data=""Wind: NW at 13 mph"" /&gt; - &lt;/current_conditions&gt; </code></pre><p>Can anybody help me out how create objects of the Outer tags if necessary?</p><p>Sorry if I am asking a stupid Question.Thanks,david</p>","422859","","225667","","2010-09-17 08:32:30","2011-03-23 14:24:39","Parsing of this string","<android><xml><xml-parsing>","2","1","","",""
"3733455","1","3736326","","2010-09-17 07:34:00","1","439","<p>I am making a alarm app and was just wondering how do I show a alarm icon at the right side of the statusbar like the original alarm app? normal notifications appear in the left side and I cant find anything about this....</p>","450351","","","","","2010-09-17 14:41:22","android: alarm statusicon like the original alarm app?","<android>","2","0","1","",""
"3733471","1","3733567","","2010-09-17 07:37:11","10","5646","<p>In Draw 9-patch, everything looks fine. <strong>However</strong>, my SDK says the 9-patch png is malformed. Because I have something like an 11-patch png. Because I don't want the little grabbing area to be scaled. How to get it working? The screenshot describes everything:</p><p><img src=""http://i.stack.imgur.com/0kIFO.png"" alt=""alt text""></p><p>Error Meassage in Console:</p><pre><code>ERROR: 9-patch image /res/drawable-hdpi/top_complete.9.png malformed.        Can't have more than one marked region along edge.        Found at pixel #10 along bottom edge.ERROR: Failure processing PNG image /res/drawable-hdpi/top_complete.9.png</code></pre>","433718","","433718","","2010-09-17 11:51:32","2012-07-28 16:09:47","Android / 9-patch PNG: What, if I need smth like a 11-patch PNG?","<android><android-layout><nine-patch>","6","0","3","",""
"3733655","1","4422855","","2010-09-17 08:14:56","0","521","<p>I want my application to run all time. It should execute a function when phone is in sleep mode and stop the execution when it is asleep. Can anyone post a sample code? </p><p>Thanks in advance.</p>","655814","","1267021","","2012-09-11 23:59:45","2012-09-11 23:59:45","How to find if a phone is in sleep mode or not???","<android><sleep><wakelock><android-wake-lock>","1","3","","",""
"3733767","1","4230032","","2010-09-17 08:30:27","0","1033","<p>I've got a question related to the Android MediaPlayer. Can it stream content through HTTP POST method , or do I have to write my own implementation? If so, what SDK do I have to use?</p><p>Thanks in advance.</p>","285680","","","","","2010-11-19 22:42:25","Android MediaPlayer streaming MP3 over POST","<android><http><post><media-player><audio-streaming>","1","0","","",""
"3733834","1","3896885","","2010-09-17 08:42:13","1","4319","<p>has any body worked with  UPnP Library for Java By Cybergarage..</p><p><a href=""https://cgupnpjava.svn.sourceforge.net/svnroot/cgupnpjava/trunk/cyberlink/upnp-stack/src/main/java/org/"" rel=""nofollow"">https://cgupnpjava.svn.sourceforge.net/svnroot/cgupnpjava/trunk/cyberlink/upnp-stack/src/main/java/org/</a></p><p>I am making android application to find the list of UPnP device from my device...</p><p>any help on these most appreciable../</p><p>thanks rakesh</p>","1386533","","","","","2012-04-27 00:10:34","UPnP device library: android","<android><upnp>","1","0","3","",""
"3733858","1","3733944","","2010-09-17 08:45:46","3","30774","<p>I have two onclick method in android project</p><pre><code>    clr=(Button)findViewById(R.id.Button01);    clr.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            tv1.setText(""CLR"");            et1.setText("""");            refrigerant = """";            pres = """";            temperature = """";            superheat_oda = 0;            sub_cool = 0;}    });</code></pre><p>And i have onther onClick method in which i have to call that method directly </p><pre><code>    prs=(Button)findViewById(R.id.Button02);    prs.setOnClickListener(new OnClickListener() {                     -----      I have to call that method---                                                 }    });</code></pre><p>Is there Any Solution for this?</p>","441224","","180538","","2010-09-17 10:06:27","2012-04-03 08:17:55","Android onClick method","<android><button><onclick>","3","1","2","",""
"3733867","1","3734070","","2010-09-17 08:46:52","4","10546","<p>I want to develop a simple stop watch logic in android. </p><p>On clicking a list view the timer should start and on clicking the button the timer should stop. Can anyone please guide me. Any sample code will be of great help</p>","303155","","","","","2014-03-12 16:22:28","stop watch logic","<android>","3","0","5","",""
"3733872","1","","","2010-09-17 08:47:38","1","860","<p>I'm new to Java and Android. I have a piece of code that is used for multiple activities so I moved it into its own library .java file. However, now my findViewById return null where they used to return the right stuff when they were part of the main Activity file with onCreate() and setContentView() calls. How do I make it work inside my library?</p><p>Call from the Activity class:</p><p>helper.popupControl(getListView(), getBaseContext(), ""on"");</p><p>The code in the libruary:</p><pre><code>public class Helper extends ListActivity {public void popupControl (View v, Context context, String on_off) {    Animation aFilm = AnimationUtils.loadAnimation(context, R.anim.fade_in);      aFilm.reset();    View vFilm = (View) v.findViewById(R.id.gray_out_film);    if(vFilm==null) {         Toast maxToast = Toast.makeText(context, ""View is null! ""+R.id.gray_out_film+"", View:""+v.toString(), Toast.LENGTH_LONG);        maxToast.setGravity(Gravity.CENTER, 0, 0);        maxToast.show();     } else {        Toast maxToast = Toast.makeText(context, ""View is not null!"", Toast.LENGTH_SHORT);        maxToast.setGravity(Gravity.CENTER, 0, 0);        maxToast.show();    }}}</code></pre>","450407","","39709","","2011-08-07 15:42:04","2012-07-03 01:29:10","findViewById returns null when moved into a library file","<android><layout>","3","0","1","",""
"3733878","1","","","2010-09-17 08:48:09","0","374","<p>This is what we can read in the Service reference page <a href=""http://developer.android.com/reference/android/app/Service.html"" rel=""nofollow"">here</a>:</p><blockquote>If you need your application to run on platform versions prior to API level 5, you can use the following model to handle the older onStart(Intent, int)  callback in that case. The handleCommand method is implemented by you as appropriate: <pre><code>// This is the old onStart method that will be called on the pre-2.0// platform.  On 2.0 or later we override onStartCommand() so this// method will not be called.@Overridepublic void onStart(Intent intent, int startId) {    handleCommand(intent);}@Overridepublic int onStartCommand(Intent intent, int flags, int startId) {    handleCommand(intent);    // We want this service to continue running until it is explicitly    // stopped, so return sticky.    return START_STICKY;}</code></pre></blockquote><p>This works perfectly for my 2.1 AVD.</p><p>But how can I test this in my 1.5 AVD as it gives me logical compilation errors.</p>","450411","","","","","2010-09-17 18:49:13","How to test on 1.5 AVD with onstartcommand","<android>","1","0","","",""
"3733988","1","3734224","","2010-09-17 09:07:35","4","17999","<p>I want to develop an application that will take screenshot of android screen..does any one know how to do it..? which is similar to koushik duttas screen shot..But with out using root..and does any one had koushik dutta screenshot application which is working..? is not working for me..please let me know..thanks in advance.</p>","399046","","180538","","2010-09-17 10:09:29","2014-04-11 11:34:25","Screen Capture in android","<android><screenshot>","4","0","3","",""
"3734046","1","","","2010-09-17 09:18:26","0","1900","<p>I'd like to call a JavaScript function out of Java (Android).</p><p>Well, the following source code works fine for me (<a href=""http://whyandroid.com/android/206-using-webviews.html"" rel=""nofollow"">source</a>)</p><pre><code> /**  * This is not called on the UI thread. Post a runnable to invoke  * loadUrl on the UI thread.  */  public void clickOnAndroid() {    mHandler.post(new Runnable() {      public void run() {        mWebView.loadUrl(""javascript:wave()"");      }    });  }</code></pre><p>My Problem now is to use a parameter for the JavaScript function.</p><p>Let's assume I've got some XML (just like AJAX somehow).</p><p>I need to escape it just like the iPhone / Objective-C command stringByEvaluatingJavaScriptFromString does.</p><p>Who can help me on this?</p><p>Thanks a lot,DaRolla</p>","450433","","589131","","2013-02-11 19:35:25","2013-02-11 19:35:25","android, webview, javascript injection","<javascript><android><webview><injection>","1","1","1","",""
"3734099","1","","","2010-09-17 09:27:12","0","5041","<p>how can i put my PopupWindow to system desk or other app?how can i use this permission:INTERNAL_SYSTEM_WINDOW<br>Any examples?Thanks!</p>","443407","","","","","2011-08-10 12:16:31","how can i put my PopupWindow to system desk or other app?","<android>","2","2","7","",""
"3734166","1","","","2010-09-17 09:36:35","5","1429","<p>Is there a way to programmatically protect the folder with password in Android ?</p>","379779","","180538","","2010-09-17 10:08:57","2011-11-07 06:32:57","Is there a way to protect the folder with password?","<java><android><password-protection>","2","0","","",""
"3734197","1","3734804","","2010-09-17 09:41:05","4","1254","<p>I'm developing an android application where i want to add the volume control in Status Bar. Can i add a seek bar inside the Status Bar. </p><p>I have worked with <code>NotificationManager</code> and i've found that adding animation is difficult in Notification bar.</p><p>But can anyone please suggest if i can add a seek bar in my Status Bar(Notification bar).      </p>","396437","","119895","","2010-09-17 11:11:30","2010-09-17 11:15:28","Android Seek Bar in Status Bar","<android><notificationmanager>","1","0","","",""
"3734242","1","3734910","","2010-09-17 09:47:17","5","6983","<p>Probably it's not a really complicated question, but first of all, I have no idea, what search query should I search for?!</p><p>At the beginning of my application I would like to start GPS and if my application will be enden GPS should be closed.</p><p>How can I check, if the whole Application (not an Activity) is finished?</p><p>Is it enough to use onDestroy-Method for Start-Activity, which will never closed with finish()?</p><p>Thank you very much and sorry for a beginner's question.</p><p>Mur</p><p><strong>UPD</strong></p><p>I saw the first answer and I'd like to say once. </p><p>I don't mean an ACTIVITY, I mean really the whole APPLICATION (in which many activities exist). </p><p>How to check if all application's activities were finished and only in that case stop the service? </p><p>Is there posibility for that?</p><p><strong>UPD2:</strong></p><p>I've tested my solution on a device:</p><p><strong>""Is it enough to use onDestroy-Method for Start-Activity, which will never closed with finish()?""</strong></p><p>Yes, it was enough.</p>","408780","","408780","","2010-09-17 13:58:33","2012-11-20 19:24:19","Android application lifecycle?","<android><lifecycle>","2","0","1","",""
"3734290","1","3734350","","2010-09-17 09:52:54","2","1008","<p>i use the following code to listener my listview onItemClick Events. no compile error occurred ,</p><p>and nothing happened when i clicked any list item , i don't why  Orz</p><p>could someone tell me why @@?</p><pre><code>mp3_listView.setOnItemClickListener(new OnItemClickListener()         {             @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2 , long arg3) {                 Toast.makeText(tabDigTest.this , arg2+"" "", Toast.LENGTH_SHORT);            }        });</code></pre>","422405","","180538","","2010-09-17 10:07:44","2010-09-17 10:07:44","android listview onItemClickListener failed","<android><listview><clicklistener>","1","0","","",""
"3734296","1","3734370","","2010-09-17 09:54:10","1","463","<p>My code for the Layout is given below. I am not able see the full content, nor am I able to scroll. How can I show the entire contents by scrolling?</p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:paddingTop=""10px"" android:background=""@color/bg_color"" &gt;  &lt;TextView android:paddingLeft=""20px"" android:text=""hhhhhhhhhhhhhhhhh"" android:id=""@+id/eventname"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""center_horizontal"" android:textColor=""@color/black"" android:textStyle=""bold"" android:textSize=""15px""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:paddingLeft=""50px"" android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:background=""@color/bg_color"" android:layout_gravity=""center_horizontal""&gt;&lt;ImageView android:id=""@+id/ImageView01"" android:scaleType=""fitCenter"" android:layout_width=""100dip"" android:layout_height=""120dip"" &gt;&lt;/ImageView&gt;&lt;ImageView android:id=""@+id/ImageView02"" android:scaleType=""fitCenter"" android:layout_width=""100dip"" android:layout_height=""120dip"" &gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:orientation=""vertical"" android:background=""@color/bg_color""&gt;  &lt;TextView android:paddingLeft=""20px"" android:text="""" android:id=""@+id/maindet"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;  &lt;TextView android:textStyle=""bold"" android:paddingLeft=""20px"" android:text=""Muzieikstijlen"" android:id=""@+id/stylet"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;  &lt;TextView android:paddingLeft=""20px"" android:text="""" android:id=""@+id/styletype"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;  &lt;TextView android:textStyle=""bold"" android:paddingLeft=""20px"" android:text=""Prinjzen"" android:id=""@+id/prijzen"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;  &lt;TextView android:paddingLeft=""20px"" android:text="""" android:id=""@+id/voor"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;  &lt;TextView android:textStyle=""bold"" android:paddingLeft=""20px"" android:text=""Line-up"" android:id=""@+id/lineup"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;  &lt;TextView android:paddingLeft=""20px"" android:text="""" android:id=""@+id/djlist"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;  &lt;TextView android:textStyle=""bold"" android:paddingLeft=""20px"" android:text=""Minimumleeftijd"" android:id=""@+id/min"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;  &lt;TextView android:paddingLeft=""20px"" android:text="""" android:id=""@+id/minage"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_gravity=""left"" android:textColor=""@color/black"" android:textSize=""12px""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;Button android:id=""@+id/back"" android:layout_height=""40px"" android:layout_width=""150px"" android:layout_gravity=""center"" android:background=""@color/btnback"" android:text=""Back"" android:textSize=""20px"" android:textColor=""@color/bg_color""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>Screen shot of the phone:</p><p>Thank you.</p><p><img src=""http://i.stack.imgur.com/jHHUD.png"" alt=""alt text""></p>","436765","","1542891","","2014-02-28 13:38:45","2014-02-28 13:38:45","How do I add scrolling to an Android layout?","<android><scrolling><scrollview>","1","0","","",""
"3734375","1","3734462","","2010-09-17 10:06:22","0","539","<p>I'm Trying to start the saveBookmark activity and I get Force Close for some unknown reason.It says it's NULL but it's supposed to be null as ""title"" and ""url"" are optional (also, I've tried replacing null with string data and I get the same Force Close).</p><p>Here is the button listener:</p><pre><code>Button addBookBtn = (Button) findViewById(R.id.add_bookmark);        addBookBtn.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                saveBookmark(context, null, null);            }        });</code></pre><p>Here is the saveBookmark method:</p><pre><code>public static final void saveBookmark(Context c, String title, String url) {        Intent i = new Intent(Intent.ACTION_INSERT, android.provider.Browser.BOOKMARKS_URI);        i.putExtra(""title"", title);        i.putExtra(""url"", url);        c.startActivity(i);    }</code></pre><p>This is the FATAL Error I get when I click the Add button:</p><pre><code>E/AndroidRuntime(17252): FATAL EXCEPTION: mainE/AndroidRuntime(17252): java.lang.NullPointerExceptionE/AndroidRuntime(17252):        at com.droidil.droidmarks.Dmarks.saveBookmark(Dmarks.java:81)E/AndroidRuntime(17252):        at com.droidil.droidmarks.Dmarks$2.onClick(Dmarks.java:71)E/AndroidRuntime(17252):        at android.view.View.performClick(View.java:2408)E/AndroidRuntime(17252):        at android.view.View$PerformClick.run(View.java:8818)E/AndroidRuntime(17252):        at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime(17252):        at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime(17252):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(17252):        at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(17252):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(17252):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(17252):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(17252):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(17252):        at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Appreciate the help!</p>","444324","","","","","2010-09-17 13:15:14","Android: saveBookmark activity","<android>","3","0","","",""
"3734409","1","3734624","","2010-09-17 10:11:22","0","558","<p>I'm trying to create an app and I'm nearly complete. I have been trying to figure out how to either put the phone into sleep mode, which would also lock the screen or just lock the screen.</p><p>This is how I am currently trying to accomplish this using the PowerManager.</p><pre><code>try{            PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);            PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, ""FACEDOWN_LOCK"");            wl.acquire();                // ? Perform operations                pm.goToSleep(SystemClock.uptimeMillis());            wl.release();        }catch(Exception e){             Toast.makeText(this, e.getMessage() , 10000).show();        }</code></pre><p>This does NOT work. It gives me permission problems even though my app is signed and I have the permissions enabled in the manifest.xml</p><pre><code>&lt;permission android:name=""android.permission.WAKE_LOCK"" /&gt;    &lt;permission android:name=""android.permission.DEVICE_POWER"" /&gt;    &lt;uses-permission android:name=""android.permission.WAKE_LOCK"" /&gt;     &lt;uses-permission android:name=""android.permission.DEVICE_POWER"" /&gt;</code></pre><p>Is there a proper way to do this? Can it even be done? Any help would be awesome. I have not been able to find any solution as to how you get the phone to lock or go to sleep.</p>","424413","","302328","","2010-09-17 10:41:46","2010-09-17 10:41:46","How do I lock the screen?","<android>","1","0","1","",""
"3734590","1","","","2010-09-17 10:34:19","2","1345","<p>I have a custom drawable object in one side, object1.xml:</p><pre><code>&lt;drawable ... /&gt;</code></pre><p>I have another custom shape object in the other side, object2.xml:</p><pre><code>&lt;shape ...&gt;&lt;gradient .../&gt;&lt;/shape&gt;</code></pre><p>In every activity, I want to have these two object as the Activity's background, so what I currently do is:</p><pre><code>&lt;LinearLayout android:background=""@drawable/object1"" ...&gt;&lt;ImageView  android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:background=""@drawable/object2"" .../&gt;...&lt;LinearLayout/&gt;</code></pre><p>What I want to do is to remove this piece of code from every Activity and create a custom Theme for the whole application, that includes this composed background.</p><p>What I have achieved is to create the Theme with the object1 as background, but no way to get the second object.</p><pre><code>&lt;resources&gt; &lt;style name=""CustomDialogTheme"" parent=""@android:style/Theme.NoTitleBar""&gt;  &lt;item name=""android:windowFullscreen""&gt;true&lt;/item&gt;  &lt;item name=""android:windowBackground""&gt;@drawable/object1&lt;/item&gt; &lt;/style&gt;&lt;/resources&gt;</code></pre><p>I've tried to use a <code>&lt;list-item&gt;</code> but the object2 is simply not displayed.</p>","245638","","244296","","2010-09-17 11:55:00","2010-09-17 11:55:00","Two background images as a android:windowBackground theme","<android><background><themes>","0","2","1","",""
"3734699","1","","","2010-09-17 10:54:51","0","2053","<p>I have fallen in a problem about process died in android.</p><p>I have an app having a progress dialog which increase progressing using thread.</p><p>As usual mode the app acts well. But at the progress dialog running state when i press the home key the process of the app goes too died.</p><p>The logCat is given below:</p><pre><code>09-20 19:00:25.109: DEBUG/KeyguardViewMediator(111): wakeWhenReadyLocked(82)09-20 19:00:25.117: DEBUG/KeyguardViewMediator(111): handleWakeWhenReady(82)09-20 19:00:25.117: DEBUG/KeyguardViewMediator(111): pokeWakelock(5000)09-20 19:00:25.117: INFO/power(111): *** set_screen_state 109-20 19:00:25.127: DEBUG/Sensors(111): sensors=00000001, real=0000000109-20 19:00:25.127: DEBUG/AKMD(100): Compass OPEN 09-20 19:00:25.227: DEBUG/WifiService(111): ACTION_SCREEN_ON09-20 19:00:25.237: DEBUG/SurfaceFlinger(111): Screen about to return, flinger = 0x11f0e009-20 19:00:27.047: DEBUG/KeyguardViewMediator(111): pokeWakelock(5000)09-20 19:00:27.187: DEBUG/KeyguardViewMediator(111): pokeWakelock(5000)09-20 19:00:27.217: DEBUG/ViewFlipper(184): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false09-20 19:00:27.277: WARN/InputManagerService(111): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43cc888009-20 19:00:31.387: INFO/NotificationService(111): enqueueToast pkg=com.android.shredder callback=android.app.ITransientNotification$Stub$Proxy@43df7a30 duration=009-20 19:00:32.817: DEBUG/ViewFlipper(184): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false09-20 19:00:32.897: DEBUG/ViewFlipper(184): updateRunning() mVisible=true, mStarted=true, mUserPresent=true, mRunning=true09-20 19:00:33.547: ERROR/ActivityThread(2053): Activity com.android.shredder.ui.ShredUI has leaked ServiceConnection com.android.shredder.domain.ShreddingEngine$2@43c0a6e0 that was originally bound here09-20 19:00:33.547: ERROR/ActivityThread(2053): android.app.ServiceConnectionLeaked: Activity com.android.shredder.ui.ShredUI has leaked ServiceConnection com.android.shredder.domain.ShreddingEngine$2@43c0a6e0 that was originally bound here09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.ActivityThread$PackageInfo$ServiceDispatcher.&lt;init&gt;(ActivityThread.java:977)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.ActivityThread$PackageInfo.getServiceDispatcher(ActivityThread.java:872)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.ApplicationContext.bindService(ApplicationContext.java:796)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.content.ContextWrapper.bindService(ContextWrapper.java:337)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at com.android.shredder.domain.ShreddingEngine.bindService(ShreddingEngine.java:116)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at com.android.shredder.domain.ShreddingEngine.&lt;init&gt;(ShreddingEngine.java:109)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at com.android.shredder.domain.ShreddingControl.&lt;init&gt;(ShreddingControl.java:29)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at com.android.shredder.ui.ShredUI.initMainView(ShredUI.java:299)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at com.android.shredder.ui.ShredUI.onCreate(ShredUI.java:106)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.os.Handler.dispatchMessage(Handler.java:99)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.os.Looper.loop(Looper.java:123)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at android.app.ActivityThread.main(ActivityThread.java:4363)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at java.lang.reflect.Method.invokeNative(Native Method)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at java.lang.reflect.Method.invoke(Method.java:521)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)09-20 19:00:33.547: ERROR/ActivityThread(2053):     at dalvik.system.NativeStart.main(Native Method)09-20 19:00:33.607: WARN/ActivityManager(111): Unbind failed: could not find connection for android.os.BinderProxy@43d4aec809-20 19:00:35.177: INFO/ActivityManager(111): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.shredder/.Splash }09-20 19:00:35.487: DEBUG/dalvikvm(2053): GC freed 2068 objects / 146416 bytes in 199ms09-20 19:00:35.807: INFO/ActivityManager(111): Displayed activity com.android.shredder/.Splash: 566 ms (total 566 ms)09-20 19:00:35.877: DEBUG/ViewFlipper(184): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false09-20 19:00:36.077: INFO/ActivityManager(111): Starting activity: Intent { cmp=com.android.shredder/.authentication.AuthenticationUI }09-20 19:00:36.467: INFO/ActivityManager(111): Displayed activity com.android.shredder/.authentication.AuthenticationUI: 371 ms (total 371 ms)09-20 19:00:40.407: INFO/NotificationService(111): enqueueToast pkg=com.android.shredder callback=android.app.ITransientNotification$Stub$Proxy@43f80da0 duration=009-20 19:00:40.857: DEBUG/dalvikvm(177): GC freed 802 objects / 60440 bytes in 335ms09-20 19:00:40.937: INFO/ActivityManager(111): Starting activity: Intent { cmp=com.android.shredder/.ui.ShredUI }09-20 19:00:41.547: INFO/ActivityManager(111): Displayed activity com.android.shredder/.ui.ShredUI: 585 ms (total 585 ms)09-20 19:00:46.717: DEBUG/dalvikvm(184): GC freed 891 objects / 45520 bytes in 164ms09-20 19:00:50.357: INFO/ActivityManager(111): Start proc android.process.media for content provider com.android.providers.media/.MediaProvider: pid=2068 uid=10022 gids={1015, 1006, 2001, 3003}09-20 19:00:50.657: DEBUG/ddm-heap(2068): Got feature list request09-20 19:00:50.917: DEBUG/dalvikvm(95): GC freed 292 objects / 11128 bytes in 520ms09-20 19:00:50.997: INFO/ActivityThread(2068): Publishing provider media: com.android.providers.media.MediaProvider09-20 19:00:51.197: VERBOSE/MediaProvider(2068): Attached volume: internal09-20 19:00:51.217: VERBOSE/MediaProvider(2068): /sdcard volume ID: 35212474909-20 19:00:51.227: DEBUG/dalvikvm(95): GC freed 52 objects / 2336 bytes in 267ms09-20 19:00:51.377: DEBUG/dalvikvm(95): GC freed 2 objects / 56 bytes in 149ms09-20 19:00:51.417: ERROR/JavaBinder(111): !!! FAILED BINDER TRANSACTION !!!09-20 19:00:51.417: INFO/ActivityManager(111): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/.Launcher }09-20 19:00:51.447: VERBOSE/MediaProvider(2068): Attached volume: external09-20 19:00:51.457: DEBUG/ViewFlipper(184): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false09-20 19:00:51.477: INFO/ActivityThread(2068): Publishing provider downloads: com.android.providers.downloads.DownloadProvider09-20 19:00:51.507: DEBUG/ViewFlipper(184): updateRunning() mVisible=true, mStarted=true, mUserPresent=true, mRunning=true09-20 19:00:51.557: INFO/ActivityThread(2068): Publishing provider drm: com.android.providers.drm.DrmProvider09-20 19:00:51.567: INFO/ActivityManager(111): Process com.android.settings (pid 2036) has died.09-20 19:00:51.567: INFO/ActivityManager(111): Low Memory: No more background processes.09-20 19:00:52.567: DEBUG/dalvikvm(2053): GC freed 7038 objects / 394128 bytes in 103ms09-20 19:00:52.577: INFO/dalvikvm(2053): Uncaught exception thrown by finalizer (will be discarded):09-20 19:00:52.587: INFO/dalvikvm(2053): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43c2b460 on password_info that has not been deactivated or closed09-20 19:00:52.597: INFO/dalvikvm(2053):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:599)09-20 19:00:52.607: INFO/dalvikvm(2053):     at dalvik.system.NativeStart.run(Native Method)09-20 19:00:52.617: INFO/dalvikvm(2053): Uncaught exception thrown by finalizer (will be discarded):09-20 19:00:52.617: INFO/dalvikvm(2053): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43c2a5e8 on password_info that has not been deactivated or closed09-20 19:00:52.627: INFO/dalvikvm(2053):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:599)09-20 19:00:52.637: INFO/dalvikvm(2053):     at dalvik.system.NativeStart.run(Native Method)09-20 19:00:52.637: INFO/dalvikvm(2053): Uncaught exception thrown by finalizer (will be discarded):09-20 19:00:52.647: INFO/dalvikvm(2053): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43c25790 on password_info that has not been deactivated or closed09-20 19:00:52.647: INFO/dalvikvm(2053):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:599)09-20 19:00:52.647: INFO/dalvikvm(2053):     at dalvik.system.NativeStart.run(Native Method)09-20 19:00:52.677: INFO/dalvikvm(2053): Uncaught exception thrown by finalizer (will be discarded):09-20 19:00:52.687: INFO/dalvikvm(2053): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43c26858 on password_info that has not been deactivated or closed09-20 19:00:52.687: INFO/dalvikvm(2053):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:599)09-20 19:00:52.687: INFO/dalvikvm(2053):     at dalvik.system.NativeStart.run(Native Method)09-20 19:00:52.987: INFO/ActivityManager(111): Start proc com.android.browser for content provider com.android.browser/.BrowserProvider: pid=2081 uid=10032 gids={3003, 1015}09-20 19:00:53.067: DEBUG/ddm-heap(2081): Got feature list request09-20 19:00:53.207: INFO/ActivityThread(2081): Publishing provider browser: com.android.browser.BrowserProvider09-20 19:00:54.587: INFO/ActivityManager(111): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.shredder/.Splash }09-20 19:00:55.147: DEBUG/ViewFlipper(184): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false09-20 19:00:56.287: INFO/ActivityManager(111): Start proc com.android.settings for broadcast com.android.settings/.widget.SettingsAppWidgetProvider: pid=2093 uid=1000 gids={3003, 3002, 3001}09-20 19:00:56.287: INFO/ActivityManager(111): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/.Launcher }09-20 19:00:56.357: DEBUG/ViewFlipper(184): updateRunning() mVisible=false, mStarted=true, mUserPresent=true, mRunning=false09-20 19:00:56.417: DEBUG/ViewFlipper(184): updateRunning() mVisible=true, mStarted=true, mUserPresent=true, mRunning=true***09-20 19:00:56.867: WARN/InputManagerService(111): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43e78d2009-20 19:00:57.307: INFO/ActivityManager(111): Process com.android.shredder (pid 2053) has died.09-20 19:00:57.307: INFO/WindowManager(111): WIN DEATH: Window{43f5ca30 com.android.shredder/com.android.shredder.ui.ShredUI paused=false}09-20 19:00:57.397: INFO/WindowManager(111): WIN DEATH: Window{43f8fd18 Start Shredding paused=false}***09-20 19:00:58.147: DEBUG/ddm-heap(2093): Got feature list request09-20 19:01:05.038: DEBUG/skia(184): purging 55K from font cache [7 entries]09-20 19:01:05.157: DEBUG/dalvikvm(184): GC freed 765 objects / 37624 bytes in 121ms09-20 19:01:10.047: DEBUG/skia(111): purging 164K from font cache [18 entries]09-20 19:01:10.297: DEBUG/dalvikvm(111): GC freed 11281 objects / 570408 bytes in 246ms09-20 19:01:15.177: DEBUG/dalvikvm(180): GC freed 1720 objects / 72928 bytes in 127ms09-20 19:01:20.177: DEBUG/dalvikvm(218): GC freed 18 objects / 760 bytes in 118ms09-20 19:01:25.057: DEBUG/skia(177): purging 51K from font cache [5 entries]09-20 19:01:25.157: DEBUG/dalvikvm(177): GC freed 612 objects / 36872 bytes in 99ms09-20 19:01:30.207: DEBUG/dalvikvm(1657): GC freed 6 objects / 224 bytes in 138ms09-20 19:01:45.817: DEBUG/dalvikvm(111): threadid=15: bogus mon 1+0&gt;0; adjusting09-20 19:01:56.217: INFO/power(111): *** set_screen_state 009-20 19:01:56.217: DEBUG/Sensors(111): sensors=00000000, real=0000000009-20 19:01:56.287: DEBUG/WifiService(111): ACTION_SCREEN_OFF09-20 19:01:56.297: DEBUG/WifiService(111): setting ACTION_DEVICE_IDLE timer for 900000ms09-20 19:01:56.357: DEBUG/ViewFlipper(184): updateRunning() mVisible=true, mStarted=true, mUserPresent=false, mRunning=false09-20 19:01:56.387: DEBUG/AKMD(100): Compass CLOSE 09-20 19:01:56.567: DEBUG/SurfaceFlinger(111): About to give-up screen, flinger = 0x11f0e009-20 19:02:01.627: DEBUG/dalvikvm(111): GC freed 5972 objects / 305272 bytes in 187ms09-20 19:02:05.605: DEBUG/GpsLocationProvider(111): NetworkThread out of wake loop09-20 19:02:05.605: DEBUG/GpsLocationProvider(111): Requesting time from NTP server north-america.pool.ntp.org09-20 19:02:06.957: DEBUG/dalvikvm(2093): GC freed 1220 objects / 85520 bytes in 120ms09-20 19:02:15.612: DEBUG/SntpClient(111): request time failed: java.net.SocketTimeoutException: The operation timed out09-20 19:02:15.612: DEBUG/GpsLocationProvider(111): requestTime failed09-20 19:02:15.612: DEBUG/GpsLocationProvider(111): NetworkThread wait for 300000ms</code></pre><p>I think the problem is on the Bold Italic part of the logcat which i have added above.</p><p>How can i solve this problem?Please help me if anyone know the solution.</p><p>BR,gsmaker</p>","424854","","380579","","2011-01-28 10:14:16","2011-01-28 10:14:16","Android process died problem","<android>","0","1","","",""
"3734844","1","","","2010-09-17 11:21:50","3","20626","<p>I am using grid view for displaying image using xml parsing,i got some exception like  <code>java.lang.IllegalArgumentException: Illegal character in path at index 80: <a href=""http://www.theblacksheeponline.com/party"" rel=""nofollow"">http://www.theblacksheeponline.com/party</a>_img/thumbspps/912big_361999096_Flicking Off Douchebag.jpg</code>,how to solve this problem?,i want to display all kind of url,anybody knows please give sample code for me..</p><p>Thanks All</p>","410757","","","","","2014-01-24 12:01:55","how to url encode in android?","<android>","5","2","1","",""
"3734944","1","3735341","","2010-09-17 11:38:44","3","895","<p>I'm making an Android AppWidget to sit on the home screen. </p><p>The user's home screen space is precious, so I want the widget to be small. The ideal size would be 2x1 cells. </p><ul><li><a href=""http://developer.android.com/guide/topics/appwidgets/index.html#MetaData"" rel=""nofollow"">Some documentation</a> suggests you can have any size you like? </li><li>But the <a href=""http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#sizes"" rel=""nofollow"">AppWidget graphical design guidelines imply</a> that only standard sizes are supported: 4x1, 3x3, 2x2. <ul><li>Does that refer to the available PhotoShop templates or is it a limitation of Android itself?</li></ul></li><li>I'm finding that a 2x1 widget works on my actual device (HTC Wildfire) but expands to 2x2 on the emulator. <ul><li>HTC have their own <a href=""http://en.wikipedia.org/wiki/HTC_Sense"" rel=""nofollow"">special implementation of the home screen</a>, so maybe my widget will only work at 2x1 on HTC devices? </li></ul></li></ul><p>Is there any way to create a 2x1 widget, or should I use a standard size?</p><p>My widget was adapted from the <a href=""http://code.google.com/p/wiktionary-android/source/browse/trunk/Wiktionary/src/com/example/android/wiktionary/WordWidget.java"" rel=""nofollow"">Simple Wiktionary</a> sample. </p><ul><li><a href=""http://code.google.com/p/wiktionary-android/source/browse/trunk/Wiktionary/res/xml/widget_word.xml"" rel=""nofollow"">The manifest</a> has <code>android:minWidth=""146dip""</code> and <code>android:minHeight=""72dip""</code>.</li><li>There's <a href=""http://code.google.com/p/wiktionary-android/source/browse/trunk/Wiktionary/res/layout/widget_word.xml"" rel=""nofollow"">a RelativeLayout with</a> <code>android:layout_width=""fill_parent""</code> and <code>android:layout_height=""wrap_content""</code></li></ul><p>I'm just starting with Android, so apologies in advance if this is a silly question. :)</p>","15639","","","","","2010-12-22 03:39:38","Are Android AppWidgets restricted to particular sizes?","<android><appwidget>","2","0","","",""
"3734981","1","3735103","","2010-09-17 11:43:27","4","9823","<p>I am absolutely new to the Android platform and have been building an application while learning the development process.</p><p>Currently, I am working on an activity in which i need to deploy 2 date pickers. One is a ""Start Date"" and the other is an ""End date"". I have been following the DatePicker tutorial on the android developers page here: <a href=""http://developer.android.com/resources/tutorials/views/hello-datepicker.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-datepicker.html</a></p><p>For one DatePicker, it works just fine.</p><p>Now my problem is, when I replicate the whole process for a second date picker, it shows up just fine on the emulator as well as on the handset. But when no matter which button I press to select the dates, only the first TextView is updated and the second TextView keeps showing the current date.</p><p>Here is the code:</p><pre><code>package com.datepicker;import java.util.Calendar;import android.app.Activity;import android.app.DatePickerDialog;import android.app.Dialog;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.DatePicker;import android.widget.TextView;public class datepicker extends Activity {private TextView mDateDisplay;private TextView endDateDisplay;private Button mPickDate;private Button endPickDate;private int mYear;private int mMonth;private int mDay;static final int START_DATE_DIALOG_ID = 0;static final int END_DATE_DIALOG_ID = 0;/** Called when the activity is first created. */@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    /*  capture our View elements for the start date function   */    mDateDisplay = (TextView) findViewById(R.id.startdateDisplay);    mPickDate = (Button) findViewById(R.id.startpickDate);    /* add a click listener to the button   */    mPickDate.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            showDialog(START_DATE_DIALOG_ID);        }    });    /* get the current date */    final Calendar c = Calendar.getInstance();    mYear = c.get(Calendar.YEAR);    mMonth = c.get(Calendar.MONTH);    mDay = c.get(Calendar.DAY_OF_MONTH);    /* display the current date (this method is below)  */    updateStartDisplay(); /* capture our View elements for the end date function */    endDateDisplay = (TextView) findViewById(R.id.enddateDisplay);    endPickDate = (Button) findViewById(R.id.endpickDate);    /* add a click listener to the button   */    endPickDate.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            showDialog(END_DATE_DIALOG_ID);        }    });    /* get the current date */    final Calendar c1 = Calendar.getInstance();    mYear = c1.get(Calendar.YEAR);    mMonth = c1.get(Calendar.MONTH);    mDay = c1.get(Calendar.DAY_OF_MONTH);    /* display the current date (this method is below)  */    updateEndDisplay();}private void updateEndDisplay() {    endDateDisplay.setText(            new StringBuilder()                // Month is 0 based so add 1                .append(mMonth + 1).append(""-"")                .append(mDay).append(""-"")                .append(mYear).append("" ""));}private void updateStartDisplay() {    mDateDisplay.setText(            new StringBuilder()                // Month is 0 based so add 1                .append(mMonth + 1).append(""-"")                .append(mDay).append(""-"")                .append(mYear).append("" ""));}</code></pre><p>/* the callback received when the user ""sets"" the date in the dialog for the start date function    */ </p><pre><code> private DatePickerDialog.OnDateSetListener mDateSetListener =            new DatePickerDialog.OnDateSetListener() {            public void onDateSet(DatePicker view, int year,                                   int monthOfYear, int dayOfMonth) {                mYear = year;                mMonth = monthOfYear;                mDay = dayOfMonth;                updateStartDisplay();            }        };@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {    case START_DATE_DIALOG_ID:        return new DatePickerDialog(this,                    mDateSetListener,                    mYear, mMonth, mDay);    }    return null;}/* the callback received when the user ""sets"" the date in the dialog for the end date function  */private DatePickerDialog.OnDateSetListener endDateSetListener =        new DatePickerDialog.OnDateSetListener() {            public void onDateSet(DatePicker view, int year,                                   int monthOfYear, int dayOfMonth) {                mYear = year;                mMonth = monthOfYear;                mDay = dayOfMonth;                updateStartDisplay();            }        };protected Dialog onCreateDialog1(int id) {    switch (id) {    case END_DATE_DIALOG_ID:        return new DatePickerDialog(this,                    endDateSetListener,                    mYear, mMonth, mDay);    }    return null;}</code></pre><p>}</p><p>Please advise on the changes required for the code.</p>","450534","","1352969","","2012-06-19 07:44:12","2014-04-07 13:12:04","Multiple DatePickers in same activity","<android><date><datepicker><picker>","4","2","3","",""
"3735095","1","3735108","","2010-09-17 11:58:46","8","4679","<p>I am using <code>ScrollView</code> in my Android Layout but it shows </p><p><code>IllegalStateException ""Scrollview can host only one direct child""</code></p><p>How can I avoid this exception? </p>","436765","","141661","","2014-02-28 12:55:40","2014-02-28 12:55:40","How can I avoid ""IllegalStateException: Scrollview can host only one direct child""?","<android><scrollview>","2","1","1","",""
"3735102","1","3735187","","2010-09-17 11:59:42","1","1528","<p>As i'm new to android, i really couldn't understand the errors or execptions shown in the android DDMS,I'm using Eclipse ..</p><p>Can anyone please share some very frequent exceptions that appear in DDMS and how to handle them...... </p>","438864","","180538","","2010-09-17 12:12:46","2011-12-20 06:02:25","Android DDMS exceptions?","<android><exception>","4","0","1","",""
"3735147","1","3736755","","2010-09-17 12:06:44","0","430","<p>I'm parsing the image from the url, i want to display the corner of parsed image as roundrect(similar to figure2) but i'm not able to do that, can anyone guide me regarding on this, My code for parsing the image from url is </p><pre><code> img_value = new URL(VAL4[arg0]); Log.v(""Image_Url1"",img_value.toString()); try{    mIcon11 = BitmapFactory.decodeStream(img_value.openConnection().getInputStream());    img.setImageBitmap(mIcon11);}catch(Exception e){    Log.v(TAG,""error   ""+e);}</code></pre><p>Figure 2<br><img src=""http://i.stack.imgur.com/1y05p.png"" alt=""alt text""> </p><p>Figure1<br><img src=""http://i.stack.imgur.com/hVV40.png"" alt=""alt text""></p>","424413","","137350","","2010-09-17 12:11:12","2010-09-17 15:35:12","How to apply round rectuangular shape to the parsed image from android?","<android>","1","0","","",""
"3735163","1","3736487","","2010-09-17 12:08:14","1","5108","<p>I want to use calendar in my android application in grid view format and it will show events and images on a specific date.</p><p>Is there any calendar jar that I could use?</p>","304961","","1288","","2011-04-06 11:10:09","2011-08-09 08:49:06","calendar view android","<android>","1","1","3","",""
"3735360","1","","","2010-09-17 12:40:27","0","251","<p>The problem is: I have problem with refreshing listView. I set ListView adapter (BaseAdapter) after changing data object I call notifyDataSetChanged but it make no effect to my list - its stay empty. None of Adapter function is called!</p><p>What i did wrong?</p>","436703","","","","","2010-09-17 17:05:02","Problem with refreshing ListView","<android><listview><refresh>","1","0","","",""
"3735379","1","4549017","","2010-09-17 12:42:37","0","627","<p>I have...</p><ul><li>PNG file for Background</li><li>PNG file for Icon (drawableTop)</li><li>Text I want to put underneath this Button</li></ul><p>It's similar to a Menu Icon. How to do that? I only found following ways. Both of them arent very nice:</p><ul><li>Make two Buttons, one for Text one for the Picture</li><li>The Background PNG File needs a transparent area at the bottom in the size of the text.</li></ul>","433718","","","","","2010-12-28 19:55:12","Android: How to put text underneath a Button?","<android><button><android-layout>","2","0","1","",""
"3735409","1","3735417","","2010-09-17 12:46:52","3","5297","<p>I have a ScrollView (and a LinearLayout within it) set as main content. When the user scrolls the view further down, and then if I replace it's child (LinearLayout) with another LinearLayout, the view remains in the scrolled positioned.</p><p>How do I reset the ScrollView back to coordinate 0?</p>","229106","","","","","2013-03-12 17:01:13","Reset scroll in ScrollView","<android><scrollview>","3","0","","",""
"3735450","1","","","2010-09-17 12:53:09","1","3852","<p>hi as i run my app my services r running but after some time a msg comesignoring second debugger- accepting and dropping  continuously and my service got hanged.plz help. my file is following</p><pre><code>D/PackageManager(   58):   Receivers: com.company.cellSafetyZone.controller.IncomingCallReceiver com.company.cellSafetyZone.controller.LocationReceiver com.company.cellSafetyZone.controller.OutGoingCallReceiver com.company.cellSafetyZone.controller.InComingSmsReceiver com.company.cellSafetyZone.controller.InComingMmsReceiver com.company.cellSafetyZone.controller.OutGoingSmsReceiverD/PackageManager(   58):   Activities: com.company.cellSafetyZone.view.SplashScreenI/installd(   34): move /data/dalvik-cache/data@app@com.company.cellSafetyZone-2.apk@classes.dex -&gt; /data/dalvik-cache/data@app@com.company.cellSafetyZone-2.apk@classes.dexD/PackageManager(   58): New package installed in /data/app/com.company.cellSafetyZone-2.apkD/dalvikvm(  128): GC_EXPLICIT freed 11288 objects / 558632 bytes in 83msI/ActivityManager(   58): Force stopping package com.company.cellSafetyZone uid=10032I/ActivityManager(   58): Force stopping package com.company.cellSafetyZone uid=10032D/Exchange(  242): BootReceiver onReceiveI/ActivityManager(   58): Start proc com.company.cellSafetyZone for broadcast com.company.cellSafetyZone/.controller.LocationReceiver: pid=256 uid=10032 gids={3003, 1015}D/EAS SyncManager(  242): !!! EAS SyncManager, onCreateD/EAS SyncManager(  242): !!! EAS SyncManager, onStartCommandD/dalvikvm(   58): GC_FOR_MALLOC freed 6262 objects / 414352 bytes in 179msD/EAS SyncManager(  242): !!! EAS SyncManager, stopping selfD/Loction Receiver(  256): IN Location Service...D/Loction Receiver(  256): received unexpected intent...Intent { act=android.intent.action.BOOT_COMPLETED cmp=com.company.cellSafetyZone/.controller.LocationReceiver }D/CheckLocation(  256): onCreate()D/MediaScannerService(  216): done scanning volume internalD/CheckLocation(  256): startService()D/CheckLocation(  256): 1D/CheckLocation(  256): 2D/CheckLocation(  256): 3D/OUT GOING SMS RECEIVER(  256): IN Outgoing sms receiver...D/OUT GOING SMS RECEIVER(  256): received unexpected intent...Intent { act=android.intent.action.BOOT_COMPLETED cmp=com.company.cellSafetyZone/.controller.OutGoingSmsReceiver }D/SMS SERVICE(  256): blank constructorD/SMS SERVICE(  256): in on Create() of sms serviceD/SMS SERVICE(  256): calling serviceD/SMS SERVICE(  256): registering resolverD/SMS SERVICE(  256): registering observerD/SMS SERVICE(  256): registerdI/ActivityManager(   58): Force stopping package com.company.cellSafetyZone uid=10032D/Eas Debug(  242): Logging: W/ActivityManager(   58): Scheduling restart of crashed service com.company.cellSafetyZone/.model.OutGoingSmsService in 5000msW/ActivityManager(   58): Scheduling restart of crashed service com.company.cellSafetyZone/.model.CheckLocation in 14999msI/Process (   58): Sending signal. PID: 256 SIG: 9I/WindowManager(   58): WIN DEATH: Window{43f2efc8 Toast paused=false}W/GpsLocationProvider(   58): Unneeded remove listener for uid 1000I/ActivityManager(   58):   Force stopping service ServiceRecord{43ffc040 com.company.cellSafetyZone/.model.OutGoingSmsService}I/ActivityManager(   58):   Force stopping service ServiceRecord{4400da20 com.company.cellSafetyZone/.model.CheckLocation}D/EAS SyncManager(  242): !!! EAS SyncManager, onDestroyD/dalvikvm(  164): GC_EXPLICIT freed 4102 objects / 253968 bytes in 333msW/RecognitionManagerService(   58): no available voice recognition services foundD/dalvikvm(   58): GC_EXPLICIT freed 3955 objects / 219648 bytes in 128msI/installd(   34): unlink /data/dalvik-cache/data@app@com.company.cellSafetyZone-1.apk@classes.dexD/AndroidRuntime(  116): Shutting down VMD/dalvikvm(  116): Debugger has detached; object registry had 1 entriesI/AndroidRuntime(  116): NOTE: attach of thread 'Binder Thread #3' failedI/ActivityManager(   58): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=270 uid=10028 gids={}I/ActivityThread(  270): Publishing provider com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProviderD/AndroidRuntime(  269): D/AndroidRuntime(  269): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime(  269): CheckJNI is ONW/NotificationService(   58): Object died trying to hide notification android.app.ITransientNotification$Stub$Proxy@43face50 in package com.company.cellSafetyZoneW/ActivityManager(   58): setProcessForeground called on unknown pid: 256D/AndroidRuntime(  269): --- registering native functions ---I/ActivityManager(   58): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.company.cellSafetyZone/.view.SplashScreen }D/AndroidRuntime(  269): Shutting down VMD/dalvikvm(  269): Debugger has detached; object registry had 1 entriesI/AndroidRuntime(  269): NOTE: attach of thread 'Binder Thread #3' failedI/ActivityManager(   58): Start proc com.company.cellSafetyZone for activity com.company.cellSafetyZone/.view.SplashScreen: pid=283 uid=10032 gids={3003, 1015}I/jdwp    (  119): Ignoring second debugger -- accepting and droppingI/jdwp    (  123): Ignoring second debugger -- accepting and droppingI/jdwp    (  128): Ignoring second debugger -- accepting and droppingI/jdwp    (  130): Ignoring second debugger -- accepting and droppingI/jdwp    (  200): Ignoring second debugger -- accepting and droppingI/jdwp    (  242): Ignoring second debugger -- accepting and droppingI/jdwp    (  283): Ignoring second debugger -- accepting and droppingI/jdwp    (  270): Ignoring second debugger -- accepting and droppingI/jdwp    (  164): Ignoring second debugger -- accepting and droppingI/jdwp    (  171): Ignoring second debugger -- accepting and droppingI/jdwp    (  181): Ignoring second debugger -- accepting and droppingI/jdwp    (  189): Ignoring second debugger -- accepting and droppingI/jdwp    (  209): Ignoring second debugger -- accepting and droppingI/jdwp    (  216): Ignoring second debugger -- accepting and droppingI/jdwp    (  226): Ignoring second debugger -- accepting and droppingI/ActivityManager(   58): Displayed activity com.company.cellSafetyZone/.view.SplashScreen: 1222 ms (total 32701 ms)I/ActivityManager(   58): Displayed activity com.android.launcher/com.android.launcher2.Launcher: 32703 ms (total 32703 ms)D/KeyguardViewMediator(   58): pokeWakelock(5000)D/KeyguardViewMediator(   58): pokeWakelock(5000)I/ARMAssembler(   58): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x2fb598:0x2fb6a4] in 1489348 nsI/ARMAssembler(   58): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x2fb6a8:0x2fb870] in 951160 nsW/KeyCharacterMap(  283): No keyboard for id 0W/KeyCharacterMap(  283): Using default keymap: /system/usr/keychars/qwerty.kcm.binD/dalvikvm(  283): GC_EXPLICIT freed 854 objects / 59728 bytes in 182msD/SntpClient(   58): request time failed: java.net.SocketException: Address family not supported by protocolD/AndroidRuntime(  304): D/AndroidRuntime(  304): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime(  304): CheckJNI is OND/AndroidRuntime(  304): --- registering native functions ---I/jdwp    (  304): Ignoring second debugger -- accepting and droppingD/AndroidRuntime(  304): Shutting down VMD/dalvikvm(  304): Debugger has detached; object registry had 1 entriesI/AndroidRuntime(  304): NOTE: attach of thread 'Binder Thread #3' failedD/AndroidRuntime(  322): D/AndroidRuntime(  322): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime(  322): CheckJNI is OND/AndroidRuntime(  322): --- registering native functions ---I/jdwp    (  322): Ignoring second debugger -- accepting and droppingD/AndroidRuntime(  322): Shutting down VMD/dalvikvm(  322): Debugger has detached; object registry had 1 entriesI/AndroidRuntime(  322): NOTE: attach of thread 'Binder Thread #3' failedD/AndroidRuntime(  334): D/AndroidRuntime(  334): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime(  334): CheckJNI is OND/AndroidRuntime(  334): --- registering native functions ---I/jdwp    (  334): Ignoring second debugger -- accepting and droppingD/AndroidRuntime(  334): Shutting down VMD/dalvikvm(  334): Debugger has detached; object registry had 1 entriesI/AndroidRuntime(  334): NOTE: attach of thread 'Binder Thread #3' failedD/AndroidRuntime(  344): D/AndroidRuntime(  344): &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;D/AndroidRuntime(  344): CheckJNI is OND/AndroidRuntime(  344): --- registering native functions ---I/jdwp    (  344): Ignoring second debugger -- accepting and droppingD/AndroidRuntime(  344): Shutting down VMD/dalvikvm(  344): Debugger has detached; object registry had 1 entriesI/AndroidRuntime(  344): NOTE: attach of thread 'Binder Thread #3' failedD/SntpClient(   58): request time failed: java.net.SocketException: Address family not supported by protocolD/SntpClient(   58): request time failed: java.net.SocketException: Address family not supported by protocolD/dalvikvm(  119): Debugger has detached; object registry had 1 entriesD/dalvikvm(  123): Debugger has detached; object registry had 1 entriesD/dalvikvm(  128): Debugger has detached; object registry had 1 entriesD/dalvikvm(  130): Debugger has detached; object registry had 1 entriesD/dalvikvm(  283): Debugger has detached; object registry had 1 entriesD/dalvikvm(  164): Debugger has detached; object registry had 1 entriesD/dalvikvm(  171): Debugger has detached; object registry had 1 entriesD/dalvikvm(  189): Debugger has detached; object registry had 1 entriesD/dalvikvm(  200): Debugger has detached; object registry had 1 entriesD/dalvikvm(  209): Debugger has detached; object registry had 1 entriesD/dalvikvm(  216): Debugger has detached; object registry had 1 entriesD/dalvikvm(  270): Debugger has detached; object registry had 1 entriesD/dalvikvm(  242): Debugger has detached; object registry had 1 entriesD/dalvikvm(  226): Debugger has detached; object registry had 1 entriesD/dalvikvm(  181): Debugger has detached; object registry had 1 entries </code></pre>","450601","","503900","","2011-03-18 14:34:02","2012-04-18 11:16:06","ignoring second debugger and service hang in android","<android><debugging>","2","2","","",""
"3735661","1","3736017","","2010-09-17 13:21:53","28","15458","<p>I have a annoying problem with @Override annotations in Eclipse. Often when i import working projects on a new PC, Eclipse marks some of the @Override annotations as wrong. If i remove the annotations everything is fine and Eclipse also indicates that the methods are overriding the parents methods but adding the Override annotation causes the error again. I am currently working on an Android project so it might be a problem with Android and not with Eclipse..</p>","165106","","","","","2013-12-11 09:30:33","Bug with Override annotations in Eclipse","<android><eclipse><annotations><override>","4","2","2","",""
"3735771","1","3747136","","2010-09-17 13:36:53","2","1545","<p>I know that after downloading an mp3 from your app you need to add it to the <code>ContentResolver</code> to see it on the music player. I am doing it with the following code:</p><pre><code>    private void addFileToContentProvider() {        ContentValues values = new ContentValues(7);        values.put(Media.DISPLAY_NAME, ""display_name"");        values.put(Media.ARTIST, ""artist"");        values.put(Media.ALBUM, ""album"");        values.put(Media.TITLE, ""Title"");         values.put(Media.MIME_TYPE, ""audio/mp3"");         values.put(Media.IS_MUSIC, true);        values.put(Media.DATA, pathToFile);        context.getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);     }</code></pre><p>My issue is that I am willing to avoid setting <code>DISPLAY_NAME</code>, <code>ARTIST</code>, <code>ALBUM</code>, <code>TITLE</code> by hand.</p><p>Is there a way to tell Android to do it from the file? I've already used just <code>values.put(Media.DATA, pathToFile);</code> but it's not adding it to the player.</p><p>Is there a way to force the thread that scans the sd for music?</p>","119895","","","","","2010-09-20 22:57:06","Adding mp3 to the ContentResolver","<android>","1","0","2","",""
"3735919","1","4078985","","2010-09-17 13:54:46","4","1518","<p>I am trying to display some ImageView and TextView in a TableLayout.</p><p>However, for the TextView (in the second column), it is partially hidden and does not go to the next line. </p><p>A screen capture is attached <a href=""http://img69.imageshack.us/img69/8980/screenshot20100917atpm0.png"" rel=""nofollow"">here</a>.</p><pre><code>&lt;TableLayout android:id=""@+id/RestTable"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""  android:background=""#D1D3D4"" android:layout_marginTop=""5dp"" android:stretchColumns=""*""&gt;&lt;TableRow android:id=""@+id/row1 android:layout_width=""fill_parent"" android:layout_height=""wrap_content""  android:layout_marginBottom=""0.3dp"" android:background=""#ffffffff""&gt; &lt;ImageView android:id=""@+id/tickPic""  android:layout_marginLeft=""13dp""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:src=""@drawable/tickPic""  android:scaleType=""matrix"" /&gt; &lt;TextView   android:id=""@+id/meal""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:textSize=""13sp""  android:text=""Dinner, Lunch, Buffet, Brunch, Hi Tea, Supper/Night Dining""  android:textColor=""#000000"" /&gt;&lt;/TableRow&gt;</code></pre><p>Is it possible for the TextView to wrap the content and move the text to the next line instead of being partially hidden?</p><p>I tried using android:layout_marginRight but doesn't solve anything.</p>","442658","","","","","2011-02-01 05:16:11","TextView in TableRow is partially hidden","<android><textview><tableview>","1","0","2","",""
"3735992","1","3736323","","2010-09-17 14:03:43","1","456","<p>I create Android applications for my job.  Eclipse is open all day and I am frequently editing XML files for layouts, etc.<br>I find that creating/editing these XML files pushes up the memory use of Eclipse.  Eclipse never seems to release any of the memory and eventually Eclipse tells me that there has been some sort of workbench out of memory error and I have to exit.  It will not let me save or do much of anything after this point.</p><p>Is there a workaround for this?<br>I don't want to have to exit Eclipse and start it up because of this memory issue.<br>Why won't Eclipse free up its memory use? It just keeps going up.</p><p>edit: I am still having issues with running out of memory, the eclipse.ini suggestions did not fix it.</p>","416412","","416412","","2010-09-26 17:36:12","2010-09-26 17:36:12","OutOfMemory while editing XML for Android in Eclipse","<android><eclipse><out-of-memory>","1","2","","",""
"3736062","1","","","2010-09-17 14:11:29","1","6142","<p>For now I've used the classic <code>export</code> command to set an environment variable and tried to read this variable from my test with <code>System.getenv()</code> function, but it doesn't seem to work. </p><p>Can someone give an example how to set and read a system variable in an Android application?</p>","342863","","","","","2011-11-02 14:35:59","How to set and use an environment variable in Android Test?","<android>","4","0","1","",""
"3736129","1","","","2010-09-17 14:18:38","0","1721","<p>I am doing some android development, and now I need to send some android application </p><p>generated data onto a remote server (a database)?</p><p>How can I do that? can I use direct JDBC connection and sql?</p><p>Thanks in advance!</p>","449034","","","","","2010-09-17 14:23:31","Android.. How to Upload data from android phone to remote database?","<android><database>","1","0","","",""
"3736252","1","3738693","","2010-09-17 14:33:45","2","565","<p>I have an application that uses predefined word lists but I want to extend it to give the option of using their own custom lists. </p><p>Unfortunately lists like SOWPODS (the official Scrabble word list) are quite comprehensive and contain words I wouldn't want popping up on the screen.</p><p>I can easily get hold of a banned word list and build it into my application as a kind of swear filter. Is this likely to get my app trapped by any application filtering that may be present on Google Marketplace and, if so, is there a way around it? (encryption, compression etc.)</p><p>EDIT: Most of the answers so far are missing the point that the user will be supplying the list so I have no control over its content and need to filter it in my app either on import or as it is used. (Though they will still blame me if the app ""swears"" at them)</p>","444709","","444709","","2010-09-18 17:17:08","2010-09-18 17:17:08","swearing in code","<android>","8","12","2","",""
"3736322","1","","","2010-09-17 14:40:46","1","1489","<p>I am doing some android development, and now I need to send some android application </p><p>generated data onto a remote server (a database)?</p><p>How can I do that? can I use direct JDBC connection and sql?</p><p>Thanks in advance!</p>","449034","","","","","2010-09-17 14:48:19","how to upload android data onto remote server (a database)?","<android><database><upload>","1","1","","",""
"3736367","1","","","2010-09-17 14:45:38","21","15345","<p>The Activity class has a setContentView() method.  The PopupWindow Class has a getContentView() method but nothing else does.  Is there another way to get the main content view for an activity?</p>","444907","","","","","2013-01-07 05:42:11","Why isn't there a getContentView() method for Activity?","<android>","3","0","6","",""
"3736408","1","3737159","","2010-09-17 14:51:17","0","1453","<p>I have a singleton which stores some prudent information about the user of my application.  At the moment, it stores the user's login and the user's location.</p><p>1)The location is found via a Service.  At the moment, the Service references my singleton directly to stuff the longitude and latitude into it.  I would like to use a BroadcastReceiver to send a broadcast that the singleton hears and uses to update the values, instead.</p><p>However, to register the BroadcastReceiver, I need a Context in my singleton.  What is the slickest way to achieve what I'm wanting.  Is BroadcastReceiver possibly not the appropriate object?</p><p>2)Also, what problems am I looking at with using a singleton?  I assume that Android will possibly reclaim this memory at any given time (which would obviously be bad); so how can I prevent that?  Would passing in the application's Context and storing it in a member variable thwart this?</p><p>The Android documentation states: ""But, the life cycle of a static is not well under your control; so to abide by the life-cycle model, the application class should initiate and tear down these static objects in the onCreate() and onTerminate() methods of the Application Class,"" but I'm not entirely sure how to accomplish this.</p>","406790","","","","","2010-09-17 16:27:05","Slickest way to use BroadcastReceiver in a singleton and more","<android><singleton><broadcastreceiver><application-lifecycle>","1","0","","",""
"3736458","1","","","2010-09-17 14:56:04","1","225","<p>I have a problem that's only affecting Droid phones.  I end up not being able to access global variables after an onActivityResult event.</p><p>While looking into this I came across:<a href=""http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables"">http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables</a></p><p>I follow those directions, but still the value is NULL.</p><p>On my HTC Hero everything I've tried works.  On Droid phones everything is NULL or an empty string.</p><p>What I need is the URL from the webview.  In the onPageFinished I've been putting the URL into a global variable.  The app has the correct URL in that method because that's when I pop open the imagepicker.  After that is when the global variable value is gone.  I also can't read the webview (I can on my Hero, can't on Droid's) after hitting the onActivityResult event.  GetUrl() returns NULL for them, works fine for me.  Everything also works fine in the simulator.  I've 1.5, 2.1, and 2.2 in the simulator.</p><p>How else can I store the info I need to retrieve?</p>","448864","","","","","2010-09-17 14:56:04","After onActivityResult event State Is Gone (Droid Phones)","<android>","0","0","","",""
"3736459","1","3740361","","2010-09-17 14:56:11","3","1507","<p>I see examples of selectors using android states like 'selected' to define style.  Here a simplified example:</p><pre><code>&lt;selector&gt;    &lt;item android:state_selected=""true"" android:drawable=""@color/transparent"" /&gt;    &lt;item android:drawable=""@drawable/listitem_normal"" /&gt;&lt;/selector&gt;</code></pre><p>So, my question is: Can I define and use my own state instead of</p><pre><code>android:state_selected=""true""</code></pre><p>My goal is to color shapes based on an integer value, like simple version of this heatmap:<img src=""http://i.stack.imgur.com/3YrLq.gif"" alt=""alt text""></p>","289740","","14651","","2010-09-18 04:36:12","2013-05-08 07:37:36","Custom item states for android selectors","<android><coding-style><selector><heatmap>","2","0","3","",""
"3736476","1","3737104","","2010-09-17 14:58:15","0","1058","<p>I am using two Intents for various actions in my activity and I also used <code>onActivityResult</code> to get a result. I want to know how to get to <code>Intent</code> result in <code>onActivityResult</code>? Can someone please provide sample code?</p><p>Thanks all.</p>","410757","","844882","","2012-03-21 05:10:59","2012-03-21 05:10:59","how to get tow intent result in onActivityResult?","<android>","1","0","","",""
"3736663","1","3737412","","2010-09-17 15:23:41","14","17554","<p>I really tried to, but I can't understand how Android interprets <code>layout_weight</code> setting...</p><p>What I'm trying to achieve is </p><ul><li>a header on top with a fixed height</li><li>an input area at the bottom containing an EditText and a Button</li><li>a content part in the middle that's taking all what's left of space  </li></ul><p>When typing I'd like to grow the EditText to a specific height and to start scrolling if the text entered exceeds the available height. Doing this I need the surrounding <code>LinearLayout</code> to grow together with the EditText.</p><p>If I define a specific height for the inner <code>LinearLayout</code> it won't grow. If I don't, the inner layout takes ALL the space instead of the ScrollView, no matter what I try using <code>layout_weight</code>. :(</p><p>My current XML looks like that:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" &gt;    &lt;TextView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""I'm a header"" /&gt;    &lt;ScrollView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""        android:gravity=""bottom""&gt;        &lt;LinearLayout            android:id=""@+id/itemContainer""            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;    &lt;/ScrollView&gt;    &lt;LinearLayout        android:layout_width=""fill_parent""        android:layout_height=""50dp""        android:padding=""2dp""        android:gravity=""bottom""        android:isScrollContainer=""true""        android:background=""@drawable/steel"" &gt;        &lt;EditText            android:id=""@+id/edittext01""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""0.2""            android:scrollbars=""vertical""            android:fadingEdge=""vertical""            android:fadingEdgeLength=""60dp""            android:maxHeight=""40dp""            android:textSize=""15sp"" /&gt;        &lt;Button            android:id=""@+id/button""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""0.8""            android:layout_gravity=""right""            android:text=""Send""            android:textStyle=""bold""            android:textSize=""15sp"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Any tips are greatly appreciated!</p>","419501","","419501","","2012-09-14 14:32:14","2012-09-14 14:32:14","Problems understanding Android XML layout_weight","<android><xml><android-linearlayout>","4","0","7","",""
"3736704","1","","","2010-09-17 15:29:48","0","1182","<p>I have customized my activity to bring it like a dialog. Now I want to stop the default animation and have to add the zoom out animation.</p><p>To stop the animation I have tried the following.</p><pre><code>customDialog.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);</code></pre><p>and in styles </p><pre><code>  &lt;style name=""Theme.CustomDialog"" parent=""android:style/Theme.Dialog""&gt;               &lt;item name=""android:windowBackground""&gt;@drawable/translucent_background&lt;/item&gt;      &lt;item name=""android:activityOpenEnterAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:activityOpenExitAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:activityCloseEnterAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:activityCloseExitAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:taskOpenEnterAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:taskOpenExitAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:taskCloseEnterAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:taskCloseExitAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:taskToFrontEnterAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:taskToFrontExitAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:taskToBackEnterAnimation""&gt;@null&lt;/item&gt;       &lt;item name=""android:taskToBackExitAnimation""&gt;@null&lt;/item&gt;   &lt;/style&gt;</code></pre><p>Even thought it is not working.</p><p>Can anyone tel me how to stop the default animation and add the zoom out animation to the activity.</p><p>Thanks in advance.</p>","275845","","","","","2011-05-19 10:12:50","Adding zoom out animation to the activity","<android><animation><activity><zoom><out>","1","0","","",""
"3736768","1","","","2010-09-17 15:36:28","7","7073","<p>I'm using a ScrollView and i want to set the ScrollBar size, but everything i tried failed.I tried with attribute android:scrollbarSize, with style, with theme but nothing. The size of the scrollbar it's always the same.Any suggestions? Thanks</p><p>I tried with this: </p><pre><code>&lt;ScrollView android:layout_width=""fill_parent"" android:layout_height=""fill_parent""android:layout_marginTop=""10px""android:layout_marginBottom=""15px""android:scrollbarSize=""20px""android:scrollbarTrackVertical=""@drawable/scrollbar_reflection""android:scrollbarThumbVertical=""@drawable/scrollbar_state2""&gt;</code></pre><p>but the width of the Scrollbar doesn't change.</p><p>So i created a stye file like this:</p><pre><code>&lt;resources&gt;   &lt;style name=""ShowAllScrollBar1""&gt;     &lt;item name=""android:scrollbarSize""&gt;20px&lt;/item&gt;            &lt;/style&gt;&lt;/resources&gt;</code></pre><p>and then set style in AndroidManifest.</p>","450742","","23354","","2011-01-24 13:54:37","2011-02-14 22:38:03","Android ScrollView scrollbarSize","<android><scrollbar>","2","1","2","",""
"3736795","1","3736928","","2010-09-17 15:39:40","2","5424","<p>Can anyone tell me how to combine or concatenate two bitmap images into one in android?</p>","397901","","244296","","2010-09-17 16:09:04","2011-09-20 08:50:04","How to concate/combine two bitmaps and make them one image in android","<android><image><graphics>","3","0","2","",""
"3736883","1","3736943","","2010-09-17 15:51:37","6","7975","<p>I'm wondering if there is a way to hide a field in Android.<br>I tried with setting the value in a TextEdit and then making the TextEdit invisible, but the result is that the value is invisible, but the control takes space.</p><p>In my case, I want to store an extra value in a row of a ListView.<br>Is there another solution besides using hidden fields?</p>","449689","","44390","","2011-11-04 15:11:46","2012-11-15 15:40:28","Hidden Field in ListView Android?","<android>","3","0","5","",""
"3737181","1","","","2010-09-17 16:30:57","0","491","<p>Could someone help with a simple PHP script to echo the whole message received with an HTTPPOST.</p><p>I am sending a string from an android app using HTTPPOST and would like to receive as a response the message received by the POST at the server.</p><p>The script that I am using will only echo name value pairs </p><pre><code>echo $_POST('data')</code></pre><p>works when I post form data, but have not figured out how to echo a string. </p><p>Thanks</p>","327415","","","","","2010-09-17 16:34:14","php script to echo a post","<php><android>","2","3","","",""
"3737439","1","3738290","","2010-09-17 17:07:19","5","4051","<p>I am doing authentication with a third-party site that's supposed to redirect back to my app with auth token (OAUTH).</p><p>I have the callback working properly if I open the 3rd party site in a separate browser process via </p><pre><code>this.startActivity(new Intent(Intent.ACTION_VIEW, uri));</code></pre><p>but, if I embed a WebView component in my layout, and open the url in that, the callback does not work. Webview says ""You do not have permission to open myapp://callback?token=...."" and quickly refreshes to ""Web page not available...temporarily down...blah blah""</p><p>Any ideas?</p>","450741","","","","","2013-02-01 04:33:12","Android: Callbacks with WebView component?","<android><callback><webview>","1","0","3","",""
"3737509","1","3737852","","2010-09-17 17:17:11","0","993","<p>When the Eclipse debugger stops due to an exception in my Android project, I can see the exception message in the variables window (e.g., ""null pointer""), but how can I find out what Java code line my app was at when the exception occurred?</p><p>I can see a stack trace in the LH window, but selecting any of them doesn't seem to reveal anything that relates to my code.</p>","446874","","","","","2010-09-17 18:13:52","Finding source line on exception (Android, Eclipse)","<android><eclipse>","1","1","","",""
"3737579","1","3737710","","2010-09-17 17:30:42","12","22008","<p>I want to change the screen brightness programmatically in android.At the moment I use this code: </p><pre><code>WindowManager.LayoutParams lp = getWindow().getAttributes();float brightness=1.0f;lp.screenBrightness = brightness;getWindow().setAttributes(lp);</code></pre><p>But this sample code works on cupcake, not on latest versions. I am using the latest version of SDK.. What is the preferred solution for newer Android Versions?</p>","399046","","114066","","2011-02-07 15:18:36","2013-11-01 04:56:03","changing screen brightness programmatically in android","<android><screen-brightness>","4","0","4","",""
"3737636","1","","","2010-09-17 17:40:54","1","1576","<p>I try to change the frequency of a single soundfile. I managed to do that in android with the SoundPool thing. But the result sounds really bad.So I stepped about the Fourier Transformation - but I am not sure if this is what I am looking for.</p><p>I want to load a single file and change the frequency of that file every time that file is played. So I can create melodies out of one tone. Is that possible with android/java?</p><hr><p>This is the way I managed to do it. With ""bad"" I mean it sounds out of tune.</p><p>If I want to play the next frequency of the note in the file I must multiply it by 2^(1/12). But since it's just a float, I guess it's not precise enough to get the ""real"" frequency of the next note.</p><p>Is there a ""simple"" way to achieve that goal?</p>","451124","","1288","","2011-12-15 11:37:20","2011-12-15 11:37:20","changing the frequency of a soundfile in android","<android><audio><frequency><pitch>","1","1","","",""
"3737666","1","3737712","","2010-09-17 17:48:01","0","101","<p>I am developing a Player application for a radio, I need to implement two app widget players for two radio stations individually.</p><p>Can i implement two app widgets for an application.</p><p>Thank you</p>","341443","","","","","2010-09-17 17:55:26","can i implement two app widgets for an application?","<android>","2","0","","",""
"3738310","1","","","2010-09-17 19:22:48","0","999","<p>HI,</p><p>I would like to know if it is possible to display Arraylist of object's value in setListadapter or SimpleAdapter for listview? </p><p>String ArrayList works fine, I am just trying my luck with Object ArrayList</p><pre><code>ArrayList&lt;userinfo&gt; list = new ArrayList&lt;userinfo&gt;();setListAdapter(new ArrayAdapter&lt;userinfo&gt;(this, R.layout.messages, list)); // list.???userinfo class consist of all the getters and setters.</code></pre><p>String ArrayList(Working Version) @ <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-listview.html</a></p>","409557","","","","","2010-09-17 19:39:13","Possible to displaying Arraylist of object's value in setListAdapter or SimpleAdapter for listview?","<java><android><listview><arraylist><android-arrayadapter>","1","0","","",""
"3738331","1","","","2010-09-17 19:25:02","1","332","<p>I don't want my Activity to be re-created every time the device is rotated, so I've put the android:configChanges=""keyboardHidden|orientation"" tags in my manifest file.</p><p>Is there any disadvantage to this approach? The screen seems to re-layout automatically upon rotation, and everything works well, with the advantage that i don't need to re-initialize all the objects in my activity every time the screen rotates.</p><p>Thanks!</p>","440889","","","","","2011-07-12 00:28:33","android: pros/cons of manually handling config changes","<android>","1","0","0","",""
"3738513","1","","","2010-09-17 19:48:51","3","2578","<p>My HTC Wildfire has built in FM radio plus a application to listen to it.I wish to write a similar application that would stream this live FM radio over bluetooth.I currently cannot find any examples of accessing the tuner.Can anyone help?</p>","245052","","","","","2011-01-22 01:25:40","FM radio source code on android","<android><source-code><radio><htc>","0","1","1","",""
"3738526","1","3738548","","2010-09-17 19:51:26","1","932","<p>I've just upgraded to Eclipse 3.6. I saved Eclipse 3.5 and made a copy of the original workspace.</p><p>I now notice an error in my GPS/mapping application which worked fine in 3.5, when I send a location from the DDMS perspective using the emulator control tab. I have a standard listener:</p><p>onLocationChanged(Location location){...}</p><p>If I break on the first line of this, having sent the lat/lon pair of 53.5/-3.0, then the mLatitude/mLongitude in the location argument have changed to 53.508833/-3.005000 (6 dec places only shown).If I repeat with Eclipse 3.5 operating on the original project in its original workspace, then it's exactly right down to the smallest decimal place. It's exactly the same code in both workspaces.</p><p>The Android SDK is 2.2 in both and the target is Google APIs level 7.</p><p>Would you say this is a bug in the Eclipse 3.6 or the SDK or the plugin?</p><p>I don't think it can be an error on my part, but I'd be happy to be proved wrong. 0.005 of a degree may not sound much but it's 0.3 nautical mile on a great circle.</p>","440010","","440010","","2010-09-18 07:35:18","2010-12-07 16:06:03","Possible bug in Eclipse DDMS emulator control?","<android><eclipse>","1","0","","",""
"3738621","1","3738795","","2010-09-17 20:05:23","0","1672","<p>I have a widget layout xml which sets the src to the delivered android widget 4x1 frame image.Here is the widget layout code.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt; &lt;AbsoluteLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:id=""@+id/tuwidget"" android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;&lt;ImageView android:id=""@+id/tuwidget_img_btn""  android:src=""@drawable/widgetinitial""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" /&gt; &lt;/AbsoluteLayout&gt;</code></pre><p>@drawable/widgetinitial holds the widgetinitial.png image example 4x1 at developer.android.com (AppWidget design guidelines).(4x1_Widget_Frame_Portrait.psd) What I am trying to do is display an image inside the delivered frame instead what happens is the frame image goes away and only the image I am trying to display shows up. How can I display the image inside the bounding box or the background?Any help is much appreciated.</p><p>Another question - I think I saw in a couple of forums AbsoluteLayout is a deprecated feature for Android 2.1 and above. Is that correct? and does using AbsoluteLayout throws any force close or other exceptions?</p>","447886","","","","","2012-08-20 02:49:07","How to display the image inside the android widget background?","<android><xml><appwidget>","2","0","","",""
"3738724","1","3738768","","2010-09-17 20:17:51","2","3549","<p>How can I silence the android phone in java? A code sample is VERY helpful.</p>","200477","","","","","2011-08-18 20:43:26","Silence Android Phone in Java","<java><android><silent>","2","0","5","",""
"3738750","1","","","2010-09-17 20:22:18","1","436","<p>If I use getScanResult() I will be able to get the information about different networks but for example if I am in a school where all access points are under network(SSID) ""The school"". Will getScanResult() filter out other access points than the one it's closest to and only return 1 BSSID for that network?  </p>","451022","","","","","2010-11-10 22:41:00","For a android system, do anyone know or has anyone tried to use getScanResult() to get multiple BSSIDs for 1 network name(SSID)?","<android><android-wifi>","2","0","1","",""
"3738814","1","","","2010-09-17 20:32:19","0","588","<p>We have contracted out an Android app, and our clients are not happy.  Can we do what we want?</p><p>THe scenario is an activity that lists data about an event, and a button to compose the email.  That works.  Except that it always uses the google account on the phone.  Can email be sent in accounts other than the google account outside of the Mail app?</p>","325227","","","","","2010-09-17 21:04:00","send email in android app, choose email address to use","<android><email>","1","0","","",""
"3738886","1","","","2010-09-17 20:43:38","14","78158","<p>i want to change the background-color of a button using a selector-xml-file. My approach is basically the one from the example at the bottom this page: <a href=""http://developer.android.com/guide/topics/resources/color-list-resource.html"">http://developer.android.com/guide/topics/resources/color-list-resource.html</a></p><p>i have a res/color/button_text.xml which looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true""          android:color=""#ffff0000""/&gt; &lt;!-- pressed --&gt;    &lt;item android:state_focused=""true""          android:color=""#ff0000ff""/&gt; &lt;!-- focused --&gt;    &lt;item android:color=""#ff000000""/&gt; &lt;!-- default --&gt;&lt;/selector&gt;</code></pre><p>and my layout contains the following code:</p><pre><code>&lt;Button    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""@string/button_text""    **android:background=""@color/button_text""** /&gt; </code></pre><p>(** is only there to show you that i use android:background instead of android:textcolor)</p><p>this code crashes. it says ""Binary XML file line #4  tag requires 'drawable' attribute or child tag defining drawable. But if I try it with android:textColor as described in the above link it works fine. So it has to be the background issue. I don't want to create a 9patch-png if it's not necessary (basically i just need a ""clickable"" rectangle so i use a button with a colored background)</p>","424514","","","","","2013-01-04 14:39:52","Android button with different background colors","<android><android-layout><android-xml>","4","2","14","",""
"3738945","1","3738980","","2010-09-17 20:51:44","5","316","<p>I began studying android and became curious what is a ROM. There are many pages that offer to download ROMs but what it is exactly from a developer's point of view is not quite clear.</p><p>So what is it?</p><p>Thanks!</p>","135749","","","","","2010-09-17 20:58:48","What exactly is a ROM?","<android>","2","0","","",""
"3738965","1","5555304","","2010-09-17 20:54:42","5","5556","<p>I have a ScrollView which has two hidden images, one at the top and one at the bottom.  In between there is a bunch of visible content.</p><p>What I need to do is make these images hidden by default but when you scroll all the way up or all the way down you could see them as you're scrolling.  But then as soon as you stop scrolling it should bounce back to the visible area so that the hidden images aren't showing.</p><p>Basically I'm trying to imitate the bounce scrolling feature of the iphone UIScrollView.</p><p>I have my ScrollView all setup and I do a scroll at the beginning so as to hide the top hidden image.  Now all I need to do is detect when a scrolling has ended, figure out the Y position,  and check whether a hidden image is shown.  If it is, I would just programmatically scroll the view back so that the hidden image is hidden.</p><p>I hope all that made sense.</p><p>So anyways, I know how to programmatically scroll a ScrollView.  Now what I need is some sort of callback to tell me when a ScrollView ended scrolling and also a way to get the ScrollView's current 'Y' position.  Are there any such methods I could use?</p><p>I looked through the ScrollView docs but nothing jumped out at me.  I'm still not very familiar with the Android naming schemes so maybe I missed something obvious somewhere.</p><p>Anyways, any help would be appreciated here.  Cheers.</p>","316891","","","","","2011-05-20 17:15:25","Android: Detect when ScrollView has finished scrolling and bouncing back?","<android><scrollview><bounce>","1","0","4","",""
"3739081","1","","","2010-09-17 21:14:51","1","526","<p>I have some data in my app that consists of text and image. I want to allow my users to be able to print that data.</p><p>Here are the options that I am thinking of:</p><p>1) Convert data into HTMl format and allow users to email and they can print from their desktop. This will be zip file with html and images. Pros: can be easily coded. Cons: not sure if users will know what to do with zip file.</p><p>2) Convert to PDF. But I have read on forums that iText won't work on Android. So any other options to convert to PDF? Pros: PDF can be easily printed. Cons: have to figure out a way to convert to PDF.</p><p>Anybody has tried allowing their users to print data? What are the options</p>","355614","","","","","2011-01-19 09:48:36","Android: How to let my users print data from the app","<android><printing><pdf-generation>","1","1","1","",""
"3739114","1","","","2010-09-17 21:19:45","0","1087","<p>I am unable to run my app on my android device. While launching the app it gives some IOException and cancel the app launching.</p><p>Like this :(in console)</p><p>[2010-09-18 02:45:53 - Lime] Android Launch![2010-09-18 02:45:53 - Lime] adb is running normally.[2010-09-18 02:45:53 - Lime] Performing com.gtx.gpstrackinglime.splash activity launch[2010-09-18 02:45:57 - Lime] Uploading Lime.apk onto device 'HT923GZ00530'[2010-09-18 02:46:12 - Lime] Failed to upload Lime.apk on device 'HT923GZ00530'[2010-09-18 02:46:12 - Lime] java.io.IOException: Unable to upload file: timeout[2010-09-18 02:46:12 - Lime] Launch canceled!</p>","412168","","68262","","2010-09-17 21:22:15","2012-02-08 13:53:27","Unable to launch app in Android device","<android>","3","1","","",""
"3739132","1","3739183","","2010-09-17 21:22:48","2","2595","<p>My android app creates a MediaPlayer() and plays a looping song.  I need to have it stop playing when the user leaves the app.  I also need to get at the volume buttons somehow, to let users adjust the songs volume...  Any Ideas?  </p><pre><code>MediaPlayer mp;public void setupMediaPlayer(){    mp = MediaPlayer.create(context, R.raw.song);    mp.setLooping(true);    mp.start(); }public void stopMediaPlayer(){    mp.stop();}</code></pre>","449950","","","","","2011-07-25 22:38:49","How to get Android MediaPlayer() to stop when app is closed?","<android>","2","4","","",""
"3739195","1","","","2010-09-17 21:32:10","1","815","<p>I'm writing a simple calculator app for Android but get the error ""savedInstanceState cannot be resolved to a variable"" at the end of the ""onCreate"" method. Any suggestions how to get rid of this error?</p><p>My code looks as follows:</p><pre><code>package se.robert.kalkylator;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.EditText;import android.widget.Button;public class kalkylatorActivity extends Activity { public EditText text; private Button addButton; @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  text = (EditText) findViewById(R.id.displayarea); } // This method is called at button click because we assigned the name to the // ""On Click property"" of the button public void myClickHandler(View view) {  switch (view.getId()) {  case R.id.add://   text.setText(""Add!"");   break;  } }}</code></pre>","451074","","317773","","2011-07-27 20:07:58","2011-07-27 20:07:58","Android error: savedInstanceState cannot be resolved","<android>","0","2","","",""
"3739204","1","3739896","","2010-09-17 21:33:27","0","346","<p>I know you can embed the google maps view in an android activity, but is it possible to plug anything into the actual google maps app.  say if somebody clicked on a result in the map, and instead of the standard screen show a list of options, like when you share an image.  Like ""tag this"".  Something like that.</p><p>I can't seem to find any info on that.  Its all on integrating MapView into your app.</p>","227313","","","","","2010-09-18 00:37:29","Does google maps in android allow any integration? Say long press on a point, or click an address","<android><google-maps>","1","0","","",""
"3739415","1","3739913","","2010-09-17 22:09:25","0","331","<p>I asked this a while back and didn't get anything useful. I'm hoping now that Android has advanced a few releases, that there will be more options. Here are the things I'm trying to accomplish:</p><ol><li>Prompt for a PIN when you uninstall a particular app. This would have been set at install time by the user.</li><li>Disable certain services (text, phone). What would be even better is if I could be selective about it instead of just turning the radios off. For example:</li></ol><p>a. intercept outgoing call, is it to one of a few allowed numbers?, yes    => allow it, no => deny</p><p>b. intercept incoming call, is it from one of a few allowed numbers, yes =>    allow it, no => to voicemail</p><p>c. intercept incoming text, is it from one of a few allowed numbers, yes =>    allow it, no => queue up for later    delivery</p><p>d. intercept outgoing text, is it to one of a few allowed numbers, yes =>    allow it, no => deny</p><p>Is this sort of thing possible using Android? I thought I would ask on her for advice prior to going digging around in the SDK since I don't know much about Android in general. How about with iPhone OS?</p><p>This is for an app that a parent would install on their child's phone to limit functionality in certain scenarios.</p><p>Thank you,</p><p>Tom</p>","88847","","88847","","2010-09-17 22:13:15","2010-09-18 00:43:20","Android or iPhone OS - Programmatically enabling/disabling certain functionality","<iphone><android><design>","1","2","","",""
"3739661","1","3739853","","2010-09-17 23:06:25","86","44562","<p>I'm new to Android development and I've been having an issue that I haven't been able to fix. I'm mostly using code from examples provided in the SDK so I'm not sure what's happening here. I'm simply trying to create a custom view GhostSurfaceCameraView that extends SurfaceView. Here's my class definition file GhostSurfaceCameraView.java:</p><pre><code>public class GhostSurfaceCameraView extends SurfaceView implements SurfaceHolder.Callback { SurfaceHolder mHolder; Camera mCamera; GhostSurfaceCameraView(Context context) {  super(context);  // Install a SurfaceHolder.Callback so we get notified when the  // underlying surface is created and destroyed.  mHolder = getHolder();  mHolder.addCallback(this);  mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) {  // The Surface has been created, acquire the camera and tell it where  // to draw.  mCamera = Camera.open();  try {   mCamera.setPreviewDisplay(holder);  } catch (IOException exception) {   mCamera.release();   mCamera = null;   // TODO: add more exception handling logic here  } } public void surfaceDestroyed(SurfaceHolder holder) {  // Surface will be destroyed when we return, so stop the preview.  // Because the CameraDevice object is not a shared resource, it's very  // important to release it when the activity is paused.  mCamera.stopPreview();  mCamera.release();  mCamera = null; } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {  // Now that the size is known, set up the camera parameters and begin  // the preview.  Camera.Parameters parameters = mCamera.getParameters();  parameters.setPreviewSize(w, h);  parameters.set(""orientation"", ""portrait"");  // parameters.setRotation(90); // API 5+  mCamera.setParameters(parameters);  mCamera.startPreview(); }}</code></pre><p>And this is in my ghostviewscreen.xml:</p><pre><code>&lt;com.alpenglow.androcap.GhostSurfaceCameraView android:id=""@+id/ghostview_cameraview""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""/&gt;</code></pre><p>Now in the activity I made: </p><pre><code>protected void onCreate(Bundle savedInstanceState) {  try  {   super.onCreate(savedInstanceState);         setContentView(R.layout.ghostviewscreen);  }</code></pre><p>When setContentView gets called, an exception is thrown: </p><blockquote>  <p>Binary XML file 09-17 22:47:01.958: ERROR/ERROR(337):  ERROR IN CODE:  android.view.InflateException: Binary  XML file line #14: Error inflating  class  com.alpenglow.androcap.GhostSurfaceCameraView</p></blockquote><p>Can anyone tell me why I get this error? Thanks</p>","451119","","","","","2014-04-01 10:22:36","Android: Error inflating class","<android><xml><class><surfaceview>","2","0","20","",""
"3739737","1","3808416","","2010-09-17 23:35:07","8","2793","<p>I found this <a href=""https://sites.google.com/site/androiddevtesting/"">example</a> where they used PowerMock and EasyMock to stub/mock the Menu and MenuItem classes for android. I have been trying to do something similar with PowerMock and Mockito with the Activity class. </p><p>I understand that a lot of the methods are final and that in the Android.jar they all just throw RuntimeException(""Stub!"").</p><p>I also understand that this test isn't complete but I just wanting to see if it is possible to mock the android Activity class.</p><p>But given that PowerMock allows you to mock classes with final methods shouldn't this code work?</p><pre><code>@RunWith(PowerMockRunner.class)@PrepareForTest(Activity.class)public class MyTestCase extends TestCase {    public void testPlease_JustWork() throws Exception {        Activity mockActivity = PowerMockito.mock(Activity.class);        PowerMockito.when(mockActivity.getTitle()).thenReturn(""Title"");    }}</code></pre><p>I would think that the RuntimeException would no longer occur and ""Title"" would be returned but it still throws the exception. </p><p>I have tried all sorts of different things like <code>doReturn(""Title"").when(mockActivity).getTitle();</code> and <code>suppress(constructor(Activity.class));</code> </p><p><strong>Am I doing something wrong or is this just not possible?</strong></p>","86452","","","","","2011-10-17 18:37:57","Attempt to stub android Activity class using PowerMockito throws RuntimeException ""Stub!""","<android><unit-testing><junit><mockito><powermock>","3","0","4","",""
"3739829","1","","","2010-09-18 00:00:34","3","3131","<p>I know how to display it in the screen, but when I use the Contacts app in my phone, I found its alphabet section header can be fixed in the top when I scroll the list.</p><p>How to make that happen?</p>","238061","","508666","","2014-01-12 03:20:20","2014-01-12 03:20:20","How to draw a section header in Android listview just like the Contacts app did ?","<android><listview><header>","2","0","2","",""
"3739938","1","3739984","","2010-09-18 00:53:52","2","681","<p>I'd like to show a large green arrow in front of all other views when the user clicks a button. The arrow should fade in, stay there for 1-2 seconds and fade out again. How would I go about programming this? I've looked at the animation examples but would like to confirm the way forward before I dive into programming something that won't work :-):</p><ol><li>Draw the arrow-image as a bitmap, immediately make it invisible</li><li>Fade it in (""alpha""-change animation) </li><li>Let it stay for 2 seconds</li><li>Fade it out (again, ""alpha""-change animation)</li></ol><p>Is this correct, or would you suggest something else?</p><p>""Mockup"": <a href=""http://screencast.com/t/MTMzZmVhNj"" rel=""nofollow"">http://screencast.com/t/MTMzZmVhNj</a></p>","241189","","244296","","2010-09-18 01:06:02","2010-09-18 01:17:38","UI Animation (Showing an arrow on top of everything else)","<android>","1","2","2","",""
"3740072","1","3742561","","2010-09-18 01:53:49","0","267","<p>What is the name of the view that is used to display options in the latest android contacts app?</p><p>It's the one that after clicking on a contact picture slides in displays a few options in a horizontal line.</p>","118241","","","","","2010-09-18 16:51:05","Android Bouncing Options View?","<android><view><views>","1","0","","",""
"3740077","1","3740146","","2010-09-18 01:57:40","8","6825","<p>This is just a quick question before I dive deeper into converting my current rendering system to openGL. I heard that textures needed to be in base 2 sizes in order to be stored for rendering. Is this true? </p><p>My application is very tight on memory, but most of the bitmaps are not powers of two. Does storing non-base 2 textures consume more memory?</p>","118241","","118241","","2011-10-13 19:11:29","2012-12-11 16:44:58","Can OpenGL ES render textures of non base 2 dimensions?","<android><opengl-es><textures>","4","2","4","",""
"3740100","1","3740463","","2010-09-18 02:09:05","5","12035","<p>I'm trying to set the z order of a UI element (i.e. a View) so that it will overlap another element, but calling ViewGroup.bringChildToFront() has a weird side effect....it moves the element to be the last item in the parent (the ViewGroup).  Is this a bug, expected behavior, or what?  More importantly, how can I set the z order or a View without this unfortunate side effect?</p>","226507","","","","","2012-11-11 17:14:55","setting z order of View with bringChildToFront()","<android>","3","0","","",""
"3740103","1","3741100","","2010-09-18 02:09:20","1","2546","<p>I'm sending a C2DM update to my Android app every 1/2 hour, which creates a Notification. Problem is, when I wake up in the morning I get 15 Notifications queued up in the status bar. </p><p>How do I only keep the latest notification, overwriting previous ones?</p><p>I tried looking at the C2DM documentation (http://code.google.com/android/c2dm/) which mentions a parameter called collapse_key, but I couldn't find an explanation for how to use it, nor am I sure the solution lies on the C2DM side.</p><p>Thanks!</p>","269238","","269238","","2010-09-18 03:14:06","2011-03-18 01:18:51","How to collapse Android notifications?","<android><push-notification><android-c2dm>","3","1","","",""
"3740223","1","3741619","","2010-09-18 03:04:14","1","1463","<p>I'm trying to use a service to make a regular call to my API. The asynchronous class I use to make external HTTP calls returns information to a handler which is passed in.</p><p>A simplified version below dies on the line where the Handler is instantiated (without a stack trace). Any idea why? Is there a better way I should be doing this?</p><pre><code>package com.fred.services;import java.util.Timer;import java.util.TimerTask;import android.app.Service;import android.content.Intent;import android.os.Handler;import android.os.IBinder;import android.util.Log;public class NotificationService extends Service {    private static final String TAG = ""com.fred.services NotificationService"";    public long delay = 0;    public long period_in_minutes = 10;    public long period = 1000*60*period_in_minutes;    private Timer timer = null;    private TimerTask task = new TimerTask() {        @Override        public void run() {            Handler h;            Log.i(TAG, ""now you see it"");            h = new Handler();            Log.i(TAG, ""now you don't"");        }    };    @Override    public void onCreate(){        super.onCreate();        if (timer == null) startservice();    }    private void startservice() {        if (timer == null) timer = new Timer();        timer.scheduleAtFixedRate(task, delay, period);    }    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }}</code></pre>","348502","","","","","2011-02-19 16:36:24","Android: Instantiate a Handler in a TimerTask within a Service","<android><android-service>","1","0","3","",""
"3740228","1","3740260","","2010-09-18 03:05:57","3","12782","<p>I'm making my first Android application.  As a toy problem to learn the system I want to make a simple app that display as text which direction the phone is pointing using the built in compass.</p><p>How do I access the compass from my code, and have my code be aware of direction changes?</p><p>I believe I'll need the <a href=""http://developer.android.com/reference/android/hardware/SensorManager.html"" rel=""nofollow"">SensorManager class</a> but I'm confused how to use it.  How do I tell it I want the compass sensor?  How do I tell it to do an action (update text) on a direction change?</p>","13009","","","","","2013-04-23 12:04:57","First Android App - How to Access the Compass","<android><compass-geolocation>","2","1","4","",""
"3740458","1","3740509","","2010-09-18 05:04:50","3","2770","<p>Hello In my android application,i would like to place a progress bar such that it shows the user that the data is getting downloaded  and gets dismissed once the data is loaded.</p><p>Is there any way that i can achieve this.</p><p>Thanks in advance:)</p>","420261","","","","","2010-09-20 11:06:35","Insert progress spinner into splashscreen android","<android>","1","0","1","",""
"3740487","1","","","2010-09-18 05:17:18","1","392","<p>I'm not a software developer, but I have done enough reading online to get the Android SDK, Eclipse, and the necessary downloads to get it all working.  </p><p>I am able to capture device screenshots using the DDMS, but I need to capture full motion video of the system OS and apps for an Android TV commercial.  </p><p>So far I've called the manufacturer and several software guys, but haven't had any luck.  I've even tried the HDMI out, but it's not pixel accurate, which is very important.  </p><p>There has to be a way to do this, since the apps are featured in other commercials and videos, and I don't believe that the only way to do it is to film the device's screen.  </p><p>No matter how complex the answer and solution to this might be, I'd love to find out.  Even if it means bringing on someone to execute it.  </p><p>THANKS IN ADVANCE!</p><p>EDIT: It needs to be at least a 20-30 fps capture.</p>","451231","","451231","","2010-09-18 05:54:07","2014-03-27 11:58:43","Video producer needs help capturing full motion screen casts on Android device","<android><video-capture><tablet>","2","0","1","",""
"3740491","1","","","2010-09-18 05:18:20","0","718","<p>Basically, we are maintaining the sessions for the specific user's environment. For that, Three basic stuff we have to maintain. That are Login, Session check and Logout.</p><p>In Android, Each screen designed by Activity. we can <code>startActivity()</code> and <code>finish()</code> a current Activity. But you can not do that Previous Activity.</p><p><strong>UI Design of APP:</strong></p><p>Login(Main Activity)-->Home(Child Activity)-->It contains Profile, add data, settings,etc.(Sub Child Activity). All Screen has a Logout option in Menu.</p><p><strong>The Problem is:</strong> </p><p>When i select a Logout. The App gets Logout. But I can not navigate the App to the Login Screen. The Previous child Activity did not finished from the Activity Stack. </p><p>Any Idea to Achieve this? Its Most Thankful.</p>","267269","","267269","","2010-09-20 05:23:56","2010-09-20 06:20:38","Activities Design in Android?","<android><activity>","1","1","","",""
"3740507","1","3741870","","2010-09-18 05:27:57","1","1305","<p>I am not able to get,</p><p>What is the purpose of Creating the MulticastLock used with WifiManager in android.</p><p>Can any body clarify me what exactly it means and when to use...</p><p>Any help much appreciated..</p><p>thanks rakesh</p>","1386533","","42346","","2010-09-18 05:33:33","2011-03-31 20:03:03","WifiManager: Android","<android><wifimanager>","2","0","","",""
"3740534","1","3740993","","2010-09-18 05:40:49","0","712","<p>i developed one app it is displaying image and play audio along with the image.for this application i want to get images and audio files from remote server and store those on inside apk</p><p>1) i heard about sqllite in mobile.is this database hold image,mp3 files 2) i dont want to store images sd card </p><p>Thanks in adavance</p><p>Aswan</p>","1746300","","","","","2010-09-18 08:51:57","store remote images and audio files in android","<android>","1","0","","",""
"3740537","1","3744128","","2010-09-18 05:42:36","0","233","<p>I've adapted the <code>GridInputProcessor</code>-class of the 3D-Gallery ( <a href=""http://android.git.kernel.org/?p=platform/packages/apps/Gallery3D.git;a=blob;f=src/com/cooliris/media/GridInputProcessor.java;h=91dfd4783be6b21ec8ff2518a5c244752570e90d;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Gallery3D.git;a=blob;f=src/com/cooliris/media/GridInputProcessor.java;h=91dfd4783be6b21ec8ff2518a5c244752570e90d;hb=HEAD</a> ) so that it detects upward/downward swipes.</p><p>The detection of swipes works, but I now want to start another activity (or draw a bitmap on the currently displayed activity), but I seemingly can't use <code>startActivity(mContext, myIntent)</code>, because the class declaration is<code>public final class GridInputProcessor implements GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener {</code>so it doesn't extend <code>Activity</code>...</p><p>Can I still start an Activity through this class, or how would I go about doing this? I have also tried sending a broadcast, but this is also not ""implemented"".</p><p>Thanks,Nick</p>","241189","","","","","2010-09-19 01:05:47","Starting an activity from a random class","<android>","1","0","","",""
"3740542","1","3740674","","2010-09-18 05:43:46","1","771","<p>I am getting this error while trying to Parse the Xml response from the Web Service by SAX Parser in Android.</p><pre><code>ERROR in LogCat :- "" Response =====&gt; org.xml.sax.InputSource@43b8e230 "" </code></pre><p>I got to know that I need to convert the response in String may be by toString() Method, but the problem is I don't know how to do that as I had tried all the possible ways I knew for conversion but nothing happened.</p><p>In InputSource I am passing the url:- </p><pre><code>URL url = new URL(""http://www.google.com/ig/api?weather=Ahmedabad"");SAXParserFactory spf = SAXParserFactory.newInstance();SAXParser sp = spf.newSAXParser();XMLReader xmlr = sp.getXMLReader();DemoHandler myDemoHandler = new DemoHandler();xmlr.setContentHandler(myDemoHandler);xmlr.parse(new InputSource(url.openStream()));Log.e(TAG, ""Condition""); System.out.println(""Response ====&gt; "" + new InputSource(url.openStream().toString()));ParsedDemoData parsedDemoData = myDemoHandler.getParsedData();</code></pre><p>Everything is fine but the response I am getting needs to be converted into String which I don't know how to do.</p><p>Can anyone please help in this.</p><p>Thanks,david</p>","422859","","140185","","2010-09-18 05:53:25","2010-09-18 06:45:58","Xml Parsing Error","<android><xml><parsing>","1","0","0","",""
"3740557","1","3740568","","2010-09-18 05:53:26","2","428","<p>i'm new to android and i would like to know about these api's..</p><p>wen i was browsing the developers guide i found out some thing like Api 1,Api 2,Api 7......etc</p><p>what are these Api's and the purpose of their presence.....</p>","438864","","","","","2010-09-18 05:59:25","What are these API's?","<android>","1","1","2","",""
"3740580","1","3781437","","2010-09-18 06:06:11","1","501","<p>I have a Widget i am working on, that allows the user to have more then one instance of the widget on his screen. Each Widget id maintains its own configuration file. However for some odd reason my code that is responsible for setting up the buttons individually for each widget id is not working, only the first widget id is linked to each individual widget. below is the code that is responsible. Can anyone see where the problem is?</p><pre><code>private void TieClicks(Context context){  RemoteViews rViews;  PendingIntent editPendingIntent= null;//  Intent updateintent = new Intent(context,SyncNoteWidget.class);//  updateintent.setAction(SyncNote_Action_Widget_Update);//  PendingIntent pendingupdateintent = PendingIntent.getBroadcast(context, 0, updateintent, 0);//  rViews.setOnClickPendingIntent(R.id.widgettextview , pendingupdateintent);//    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);  int[] ids = appWidgetManager.getAppWidgetIds(new ComponentName(context, SyncNoteWidget.class));  for (int i =0;i&lt; ids.length;i=i+1){   int wId = ids[i];   rViews = new RemoteViews(context.getPackageName(),R.layout.widget);   editPendingIntent = makeControlPendingIntentActivity(context, wId);   Log.v(""syncnote"", ""tieing "" + String.valueOf(wId));   rViews.setOnClickPendingIntent(R.id.widgeteditbutton , editPendingIntent);   appWidgetManager.updateAppWidget(wId, rViews);   editPendingIntent= null;  } } private PendingIntent makeControlPendingIntentActivity(Context context,int appWidgetId) {     Intent active = new Intent(context, EditNote.class);     active.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK );     active.setAction(com.ntu.way2fungames.syncnote.SyncNoteWidget.SyncNote_Action_Edit);      active.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);     return(PendingIntent.getActivity(context, 0, active, 0 ));    }</code></pre>","263111","","263111","","2010-09-20 03:25:34","2012-04-05 12:38:19","How to tie specific pending intents to specific buttons on specific widgets on a multi-widget.. appwidget?","<android><widget><appwidget>","2","0","4","",""
"3740597","1","3740672","","2010-09-18 06:14:27","8","705","<p>Is it somehow possible to use the Delphi language (or Prism if absolutely necessary) to develop programs for the Android platform ?</p><p>Any starting point ?</p>","231181","","976391","","2013-04-19 13:02:02","2013-05-29 06:05:57","Has anyone done or does anyone knows of a way to use Delphi/Prism to develop for the Android os?","<android><delphi><delphi-prism><oxygene>","5","0","4","",""
"3740784","1","3740963","","2010-09-18 07:39:13","0","4527","<p>how to store image and audio files in android internal storage</p><p>and how to retrieve back to display image imageview </p><p>Thanks in advance</p><p>Aswan </p>","1746300","","","","","2010-11-04 06:21:53","store image and audio file in android internal storage","<android>","1","0","0","",""
"3740815","1","3741066","","2010-09-18 07:55:28","0","864","<p>I know there are plenty of tutorials about integrating C++ into Java, but whats about the other way around, a Bridge from Java to C++?</p><p>The reason i'm asking this is <a href=""http://www.android.com/"" rel=""nofollow"">Android</a>.</p><p>Every C++ developer who wanted to write applications for the android noticed at some point that there is no serious (mature) C++ api for android (infact, android is lacking an implementation of the STL).</p><p>The only API that is mature enough to write android applications in, is Java. So instead of writing an api from scratch, wouldn't it be possible to use the Java Classes from C++?</p><p>I know that this sounds merely like an unrealistic dream, but that way most C++ developers weren't forced to learn a new Language.</p>","","user350814","","","","2010-09-18 09:19:18","Java to C++ bridge?","<java><c++><android>","2","2","","",""
"3740842","1","","","2010-09-18 08:05:01","2","972","<p>Please help me, now I am developing a screen saver by let the user input the string and I will bring this string to print out as a 3d string on the android mobile phone. Please suggest me in the android have function to do this or I have to use <code>openGL ES</code> to develop and how to do that.</p>","451281","","750613","","2012-06-26 05:23:34","2012-08-01 15:12:20","How to print 3d string in android","<android><opengl-es><3d>","2","0","","",""
"3740859","1","3741053","","2010-09-18 08:13:13","2","304","<p>I've been reading the android documentation on reflection, but i'm just not really grasping how to actually use it. Is it multiple class files i'll have to create? Is it breaking it up to certain parts all in the same class file? I want to understand it, I really do, but I just don't get it. </p><p>Anyway, I have this simple webview code that wants to use the new geolocation code from SDK7 but it makes 1.5 and 1.6 phones crash. I really want to be able to make this java class work (as in at least loading the html) even if the geolocation won't work prior to sdk7.  I've put comments around all the code the has a red line under it in eclipse when the SDK is under 7. Would someone mind showing me with my code how exactly to use reflection? I'd really appreciate it. I've read the bogs and documents and everything i try after reading them doesn't work.</p><pre><code>    package com.my.app;    import com.facebook.android.R;    //NEEDS TO BE IGNORED**********************************************************    import android.webkit.GeolocationPermissions;    import android.webkit.GeolocationPermissions.Callback;    //END**************************************************************************    import android.app.Activity;    import android.app.ProgressDialog;    import android.content.Intent;    import android.net.Uri;    import android.os.Bundle;    import android.util.Log;    import android.view.KeyEvent;     import android.view.Menu;    import android.view.MenuInflater;    import android.view.MenuItem;    import android.webkit.CookieSyncManager;    import android.webkit.WebChromeClient;    import android.webkit.WebView;    import android.webkit.WebViewClient;    import android.widget.Toast;    //GeolocationPermissionsCallback NEEDS TO BE IGNORED**********************************************************    public class Places extends Activity implements GeolocationPermissions.Callback{             private ProgressDialog progressBar;            public WebView webview;            private static final String TAG = ""Main"";            String geoWebsiteURL = ""http://google.com"";            @Override              public void onStart()            {               super.onStart();                CookieSyncManager.getInstance().sync();            }        public void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.main);            CookieSyncManager.createInstance(this);            CookieSyncManager.getInstance().startSync();            webview = (WebView) findViewById(R.id.webview);            webview.setWebViewClient(new testClient());            webview.getSettings().setJavaScriptEnabled(true);            webview.getSettings().setPluginsEnabled(true);            webview.loadUrl(""http://google.com"");            progressBar = ProgressDialog.show(Places.this, """", ""Loading Page..."");            //START GROUP OF CODE THAT NEEDS TO BE IGNORED************************************************************            webview.getSettings().setGeolocationEnabled(true);            GeoClient geo = new GeoClient();            webview.setWebChromeClient(geo);                }        public void invoke(String origin, boolean allow, boolean remember) {        }        final class GeoClient extends WebChromeClient {        @Override        public void onGeolocationPermissionsShowPrompt(String origin,        Callback callback) {        super.onGeolocationPermissionsShowPrompt(origin, callback);        callback.invoke(origin, true, false);        }    //END OF CODE THAT NEEDS TO BE IGNORED************************************************}        private class testClient extends WebViewClient {             @Override             public boolean shouldOverrideUrlLoading(WebView view, String url) {                Log.i(TAG, ""Processing webview url click..."");                view.loadUrl(url);                return true;              }            public void onPageFinished(WebView view, String url) {                Log.i(TAG, ""Finished loading URL: "" +url);                if (progressBar.isShowing()) {                    progressBar.dismiss();                }                if (url.startsWith(""mailto:"") || url.startsWith(""geo:"") ||                        url.startsWith(""tel:"")) {                                                    Intent intent = new Intent                        (Intent.ACTION_VIEW, Uri.parse(url));                                                    startActivity(intent);                        }            }        }            public boolean onKeyDown(int keyCode, KeyEvent event) {                 if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; webview.canGoBack()) {                     webview.goBack();                     return true;                 }                    if (keyCode == KeyEvent.KEYCODE_SEARCH) {                        Intent z = new Intent(this, Search.class);                        startActivity(z);                      }                  return super.onKeyDown(keyCode, event);                  }            public boolean onCreateOptionsMenu (Menu menu) {                super.onCreateOptionsMenu(menu);                MenuInflater inflater = getMenuInflater();                inflater.inflate(R.menu.menu, menu);                return true;            }        @Override        public boolean onOptionsItemSelected (MenuItem item) {                switch (item.getItemId()) {                case R.id.home:                    Intent m = new Intent(this, Home.class);                    startActivity(m);                    return true;                case R.id.refresh:                    webview.reload();                    Toast.makeText(this, ""Refreshing..."", Toast.LENGTH_SHORT).show();                    return true;        }        return false;            }        public void onStop()        {           super.onStop();    CookieSyncManager.getInstance().sync();        }    }</code></pre>","393373","","422597","","2010-09-18 08:20:10","2010-09-18 09:13:02","Need help with using reflection for backwards compatability","<java><android><reflection><backwards-compatibility>","1","0","1","",""
"3741147","1","7210068","","2010-09-18 09:47:47","2","12340","<p>I'm new to Android development and I can't seem to find a good guide on how to use an <code>onKeyUp</code> listener.</p><p>In my app, I have a big <code>EditText</code>, when someone presses and releases a key in that <code>EditText</code> I want to call a function that will perform regular expressions in that <code>EditText</code>.</p><p>I don't know how I'd use the onKeyUp. Could someone please show me how?</p>","427234","","1318946","","2013-10-10 10:55:12","2013-10-10 10:55:12","Android Development: How To Use onKeyUp?","<java><android><onkeyup>","4","0","","",""
"3741156","1","","","2010-09-18 09:49:48","2","226","<p>I am trying to invoke opencv library from my android code. </p><p>I previously stored my haar xml under the /data/data/org.siprop.opencv/files/ directory and passed this file path (i.e. /data/data/org.siprop.opencv/files/haarcascade_frontalface_alt.xml) to the opencv library. This xml was successfully read by the opencv code. </p><p>But I noticed that these xml files were not packaged in the .apk file which meant I would have a problem when distributing the same. </p><p>I hence tried storing these haar xmls in the assets/files folder. Now the files were included in the .apk file but i could not locate this in the emulator via the DDMS file explorer. So not sure what file path can I pass back to the opencv library. </p><p>Can you please let me know where am i going wrong?</p>","449493","","","","","2010-09-18 09:49:48","File sharing between android and opencv","<android><communication><native>","0","2","","",""
"3741224","1","","","2010-09-18 10:06:59","1","629","<p>I designed an app for htc desire. The background image used for the app looks good in Eclipse layout, when installed in phone it is stretched.</p>","451320","","387076","","2012-05-12 20:24:30","2012-05-12 20:24:30","Distorted background image on HTC Desire","<background-image><aspect-ratio><android>","2","1","","",""
"3741250","1","3741322","","2010-09-18 10:12:58","2","1328","<p>I'm trying to delete a bookmark using contentResolver.delete() and I get force close for missing permission ""<strong>com.android.broswer.permission.WRITE_HISTORY_BOOKMARKS</strong>"" but it's in the manifest...</p><p><strong>this is in the manifest (outside <code>&lt;application&gt;&lt;/application&gt;</code>)</strong></p><pre><code>&lt;uses-permission android:name=""com.android.browser.permission.READ_HISTORY_BOOKMARKS""&gt;&lt;/uses-permission&gt;    &lt;uses-permission android:name=""com.android.broswer.permission.WRITE_HISTORY_BOOKMARKS""&gt;&lt;/uses-permission&gt;</code></pre><p><strong>this is the method:</strong></p><pre><code>public void deleteBookmark(Cursor cur, long id) {        getContentResolver().delete(BOOKMARKS_URI, ""_id = "" + id, null);    }</code></pre><p>(ignore the unused Cursor)</p><p><strong>and this is the logcat:</strong></p><pre><code>E/AndroidRuntime(26750): FATAL EXCEPTION: mainE/AndroidRuntime(26750): java.lang.SecurityException: Permission Denial: writing com.android.browser.BrowserProvider uri content://browser/bookmarks from pid=26750, uid=10001 requires com.android.browser.permission.WRITE_HISTORY_BOOKMARKSE/AndroidRuntime(26750):        at android.os.Parcel.readException(Parcel.java:1260)E/AndroidRuntime(26750):        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:160)E/AndroidRuntime(26750):        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)E/AndroidRuntime(26750):        at android.content.ContentProviderProxy.delete(ContentProviderNative.java:472)E/AndroidRuntime(26750):        at android.content.ContentResolver.delete(ContentResolver.java:675)E/AndroidRuntime(26750):        at com.deleteBookmark(.java:167)E/AndroidRuntime(26750):        at com.onContextItemSelected(.java:138)E/AndroidRuntime(26750):        at android.app.Activity.onMenuItemSelected(Activity.java:2199)E/AndroidRuntime(26750):        at com.android.internal.policy.impl.PhoneWindow$ContextMenuCallback.onMenuItemSelected(PhoneWindow.java:2744)E/AndroidRuntime(26750):        at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)E/AndroidRuntime(26750):        at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)E/AndroidRuntime(26750):        at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:137)E/AndroidRuntime(26750):        at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:875)E/AndroidRuntime(26750):        at android.widget.AdapterView.performItemClick(AdapterView.java:284)E/AndroidRuntime(26750):        at android.widget.ListView.performItemClick(ListView.java:3382)E/AndroidRuntime(26750):        at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)E/AndroidRuntime(26750):        at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime(26750):        at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime(26750):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(26750):        at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(26750):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(26750):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(26750):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(26750):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(26750):        at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Any idea why it says Permission Denial when it's clearly in the manifest? Maybe my code is the problem?</p>","444324","","750613","","2012-06-26 05:21:11","2013-06-18 10:44:05","Android: Force closing for lack of permission which is located in the manifest","<android><android-manifest>","2","0","1","",""
"3741291","1","3741439","","2010-09-18 10:21:20","4","465","<p>I want to simulate Memory in android programmatically..That is i want to generate an low memory alert when i click on button in my activity..is there any way to do this..?is there any way to limit memory in android..?</p><p>if u had any ideas please let me know..</p><p>Thanks in advance..</p>","399046","","750613","","2012-06-26 05:21:46","2012-06-26 05:21:46","Memory simulation in android","<android><memory><memory-management>","1","0","","",""
"3741458","1","3741643","","2010-09-18 11:11:34","0","2980","<p>I'm trying to implement a simple activity that will let user to insert a password.I've a gridview with the 9 images to use and 4 imageviews that will be the selected images (on clicking on item on gridview, the corresponding image will be filled with the selected one).</p><p>Now the problem: I want that the 4 imageviews acts similar to password fields: for 1 seconds appears the selected item and then another image...I tried using asyncthread but I got and error: <strong>Only the original thread that created a view hierarchy can touch its views</strong> Here my code:</p><pre><code>@Overrideprotected String doInBackground(ImageView... imageViews) {    ImageView passField1 = imageViews[0];    ImageView passField2 = imageViews[1];    ImageView passField3 = imageViews[2];    ImageView passField4 = imageViews[3];    try {        switch (currentField) {        case 1:            passField1.setImageResource(//selected recource on grid view);            Thread.sleep(1000);            passField1.setImageResource(R.drawable.e00); //this is a blank image            break;        case 2:            passField2.setImageResource(//selected recource on grid view);            Thread.sleep(1000);            passField1.setImageResource(R.drawable.e00);            break;        case 3:            passField3.setImageResource(//selected recource on grid view);            Thread.sleep(1000);            passField1.setImageResource(R.drawable.e00);            break;        case 4:            passField4.setImageResource(//selected recource on grid view);            Thread.sleep(1000);            passField1.setImageResource(R.drawable.e00);            break;        }    } catch (InterruptedException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    return null;}</code></pre>","451339","","","","","2011-06-15 12:00:56","Change ImageView after few seconds","<android><asynchronous><imageview>","2","0","","",""
"3741474","1","3741807","","2010-09-18 11:16:15","0","1028","<p>I was trying to implement the EventLogTags in my application (building for API level 4)but couldn't get it to work. Actually i am trying to listen to the ""ActivityManager"" Log Taglike this</p><pre><code>EventLogTags event = new EventLogTags();EventLogTags.Description desc = event.get(""ActivityManager"");Log.i(tag,desc.mTag);</code></pre><p>Logging is done just to ensure i am getting the desc object properly.</p><p>But it is causing FC in the APP</p>","388044","","","","","2010-09-18 13:09:04","Android: Reading EventLog","<android>","1","0","","",""
"3741586","1","3741627","","2010-09-18 11:49:43","0","564","<p>I am use OpenHttpConnection(URL) method to connect internet in my android application. But getting ""java.io.IOException:Error Conneting"".How i can avoid this. Permissions in android manifest had given.Please help me .Thank you.   </p>","436765","","","","","2010-09-18 12:02:37","Getting Exception while Connecting to Internet in android","<android>","1","0","","",""
"3741612","1","","","2010-09-18 11:56:43","3","1625","<p>I am getting following error while updating my twitter status from java code in android using Twitter4J .</p><p>Any help will be appreciated.....</p><pre><code>09-18 11:34:50.476: WARN/System.err(755): TwitterException{exceptionCode=[15bb6564-00e4d61f], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.5-SNAPSHOT(build: d372a51b9b419cbd73d416474f4a855f3e889507)}09-18 11:34:50.476: WARN/System.err(755):     at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:308)09-18 11:34:50.496: WARN/System.err(755):     at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:72)09-18 11:34:50.496: WARN/System.err(755):     at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:103)09-18 11:34:50.496: WARN/System.err(755):     at twitter4j.Twitter.updateStatus(Twitter.java:500)09-18 11:34:50.496: WARN/System.err(755):     at com.android.twitterTest.twitterTest.postUpdate(twitterTest.java:115)09-18 11:34:50.510: WARN/System.err(755):     at com.android.twitterTest.twitterTest$1.onClick(twitterTest.java:50)09-18 11:34:50.510: WARN/System.err(755):     at android.view.View.performClick(View.java:2408)09-18 11:34:50.510: WARN/System.err(755):     at android.view.View$PerformClick.run(View.java:8816)09-18 11:34:50.510: WARN/System.err(755):     at android.os.Handler.handleCallback(Handler.java:587)09-18 11:34:50.536: WARN/System.err(755):     at android.os.Handler.dispatchMessage(Handler.java:92)09-18 11:34:50.536: WARN/System.err(755):     at android.os.Looper.loop(Looper.java:123)09-18 11:34:50.536: WARN/System.err(755):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-18 11:34:50.536: WARN/System.err(755):     at java.lang.reflect.Method.invokeNative(Native Method)09-18 11:34:50.536: WARN/System.err(755):     at java.lang.reflect.Method.invoke(Method.java:521)09-18 11:34:50.536: WARN/System.err(755):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-18 11:34:50.536: WARN/System.err(755):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-18 11:34:50.536: WARN/System.err(755):     at dalvik.system.NativeStart.main(Native Method)09-18 11:34:50.596: INFO/Exception(755): TwitterException{exceptionCode=[15bb6564-00e4d61f], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.5-SNAPSHOT(build: d372a51b9b419cbd73d416474f4a855f3e889507)}09-18 11:36:38.517: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol09-18 11:41:38.527: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol09-18 11:42:49.207: DEBUG/ThrottleService(60): onPollAlarm - roaming =false, read =0, written =0, new total =009-18 11:46:38.530: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre>","405521","","65977","","2010-09-19 00:47:55","2012-12-13 16:04:47","Android Twitter4j Error","<android><twitter4j>","2","4","","",""
"3741751","1","3741760","","2010-09-18 12:50:39","0","208","<p>Hi I wounder if itpossible to have a view inside of a view, Iam going to have a toolbar on my android app,, and this toolbar is going to be shown in many activites, so I have xmlfile for each of the activites, and I wounder if should create an cml only for the toolbar. and then use ut in other xml files. </p><p>How is that possible, so i don't have dublicated xl data. </p>","371301","","750613","","2012-06-26 05:18:03","2012-06-26 05:18:03","Android layouts","<android><xml><android-layout>","1","0","1","",""
"3741863","1","3741872","","2010-09-18 13:28:43","5","16953","<p>I want to have some layout a bit like this</p><pre><code>[text tabel][edittext]</code></pre><p>i cant find an attribute like html esque label. It seems to be the case that i need to use </p><pre><code>[TextView][EditText]</code></pre><p>but i cant get them to go on the same line this is my xml file.</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;""&lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/boat_1""/&gt;&lt;EditText    android:id=""@+id/entry""    android:hint=""@string/IRC""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:background=""@android:drawable/editbox_background""/&gt;&lt;TextView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/boat_2""/&gt;&lt;EditText    android:id=""@+id/entry""    android:hint=""@string/IRC""    android:minWidth=""100dip""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:background=""@android:drawable/editbox_background""/&gt;&lt;Button android:id=""@+id/close""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""    android:text=""@string/title_close"" /&gt;</code></pre><p></p>","296051","","750613","","2012-06-26 05:17:34","2012-07-24 09:48:20","EditText Label?","<android><android-edittext>","2","0","1","",""
"3741883","1","","","2010-09-18 13:36:28","-1","3362","<p>I have the following layout defined:</p><pre><code>&lt;LinearLayout&gt;  &lt;TextView /&gt;  &lt;RelativeLayout&gt;     &lt;TextView&gt;     &lt;Button&gt;     &lt;Button&gt;  &lt;/RelativeLayout&gt;&lt;LinearLayout&gt;</code></pre><p>now i want to get the height of the RelativeLayout (i want to specify the height of its children programatically):</p><pre><code>View rel = findViewById(R.id.RelativeLayout01);int width = rel.getWidth();int height = rel.getHeight();</code></pre><p>but the <code>size returned is 0</code>. How do I get the size of the RelativeLayout (it's mostly pseudocode above, but both layout have a height/width of ""fill_parent"" in the xml)</p>","424514","","750613","","2012-06-26 05:16:39","2012-06-26 05:16:39","Getting the size of an layout in Android","<android><android-layout><relativelayout>","1","0","","",""
"3741921","1","","","2010-09-18 13:45:43","6","1744","<p>I'm very new to Android (like 2 days), but I'm experienced with other layout toolkits. I'm trying to put an AdView below a TabHost, and it seems that I can either get the TabWidget or the AdView to display correctly, but never both.</p><p>First, here's an ASCII art version of what I'm trying to accomplish:</p><pre>--------------------------------------------| Tab 1               | Tab 2              |--------------------------------------------| MapView when tab 1 is selected           ||                                          ||                                          ||                                          ||                                          ||                                          ||                                          |--------------------------------------------| AdView that stays no matter what tab     |--------------------------------------------</pre><p>As you can see, I'm trying to get the AdView <em>outside</em> the TabWidget or FrameLayout. I want it to be below the whole tabhost contents.</p><p>Here's the layout I've got <em>before</em> adding the AdView:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android"" xmlns:myapp=""http://schemas.android.com/apk/res/org.mbs3.android.ufcm"" android:layout_height=""fill_parent"" android:layout_width=""wrap_content"" &gt; &lt;TabHost android:id=""@+id/tabhost"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;  &lt;LinearLayout android:layout_width=""fill_parent""   android:id=""@+id/home_layout"" android:orientation=""vertical""   android:layout_height=""fill_parent""&gt;   &lt;TabWidget android:id=""@android:id/tabs""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;   &lt;FrameLayout android:id=""@android:id/tabcontent""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;RelativeLayout android:id=""@+id/emptylayout1""     android:orientation=""vertical"" android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt;    &lt;!--     programatically added tabs will appear here,                                        one per activity    --&gt;   &lt;/FrameLayout&gt;  &lt;/LinearLayout&gt; &lt;/TabHost&gt;&lt;/RelativeLayout&gt;</code></pre><p>Now, I tried a couple different tips to get the AdView added, such as <a href=""http://www.spencerelliott.ca/blogs/blog-android-menu"" rel=""nofollow"">http://www.spencerelliott.ca/blogs/blog-android-menu</a>. Here's the best layout I came up with:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android"" xmlns:myapp=""http://schemas.android.com/apk/res/org.mbs3.android.ufcm"" android:layout_height=""fill_parent"" android:layout_width=""wrap_content""&gt; &lt;TabHost android:id=""@+id/tabhost"" android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;  &lt;LinearLayout android:layout_width=""fill_parent""   android:id=""@+id/home_layout"" android:orientation=""vertical""   android:layout_height=""fill_parent""&gt;   &lt;TabWidget android:id=""@android:id/tabs""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;   &lt;FrameLayout android:id=""@android:id/tabcontent""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;RelativeLayout android:id=""@+id/emptylayout1""     android:orientation=""vertical"" android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt;    &lt;!--     programatically added tabs will appear here, usually one per     activity    --&gt;   &lt;/FrameLayout&gt;  &lt;/LinearLayout&gt; &lt;/TabHost&gt; &lt;LinearLayout android:layout_width=""fill_parent""  android:id=""@+id/ad_layout"" android:layout_height=""wrap_content""  android:gravity=""bottom"" android:layout_alignParentBottom=""true""  android:layout_alignBottom=""@+id/home_layout""&gt;  &lt;com.admob.android.ads.AdView android:id=""@+id/ad""   android:layout_width=""fill_parent"" android:layout_height=""wrap_content""   myapp:backgroundColor=""#000000"" myapp:primaryTextColor=""#FFFFFF""   myapp:secondaryTextColor=""#CCCCCC""   myapp:keywords=""words"" /&gt; &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Unfortunately, in that one, my MapView in the first tab puts the Zoom controls on top of the AdView. Is there some simple layout I'm missing? Cuz I can get the TabWidget to wrap_content for height, or the AdView to wrap_content for height, but only when they go above the ""@android:id/tabcontent.""</p><p>Anything below the tab content gets eaten by the MapView.</p><p>Thanks</p>","70665","","750613","","2012-06-26 05:15:22","2012-06-26 05:15:22","How can I use a wrap a TabHost containing a MapView that also displays an AdMob view below it?","<android><google-maps><android-mapview><android-tabhost><admob>","1","0","1","",""
"3741982","1","3742318","","2010-09-18 14:04:37","-1","1075","<p>There are the following layout options to create interfaces for android.</p><pre><code>AbsoluteLayoutFrameLayoutLinearLayoutTableLayoutRelativeLayout (and some more)</code></pre><p>Which of the following is most suitable for designing simple games? Guessing that the absoluteLayout is easiest, but will it be problems with different screen sizes? What do you recommend?</p>","450019","","750613","","2012-06-26 05:14:36","2012-06-26 05:14:36","Which layout (AbsoluteLayout etc) is best for simple game programming in the android?","<android><android-linearlayout><relativelayout><absolutelayout>","2","3","","",""
"3742028","1","3742269","","2010-09-18 14:24:01","0","877","<p>I am trying to mix nodpi resources and non-nodpi resources in my application, but it just doesn't work. When I work with nodpi only, the screen size reported is <code>480x800</code> (for example) and all the bitmaps are drawn properly. But when I drop a single bitmap in drawable-normal, the resolution is lowered and that is not the behaviour I want.</p><p>What I am looking for is to mix assets that are not to be scaled according depending of the screen specs (the nodpi bitmaps) with other bitmaps that I would like android to take charge of choosing the proper size.</p><p>In case that doesn't make sense, let me explain it with an example: I want the fonts/buttons/other-UI-elements to scale, but not the background of the game that is supposed to take larger than the size of the screen. The last part must be nodpi (there is simply more scrolling on the smaller size screen).</p><p>How can I do that?</p>","3610","","750613","","2012-06-26 05:13:55","2012-06-26 05:14:13","How to mix nodpi and normal/medium/small/large resources","<android><gui><screen-size>","2","0","","",""
"3742043","1","","","2010-09-18 14:27:15","0","771","<p>I am trying to play video file which is of .3gp format using <code>VideoView</code> of Android. When I try to play this video I am getting a pop up message saying that ""sorry video cannot be played"". I am using Android 2.2 Google APIS.</p><p>I am getting the following errors in Logcat:</p><blockquote>  <p>09-18 15:00:39.607:  DEBUG/MediaPlayer(458): Couldn't open  file on client side, trying server  side  09-18 15:00:39.836:  ERROR/MediaPlayer(458): error (1,  -1002)  <br> <br> 09-18 15:00:39.727: INFO/StagefrightPlayer(33): <br>  setDataSource('http://freemobilvideos.com/eng/download/1099/Prince+of+Persia.3gp')  <br>09-18 15:00:39.836:  INFO/AwesomePlayer(33):  mConnectingDataSource->connect()  returned -1002 <br>09-18 15:00:39.836:  ERROR/MediaPlayer(458): error (1,  -1002) <br>09-18 15:00:40.426: ERROR/MediaPlayer(458): Error  (1,-1002) <br>09-18 15:00:40.426:  DEBUG/VideoView(458): Error: 1,-1002   <br><br></p></blockquote><p>Can anyone help me in solving this issue?</p>","429501","","119895","","2010-09-18 14:57:37","2011-10-15 17:58:04","Error while playing video from server in Android","<android><android-widget>","0","2","","",""
"3742124","1","3742209","","2010-09-18 14:54:51","0","652","<p>I have some problem with passing a WebView from the first activity to the second activity. I have tried <code>putExtra</code> and so on, but it complains that I'm trying to pass a WebView instead of a String.</p><pre><code>Intent intent = new Intent().setClass(this, WebView.class);intent.putExtra(""myPassedWebView"", mWebView);startActivity(intent);  </code></pre><p>Any ideas?</p><p>Thanks in advance!</p>","386562","","","","","2010-09-18 15:18:45","Pass WebView from one activity to another","<android>","1","0","","",""
"3742240","1","4855639","","2010-09-18 15:30:37","2","4511","<p>I'm developing a application for Android v2.1 and i seach how i can change the color of the ""check"" for a CheckBox component ?</p><p>Thanks you in advance :smile5:</p><p>Dominique</p>","451455","","","","","2014-02-15 10:00:54","Android 2.1 CheckBox component : change check color","<android><colors><checkbox><activity>","2","0","","",""
"3742323","1","3797361","","2010-09-18 15:52:37","1","7653","<p>I'm making a vibrate toggling widget (in fact, its first version is already in the Market) but I'm having some problems with the vibrate settings of Android 2.2.</p><p>Up to Android 2.1 I have no problem, when I want to disable vibrate I do</p><pre><code>am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,AudioManager.VIBRATE_SETTING_OFF);am.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION,AudioManager.VIBRATE_SETTING_OFF);</code></pre><p>and the same but with <code>VIBRATE_SETTING_ON</code> on both lines to turn it on, and it works allright.</p><p>However, since Android 2.2 introduced ""Vibrate only in silent mode"" and ""Vibrate when not in silent mode"", I don't know how to make it work. When vibrate is set to ""Always"" or ""Never"" there's no problem, but as soon as the user manually sets it to one of the other two settings, the app starts doing strange things.</p><p>For example, if I have it set to ""vibrate only in silent mode"" and I turn vibration off via my widget, it turns off, but when I turn it back on... it goes back to ""only in silent mode"" instead of ""Always"". In fact, there's no way to set it back to ""Always"" unless you do it via Settings -> Sound, so I guess the combobox for vibrate mode is doing something else that I don't know of. It's like it stored the value somewhere else, because even if I set manually to ""Always"", when I disable it and enable it again via the widget (with the code I posted before) it keeps going back to ""Vibrate only in silent mode"". </p><p>And what's more, there's a value in AudioManager class for ""Only in silent mode"" (VIBRATE_SETTING_ONLY_SILENT) but when you set it to ""Only when not in silent mode"" it uses VIBRATE_SETTING_ON, so there are no way to detect it (not that I know of, I mean).</p><p>Hope I have not been too confusing, but I wanted to give all the possible data. And with all that set...</p><p>Does anyone know how to properly handle vibrate settings in 2.2? Is there any other variable that I have to set or function that I have to call in order to disable or enable vibrate completely? Or a way to ""reset"" the phone to a known state so that it works ok?</p><p>The steps to reproduce the problem (or, at least, one of the problems) are: </p><ul><li><p>Set vibrate to ""only in silent mode"" via the settings menu.</p></li><li><p>Set vibrate to ""never"" via the widget:</p><p><code>setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);</code></p></li><li><p>Check in the settings menu that vibrate is set to ""never"".</p></li><li><p>Set vibrate to ""always"" via the widget:</p><p><code>setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_ON);</code></p></li><li>Go to the settings menu -> Vibrate is set to ""Only in silent mode""</li></ul>","451420","","995926","","2012-05-05 13:53:51","2012-05-05 13:53:51","Vibrate settings on Android 2.2","<android><settings><vibrate><android-2.2-froyo><vibration>","2","0","8","",""
"3742332","1","3743492","","2010-09-18 15:55:59","0","320","<p>For some reason, after a user enters text into an EditText within my Android app the white-bar which contains ""suggestions"" remains at the bottom of my Layout! If you press the ""Back"" button, it disappears.</p><p>How can I stop this from remaining after completing text entry?</p><p>EDIT:</p><p>Screenshots</p><p>Editing the text, white bar appears with suggestions:</p><p><img src=""http://i.stack.imgur.com/4JiKy.png"" alt=""alt text""></p><p>And after going back to the ListView activity</p><p><img src=""http://i.stack.imgur.com/jG1r4.png"" alt=""alt text""></p>","250022","","250022","","2010-09-18 17:05:04","2010-10-06 15:50:50","How to remove the white-bar which remains after typing in Android","<android>","3","3","","",""
"3742377","1","","","2010-09-18 16:08:27","4","3810","<p>I've looked everywhere, it seems this would be common, and simple.  I have a string from a database, ""Ros%E9""  What is the simplest way to convert it to ""Rose"" with an accented e?</p>","450317","","","","","2010-09-18 16:12:44","unescape a string","<java><android>","1","0","1","",""
"3742393","1","3742586","","2010-09-18 16:10:54","1","1370","<p>From the beging The android app has black background, I want to make all these changes, How is that possible</p>","371301","","","","","2010-09-18 16:56:31","change the style and theme of android app","<android><coding-style>","1","0","","",""
"3742481","1","","","2010-09-18 16:30:27","0","103","<p>What is aymsg ?</p>","405452","","","","","2010-09-18 16:31:25","aymsg in android","<android>","1","0","","2012-08-21 13:02:23",""
"3742502","1","","","2010-09-18 16:36:57","2","262","<p>Yo guys,</p><p>I'm trying to get into native android development coming from an Actionscript 3.0 background.</p><p>My question is: what is the standard convention for creating basic movement in Android? By movement I mean a 2D graphic moving across the screen for instance.</p><p>Is it by using timers to fire a general update() method?</p><p>I have seen some things about the onDraw() method of Views but it doesn't seem to be used very often (if at all) and I'm guessing this is because it would be very restrictive and would fire just as soon as the phone can handle it, not when you need it, but really I'm not sure.</p><p>Anything is much appreciated, and an example would be very lovely indeedy! :)</p>","451493","","403610","","2010-09-18 16:44:37","2010-09-18 16:52:40","Movement in native Android development?","<java><android><physics><movement>","1","1","0","",""
"3742870","1","","","2010-09-18 18:12:58","1","441","<p>How do I test my Android application such that it works on all major android phones ? e.g. Motorola, HTC, Samsung etc. </p><p>I have an app that works on Nexus One and Samsung but it is giving problems on HTC Incredible.</p>","394675","","584192","","2011-11-14 13:30:18","2011-11-14 13:30:18","Testing Android Application","<android><testing><mobile>","6","1","","",""
"3742979","1","4913266","","2010-09-18 18:43:01","19","7506","<p>Tearing my hair out trying to get an Android ListView to do what I want. </p><p>I want to have a ListView in single choice mode with a custom row layout that has a different background color for selected, pressed and checked (i.e. the choice is shown by a color rather than a check mark - this is what I would normally call the ""selection"" but selection in android seems line I'm about to choose before I press it)</p><p>I thought of trying a background selector with the three states in it.  It works fine for state_selected and state_pressed, but not state_checked.  So I created a CheckableRelativeLayout that extends RelativeLayout and implements Checkable and used for the view of each row.</p><p>A simplified version is shown here:</p><pre><code>&lt;my.package.CheckableRelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:background=""@drawable/bkg_selector""&gt;    &gt;     &lt;ImageView android:id=""@+id/animage""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentLeft=""true""     /&gt; &lt;/my.package.CheckableRelativeLayout&gt;</code></pre><p>bkg_selector looks like</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_pressed=""true"" android:drawable=""@drawable/purple"" /&gt;    &lt;item android:state_checked=""true"" android:drawable=""@drawable/red"" /&gt;    &lt;item android:state_selected=""true"" android:drawable=""@drawable/darkpurple"" /&gt;    &lt;item android:drawable=""@drawable/black"" /&gt;&lt;/selector&gt;</code></pre><p>The colors are defined elsewhere.</p><p>This still didn't work.  So in the custom ListAdapter I tracked the ""checked"" row and tried (in getView)</p><p>if( position == checkedPosition )      ret.getBackground().setState(CHECKED_STATE_SET);</p><p>And it STILL doesn't work.  How can I get it to do what I want?</p>","199816","","","","","2013-12-15 04:49:37","How to get a android ListView item selector to use state_checked","<android><listview>","3","0","9","",""
"3743017","1","3743026","","2010-09-18 18:54:19","3","360","<p>I am writing a basic game engine and have an abstract class that represents any object that can be drawn in the 3D world, however inside this class is an abstract method Render() which I would like called automatically by the engine on each draw phase. How could I implement this so that every class extending from my abstract class will automatically have Render() called?</p><p>I am using java, android sdk 2.2, and opengl es</p>","","nick","44729","","2010-09-18 21:23:44","2010-09-20 13:38:40","How would you call a method from all instances of a class?","<java><android><opengl-es><engine>","3","0","","",""
"3743022","1","3743068","","2010-09-18 18:55:42","1","1121","<p>I am able to play a video using VideoView in combination with MediaController. The problem when I started my activity , a bar appears below with media controllers play,pause,rewind ,progress bar representing video. But it disappears after displaying 1 second. Then I how can  I make this media Controller bar with controls to display as long as my video plays so that I can pause,rewind my video.</p><p>Thanks in Advance</p>","429501","","","","","2010-09-18 19:09:23","Media controls Bar disappears after appearing for a second in VideoView Android","<android>","1","0","1","",""
"3743035","1","","","2010-09-18 18:58:48","2","3151","<p>i tried running ""Photo capture example""  in android emulator ,</p><pre><code>http://labs.makemachine.net/wp-content/uploads/2010/03/2010_04_09_make_machine_photo_capture.zip</code></pre><p>when the photocapture example is loaded in android emulator ,it shows the screen with “No Image” Text and “Take Photo” button. as follows,</p><p><img src=""http://i.stack.imgur.com/5qAZA.png"" alt=""alt text""></p><p>if i click on “Take Photo: Button then a camera window appears with a “black and white boxes” and after that a run time error generated to forcefully close the application.</p><p>As far as sd card is concerned i have created it using AVD manager in eclipse.after that i have set one image file also and mount the sdcard.</p><p>But still not be able to take the photo , so please tell me what is require to run this program.</p>","405383","","","","","2010-09-19 01:48:02","take photo in android emmulator","<android><android-emulator>","1","5","1","",""
"3743474","1","3743710","","2010-09-18 21:01:05","2","4420","<p>I have an android application. Based on the current geo location of user, I want to fetch some remote data in background and store it. My implementation is:</p><p>At specific interval a alarm fires up my service. Service uses an anonymous class to query current location and registers a locationListener callback. On call of onLocationChanged() I initiate the remote data fetch from server.</p><p>However once my service is done registering the location listener using anonymos class, it returns as expected; as it doesn't wait for callback to happen before finishing. Since callback takes some time and makes a call when service has already returned, it throws an error saying:</p><pre><code>java.lang.RuntimeException: Handler{43e82510} sending message to a Handler on a dead thread</code></pre><p>Which is quite understandable. One quick workaround for me now is that I can use getLastKnownLocation from locationManager as that doesn't respond back by callback; but what if I do want the latest location right now, in a service and not activity? How can I wait for callback to happen and stop my service from returning.</p><p>Also, at what point does lastKnownlocation gets updated? Everytime GPS registers a new location; does it update it? What I want to know is that if it's not latest can it still be closed to latest? As I didn't see an option in android emulator to configure the time period between subsequent updates.</p><p>Any help is much appreciated.Cheers</p>","57847","","","","","2010-09-18 22:07:50","Android service with locationListener callbacks","<android><service><geolocation><locationlistener>","1","0","1","",""
"3743548","1","","","2010-09-18 21:17:25","0","131","<p>I have followed the instructions found online on my laptop and my desktop.  My desktop works fine  but my laptop gives me the following errors when I try to run the emulator through eclipse.  The device 'and' is listed and the preferences point to the correct file.</p><p>emulator: ERROR: unknown virtual device name: 'and'emulator: could not find virtual device named 'and'</p>","451616","","404469","","2010-09-18 21:25:16","2011-03-30 19:35:22","I am having trouble getting the emulator to work","<android><android-emulator>","1","1","","",""
"3743551","1","3743571","","2010-09-18 21:18:12","0","3550","<p>I want to find out storage usage of an app.I can list file size in adb shell using ls command. But, I didn't find 'du' command in adb shell. Is there any command or tool that allows me to figure out the storage usage of a directory?</p><p>Thanks.</p>","445302","","207655","","2010-09-18 21:20:25","2010-09-18 21:25:24","How to find out the size of a directory in adb shell?","<android><adb>","1","0","","",""
"3743634","1","3764842","","2010-09-18 21:46:30","2","4546","<p>I want to forece a foreign key constarint on a table in an Android application.</p><p>I've searched that this can be done by using triggers:</p><p>I did it like this:</p><pre><code>db.execSQL(""CREATE TRIGGER dept_id_trigger22+"" +                "" AFTER INSERT ""+                "" OF EmployeeName ON Employees""+                "" BEGIN""+                                     //Condition                "" RAISE(ABORT,'error') END;"");</code></pre><p>but no error was raised and the illegal values are inserted.</p><p>what is  wrong with this ?</p>","235123","","161161","","2010-09-18 21:49:06","2013-09-27 11:26:25","SQLite triggers in Android?","<android><sqlite>","5","2","","",""
"3743652","1","3743666","","2010-09-18 21:52:59","0","161","<p>I've start developing android applications.but My PC has so poor  resource cpu and  ram for using eclipse so I'd like to develop by CLI javac..</p><p>How can I use CLI for developing android?</p>","76509","","","","","2010-09-18 22:03:15","Can I develop for android applications by using CLI","<java><android><eclipse><command-line>","2","1","","",""
"3743713","1","3743739","","2010-09-18 22:08:43","0","257","<p>I wish to set the title of each activity with a constant value which is fetched from a local sqlite database.  the value is the user's username.</p><p>Is there a way to set the title once and have it affect all activities? or do I have to manually set the title on each activity?  </p><p>If there is a way, how is it achieved?</p>","416412","","","","","2010-09-18 22:18:40","how can i set a title(once) for all activities?","<android><titlebar>","1","0","","",""
"3743781","1","3744249","","2010-09-18 22:35:10","0","2541","<p>Hey, I'm trying to query the words which have the maximul values in the cont columns. Ex: if the word ""test1"" has the value 5 in cont, and ""test2"" has 2, ""test1"" will be shown in first position. got it?</p><p>so. Im trying to do it but it returns the following error:</p><p>09-18 22:24:04.072: ERROR/AndroidRuntime(435): Caused by: android.database.sqlite.SQLiteException: misuse of aggregate function MAX(): , while compiling: SELECT word FROM words WHERE MAX(cont) ORDER BY cont desc</p><p>Here is my method:</p><pre><code>public List&lt;String&gt; selectMaxCont(){   List&lt;String&gt; list = new ArrayList&lt;String&gt;();   Cursor cursor = this.db.query(TABLE_NAME, new String[]{""word""}, ""MAX(cont)"", null, null, null, ""cont desc"");   if(cursor.moveToFirst()){       do{   list.add(cursor.getString(0));       }while(cursor.moveToNext());   }   if(cursor != null &amp;&amp; !cursor.isClosed()){       cursor.close();   }   return list;</code></pre><p>}</p>","399459","","135152","","2011-05-25 03:12:07","2011-05-25 03:12:07","Query the row which with the maximum value on ""cont"" column","<android><sql><sqlite>","1","0","","",""
"3743816","1","3743989","","2010-09-18 22:43:44","1","2148","<p>I am a student taking a course in Network security.As a part of my coursework I need to do a project on the security side of Android like developing a simple application which involves basic security concepts.</p><p>I searched for different ideas which I can implement on Android within a span of 2-3 weeks.I found ideas such as secure sms or mobile antivirus or mobile finder.I am a beginner with the Android development and thus I might require more time to develop these apps(Maybe a month)</p><p>Can anyone please suggest some ideas for simple security apps which I can develop within 2-3 weeks?</p><p>Thanks,</p><p>Ameya</p>","355833","","","","","2010-09-18 23:58:04","Ideas for Android Securty Project","<android><security><rsa>","1","1","2","",""
"3743827","1","3744143","","2010-09-18 22:47:15","3","1202","<p>I'm trying to create an Android app that searches for a certain type of business near the user's current location. I found the Google Places API, but it doesn't look like you can specify what type of place you want to search for. They also say you're not allowed to filer the results, so I can't even just filter out the ones i'm actually looking for.</p><p>Does anyone have any suggestions on how to search for nearby places of a certain type? This will eventually be displayed using the Google MapView for the Android. But the big problem I'm facing right now is how to get the list of businesses I'm looking for.</p><p>Thanks for any help you can give!</p>","318158","","","","","2010-09-19 01:11:28","Location based search on Android","<android><search><google-maps>","2","0","1","",""
"3743916","1","","","2010-09-18 23:20:17","0","370","<p>In my app I am displaying a table where the individual cells are editable text fields (i.e. EditText objects). I am currently struggling calculating appropriate widths for these. </p><p>If I set the width to be as many ""Ems"" as the displayed text has characters, my fields are much to wide by about a factor of 2 and the table looks ugly and wastes lots of precious screen space. Setting the width in ""Ems"" is essentially like assuming the worst case, i.e. the width of a string under the assumption that it contains only the broadest characters in a font, usually 'M' (hence the name of the method), 'm', 'W', or '_'). But on average strings contain narrower characters and so most of these fields are half empty and much too wide for their actual content. I am thus desperately seeking a way to calculate a better fitting width, not that worst case width.</p><p>The ""normal"" way to do this in Java (in AWT or Swing at least) is to asks a widget's current Font (actually a Font's FontMetrics), to calculate and return the width that will be necessary to display a given string in pixels. But how does one obtain a TextView's Font? I haven't found any method to obtain a (Text)View's font and/or calculate a more appropriate width given the actual content of a cell's text string. How does one do that in Android?</p><p>Michael</p>","423411","","423411","","2010-09-18 23:29:07","2010-09-18 23:50:54","How to calculate an appropriate field width?","<android><android-widget>","1","0","1","",""
"3744368","1","","","2010-09-18 18:42:30","0","873","<p>I am an android developer I have a problem..I want to be get notified when the phone screen goes to sleep PLease Help wiith a sample code.</p>","","Jim","","","","2010-09-19 11:34:57","Sleep in android","<android>","1","1","","",""
"3744415","1","","","2010-09-19 03:24:03","1","404","<p>Long story short: I'm trying to post comments and create issues onto Google Code via an Android App called Abugadro. </p><p>I followed a very similar piece of code here: <a href=""http://stackoverflow.com/questions/3254330/google-spreadsheet-api-update-edit-with-protocol"">http://stackoverflow.com/questions/3254330/google-spreadsheet-api-update-edit-with-protocol</a></p><p>When trying to post a comment onto the API, I've gotten various errors like 403 and 501 depending on the headers I use. </p><p>Anyway, Code talks, so here's my piece: </p><pre><code>HttpPost postRequest = new HttpPost(""http://code.google.com/feeds/issues/p/""+projName+""/issues/""+issueId+""/comments/full"");postRequest.addHeader(""Content-Type"",""application/atom+xml;charset=UTF-8"");postRequest.setHeader(""Authorization"", ""GoogleLogin auth="" + auth);postRequest.addHeader(""User-Agent"", ""abugadro-v""+getResources().getString(R.string.version));postRequest.addHeader(""Accept-Encoding"",""gzip"");postRequest.addHeader(""GData-Version"", ""1.0"");//postRequest.addHeader(""If-Match"", ""*"");//Not entirely sure if I should use this or notHttpEntity se = new StringEntity(xml,""UTF-8""); //Contains the comment info              postRequest.setEntity(se);</code></pre><p>The IssueTrackerAPI is very vague on what sort of headers I should be using to post correctly. <a href=""http://code.google.com/p/support/wiki/IssueTrackerAPI#Modifying_an_issue_or_creating_issue_comments"" rel=""nofollow"">http://code.google.com/p/support/wiki/IssueTrackerAPI#Modifying_an_issue_or_creating_issue_comments</a></p><p>P.S. I know there's a gdata-java-client but there's no sane way to use that api on android without dragging ~2mb of jars. </p><p>I really appreciate your help, this issue has been driving me insane beyond comprehension. Thanks again. </p>","222344","","222344","","2010-09-23 17:41:54","2010-09-24 02:00:45","Help with Google Code Issue Tracker API","<java><android><http><google-code><google-api-java-client>","1","5","1","",""
"3744498","1","5409022","","2010-09-19 04:25:13","1","1834","<p>Being an Android newbie experimenting with GPS stuff I managed to put together this code and it works just like I expect it to except for one thing, the GPS icon never goes away. How can get the GPS icon to disappear when the activity is destroyed?  I have </p><pre><code>locationManager.removeUpdates(GPSMapTest.this);     locationManager = null;</code></pre><p>in my <code>onPause()</code> but apparently that's not enough?  Thanks.</p><p>The problem exists in the emulator and also on my HTC EVO with 2.2. On my EVO, the icon stays there when the activity is destroyed and only disappears when I uninstall the app.</p><pre><code>    public class GPSMapTest extends MapActivity implements LocationListener, OnClickListener {    /** Called when the activity is first created. */    private MapView mapView;    private MapController mapController;            private LocationManager locationManager;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        getWindow().setFormat(PixelFormat.TRANSPARENT);        setContentView(R.layout.main);        mapView = (MapView)findViewById(R.id.mapview);        mapController = mapView.getController();                      mapController.setZoom(18);         mapView.setClickable(true);        mapView.setEnabled(true);        mapView.setSatellite(true);        Button buttonCurrentLoc = (Button)findViewById(R.id.myloc_btn);        buttonCurrentLoc.setOnClickListener(this);         }//End onCreate()            @Override    protected boolean isRouteDisplayed() {        return false;    }       @Override       protected void onPause() {        super.onPause();                                locationManager.removeUpdates(GPSMapTest.this);             locationManager = null;    }    @Override       protected void onResume() {        super.onResume();        locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);        Criteria criteria = new Criteria();        criteria.setAccuracy(Criteria.ACCURACY_FINE);        criteria.setPowerRequirement(Criteria.POWER_LOW);               criteria.setAltitudeRequired(false);        criteria.setBearingRequired(false);        criteria.setSpeedRequired(false);        criteria.setCostAllowed(false);             final String bestProvider = locationManager.getBestProvider(criteria, true);        Toast.makeText(GPSMapTest.this, ""Best Provider: "" + bestProvider, Toast.LENGTH_SHORT).show();        locationManager.requestLocationUpdates(bestProvider, 60000, 1, GPSMapTest.this);        Location location = locationManager.getLastKnownLocation(bestProvider);             if (location != null) {            Double latitude = location.getLatitude()*1E6;            Double longitude = location.getLongitude()*1E6;            GeoPoint point = new GeoPoint(latitude.intValue(),longitude.intValue());            final MyLocationOverlay myLocationOverlay = new MyLocationOverlay(GPSMapTest.this, mapView);                    mapView.getOverlays().add(myLocationOverlay);                       myLocationOverlay.enableMyLocation();            mapController.animateTo(point);         }        mapView.setBuiltInZoomControls(true);               }    public void onClick(View v) {        switch (v.getId()) {        case (R.id.myloc_btn):            locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);            Criteria criteria = new Criteria();            criteria.setAccuracy(Criteria.ACCURACY_FINE);            criteria.setPowerRequirement(Criteria.POWER_LOW);                   criteria.setAltitudeRequired(false);            criteria.setBearingRequired(false);            criteria.setSpeedRequired(false);            criteria.setCostAllowed(false);                 final String bestProvider = locationManager.getBestProvider(criteria, true);            Location location = locationManager.getLastKnownLocation(bestProvider);                 if (location != null) {                Double latitude = location.getLatitude()*1E6;                Double longitude = location.getLongitude()*1E6;                GeoPoint point = new GeoPoint(latitude.intValue(),longitude.intValue());                final MyLocationOverlay myLocationOverlay = new MyLocationOverlay(GPSMapTest.this, mapView);                        mapView.getOverlays().add(myLocationOverlay);                           myLocationOverlay.enableMyLocation();                mapController.animateTo(point);             }            mapView.setBuiltInZoomControls(true);                           break;                      }    }           public void onLocationChanged(Location location) {        locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);             if (location != null) {            final MyLocationOverlay myLocationOverlay = new MyLocationOverlay(GPSMapTest.this, mapView);                    mapView.getOverlays().add(myLocationOverlay);                       myLocationOverlay.enableMyLocation();            myLocationOverlay.runOnFirstFix(new Runnable() {                public void run() {                                     mapController.animateTo(myLocationOverlay.getMyLocation());                                                      }            });                         }        mapView.setBuiltInZoomControls(true);                       }    public void onProviderDisabled(String provider) {           }    public void onProviderEnabled(String provider) {    }    public void onStatusChanged(String provider, int status, Bundle extras) {    }}</code></pre><p>No one? I tried everything with my limited knowledge! Help!</p>","403146","","403146","","2010-09-19 19:54:12","2011-07-03 20:17:02","GPS icon won't disappear when activity destroyed?","<android><icons><gps>","3","1","","",""
"3744564","1","3752591","","2010-09-19 05:00:19","0","1133","<p>I'm trying to display a message to the user some time after an event is received by a BroadcastReceiver.</p><pre><code>public class MyReceiver extends BroadcastReceiver {  private Timer timer = new Timer();  @Override  public void onReceive(Context context, Intent intent) {      // Display message in 10 sec.      timer.schedule(new MessageTask(context, ""Test Message""), 10 * 1000);  }  private static class MessageTask extends TimerTask {    public MessageTask(Context context, String message) {      this.context = context;      this.message = message;    }    public void run() {      Toast.makeText(context, message, Toast.LENGTH_SHORT).show();    }  }}</code></pre><p>When I run this I get the following exception:</p><pre><code>java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>Is this the right way to do something like this?  Should I be using something other then a Timer?  And what is the right way to get a Context object in this situation?</p><p>Thank you</p>","9435","","","","","2010-09-20 14:50:46","Displaying a Delayed Toast from a BroadcastReceiver","<android>","3","0","","",""
"3744592","1","","","2010-09-19 05:12:44","0","1884","<h3>main.xml</h3><pre><code>&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@android:id/tabhost"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;TabWidget android:id=""@android:id/tabs"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""  android:paddingTop=""5dip""&gt;            &lt;LinearLayout android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:id=""@+id/main""&gt;                &lt;ListView android:id=""@+id/list"" android:layout_width=""fill_parent"" android:layout_height=""0dip"" android:layout_weight=""1""/&gt;                &lt;TextView android:id=""@+id/empty"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:gravity=""center"" android:text=""Loading""/&gt;            &lt;/LinearLayout&gt;            &lt;RelativeLayout android:id=""@+id/mainlayout"" android:orientation=""vertical"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;                &lt;com.google.android.maps.MapView android:id=""@+id/mapview"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:clickable=""true"" android:apiKey=""0Ua9BENcUvNKEom7wvjrrtlCVIeJ9SNYAbLAkJA""/&gt;            &lt;/RelativeLayout&gt;        &lt;/FrameLayout&gt;    &lt;/TabWidget&gt;&lt;/TabHost&gt;</code></pre><hr><pre><code>public class TabbedListMapActivity extends MapActivity implements OnTabChangeListener {        private static final String LIST_TAB_TAG = ""List"";        private static final String MAP_TAB_TAG = ""Map"";         private TabHost tabHost;        private ListView listView;        private MapView mapView;        private  LocalActivityManager mLocalActivityManager ;        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);           setContentView(R.layout.main);            tabHost = (TabHost) findViewById(android.R.id.tabhost);            tabHost.setup();            tabHost.setup();            // LayoutInflater.from(this).inflate(R.layout.maplv, tabHost.getTabContentView(), true);            // setup must be called if you are not inflating the tabhost from XML            tabHost.setOnTabChangedListener(this);            // setup list view            listView = (ListView) findViewById(R.id.list);            listView.setEmptyView((TextView) findViewById(R.id.empty));            // create some dummy coordinates to add to the list            List&lt;GeoPoint&gt; pointsList = new ArrayList&lt;GeoPoint&gt;();            pointsList.add(new GeoPoint((int)(32.864*1E6), (int)(-117.2353*1E6)));            pointsList.add(new GeoPoint((int)(37.441*1E6), (int)(-122.1419*1E6)));            listView.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, pointsList));            // add an onclicklistener to see point on the map            listView.setOnItemClickListener(new OnItemClickListener() {                public void onItemClick(AdapterView parent, View view, int position, long id) {                    GeoPoint geoPoint = (GeoPoint) listView.getAdapter().getItem(position);                    if(geoPoint != null) {                        // have map view moved to this point                        setMapZoomPoint(geoPoint, 12);                        // programmatically switch tabs to the map view                        tabHost.setCurrentTab(1);                    }                }            });            // setup map view            mapView = (MapView) findViewById(R.id.mapview);            mapView.setBuiltInZoomControls(true);            mapView.postInvalidate();            // add views to tab host            tabHost.addTab(tabHost.newTabSpec(LIST_TAB_TAG).setIndicator(""List"").setContent(R.id.list));            tabHost.addTab(tabHost.newTabSpec(MAP_TAB_TAG).setIndicator(""Map"").setContent(R.id.mapview));            //HACK to get the list view to show up first,            // otherwise the mapview would be bleeding through and visible            tabHost.setCurrentTab(1);            tabHost.setCurrentTab(0);        }        /**         * Instructs the map view to navigate to the point and zoom level specified.         * @param geoPoint         * @param zoomLevel         */        private void setMapZoomPoint(GeoPoint geoPoint, int zoomLevel) {            mapView.getController().setCenter(geoPoint);            mapView.getController().setZoom(zoomLevel);            mapView.postInvalidate();        }        /**         * From MapActivity, we ignore it for this demo         */        @Override        protected boolean isRouteDisplayed() {            return false;        }        /**         * Implement logic here when a tab is selected         */        public void onTabChanged(String tabName) {            if(tabName.equals(MAP_TAB_TAG)) {                //do something on the map            }            else if(tabName.equals(LIST_TAB_TAG)) {                //do something on the list            }        } } </code></pre><p>I get a result similar to <a href=""http://i3.6.cn/cvbnm/e1/71/e9/19008bd7258eaf858be73dc6431b1f8b.jpg"" rel=""nofollow"">http://i3.6.cn/cvbnm/e1/71/e9/19008bd7258eaf858be73dc6431b1f8b.jpg</a>.I want to get two tabs; could you help me?</p>","233618","","15168","","2011-09-02 04:30:56","2011-09-02 04:30:56","use tabhost by extending MapActivity","<android><android-tabhost>","2","0","","",""
"3744755","1","","","2010-09-19 06:32:45","1","1245","<p>What is the final behavior of starting an already existed Activity?</p><p>If I set the activity's launchmode to singletop while does not set the activity's flag,</p><p>or I set the activity's launchmode to standard while set the activity's flag to Intent.FLAG_ACTIVITY_REORDER_TO_FRONT.</p><p>Thanks.</p>","441316","","","","","2010-09-19 10:08:38","launchmode and Intent.setFlag","<android>","1","0","","",""
"3744854","1","","","2010-09-19 07:15:32","4","775","<p>I'm trying to layer graphics one top of each other, like an icon over a background, with the second layer (icon) at a certain pixel offset from the top left corner of first layer (background).  Since each layer will eventually have its own animation, I'm placing each in its own View.</p><p>For my implementation I have two ImageViews, one for each layer, inside a RelativeLayout, which in turn is inside a ScrollView.  ImageViews are positioned using layout_margin relative to the top left corner (0,0).  The first ImageView is larger than the screen (background), while the second ImageView is smaller than it (icon).  ScrollView automatically resizes the first ImageView (background) since it is larger than the screen, it does not resize the second since it is smaller (icon).</p><p>I need both of them to scale together, and I also need the positioning of the second layer over the first layer to adjust itself accordingly.  This actually works well in a layer-list, but due to the animations I am forced to use Views.  How can I scale and position multiple Views together, or do I need to build my own class for something that seems like it should be fairly basic?</p><p>Thanks in advance.</p>","451792","","","","","2010-09-19 07:15:32","Android: How do you scale multiple views together?","<android><view><scaling><imageview><scrollview>","0","0","1","",""
"3744878","1","3744927","","2010-09-19 07:28:25","-3","1286","<p>I want to change the network signal strength programmatic-ally in android..Even though signal is full i want to make it 50% or even 0%. Friends is it possible..?If possible please me how to do it..Thanks in advance..</p>","399046","","","","","2013-05-06 08:20:04","changing signal strength programmatically in android","<android>","2","2","","",""
"3744883","1","","","2010-09-19 07:30:40","0","1201","<p>How can I know when an Android phone is going to sleep? I tried with the sample code but nothing is happening.</p><p>Here is what I have so far:</p><p><strong>ScreenON_OFF_ACTIVITY.java</strong>:</p><pre><code>package com.pack;import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;public class ScreenON_OFF_ACTIVITY extends Activity {     public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            onCreate();     }     public void onCreate() {            // initialize receiver            System.out.println(""onCreate1 "");            IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);            filter.addAction(Intent.ACTION_SCREEN_OFF);            BroadcastReceiver mReceiver = new ScreenReceiver();            registerReceiver(mReceiver, filter);            System.out.println(""onCreate "");                }        @Override        protected void onPause() {            // when the screen is about to turn off            if (ScreenReceiver.screenOff) {                // this is the case when onPause() is called by the system due to a screen state change                System.out.println(""SCREEN TURNED OFF"");            } else {                // this is when onPause() is called when the screen state has not changed                 System.out.println(""this is when onPause() is called when the screen state has not changed "");            }            super.onPause();        }        @Override        protected void onResume() {            // only when screen turns on            if (!ScreenReceiver.screenOff) {                // this is when onResume() is called due to a screen state change                System.out.println(""SCREEN TURNED ON"");            } else {                // this is when onResume() is called when the screen state has not changed                 System.out.println("" this is when onResume() is called when the screen state has not changed "");            }            super.onResume();        }    }</code></pre><p><strong>ScreenReceiver.java</strong>:</p><pre><code>package com.pack;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;public class ScreenReceiver extends BroadcastReceiver {    public static boolean screenOff;    @Override    public void onReceive(Context context, Intent intent) {         System.out.println(""onReceive "");        if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {            screenOff = true;            System.out.println(""SCREEN TURNED OFF on BroadcastReceiver"");        } else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {            screenOff = false;            System.out.println(""SCREEN TURNED ON on BroadcastReceiver"");        }        Intent i = new Intent(context, UpdateService.class);        i.putExtra(""screen_state"", screenOff);        context.startService(i);    }}</code></pre><p><strong>UpdateService.java</strong>:</p><pre><code>package com.pack;import android.app.Service;import android.content.BroadcastReceiver;import android.content.Intent;import android.content.IntentFilter;import android.os.IBinder;public class UpdateService extends Service {    public void onCreate() {        super.onCreate();        // register receiver that handles screen on and screen off logic        IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);        filter.addAction(Intent.ACTION_SCREEN_OFF);        BroadcastReceiver mReceiver = new ScreenReceiver();        registerReceiver(mReceiver, filter);    }    @Override    public void onStart(Intent intent, int startId) {        boolean screenOn = intent.getBooleanExtra(""screen_state"", false);        if (!screenOn) {            System.out.println(""Screen is off"");        } else {            System.out.println(""Screen is on"");        }    }    @Override    public IBinder onBind(Intent intent) {              return null;    }}</code></pre>","655814","","496830","","2011-11-08 14:24:59","2011-11-08 14:24:59","How can I know when an Android phone is going to sleep?","<android>","1","3","","",""
"3744930","1","","","2010-09-19 07:46:19","0","292","<p>I want to develop an application that will periodically check whether Wi-Fi is enabled in android and depending on on the result it will take an action. Can anyone give me some suggestions regarding this?</p><p>Thankskaisar</p>","438383","","","","","2010-09-19 08:14:50","periodic check to see whether Wifi in enables in Android","<android>","1","0","1","",""
"3744954","1","3744964","","2010-09-19 07:58:18","4","3852","<p>I am using viewflipper for fling gesture recognition everything works fine for 2.0 and prior but in 2.2 and 2.1 it throws exception as ""java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper"" below is full debug trace.</p><pre><code>java.lang.IllegalArgumentException: Receiver not registered: android.widget.ViewFlipper$1@452f839809-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.app.ActivityThread$PackageInfo.forgetReceiverDispatcher(ActivityThread.java:793)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:814)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:331)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.widget.ViewFlipper.onDetachedFromWindow(ViewFlipper.java:104)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.View.dispatchDetachedFromWindow(View.java:6033)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1158)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1630)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.ViewRoot.doDie(ViewRoot.java:2671)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.ViewRoot.die(ViewRoot.java:2641)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:218)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.view.Window$LocalWindowManager.removeViewImmediate(Window.java:436)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3684)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3789)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.app.ActivityThread.access$2400(ActivityThread.java:125)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2037)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.os.Handler.dispatchMessage(Handler.java:99)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.os.Looper.loop(Looper.java:123)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at java.lang.reflect.Method.invokeNative(Native Method)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at java.lang.reflect.Method.invoke(Method.java:521)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-19 11:33:06.825: ERROR/AndroidRuntime(393):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p><a href=""http://code.google.com/p/android/issues/detail?id=6191"" rel=""nofollow"">There is issue on Google related to this bug 6191. </a></p><p>And the solutions mentioned in there seems to work only if your are creating ViewFlipper through code but in my case i am using ViewFlipper in XML which is my layout file and so i cant use the solution mentioned for extending the ViewFlipper i tried using delay nothing seems to work.</p><p>I am stuck awfully with this any help will be really appreciated.</p><p>Below is my layout code.</p><pre><code>&lt;ViewFlipper xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;        android:id=&quot;@+id/flipper&quot;        android:layout_width=&quot;fill_parent&quot;         android:layout_height=&quot;fill_parent&quot;&gt;    &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:id=&quot;@+id/parentView&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot; android:background=&quot;@color/listingBG&quot;&gt;        &lt;TextView                 android:id=&quot;@+id/statusMessage&quot;                 android:layout_height=&quot;fill_parent&quot;                 android:layout_width=&quot;fill_parent&quot;                style=&quot;@style/TextLabel.Normal&quot; android:visibility=&quot;gone&quot;                 android:text=&quot;No result&quot; android:padding=&quot;15dp&quot; android:gravity=&quot;center_horizontal&quot;/&gt;        &lt;ScrollView android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot; android:scrollbars=&quot;none&quot; android:id=&quot;@+id/scrollView&quot; &gt;            &lt;RelativeLayout android:id=&quot;@+id/parentItemView&quot; android:layout_height=&quot;wrap_content&quot; android:layout_width=&quot;fill_parent&quot;&gt;            &lt;/RelativeLayout&gt;        &lt;/ScrollView&gt;    &lt;/LinearLayout&gt;&lt;/ViewFlipper&gt;</code></pre>","288156","","288156","","2010-09-19 08:21:09","2011-06-17 18:41:21","Viewflipper Receiver not registered error while orientation change in 2.1 and 2.2","<android><screen-orientation><viewflipper><android-sdk-2.1><android-sdk-2.2>","2","0","1","",""
"3744987","1","3745012","","2010-09-19 08:12:40","2","1404","<p>I want to enable and disable bluetooth in android programmatically..Please help me how to do this..Thanks in advance.</p>","399046","","265167","","2011-12-16 19:36:08","2013-02-20 06:24:54","Enable Disable Bluetooth in Android","<android><bluetooth>","2","0","1","",""
"3745107","1","3745119","","2010-09-19 09:11:14","0","4647","<p>I have an imageView and want it to work like this:</p><p>ImageViewer visible</p><p>5 second pause</p><p>image view invisible</p><p>5 second pause</p><p>ImageViewer visible</p><p>and so on ...</p><p>How do I do that? I have tried sleep but it freezes the whole program in 5 seconds. I just want to affect my imageView.</p>","446752","","","","","2010-09-20 03:31:17","How can I make a imageview visible, 5 sec pause, invisible, 5 sec pause and so on","<android><imageview><visible><invisible>","2","0","1","",""
"3745167","1","3747734","","2010-09-19 09:30:38","1","3519","<p>I'm about to create a lazy image loader for images both from device and from the web for a <code>ListView</code>.I'm thinking of what to use and how, on one hand I can use a thread that pools my request (always running, and I can attach a view and an adapter and it will handle the image loading for me), cache my allready loaded images and checks for the visibility of the images before I load so I wont do unneeded job.</p><p>I had another thought of using the <code>AsyncTask</code> like many suggest in the forum. Terhe is one drawback though. I see that many use <code>new MyTask().execute(urls);</code>  this presents a problem if I want to start loading and stop loading images on demand.If I use the async task per image then I need new async task for each image, that's a lot of 'new' to make, I can use a pool, but if too many async tasks are stuck, I will still create about 150-200 asyc tasks, too many for my taste...</p><p>What do you guys think ? I think a thread will do a nicer job here:</p><ol><li>keep on running till killed</li><li>try to get a job from the queue, if not jobs, wait.</li><li>if a job is available, get it and start processing.</li><li>each request is processed alone,serially and blocks the thread.</li><li>once does goes on with '2'.</li><li>each enqueue that is done by the adapter using <code>startLoadingImage()</code> for views that need to be displayed will create  anew job and call notify on the wait lock.</li></ol><p>I can optimize this code with a pool of threads if I want several GET\POST requests in parallel.Also I'm caching the images I already downloaded \ loaded for fast load on next access. the idea is to minimize GC and list's slagging.</p>","312288","","431396","","2011-09-21 11:54:16","2011-09-21 11:54:16","AsyncTask preformance issue on many AsyncTasks spawning","<android><listview><android-asynctask><lazy-loading>","2","0","1","",""
"3745184","1","","","2010-09-19 09:37:21","1","2468","<p>I'm going to build an application that allows an Android to connect to other phone's DUN (dial-up) bluetooth service, to use this other phone as an internet modem.</p><p>It seems like dund is included into Android (i'm targetting at 2.1 -- not sure if it is actually included there?), so I wonder if it supports ""dund --connect"" command not just --listen?</p><p>Or, maybe, there're other ways to implement that? Existing software maybe?</p><p>Thanks a lot in advance!</p>","337757","","","","","2012-07-12 09:45:58","Does Android's DUND support DUN DT (aka Dial Up client aka Data Terminal aka ""dund --connect"")","<android><bluetooth>","1","0","","",""
"3745208","1","","","2010-09-19 09:50:02","0","400","<p>I have a simple ListView in my application. What I want to do on a row select is to expand it and show additional details in there and then if some other is selected then collapse the previous one and expand the new one.</p><p>I can modify the contents list item row in ""onListItemClick"" method. However how do I animate the change in height of the list item row.</p><p>Is there a better way to do it? Or is there a better component still? I don't want to use the expandable list as it's not a group of child lists, instead just expanding the contents with more details.</p><p>Any help is much appreciated.Cheers</p>","57847","","967945","","2013-08-26 15:34:44","2013-08-26 15:34:44","How do I animate ListView item hights?","<android><animation><android-listview>","1","0","","",""
"3745254","1","3745385","","2010-09-19 10:02:39","4","527","<p>Is there open code available for implementing a time selector like the one used in HTC Sense?It's a wheel and the user can push it up or down to select higher or lower number.If there isn't code available, how do I go about implementing it?At best I would like to have a 59 beneath the 00 to be more like a real wheel.</p><p><img src=""http://i.stack.imgur.com/V0lji.png"" alt=""htc number wheel""></p>","25282","","25282","","2010-09-19 10:15:24","2010-09-19 10:52:03","How to implement HTC Sense style time selectors in android?","<android>","1","0","","",""
"3745276","1","","","2010-09-19 10:10:42","0","246","<p>I am changing the language in <code>MainActivity.onCreate()</code> like this:</p><pre><code>Locale locale = new Locale(""cs"");Configuration config = getResources().getConfiguration();config.locale = locale;getResources().updateConfiguration(config, getResources().getDisplayMetrics());</code></pre><p>It works OK at first look, the layout is in he correct language. But when I open the menu, it is localized to the system default language (English)! To find out what's happening I checked every 30ms (via <code>Timer</code>) what is the value of <code>getResources().getConfiguration().locale.getLanguage()</code>. About 50ms after <code>onResume()</code> is finished, the language magically changes from ""cs"" to ""en"".</p><p>I tried to set it back after I detect the change, but it was not working. What worked was if I set the language again to ""cs"" in <code>onCreateOptionsMenu()</code>.</p><p><strong>Important note:</strong> this happens only if the app is started after it was previously killed. By ""killed"" I don't mean <code>MainActivity.finish()</code> is called but rather that the app is completely removed from the memory including static fields (in practice this happens after install or if the system kills it due to low memory).</p><p><strong>UPDATE:</strong> Another issue I noticed is that when I change the orientation of the phone to landscape, my app still uses portrait layout and not the layout from layout-land folder.</p>","243225","","243225","","2010-09-19 11:38:59","2010-09-19 11:38:59","Changing language from my app works weirdly","<android>","0","4","","",""
"3745305","1","","","2010-09-19 10:19:13","0","2678","<p>Hey... i'm trying to create an activity with the layout structure like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;TabHost android:id=""@+id/tabHost""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;        &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;            &lt;TabWidget android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                 android:id=""@android:id/tabs""                 /&gt;             &lt;FrameLayout                android:id=""@android:id/tabcontent""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                &gt;            &lt;/FrameLayout&gt;        &lt;/LinearLayout&gt;     &lt;/TabHost&gt;     &lt;some code here&gt;&lt;/LinearLayout&gt;</code></pre><p>What is wrong here? I'm getting nullPointerException in my activity</p><pre><code>public class TabsActivity extends Activity{    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.tabs);        // Resources res = getResources();        // TabHost tabHost = (TabHost)findViewById(R.id.tabHost);   }}</code></pre><p>The problem is with nesting. There is no problem with the TabHost as the main XML node. Thx!</p><p>Error:<img src=""http://i.stack.imgur.com/WIYtx.png"" alt=""Screenshot""></p>","132257","","132257","","2010-09-19 11:59:30","2010-09-23 20:30:24","Android TabHost inside LinearLayout","<android><android-tabhost><android-linearlayout>","2","2","2","",""
"3745405","1","3752398","","2010-09-19 11:02:04","5","5531","<p>I've just started with android development and updating the UI is really bugging me :/</p><p>This is what I've got working so far -</p><pre>package projects.Move;import android.os.Bundle;import android.view.View;import android.app.Activity;import android.content.Context;import android.graphics.Canvas;import android.graphics.Paint;import android.graphics.Color;public class Move extends Activity {    private float y = 0;    private long now = 0;      private float delay = 75;    private Paint paint = new Paint();    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(new SimpleMotion(this));        paint.setColor(Color.BLACK);    }    private class SimpleMotion extends View {        public SimpleMotion(Context context) {            super(context);        }        @Override protected void onDraw(Canvas canvas) {            float x = canvas.getWidth() / 2;            canvas.drawColor(Color.WHITE);            canvas.drawCircle(x, y, 30, paint);              if(System.currentTimeMillis() - now > delay) y++;                invalidate();        }    }}</pre><p>It works fine but everybody says that doing your graphics in the main thread, so I'm trying (and failing) to pass it off to another thread. Trouble is, I have absolutely no idea how since really I've never used Threads.</p><p>The examples that Google gives on using Threads doesn't seem to be very clear and I couldn't really follow it for what I want to do. Could I ask somebody out here to give me the most basic example of how I could do what I'm doing here efficiently using Threads?</p><p>Thanks in advance :)</p>","451575","","","","","2010-09-20 14:27:32","Threading UI updates in Android","<java><android><multithreading><user-interface>","4","0","2","",""
"3745461","1","3745496","","2010-09-19 11:22:10","2","1182","<p>How can I play a video in Android? Where do I put my video file?</p>","655814","","496830","","2011-11-08 14:16:07","2011-11-08 14:16:07","How can I play a video?","<android>","2","0","1","",""
"3745491","1","4473842","","2010-09-19 11:34:15","46","58139","<p>I would like to test my application with new Samsung Galaxy Tab tablet.</p><p>What parameter should I set in emulator to emulate this device?</p><ul><li>What resolution and density should I set?</li><li>How can I indicate that this is large screen device?</li><li>What hardware does this tablet support?</li><li>What is max  heap size?</li><li>Which Android version? </li></ul>","361832","","","","","2013-07-04 21:07:37","Emulate Samsung Galaxy Tab","<android><android-emulator><tablet>","6","2","16","",""
"3745523","1","3745555","","2010-09-19 11:42:51","12","14644","<p>Can we switch off an Android phone programmatically?</p><p>Second question: how to lock and unlock the screen in Android?</p><p>I am using following snippet but it didn't work for me.</p><pre><code>KeyguardManager keyguardManager =        (KeyguardManager) getSystemService(Activity.KEYGUARD_SERVICE); KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE); lock.disableKeyguard(); // to disablelock.reenableKeygaurd();// to enable</code></pre><p>and I used the permission also.</p>","399046","","635608","","2011-12-17 09:07:34","2013-07-28 23:10:58","Programmatically switching off Android phone","<android>","4","2","9","",""
"3745884","1","3745912","","2010-09-19 13:38:37","1","1767","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4721449/enable-gps-programatically-like-tasker"">Enable GPS programatically like Tasker</a>  </p></blockquote><p>Anybody know how to enable the GPS setting automatic? Seems the ""Toggle Settings"" app can handle it, but I want to force open in my app sdk 2.1.some people said </p><pre><code> ""Method m =locationManager.getClass().getMethod(""updateProviders"", new Class[] {});                m.setAccessible(true);                m.invoke(locationManager, new Object[]{});""</code></pre><p>but  in sdk2.1  locationManager class donot have updateProviders.couled you give me some directions or code?</p><p>Please help me if you have time. </p>","233618","","233618","","2010-09-19 13:56:59","2010-09-19 13:56:59","How to enable the GPS setting automatic","<android>","1","0","0","2011-12-04 15:58:27",""
"3746005","1","3746738","","2010-09-19 14:11:15","1","4604","<p>I am  trying to push a videofile onto SDCard . But when I opened SDCARD in FIleExplorer the permission of SDCard is not showing readwrite. How to change SDCard permission to readwrite so that I can push my file into SDCard.</p><p>Thanks in Advance.</p>","429501","","","","","2011-09-14 11:39:35","how to change premission of SDCARD to Readwrite in Android 2.2 FileExplorer ","<android>","1","0","","",""
"3746076","1","","","2010-09-19 14:27:56","1","561","<p>Hi I would like to access the audio that my call manager captures while a call is active.I would like to access it before it is transmitted to the other party.</p><p>Is this possible?</p>","451965","","","","","2010-09-19 14:31:55","How to access the audio of call manager","<android><audio><call><manager>","1","0","","",""
"3746196","1","","","2010-09-19 14:59:46","0","3454","<p>I am new to Android development, and I am working on a media player app as a learning experience. I am currently trying to add a menu view that utilizes album art in a gridview. Here is my code:</p><pre><code>public class coverMenu extends Activity { private Cursor audioCursor; public String artistInput; private static final String TAG = ""coverMenu""; @Override public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.cover);        Bundle data = this.getIntent().getExtras();        String artistKey = data.getString(""artistPass"");       Toast.makeText(this, artistKey, Toast.LENGTH_LONG).show();       audioCursor = getContentResolver().query(MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI, null,          MediaStore.Audio.Albums.ARTIST + ""='"" + artistKey + ""'"", null,MediaStore.Audio.Albums.ALBUM + "" ASC"");        startManagingCursor(audioCursor);        String[]from = new String[]{MediaStore.Audio.Albums.ALBUM_ART};        int[] to = new int []{android.R.id.text1};        ListAdapter mAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1,          audioCursor, from, to);        GridView gridview = (GridView) findViewById(R.id.gridview);         gridview.setAdapter(mAdapter);</code></pre><p>My problem is that the grid item now lists the path to the art, but does not show it. Can anyone help me by explaining how to parse this into a bitmap and send it to the gridview?</p><p>I have spent some time looking at the stock Android music player, but cannot find a simple solution to this.</p><p>Any help is appreciated.</p><p>[Latest Debug:]</p><pre><code>DalvikVM[localhost:8615]        Thread [&lt;3&gt; main] (Suspended (exception RuntimeException))          ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2496          ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2512           ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119         ActivityThread$H.handleMessage(Message) line: 1863          ActivityThread$H(Handler).dispatchMessage(Message) line: 99         Looper.loop() line: 123         ActivityThread.main(String[]) line: 4363            Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]          Method.invoke(Object, Object...) line: 521          ZygoteInit$MethodAndArgsCaller.run() line: 860          ZygoteInit.main(String[]) line: 618         NativeStart.main(String[]) line: not available [native method]      Thread [&lt;13&gt; Binder Thread #2] (Running)        Thread [&lt;11&gt; Binder Thread #1] (Running)        Thread [&lt;15&gt; Binder Thread #3] (Running)</code></pre>","451987","","603744","","2012-01-16 06:52:00","2012-01-16 06:52:00","Android Album Art GridView ","<android><gridview>","1","0","2","",""
"3746361","1","","","2010-09-19 15:48:20","6","13032","<p>I want to play a video from my assets or raw folder in my app in Androidusing <code>VideoView</code> I am getting the error as video cannot be played please anyone give me a solution.</p><p>Here is the code I used</p><pre><code>VideoView vd = (VideoView)findViewById(R.id.Video);         Uri uri = Uri.parse(""android.resource:""  + R.raw.video);MediaController mc = new MediaController(this);vd.setMediaController(mc);vd.setVideoURI(uri); vd.start();</code></pre>","655814","","119895","","2011-08-15 13:15:10","2014-03-26 20:30:07","I want to play a video from my assets or raw folder","<android>","6","0","7","",""
"3746388","1","","","2010-09-19 15:55:32","0","336","<p>I am using the CameraDemo code and have added some extra functionality to it.  I have calls to <code>getFilesDir()</code> and <code>openFileInputString()</code> in both <code>CameraDemo.java</code> and <code>Preview.java</code>.  The Problem is window won't let me run because it says that both these are undefined for the type Preview.  Running 'clear project' doesn't help. It doesn't object to them in CameraDemo and I've checked the imports and I now have all the ones in CameraDemo also in Preview.   The android help seems to indicate they both are in Class File  and I have <code>import java.io.File</code> in both files.  I hope someone has a suggestion!Thanks</p>","442245","","1232277","","2013-01-04 06:56:26","2013-01-04 06:56:26","android method is undefined prob","<java><android>","0","6","","",""
"3746477","1","3746512","","2010-09-19 16:24:09","0","772","<p>I am really struggling with linking menus together.  The app I want to create os a collection of menus that leads to url links to various sites I plan to open within the application.  I have created a list activity menu with 8 options and I have eight classes with further options.  My problem is how to link the menus together. </p><pre><code>public void onCreate(Bundle icicle) {    super.onCreate(icicle);    // Create an array of Strings, that will be put to our ListActivity    String[] names = new String[] { ""P"", ""Ch"", ""Le"", ""Le"", ""B"", ""Sk"", ""Awa"", ""Tra""};    // Create an ArrayAdapter, that will actually make the Strings above    // appear in the ListView    this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_checked, names));}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    // Get the item that was clicked    Object o = this.getListAdapter().getItem(position);    String keyword = o.toString();    Toast.makeText(this, ""You selected: "" + keyword, Toast.LENGTH_LONG)            .show();        }    }</code></pre><p>At the moment all this does is print the selection using the toast method but how do I get it  to switch to the p.java class when I have selected it.  In basic I would take the names variable and say if names = p goto p.java, I have googled and although I get part of the answer I cannot figure out how to implement it.</p><p>Many Thanks In Advance.</p>","445174","","","","","2010-09-20 13:57:28","How to link classes and menus","<java><android><eclipse>","1","0","","",""
"3746531","1","","","2010-09-19 16:37:17","4","2273","<p>I want to save the SMS I have on my old Samsung SGH-D500. Since the software for it doesn't save the time for exported messages, I copied messages to the SIM card and backuped them on Android using the following code:</p><pre><code>    Cursor c = getContentResolver().query(Uri.parse(""content://sms""), null, null, null, null);    startManagingCursor(c);    String text = """";    for(String name : c.getColumnNames()){        text += name+""\t"";    }    text += ""\n"";    while(c.moveToNext()){        for(int i=0; i&lt;c.getColumnCount(); i++){            text += c.getString(i)+""\t"";        }        text += ""\n"";    }    Log.d(""sms"", text);    File root = Environment.getExternalStorageDirectory();    if(root.canWrite()){        File export = new File(root, ""sms.txt"");        try {            BufferedWriter bw = new BufferedWriter(new FileWriter(export));            bw.write(text);            bw.close();        } catch (IOException e) {            e.printStackTrace();        }    }</code></pre><p>The first problem is that it only gets the messages that are on the phone. So I have to copy each message (there's no copy all) to the phone first.<br>The second problem is that Android doesn't even recognize sent messages I put on the SIM card (SIM card is full but Android shows nothing).</p><p>I looked into the <a href=""http://source.android.com/porting/stk.html"" rel=""nofollow"">Sim Toolkit</a>, but didn't really know where to start.Isn't there something like ""content://icc/adn"" (contacts) just for SMS?</p><p>Thanks<br>Ralf</p>","452015","","","","","2011-05-24 00:03:26","Get SMS Messages from SIM card","<android><sms>","1","1","1","",""
"3746635","1","","","2010-09-19 17:07:51","0","566","<p>I'm doing a little research about this subject. It's for my blog. So, I'm looking for some experiences about this. </p><p>I have the ""user's side"" of the story, I think they want it better if it's on Spanish. But, what about the programmers? Do you make your programs multi-language? Why? Why not? Are you ok with paying somebody to translate your app or you prefer doing it yourselves? Is the benefit bigger than the costs?  </p><p>Thanks!</p>","452035","","635608","","2012-04-28 08:10:04","2012-04-28 08:10:04","Is it worth it to translate an [iPhone] / [android] app into Spanish?","<android><iphone><translation>","4","1","1","2010-09-21 00:31:56",""
"3746746","1","","","2010-09-19 17:40:43","0","5175","<p>I think this is weird question , but i do not have any clue to solve it . I want to set ringtone from my code , butt i cannot set it. I saw this questions ..<a href=""http://stackoverflow.com/questions/1986756/setting-ringtone-in-android"">http://stackoverflow.com/questions/1986756/setting-ringtone-in-android</a>and <a href=""http://stackoverflow.com/questions/1986756/setting-ringtone-in-android"">http://stackoverflow.com/questions/1986756/setting-ringtone-in-android</a></p><p>I use this code .</p><pre><code>        ContentValues values = new ContentValues();        values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());        values.put(MediaStore.MediaColumns.TITLE, ""My Song title"");        values.put(MediaStore.MediaColumns.SIZE, 215454);        values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/mp3"");        values.put(MediaStore.Audio.Media.ARTIST, """");        values.put(MediaStore.Audio.Media.DURATION, 230);        values.put(MediaStore.Audio.Media.IS_RINGTONE, true);        values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);        values.put(MediaStore.Audio.Media.IS_ALARM, false);        values.put(MediaStore.Audio.Media.IS_MUSIC, false);        //Insert it into the database        Uri uri = MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath());        Uri newUri = activity.getContentResolver().insert(uri, values);        RingtoneManager.setActualDefaultRingtoneUri(myucontext ,RingtoneManager.TYPE_RINGTONE, newUri);                             Settings.System.putString(activity.getContentResolver(), Settings.System.RINGTONE, newUri.toString());</code></pre><p>but i am getting this error</p><p>W/BackupManagerService(   52): dataChanged but no participant pkg='com.android.providers.settings' uid=10024</p><p>I cannot find why this is happening to my code ? I use log .. </p><pre><code>// this is before  i set the ringtone D/testing (  232): New uricontent://media/external/audio/media/46i set this uri to  RingtoneManager.setActualDefaultRingtoneUriD/testing (  232): Default uricontent://settings/system/ringtoneAfter seting the uri when i read the value again i found this setings :((D/dalvikvm(  221): GC freed 3861 objects / 221176 bytes in 95ms</code></pre><p>I give permission to the app ..</p><pre><code>&lt;uses-permission android:name=""android.permission.WRITE_SETTINGS"" &gt;&lt;/uses-permission&gt;      &lt;uses-permission android:name=""android.permission.CHANGE_CONFIGURATION"" &gt;&lt;/uses-permission&gt;      &lt;uses-permission android:name=""android.permission.MODIFY_AUDIO_SETTINGS"" &gt;&lt;/uses-permission&gt;</code></pre><p>Please help me overcome this error :(( ..</p>","446555","","","","","2012-03-10 19:10:19","How to set Ringtone in android?","<android><ringtone>","0","1","","",""
"3746917","1","3747372","","2010-09-19 18:26:05","2","1066","<pre><code>&lt;resources&gt;    &lt;drawable name=""red""&gt;#7f00&lt;/drawable&gt;....    &lt;color name=""solid_red""&gt;#f00&lt;/color&gt;.....&lt;/resources&gt;</code></pre><p>This is some part of the colors.xml from android samples directory. </p><p>Now my question is that,  what is the difference between defining a color in <code>&lt;drawable&gt;</code> tag and <code>&lt;color&gt;</code> tag ?</p>","255721","","","","","2010-09-19 20:36:30","Difference between defining a value in color and drawable tag?","<android><colors><drawable>","1","0","","",""
"3747139","1","","","2010-09-19 19:28:18","20","25878","<p>How can I show a <code>MediaController</code> while playing audio file? I am creating an instance of <code>MediaController</code> and calling its <code>show()</code> method, but it is not showing.Can any help me in sorting out this issue?</p>","429501","","403455","","2012-09-07 19:41:22","2014-01-11 08:10:12","How can I show a MediaController while playing audio in Android?","<android>","3","2","27","",""
"3747161","1","3747386","","2010-09-19 19:35:01","1","4994","<p>I want to pass a variable to an outer function when user clicks on ""OK"" in AlertDialog.I'm trying this for example but it won't recognize the Variable (Yup).</p><pre><code>public final void deleteBookmark(Cursor cur, int pos) {        //fetching info        ((Cursor) cur).moveToPosition(pos);        String bookmark_id = ((Cursor) cur).getString(((Cursor) cur).getColumnIndex(Browser.BookmarkColumns._ID));        String bookmark_title = ((Cursor) cur).getString(((Cursor) cur).getColumnIndex(Browser.BookmarkColumns.TITLE));        //asking user to approve delete request        AlertDialog alertDialog = new AlertDialog.Builder(Dmarks.this).create();        alertDialog.setTitle(""Delete"" + "" "" + bookmark_title);        alertDialog.setIcon(R.drawable.icon);        alertDialog.setMessage(""Are you sure you want to delete this Bookmark?"");        alertDialog.setButton(""OK"", new DialogInterface.OnClickListener() {              public void onClick(DialogInterface dialog, int which) {                 **String Yup = ""yes"";**            } });        alertDialog.setButton2(""Cancel"", new DialogInterface.OnClickListener() {              public void onClick(DialogInterface dialog, int which) {                  Context context = getApplicationContext();                  Toast.makeText(context, ""canceled"" , Toast.LENGTH_SHORT).show();            } });        alertDialog.show();        **if (Yup == ""yes"")** {         //deleting if user approved        getContentResolver().delete(Browser.BOOKMARKS_URI, ""_id = "" + bookmark_id, null);        //notifying user for deletion        Context context = getApplicationContext();        Toast.makeText(context, bookmark_title + "" "" + ""deleted"" , Toast.LENGTH_SHORT).show();        }    }</code></pre><p>I know the code is a bit messed up but it's only for the sake of understanding.</p><p>Appreciate the help!</p>","444324","","","","","2010-09-19 20:55:35","Android: Passing a variable outside from AlertDialog onClick","<android><alertdialog>","1","4","","",""
"3747415","1","3747431","","2010-09-19 20:47:55","0","785","<p>I'm just starting to play around with the android SDK, and was trying to build a simple bubble wrap app, so I could understand how custom components work. I have my onMeasure(), onSizeChanged(), onDraw() methods which create the unpopped bubble bitmaps. I have a onTouchEvent() so I know which bubble number is being touched. After this I wanted to replace the unpopped bubble with a popped bubble image, and was wondering how I could go about doing that. If I understand it right, onDraw() is only called once initially right? </p><p>Thanks in advance!</p>","388025","","","","","2010-09-19 20:53:50","How many times is onDraw() called?","<android>","1","0","","",""
"3747448","1","3747645","","2010-09-19 20:57:07","13","19135","<p>So I'm getting really confused on how to do this whole thing and I was hoping someone could break it down for me a little bit.  </p><p>I have a service that should always be running, and at certain times it needs to alert the user that a task is to be completed(probably through a notification bar icon).  When the user accepts the task, the service needs to look into the local database, construct some non primitive objects, and give them to the activity that it just started.  </p><p>I have looked all over and gotten very confused as to a proper approach so I have a few questions to help me wrap my head around it.</p><ol><li><p>If an activity creates a local SQLite database can the service and activities of that application access that same database later?</p></li><li><p>Does the service and activity need to be in the same or separate packages?  I would think no but for some reason I remember seeing something about this elsewhere.</p></li><li><p>How would I do the data transmission from the service to the activity?  I was thinking a content provider but it seems like there should be an easier way for the service to just hand off the data.  Similar to an Intent but for non primitives.</p></li></ol><p>Thanks in advance.</p>","451037","","","","","2013-03-25 14:36:48","Android: Passing data between service and activity","<android><service>","2","0","10","",""
"3747490","1","3747561","","2010-09-19 21:11:00","6","12848","<p>How to get date before one week from now in android in this format:</p><pre><code>SimpleDateFormat dateFormat = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss"");</code></pre><p>ex: now <code>2010-09-19 HH:mm:ss</code>, before one week <code>2010-09-12 HH:mm:ss</code></p><p>Thanks</p>","432848","","356895","","2013-02-28 10:19:26","2013-02-28 10:19:26","Android get date before 7 days (one week)","<java><android><date>","2","0","9","",""
"3747496","1","3747608","","2010-09-19 21:12:51","0","67","<p>I am about to write a task which will be run once in about 1 - 10 minutes.This task uses the GPS. However I am not sure about the best way to do this.Is it better to use a Service in the background with a sleep or timeout of some sort? OR am I better off using the AlarmManager Class from the android SDK?</p><p>Keep in mind it is important the task is always run (cannot afford a task to be missed because of android freeing up resources).</p>","407133","","","","","2010-09-19 21:47:50","Best way to run a check periodicly?","<android>","1","0","","",""
"3747510","1","3748145","","2010-09-19 21:16:02","0","418","<p>I have a ListView with a RadioButton in it and a LinearLayout.I want to manage the onClickListener on the LinearLayout, but I noticed 2 things:</p><p>1 - when I click on the LinearLayout it will not be highlighter; how to make it highlighted (orange) on the click or touch of the user?2 - in the LinearLayout there are 2 TextView controls and the onClickListener works only when I click on them, it doesn't work when I click out of them. How to make the onClickListener work on the entire row?</p><p>Thank you very much in advance, bye!</p>","449689","","","","","2010-09-20 01:10:57","Problem with ListView highlight element and OnClickListener","<android>","1","0","","",""
"3747850","1","3747868","","2010-09-19 23:08:43","1","916","<p>I would like to have a Toast Message appear while my app is downloading information but even if I put it before my code it doesn't appear until after the download has completed.  Putting my code in a separate thread causes many headaches but putting toast in a separate thread doesn't work either.  Is there anyway I can have this Toast message come up before this or am I just going to have to work through the headaches?</p>","445342","","","","","2010-09-19 23:38:17","Toast Immediately","<android><multithreading><paint><toast>","2","2","","",""
"3748035","1","3774573","","2010-09-20 00:25:49","0","2856","<p>I'm starting learning android development, so my knowledge is really limited at the moment.I'm trying playing with broadcasts, but I'm stuck and I can't understand what I'm doing wrong.What I'm trying to do it's just show a simple Toast from the broadcast receiver.</p><p>The Intent is a custom intent defined in the manifest:</p><pre><code>&lt;receiver android:name="".receiver.SendReceiver"" android:enabled=""true""&gt;     &lt;intent-filter&gt;   &lt;action android:name=""com.android.terralink.sem.SOCCIA""&gt;&lt;/action&gt;     &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>The receiver is defined like this:</p><pre><code>public class SearchReceiver extends BroadcastReceiver {    public void onReceive(Context context, Intent intent){   Toast.makeText(context, ""asasa"", Toast.LENGTH_SHORT).show();   }}</code></pre><p>In the first action called from the application I do this:</p><pre><code>Intent i2 = new Intent(this, SearchReceiver.class);i2.setAction(CUSTOM_INTENT);sendBroadcast(i2);</code></pre><p>I checked that the Toast code works in the Activity, but not in the broadcast.It is because the Toast can't be shown in the receiver context?</p><p>Also, another question more about android application structure.If from my Activty I allow the user to insert a string in a text box and submit (button bind), and I want the application do a search in the background and notify the user once the result is ready, is correct do the following?1) Main Activity with search box2) Start a Service that fetches the data, send a broadcast3) The receiver notofy the user and open an Activity that shows the result</p><p>Does it make sense do something like that?Or the notification should be done by the service itself before finish its job?</p><p>Thanks</p>","452208","","881229","","2014-04-01 19:52:54","2014-04-01 19:52:54","Intent & BroadcastReceiver","<android><broadcastreceiver>","3","0","","",""
"3748226","1","","","2010-09-20 01:36:48","10","9194","<p>I'm currently building a web app in android. My app runs in a webview, and loads third-party contents through iframes. The iframe size is fixed and supposed not to be changed by the content loaded. In desktop Chrome browser, it works fine and the overflow part of loaded content can be scrolled via scrollbars. However, in android webview, the iframe tends to resize itself based on the contents loaded, which leads to a mess of the page layout.Has anyone else encountered the same problem?</p>","418070","","703019","","2012-03-07 07:39:05","2014-04-16 12:11:35","android webview iframe overflow","<android><iframe><webview><overflow>","2","0","6","",""
"3748244","1","","","2010-09-20 01:42:33","1","738","<p>I want to navigate items in a tree hierarchy.</p><p>I put the items on the same level in a listview. Upon clicking the item in the listview it will open another listview to show the items in the child level.</p><p>I want the user to navigate easily to another level (parent, grandparent, grandgrandparent) without pressing the back buttons several times.</p><p>What is the best way (what type of Android controls) to handle this? Examples provided will be great.</p>","434784","","","","","2011-02-01 19:05:39","Android controls for navigation in a tree hierarchy","<android><controls><tree><navigation>","1","0","1","",""
"3748255","1","","","2010-09-20 01:46:25","48","35046","<p>I'm trying to center a button in relative layout, is this possible? I've tried the Gravity and Orientation functions but they don't do anything.</p>","452238","","31044","","2010-09-20 02:20:49","2012-07-12 02:21:59","Can you center a Button in RelativeLayout?","<android><layout>","3","8","6","",""
"3748568","1","","","2010-09-20 03:36:13","4","2883","<p>In my android, how can I launch android's compose email activity with an attachment attached?</p>","141673","","244296","","2010-09-20 03:51:49","2010-09-20 03:51:49","How can I launch android's email activity with an attachment attached in the email?","<android>","1","0","1","",""
"3748605","1","3757189","","2010-09-20 03:50:17","0","6643","<p>I am writing a very small app that just opens the camera app ready for video.  I am able to get my code to work on an Android 2.2 emulator, but it will not work on my device, Motorola Droid 1 stock 2.2 FRG22D.  Any ideas where I went wrong on this code?</p><pre><code>public class StartVid extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);final int VIDEO = 1;    Intent intent = new Intent();    intent.setClassName(""com.android.camera"",""com.android.camera.VideoCamera"");    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    startActivityForResult(intent, VIDEO );    finish();</code></pre><p>It appears ThorstenW is correct.  I would upvote your answer if I had enough rep.  You can see from the logcat that com.android.camera could not be found and throws a fatal exception.  Logcat below.</p><p>D/dalvikvm( 1159): GC_EXTERNAL_ALLOC freed 251 objects / 13456 bytes in 66msI/ActivityManager( 1086): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.goatpen.Phobos.QSVideo/.StartVid }I/ActivityManager( 1086): Start proc com.goatpen.Phobos.QSVideo for activity com.goatpen.Phobos.QSVideo/.StartVid: pid=483 uid=10092 gids={}</p><p><strong>E/AndroidRuntime(  483): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.goatpen.Phobos.QSVideo/com.goatpen.Phobos.QSVideo.StartVid}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.camera/com.android.camera.VideoCamera}; have you declared this activity in your AndroidManifest.xml?</strong></p><p><strong>E/AndroidRuntime(  483): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.camera/com.android.camera.VideoCamera}; have you declared this activity in your AndroidManifest.xml?</strong></p>","440968","","440968","","2010-09-20 23:02:34","2012-07-09 21:06:35","Starting Video Camera with Intent","<android><video><permissions><camera><android-intent>","2","1","3","",""
"3748628","1","","","2010-09-20 04:00:14","1","1287","<p>HelloIn my android application i would like to download from a  http link progressively and then play it.That is first save some bytes and play it in the meanwhile buffer the next file.Could you please let me know as how i can achieve that in android?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","420261","","2010-09-20 07:01:24","2010-11-10 05:09:29","progressive download of http links and play in android","<android>","2","0","","",""
"3748663","1","3764519","","2010-09-20 04:09:25","4","6626","<p>I have an Android application with an ASP.NET backend.  I have the registration_id for the phone as well as an auth token from google for the application server that is performing a push.  </p><p>When I make the http post request to C2DM so that the phone gets a message I keep getting the 401 Unauthorized.  Here is how I'm making the request in .NET:</p><pre><code>    WebRequest myRequest = WebRequest.Create(""https://android.apis.google.com/c2dm/send"");    myRequest.ContentType = ""application/x-www-form-urlencoded"";    myRequest.Method = ""POST"";    myRequest.Headers.Add(""Authorization"", ""GoogleLogin auth="" + authId);    // buiold the post string    StringBuilder myPost = new StringBuilder();    myPost.AppendFormat(""registration_id={0}"", regId);    myPost.AppendFormat(""&amp;data.payload={0}"", msg);    myPost.AppendFormat(""&amp;collapse_key={0}"", colKey);    // write the post-string as a byte array    byte[] myData = ASCIIEncoding.ASCII.GetBytes(myPost.ToString());    myRequest.ContentLength = myData.Length;    Stream myStream = myRequest.GetRequestStream();    myStream.Write(myData, 0, myData.Length);    myStream.Close();    // Do the actual request and read the response stream    WebResponse myResponse = myRequest.GetResponse();    Stream myResponseStream = myResponse.GetResponseStream();    StreamReader myResponseReader = new StreamReader(myResponseStream);    string strResponse = myResponseReader.ReadToEnd();    myResponseReader.Close();    myResponseStream.Close();</code></pre><p>Any help would be much appreciated.  </p>","274817","","","","","2012-03-30 11:32:33","Android C2DM getting (401) Unauthorized","<asp.net><android><oauth><android-c2dm>","3","3","3","",""
"3748678","1","","","2010-09-20 04:13:23","0","463","<p>I currently facing problem where user have the choice to enter several working experience, where every working experience include several details (company name, duration, roles etc)I don't know how should I store it since users have the freedom to add as many working experience as they have.</p><p>I have a table as below</p><pre><code>private static final String DATABASE_CREATE_WORKEXP =        ""create table workexp (work_id integer primary key, _id integer not null,"" +        ""workcompany text, workduration text, workrole text, workskills text"" +        ""workproject text, worksalary integer, workreason text,"" +        ""foreign key(_id) references user(_id));"";</code></pre><p>I have a problem while trying to insert/update and delete entries as company name can be duplicated.Any advice or suggestion?I'm glad to provide more info for you to help me.</p><p>THANKS!</p>","410487","","","","","2011-02-01 08:38:44","Android database question, need advice and suggestions","<android><sqlite>","2","0","","",""
"3748721","1","3748754","","2010-09-20 04:31:37","1","1223","<p>In my android application i am playing videos using video view.While the video is getting downloaded i am showing a progress dialog.</p><p>At times when the streaming is not supported or when there is some error an error message is displayed onto the screen.After the ok click of the error message the progress dialogue again shows the message and tries to download.</p><p>But i would like to dismiss this dialogue if there is any error messgae and as soon as the user clicks Ok and return to the video player </p><p>so that the user can go through the next or previous video.</p><pre><code>private ProgressDialog mProgressDialog;Handler myUiHandler = new Handler();         boolean m_prgisShowing = false;         private static final int DIALOG_100 = 0;        ProgressDialog mDialog2;     mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {                    public void onPrepared(MediaPlayer mp) {                        Log.i(""Manju"", ""OnPrepared"");                        myUiHandler.post(myDilgDismis);                        mVideoView.start();        protected Dialog onCreateDialog(int id) {            switch (id) {            case DIALOG_100: {                mDialog2 = new ProgressDialog(this);                mDialog2.setMessage(""buffering..."");                mDialog2.setIndeterminate(true);                mDialog2.setCancelable(true);                return mDialog2;            }            }            return null;        }        Runnable myDilgShow = new Runnable() {            public void run() {                show_My_Dialog();            }        };        Runnable myDilgDismis = new Runnable() {            public void run() {                dismiss_My_Dialog();            }        };        public void show_My_Dialog() {            m_prgisShowing = true;            showDialog(DIALOG_100);        }        public void dismiss_My_Dialog() {            if (m_prgisShowing) {                try {                    if (null != mDialog2) {                        mDialog2.dismiss();                    }                } catch (Exception e) {                    e.printStackTrace();                    m_prgisShowing = false;                }            }            m_prgisShowing = false;        }</code></pre><p>Please share your valuable suggestions.</p><p>Thanks in advance</p>","420261","","510491","","2011-04-11 11:27:05","2011-04-11 11:27:05","Dismiss progress dialogue in android","<android><streaming>","1","0","","",""
"3748727","1","3748764","","2010-09-20 04:35:05","1","1142","<p>I need to store 100 images and sounds files in SQLite. Is it possible to store this data?</p><p>How many MB of data can be stored in SQLite?</p><p>Regards</p><p>Aswan</p>","1746300","","265167","","2011-12-17 20:19:15","2011-12-17 20:19:15","Should i store images in SQLite database?","<android><sqlite>","2","0","","",""
"3748732","1","","","2010-09-20 04:37:50","1","616","<p>I have two buttons. I want one to be aligned at the top center of the application. I want to get the other button to ignore the gravity settings and go where I tell it. How do I do this?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/relative_layout""    android:layout_width=""fill_parent""     android:gravity=""center_horizontal""    android:layout_height=""fill_parent"" &gt;    &lt;Button        android:id=""@+id/the_button""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Centered Button""        android:layout_alignTop=""@id/relative_layout"" /&gt;    &lt;Button        android:id=""@+id/the_button2""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Random Button""        android:ignoreGravity=""@id/relative_layout"" /&gt; &lt;/RelativeLayout&gt;</code></pre>","452238","","272824","","2010-09-20 07:27:50","2010-09-20 07:27:50","Can't get IgnoreGravity within RelativeLayout to work","<android><xml><layout><button><relative>","1","0","","",""
"3748742","1","","","2010-09-20 04:42:41","1","121","<p>I am currently working on a new app and this is my first ever app I have attemped to make with the android os.</p><p>I am using eclipse 3.6 and using android 1.5 version as the base to make the app as compatible as I can with all android phones.</p><p>I am a newbie to java and I read a few tutorials which helped me get the app up and working but I am using webview using iframes and have the html document hosted online but I would like to have it intergrated into the app itself so that I will not have to worry if a lot of people use the app will not bring down the website.</p><p>But I also want it to be able to update all the data off the website when members want to check for updated information on the html document as I am using the html document to control the main gui.</p>","452319","","","","","2012-02-16 14:36:53","How do I intergrate a html document into the code","<html><android><eclipse-plugin>","1","2","","",""
"3748818","1","3749136","","2010-09-20 05:04:09","0","518","<p>I have been working with a Birthday reminder application for quite some time. During which, I have noticed that contact birthdays are being stored in different formats on different devices. Several of them are given below.</p><p>yyyy-MM-dd<br>yyyy-MM-dd'T'HH:mm:ss'Z'<br>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</p><p>It took many crashes and bug-reports to figure out these formats.</p><p>Now, I am having same problem all over again with <strong>dates with no year</strong>. This is a valid case and it's supported by google contacts. I own an HTC Desire and these dates are stored in my phone with the following format <strong>(--MM-dd)</strong>.</p><p>What I want to know is whether Android has any standard way of storing dates (like birthdays/anniversaries) when no year is specified? According to DateParser, it should take current year but, that's not valid. <strong>What can I do to explicitly specify that the year in a date is unknown?</strong></p><p>Thanks in advance.</p>","257752","","257752","","2010-09-20 06:13:54","2010-09-20 06:36:16","How does android store dates without year?","<android><datetime>","1","0","","",""
"3748920","1","","","2010-09-20 05:35:21","0","765","<p>How could I draw a circle surrounding a point on the map with a certain radius? this radius must be of for example 1KM and must stay 1KM on the map at all times (will get smaller when zoomed out and so on).</p><p>thanks for your help </p>","407133","","","","","2012-11-12 19:11:01","How to draw a circle around a point on a mapview?","<android>","1","0","","",""
"3748958","1","","","2010-09-20 05:49:50","0","535","<p>I have downloaded 3D list View code.And I changed it to my requirement. Now the problem is that, I displayed data on each row of Listview, but the data do not invalidate continously, instead it invalidate during scrolling.</p><p>Please tell how can i invalidate 3D ListView during rotation/stop with streaming data ?</p>","406631","","","","","2012-03-23 13:08:46","How to invalidate 3D list view with fresh data during rotation?","<android>","1","0","","",""
"3748978","1","3749132","","2010-09-20 05:57:51","1","1289","<p>I want to use a <a href=""http://developer.android.com/reference/android/widget/SlidingDrawer.html"" rel=""nofollow"">SlidingDrawer</a> in an activity, and I would love to just use the built-in tray handle, rather than try to find or create my own. I <a href=""http://github.com/commonsguy/cw-android/blob/master/Fancy/DrawerDemo/res/drawable/tray_handle_normal.png"" rel=""nofollow"">found it online</a> thanks to CommonsWare but I assume that <em>they</em> got it from the Android platform itself, so I figure it will benefit me in the long run to know where to find it, rather than just use their copy of it. I looked for it in my Android SDK installation, under <code>platforms/android-8/android.jar/res/</code> but with no success.</p><p><img src=""http://i.stack.imgur.com/wtTB0.png"" alt=""SlidingDrawer handle""></p><p>Where can I find the above image, in the Android SDK itself, rather than just downloading it? </p>","65977","","","","","2010-09-20 07:50:17","Where is the drawable for the handle of a SlidingDrawer defined?","<android><resources><drawable>","3","0","1","",""
"3749014","1","","","2010-09-20 06:09:02","2","1066","<p>I am able to draw a signature on my canvas. Now after that I want to save this signature as an image which can be used later.</p><p>I am unable to implement an <code>onClicklistener</code> on this canvas. Also I am unclear as to how this signature can be stored as an image. Please suggest?</p>","335429","","1747491","","2012-10-17 17:57:08","2012-10-17 17:57:08","Working with canvas","<android><android-canvas>","2","0","","",""
"3749297","1","3749802","","2010-09-20 07:08:23","1","4407","<p>i want to run an countdown time , in which i want to show days,hours,sec and milisec remaining for a specific date. and will be be keep changing till the end of the specific date.Hope you can understand.</p><p>Thanks in advance.  </p>","307585","","","","","2010-09-20 08:37:50","countdown timer in android","<android><timer>","1","1","","",""
"3749435","1","3904029","","2010-09-20 07:34:52","0","39","<p>friends,</p><p>i want to perform functionality same like stackoverflow tags as we do normally creating a question separated by commas in android.</p><p>i know we have auto complete text view in android any one suggest me can i use it for multi selection?</p><p>or any useful way to achieve this?</p><p>any help would be appreciated.</p>","249991","","","","","2010-10-11 06:52:49","How to achieve tags related functionality in android?","<android><layout>","1","0","","",""
"3749539","1","","","2010-09-20 07:55:20","2","4541","<p>In an application I would like to start a Service that can receive twonotification from GPS: GPS_EVENT_STARTED and GPS_EVENT_STOPPED.</p><p>To do so I've done the following code:</p><pre><code>package com.test;import android.app.Service;import android.content.Context;import android.content.Intent;import android.location.GpsStatus;import android.location.LocationManager;import android.os.IBinder;import android.util.Log;public class TestNotification extends Service {    private LocationManager mLm;    private MyListener mMyListener;    private class MyListener implements GpsStatus.Listener {        @Override        public void onGpsStatusChanged(int event) {            Log.i(""MyGps"", ""Event"");            switch(event) {            case GpsStatus.GPS_EVENT_STARTED:                Log.i(""MyGps"", ""Started"");                break;            case GpsStatus.GPS_EVENT_STOPPED:                Log.i(""MyGps"", ""Stopped"");                break;            }        }        }    @Override    public IBinder onBind(Intent arg0) {        return null;    }    @Override    public void onCreate() {        mLm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);        mMyListener = new MyListener();        mLm.addGpsStatusListener( mMyListener );    }}</code></pre><p>I also have set the following permission in manifest: ACCESS_FINE_LOCATIONI don't want to use requestLocationUpdates because it makes the GPS working everytime and send events when fixes change. </p><p>It test it on emulator and on real device (Eclair) but it doesn't work,the Service never receive any notification.</p><p>I've read in detail the following thread (<a href=""http://stackoverflow.com/questions/2021176/android-gps-status"">here</a>) but no solution work. I send it in a separate question because I only want to be informed of GPS start and stop, not fixes.</p><p>Do you have any advice on this? May be it is because I try to do it in a Service rather that in an Activity?</p><p>Thanks for reading.</p>","452447","","","","","2014-03-15 19:18:18","Get GPS start/stop events with addGpsStatusListener","<android><gps>","1","1","2","",""
"3749556","1","8063080","","2010-09-20 07:59:21","4","2095","<p>I'm encrypting a file in java and send the encrypted file and private key to android device. But while decrypting the file in Android, it gives pad block corrupted error.By the way, <strong>same decryption code works on PC</strong></p><p>Here is the encryption:</p><pre><code>public void encrypt(File inf, File outf, File publicKey, int userId, int resourceId) throws ArServerConnectionException {    // ENCRYPTION BEGIN    try {        pkCipher = Cipher.getInstance(""RSA"");    } catch (NoSuchAlgorithmException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (NoSuchPaddingException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    // create AES shared key cipher    try {        aesCipher = Cipher.getInstance(""AES"");    } catch (NoSuchAlgorithmException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (NoSuchPaddingException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    try {        makeKey();    } catch (NoSuchAlgorithmException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }            // File operation            try {        saveKey(new File(System.getProperty(""user.home"") + ""/"" + userId                + ""/keyfile""), publicKey);    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (GeneralSecurityException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    // File operation    try {        encryptFiles(inf, outf);    } catch (InvalidKeyException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    // /ENCRYPTION END}    public void saveKey(File out, File publicKeyFile) throws IOException,        GeneralSecurityException {    // read public key to be used to encrypt the AES key    byte[] encodedKey = new byte[(int) publicKeyFile.length()];    new FileInputStream(publicKeyFile).read(encodedKey);    // create public key    X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encodedKey);    KeyFactory kf = KeyFactory.getInstance(""RSA"");    PublicKey pk = kf.generatePublic(publicKeySpec);    // write AES key    pkCipher.init(Cipher.ENCRYPT_MODE, pk);    CipherOutputStream os = new CipherOutputStream(            new FileOutputStream(out), pkCipher);    os.write(aesKey);    os.close();}    public void makeKey() throws NoSuchAlgorithmException {    KeyGenerator kgen = KeyGenerator.getInstance(""AES"");    kgen.init(AES_Key_Size);    SecretKey key = kgen.generateKey();    aesKey = key.getEncoded();    aeskeySpec = new SecretKeySpec(aesKey, ""AES"");}</code></pre><p>Here is the decryption part:</p><pre><code>public class FileDecrypt {    public static final int AES_Key_Size = 256;    Cipher pkCipher, aesCipher;    byte[] aesKey;    SecretKeySpec aeskeySpec;    private String pubKeyPath=null;    private String prvKeyPath=null;    private String keyFilePath=null;    private String encFilePath=null;    private String unencFilePath=null;    public String getEncFilePath() {        return encFilePath;    }    public void setEncFilePath(String encFilePath) {        this.encFilePath = encFilePath;    }    public String getUnencFilePath() {        return unencFilePath;    }    public void setUnencFilePath(String unencFilePath) {        this.unencFilePath = unencFilePath;    }    public String getPubKeyPath() {        return pubKeyPath;    }    public void setPubKeyPath(String pubKeyPath) {        this.pubKeyPath = pubKeyPath;    }    public String getPrvKeyPath() {        return prvKeyPath;    }    public void setPrvKeyPath(String prvKeyPath) {        this.prvKeyPath = prvKeyPath;    }    public String getKeyFilePath() {        return keyFilePath;    }    public void setKeyFilePath(String keyFilePath) {        this.keyFilePath = keyFilePath;    }    public void decrypt() {        Log.i(""DECRYPT"",""**************************************************DECRYPT&amp;*******************"");        Log.i(""encFilePath"",encFilePath);        Log.i(""pubKeyPath"",pubKeyPath);        Log.i(""prvKeyPath"",prvKeyPath);        Log.i(""keyFilePath"",keyFilePath);        Log.i(""unencFilePath"",unencFilePath);        Log.i(""DECRYPT"",""********************************************DECRYPT&amp;*******************"");        try {            pkCipher = Cipher.getInstance(""RSA"");        } catch (NoSuchAlgorithmException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (NoSuchPaddingException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        try {            aesCipher = Cipher.getInstance(""AES"");        } catch (NoSuchAlgorithmException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (NoSuchPaddingException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        //DECRYPTION BEGIN        File pkf=new File(pubKeyPath);        byte[] encodedKey = new byte[(int) pkf.length()];        try {            new FileInputStream(pkf).read(encodedKey);            // create public key            X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encodedKey);            KeyFactory kf = KeyFactory.getInstance(""RSA"");            PublicKey pk = kf.generatePublic(publicKeySpec);            // write AES key            pkCipher.init(Cipher.ENCRYPT_MODE, pk);        } catch (FileNotFoundException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();        } catch (IOException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();        } catch (NoSuchAlgorithmException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (InvalidKeyException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (InvalidKeySpecException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        try {            loadKey(new File(keyFilePath), new File(prvKeyPath));        } catch (GeneralSecurityException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        try {            decrypt(new File(encFilePath), new File(unencFilePath));        }  catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        //DECRYPTION END    }    /**     * Decrypts an AES key from a file using an RSA private key     */    public void loadKey(File in, File privateKeyFile)            throws GeneralSecurityException, IOException {        // read private key to be used to decrypt the AES key        byte[] encodedKey = new byte[(int) privateKeyFile.length()];        new FileInputStream(privateKeyFile).read(encodedKey);        // create private key        PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(encodedKey);        KeyFactory kf = KeyFactory.getInstance(""RSA"");        PrivateKey pk = kf.generatePrivate(privateKeySpec);        // read AES key        pkCipher.init(Cipher.DECRYPT_MODE, pk);        aesKey = new byte[AES_Key_Size / 8];        CipherInputStream is = new CipherInputStream(new FileInputStream(in),                pkCipher);        is.read(aesKey);        aeskeySpec = new SecretKeySpec(aesKey, ""AES"");    }    /**     * Decrypts and then copies the contents of a given file.     */    public void decrypt(File in, File out) throws IOException         {        try {            aesCipher.init(Cipher.DECRYPT_MODE, aeskeySpec);        } catch (InvalidKeyException e) {            Log.i(""EXCEPTION"",""INVALID KEY EXCEPTION"");            e.printStackTrace();        }        CipherInputStream is = new CipherInputStream(new FileInputStream(in),                aesCipher);        FileOutputStream os = new FileOutputStream(out);        copy(is, os);        is.close();        os.close();    }    /**     * Copies a stream.     */    private void copy(InputStream is, OutputStream os) throws IOException {        int i;        byte[] b = new byte[2048];        while ((i = is.read(b)) != -1) {            os.write(b, 0, i);        }    }}</code></pre>","381004","","381004","","2010-09-20 08:16:29","2011-11-09 09:47:05","pad block corrupted during decryption(Android)","<java><android><encryption>","2","0","","",""
"3749602","1","3812196","","2010-09-20 08:06:15","0","1958","<p>friends,</p><p>right now i am showing list of map overlays on google map using following code</p><pre><code> mapOverlays = mapView.getOverlays();        drawable = this.getResources().getDrawable(R.drawable.balloon);        itemizedOverlay = new MarkerItemizedOverlay(drawable,this);        GeoPoint point;        OverlayItem overlayitem;         for (DalMapSearch t : Sr)         {             if(t != null)             {            point = new GeoPoint((int) (t.getLati() * 1E6),  (int) (t.getLongi() * 1E6));             overlayitem = new OverlayItem(point, heading, t.getAd_text()+"", ""+t.getLocation()+""@@""+t.getAd_id());            itemizedOverlay.addOverlay(overlayitem);             }         }         mapOverlays.add(itemizedOverlay);        // marker code goes here        mc.animateTo(myLocation);        mc.setZoom(12);         mapView.invalidate();</code></pre><p>so in such a scenario <strong>balloon</strong> is displayed i want to show other images too depened upon category or a if statement.any one guide me how can i show different images as a map overlay? for example images are imageA,ImageB,ImageC</p><p>any help would be appreciated.</p>","249991","","","","","2010-09-28 11:23:41","how to show multi color map overlays or pins in android on google map?","<android><google-maps><overlay>","1","0","1","",""
"3749608","1","","","2010-09-20 08:07:14","0","629","<p>i tryied to  custom my ListView , so i use this item layout ? list_item.xml?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:gravity=""center_vertical""    &gt;    &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/title""        android:layout_width=""fill_parent""        android:layout_height=""?android:attr/listPreferredItemHeight""        android:padding=""10dp""        android:textSize=""16dip""        android:textColor=""#000000""        android:gravity=""center_vertical""        android:background=""#FFFFFF""        android:textAppearance=""?android:attr/textAppearanceLarge""        android:layout_weight=""1""&gt;    &lt;/TextView&gt;    &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_weight=""0""        android:background=""#FFFFFF""        android:padding=""10dip""        android:gravity=""center_vertical""&gt;                        &lt;ImageView                            android:id=""@+id/pause""                            android:src=""@drawable/stop""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:onClick=""pauseBtn_onClick""                            /&gt;                        &lt;ImageView                            android:id=""@+id/play""                            android:src=""@drawable/play""                            android:layout_width=""wrap_content""                            android:layout_height=""wrap_content""                            android:onClick=""playBtn_onClick""/&gt;    &lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>just as  what you saw, there are 2 images in this layout, what i wanna do is,</p><p>when user click any item , the play_icon(the second image in the listview item) , will </p><p>disappear.</p><p>so i write code as the following :</p><pre><code>mp3_listView.setOnItemClickListener(new OnItemClickListener()         {             @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View _view, int index , long arg3)             {                 String _url = musicList.get(index).get(""link"").toString();                LinearLayout _container = (LinearLayout)mp3_listView.getChildAt(index);                RelativeLayout _container2 = (RelativeLayout) _container.getChildAt(1);                ImageView img = (ImageView)_container2.getChildAt(1);                img.setVisibility(View.INVISIBLE);                Toast.makeText(tabDigTest.this , ""GG : ""+_container.findViewById(R.id.play) , Toast.LENGTH_SHORT).show();                }}</code></pre><p>but something strange occurred .... more than one item's img be hidden because of the:</p><pre><code>img.setVisibility(View.INVISIBLE);</code></pre><p>i don't why because i only set one img to INVISIBLE ......i think i need help O_o</p>","422405","","422405","","2010-09-21 03:47:07","2010-09-21 03:47:07","android how to access customized listview item","<android>","1","0","","",""
"3749713","1","3750262","","2010-09-20 08:24:31","0","721","<p></p><p>I want to create a application where user can login with twitter account and whatever activity he does (depending on other cases) should be tweeted. </p><p>Now since twitter has removed basic authentication how to achieve this ????</p><p>Any help will be appreciated</p>","405521","","","","","2010-09-20 09:48:13","Android Twitter4j","<android><twitter4j>","1","1","","",""
"3749789","1","3750102","","2010-09-20 08:36:03","0","670","<p>I am developing an android application at the moment, and i'm facing a problem that i have no idea how to solve. My application communicates with a Tomcat Server, and i'm using ObjectOutputStream to send a Document object to my application from my servlet. There fore, i'm importing org.w3c.dom to my project. The problem i'm facing is, that I can't read the Document object with ObjectInputStream on my android device. I'm getting the following exception.</p><p>com.sun.org.apache.xerces.internal.dom: ClassNotFoundException </p><p>on the lines:           </p><pre><code>ObjectInputStream ois = new ObjectInputStream(conn.getInputStream());Document doc = (Document) ois.readObject();     ois.close();</code></pre><p>I can send and recieve any object i want without any problem, but when I try to send an object refered to the com.w3c.dom package I get this exception. Can anybody help?</p>","452492","","113158","","2010-09-20 09:29:26","2010-09-20 09:29:26","Android: com.sun.org.apache.xerces.internal.dom: classNotFoundException","<android><dom><serialization><jvm><classnotfoundexception>","1","0","","",""
"3749971","1","","","2010-09-20 09:05:25","12","3176","<p>How do you create the setError() (similar to that of a TextView/EditText) function for a Spinner? The following doesn't work:</p><p>I tried extending the Spinner class and in the constructor:</p><pre><code>ArrayAdapter&lt;String&gt; aa = new ArrayAdapter&lt;String&gt;(getContext(),                    android.R.layout.simple_spinner_item, android.R.id.text1,                    items);            aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);            setAdapter(aa);             tv = (TextView) findViewById(android.R.id.text1);            // types_layout_list_tv            ctv = (CheckedTextView) aa.getDropDownView(1, null, null);            tv2 = (TextView) aa.getView(1, null, null);</code></pre><p><code>setError</code> method:</p><pre><code>    public void setError(String str) {        if (tv != null)            tv.setError(str);        if(tv2!=null)            tv2.setError(str);        if (ctv != null)            ctv.setError(str);    }</code></pre>","356580","","724626","","2011-12-19 18:17:05","2014-03-24 13:08:12","Creating a setError() for the Spinner","<android><spinner>","4","2","4","",""
"3750063","1","","","2010-09-20 09:21:54","3","2505","<p>How to get application usage statistics on android?What I want is to access the time (in milliseconds) that each aplication is used.</p><p>Thanks</p>","452538","","","","","2012-11-19 06:55:54","Android application usage","<android><usage>","2","0","2","",""
"3750109","1","","","2010-09-20 09:28:07","13","22717","<p>I am trying to use some arguments for an Instrumentation test. I noticed that I can read system properties with <code>System.getProperty()</code> function. So I use setprop command to set a system property. For example: <code>adb shell setprop AP 123</code>.Inside my Test code I try to read this AP property with : </p><pre><code>tmp = System.getProperty(""AP""); Log.d(""MyTest"",""AP Value = "" + tmp);</code></pre><p>Then I use logcat to view this debug message but I get a null value for this property. Any ideas on what could be wrong? Note that I can still read the system property with <code>adb shell getprop AP</code> command.</p>","342863","","302328","","2010-09-20 09:40:32","2012-07-24 02:33:01","How to define and use a system property in Android Instrumentation test?","<android><adb>","3","1","3","",""
"3750133","1","","","2010-09-20 09:31:07","0","660","<p>I have created games with 3 tabs and one of the tab is the game using the onKeyDown (KEYCODE_DPAD_LEFT and KEYCODE_DPAD_RIGHT) to control the game. It is working fine if there is no tab. But now with the tab, the KEYCODE_DPAD_LEFT and KEYCODE_DPAD_RIGHT are actually controlling the tab movement instead of the game.</p><p>May I know how to let the KEYCODE_DPAD_LEFT and KEYCODE_DPAD_RIGHT is referred to the game and not the tab?</p><p>Thanks.  </p>","452550","","302328","","2010-09-20 09:38:47","2011-03-06 03:06:55","TabActivity and onKeyDown","<android><keycode><tabactivity>","1","0","0","",""
"3750301","1","","","2010-09-20 09:53:03","1","630","<p>I am using the following code for alarm, it will alert after 10 secs. Its works fine in emulator but in real device its forcely closing..can you guide me in correct way..this is my actvity..</p><pre><code>      public class Alarm1 extends Activity {/** Called when the activity is first created. */@Override    public void onCreate(Bundle savedInstanceState) {   super.onCreate(savedInstanceState);    setContentView(R.layout.main);Intent intent = new Intent(this, AlarmReceiver.class);PendingIntent pendingIntent = PendingIntent.getBroadcast(this,001000,intent,0);AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (5 * 1000), pendingIntent);Toast.makeText(this,""Alarm set"", Toast.LENGTH_LONG).show();</code></pre><p>}}`This is receiver class</p><pre><code>public class AlarmReceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {    Toast.makeText(context, ""Alarm worked"", Toast.LENGTH_LONG).show();    try{        Intent back = new Intent(context,Alarm.class);        back.addFlags(Intent.FLAG_FROM_BACKGROUND);        back.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        back.setAction(""android.intent.action.MAIN"");        back.addCategory(""android.intent.category.LAUNCHER"");        context.startActivity(back);    }    catch(Exception e){}}</code></pre><p>}</p><p>This is to play Ringtone for alarm.</p><pre><code>public class Alarm extends Activity {private MediaPlayer mp; /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.alarm);    mp = MediaPlayer.create(this, R.raw.up);    mp.start();    Button start = (Button) findViewById(R.id.Button01);    start.setOnClickListener(vvvvv);}private OnClickListener vvvvv = new OnClickListener() {    public void onClick(View v) {        mp.stop();        finish();    }};</code></pre><p>}</p><p>This is working fine in emulator but not on real device..i used permissions also..I am using Samsung Galaxy 1.6.Thanks in advance..</p>","399046","","","","","2012-10-18 20:30:46","Alarm in android","<android>","2","4","","",""
"3750325","1","3750340","","2010-09-20 09:57:01","-1","917","<p>Can anybody have any idea about how to get a small bitmap image from a big bitmap which is the combination of many bitmaps.</p>","397901","","207655","","2011-12-09 15:08:27","2011-12-09 15:08:27","get a small bitmap image from a big bitmap in android","<android><image><graphics><bitmap>","1","0","","",""
"3750361","1","6686212","","2010-09-20 10:01:48","3","929","<p>I want to pass some headers while opening a web page. Right now, I'm doing something like :<code>browserIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(data.link));startActivity(browserIntent</code>);</p><p>Now I'm stuck as I dont know how to pass headers using browserIntent. I've tried using browserIntent.putExtra() but it doesn't work.</p><p>Can anyone please help.!!</p>","395028","","413254","","2014-03-20 14:32:37","2014-03-20 14:32:37","Passing Headers while using Browser Intent","<android><android-intent><http-headers><android-webview>","2","0","","",""
"3750380","1","","","2010-09-20 10:05:19","3","17887","<p>I am trying to bind a list view to a List.  This works ok when I create an activity that extends ListActivity and I have a text view in my layout file (i.e. the activity is binding to the default listview in the activity).  However, what I would like to do is have a ListView that contains an image button (to further perform the deeltion of the row) and the text view to illustrate the name of the item being bound.  </p><p>Can anyone point me in the direction that would show how to do this that contains:</p><ul><li>The layout file</li><li>The activity class</li></ul><p>I have played around and cant seem to get it to work, as soon as I add a ListView / image button to the layout file my code crashes. I've also found a few examples through google, but none seem to work!</p>","113911","","","","","2013-07-22 13:24:31","Android ListView with delete button","<android><listview>","2","0","3","",""
"3750391","1","","","2010-09-20 10:06:32","1","1934","<p>I got all images from device's gallery,but i got images path is like <code>content://media/external/image/media/102</code>,so i want to get real image path for each images and send email,how can i get path?given below code i used,anybody knows,please give some sample code for me..i have email code.i want to only get real image path.How can I convert this path to real one (just like '<code>/sdcard/image.png'</code>) ?</p><pre><code>Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);photoPickerIntent.setType(""image/*"");startActivityForResult(photoPickerIntent, 1);</code></pre>","410757","","410757","","2010-09-20 10:16:46","2010-09-20 10:46:19","how can i get real path in image gallery?","<android>","1","0","2","",""
"3750399","1","3750517","","2010-09-20 10:07:18","2","14557","<p>Hi guys i was wondering how to create an emulator environment for a tablet sized device, i know there are quite a few devices being released soon, but how do start sizing up my layout?</p><p>thanks</p>","445245","","","","","2012-03-18 12:12:29","Android SDK emulator (AVD) for tablet size","<android><sdk><avd><tablet>","1","1","3","",""
"3750545","1","3750984","","2010-09-20 10:31:16","0","571","<p>I am making a IM client for android and i want to know how to do the communication between a Service and Activity.</p><p>I have a Service that establish the connection to gtalk, gets the contacts, listens for the incoming messages... , and i have the activity that is the UI of my application. </p><p>In the activity i create the service and bind the activity to it. I have an aidl interface to communicate between service and the activity with this methods:</p><pre><code>  String[] getContacts();     String[] getPressence();    int setConnection(int type);    void logOut(); </code></pre><p>So far so good, i can make the connection to gtalk, i can get the contacts and the status, but now i want to do a function in the activity that listens when the service gets a message and updates the UI...</p><p>For this i made another aidl file with the metod <code>void receivedMessage(String message);</code>and whenever the service gets a message, i call that method, in the activity i display the message passed in the message String and i get an NullPointer exception.</p><p>Do i have to get the message in a handler or by some sync or async methods ? I am beginner in android and now i learn the services part so please help me .</p><p>Thank you very much! </p>","449310","","319618","","2010-09-20 10:34:19","2010-09-20 11:28:20","Service and activity communication","<android><service><activity><communication>","1","0","","",""
"3750547","1","3751849","","2010-09-20 10:31:45","3","2034","<p>I have a button in Android Application. When the button is clicked following code is invoked:</p><pre><code>TestSmack a = new TestSmack();a.login(""abc@gmai.com"",""password"");</code></pre><p>I have a TestSmack class.....in the constructor of this class i wrote</p><pre><code>public TestSmack (){    ConnectionConfiguration connConfig = new           ConnectionConfiguration(""talk.google.com"", 5222, ""gmail.com"");    connection = new XMPPConnection(connConfig);}</code></pre><p>where XMPPConnection connection is a global variable. And in the login method I try to connect to the Server:</p><pre><code>public void login(String userName, String password) throws XMPPException{    SASLAuthentication.supportSASLMechanism(""PLAIN"", 0);    connection.connect();        connection.login(userName, password);}</code></pre><p>But it crashes. I don't know whats happening.</p><p>Whereas when I call these all methods from <code>main()</code> and run a simple Java application in separate project (Java, not Android) it works fine.</p><p>I am not able to figure out whats the problem.</p><p>Thanks</p>","375061","","140185","","2010-09-20 10:41:41","2010-09-21 04:06:51","facing problem using smack on android","<android><smack>","2","0","","",""
"3750578","1","","","2010-09-20 10:35:55","1","106","<p>I use command line <code>adb shell am instrument -w -e class com.jayway.test.NotePadTest#test_function com.jayway.test/android.test.InstrumentationTestRunner</code> to execute a JUnit test case. </p><p>How can I pass command line arguments for this Test? </p>","342863","","","","","2010-09-20 10:35:55","How can I use arguments inside an Android Test application?","<android>","0","0","","",""
"3750604","1","3752069","","2010-09-20 10:39:33","0","499","<p>I am getting a response from xml which is dynamic in nature .After parsing the xml , I able to generate a tree view. Now , <strong>I want to convert the tree view structure to a List view which will have multiple List(list within list &amp; so on) depending on the depth of the xml.</strong></p><p>I am aware of the <strong>ExpandableListActivity</strong> which provide a two-levels of data.</p><p>In my case , <strong>it can be more than two levels of data rather it should be dynamic in nature</strong>.</p><p>I need any sample code to <strong>implement the dynamic List i.e a List within another List &amp; so on.</strong></p><p>Kindly help</p><p>Chiranjib</p>","443141","","","","","2010-09-20 13:48:04","Develop list within List in Android","<android>","1","1","1","",""
"3750609","1","4321989","","2010-09-20 10:40:38","0","1110","<p>I have a Thread that downloads data from internet </p><pre><code>public class Bp implements Runnable{Handler myHandler;public void setHandler(Handler myHandler){ this.myHandler=myHandler; }....myHandler.sendEmptyMessage (0);}</code></pre><p>There is an activity that needs to be updated according to downloaded data.</p><pre><code>public class Hp extends Activity implements Runnable{....public Handler myHandler = new Handler() {  public void  handleMessage(Message msg) { //TODO handle myHandler from ""Bp"" Thread      //TODO remove Queue's View    if(m_adapter2.getCount ()==6)   {    m_adapter2.remove (queue);         //removing view named queue from adapter    m_adapter2.notifyDataSetChanged ();   }  }};</code></pre><p>Whenever I run above code I get NullPointer Exception .Please help me to update the view.</p>","437703","","437703","","2010-09-20 14:27:11","2012-01-15 08:47:20","android:Handler from a Runnable throws Null Pointer Exception","<android><handler><runnable>","2","3","0","",""
"3750712","1","","","2010-09-20 10:53:40","0","111","<p>I am really struggling with linking menus together. The app I want to create is a collection of menus that leads to url links to various sites I plan to open within the application. I have created a list activity menu with 8 options and I have eight classes with further options. My problem is how to link the menus together.  I ask the question and someone said that I should map.  Here is the code:</p><pre><code>public class MyList extends ListActivity {private static final String Cp = null;private static final String Pp = null;private static final String L2 = null;private static final String L1 = null;/** Called when the activity is first created. */public void onCreate(Bundle icicle) {    super.onCreate(icicle);    // Create an array of Strings, that will be put to our ListActivity    String[] names = new String[] { ""Pp"", ""Cp"", ""L1"", ""L2"", ""Bt"", ""Se"", ""As"", ""Travel""};    // Create an ArrayAdapter, that will actually make the Strings above    // appear in the ListView    this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_checked, names));}{Map&lt;String, Runner&gt; runners = new HashMap&lt;String, Runner&gt;();runners.put(""Pp"", (Runner) new Pp());runners.put(""Cp"", (Runner) new Cp());runners.put(""L1"", (Runner) new L1());runners.put(""L2"", (Runner) new L2());public void onListItemClick(runners.get(getListView()).L2();runners.get(getListView()).L1();runners.get(getListView()).Pp();runners.get(getListView()).Cp(); {</code></pre><p>I have setup a class called runners and added the next menu within each option like so:</p><p>public interface Runner {</p><pre><code>void L2();void L1();void Pp();void Cp();}</code></pre><p>At the moment I get one error at this line public void onListItemClick(runners.get(getListView()).League2();void is an invalid type for the variable onListItemClick, have I done this correctly, am I missing something, is this the way I should use this method??</p>","445174","","","","","2010-09-20 14:35:00","Linking menus together","<java><android><eclipse>","1","0","1","",""
"3750776","1","3751283","","2010-09-20 11:02:23","2","4157","<p>I have two activities</p><p>The first one gets some data from a content provider, and displays it</p><p>The second activity has a button, and when clicked it should call the first activity to ""refresh"", in other words to reload data from the content provider</p><p>This is my first activity</p><pre><code>...@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         setContentView(R.layout.contactsview);            // Grab data and put it onto screen                getDataAndPutToUI();    }    @Override    public void onStart()    {       //Refresh data           getDataAndPutToUI();    }...</code></pre><p>And this is my second activity</p><p>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         setContentView(R.layout.optionsview);</p><pre><code>    Button button = (Button) findViewById(R.id.intentButton);        button.setOnClickListener(this);}   // This is bound to the ""refresh"" button    @Overridepublic void onClick(View v) {    // Call first activity, to reload the contacts            Intent i = new Intent(this, FirstActivity.class);    startActivity(i);}</code></pre><p>Is this the correct way to be implementing such functionality? It feels incorrect, but I can't determine any reasons to backup my claims</p>","155695","","","","","2010-09-20 12:04:49","Android; How can I initialise state in one activity, then have another refresh that?","<android><android-2.2-froyo><android-lifecycle>","2","0","1","",""
"3750789","1","3750918","","2010-09-20 11:03:26","1","670","<p>Im trying to do a very simple thing (showing a populated listView) but im not able. My code is not working and i cant find what's wrong, so i hope someone else can help me :)</p><p>My XML where i have the listView defined:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:padding=""10px""&gt;&lt;TextView    android:id=""@+id/descripcion""    android:text=""@string/descripcion""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    /&gt;&lt;ListView    android:id=""@+id/listaConfig""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>The Activity:</p><pre><code>public class s_config extends Activity {    public ArrayAdapter&lt;String&gt; lvAdapter;    public ListView lv;    @Override    public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.s_config);       final String[] datos = new String[]{""Elem1"",""Elem2"",""Elem3"",""Elem4"",""Elem5""};      lvAdapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,datos);      lv = (ListView) findViewById(R.id.listaConfig);      lv.setAdapter(lvAdapter);    }}</code></pre><p>When i launch the app, it goes fine, the TextView of the XML is showed but no signs of the ListView... Am i missing something?</p>","446234","","","","","2010-09-20 11:23:24","Why is not populating the listView?","<android><android-listview><android-adapter>","1","0","","",""
"3750845","1","3754886","","2010-09-20 11:10:03","-1","1195","<p>I have this code in my DataBase Helper:</p><pre><code>public ArrayList&lt;ArrayList&lt;Object&gt;&gt; getAllRowsAsArrays(){    // create an ArrayList that will hold all of the data collected from    // the database.    ArrayList&lt;ArrayList&lt;Object&gt;&gt; dataArrays = new ArrayList&lt;ArrayList&lt;Object&gt;&gt;();    // this is a database call that creates a ""cursor"" object.    // the cursor object store the information collected from the    // database and is used to iterate through the data.    Cursor cursor;    try    {        // ask the database object to create the cursor.        cursor = db.query(                TABLE_NAME,                new String[]{TABLE_ROW_NAME},                null, null, null, null, null        );        // move the cursor's pointer to position zero.        cursor.moveToFirst();        // if there is data after the current cursor position, add it        // to the ArrayList.        if (!cursor.isAfterLast())        {            do            {                ArrayList&lt;Object&gt; dataList = new ArrayList&lt;Object&gt;();                dataList.add(cursor.getString(1));                dataArrays.add(dataList);            }            // move the cursor's pointer up one position.            while (cursor.moveToNext());        }    }    catch (SQLException e)    {        Log.e(""DB Error"", e.toString());        e.printStackTrace();    }    // return the ArrayList that holds the data collected from    // the database.    return dataArrays;}</code></pre><p>How do I use this code and show the results in a ListActivity?</p><p>Been stuck with this for the last 2 days. Any help on this is appreciated.</p><p>Thanks in advance.</p>","450534","","3527","","2010-09-20 19:33:02","2010-09-20 19:39:19","SQLite to ListActivity","<android><sqlite><listactivity>","1","0","","",""
"3750884","1","4987135","","2010-09-20 11:14:55","1","1165","<p>I'm wondering whether prepared statements in Android (instances of SQLiteStatement) are thread-safe. In particular I'm asking with regard to the following scenario:</p><p>In a ContentProvider you create a pre-compiled insert statement during onCreate. Then, in the overriden insert method you make use of this statement by binding a set of parameters to it and calling executeInsert on it.</p><p>We know that a ContentProvider has to be written in a thread-safe manner. If SQLiteStatement does not bind parameters per thread, a concurrent call to the provider's insert method would alter the statement's bindings and result in unpredictable behavior.</p><p>Android's own Contacts provider uses prepared statements in this way (http://bit.ly/bDuKAT), so I tend to believe that they are in fact thread-safe.  Looking at the source code of SQLiteStatement I don't see how though (http://bit.ly/9M1Swv).</p><p>So, is SQLiteStatement (or SQLiteProgram that is) thread-safe with respect to parameter binding or not?</p>","219293","","","","","2011-02-13 21:50:45","Is Android's SQLiteStatement (prepared statement) thread-safe? I.e. is ""bind*, bind*... execute"" atomic?","<sql><android><concurrency><thread-safety><prepared-statement>","2","0","","",""
"3750903","1","3751547","","2010-09-20 11:19:12","9","29221","<p>I want to know the context in which <code>getContentResolver()</code> is called?</p><p>I have a scenario like this:<br>I have an activity A that calls a method <code>myFunc()</code> of class B which is not an activity.<br>So, in class B I have to use <code>getContentResolver()</code>. I directly called <code>getContentResolver()</code>. It was showing error. Then I called <code>myFunc(Acitivy act)</code> from the activity and called  <code>act.getContentResolver()</code> which solved my problem. Is this the only way to call <code>getContentResolver()</code>, which means it can be used in context with activity or can be used alone.</p>","448037","","939860","","2011-12-27 16:34:19","2013-06-11 05:52:47","How can getContentResolver() be called in Android?","<android>","2","0","2","",""
"3750967","1","","","2010-09-20 11:27:00","1","359","<p>I'm a totally newbie to the Android SDK. I have been installedEclipse 3.4 (Ganymede), Android 2.1 SDK with JRE 6 updated 7.</p><p>I need to use external .jar 's, when i load that jar ineclispe,automatically abc.apk is missing and showing the error like</p><p>[2010-09-20 08:33:54 - CodeFinder]warning: Ignoring InnerClassesattribute for an anonymous inner class that doesn't come with anassociated EnclosingMethod attribute. (This class was probablyproduced by a broken compiler.)[2010-09-20 08:33:54 - CodeFinder]warning: Ignoring InnerClassesattribute for an anonymous inner class that doesn't come with anassociated EnclosingMethod attribute. (This class was probablyproduced by a broken compiler.)[2010-09-20 08:33:54 - CodeFinder]warning: Ignoring InnerClassesattribute for an anonymous inner class that doesn't come with anassociated EnclosingMethod attribute. (This class was probablyproduced by a broken compiler.)[2010-09-20 08:33:54 - CodeFinder]warning: Ignoring InnerClassesattribute for an anonymous inner class that doesn't come with anassociated EnclosingMethod attribute. (This class was probablyproduced by a broken compiler.)[2010-09-20 08:33:54 - CodeFinder]warning: Ignoring InnerClassesattribute for an anonymous inner class that doesn't come with anassociated EnclosingMethod attribute. (This class was probablyproduced by a broken compiler.)[2010-09-20 08:33:54 - CodeFinder]warning: Ignoring InnerClassesattribute for an anonymous inner class that doesn't come with anassociated EnclosingMethod attribute. (This class was probablyproduced by a broken compiler.)</p><p>[2010-09-20 08:33:54 - CodeFinder]warning: Ignoring InnerClassesattribute for an anonymous inner class that doesn't come with anassociated EnclosingMethod attribute. (This class was probablyproduced by a broken compiler.)</p><p>[2010-09-20 08:33:54 - CodeFinder]warning: Ignoring InnerClassesattribute for an anonymous inner class that doesn't come with anassociated EnclosingMethod attribute. (This class was probablyproduced by a broken compiler.)</p><p>[2010-09-20 08:33:55 - CodeFinder]1 error; aborting</p><p>[2010-09-20 08:33:55 - CodeFinder]Conversion to Dalvik format failedwith error 1</p><p>if i remove my .jar from build path then automatically abc.apk isbuild.so plz help mehow to use external jar in order to run android apps.</p>","452656","","","","","2010-09-20 11:45:01","could not load abc.apk","<android>","1","0","","",""
"3751122","1","3751807","","2010-09-20 11:44:21","4","364","<p>I have developed an application , where it provide some services to user. he has to subscribe before for 2 months , 4 months like that , he can update it by paying . Can any one tell me , is there any api provided to serve the above purpose . ?? </p><p>Thank you,</p><p>Srinivas</p>","414777","","","","","2010-09-23 07:06:44","Is there any subscription payment api in android ,user has to pay every two months , in order to access app service?","<android><subscribe>","2","0","1","",""
"3751147","1","","","2010-09-20 11:46:46","0","406","<p>In Android, if I have a circle's radius and center value, how could I measure the latitude and longitude of about 1 km periphery of that circle?</p>","450601","","1128737","","2012-01-15 09:52:43","2012-09-07 14:29:28","What are the latitude and longitude of a circle?","<android>","4","2","","",""
"3751297","1","6589487","","2010-09-20 12:07:08","11","4197","<p>Can anyone give me a comparison for android push notification services. Mainly I want to compare these services.</p><p>MQTT - <a href=""http://mqtt.org/"" rel=""nofollow"">http://mqtt.org/</a></p><p>XTIFY - <a href=""http://xtify.com/"" rel=""nofollow"">http://xtify.com/</a>  </p><p>Mobile Push - <a href=""https://labs.ericsson.com/apis/mobile-push/"" rel=""nofollow"">https://labs.ericsson.com/apis/mobile-push/</a></p><p>Google's C2DM server</p><p>Thanks </p>","303073","","747536","","2012-04-24 17:37:04","2012-04-24 17:37:04","android push notification service comparision","<android><push-notification><xtify>","1","1","9","",""
"3751321","1","","","2010-09-20 12:09:59","3","1136","<p>Does the Android 2.2 media framework support IGMP/Multicast? If yes, can anyone guide how we can do that?</p>","407364","","995926","","2012-05-05 13:54:11","2014-01-27 03:11:16","Multicast Support in Android 2.2?","<android><multicast><android-2.2-froyo>","2","1","1","",""
"3751528","1","3752267","","2010-09-20 12:37:30","1","3356","<p>I really need a help on this point because its the only thing not working in my app.I have a listview managed by an adapter that is extending BaseAdapter.</p><p>In the getview function im using the convertView to set up a OnClickListener.This OnClickListener work well when I am touching the screen but if I use the trackball of the HTC Desire, I see the row flashing on the screen, but the OnClickListener is not called...</p><p>I've read the android dev guide : <a href=""http://developer.android.com/guide/topics/ui/ui-events.html"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/ui-events.html</a>and its say that I should receive a onClick event from the trackball...</p><p>Im putting here my getview code in case someone see anything strange. If you have any idea on what I can do, please let me know.</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {        //ici on va utiliser un mécanisme de cache avec le Tag Holder        MyTag holder;                   if (convertView == null){            //On se branche sur le bon layout            // convertView = inflater.inflate(android.R.layout.simple_list_item_2, null)             convertView = inflater.inflate(R.layout.twolines, null);            holder          = new MyTag();            //on récupère les éléments du layout dans le holder            holder.txtData  = (TextView)convertView.findViewById(R.id.productTitle);            holder.txtExtra = (TextView)convertView.findViewById(android.R.id.text2);            holder.imgScreenshot = (ImageView)convertView.findViewById(R.id.Screenshot);            holder.imgFlag = (ImageView)convertView.findViewById(R.id.Flag);            //holder.mLoginButton = (LoginButton) convertView.findViewById(R.id.login);            holder.mPostButton = (ImageView) convertView.findViewById(R.id.postButton);            //sauvegarde du holder            convertView.setTag(holder);        } else {            holder = (MyTag)convertView.getTag();        }        //Facebook post button management        holder.mPostButton.setOnClickListener((OnClickListener) new OnPostClickListener(convertView.getContext(),mFacebook, Long.toString(data[position].videoId), data[position].title, data[position].publisher, data[position].imageUrl));        holder.mPostButton.setImageResource(com.cedemo.scan.utils.getPostButtonResId());        //data update        if(data[position].title != null)            holder.txtData.setText(data[position].title);        if(data[position].publisher != null)            holder.txtExtra.setText(data[position].publisher);        //get and set the language flag        if(data[position].language != null)            holder.imgFlag.setImageResource(com.cedemo.scan.utils.getFlag(data[position].language));        //set the screenshot        if(data[position].myVideoScreenshotBm != null)            holder.imgScreenshot.setImageBitmap(data[position].myVideoScreenshotBm);                    /* =================================================================                       THIS FUNCTION IS NOT CALLED WHEN I CLICK ON THE TRACKBALL                       BUT IS CALLED WHEN I TOUCH THE SCREEN.                       WHEN I USE THE TRACKBALL THE SELECTED ROW IS FLASHING ONCE.                       ================================================================= */        //set the click mechanic if there is a valid video url        if(data[position].url != null) {            convertView.setOnClickListener((OnClickListener) new OnProductClickListener(position));        }        return convertView;    }</code></pre>","429222","","","","","2010-09-20 14:11:17","android onClick event not firing","<android><click><onclick><htc>","1","2","1","",""
"3751663","1","4107345","","2010-09-20 12:57:22","5","510","<p><a href=""http://developer.android.com/guide/topics/ui/themes.html#ApplyingStyles"">Here</a> they write: </p><blockquote>  <p>To apply a style definition as a theme, you must apply the style to an Activity or application in the Android manifest. When you do so, every View within the  Activity or application will apply  each property that it supports. For  example, if you apply the CodeFont  style from the previous examples to an  Activity, then all View elements that  support the text style properties will  apply them.</p></blockquote><p>So, when I set TextColor to Red, do ALL Elements with Text change to red?? Arent there powerful specifier like in CSS style-sheets? I just see the concept of styles (<code>style=""@style/CodeFont""</code>) practicable.</p><p><a href=""http://developer.android.com/guide/topics/ui/themes.html#ApplyingStyles"">1</a>: <a href=""http://developer.android.com/guide/topics/ui/themes.html#ApplyingStyles"">http://developer.android.com/guide/topics/ui/themes.html#ApplyingStyles</a><em>emphasized text</em></p>","433718","","","","","2010-11-05 15:25:24","Android: Do I just have one shot per property through the use of themes? Is there nothing like CSS in Android?","<android><themes><android-layout><android-xml><android-styles>","2","0","2","",""
"3751758","1","3752698","","2010-09-20 13:09:10","1","893","<p>I'v encountered a problem with Google Maps on Android. In my app I have a location-chooser where the user navigates to his desired location to save the exact street location. In order for the user to actually see what street he is no (and not just the general area) I need to mark the middle of the map clearly.</p><p>The problem is that the reticle (the little circle marking the center) from Google Maps usually won't show. It appears at the most 1 out of 10 times I open the map, probably less. This happens regardless if I add other overlays or if I just show the map as is. I am aware of ReticleDrawMode and have tried setting it to DRAW_RETICLE_OVER, but this does not seem to work (and it should be the default already).</p><p>Have I missed something here? I have searched for the problem and from what I have see the problem seems to be common, but I havn't seen a solution for actually forcing it to always show, only for hiding it.</p><p>If the reticle is broken, does anyone have a good suggestion for how to create a custom one? As I said the the user will navigate the map, so I can't just do a normal overlay on a fixed point of the map, and the map also does not take up the full screen so drawing something over it is a bit ugly (although I guess that will be my last resort).</p>","746431","","","","","2010-09-20 15:00:58","Showing the Google Maps reticle on Android","<android><google-maps><overlay>","1","3","","",""
"3751794","1","3752345","","2010-09-20 13:14:26","1","835","<p>I would like to use self defined Environment variables in my source code. I use System.getenv() to do this and the code line looks like this. <code>Log.d(""MyTest"",""== MyEnv "" + System.getenv(""AP"") + "" ANDROID_ASSETS:"" + System.getenv(""ANDROID_ASSETS""));</code> </p><p>before I execute my code I define my AP variable with export: <code>export AP=""12345""</code> and the this is my output of set command </p><pre><code>ANDROID_ASSETS=/system/appANDROID_BOOTLOGO=1ANDROID_DATA=/dataANDROID_PROPERTY_WORKSPACE=9,32768ANDROID_ROOT=/systemAP=12345</code></pre><p>...</p><p>Then I execute my code and I get this line from logcat </p><pre><code>D/MyTest( 5363): == MyEnv null ANDROID_ASSETS:/system/app</code></pre><p>The value for my defined Environment variable is null. Any suggestions on why it didn't work? </p>","342863","","","","","2010-09-20 14:21:03","How can I get user defined Environment variables?","<android>","1","0","","",""
"3751814","1","3780982","","2010-09-20 13:17:39","1","634","<p>Is there anywhere that I can find documentation on the scope of the XML files? I have an app I am currently working on and have been struggling with getting a feature to work and it seems that the problem I am having is that I am trying to access an element in an XML file that must be out of scope. To simplify the layout, my project has main.xml, sub.xml, main.java, and sub.java files in it. As you can probably guess, main.java works with main.xml and sub.java is working with the elements in sub.xml. Here's where the issue comes in, I have a TextView element that is created in main.xml that I would like to modify the text in, but the action that would trigger it will occur in sub.java. I can't figure out how to change it from sub.java, and I can't figure out how to move the element into sub.xml. The code I am using is pretty simple:</p><pre><code>TextView titleText = (TextView) findViewById(R.id.myTitle);titleText.setText(filePath);</code></pre><p>I get a FC every time I run the app, but if I move the code into main.java, it runs flawlessly. If anyone can offer any ideas, or point me in the direction of some documentation that would explain what java files can access what elements in which xml files, that would be awesome! Sorry for the novel, but I'm just struggling to get the point across. Thanks.</p>","452755","","","","","2012-05-18 00:48:04","XML scope in Android","<android><xml>","3","0","","",""
"3751898","1","","","2010-09-20 13:27:39","0","330","<p>I have a ListAdapter that displays View with contains an Edittext.When that view is focused the softkeyboard pops up.However for some reason that causes the view to lose focus. Is there a way to avoid this behavior?</p>","25282","","","","","2010-10-29 19:45:53","Fixing android softkeyboard issues","<android><android-softkeyboard>","1","0","","",""
"3751903","1","3752037","","2010-09-20 13:27:46","1","287","<p>I am using the package <code>org.json</code> package: I need help with getting the corect data from the json in java. this is the string I have in json:</p><pre><code>{""GetLocationsResult"":[{""ID"":82,""Name"":""Malmo"",""isCity"":true,""isCounty"":false,""isDisctrict"":false,""ID_Parent"":null,""ID_Map"":35,""ZipCode"":""7000""},{""ID"":82,""Name"":""Trelleborg"",""isCity"":true,""isCounty"":false,""isDisctrict"":false,""ID_Parent"":null,""ID_Map"":35,""ZipCode"":""7000""}]}</code></pre><p>This is a listing and this is just a test, it will contain more than 2 items, so my questions is, I want to get the name of all locations, I want to populate a spinner with names in my android app. </p><p>How can I get the ""Name"":""Malmo"" and so on....???</p>","371301","","251173","","2010-09-20 13:38:31","2010-09-20 13:43:58","json in java getting the correct values from a list","<java><android><json><wcf>","1","0","","",""
"3751994","1","3752056","","2010-09-20 13:38:16","1","1067","<p>I'm new to mobile phones development, but I wonder whether there is any way to develop <strong>native</strong> apps (HTML-based apps is another story) that would run both on Android and iPhone? I know that there exist applications available for both OSs, so I wonder how are they ported/developed for both targets?</p>","284428","","","","","2010-09-21 23:38:07","Developing native applications to run both on Android & iPhone?","<iphone><android>","3","2","2","",""
"3752003","1","4522675","","2010-09-20 13:39:20","3","8920","<p>I've got a dispatch/delivery/tracking application running on (ugh) Windows mobile that allows a signature capture.</p><p>I <em>really</em> want to port this to Android to give my customers another option (thankfully) from Windows mobile devices.</p><p>Is it possible to capture a signature on the device?  What are my options here?</p><p>Thanks.</p>","446347","","446347","","2010-09-20 13:53:48","2014-01-21 00:56:22","Need to implement signature capture","<android>","7","0","5","",""
"3752106","1","3752222","","2010-09-20 13:52:07","1","1428","<p>My boss recently gave me an HTC Wildfire phone for doing an Android version of one of our mobile apps, which is all fine and good, except that the app requires API level 8 (ie Android 2.2), and the phone itself only has Android 2.1 installed.  After much googling, I discovered that this phone does support Android 2.2, and carriers will be rolling out updates over the air for this model phone ""in the near future"".</p><p>Since I'm not entirely certain what our lazy carrier's definition of ""near future"" is, it would be nice if I could download images for particular releases and install them on my phone.  Coming from the world of the iPhone, it seems that this should be something rather necessary in order to successfully develop an Android app.</p><p>Yet, it doesn't seem that Google offers any Android OS updates themselves.  Have I no choice but to wait for the carrier to release an update?</p><p><strong>Edit</strong>: Thanks for the suggestions regarding the emulator, but I'm asking about testing on hardware <em>only</em>.  I already have a working 2.2 emulator image, but I need to test on hardware now, since the emulator does a very poor job of things like video playback and audio processing.</p>","14302","","14302","","2010-09-20 14:29:34","2013-05-13 19:56:54","How can I install a specific version of Android on my phone for testing?","<android>","4","2","","",""
"3752290","1","3935071","","2010-09-20 14:14:11","0","142","<p>I have an App and an AppWidget associated with it. The AppWidget is updated by an Update Service. What I want to implement is that the AppWidget only starts getting updates only when the User has logged in, much like the Facebook/Twitter Application and AppWidget functionality on Android. If the User is not logged in, the Widget will show ""Please log in"" or something.Is there a standard way to implement this functionality in Android?</p><p>Any help is much appreciated.</p>","447886","","","","","2010-10-14 15:51:47","Android AppWidget and App Single Signon","<android><appwidget>","1","0","","",""
"3752335","1","3754307","","2010-09-20 14:19:11","0","138","<p>i want to analyse the json just like:</p><p>[{""id"":""ssq"",""name"":""???"",""term"":""2010092"",""date"":""2010-08-12 19:15"",""numbers"":{""normal"":""3,13,19,27,28,30"",""special"":""2""},""jackpot"":""30000000""},{""id"":""3d"",""name"":""3D"",""term"":""2010216"",""date"":""2010-08-12 19:55"",""numbers"":{""normal"":""6,8,8""},""jackpot"":""-""},{""id"":""qlc"",""name"":""???"",""term"":""2010093"",""date"":""2010-08-11 20:45"",""numbers"":{""normal"":""08,09,10,11,16,21,27"",""special"":""26""},""jackpot"":""0""},{""id"":""dfljy"",""name"":""??6+1"",""term"":""2010093"",""date"":""2010-08-14 18:30"",""numbers"":{""normal"":""4,1,3,9,7,2"",""special"":""?""},""jackpot"":""12866531""},{""id"":""swxw"",""name"":""15?5"",""term"":""2010217"",""date"":""2010-08-12 18:45"",""numbers"":{""normal"":""1,3,5,13,15""},""jackpot"":""5693612""},{""id"":""ssl"",""name"":""???"",""term"":""20100811-23"",""date"":""2010-08-12 10:27"",""numbers"":{""normal"":""6,7,1""},""jackpot"":""-""},{""id"":""klsf"",""name"":""????"",""term"":""201021649"",""date"":""2010-08-11 22:00"",""numbers"":{""normal"":""5,11,12,14,20""},""jackpot"":""-""},{""id"":""klsc"",""name"":""????"",""term"":""2010215"",""date"":""2010-08-10 21:25"",""numbers"":{""normal"":""12,23,10,15,7,3"",""special"":""11""} ,""jackpot"":""198059""}]</p><p>i want to gain all of them,but the data is so many,so whether i need to create 8 kinds of class to store the data,so to be easier to use.thanks!</p>","445611","","","","","2010-09-20 18:29:05","how to be easier to analyse the json","<android>","2","1","","",""
"3752347","1","","","2010-09-20 14:21:12","1","918","<p>I've created service which has LocationListener in it. In order to keep service running the service is set as foreground. I have some questions about phone power management and sleeping in that circumstances:</p><ol><li>Will phone go to sleep while such service is running?</li><li>How can I save power in this stuation?</li></ol><p>Thanks in advance!</p>","452806","","","","","2012-01-19 04:58:44","GPS LocationListener and phone sleeping","<android><gps>","3","0","1","",""
"3752359","1","10152295","","2010-09-20 14:22:59","3","9126","<p>How to compress and decompress a file in android using GZip. please provide with some reference , so that it would a great help for me.</p><p>Thanks in advance</p>","384193","","1439305","","2013-02-01 16:16:41","2014-02-25 09:36:59","GZip in android","<android><gzip><gzipoutputstream>","4","1","2","","2010-09-20 14:23:09"
"3752532","1","5055767","","2010-09-20 14:43:49","2","325","<p>I am trying to <code>setText(string)</code> on a <code>TextView</code> component and I am not seeing the text I set.  The input <code>String</code> is larger than 4000 in <code>length()</code>.  I find that if I reduce the text size, the text will display.</p><p>How can I <code>setText(string)</code> on a <code>TextView</code> with all of the input <code>String</code> visible without changing the text size of the <code>TextView</code>?</p><p>Do I have to split the input <code>String</code> and use multiple <code>TextView</code> objects?</p><p>How will I know if the input <code>String</code> will be too large and not be seen, as my <code>TextView</code> may be filled with dynamic text?</p>","416412","","","","","2011-07-21 12:27:27","Setting the text of a TextView when the desired input is larger than ~4000 in String length()","<android><textview>","2","0","0","",""
"3752536","1","","","2010-09-20 14:44:22","2","1056","<p>Android:</p><p>I have an animated ImageView with an onClickEvent registered. I want the ImageView to move around the screen and then click on the ImageView. But when I click on the moving imageView, nothing happens. When I click at the position of the screen, where the imageView was at the beginning, the clickEvent is fired. So the real position of the ImageView does not move with the animation. Has anybody an idea how to get the event when someone clicks the image which is moving on the screen?</p><p>My code so far:</p><pre><code>public class OnePlayer extends Activity {private ImageView imageView;private int points;private TextView timeTextView;private TextView pointsTextView;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.oneplayer);    timeTextView = (TextView) findViewById(R.id.time);    timeTextView.setText(""01:00"");    points = 0;    pointsTextView = (TextView) findViewById(R.id.points);    pointsTextView.setText(""0/500"");    Animation animation = new TranslateAnimation(0, 100, 0, 200);    animation.setDuration(2000);    animation.setRepeatCount(-1);    animation.initialize(10, 10, 10, 10);    imageView = new ImageView(this);    imageView.setImageResource(R.drawable.plus10);    imageView.setAdjustViewBounds(true);    imageView.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));    imageView.startAnimation(animation);    imageView.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            v.clearAnimation();            v.setVisibility(View.GONE);            points += 10;            pointsTextView.setText(points + ""/500"");        }    });    RelativeLayout layout = (RelativeLayout) findViewById(R.id.oneplayergame);    layout.addView(imageView);}</code></pre><p>}</p>","452834","","","","","2012-06-14 03:39:54","ClickEvent on animated ImageView fires only at the start position","<android><animation><onclick><imageview>","1","2","","",""
"3752663","1","","","2010-09-20 14:58:08","0","1619","<p>i have noticed while working in the emulator that whenever i get out of my app via any method other than pressing the back button, my toggle button (if pressed) will have its state saved and return to that state when i return to the app. im guessing its because its value gets saved in a bundle and reloaded when i return. when i leave the app via the back button, this does not happen and the toggle is always off when i return. is there any way to get the value of the toggle back if the user leaves via the back button, without having to save the value in a db table? alternatively, if my apps notification is in the status bar, i can be confident that the toggle should always be selected, so if there is no way to save the state, is there a way to find out if my apps notification is currently being displayed? then it would be easy to just set the toggle each time via a quick check of the status bar</p><p>thx in advance</p>","452849","","","","","2010-09-20 15:18:44","Save state of an android application when the back button is pressed","<android>","1","1","","",""
"3752670","1","3962492","","2010-09-20 14:58:38","0","134","<p>My application include Text Viewer that grabs a file and shows it.For some reason this file is trancuated on Samsung Epic. My questions are:1. Why is happening only on the Epic.2. Is there an Emulator to test on Epic (since I can't reproduce this on the 2.1 or 2.2 emulator)</p><p>Ohad</p>","380490","","","","","2010-10-18 19:12:54","Android development for Samsung Epic","<android><file><textview>","1","1","","",""
"3752763","1","3756438","","2010-09-20 15:09:29","3","2050","<p>Does anyone know if there is a way to group a notification in the status bar but not in the list of notifications?</p><p>I want to show only one icon in the status bar but when the user drags down the ""notifications list"" it should be several notifications with different intents.</p><p>As I understood there is only possible to either group both notifications on both places or to create several notifications which will cause several notifications in the status bar.Is this the case?</p>","331749","","331749","","2010-09-21 10:44:35","2011-03-17 12:49:25","Android: Group notification in status bar but not in notifications list","<android><notifications>","1","0","3","",""
"3752793","1","8377281","","2010-09-20 15:13:15","2","3422","<p>I am trying to test a notification. I have created an emulator with audio playback enabled. I am able to get the notification but I am not able to hear sound. What could be the problem? Are there any settings I am missing? </p><pre><code>NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns);        int icon = R.drawable.icon;        CharSequence tickerText = ""Hello"";        CharSequence contentTitle = ""My notification"";  // expanded message title        CharSequence contentText = ""Hello"";      // expanded message text        Intent notificationIntent = new Intent(""ABC"");        PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);        long when = System.currentTimeMillis();        Notification notification = new Notification(icon, tickerText, when);        notification.defaults |= Notification.DEFAULT_SOUND;        notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);        mNotificationManager.notify(HELLO_ID, notification);</code></pre><p>When I saw logcat, I have the following stack trace. </p><pre><code>09-20 15:44:47.297: DEBUG/MediaPlayer(62): Couldn't open file on client side, trying server side09-20 15:44:47.347: ERROR/MediaPlayerService(34): Couldn't open fd for content://settings/system/notification_sound09-20 15:44:47.347: ERROR/MediaPlayer(62): Unable to to create media player09-20 15:44:47.415: WARN/NotificationService(62): error loading sound for content://settings/system/notification_sound09-20 15:44:47.415: WARN/NotificationService(62): java.io.IOException: setDataSource failed.: status=0x8000000009-20 15:44:47.415: WARN/NotificationService(62):     at android.media.MediaPlayer.setDataSource(Native Method)09-20 15:44:47.415: WARN/NotificationService(62):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:714)09-20 15:44:47.415: WARN/NotificationService(62):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:669)09-20 15:44:47.415: WARN/NotificationService(62):     at com.android.server.NotificationPlayer$CreationAndCompletionThread.run(NotificationPlayer.java:88)</code></pre>","255650","","255650","","2010-09-20 15:53:40","2011-12-04 17:47:43","Problem with notification sounds","<android><android-emulator>","2","0","1","",""
"3752889","1","3752993","","2010-09-20 15:22:37","2","3262","<p>I want to override the default android messaging application. If I receive a sms or mms I want to send that to email but i don't want any notification on phone. So basically I want to replace the default messaging application. </p><p>How can I make my application the default one that receive the sms?</p><hr><p>Thanks a lot. That is exactly what I need. But I have one more problem.I used the receiver to get the message ... but I don't know how to find the message in the phone and mark it as read.</p><pre><code>public void onReceive(Context context, Intent intent) {    // TODO Auto-generated method stub    //---get the SMS message passed in---    Bundle bundle = intent.getExtras();            SmsMessage[] msgs = null;    String str = """";                if (bundle != null)    {        //---retrieve the SMS message received---        Object[] pdus = (Object[]) bundle.get(""pdus"");        msgs = new SmsMessage[pdus.length];                    for (int i=0; i&lt;msgs.length; i++){            msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                            str += ""SMS from "" + msgs[i].getOriginatingAddress();                                 str += "" :"";            str += msgs[i].getMessageBody().toString();            str += ""\n"";                }        //---display the new SMS message---        Toast.makeText(context, str, Toast.LENGTH_SHORT).show();        //---find and mark the messages as read---        Uri uriSms = Uri.parse(""content://sms/inbox/"");       try{        Cursor c = context.getContentResolver().query(uriSms, null,null,null,null);            //---code to find the message by body and sender---            ...    }</code></pre><p>Is there any way in which I can identify the message like an id? Now I find the message comparing the bofy and sender number for all messages in inbox. </p><p>Thanks, Radu</p>","334207","","1288","","2011-08-26 11:29:27","2012-04-27 13:42:32","Override default android messaging application","<android><sms><mms>","3","0","4","",""
"3752925","1","3753256","","2010-09-20 15:26:46","0","120","<p>Is it normal, that <a href=""http://developer.android.com/guide/topics/ui/themes.html#ApplyingStyles"" rel=""nofollow"">styles</a> and includes don't have any effect in preview in Eclipse? The more I get into Layout building the less I can use the preview. Even in the newest SDK Version it's so poorly made.</p>","433718","","433718","","2010-09-22 12:50:35","2010-09-22 13:15:34","Android: Styles, Includes don't take impact on preview?","<android><eclipse><android-layout>","2","1","","",""
"3752954","1","","","2010-09-20 15:30:21","0","1370","<p>I am trying to activate bluetooth programatically in android and the application installs fine, but when I click the button to activate BT , it gives exception. I am not able to handle the exception. Any help is greatly appreciated. I am new to this.  Here is the code : </p><pre><code>package com.example.helloandroid2;import java.io.IOException;import android.app.Activity;import android.bluetooth.BluetoothAdapter;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.widget.Toast;public class HelloAndroid extends Activity { // Declare our Views, so we can access them later private Button activate_buletooth;    static final int REQUEST_ENABLE_BT = 0;    Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);    BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Set Activity Layout        setContentView(R.layout.main);         activate_buletooth = (Button)findViewById(R.id.activate_buletooth);        // Set Click Listener            activate_buletooth.setOnClickListener(new OnClickListener() {         @Override         public void onClick(View v){          if (mBluetoothAdapter == null) {              // Device does not support Bluetooth           Context context = getApplicationContext();           CharSequence text = ""BT not suported"";           int duration = Toast.LENGTH_SHORT;           Toast toast = Toast.makeText(context, text, duration);           toast.show();          }               if (!mBluetoothAdapter.isEnabled()) {              Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);              startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);          }          // startActivityForResult(discoverableIntent, REQUEST_ENABLE_BT);         }        });    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data)    {     if(requestCode == REQUEST_ENABLE_BT)        {      if(resultCode == RESULT_CANCELED)            {       Context context = getApplicationContext();       CharSequence text = ""bt not available"";       int duration = Toast.LENGTH_SHORT;       Toast toast = Toast.makeText(context, text, duration);       toast.show();            }       else             {             }        }    }}</code></pre>","170986","","","","","2013-10-10 18:33:09","android bluetooth activation error","<android><bluetooth>","1","2","","",""
"3753019","1","3753267","","2010-09-20 15:36:28","2","1754","<p>I have the following codeI want to detect the screen off of the phoneBut the function onReceive never is never calledcan anyone give me a solution.Please help.if anyone has anyother working code please help.Thank you</p><pre><code>package com.pack;import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;public class Screen extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        IntentFilter filter = new IntentFilter();        filter.addAction(Intent.ACTION_SCREEN_OFF);     Context con = this;        this.registerReceiver(new BroadcastReceiver() {              @Override              public void onReceive(Context context, Intent intent) {               System.out.println(""Screen off..................."");              }            }, new IntentFilter(Intent.ACTION_SCREEN_OFF));    }}</code></pre>","655814","","390989","","2010-09-20 15:40:29","2010-09-20 16:04:49","onReceive never called","<android>","1","0","","",""
"3753193","1","","","2010-09-20 15:56:00","1","179","<p>I'm working on a project for android that uses an external library, db4o. Well, I've created a test project and I was trying to test my PersistenceManager, an object that controls the database life-cycle and exposes part of the ObjectContainer api (ObjectContainer is an object from db4o library). When I started to write the tests, I had to access a method that returned to me an object from the db4o lib, the Query object. That caused a compilation error, since this object wasn't visible to the test project. </p><p>To try and solve this problem, I put the lib reference also on the test project, which solved the compilation problem. But when I ran the tests, I receive the following error the first time an object from db4o lib is accessed (this happens in application code, not in the test code):</p><pre><code>java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementationat br.com.jongo.referencefile.PersistenceManager.grantDBStart(PersistenceManager.java:23)at br.com.jongo.referencefile.PersistenceManager.getQuery(PersistenceManager.java:38)at... </code></pre><p>I then copied the tests to the application project. In this way, I could run the tests from the application project (making some adjustments to AndroidManifest.xml). But I really would like to have the tests in a separate project. How can I do that?</p>","450201","","","","","2010-09-20 15:56:00","Testing android project with db4o (or other referenced lib)","<android><unit-testing><testing><db4o>","0","1","1","",""
"3753331","1","3753371","","2010-09-20 16:12:22","1","1114","<p>Looking at the example code in the docs <a href=""http://developer.android.com/reference/android/content/Context.html#getExternalFilesDir%28java.lang.String%29"" rel=""nofollow"">http://developer.android.com/reference/android/content/Context.html#getExternalFilesDir%28java.lang.String%29</a></p><pre><code>File path = getExternalFilesDir(Environment.DIRECTORY_PICTURES);</code></pre><p>It does not compile on 2.1The static fields DIRECTORY_PICTURES, DIRECTORY_MUSIC etc. don't seem to be found.</p><p>Update: Using the filter api checkbox, I see that it was removed in Android 2.2 (or api version 8). So the manifest file needs to contain minSdk defined as 7.</p>","398348","","398348","","2010-09-20 16:19:20","2010-09-20 16:19:20","Have the public static fields in android.os.Environment been removed? (Android 2.1)","<android>","1","2","","",""
"3753337","1","","","2010-09-20 16:13:17","1","715","<p>So I'm making a simple game with a few irregularly shaped bitmaps drawn to the canvas every frame.</p><p>The bitmaps move around the canvas via simple motion math.</p><p>I'd like to detect when the user clicks on the bitmaps. They are PNGs with transparency of somewhat different shapes, and they are rotated via a matrix.</p><p>Is there a way to capture touch events on them?  I can't use the bounding box technique because their shape is so irregular!</p>","420775","","7565","","2010-09-20 16:14:20","2012-05-10 05:54:34","Detect touch on irregularly shaped bitmap on Android","<android><events><bitmap><touch>","0","0","","",""
"3753370","1","3753861","","2010-09-20 16:17:16","1","4798","<p>In android, is there an activity show a directory explorer to browse content of sdcard ?Like a File explorer in Java, it can show the content of current directory and I can move up to its parent by clicking '..' and move down to a child directory by clicking the name of the child directory?</p><p>Thank you.</p>","286802","","","","","2010-09-20 17:28:29","Android activity to show a directory explorer to browse content of sdcard","<android>","1","0","","",""
"3753379","1","3753425","","2010-09-20 16:19:32","1","1525","<p>I am trying to connect 2 spinners together. Meaning, the items inside 2nd spinner will depend on whatever item is chosen for the 1st spinner.</p><p>This is the code inside the main java file.</p><p>public void onCreate(Bundle savedInstanceState) {</p><pre><code>super.onCreate(savedInstanceState);setContentView(R.layout.main);Spinner spinner = (Spinner) findViewById(R.id.spinner);ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(        this, R.array.planets_array, android.R.layout.simple_spinner_item);adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);spinner.setAdapter(adapter);</code></pre><p>}</p><p>This is the code inside MyOnItemSelectedListener.java</p><p>public class MyOnItemSelectedListener implements OnItemSelectedListener {</p><pre><code>public void onItemSelected(AdapterView&lt;?&gt; parent,    View view, int pos, long id) {  Toast.makeText(parent.getContext()), ""The planet is "" +      parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();}public void onNothingSelected(AdapterView parent) {  // Do nothing.}</code></pre><p>}</p><p>So the onItemSelected function will print out the item that was chosen in 1st spinner on the screen. However, I can't figure out how to create the 2nd spinner fully based on the value inside 1st spinner.</p><p>I know that there should be something needed to be done inside onItemSelected, but I just can't figure it out since I am a newbie in Java Android.</p><p>Can you guys assist me on this?</p><p>Thank you.</p>","448732","","","","","2012-03-17 19:15:51","How to connect 2 different spinners altogether","<android><listener><spinner>","1","0","","",""
"3753436","1","","","2010-09-20 16:27:16","4","1389","<p>My Android Application needs support for various languages (like Chinese etc.). Most of them are in the DroidSansFallback.ttf file from Ascender.</p><p>See <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=data/fonts;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=data/fonts;hb=HEAD</a></p><p>On some Android Phones, there is DroidSansFallback.ttf, but with many glyphs missing, e.g. on the NexusOne that is distributed in the USA. There are no Asian Fonts Glyphs at all, mostly only Latin and related characters.</p><p>So what to do?</p><p>I added to the ""assets"" my own copy of DroidSansFallback.ttf (I also tried other fonts from other sources) and set it during runtime using the Typeface Class.</p><p>With some phones and some .ttf files, the font rendering gets completely screwed up, means the letters are just some dots in one line.</p><p>After deeper analysis, the problem boils down to:</p><ol><li>Small .ttf files seem to always work (&lt;200kB)</li><li>Large .ttf files don't work at all (>3MB)</li><li>If the phone has the full DroidSansFallback.ttf installed (which is ~3.5MB), even an 1 or 2MB font screws up. If the phone has only a ""lite"" Version of DroidSansDallback.ttf installed (which is ~1MB), a 3MB font works fine.</li></ol><p>Whats wrong here? Am I missing something? It looks like all installed/used Fonts together cannot be larger than somehwat ~4MB.</p><p>Anyone has experienced the same problem? I tried it on NexusOne (2.1), HTC Hero(2.1), SonyEricson Xperia (1.6) and Motorola MileStone(2.0), all show the same behaviour.</p><p>Thanks for any hints.</p>","273501","","273501","","2010-09-22 13:12:53","2011-05-26 20:17:47","Android: Font Rendering Problems with .ttf >3MB","<android><fonts><rendering>","1","1","1","",""
"3753494","1","3753509","","2010-09-20 16:36:17","0","565","<p>I'm filling programmatically a <code>LinearLayout</code> with some <code>TextView</code>s using the <code>addView()</code> method.</p><p>Is it even possible to let a <code>LinearLayout</code> scroll? Is there a widget that I could use instead? I tried quite a few but nothing worked. </p><p>I found a few websites that recommended to use a <code>TextView</code> to create a scrolling area, but a <code>TextView</code> won't take ""subviews"", right?</p><p>Thanks in advance!<br>S.</p>","419501","","","","","2010-09-20 16:38:37","Is it possible to scoll a LinearLayout","<android><scrolling><textview><android-linearlayout>","1","0","","",""
"3753496","1","3753545","","2010-09-20 16:36:25","0","526","<p>I`m using the class HttpURLConnection this way:</p><pre><code>HttpURLConnection con=(HttpURLConnection) servlet.openConnection();int conResponseCode = con.getResponseCode();</code></pre><p>Sometimes I`m getting conResponseCode as <strong>0</strong>.</p><p>I tried to look in the net, and couldnt find what it means?</p><p>any idea why it occours? and what it states for?</p><p>Thanks,ray.</p>","260511","","","","","2010-09-20 16:44:12","Got 0 when using HttpURLConnection.getResponseCode ()","<java><android>","1","2","","",""
"3753498","1","","","2010-09-20 16:36:36","3","2295","<p>Please kindly have a look at this. I am trying to set an alarm for a specific time and date. It does not seem to be working and i don't really know why. </p><pre><code>             Calendar cal = Calendar.getInstance();         cal.setTimeInMillis(System.currentTimeMillis());         cal.set(Calendar.YEAR, mYear);         cal.set(Calendar.MONTH,mMonth);         cal.set(Calendar.DAY_OF_MONTH,mDay);         cal.set(Calendar.HOUR,mHour);         cal.set(Calendar.MINUTE,mMinutes);// where mYear, mMonths, mDay, mHour and mMinutes are int values from the Date and Time picker dialogs respectively     Intent activate = new Intent(this, Alarm.class);     PendingIntent alarmIntent = PendingIntent.getBroadcast(this, 0, activate, 0);     alarms = (AlarmManager)getSystemService(Context.ALARM_SERVICE);     alarms.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), alarmIntent);</code></pre><p>just to let you know, it works if i replace the cal.getTimeInMillis() with System.CurrentTimeInMillis() in the alarms.set() methods.  But thats obviously what i don't want. Thanks    </p>","316843","","","","","2013-03-28 07:44:42","Set Alarms to Specific Date and Time in Android","<android>","1","0","2","",""
"3753564","1","3753599","","2010-09-20 16:46:05","0","1183","<p>At my campus, to get internet connection, I need to log on to a SSH server like they write:</p><blockquote>  <p>...you must manually log in to the firewall server, by establishing a <strong>pseudo-tty-less ssh connection</strong> to it. The following command can be used on most systems: ssh -T -l [username] [server-URL]  I must be logged on to the server for as long as I want internet.</p></blockquote><p>Does anyone have any idea how to accomplish this on Android?</p><p>I have a little experience in writing basic apps for Android, but not much with SSH, any help is appreciated.</p><p><strong>/Update</strong>Tried ConnectBot, but the server replies ""You may only connect without a pseudo-tty!"" at login attempt. I have no idea what ""pseudo-tty"" is, and I have looked in the settings of ConnectBot, there is no mention of this.</p><p><strong>/Update2</strong> Searched for any further info about the pseudo-tty-less function, in connection with OpenSSH. No luck so far, only a definition of the -T parameter which has no equivalent in ConnectBot.</p><p><strong>/bump</strong>Still very interested in any further suggestions!</p>","355942","","355942","","2010-09-22 13:19:24","2012-11-29 16:31:00","Android: Logging on to SSH server for internet access","<android><ssh>","3","1","1","2012-11-30 09:53:23",""
"3753820","1","3753853","","2010-09-20 17:21:48","2","1765","<p>how to scroll through activity when activity is in landscape mode, </p><p>Scenario: my textview has around thousand words and few buttons,how to apply scroll to this when activity is in landscape mode</p>","413770","","","","","2010-09-20 17:27:22","android:screenOrientation=""landscape"" Scroll not working","<android>","1","0","1","",""
"3753852","1","3753926","","2010-09-20 17:27:19","4","5078","<p>i am displaying images from url using xml parsing,some images are displaying very well,some time i got exception like  </p><pre><code>Illegal character in path at index 113: http://www.theblacksheeponline.com/party_img/thumbspps/12390867930_15951_186997180114_709920114_4296270_6115611_n[1].jpg</code></pre><p>How can i solve this problem,anybody know,please give some sample code for me...</p><p>Thanks All</p>","410757","","","","","2010-09-20 18:02:00","how to solve this exception Illegal character in path?","<android>","2","0","3","",""
"3754040","1","3756421","","2010-09-20 17:53:44","0","652","<p>i am storing image in External storage using MediaStore,and send email with attach that image,image saved and sent email with attachment is working fine,i want to delete that image in external storage after mail sent.anybody knows,please give sample code for me..</p><p>Thanks All,</p>","410757","","","","","2010-09-21 00:02:15","How can i delete image file in external storage after email sent?","<android>","1","0","","",""
"3754169","1","","","2010-09-20 18:09:54","6","3189","<p>I would like to implement a time settings wheel widget like the one iPhone has (<a href=""http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/art/ui_datetimepicker.jpg"">http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/art/ui_datetimepicker.jpg</a>).</p><ol><li>Should I use GlSurfaceView or just extend View?</li><li>Should I make it as a compound View (it would consist of several Views) or draw everything on the Canvas in onDraw?</li><li>In case I won't extend GlSurfaceView, how to do (smooth) animations? Start a Thread and call postInvalidate()?</li></ol>","243225","","","","","2011-04-04 20:11:35","How to implement wheel widget like in iPhone?","<android><android-widget>","3","0","3","",""
"3754217","1","3821723","","2010-09-20 18:18:38","4","7234","<p>I'm currently writing a application that allows to save drafts (using android version >= 2.0). Each draft is connected to a contact via the <code>ContactsContract.Contacts.LOOKUP_KEY</code>.My problem is that if I change the name of my contact the lookup key changes also. Is that the way this works?</p><p>So for what do I need a lookup key? I thought that the lookup key does never change and now it changes anyway. I'm confused about that behavior ...</p><p>Can someone explain to me how to link permanently to a contact? Should I use IDs instead of the lookup key?</p><p>Thanks in advance.</p>","434227","","","","","2013-09-10 19:33:35","Android: Manage contacts with lookup key","<android>","2","0","3","",""
"3754267","1","","","2010-09-20 18:24:49","0","9057","<p>My Helloworld tutorial sample builds and runs just fine, except it doesn't show the text (i.e. loads apps). The only thing I see is that Emulator (Target 2.2 API level 8) comes up with just the ""Android"" in it. and then the emulator shows up a locked up screen in a while. Here is output from the console</p><pre>[2010-09-20 10:36:55 - HelloAndroid] Android Launch![2010-09-20 10:36:55 - HelloAndroid] adb is running normally.[2010-09-20 10:36:55 - HelloAndroid] Performing com.example.HelloAndroid.HelloAndroid activity launch[2010-09-20 10:36:55 - HelloAndroid] Automatic Target Mode: Preferred AVD 'my_avd' is not available. Launching new emulator.[2010-09-20 10:37:56 - HelloAndroid] WARNING: Application does not specify an API level requirement![2010-09-20 10:37:56 - HelloAndroid] Device API version is 8 (Android 2.2)[2010-09-20 10:37:56 - HelloAndroid] HOME is up on device 'emulator-5554'[2010-09-20 10:38:23 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'[2010-09-20 10:38:27 - HelloAndroid] Installing HelloAndroid.apk...</pre><p>After I exit the emulator, I get the following errors.</p><pre>[2010-09-20 09:02:24 - DeviceMonitor]Sending jdwp tracking request failed![2010-09-20 09:38:46 - ddms]nulljava.lang.NullPointerExceptionat com.android.ddmlib.JdwpPacket.writeAndConsume(Jdwp Packet.java:213)at com.android.ddmlib.Client.sendAndConsume(Client.ja va:573)at com.android.ddmlib.HandleHello.sendHELO(HandleHell o.java:142)at com.android.ddmlib.HandleHello.sendHelloCommands(H andleHello.java:65)at com.android.ddmlib.Client.getJdwpPacket(Client.jav a:670)at com.android.ddmlib.MonitorThread.processClientActi vity(MonitorThread.java:317)at com.android.ddmlib.MonitorThread.run(MonitorThread .java:263)[2010-09-20 09:38:47 - ddms]nulljava.lang.NullPointerExceptionat com.android.ddmlib.JdwpPacket.writeAndConsume(Jdwp Packet.java:213)at com.android.ddmlib.Client.sendAndConsume(Client.ja va:573)at com.android.ddmlib.HandleHello.sendHELO(HandleHell o.java:142)at com.android.ddmlib.HandleHello.sendHelloCommands(H andleHello.java:65)at com.android.ddmlib.Client.getJdwpPacket(Client.jav a:670)at com.android.ddmlib.MonitorThread.processClientActi vity(MonitorThread.java:317)at com.android.ddmlib.MonitorThread.run(MonitorThread .java:263)[2010-09-20 09:50:11 - DeviceMonitor]Sending jdwp tracking request failed![2010-09-20 09:59:29 - DeviceMonitor]Sending jdwp tracking request failed![2010-09-20 09:59:31 - Logcat]device not foundcom.android.ddmlib.AdbCommandRejectedException: device not foundat com.android.ddmlib.AdbHelper.setDevice(AdbHelper.j ava:736)at com.android.ddmlib.AdbHelper.executeRemoteCommand( AdbHelper.java:373)at com.android.ddmlib.Device.executeShellCommand(Devi ce.java:285)at com.android.ddmuilib.logcat.LogPanel$3.run(LogPane l.java:516)[2010-09-20 10:40:46 - DeviceMonitor]Sending jdwp tracking request failed!</pre><p>Also, is there a way to capture the TEXT from CMD window that runs while the Emulator is coming up?</p>","453041","","246246","","2013-05-19 13:59:37","2014-03-27 09:25:26","Cant get helloWorld Loaded on AVD","<android>","2","1","1","",""
"3754360","1","","","2010-09-20 18:33:58","1","814","<p>I have an activity which has a thread and a view in it...they're suspiciously similar to LunarLander. To show an in-game menu, i'm calling the startActivityForResult for a different activity which has a number of buttons on it...this is then returning the button type pressed to the parent activity. This is fine except when I carry on in the parent activity, the original thread I had is now TERMINATED. I guess this is happening because the parent activity has lost focus and so the thread is considered dead, but I want to carry on with the thread.</p><p>Is there any way I can keep the thread alive? I've tried setFlags on the intent for the new activity but i've not found anything that maintains it..</p>","448851","","","","","2010-09-20 23:11:31","android startActivityForResult is killing a thread within the parent activity","<android><multithreading><activity><parent>","1","0","","",""
"3754445","1","","","2010-09-20 18:44:02","5","3180","<p>I'm new to Android and I want to make an image gallery where each column is a category, and users can scroll both vertically and horizontally. </p><p>I found a useful post about how to display list of images <a href=""http://stackoverflow.com/questions/459729/how-to-display-list-of-images-in-listview-in-android"">here</a>. I'm wondering if it's possible to nest lists of image inside of a gallery view? </p>","436323","","436323","","2010-09-20 21:20:30","2012-11-17 19:49:37","How to make a 2-dimension image gallery with both horizontal and vertical scrolling?","<android><gridview><listview><image-gallery>","2","0","3","",""
"3754449","1","","","2010-09-20 18:44:30","1","158","<p>I'm trying to get some resource usage (processor, etc) for an application I am developing, and the best way seems to be putting the 'Dev Tools' program on my phone.  I've tried as <a href=""http://developer.android.com/guide/developing/debug-tasks.html"" rel=""nofollow""> outlined on the Android Developer site </a>, but every time I try to run it, the program crashes.</p><p>The error seems to come from an invalid permission.  From the debug log:</p><p>WARN/ServiceManager(1103): Permission failure: android.permission.HARDWARE_TEST from uid=10064 pid=6697</p><p>Which then throws a security exception.  I've tried searching around, but the solutions I have tried do not seem to fix the issue.  Anyone have any ideas, or have tried (and succeeded) the same on a Motorola Droid?</p>","453045","","","","","2010-09-20 18:44:30","Running Dev Tools on Motorola Droid","<android>","0","0","1","",""
"3754453","1","","","2010-09-20 18:44:58","0","546","<p>I am having a problem where my XML files are slow to load and don't finish downloading before they start to be parsed which throws an xml not well formatted exception from my parser showing that the file downloaded incompletely.</p><p>The complete error from logcat is ""ERROR/Error(323): errororg.apache.harmony.xml.ExpatParser$ParseException: At line 10, column 46: not well-formed (invalid token)""</p><p>I know the xml file is correct because sometimes it will work and I can also pull it up in my browser and look at it.</p><p>What would be the best way to make the parser wait for the InputSource before continuing on and parsing the xml data? </p><p>The code below is the code I use to get the file and parse it.</p><pre><code>SAXParserFactory spf = SAXParserFactory.newInstance();SAXParser sp = spf.newSAXParser();XMLReader xr = sp.getXMLReader();GradeHandler gradeHandler = new GradeHandler();xr.setContentHandler(gradeHandler);URL url = new URL(""https://url/to/xml/file"");HttpsURLConnection ucon = (HttpsURLConnection)url.openConnection();ucon.setHostnameVerifier(new AllowAllHostnameVerifier());xr.parse(new InputSource(new BufferedInputStream(ucon.getInputStream())));</code></pre>","389096","","","","","2011-02-15 00:08:32","How to make the SAX Parser wait for a file to finish downloading before it is parsed?","<java><android><xml><parsing><sax>","1","0","2","",""
"3754536","1","","","2010-09-20 18:55:14","0","116","<p>I'm building some common gnu/linux console utilities for my Android phone but so far I have only been able to build them statically, with quite a size penalty. Can someone walk me through the steps for synamic compiles using shared libraries? </p><p>Here's the script(s) I'm using for configuration:</p><pre><code>./configure --host=arm-none-linux-gnueabi \CC=""arm-none-linux-gnueabi-gcc"" \CROSS_COMPILE=""arm-none-linux-gnueabi-"" \CFLAGS="" -static $_XXFLAGS"" \</code></pre><p>for shared:</p><pre><code>./configure --host=arm-none-linux-gnueabi \CC=""arm-none-linux-gnueabi-gcc"" \CROSS_COMPILE=""arm-none-linux-gnueabi-"" \--enable-shared=yes --enable-static=no</code></pre><p>Do I need to make the libs on my android phone avaiableto my cross-compiler? Google isn't helping me here.</p>","72793","","","","","2011-03-23 00:27:28","compiling synamic arm code","<android><command-line><cross-compiling>","1","0","","",""
"3754619","1","3754854","","2010-09-20 19:06:06","3","4653","<p>I am implementing an android application and i can't figure out how to solve this problem : When user clicks to the update button , i want to connect to the my server and check if there is any update on the data , if there is , i want to get data from server and update the database.Should i use xml structure to check and get updates from server or is there any smarter ways to achieve this ?</p>","426815","","","","","2010-09-20 19:52:19","How to get data from server and update the database with it?","<android><xml><database><update-site>","1","0","2","",""
"3754692","1","3754846","","2010-09-20 19:13:38","1","199","<p>I am trying to play Audio using videoView using MediaController. The Audio is playing well, when I click back key the controls returns to previous state. But when I select activity again from launch screen, activity appears but music doesnot play. Can anyone help me in sorting out this issue?The code is as follows:  </p><pre><code>public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);        setContentView(R.layout.video);        videoView = (VideoView)this.findViewById(R.id.videoView);      videoView.setVideoPath(""http://www.pocketjourney.com/downloads/pj/video/famous.3gp"");        final MediaController mc = new MediaController(this);        videoView.setMediaController(mc);        videoView.setVideoURI(Uri.parse(""http://www.pocketjourney.com/downloads/pj/tutorials/audio.mp3""));        videoView.requestFocus();        videoView.start();        videoView.setMediaController(new MediaController(this)        {            public void hide()            {                System.out.println(""HIDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEHELLLOO"");                mc.show();            }        });}public boolean onKeyDown(int keyCode, KeyEvent event) {     if (keyCode == KeyEvent.KEYCODE_BACK) {                moveTaskToBack(true);         return true;    }    return super.onKeyDown(keyCode, event);}</code></pre><p><br> Thanks in Advance</p>","429501","","234039","","2010-09-20 19:29:54","2014-03-17 15:34:50","Music does not play after clicking back key and returning to activity in Android","<android>","2","0","","",""
"3754836","1","","","2010-09-20 19:31:49","1","234","<p>Can you please tell me how does my android activity know (is there a callback) when there is a change in screen orientation?</p><p>Thank you.</p>","141673","","","","","2010-09-20 19:41:14","How does my android activity knows when the device changes in orientation","<android>","1","0","","",""
"3754941","1","3755265","","2010-09-20 19:47:04","1","988","<p>I am attempting to have my android phone connect to my servlet and send it a certain image. The way I figured I would do this, is to use the <code>copyPixelsToBuffer()</code> function and then attempt to send this to the servlet through some output stream(similar to how I would do it in a normal stand alone java application). Will this way work? If so, what kind of stream do I use exactly? Should I just use DataOutputStream and just do something like the following:</p><pre><code>ByteBuffer imgbuff;Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.icon);bm.copyPixelsToBuffer(bm);...code...URLConnection sc = server.openConnection();sc.setDoOutput(true);DataOutputStream out = new DataOutputStream( sc.getOutputStream() );out.write(imgbuff.array());out.flush();out.close();</code></pre><p>Note: I understand that this may not be the proper way of connecting to a server using the Android OS but at the moment I'm working on just how to send the image, not the connection (unless this is relevant on how the image is sent).</p><p>If this is not a way you'd recommend sending the image to the servlet (I figured a byte buffer would be best but I could be wrong), how would you recommend this to be done?</p>","278447","","157882","","2010-09-20 22:22:56","2010-09-20 22:22:56","Possible to send an image to my Servlet as a ByteBuffer?","<java><android><servlets><outputstream><android-image>","1","0","","",""
"3754977","1","3755526","","2010-09-20 19:54:00","1","803","<p>I am writing an Android App where I am playing video using VideoView,but the mediaController appears only after tapping the screen.Is this correct procedure ? If not how can we make it to appear without tapping on the screen.</p><p>Thanks in Advance,</p>","429501","","","","","2010-10-15 16:22:40","MediaController appears only after tapping in Android","<android>","2","0","0","",""
"3754989","1","","","2010-09-20 19:55:52","2","2062","<p>I'm occassionally tripping the jni global reference limit for the android emulator.  I'm trying to store around 2000 words along with definitions in my application and it's failing at either of two spots:  if I use DOM to parse the xml file with all those references it fails when DOM pulls the tree into memory.  If I use SAX it fails when I get to around the 2000th element.  </p><p>Does anyone have a link to how I can disable the check (I understand it doesn't exist on the actual machines and I am trying to persist 2000 small objects in memory)?  If not, is there a good way to debug this?  The objects that are building up are strings:</p><pre><code>09-20 16:24:00.278: WARN/dalvikvm(625):  1879 of Ljava/lang/String; 28B (1877 unique)</code></pre><p>I tried starting the avd with <code>-nojni</code> and using <code>adb</code> to set <code>dalvik.vm.checkjni</code></p><pre><code>C:\android-sdk-windows\tools&gt;adb shell getprop dalvik.vm.checkjnifalse</code></pre><p>Although logcat shows ""CheckJNI is Off"", it stills dies a the globalref 2001 limit.</p><p>Also, after the parsing section, the memory winds up getting returned as I see:</p><pre><code>09-20 16:31:23.238: DEBUG/dalvikvm(654): GC_EXPLICIT freed 1157 objects / 48208 bytes in 147ms09-20 16:31:23.258: DEBUG/dalvikvm(654): GREF has decreased to 179909-20 16:31:23.278: DEBUG/dalvikvm(654): GREF has decreased to 169909-20 16:31:23.287: DEBUG/dalvikvm(654): GREF has decreased to 159909-20 16:31:23.309: DEBUG/dalvikvm(654): GREF has decreased to 149909-20 16:31:23.328: DEBUG/dalvikvm(654): GREF has decreased to 139909-20 16:31:23.338: DEBUG/dalvikvm(654): GREF has decreased to 129909-20 16:31:23.367: DEBUG/dalvikvm(654): GREF has decreased to 119909-20 16:31:23.367: DEBUG/dalvikvm(654): GREF has decreased to 109909-20 16:31:23.398: DEBUG/dalvikvm(654): GREF has decreased to 99909-20 16:31:23.398: DEBUG/dalvikvm(654): GREF has decreased to 89909-20 16:31:23.408: DEBUG/dalvikvm(654): GREF has decreased to 79909-20 16:31:23.418: DEBUG/dalvikvm(654): GREF has decreased to 69909-20 16:31:23.418: DEBUG/dalvikvm(654): GREF has decreased to 59909-20 16:31:23.437: DEBUG/dalvikvm(654): GREF has decreased to 49909-20 16:31:23.447: DEBUG/dalvikvm(654): GREF has decreased to 39909-20 16:31:23.447: DEBUG/dalvikvm(654): GREF has decreased to 29909-20 16:31:23.469: DEBUG/dalvikvm(654): GREF has decreased to 199</code></pre><p>So I don't think it's my hashmap holding the word objects that is actually the problem.  The only idea I have left is to cut the xml file into multiples, but that seems like a might inelegant solution.</p><p>Thanks a lot!</p>","453144","","418183","","2010-11-16 23:25:04","2010-11-16 23:25:04","android excessive global references","<android><jni><emulator>","2","3","1","",""
"3755179","1","","","2010-09-20 20:22:37","0","3043","<p>I am currently sending out a DatagramPacket on a DatagramSocket and I receive just fine.. the problem is that I am receiving the packet I sent out.  If I call the receive twice then it times out.  Is there a way to ignore the first packet and receive the second.</p><p>Here is my code..</p><pre><code>            socket = new DatagramSocket(8001);            socket.setBroadcast(true);            socket.setReuseAddress(false);            DatagramPacket packet = new DatagramPacket(databytes, 7,                getBroadcastAddress(), 8001);            socket.send(packet);            String localAddress = socket.getLocalAddress().toString();            byte[] buf = new byte[1024];            DatagramPacket receivepacket = new DatagramPacket(buf, buf.length);            socket.setSoTimeout(5000);            String temp = """";            String delims = ""[/]"";            while(true)            {                try{                    socket.receive(receivepacket);                    temp = receivepacket.getAddress().toString();                    temp = temp.split(delims)[0];                    if(temp != localAddress)                    {                       }else                    {                        m_IPAddress = temp;                        break;                    }                }catch (SocketException e){                } catch (IOException e){                    String temp1 = e.toString();                }            }</code></pre>","448768","","12707","","2010-09-20 20:41:09","2010-09-21 01:11:35","Android Broadcast UDP Looping","<android><udp><broadcast>","1","0","","",""
"3755684","1","","","2010-09-20 21:33:02","1","395","<p>I have been following the <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">hello mapview tutorial</a></p><p>In the tutorial they use a custom implementation of the ItemizedOverlay class.I tried using this approach but I am getting very poor performance when I add a large number of OverlayItems.</p><p>This leads me to think that the tutorial I used is not best suited for my needs. Can anyone point me to a tutorial or documentation on what I should use when I need to add a large number of markers (&lt;500) on a mapview ?</p><p>Cheers !</p>","271395","","271395","","2010-09-21 12:13:51","2010-09-21 12:13:51","android + mapview large amount of marquers","<android><performance><android-mapview>","0","3","1","",""
"3755834","1","","","2010-09-20 21:56:16","2","1183","<p>I am in the process of trying to convert a desktop app to Android - and am struggling with some very basic stuff.</p><p>When I specify a layout including a textview that holds a sizable amount of text wrap_content seems to arbitrarily break in the middle of a word - and I can not find any documentation indicating this can be controlled.</p>","453249","","","","","2012-09-20 09:54:42","Can one prevent words from breaking in textview when using wrap_content in android","<android><textview><wrapping>","1","1","1","",""
"3755896","1","3756013","","2010-09-20 22:08:50","2","1383","<p>I have an application that is at the same time a broadcast sender and receiver of standard action android.intent.action.SET_WALLPAPER. I want to do some stuff only in a case when another application broadcasted this intent.</p><p>Is there any way to determine who initiated a broadcast in onReceive method of a BroadcastReceiver?</p>","431502","","","","","2013-03-14 17:31:38","How to determine the sender of Broadcast Intent","<android><android-intent><broadcastreceiver><broadcast>","2","0","","",""
"3755900","1","3758102","","2010-09-20 22:10:05","7","2616","<p>I am creating an app which allows for many different <code>Activities</code> to be started from a <code>TabActivity</code>(up to ~25).  Most of the activities require data from the sqlite database, so when <code>onCreate</code> is run, an <code>AsyncTask</code> creates an SQLiteOpenHelper object(which will open a readable/writable database), runs a query, data is retrieved, and everything is then closed.  </p><p>i was just testing messing around to see if i could break something, so i added every <code>Activity</code>to the <code>TabActivity's</code> <code>TabHost</code>.  I then started mashing each tab as quickly as possible.  </p><p>i noticed that very quickly i began to see in the LogCat: <code>Caused by: android.database.sqlite.SQLiteException: database is locked: BEGIN EXCLUSIVE;</code> and the app proceeded to die.</p><p>Typically there will only be about 4-6 tabs(i can just limit the user anyway) for the <code>TabHost</code>. I haven't been able to break anything with a small amount of tabs to mash, but i am still worried that maybe i am accessing the database in a poor way.</p><p>How can i prevent my SQLiteDatabase objects to cause a lock?</p><p>If i create a <code>ContentProvider</code> will that eliminate the possibility of database locking?</p><p>Do you have any suggestions for changes I could make for accessing data from an <code>SQLiteDatabase</code>?</p><p>I ended up taking the approach of using the <code>Application</code> class and storing 1 <code>SQLiteOpenHelper</code> and trying my best to keep it synchronized.  This seems to be working great - i put all my 25 activities in the <code>TabHost</code> and mashed away on them with no errors.</p><p>I am calling <code>((SQLiteDbApplication)getApplication()).setDbHelper(new DBHelper(this, Constants.DB_NAME, null, Constants.DB_VERSION_CODE));</code> method(shown below) in every <code>onCreate()</code> in my activities</p><p>Any further suggestions to this approach or to the changes i made using this <code>Application</code> class?</p><pre><code>import android.app.Application;import android.database.sqlite.SQLiteDatabase;public class SQLiteDbApplication extends Application {    private DBHelper dbHelper;    private SQLiteDatabase db;    public synchronized DBHelper getDbHelper() {        db = dbHelper.getDatabase();//returns the already opened database object        while(db.isDbLockedByCurrentThread() || db.isDbLockedByOtherThreads());        return dbHelper;    }    public synchronized void closeDb() {        if(null != dbHelper)            dbHelper.close();        if(null != db)            db.close();    }    @Override    protected void finalize() throws Throwable {        if(null != dbHelper)            dbHelper.close();        if(null != db)            db.close();        super.finalize();    }    public synchronized void setDbHelper(DBHelper dbHelper) {        if(null == this.dbHelper) {            this.dbHelper = dbHelper;            this.dbHelper.setDb(this.dbHelper.getWritableDatabase());//creates and sets the database object via getWritableDatabase()        }    }}</code></pre>","416412","","416412","","2010-09-21 14:38:22","2010-09-21 14:38:22","How careful should I be with thread-safety when creating methods/activities which interact with SQLite database?","<android><sqlite>","2","2","3","",""
"3755921","1","4445495","","2010-09-20 22:15:48","39","6632","<p>I have been trying for hours to figure out why I can not use an Itemized Map overlay without doing this before adding it to the ovelays of the map:</p><p><code>GeoPoint point;OverlayItem overlayitem = new OverlayItem(point, """","""");MarkerOverlay.addOverlay(overlayitem);</code></p><p>If i try to do this without the <code>MarkerOverlay.addOverlay(overlayitem);</code> command then when i try to add a new overLay like so: </p><pre><code>public boolean onTap(GeoPoint point, MapView mapView){    if (mOverlays.size() &gt; 0)        mOverlays.remove(0);    OverlayItem overlayitem = new OverlayItem(point, """", """");    mOverlays.add(overlay);    populate();    return true;}</code></pre><p>Inside my ItemizedOverlay class then i Just get a null reference exeption (I have no idea when or why - It says its no source code available when in debug)</p><p>Any Ideas?</p><p>EDIT:This is what I can find in the logcat :</p><pre><code>09-20 22:36:22.164: WARN/dalvikvm(311): threadid=3: thread exiting with uncaught exception (group=0x4001b188)</code></pre><p>and this is what I believe to be the infamous exception:</p><pre><code>   09-20 22:36:22.293: ERROR/AndroidRuntime(311): java.lang.NullPointerException09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.google.android.maps.ItemizedOverlay.getItemsAtLocation(ItemizedOverlay.java:617)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.google.android.maps.ItemizedOverlay.getItemAtLocation(ItemizedOverlay.java:586)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.google.android.maps.ItemizedOverlay.handleMotionEvent(ItemizedOverlay.java:498)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.google.android.maps.ItemizedOverlay.onTouchEvent(ItemizedOverlay.java:572)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.google.android.maps.OverlayBundle.onTouchEvent(OverlayBundle.java:63)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.google.android.maps.MapView.onTouchEvent(MapView.java:625)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.view.View.dispatchTouchEvent(View.java:3709)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:822)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:822)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:822)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.os.Handler.dispatchMessage(Handler.java:99)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.os.Looper.loop(Looper.java:123)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at android.app.ActivityThread.main(ActivityThread.java:4363)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at java.lang.reflect.Method.invokeNative(Native Method)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at java.lang.reflect.Method.invoke(Method.java:521)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)09-20 22:36:22.293: ERROR/AndroidRuntime(311):     at dalvik.system.NativeStart.main(Native Method)09-20 22:36:22.394: ERROR/dalvikvm(311): Unable to open stack trace file '/data/anr/traces.txt': Permission denied</code></pre>","407133","","407133","","2010-09-20 22:44:37","2013-10-04 03:46:01","Problem with crash with ItemizedOverlay","<android>","3","0","7","",""
"3756012","1","","","2010-09-20 22:34:31","3","1050","<p>Hello I am having a problem trying to stop adMob from requesting new ads. If a person hits the back key or home the application goes to sleep, but admob continues to request new ads. The only way it stops is if the user selects quit from the menu. </p><p>Does anyone know of a way that in my onPause method I could do something such as ad.pauseUpdates(); I am not seeing anything like this in the documentation.</p><p>Any ideas would be helpful.</p>","453270","","114066","","2012-07-24 14:26:16","2014-02-25 23:48:06","AdMob Android requesting ads while program is not in view","<android><admob><updating>","1","5","1","",""
"3756024","1","3759240","","2010-09-20 22:36:50","2","6891","<p>I'm trying to compile a C++ library (VRPN) with a couple of Java wrappers to be used in an Android app.  Using the ndk-build command, I get an ""undefined reference"" error for the first line of my C++ interface file which references a constructor for an object in the library.  I am fairly sure my code is correct - the call matches the method header and I have both the header and source files to verify that it is implemented.  I think the problem is with my Android.mk file, which currently only references my single class.  So the code appears to compile but won't link once it fails to find object code for the rest of the library.  I'm pretty new to C++, so I don't know a lot about makefiles, but none of the ""standard"" makefiles I've seen match up to those used by the Android NDK, which apparently hide a lot of details.  If I understand correctly, in a ""standard"" makefile, I simply name the output file and which object files it needs, followed by the object files and their source and header files, etc etc.  I don't know how to force ndk-build to create object code for and link the rest of the library.</p><p>Here's my current Android.mk:</p><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE    := jni_vrpn_buttonLOCAL_SRC_FILES := jni_vrpn_button.cppinclude $(BUILD_SHARED_LIBRARY)</code></pre><p>jni_vrpn_button.h:</p><pre><code>/* DO NOT EDIT THIS FILE - it is machine generated */#include &lt;jni.h&gt;/* Header for class jni_VrpnButton */#ifndef _Included_jni_VrpnButton#define _Included_jni_VrpnButton#ifdef __cplusplusextern ""C"" {#endif/* * Class:     jni_VrpnButton * Method:    vrpn_Button_initialize * Signature: (Ljava/lang/String;J)J */JNIEXPORT jlong JNICALL Java_jni_VrpnButton_vrpn_1Button_1initialize  (JNIEnv *, jobject, jstring, jlong);/* * Class:     jni_VrpnButton * Method:    vrpn_button_mainloop * Signature: (J)V */JNIEXPORT void JNICALL Java_jni_VrpnButton_vrpn_1button_1mainloop  (JNIEnv *, jobject, jlong);#ifdef __cplusplus}#endif#endif</code></pre><p>jni_vrpn_button.cpp:</p><pre><code>#include &lt;unistd.h&gt;#include &lt;sys/types.h&gt;#include &lt;sys/time.h&gt;#include &lt;jni_vrpn_button.h&gt;#include &lt;vrpn_Button.h&gt;#include &lt;vrpn_Connection.h&gt;/* * Class:     jni_VrpnButton * Method:    vrpn_Button_initialize * Signature: (Ljava/lang/String;J)J */JNIEXPORT jlong JNICALL Java_jni_VrpnButton_vrpn_1Button_1initialize  (JNIEnv * env, jobject, jstring n, jlong conn){ const char* name = strdup(env-&gt;GetStringUTFChars(n, 0)); vrpn_Button_Example_Server * serv = new vrpn_Button_Example_Server(name, (vrpn_Connection *) conn, 1, 1.0); return (long) serv;}/* * Class:     jni_VrpnButton * Method:    vrpn_button_mainloop * Signature: (J)V */JNIEXPORT void JNICALL Java_jni_VrpnButton_vrpn_1button_1mainloop  (JNIEnv *, jobject, jlong ptr){ ((vrpn_Button_Example_Server *) ptr)-&gt;mainloop();}</code></pre><p>Ideas?</p><p>Edit: forgot to post the error:</p><blockquote>  <p>$ $CRYSTAX/ndk-build SharedLibrary  :  libjni_vrpn_button.so  /cygdrive/c/Development/android-ndk-r4-windows-crystax-4/android-ndk-r4-crystax/sources/string/obj/l  ocal/armeabi/objs/jni_vrpn_button/jni_vrpn_button.o:  In function  <code>Java_jni_VrpnButton_vrpn_1Button_1  initialize':  /cygdrive/c/Development/android-ndk-r4-windows-crystax-4/android-ndk-r4-crystax/sources/string/jni/j  ni_vrpn_button.cpp:18: undefined  reference to  </code>vrpn_Button_Example_Server::vrpn_Button_Example_Serve  r(char const*, vrpn_Connection*, int,  double)' collect2: ld returned 1 exit  status make: <em>*</em>  [/cygdrive/c/Development/android-ndk-r4-windows-crystax-4/android-ndk-r4-crystax/sources/s  tring/obj/local/armeabi/libjni_vrpn_button.so]  Error 1</p></blockquote>","453264","","453264","","2010-09-20 23:02:46","2010-09-21 10:08:16","Compiling a large C++ library into Android NDK using JNI - Makefile Questions","<c++><android><makefile><android-ndk>","1","0","","",""
"3756201","1","3756354","","2010-09-20 23:14:44","0","282","<p>I would like to make an android application that opens the device microphone and records same samples, my question is if it is possible to know the bps(bits per second) of the recorded audio file. Also is this possible to do from a file stores on the sd card?regards maxsap </p>","234898","","","","","2010-09-20 23:47:32","Android get bps from audio sample","<android>","1","1","1","",""
"3756209","1","","","2010-09-20 23:16:29","0","34","<p>Looks like the only way to record something is the narrowband codec at 12kbps and 8khz sample rate. Surely audiorecord isnt limited by these rates is it? Where do I look? HTC sapphire source?</p>","453311","","","","","2010-12-12 17:29:29","What record formats are available in Google Ion not listed in core formats?","<android><audio><record>","1","0","","",""
"3756239","1","3756604","","2010-09-20 23:23:31","0","212","<p>For example code below works right</p><pre><code>CharSequence text = TextUtils.concat( ""before "", Html.fromHtml( ""&lt;b&gt;This works&lt;/b&gt;""), "" after "" );myTextView.setText(text, TextView.BufferType.SPANNABLE );</code></pre><p>If i put an hyperlink in the html code, i.e</p><pre><code>CharSequence text = TextUtils.concat( ""before "", Html.fromHtml( ""&lt;a href=\""www.google.it\""&gt;Google&lt;/a&gt;""), "" after "" );myTextView.setText(text, TextView.BufferType.SPANNABLE );Linkify.addLinks( myTextView, Linkify.ALL );</code></pre><p>""Google"" is displayed but hyperlink is not undelined correctly and is not clickable. Any advice?</p>","321354","","","","","2010-09-21 01:04:41","TextUtil.concat not preserves hyperlinks","<android>","1","0","","",""
"3756285","1","","","2010-09-20 23:35:38","3","532","<p>I am a very green android developer and need some help with a strange program crash. Often the program will run just fine.  There is an equal chance it will fail (see stack at the end).  I can watch the program run through the getView function and everything seems in order (i.e. all the information is there as expected and passes through convertView seemingly fine).  Either it will go through a few times and then program will be A-OK or it will fail as seen below and I have not been able to pick out what causes the crash.  Even stranger is that if I hold the phone in landscape mode, it will never fail!!  It only fails about 50% of the time in portrait orientation.  Can someone please help me? </p><pre><code>        @Override    public View getView(int position, View convertView, ViewGroup parent){        View v = convertView;        if (v == null) {            LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.row, null);        }        ADDPResults addpres = items.get(position);        if (addpres != null) {                //initialize display variables from inflated row.xml variables                TextView iptext = (TextView) v.findViewById(R.id.IPtext);                TextView mactext = (TextView) v.findViewById(R.id.MACtext);                TextView nametext = (TextView) v.findViewById(R.id.Nametext);                TextView devicetext = (TextView) v.findViewById(R.id.Devicetext);                //TextView firmwaretext = (TextView) v.findViewById(R.id.Firmwaretext);                //write the real data to the display                iptext.setText(""IP Address:     ""+addpres.addp_deviceIP.toDecString());                 mactext.setText(""MAC Address: ""+addpres.addp_deviceMAC.toHexString() );                nametext.setText(""Name:             ""+addpres.addp_devName);                devicetext.setText(""Device:           ""+addpres.addp_devType);                       //firmwaretext.setText(""Firmware:       ""+addpres.addp_FWVersion);        }        return v;    }}</code></pre><p>-----------------------Failure----------------------------------------------Thread [&lt;3> main] (Suspended (exception ArrayIndexOutOfBoundsException))  ListView.layoutChildren() line: 1686  ListView(AbsListView).onLayout(boolean, int, int, int, int) line: 1224  ListView(View).layout(int, int, int, int) line: 6886  LinearLayout.setChildFrame(View, int, int, int, int) line: 1119  LinearLayout.layoutVertical() line: 998  LinearLayout.onLayout(boolean, int, int, int, int) line: 918  LinearLayout(View).layout(int, int, int, int) line: 6886  FrameLayout.onLayout(boolean, int, int, int, int) line: 333  FrameLayout(View).layout(int, int, int, int) line: 6886  LinearLayout.setChildFrame(View, int, int, int, int) line: 1119  LinearLayout.layoutVertical() line: 998  LinearLayout.onLayout(boolean, int, int, int, int) line: 918  LinearLayout(View).layout(int, int, int, int) line: 6886  PhoneWindow$DecorView(FrameLayout).onLayout(boolean, int, int, int, int) line: 333  PhoneWindow$DecorView(View).layout(int, int, int, int) line: 6886  ViewRoot.performTraversals() line: 996  ViewRoot.handleMessage(Message) line: 1633  ViewRoot(Handler).dispatchMessage(Message) line: 99  Looper.loop() line: 123  ActivityThread.main(String[]) line: 4363  Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  ZygoteInit$MethodAndArgsCaller.run() line: 862  ZygoteInit.main(String[]) line: 620  NativeStart.main(String[]) line: not available [native method] </p>","329174","","","","","2010-09-20 23:48:37","Orientation specific failure in ListView.layoutChildren -- exception ArrayIndexOutofBoundsException","<android><exception><listview>","1","0","","",""
"3756382","1","","","2010-09-20 23:51:11","1","1427","<p>In iPhone there is Cocoa Asynchronous socket library. Is there a similar library in Java for Android? Can it be done using Java Asynchronous sockets(NIO library) or is there a way I can make use of NDK for Android and use native libraries for asynchronous sockets?</p>","138900","","","","","2010-09-23 05:24:20","Asynchronous Sockets implementation on Android","<java><android><sockets><asynchronous>","1","1","","",""
"3756383","1","3756619","","2010-09-20 23:51:56","19","6061","<p>In android, most event listener methods return a boolean value. What is that true/false value mean ? what will it result in to the subsequence events ?</p><pre><code>class MyTouchListener implements OnTouchListener {    @Override    public boolean onTouch(View v, MotionEvent event) {        logView.showEvent(event);        return true;    }}</code></pre><p>Regarding to the above example, if return true in <strong>onTouch</strong> method,I found every touch event(DOWN,UP,MOVE,etc) has been captured according to my <strong>logView</strong>. On the contrary,if return false, onely the DOWN event been captured. So it's seemd that return false will prevent the event to propagate. Am I correct ?</p><p>Furthermore, in a <strong>OnGestureListener</strong>, many methods have to return a boolean value too. Do they have the same meaning ?</p>","388887","","42346","","2010-09-20 23:57:10","2013-06-14 14:58:06","What is meaning of boolean value returned from an event-handling method in Android","<android><events><touch><return><listener>","4","0","5","",""
"3756532","1","","","2010-09-21 00:36:53","0","1227","<p>I'm developing an Android application, and I have a 2 tabbed interface, created by having separate TabSpec's for each tab within a TabHost. I have separate activities for each Tab - let's call them TabPhotos and TabAlbums. The layout for each tab is a ListView of records (e.g. photos and albums, respectively).</p><p>From the TabPhoto context menu, by long-holding a photo, I can either choose an existing album to add a photo to, or I can create a new album on the fly to add a photo to. If I choose to add it to a new album, I need to refresh the ListView for TabAlbums to show this new album. Normally, I would be able to refresh the ListView for TabAlbums from within that class by calling ""fillAlbumsView()"":</p><pre><code>public class TabAlbums extends ListActivity {    private DbAdapter mDbHelper;    private Cursor mAlbumsCursor;    private void fillAlbumsView() {        if (mAlbumsCursor == null) {            mAlbumsCursor = mDbHelper.fetchAllAlbums();            startManagingCursor(mAlbumsCursor);        }        else {            mAlbumsCursor.requery();        }        String[] from = new String[]{DbAdapter.KEY_ALBUM_TITLE};        int[] to = new int[]{R.id.album_list_row_title};        SimpleCursorAdapter album =             new SimpleCursorAdapter(this, R.layout.albums_list_row, mAlbumsCursor, from, to);        setListAdapter(albums);    }</code></pre><p>However, since the call to refresh the TabAlbums view needs to happen from the onActivityResult() method of the TabPhotos class, I'm not sure how to handle that.</p><p>I've seen many people strongly advocate for having separate views for Tabs, instead of separate activities, but I am a novice Android programmer and it seems like the work involved with tracking which tab is active/inactive is more trouble than it's worth. Plus, from the example I'm trying to follow (e.g. the source for Android's native Music player), I can't seem to follow what they are doing with Uri's for calling activities. </p><p>What do I do? Do I refresh each tab every time someone clicks it? Do I create some utility class that can somehow refresh both tab's views? Can I call, from the TabPhotos activity, the parent class of TabPhotos and then call the TabAlbums child activity? Any help would be very much appreciated. Thank you.</p>","453354","","453354","","2010-09-29 20:08:44","2010-09-29 20:08:44","Android - refresh view for one Tab from another Tab","<android><tabs>","0","4","","",""
"3756562","1","","","2010-09-21 00:47:02","0","3184","<p>I have followed the tutorial and can't seem to get it to work. Here's my code:</p><p>GridView.java:</p><pre><code>package com.example.gridview;import android.app.Activity;import android.os.Bundle;public class GridView extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    GridView gridview = (GridView) findViewById(R.id.gridview);    gridview.setAdapter(new ImageAdapter(this));    gridview.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {            Toast.makeText(HelloGridView.this, """" + position, Toast.LENGTH_SHORT).show();        }    });}</code></pre><p>ImageAdapter.java</p><pre><code>public class ImageAdapter extends BaseAdapter {private Context mContext;public ImageAdapter(Context c) {    mContext = c;}public int getCount() {    return mThumbIds.length;}public Object getItem(int position) {    return null;}public long getItemId(int position) {    return 0;}// create a new ImageView for each item referenced by the Adapterpublic View getView(int position, View convertView, ViewGroup parent) {    ImageView imageView;    if (convertView == null) {  // if it's not recycled, initialize some attributes        imageView = new ImageView(mContext);        imageView.setLayoutParams(new GridView.LayoutParams(85, 85));        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);        imageView.setPadding(8, 8, 8, 8);    } else {        imageView = (ImageView) convertView;    }    imageView.setImageResource(mThumbIds[position]);    return imageView;}// references to our imagesprivate Integer[] mThumbIds = {        R.drawable.sample_2, R.drawable.sample_3,        R.drawable.sample_4, R.drawable.sample_5,        R.drawable.sample_6, R.drawable.sample_7,        R.drawable.sample_0, R.drawable.sample_1,        R.drawable.sample_2, R.drawable.sample_3,        R.drawable.sample_4, R.drawable.sample_5,        R.drawable.sample_6, R.drawable.sample_7,        R.drawable.sample_0, R.drawable.sample_1,        R.drawable.sample_2, R.drawable.sample_3,        R.drawable.sample_4, R.drawable.sample_5,        R.drawable.sample_6, R.drawable.sample_7    };</code></pre><p>main.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;GridView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/gridview""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:columnWidth=""90dp""    android:numColumns=""auto_fit""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:stretchMode=""columnWidth""    android:gravity=""center""</code></pre><p>All I get are error message everywhere. What did I do wrong? I followed everything the tutorial said to do.</p>","452238","","472647","","2012-01-03 18:49:41","2013-07-30 18:28:13","Hello, GridView Tutorial not working","<android><image><view><grid>","6","0","","",""
"3756707","1","3757056","","2010-09-21 01:28:58","0","98","<p>In my application, after the user presses the appropriate button, an activity starts that creates a database with one table with two columns.  The thing I can't seem to get is: I would like one of the columns to automatically fill with the days of the week so that when I return a cursor over the database for the listActivity, the days are shown.  I can get the database to build but I can't seem to get the column to fill with the days.  I tried this</p><pre><code>public void installDays(){   String[] day = new String[7];;   ContentValues initialValues = new ContentValues();   day[0] = ""Monday"";   day[1] = ""Tuesday"";   day[2] = ""Wednesday"";   day[3] = ""Thursday"";   day[4] = ""Friday"";   day[5] = ""Saturday"";   day[6] = ""Sunday"";   for(int i = 0; i &lt; 7; i++)   {    initialValues.put(KEY_DAY, day[i]);   } menuDb.insert(DATABASE_TABLE, null, initialValues); }</code></pre><p>but that didn't work.  Then I tried this:</p><pre><code>if(rowId == 0)        {            menuDbHelper.createMenu(""Monday"", """", """", """");            menuDbHelper.createMenu(""Tuesday"", """", """", """");            menuDbHelper.createMenu(""Wednesday"", """", """", """");            menuDbHelper.createMenu(""Thursday"", """", """", """");            menuDbHelper.createMenu(""Friday"", """", """", """");            menuDbHelper.createMenu(""Saturday"", """", """", """");            menuDbHelper.createMenu(""Sunday"", """", """", """");            //menuDbHelper.installDays();            rowId = 1;        }</code></pre><p>That works but its no good, if you hit the back button and come back to that activity it just adds them all over again and then I have fourteen days.  What am I doing wrong here?  I am new to Java so take it easy on me.</p>","436204","","","","","2010-09-21 03:15:09","Build a Database with 7 values already inserted","<android>","1","0","2","",""
"3756804","1","3756875","","2010-09-21 01:58:57","5","2079","<p>Android API level 8 introduced the <a href=""http://developer.android.com/reference/android/content/Context.html#getExternalFilesDir%28java.lang.String%29""><code>Context.getExternalFilesDir()</code></a> method, providing a <code>File</code> object reference to an SD card path specific to your app.  I am wondering how to mimic this as low as API level 5.</p><p>I see there is a <a href=""http://developer.android.com/reference/android/content/Context.html#getDir%28java.lang.String,+int%29""><code>Context.getDir()</code></a> method, but I can't tell from reading about it how this differs.</p>","107277","","","","","2010-09-21 02:19:00","Mimic Context.getExternalFilesDir() prior to Android API Level 8?","<android><filesystems><directory><context>","1","0","1","",""
"3756837","1","","","2010-09-21 02:08:57","0","273","<p>I have an XML file that looks something like this (received from a web service)</p><pre><code> &lt;schedule type=""XUZ "" fromdate=""09/14/2010"" thrudate=""09/14/2010"" bay="""" vin="""" mechanic=""""          datetimestamp=""09/14/2010 10:56:15""&gt;- &lt;date date=""09/14/2010""&gt; - &lt;part id=""845205"" date=""09/14/2010"" time=""08:00"" date_sort=""61983"" time_sort=""28800"" duration=""2:42"" bay=""1""    type=""OIL"" bay_sort_order=""1""/&gt;  &lt; vin=""4004126"" name=""A, SP"" lastname=""A"" firstname=""SP"" mi=""R""   /&gt; ""  &lt; mid=""023384"" name=""RIT, S"" primary=""TRUE"" /&gt;  &lt;service name=""THY"" primary=""TRUE"" /&gt;  &lt;equipment&gt;ELECTRIC &lt;/equipment&gt;   &lt;timestamp event="" CHECKS IN"" date=""09/14/2010\"" time=\""06:05\"" user=\""DS820\"" sort=\""10\"" /&gt;  &lt;timestamp event=""READY FOR TRANSPORT\"" date=""09/14/2010\"" time=\""07:02\"" user=\""KMH11\"" sort=\""20\"" /&gt;   &lt;timestamp event=""INTO BAY"" date=\""09/14/2010"" time=\""08:00\"" user=\""PFC5\"" sort=\""30\"" /&gt;   &lt;timestamp event=""READY FOR "" date=\""09/14/2010"" time=\""08:17\"" user=\""PFC5\"" sort=\""40\"" /&gt;   &lt;timestamp event=""FIRST begins"" date=\""09/14/2010"" time=\""08:20\"" user=\""PFC5\"" sort=\""50\"" /&gt;   &lt;timestamp event=""FIRS ENDS"" date=""09/14/2010"" time=\""10:05\"" user=\""PFC5\"" sort=\""60\"" /&gt;   &lt;timestamp event="" LEAVES "" date=""09/14/2010"" time=\""10:42\"" user=\""PFC5\"" sort=\""70\"" /&gt;   &lt;timestamp event=""INTO XYZ"" date=""09/14/2010"" time=\""10:43\"" user=\""SD986\"" sort=\""80\"" /&gt;        &lt;/part&gt;</code></pre><p>As you can see several fields don't have  </p><p>How can I parse the file to extract name, vin, date?</p><p>I have tried using SAX on Android but the results are always empty.</p><p>Thanks</p><p>PS:Please ignore the \"" as the \ are escapes for the "" in Java.</p>","327415","","","","","2010-09-21 02:08:57","How do I use SAX to parse this type of xml file on Android","<android><sax>","0","5","","",""
"3757220","1","","","2010-09-21 04:02:26","3","1936","<p>I want to write an android app that would be a background service that would listen for either a specific gesture or key press in the and then trigger an action.  Is it even possible to do such a thing with a service?  If so could someone guide me the right direction.  I have search high and low can could seem to find an answer.</p>","414576","","145574","","2010-09-21 05:18:19","2011-07-01 04:11:55","android reading user input in a service","<java><android>","2","1","0","",""
"3757229","1","9853822","","2010-09-21 04:05:49","5","7803","<p>I've found a few tutorials on how to send/receive text SMS messages, but none on how to send/receive data SMS messages. I have a very small amount of data I would like the users of my app to be able to share. </p><p>I am able to send, but my <code>BroadcastReceiver</code> doesn't ever get called. It seems this is a known issue (http://code.google.com/p/android/issues/detail?id=1576) but has anyone figured out how to do this yet?</p><p>I tried sending/receiving a text SMS and that works fine, the thing is, I need to specify a port so only my app can listen for the SMS.</p><p>It seems this question has been asked here before and was never answered: <a href=""http://stackoverflow.com/questions/2726976/how-to-recieve-text-sms-to-specific-port"">http://stackoverflow.com/questions/2726976/how-to-recieve-text-sms-to-specific-port</a></p>","413414","","413414","","2010-09-21 06:44:35","2013-04-29 10:36:48","Android: How to send and receive data SMS messages","<android><data><sms><send><receive>","1","1","","",""
"3757325","1","","","2010-09-21 04:33:43","0","513","<p>I am trying to a menu item to launch the Send intent. This is what I did, I see the menu itembut i don't see send intent launch when i select the menu item.</p><pre><code>public void onCreateContextMenu(ContextMenu menu, View v,    ContextMenuInfo menuInfo) {      Intent sendIntent = new Intent(Intent.Action_Send);      menu.add(Menu.NONE, 0, 0, ""testmenu"").setIntent(sendIntent);    }  }}</code></pre><p>Thank you.</p>","141673","","376454","","2010-09-24 19:42:39","2010-12-19 10:44:14","How can I add a menu item to launch the Send intent","<android><menu><contextmenu><menuitem><send>","1","0","","",""
"3757365","1","7936787","","2010-09-21 04:42:44","3","1176","<p>When you debug from eclipse with more than one android device, you get the 'Android Device Chooser' dialog box to select with one to deploy the application to. That dialog has a 'Debug' column, what does that column mean exactly? One of my phone says 'Yes' and the other says nothing.</p><p>And second part: I assume that the phone that says 'Yes' is in some kind of debug mode and that it slows it down (it is slow!). How can I turn it off?!</p>","3610","","","","","2011-10-29 03:18:16","Android Device Chooser - Debug column","<android>","2","0","2","",""
"3757395","1","","","2010-09-21 04:50:22","1","2200","<p>I have a Live Folder that lists custom content from a SQLite DB.  When an item is clicked, the detail page for that item should be displayed using this URI: content://com.langley.app/item/detail/# (e.g. content://com.langley.app/item/detail/100).  Whenever I test this using the ""am start"" command, the detail activity loads perfectly.</p><p>However, when I try to click on the item in the Live Folder, I get the ""cannot find Activity"" error message.  When I compare the parameters that are being used to start the activity, they are exactly like the parameters I am using through ""am start"".  I am not sure what is going on.  </p><p>Here is my Activity def:</p><pre><code>    &lt;activity android:name=""ItemDetailActivity""&gt;    &lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.VIEW""&gt;&lt;/action&gt;    &lt;category android:name=""android.intent.category.DEFAULT""&gt;&lt;/category&gt;&lt;data android:scheme=""content"" android:host=""com.langley.app"" android:pathPrefix=""/item/detail""&gt;&lt;/data&gt;       &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>Here is how my base intent is defined in the Live Folder:</p><pre><code>// Item.CONTENT_URI = content://com.langley.app/itemintent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT,                new Intent(Intent.ACTION_VIEW, Uri.withAppendedPath(Item.CONTENT_URI, ""detail"")));</code></pre><p>Here is my call to ""am start"" (this works):</p><pre><code>am start -D -a android.intent.action.VIEW -d content://com.langley.app/item/detail/100</code></pre><p>I also compared the logcat messages for the 2 start attempts:</p><pre><code>**FAILED**I/ActivityManager(   60): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.langley.app/item/detail/1 flg=0x10000000 }**WORKED**I/ActivityManager(   60): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.langley.app/item/detail/1 flg=0x10000000 cmp=com.langley.app/.ItemDetailActivity }</code></pre><p>Help is appreciated.</p><hr><p>Per my comment below, I was able to change the base intent declaration to what you see below to get it working, but this seems like a hack since Intent should be able to be broadcast and received (and I still don't get why it works from ""am start"" but not the Live Folder directly).</p><pre><code>// Item.CONTENT_URI = content://com.langley.app/itemintent.putExtra(LiveFolders.EXTRA_LIVE_FOLDER_BASE_INTENT,                new Intent(Intent.ACTION_VIEW, Uri.withAppendedPath(Item.CONTENT_URI, ""detail""), context, ItemDetailActivity.class));</code></pre>","453472","","453472","","2010-09-21 14:57:34","2010-09-21 14:57:34","Android Intent-Filter only works for ""am start"" command, but not Live Folder item click","<android><adb><intentfilter><android-livefolders>","0","1","","",""
"3757575","1","3757637","","2010-09-21 05:39:25","0","143","<p>I am running a countdown timer in android and i want to show this countdown to the user in an Activity with a TextView. How can i do this? Has any one done this before?</p>","307585","","114066","","2010-09-21 07:51:05","2010-09-21 07:51:05","update Ui with TimeTask in android","<android>","1","0","","",""
"3757576","1","3801422","","2010-09-21 05:39:40","1","2057","<p>I am using the Emulator of version 8. and when i am trying to register the Android Application then it will gives the null registration ID. Please help me to resolve this issue. How can i register the Android Application with C2DM.My code is to register the App.</p><pre><code>Intent registrationIntent = new Intent(""com.google.android.c2dm.intent.REGISTER"");registrationIntent.putExtra(""app"", PendingIntent.getBroadcast(startCode.this, 0, new Intent(), 0)); // boilerplateregistrationIntent.putExtra(""sender"", ""12786@gmail.com"");startService(registrationIntent); handleRegistration(getApplicationContext(), registrationIntent);private void handleRegistration(Context context, Intent intent) {        String registration = intent.getStringExtra(""registration_id"");         if (intent.getStringExtra(""error"") != null) {            // Registration failed, should try again later.            Log.e(""ERROR"", ""ERROR"");        } else if (intent.getStringExtra(""unregistered"") != null) {            // unregistration done, new messages from the authorized sender will be rejected            Log.e(""unregistered"", ""unregistered"");        } else if (registration != null) {           // Send the registration ID to the 3rd party site that is sending the messages.           // This should be done in a separate thread.           // When done, remember that all registration is done.             Log.e(""registration"", registration);        }    }</code></pre>","339116","","114066","","2010-09-21 07:47:24","2010-09-27 05:59:39","Register the Android App with C2DM","<android><push-notification><android-c2dm>","1","0","","",""
"3757696","1","","","2010-09-21 06:03:34","10","1959","<p>I'm trying to use a color defined in a stlyle in a selector but it is causing a Resources$NotFoundException.</p><p>First I added a new attribute to attr.xml:</p><pre><code>&lt;resources&gt;    &lt;attr name=""unread_background"" format=""color"" /&gt;&lt;/resources&gt;</code></pre><p>Then I defined that attr value in styles.xml:</p><pre><code>&lt;style name=""ThemeNoTitleBar"" parent=""android:Theme.NoTitleBar""&gt;    &lt;item name=""unread_background""&gt;#000000&lt;/item&gt;&lt;/style&gt;</code></pre><p>Then I tried to use that attr in my selector definition:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;!-- other states snipped --&gt;    &lt;item android:state_selected=""false""        android:drawable=""?unread_background"" /&gt;&lt;/selector&gt;</code></pre><p>Lastly, the activity uses the ThemeNoTitleBar style theme in the manifest.</p><p>I've also tried creating a color in colors.xml and having it use the new attr but that also fails.</p><p>I'm obviously missing something but am not sure what to do to fix it.  My intent is to create multiple themes and have the selector use the color in the currently selected theme.</p>","453479","","","","","2012-01-26 20:17:48","Can a selector resource use a color defined in a style?","<android>","2","0","5","",""
"3757849","1","","","2010-09-21 06:35:54","2","1431","<p>I want to run tcpdump on the NDK using Process.start() and want to capture this output to a buffer.Can anybody show me how i can do this?Also is the process created in the same Dalvik Vm as the JNI call or is it in a different VM?</p>","275674","","275674","","2010-09-21 07:15:01","2010-09-23 11:14:22","Android NDK running native processes","<android><android-ndk>","1","0","1","",""
"3758188","1","","","2010-09-21 07:35:23","1","5779","<p>how can I prevent zoom controls in webview from disappearing after zooming in or out.</p><p>and these zoom controls always show up after sliding the webview i.e. zoom controls do not show up autmatically as soon as webview loads up.</p><p>I have tried this code.</p><pre><code>webview = (WebView)findViewById(R.id.webview);                                                                                                                                                                                                             //getWindow().requestFeature(Window.FEATURE_PROGRESS);WebSettings webSettings = webview.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setLoadsImagesAutomatically(true);webSettings.setSupportZoom(true) ;webSettings.setBuiltInZoomControls(true);// findViewById(R.id.LinearLayout01).; webview.invokeZoomPicker();</code></pre>","443387","","840532","","2011-12-13 12:58:40","2012-05-30 18:24:39","Android webview zooming buttons","<android>","1","0","1","",""
"3758220","1","3760190","","2010-09-21 07:40:05","3","690","<p>I had a project working in Eclipse completely, but after compiling it with ant in order to use Proguard to obfuscate the code the entire project fell apart.</p><p>The project consists of a single package containing two main activities and 4 helper classes to handle databases and such. After using ant the activities work fine but Eclipse cannot find the helper classes and won't build. Even if I explicitly import the classes the error I get is <code>The import com.ts.routeTracking.DataHelper cannot be resolved</code> while further mentions of the class get the error <code>DataHelper cannot be resolved to a type</code>.</p><p>How can I get Eclipse and ant to work together?</p>","416022","","","","","2012-09-21 11:56:36","Android project broken in Eclipse after ant build","<android><eclipse><ant>","1","0","2","",""
"3758313","1","3758361","","2010-09-21 07:55:10","1","620","<p>I wanna disable the automatic slide in from right to left animation/transition. All new intents/activities in my app are supposed to have no animation.</p><p>How can this be achieved?</p>","386562","","114066","","2010-09-21 08:04:35","2010-09-21 08:04:35","Prevent default animation (Right to Left)","<android><animation>","1","0","","",""
"3758371","1","4295669","","2010-09-21 08:06:08","1","2135","<p>I am trying to boot android in beagleboard.anyone can explain step by step to boot android with beagle board.thanks in advance. </p>","366916","","49246","","2010-12-27 22:57:41","2013-09-29 01:22:55","Android-With BeagleBoard","<android><beagleboard>","3","0","1","",""
"3758382","1","","","2010-09-21 08:07:36","2","2499","<p>I am new to android platform. I need to create a text file in android. Please let me know how to perform this task in android. I have written a code that is working fine in java but not in android. Please help me on this....the sample code that ihave written is :-</p><pre><code>try{DataOutputStream   dos = new DataOutputStream(new FileOutputStream(""test.txt"", true));dos.writeBytes(dataLine);dos.close();} catch (FileNotFoundException ex) {}</code></pre><p>the above code snippet is working fine in java but not in android :(</p><p>Thanks,Ashish </p>","453632","","1481317","","2014-01-02 08:47:24","2014-01-02 08:47:24","File operation in android","<android>","3","0","1","",""
"3758535","1","3767016","","2010-09-21 08:32:17","1","5889","<p>I want to set a <code>TextView</code> with <code>SpannableString</code> which is from the method below:</p><pre><code>Html.fromHtml(String source, Html.ImageGetter imageGetter,    Html.TagHandler tagHandler)</code></pre><p>But the <code>ImageGetter</code> here need to override the method below:</p><pre><code>public abstract Drawable getDrawable(String source)</code></pre><p>Because I need to get the drawable from the internet, I have to do it asynchronously and seems it is not.</p><p>How to make it work?Thanks.</p>","428022","","403455","","2012-07-30 12:53:56","2013-08-01 22:59:20","Display images on Android using TextView and Html.ImageGetter asynchronously?","<android><textview><android-asynctask><html-parsing>","3","0","4","",""
"3758640","1","3758821","","2010-09-21 08:47:39","0","106","<p>friend's         I wanna need to know how to set progressbars for webview,when i click submenus or links from that webpage.</p><p>thanks in advance.</p>","393953","","180538","","2010-09-21 09:27:40","2010-09-21 09:27:40","need help for setting progressbars for webview clicks","<android><progress-bar><webview>","1","0","","",""
"3758753","1","3758817","","2010-09-21 09:03:59","9","970","<p>I implemented a ImageCache. But I'm curious about what type to store in it will cost less.</p><p>Now I use <code>BitmapFactory</code> to get the images from the internet, so I get a <code>Bitmap</code> first.Should I convert to a <code>Drawable</code> to store in my ImageCache or just store the Bitmap is fine?</p><p>Any ideas?</p><p>Thanks.</p>","428022","","","","","2012-10-20 00:28:21","Should I use Bitmap or Drawable to store in ImageCache on Android?","<android><image><bitmap><drawable>","2","0","","",""
"3758795","1","","","2010-09-21 09:10:43","4","1051","<p>I'm new to StackOverflow and I hope to find some help about ExpandableListView.</p><p>I'm using an ExpandableListView having several groups but only one child in each group. The child is a custom view (FrameLayout) which contains some ImageViews. Only one group can be expanded at the same time (this is ok).</p><p>I would like to animate the expand and collapse actions : as soon as a group header is clicked, an animation should collapse the current expanded group if any and an other animation should expand the clicked group.</p><p>I would like the animation to be a smooth transition animating both the child view (hiding progresively if collapsing or showning progressively if expanding) and the other groups (which should move progressively with the hiding/showing of the child view).</p><p>I tried to animate the child view without great success : I didn't find how to define the ""progressively hiding/showing"" animation. I used the default android one called slide_in_left for test purpose but it is animating only the child view.</p><p>Can someone help me to find a way to animate smoothly the showing/hiding of the child view and allowing the groups header to follow this animation ?</p><p>Thanks a lot,</p><p>Massou</p>","453675","","","","","2012-06-02 17:28:51","Android : Is there a way to animate both group and listview of an ExpandableListView?","<android><animation><expandablelistview>","1","3","0","",""
"3758867","1","3759071","","2010-09-21 09:20:16","1","621","<p>I just tried this <a href=""http://developer.android.com/guide/topics/resources/color-list-resource.html"" rel=""nofollow"">example</a>. I saved that code in res/color/hover.xml but I always get this error message and Eclipse won't compile my project with this xml. What am I doing wrong?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_pressed=""true""          android:color=""#ffff0000""/&gt; &lt;!-- pressed --&gt;    &lt;item android:state_focused=""true""          android:color=""#ff0000ff""/&gt; &lt;!-- focused --&gt;    &lt;item android:color=""#ff000000""/&gt; &lt;!-- default --&gt;&lt;/selector&gt; &lt;!-- Error Message --&gt;</code></pre><p><strong>Error parsing XML:</strong> not well-formed (invalid token) hover.xml /MmAndroid/res/color line 8 Android AAPT Problem</p><p>The only thing I might not have done is following. I don't know how to do that:</p><blockquote>  <p><strong>compiled resource datatype:</strong> Resource  pointer to a ColorStateList.</p></blockquote>","433718","","433718","","2010-09-21 10:02:11","2011-07-11 13:37:27","Android: My XML with a selector is not well-formed while styling a button?","<android><android-xml><android-styles>","2","0","","",""
"3758932","1","","","2010-09-21 09:27:13","1","2597","<p><br>This is an android development question.<br>If I first set the content view to my xml layout using <code>setContentView(R.layout.main);</code> and then add another content view using <code>addContentView(layout, params)</code>, the content views overlap each other. I want the second content view to position itself directly under the first one. Is it possible or do I need to combine the xml and the programatically created layouts in some way? Both of the layouts are linear.    </p><p>Thanks in advance</p>","453715","","267269","","2013-05-08 06:05:42","2013-05-08 06:05:42","Layouts on top of each other","<android><android-layout>","1","0","","",""
"3758942","1","","","2010-09-21 09:28:25","4","39730","<p>How to create a custom themes and use it in the code? in menu how to implement theme option and apply for the activity?</p><p>any ideas ?</p>","428231","","1437962","","2013-01-01 20:22:27","2013-10-21 12:25:31","how to create a custom theme and use it in android application","<android><themes>","1","2","3","",""
"3758948","1","3758991","","2010-09-21 09:29:43","0","1086","<p>I installed my application through clicking run in eclipse.When I search for my application to start it and click on it I get the following error.Do I have to add some magic phrase to the manifest?</p><pre><code>09-21 11:25:33.138: ERROR/AndroidRuntime(23360): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Questionaire/com.Questionaire.FillInput}: java.lang.NullPointerException09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.os.Handler.dispatchMessage(Handler.java:99)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.os.Looper.loop(Looper.java:123)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.app.ActivityThread.main(ActivityThread.java:4595)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at java.lang.reflect.Method.invokeNative(Native Method)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at java.lang.reflect.Method.invoke(Method.java:521)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at dalvik.system.NativeStart.main(Native Method)09-21 11:25:33.138: ERROR/AndroidRuntime(23360): Caused by: java.lang.NullPointerException09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at com.Questionaire.FillInput.onCreate(FillInput.java:94)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)09-21 11:25:33.138: ERROR/AndroidRuntime(23360):     ... 11 more09-21 11:26:16.488: ERROR/ActivityManager(82): fail to set top app changed!</code></pre>","25282","","180538","","2010-09-21 09:36:05","2010-09-21 09:39:41","Android starting application after searching for it","<android><nullpointerexception>","2","0","","",""
"3759080","1","","","2010-09-21 09:47:58","1","502","<p>In the method onCreate, I tried to put a series of TextView in HorizontalScrollView and then I tried to set the value of the scroll to a TextView. Not working. When I find the TextView I need, i put it in a class field and when the cycle that inflates the TextViex is over, i ask to my good one TextViev its getLeft(), and it return me always 0. If I try to scroll by arbitrary measure in onCreate, even that does not work.What happens? How can i accomplish what i'm looking for?</p>","271889","","271889","","2010-09-23 09:01:13","2010-09-23 09:01:13","scroll start point of a HorizontalScrollView","<android><activity><workflow-activity><horizontalscrollview>","0","2","","","2010-09-21 09:47:58"
"3759092","1","3759115","","2010-09-21 09:49:55","1","2280","<p>I'm trying to get the ADT working in Eclipse, but I'm getting random hangs where eclipse just locks for no apparent reason, usually requiring a 'killall java' to properly clean it out of the memory.</p><p>I'm on Ubuntu 10.4 (64bit)Here's the details of my eclipse/android install:</p><p>eclipse Version: 3.5.2Build id: M20100211-1343Android Development Tools 0.9.8.v201008281755-53891 com.android.ide.eclipse.adt.feature.groupAndroid DDMS 0.9.8.v201008281755-53891 com.android.ide.eclipse.ddms.feature.group</p><p>Here's the output from java -version :java version ""1.6.0_20""Java(TM) SE Runtime Environment (build 1.6.0_20-b02)Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)</p><p>I often don't get anything in the workspace logs, but here's an example of what appeared after Eclipse hung just now :!ENTRY org.eclipse.core.resources 8 2 2010-09-21 10:22:27.407!MESSAGE Problems occurred when invoking code from plug-in: ""org.eclipse.core.resources"".!STACK 1org.eclipse.core.runtime.CoreException: Project target not resolved yet. at com.android.ide.eclipse.adt.internal.build.BaseBuilder.stopBuild(Unknown Source) at com.android.ide.eclipse.adt.internal.build.BaseBuilder.abortOnBadSetup(Unknown Source) at com.android.ide.eclipse.adt.internal.build.PreCompilerBuilder.build(Unknown Source) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)!SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2010-09-21 10:22:27.407!MESSAGE Project target not resolved yet.!SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2010-09-21 10:22:27.407!MESSAGE Project target not resolved yet.</p><p>There were two of these entries - identical except for the timestamps.</p><p>I've tried just about every version of eclipse I can download, I've tried tying adt to sdk 1.6 r1, r2 and r3.</p><p>Anyone got any ideas?  I'm at my wits end here.  Eclipse is fairly solid for me using other plugins - C/C++, PyDev, PHP, Web stuff all work fine, but as soon as I try using the android plugin I start hanging. I've disabled code completion, in case it was that, but nope, whatever I seem to do, I get a couple of lines typed then everything goes grey.</p>","390355","","","","","2014-02-12 02:22:13","Android Eclipse Hanging","<android><eclipse><adt><hang>","3","0","","",""
"3759232","1","3759782","","2010-09-21 10:07:34","12","4492","<p>What would be the best way to implement Aspect-oriented programming (AOP) in an Android application?</p><p>Would it be efficient with the mobile battery?</p>","249699","","119895","","2010-09-21 11:16:50","2010-09-21 11:23:42","Aspect-oriented programming in android","<java><android><aop>","1","2","3","",""
"3759241","1","3759679","","2010-09-21 10:08:21","0","504","<p>can anyone tell me how could i create a down loadable link for my android app for users.so that i can send them a mail. and as user click on that mail from mobile my app start installation. how could i do this...</p>","450601","","","","","2010-09-21 11:07:25","Create Downloadble link of app","<android>","3","0","","2012-08-21 11:45:54",""
"3759335","1","3759629","","2010-09-21 10:20:04","1","1521","<p>I don't have the accurate terminology and maybe that's a part of my question.</p><p>In the android home screen, we have the ability to slide the screen left and right and display multiple pages. Each of these pages has a different set of icons. in the mac world these would be called ""spaces"". What is it called in the android world.</p><p>More importantly is there a standard control that can be used to achieve this effect ?</p>","154353","","","","","2010-09-21 11:01:30","android launcher home screen","<android><home><launcher>","2","0","","",""
"3759465","1","","","2010-09-21 10:38:27","0","378","<p>Does Android support the OpenYmsg API?</p>","405452","","869912","","2012-08-13 18:17:52","2012-08-13 18:17:52","Does Android support the OpenYmsg API?","<android>","1","0","","",""
"3759545","1","3759710","","2010-09-21 10:49:45","7","16405","<p>can anybody tell how to display background image in a <code>TextView</code> in android?</p>","426344","","119895","","2010-09-21 11:07:22","2010-09-21 11:11:30","How to display background image in text view","<android>","2","1","","",""
"3759620","1","3759672","","2010-09-21 11:00:11","0","91","<p>I have an Activity with a listView with few options and a button at the bottom of the screen. The listView is just to configurate some options so, when i click in any of the items in the list its needed to let the user choose between some options (in some cases i'll use another list to show the options, in other cases i'll let the user write in an editText view) to make the configuration.</p><p>It's recommendable to create new Activities to show this options or can i choose other way? I was thinking about loading a new .XML in the same Activity but im not sure if this is ""a good practice"".</p><p>Something like that:</p><pre><code>Activity{  setContentView() --&gt; The main XML  setOnItemClickListener{    switch between item's Id's and setContentView() depending on the item;  }}</code></pre><p>Thanxs!</p><p>@EDIT</p><p>I also have a question about declaring new classes. I've seen some tutorials declaring a custom Adapter class inside the main Activity. So, once again, is that a good way of doing things? :D</p>","446234","","446234","","2010-09-21 11:08:11","2010-09-21 11:43:17","About making new Activities","<android><coding-style><activity>","2","0","","",""
"3759680","1","","","2010-09-21 11:07:27","0","756","<p>I have an application with a map and an <code>ItemizedOverlay</code>, and need to determine if the user is within a certain distance of a <code>GeoPoint</code> on the <code>ItemizedOverlay</code>. If thats the case then start a new <code>Activity</code>..</p><p>How do I approach this?</p>","453827","","2961","","2010-09-21 11:09:49","2010-09-21 11:21:35","Android: How to detect if users if within distance of GeoPoint on MapVIew","<android>","1","0","","",""
"3759695","1","3761513","","2010-09-21 11:09:33","0","121","<p>i need to place two text box in such a way that it sloud look like this..</p><p>===================</p><p><strong>Username</strong> contents contents contents contents <br>contents contents contents contents contents contents <br>contents contents contents  contents contents contents</p><p>====================</p><p>Here, the Username is one TextView which is Clickable and ""contents"" is another TextView.</p><p>i had tried with do as above but i couldn't get as desired result..</p><p>===================</p><p><strong>Username</strong>  contents contents contents contents <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contents contents contents contents contents contents <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contents contents contents  contents contents contents</p><p>====================</p><p>Pls help me out through this...</p><p>Thanks.</p>","435025","","302328","","2010-09-21 11:43:42","2010-09-21 15:12:22","Placing two TextView together..issue","<android><textview>","4","0","","",""
"3759747","1","","","2010-09-21 11:18:21","1","188","<p>friend's          I need help on pointing mapview findme location option,when i click find me from map it shows location without identificaton,after long time only the circle with pin point appears,but i need it to appear immediately,what can i do what the problem is.Here my code for findme click event...</p><pre><code>                try {                    criteria = new Criteria();                    criteria.setAccuracy(Criteria.ACCURACY_FINE);                    criteria.setAltitudeRequired(false);                    criteria.setBearingRequired(false);                    criteria.setCostAllowed(true);                    criteria                            .setPowerRequirement(Criteria.POWER_LOW);                    locationManager.requestLocationUpdates(                            LocationManager.GPS_PROVIDER, 1000L,                            500.0f, locationListener);                    overlays = wv.getOverlays();                    MyLocationOverlay myLocationOverlay = new MyLocationOverlay(                            Bru_Maps_Result.this, wv);                    overlays.add(myLocationOverlay);                    myLocationOverlay.enableMyLocation();                    String provider = locationManager.getBestProvider(criteria, true);                    // Update the UI using the last known locations                    Location location = locationManager.getLastKnownLocation(provider);                    updateWithNewLocation(location);                    Log.v(""Find_Location"",location.toString());                    // Start listening for location changes                    locationManager.requestLocationUpdates(                            provider, 60000, // 1min                            1000, // 1km                            locationListener);                    // geoPoint = currentlocation.getMyLocation();                    // wv_cont.setCenter(geoPoint);                    // wv_cont.setZoom(18);                } catch (Exception e) {                    mToast = Toast.makeText(Bru_Maps_Result.this,                            R.string.errorinmaps,                            Toast.LENGTH_SHORT);                    mToast.show();                    Log.v(TAG, ""exception current location : "" + e);                }</code></pre><p>Thanks in advance. </p>","393953","","302328","","2010-09-21 11:43:04","2010-09-21 11:43:04","need help on pointing findme location in mapview without taking long time","<android><android-mapview>","0","0","","",""
"3759933","1","3759963","","2010-09-21 11:42:51","0","314","<p>I can create a class which extends Thread and overrides the run method with a loop.I then start it with myThread.start(), which create the OS thread and executes my run().That's all good.</p><p>However, I don't quite understand the details. I'll have a go at working this out using test code when I get the chance, but before then can anyone answer these:</p><p>Q1. When does the constructor get executed, presumably when myThread is declared, or on start()?</p><p>Q2. What happens when my run() code completes? Is there a way of getting it to run again in the same thread (i.e. not losing all the thread variable values defined in class) Presumably calling start() might create a new os thread?</p><p>Q3. Presumably just calling myThread.run() would execute my run() in the context of the current activity, not mythread, in which case how could it access the thread variables?)</p><p>-Frink</p>","131209","","","","","2010-09-21 13:40:32","Android Thread details","<java><android><multithreading>","1","1","","",""
"3760033","1","3803284","","2010-09-21 11:56:40","25","4895","<p>I am looking for an efficient way to find out if a resource (mostly a drawable) is used in java or in an XML file.</p><p>The problem is, that on my current project the drawables are changed often and now I have some drawables, which might never be used.</p><p>Is there a tool/way to find those unused drawables without search each filename in the whole project?</p>","180538","","180538","","2010-09-27 11:17:57","2013-01-08 21:26:13","Find out if resource is used","<android><resources><tracking><drawable>","3","5","14","",""
"3760212","1","3760546","","2010-09-21 12:23:15","2","12489","<p>I'm trying to create a new SMS receive listner.</p><p>I have googled the problem and all I found was it requires</p><p>android.provider.Telephony.SMS_RECEIVED</p><p>but it doesnt exist in android 2.2</p><p>how to listen to new incoming messages is my question.!</p>","447238","","","","","2010-09-21 13:21:48","android.provider.Telephony.SMS_RECEIVED not available!","<android><sms><listener><receive>","1","1","2","",""
"3760276","1","5097734","","2010-09-21 12:32:04","32","18248","<p>I have a custom file type/extension that I want to associate my app with.</p><p>As far as I know, the data element is made for this purpose, but I can't get it working.<a href=""http://developer.android.com/guide/topics/manifest/data-element.html"">http://developer.android.com/guide/topics/manifest/data-element.html</a>According to the docs, and a lot of forum posts, it should work like this:</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.MAIN"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;    &lt;data android:mimeType=""application/pdf"" /&gt;&lt;/intent-filter&gt;</code></pre><p>Well, it does not work. What did I do wrong? I simply want to declare my own file type.</p>","373248","","815724","","2013-01-12 12:39:41","2013-01-12 12:39:41","Android intent filter: associate app with file extension","<android><android-manifest><intentfilter>","5","0","28","",""
"3760357","1","3761901","","2010-09-21 12:43:54","0","418","<p>I have an apk (or .class, whatever) with a 'public static void main'-method (java style) which does some things. Compiling and installing the apk this gives works fine (from eclipse). </p><p>Now from a regular Android app I would like to invoke that code while redirecting its stdin/stdout to Input-/Output- Stream objects. Is this possible? And if so: how? And if not: is there some other way in which I can run an activity in the background with some kind of pipe/io-redirection construction?</p><p>Thanks.</p>","216582","","","","","2010-09-23 04:50:29","Android: invoking a regular Java-style program with i/o redirection","<android><pipes><io-redirection>","3","7","","",""
"3760381","1","","","2010-09-21 12:46:32","14","21717","<p>I want to create a rotating progress image, and wonder what's the best way to proceed. I can make it work with an animation list with for example 12 images changing every 100ms. This works fine, but it's quite tedious to create 12 images or for every size and resolution:</p><pre><code>&lt;animation-list xmlns:android=""http://schemas.android.com/apk/res/android"" android:oneshot=""false""&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_01"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_02"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_03"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_04"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_05"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_06"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_07"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_08"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_09"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_10"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_11"" android:duration=""100"" /&gt;&lt;item android:drawable=""@drawable/ic_loading_grey_on_black_12"" android:duration=""100"" /&gt;</code></pre><p></p><p>I suppose that an easier solution is to use one image per resolution, but rather rotate it for each frame. In the platform resources (android-sdk-windows/platforms...) I found something called animated-rotate in the file drawable/search_spinner.xml, but if I copy the code get a compiler error complaining about android:framesCount and android:frameDuration (Google APIs 2.2 in Eclipse):</p><pre><code>&lt;animated-rotate xmlns:android=""http://schemas.android.com/apk/res/android""android:drawable=""@drawable/spinner_black_20""android:pivotX=""50%""android:pivotY=""50%""android:framesCount=""12""android:frameDuration=""100"" /&gt;</code></pre><p>I have also tried using a repeating rotate animation (using   in the anim resource folder), but I actually prefer the look of the animation list version.</p><p>What is the recommended way of solving this problem?</p>","184844","","","","","2014-01-27 09:59:37","Rotating image. Animation list or animated rotate? (Android)","<android><animation><rotation>","6","0","8","",""
"3760391","1","","","2010-09-21 12:48:02","1","592","<p>Hi i want to display 4 frames in layout which contains customized views.when ever i clicked on one frame it has to occupy total screen. please let me know how to do .</p>","446010","","","","","2010-09-24 06:33:31","scaling view dynamically","<android><android-widget>","2","0","1","",""
"3760593","1","3825410","","2010-09-21 13:12:08","15","2008","<p>I'm developing on an application at the moment which contains quite a lot of personal user information - things like Facebook contacts, etc ... Now, one of the things I want to be able to do (and have done, quite effectively) is open up parts of the application to ""3rd Party"" applications, using Android's build-in inter-process communication protocol (AIDL). So far so good.</p><p>Here's the catch: because we're involved in handling quite a lot of personal information, we have to be quite careful about who can and can't access it; specifically, only ""Trusted"" applications should be able to do so. So the natural way to do this is to use a custom permission within the AndroidManifest.xml file where we declare the services. My problem is this: I want to be able to enact signature-level protection (similar to the normal ""signature"" permission level), but with a bit of a catch:</p><p>I don't <em>only</em> want application signed with our internal signature to be able to access the services. I'd like to be able to build a list of ""trusted signatures"" &amp; at runtime (or if there's a better way, then maybe some other time?) be able to check incoming requests against this list of trusted keys.</p><p>This would satisfy the security constraints in the same way as the normal ""signature"" permission level I think - only programs on the ""trusted keys list"" would be able to access the services, and keys are hard to spoof (if possible at all?) - but with the added bonus that we wouldn't have to sign every application making use of the APIs with our internal team's key.</p><p>Is this possible at the moment in Android? And if so, are there any special requirements?</p><p>Thanks</p>","227224","","","","","2013-05-31 19:52:27","Implement signature-level security on Android services with more than one allowed signature","<java><android><security><ipc><aidl>","1","0","7","",""
"3760600","1","","","2010-09-21 13:12:47","4","4083","<p>I was attempting to design an app that would allow me to have android emulate a hardware device.<br>I.E.  a generic keyboard, a generic mouse.</p><p>I could essentially plug in my android (HTC) to a computer, and program it to use a software keyboard as the computers hardware keyboard.</p><p>I don't have any direction on how to accomplish this.</p><p>I only wish to connect USB(not bluetooth).  So that the computer needs 0 installation before working.  And most devices will work in Dos Mode.</p>","453945","","","","","2013-10-16 19:11:32","Can android Emulate a HID device?","<android><keyboard><hid>","4","0","2","2014-01-09 03:40:31",""
"3760626","1","3760684","","2010-09-21 13:15:47","23","30250","<p>I am working on some a application where I have to update some files present in assets / raw folder runtime from some http location.</p><p>Can anyone help me to by sharing how to write files in assets or raw folder?</p>","453951","","114066","","2012-01-17 16:11:34","2014-02-11 06:30:54","How to write files to assets folder or raw folder in android?","<android>","4","1","6","",""
"3760774","1","3874985","","2010-09-21 13:30:57","11","23453","<p>i would like to update my sql lite database with the native update-method of the SQLiteDatabase class of android.</p><pre><code>ContentValues dataToInsert = new ContentValues();                          dataToInsert.put(""name"", ""flo"");dataToInsert.put(""location"", ""flotown"");String where = ""id"" + ""="" + id;try{        db.update(DATABASE_TABLE, dataToInsert, where, null);}catch (Exception e){    String error =  e.getMessage().toString();}</code></pre><p>but i get following error:android.database.sqlite.SQLiteException: near ""15"": syntax error: , while compiling: UPDATE mytable SET location=?, name=? WHERE id=2010-09-21 15:05:36.995</p><p>I don´t know what should be the problem. Somehow the values do not arrive in the sql statement. I did nearly the same with the insert method and that worked quite fine.</p><p>many thx,florian</p>","453959","","","","","2012-11-01 00:11:58","update sql database with ContentValues and the update-method","<android><database><sqlite>","2","1","2","",""
"3760922","1","3762208","","2010-09-21 13:44:55","0","733","<p>I am developing an Android mapping application and I have managed to work Google's ItemizedOverlay tutorial into my code.  I'm plotting my little circle on the map nicely.</p><p>However, I would like to label my tiny symbol with its title -- all the time.  I'm going to be dropping a few different symbols on my map and the able to display their labels would be a BIG help.  I got the onTap method working, but when you tap the screen, it takes over the whole display -- which is not very helpful.</p><p>I haven't managed to find a thing about this on the internet, so I'm not optimistic, but if anybody's got any sort of suggestion, that would be much appreciated.</p>","453989","","","","","2010-09-23 12:36:15","Android Mapping Overlay Question","<android><title><itemizedoverlay>","2","0","","",""
"3761010","1","","","2010-09-21 13:54:23","1","284","<p>Got this issue developing a game application.<br><strong>Main concept</strong>:We have an activity with layout set to it by <strong>setContentView</strong>.Layout has a SurfaceView, which is used to draw some additional graphics (transition between different screens).<br>Problem is that on 1.5 and 1.6 everything works prefectly fine.<br>But testing on 2.0 and greater version of andorid shown a issue:At the moment when we use <strong>setVisiblity</strong>(true/false) on our SurfaceView screen flickers with black.<br><strong>EDITED:</strong> Seems like starting from 2.0 any changes to order of views in hierarchy cause some flickering. <br>Tried removing view using <strong>(ViewGroup).removeView(myView)</strong> - same results like in <strong>setVisiblility()</strong><br> Checked sources, in both methods <strong>invalidate()->invalidateChild()->invalidateChildInParent()</strong> are called.<br> May be some problem in SDK methods?</p><p>Also noted another issue on 2.0/2.0.1/2.1-update1. If from activity with layout and surfaceView we start another activity by <strong>startActivity/startActivityForResult()</strong> after we get back from that activity, canvas of the surfaceView will be valid all right, but it will be just black. And drawing on that canvas will not be shown. Reseting holder of surface in callback methods didn't help at all.</p><p>If anyone happen to know workarounds for these issue, I'll be very grateful.</p>","453991","","453991","","2010-09-22 06:53:28","2010-09-22 06:53:28","SurfaceView flicker on setVisiblity() in 2.0 and later version","<android>","0","0","","",""
"3761068","1","","","2010-09-21 14:01:09","0","233","<p>When I run the sample from <a href=""http://developer.android.com/resources/tutorials/hello-world.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/hello-world.html</a>, I am not getting to see the ""hello Android"" in the AVD/Emulator. I have a target compile set to 2.2 (API level 8) and thats also what the AVD is targettted to run.</p><p>Please advice.</p>","454015","","119895","","2010-09-21 14:09:36","2011-06-29 01:04:53","Beginners question: Cant Get HelloWorld","<android><eclipse>","1","2","","",""
"3761099","1","","","2010-09-21 14:05:14","0","176","<p>I have tried many sample code connecting twitter with android app.but nothing happen  at all.I am blocked after getting Pin form url.Can any give me a complete application for twitter android connection.jeet.shri123@gmail.comMail the code  if any one have the code or solution  of this problem.</p><p>with thanksJitendra</p>","454021","","238123","","2010-09-21 14:19:26","2010-09-21 17:01:36","Twitter app in android","<android>","1","1","","",""
"3761137","1","","","2010-09-21 14:08:25","1","1173","<p>How can I create avd from command line with keyboard support?</p><p>I was able to create avd from commandline using:<code>android create avd</code>, but I dont know how to enable keyboard support into this.</p><p>Even android documentaion/help doesn't any thing about this.</p>","454023","","213269","","2011-03-22 08:39:43","2013-02-04 22:22:52","creating avd from command line with keyboard support","<android><keyboard><avd>","2","0","","",""
"3761291","1","4872576","","2010-09-21 14:25:44","2","3795","<p>I Try to connect a Bluetooth Adapter, which send me some Data after sending a Handshake.My Problem is,  until the Adapter is sending, the code works fine, but if it stopped, the in.read(xxx Command blocks whithout any exeption. I have to turne off the adapter and wait severeal seconds, then an exception occurs and the Code resumed.How to solve this? (I removed the errorhandling for better understanding)</p><pre><code>BluetoothAdapter bt_adapter = BluetoothAdapter.getDefaultAdapter();BluetoothDevice bt_device = null;//Bluetooth not supportetif (bt_adapter == null) {    return false;}//enable Bluetoothif (!bt_adapter.isEnabled()) {    Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);    startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);    return false;}    //search K01-Blue AdapterSet&lt;BluetoothDevice&gt; pairedDevices =  bt_adapter.getBondedDevices();if (pairedDevices.size() &gt; 0) {for (BluetoothDevice device : pairedDevices) {    String name = device.getName();    if (name.contains(""K01-Blue"")) {        bt_device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(device.getAddress());        break;    }}}//Exit if no Adapter foundif(bt_device == null){ return false; }//Create Socket         try {UUID uuid =UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB"");GlobalVars.bluetooth.bt_socket =GlobalVars.bluetooth.bt_device.createRfcommSocketToServiceRecord(uuid);    } catch (Exception e) {    e.printStackTrace();    }//Exit if socket not created              if(bt_socket == null){ return false; }/Connect to Socket, otherwise exittry {bt_socket.connect();    } catch (IOException e1) {return false;}//get InputStream   InputStream in = null;try {in = GlobalVars.bluetooth.bt_socket.getInputStream();    } catch (IOException e1) {return false;}//get OutputStreamOutputStream out = null;try {out = GlobalVars.bluetooth.bt_socket.getOutputStream()    } catch (IOException e1)  {return false;}//Say hello to K01 Adapter  byte[] hello = {0x2F, 0x3F, 0x21, 0x0D, 0x0A};try {out.write(hello);   } catch (IOException e1) {return false;}//Listen to Answer of K01 AdapterByteArrayOutputStream buffer = new ByteArrayOutputStream();int nRead;byte[] data = new byte[1024];try {    nRead = in.read(data, 0, data.length);    while (nRead != -1) {        nRead = in.read(data, 0, data.length);        buffer.write(data, 0, nRead);    }   } catch (IOException e1) {e1.printStackTrace();}//Create String from BytearrayString str1 = new String(buffer.toByteArray());</code></pre>","432657","","14302","","2010-09-21 14:38:52","2011-05-13 12:16:26","Error in Android 2.1 Bluetooth SPP with Inputstream.read","<android><bluetooth>","2","0","","",""
"3761305","1","11977292","","2010-09-21 14:27:00","7","19987","<p>I've been really banging my head against the table trying to get the MediaPlayer class to try to play h.264-encoded videos on Android 2.1.  My code is rather simple:</p><pre><code>  AssetFileDescriptor fileDescriptor = getResources().openRawResourceFd(R.raw.my_movie);  introMoviePlayer = new MediaPlayer();  introMoviePlayer.setDataSource(fileDescriptor.getFileDescriptor(), fileDescriptor.getStartOffset(), fileDescriptor.getDeclaredLength());  introMoviePlayer.prepare();</code></pre><p>This always throws an exception at <code>prepare()</code>, with the text <code>java.io.IOException: Prepare failed.: status=0x1</code>.  I got a bit more info by using <code>MediaPlayer.create()</code> with a URI, which also throws at <code>prepare()</code>, which is actually called by <code>MediaPlayer.create()</code>, with the message <code>Command PLAYER_PREPARE completed with an error or info PVMFErrResourceConfiguration</code>.</p><p>The same code works perfectly in Froyo (2.2).  The videos themselves play fine in the video player app.  Does anyone have perhaps a helpful hint that might help to solve this problem?</p><p><strong>Edit</strong>: Still no solution -- very frustrating problem indeed.  However, I have found that by creating a <code>VideoView</code> and setting the URI for the raw video works.  This is very puzzling, as sending the exact same URI through a MediaPlayer class will throw.</p>","14302","","14302","","2010-10-13 12:31:18","2013-07-25 03:46:24","Android MediaPlayer throwing ""Prepare failed.: status=0x1"" on 2.1, works on 2.2","<android><media-player>","8","2","3","",""
"3761455","1","","","2010-09-21 14:43:25","-2","375","<p>Apart from knowing a bit of C, I have no experience in software development.I want to know from where to start learning to build android applications apart from learning java? What are the steps?</p>","454067","","","","","2014-03-09 04:05:15","No experience in software but willing to learn","<android>","2","2","0","2014-03-09 04:37:59",""
"3761484","1","","","2010-09-21 14:46:47","2","1468","<p>I want to build an app for Google Android that uses natural feature tracking to create some cool augmented reality. Now what I need is a good library that for Android that does some serious natural feature tracking.</p><p>Can anyone help me out?</p><p>Thanks you.</p>","453793","","1085483","","2012-09-30 14:48:16","2012-09-30 14:48:16","Natural Feature Tracking - augmented reality","<java><android><image-processing><opencv>","4","0","","",""
"3761538","1","","","2010-09-21 14:52:22","0","1985","<p>In my android application I would like to keep the backlight on always, without the screen getting locked.</p><p>Is there any way that I can do this?I am using the below code in my application but am facing force close.</p><pre><code>final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);         PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK , ""My Tag"");         wl.acquire(); -----w1.release;</code></pre><p>I have also used user permission in manifest.</p><p>To be more clear I have placed this in my splash screen but the issue is like the splash screen gets started after a particular time the screen shows a force close message after a bright light.</p><p>Could you please let me know if there is any solution for this.Please share your valuable suggestions.</p>","420261","","741249","","2012-10-10 11:05:40","2012-10-10 11:05:40","Keep backlight on through out the app in android","<android><wakelock><forceclose>","0","1","","",""
"3761631","1","3761724","","2010-09-21 15:04:26","1","164","<p>I have an interesting problem. I pull down an android project from cvs, which works fine.  Once Eclipse builds the project, my .java files are removed.  XML files, pngs, everything else is fine. I seem to be left with just the package tree, but no source files.  Any thoughts?</p>","245634","","","","","2010-09-21 15:14:52","Eclipse deletes java files on build of an android project","<java><android><eclipse>","1","1","","",""
"3761737","1","","","2010-09-21 15:16:46","19","24818","<p>I have looked into various posts about how to retrieve something via <code>HTTPS</code> on Android, from a server that uses a self-signed certificate. However, none of them seem to work - they all fail to remove the  </p><blockquote>  <p>javax.net.ssl.SSLException: Not trusted server certificate message.  </p></blockquote><p>It is not an option to modify the server to have a trusted certificate, and it is also not an option to make the server certificate match the server's IP address.</p><p>Note, that the server will not have a DNS name, it will only have an IP-address. The GET request looks something like this:</p><pre><code> https://username:password@anyIPAddress/blabla/index.php?param=1&amp;param2=3</code></pre><p>I am fully aware that this solution is prone to man-in-the-middle attacks etc.</p><p>So, the solution must ignore the lack of trust in the certificate, and ignore the hostname mismatch.</p><p>Does anybody know the code, that does this, using Java for Android?</p><p>There are plenty of attempts to explain this on <a href=""http://www.stackoverflow.com"">stackoverflow.com</a>, and plenty of code snippets, but they don't seem to work, and nobody has provided one block of code that solves this, as far as I can see. It would be interesting to know if somebody really solved this, or if Android simply blocks certificates that are not trusted.</p>","1507543","","1139398","","2012-10-25 07:43:54","2013-03-20 18:19:37","HTTPS GET (SSL) with Android and self-signed server certificate","<java><android><ssl>","6","1","19","",""
"3761908","1","3767733","","2010-09-21 15:35:50","1","757","<p>I am developing an application that displays images. The application provides an option to email the image as an attachment. I have to save the image to the SD card in order to email the image as an attachment.  </p><p>Is it possible to email the image as an attachment without writing it to the SD card first?</p>","410757","","244296","","2010-09-21 16:02:41","2010-09-22 09:03:43","How can i send image without storing in sdcard?","<android><android-contentprovider>","3","0","","",""
"3762300","1","3762349","","2010-09-21 16:17:44","2","1315","<p>I would like to know if the user is using the application for the first time. I am using <code>SharedPreferences</code>, but I am not sure if I have the right logic. </p><p>How can I set my <code>isFirstLaunched</code> boolean to true when the user first launches, and then immediately set to false after work has been done?</p><pre><code>protected void onStart() {        super.onStart();        if(isFirstLaunch()){            populateDefaultQuotes();            //Save the preferences, isFirstLaunch will now be false            SharedPreferences settings = getSharedPreferences(Constants.PREFS_NAME, 0);            SharedPreferences.Editor editor = settings.edit();            editor.putBoolean(""isFirstLaunch"", false);            editor.commit();        }        setupUI();        checkOrientation();        restoreCache();    }    private void populateDefaultQuotes(){        System.out.println(""!!!!!! FIRST TIMER !!!!!!"");    }    private boolean isFirstLaunch() {        // Restore preferences        SharedPreferences settings = getSharedPreferences(Constants.PREFS_NAME, 0);        boolean isFirstLaunch = settings.getBoolean(""isFirstLaunch"", false);        return isFirstLaunch;    }</code></pre>","19875","","","","","2011-06-24 15:40:36","How can I detect if a user is using my application for the first time?","<java><android><sharedpreferences>","2","2","2","",""
"3762306","1","3893341","","2010-09-21 16:18:18","6","2713","<p>I try to implement a hover effect (effect when button is pressed) through putting a semi transparent PNG file on top of the button background and the button icon. Unfortunatly the button background file is a 9-PATCH-PNG which causes some trouble here: It ""swallows"" everything on top of its layer and doesnt allow to cover the stretchable areas (the fine light line around) of the nine-patch-png. <strong>In other words, the black lines the top and left edge of the 9 PATCH PNG cause not only stretching, but also padding behaviour.</strong></p><p>Removing the 9-Patch-Information is not a good solution.</p><p>Here u can see my Button. The blue background is a 9 PATCH PNG. The thin light line around the button is unwanted.</p><p><img src=""http://i.stack.imgur.com/GTIbq.png"" alt=""alt text""></p><p>This layer-list is assigned to the button attribute ""background"":</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layer-list  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item    android:drawable=""@drawable/home_btn_bg_blue_without_padding"" /&gt;  &lt;item&gt;    &lt;bitmap      android:src=""@drawable/home_icon_test""      android:gravity=""center"" /&gt;  &lt;/item&gt;  &lt;item    android:drawable=""@drawable/layer_black_50"" /&gt;&lt;/layer-list&gt;</code></pre><p>Setting the offsets of the layer to ""-1"" on each border is not valid. Have u guys suggestions?</p><p><strong>Update</strong></p><p>I tried following, which shall <strong>avoid scaling</strong>, suggested from <a href=""http://developer.android.com/guide/topics/resources/drawable-resource.html#LayerList"" rel=""nofollow"" title=""android.com"">here</a>. But didn't work either:</p><pre><code>&lt;!-- To avoid scaling, the following example uses a &lt;bitmap&gt; element with centered gravity: --&gt;&lt;item&gt;  &lt;bitmap android:src=""@drawable/image""          android:gravity=""center"" /&gt;&lt;/item&gt;</code></pre><p>My version (There are still the stretchable areas of the 9-patch-png uncovered):</p><p><img src=""http://i.stack.imgur.com/Hn2dx.png"" alt=""alt text""></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layer-list  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item    android:drawable=""@drawable/home_btn_bg_blue_hover_without_padding"" /&gt;  &lt;item&gt;    &lt;bitmap      android:src=""@drawable/home_icon_test""      android:gravity=""center"" /&gt;  &lt;/item&gt;  &lt;item&gt;    &lt;bitmap android:src=""@drawable/layer_black_100""          android:height=""100dp""          android:width=""100dp""/&gt;&lt;/item&gt;&lt;/layer-list&gt;</code></pre><p><strong>Update 2</strong></p><p>Could that work for me? <a href=""http://stackoverflow.com/questions/3021401/making-overlaid-image-transparent-on-touch-in-android"">http://stackoverflow.com/questions/3021401/making-overlaid-image-transparent-on-touch-in-android</a></p>","433718","","21234","","2010-12-08 11:02:56","2011-02-18 18:47:39","How to cover a 9-PATCH-PNG entirely?","<android><android-layout><layer><nine-patch>","4","5","3","",""
"3762362","1","3762697","","2010-09-21 16:24:31","1","882","<p>I'm using code similar to whats below with the exception that the thread is started via a button press. When I press the button, the data at the url is grabbed and it switches me over to the other activity. The issue i'm having is when I'm at the other activity and hit the backbutton I get an Exception saying that the thread has already been started. I've tried killing the thread when the activity loads checking for isAlive but it won't seem to die. Does anyone happen to know how I would get this activity back to it's original state with the created thread not running?</p><pre><code>import java.io.BufferedInputStream;  import java.io.InputStream;  import java.net.URL;  import java.net.URLConnection;  import org.apache.http.util.ByteArrayBuffer;  public class Iconic extends Activity {  private String html = """";  private Handler mHandler;  public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      mHandler = new Handler();      checkUpdate.start();  }  private Thread checkUpdate = new Thread() {      public void run() {          try {              URL updateURL = new URL(""http://iconic.4feets.com/update"");              URLConnection conn = updateURL.openConnection();              InputStream is = conn.getInputStream();              BufferedInputStream bis = new BufferedInputStream(is);              ByteArrayBuffer baf = new ByteArrayBuffer(50);              int current = 0;              while((current = bis.read()) != -1){                  baf.append((byte)current);              }              /* Convert the Bytes read to a String. */              html = new String(baf.toByteArray());              mHandler.post(showUpdate);          } catch (Exception e) {          }      }  };  private Runnable showUpdate = new Runnable(){      public void run(){          Intent newIntent = New Intent(Iconic.this, otherClass.class);        startActivity(newIntent);    }  };  </code></pre><p>}  </p>","70342","","","","","2010-11-29 07:14:27","Exception caused by still running thread on back button press(Android)","<android><multithreading>","5","0","","",""
"3762476","1","3762611","","2010-09-21 16:39:11","2","1117","<p>I am trying to make Task parcelable to put into an bundle to pass from my service to activity but I'm having a little bit of trouble working with the ArrayList of my custom type.</p><p>Task:</p><pre><code>@Overridepublic int describeContents() {    // TODO Auto-generated method stub    return 0;}@Overridepublic void writeToParcel(Parcel prc, int arg1) {    // TODO Auto-generated method stub    prc.writeInt(id);    prc.writeString(timeStamp_string);    prc.writeString(timeToComplete_string);    prc.writeTypedArray(resources.toArray(), PARCELABLE_WRITE_RETURN_VALUE);}</code></pre><p>Resource:   </p><pre><code>@Overridepublic int describeContents() {    // TODO Auto-generated method stub    return 0;}@Overridepublic void writeToParcel(Parcel prc, int flags) {    // TODO Auto-generated method stub    prc.writeInt(id);    prc.writeString(timeStamp_string);    prc.writeString(resourceType);    prc.writeString(dataType);    prc.writeString(value);    prc.writeInt(taskId);}</code></pre><p>It gives me an error on the prc.writeTypedArray function inside task:</p><pre><code>Bound mismatch: The generic method writeTypedArray(T[], int) of type Parcel is not applicable for the arguments (Object[], int). The inferred type Object is not a valid substitute for the bounded parameter &lt;T extends Parcelable&gt;</code></pre><p>If Resources is implementing Parcelable then I don't see where the problem is.  </p><p>Edit: <strong>I BELIEVE I FIXED THIS PART.  I USED .writeParcelableList() INSTEAD.  CAN SOMEONE CONFIRM THAT THIS SHOULD WORK?  QUESTION BELOW IS STILL VALID.</strong>   </p><p>Also when Task is read from the intent by the activity, I need to do some computation to fill some other data members.  What function is called there that I can impliment to do the computation?  Is it readFromParcel(...) or the constructor that takes in a Parcelable as a parameter?</p><p>Thanks</p>","451037","","451037","","2010-09-21 16:56:43","2010-09-21 16:57:34","Make Class Parcelable error","<android><parcelable>","1","0","1","",""
"3762607","1","","","2010-09-21 16:57:14","2","6341","<p>for a school project I am trying to make an android application that, once started, will perform a spectrum analysis of live audio received from the microphone or a bluetooth headset. I know I should be using FFT, and have been looking at moonblink's open source audio analyzer ( <a href=""http://code.google.com/p/moonblink/wiki/Audalyzer"" rel=""nofollow"">http://code.google.com/p/moonblink/wiki/Audalyzer</a> ) but am not familiar with android development, and his code is turning out to be too difficult for me to work with. </p><p>So I suppose my questions are, are there any easier java based, or open source android apps that do spectrum analysis I can reference? Or is there any helpful information that can be given, such as; steps that need be taken to get the microphone input, put it into an fft algorithm, then display a graph of frequency and pitch over time from its output?</p><p>Any help would be appreciated, thanks.</p>","454211","","","","","2012-11-10 16:58:44","android spectrum analysis of streaming input","<android><audio><analysis><fft>","1","3","1","",""
"3762620","1","3762699","","2010-09-21 16:58:37","0","316","<p>I am trying to create a tic - tac - toe type of game where two androids can play with each other. I am trying to build this game using eclipse SDK and a servlet written in PHP (or I can use Java if needed). The diagram is attached ( <a href=""http://www.scorechase.com/tictactoe.PNG"" rel=""nofollow"">http://www.scorechase.com/tictactoe.PNG</a> ) which depicts one side of the data flow. Here is the problem</p><p>1] How do I identify the two emulators?2] When the device 1 sends an ""X"" to the servlet, how do I push the message to device 2 so that the message gets populated on device 2.</p><p>I did this long back in J2ME where I used the push API to push the data after the devices registered a listener on the servlet. I am not sure how to achieve this in Android. Any ideas will be really helpful.</p><p>Thanks!</p>","454084","","","","","2010-09-21 17:11:25","Making two android emulators talk through a servlet","<android><api><servlets><push>","1","0","","",""
"3762678","1","","","2010-09-21 17:07:21","6","12830","<p>I'm publishing an Android application developed in Eclipse and, as stated in the title, I would like to integrate Proguard obfuscation into the build, specifically for exporting a signed app.</p><p>Anyone had any luck without going down the ant path?</p>","454233","","220621","","2012-05-07 15:50:06","2012-05-07 15:50:06","How to set up ProGuard in Eclipse when exporting a signed, obfuscated Android application?","<android><eclipse><obfuscation><proguard>","2","1","4","",""
"3762763","1","","","2010-09-21 17:21:15","16","13230","<p>I guess that Android won't let people to do this, because they think they have perfect handle for the task/applications. However, I really need to do this in my case.</p><p>I have an activity A acting as the entry point of my application. In that activity, it reads the preference and decided which activity to start, say B or C. After that, it finishes itself. So, activity A never appears to the users. </p><p>My application stores things on sdcard, and reads from it constantly. So, when the sdcard is unmounted, I need to display a message to the user that the sdcard is unavailable, instead of opening B or C. I set a check in A to display that message when sdcard is unavilable. When that message is displayed, A will not try to start B or C. </p><p>Things works perfectly if user only enter my application from application launcher. However, I found that user can also enter my application by long pressing home and choose it from the recent application list, if he has opened it recently. When user does that, it skips A and goes directly to B or C. I don't have the check in both of them, so exception is thrown while I am trying to access sdcard, and force close dialog pops up.</p><p>I can simply move my check to both B and C to fix this problem. But in the future, the number of activities started from A will increase. If there are 6 of them, I'll need to copy this check to 6 places. Needless to say, this looks very ugly, and is a maintenance nightmare.</p><p>So, the best fix should be removing my application from recent application list when the sdcard is uunmounted. However, I can't find how to do this. Even killing the process or use ActivityManager.restartPackage, it still appears in the list. Can anyone tell me how to remove it from the list?</p>","412759","","","","","2012-06-15 23:10:24","How to remove application from recent application list?","<android>","6","1","4","",""
"3762833","1","3763122","","2010-09-21 17:28:07","5","2415","<p>My question in a nutshell is: Is there a correlation between the number of decimals used in GPS co-ordinates and the accuracy of the location?</p><p>Right now I happen to be working with the Android SDK but I'm sure this question can apply to many other geolocation SDKs. Basically, Android returns GPS coordinates with up to 14 digits. That seems like overkill in most situations. Lets say I needed accuracy down to about an area of 10 feet by 10 feet. How many decimals do I really need to worry about? The use-case that I'm looking for is I want to know if a person is north or south of a particular latitude - how many digits would I need to store in the database and how many digits would I need to compare?</p>","208127","","","","","2010-09-21 18:54:37","Geocoding - accuracy required in GPS coordinates?","<android><geocoding>","2","1","","",""
"3762887","1","3762943","","2010-09-21 17:35:00","0","11723","<p>In the ImageAdapter class of this tutorial, <a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-gridview.html</a></p><p>I would like to create and populate an array using a for loop. But it seems no matter where I place it, it causes an error.</p><p>For example, under <code>private Context mContext;</code> I put in the following and it causes an error. I think the loop is good, I'm just not sure where I can put it.<br></p><p><code>private String[] myString;for (int number = 0; number &lt;= 12; number++) {    myString[number] = ""image"" + number;}</code></p>","454255","","","","","2012-02-29 12:41:10","For Loop to populate Array?","<android><loops>","3","0","","",""
"3762895","1","3762927","","2010-09-21 17:35:56","1","2807","<p>I am not using an image icon, only a (fixed size) text indicator. How do I set the tab height to its most efficient size?[wrap_content has no effect.]</p>","353616","","","","","2011-11-15 05:21:51","Android Tab height wastes real estate! There must be a way to minimize it!","<android><android-tabhost><tabwidget>","2","0","0","",""
"3762979","1","4001900","","2010-09-21 17:46:04","0","1241","<p>When Android 2.1 focuses on a text field in a WebView while in Landscape, it does this below.  It takes the entire field input area and fills the tiny strip of available screen.</p><p>The problem here is that when you hit that ""Next"" button, you have enough idea what field you are in.</p><p>Is there a way to improve this with some sort of prompt so the user at least knows the type of data they are expected to enter in that field?  I tried using a</p><pre><code>&lt;label for=""my_field_id""&gt;My Caption&lt;/label&gt;&lt;input type=""text"" id=""my_field_id""/&gt;</code></pre><p>hoping that it would pull text from there, but it seemed to have no effect.</p><hr><p>Also, I just tried adding a <code>placeholder=""Foo Bar""</code> to the input field.  This sort of worked.  The prompt appeared in the field, and when tapped it appeared in the fullscreen input area.  But the problem was that the placeholder was kind of editable text, but not really.  The cursor placement and input just sort of behaved buggy and strange as it couldn't deleted, but new input would write over it.  It was not a pleasant user experience :(</p><p><img src=""http://i.stack.imgur.com/IkWRR.jpg"" alt=""alt text""></p>","62076","","62076","","2010-09-21 18:11:26","2010-12-14 22:09:12","Android 2.1 WebView and keyboard input","<html><android><webview>","1","0","","",""
"3763124","1","3765936","","2010-09-21 18:05:05","1","879","<p>Is it possible to have something similar like Blackberry in Android:<a href=""http://docs.blackberry.com/en/developers/deliverables/11935/Create_a_menu_item_602617_11.jsp"" rel=""nofollow"">link text</a></p><p>I want to add a menu item particularly to the Contacts Option menu.</p><p>please let me know if this can be done in android.</p>","454281","","","","","2010-09-22 02:35:18","add menu item to android applicaton","<android><menuitem>","1","0","","",""
"3763166","1","","","2010-09-21 18:11:45","0","1306","<p>My layout xml has a Tablelayout with TextViews for a cell:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:stretchColumns=""1""&gt;    &lt;TableRow&gt;        &lt;TextView            android:text=""Style Details...""            android:padding=""3dip"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:text=""Style""            android:padding=""3dip"" /&gt;        &lt;TextView            android:id=""@+id/StyleName""            android:gravity=""right""            android:padding=""3dip"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:text=""Price (Euro)""            android:padding=""3dip"" /&gt;        &lt;TextView            android:id=""@+id/StylePrice""            android:gravity=""right""            android:padding=""3dip"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:text=""Price for Volume &amp;lt;60&amp;lt;90 pcs""            android:padding=""3dip"" /&gt;        &lt;TextView            android:id=""@+id/PriceVolume6090""            android:gravity=""right""            android:padding=""3dip"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:text=""Price for Volume &amp;lt;100&amp;lt;250pcs""            android:padding=""3dip"" /&gt;        &lt;TextView            android:id=""@+id/PriceVoume100250""            android:gravity=""right""            android:padding=""3dip"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:text=""Price for Volume &amp;lt;251&amp;lt;500pcs""            android:padding=""3dip"" /&gt;        &lt;TextView            android:id=""@+id/PriceVoume251500""            android:gravity=""right""            android:padding=""3dip"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:text=""Price for Volume &amp;lt;501pcs""            android:padding=""3dip"" /&gt;        &lt;TextView            android:id=""@+id/PriceVolume501""            android:gravity=""right""            android:padding=""3dip"" /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>I want to set the value for StyleName through my Activity. Following is the code that I am using:</p><pre><code>import android.app.Activity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.util.Log;import android.widget.TextView;public class StyleDetailsActivity extends Activity { private TextView tvStyleName; @Override  public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);                setContentView(R.layout.styledetailsview);  String styleName = ""Testing Style Name"";                tvStyleName = (TextView)findViewById(R.id.StyleName);  tvStyleName.setText(styleName);        }}</code></pre><p>The code is compiling fine and the app starts. On Running the app, I am getting a nullpointer exception. When I debug, I see that tvStyleName is null. Any suggestions as to why it would not be initializing</p>","454284","","234039","","2010-09-21 18:23:38","2012-12-27 16:37:02","TextView is not initializing","<android><nullpointerexception><textview>","2","3","","",""
"3763171","1","3763670","","2010-09-21 18:12:09","1","4966","<p>It should be easy, right? So - here's how I have <code>ViewSwitcher</code> defined in XML (Id's and layouts omitted for brevity)</p><pre><code>&lt;ViewSwitcher android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" &gt;           &lt;!-- First view, comes up OK --&gt;     &lt;LinearLayout android:id=""@+id/header1""&gt;        &lt;!-- some more controls: Progress bar, test view and the button --&gt;    &lt;/LinearLayout&gt;    &lt;!-- second view. changing to the actual (not include) layout has no effect --&gt;    &lt;include android:id=""@+id/header2"" /&gt;&lt;/ViewSwitcher&gt;</code></pre><p>Then somewhere in my Java code I have this code</p><pre><code>ViewSwitcher switcher = (ViewSwitcher) findViewById(R.id.profileSwitcher);// more code that basically executes background search// when call comes back - switchswitcher.bringToFront(); // does nothing// switcher.bringChildToFront(findViewById(R.id.header2)); // no effect ether</code></pre><p>It's just not switching. I develop for API v. 3 (1.5+) and to my surprise there are very few references to ViewSwitcher. I'm I missing something obvious here?</p><p>P.S. I just found out by brute force that this works:</p><pre><code>switcher.setDisplayedChild(1);</code></pre><p>Still - why no luck with <code>bringToFront()</code>?</p>","135946","","135946","","2010-09-21 18:36:09","2013-03-26 08:36:26","Android - ViewSwitcher is not switching views","<android><viewswitcher>","2","0","2","",""
"3763234","1","","","2010-09-21 18:21:40","-2","1984","<p>i have a problem... How to display data from sqlite in textview..</p><p>please help me out..</p><p>Thank u..</p>","448928","","","","","2012-01-10 18:12:24","How to display data from sqlite in textview","<android>","1","0","1","",""
"3763301","1","3763339","","2010-09-21 18:28:44","4","1766","<p>I just started looking at the android framework and was wondering what was the best way going about getting good at it. I started with a text game and created a simple bubbleWrap game next. But am not sure if I'm going about it the right way now, so I thought I'd ask some of you more experienced Android people out here. Are there any courses online that would be beneficial? Any books that helped ya'll?</p><p>Thanks in advance!</p>","388025","","","","","2012-12-22 14:01:13","How to go about learning the android framework","<android>","3","4","4","2012-12-22 16:09:30",""
"3763428","1","","","2010-09-21 18:47:44","2","1248","<p>My spinner control is displaying fine no problem.  When someone is in create mode they are able to selected a value which I am able to record and store in my database.</p><p>But I have a problem when someone is in edit mode and I want to display the list but have one of the items (say the third) selected.  I can't see how to do that.  All the tutorials talk about how to populate the spinner but not how to preset one as being selected.</p><pre><code>this.ddlCategory = (Spinner)this.findViewById(R.id.add_edit_place_ddlCategory);    ArrayAdapter adpt = new ArrayAdapter(this, android.R.layout.simple_spinner_item, categories);    adpt.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    this.ddlCategory.setAdapter(adpt);</code></pre><p>Please helpCheryl</p>","198888","","","","","2010-09-21 18:57:08","Android Spinner Control - Presetting an item as being selected","<android><spinner>","1","0","","",""
"3763547","1","3764032","","2010-09-21 19:03:00","0","2026","<p>I have a listview and i inflate the first position with a layout and every other position i do another inflation with another layout.I can do that by checking every time in getView, but as you can imagine this is not very efficient.</p><p>Can you share me your thoughts to get that result by having this pattern?(This don't get me the correct result(cause after 4-5 positions, depending of the number of positions inflated the first time, i get the layout.inside_list_2 on other positions too.)</p><pre><code>if (convertView == null) {  if (position == 0)   convertView = mInflater.inflate(R.layout.inside_list_2,                            parent, false);    else    convertView = mInflater.inflate(R.layout.inside_list, null);  }else{        holder=(ViewHolder)convertView.getTag();}</code></pre>","348058","","","","","2010-09-21 20:10:13","inflating 2 different layouts at a listAdapter on Android","<android><listview>","2","0","","",""
"3763585","1","3764540","","2010-09-21 19:09:25","1","5932","<p>I have 2 items that are related to each other that need to be accessed separately. The title of a book and how many pages it has. I have made an array for the titles, but what is the best way to link the number of pages in that book to that title?</p><p>I was thinking of the following but I don't see how to access the page count.</p><pre><code>&lt;string-array name=""books""&gt;    &lt;item pages=""428""&gt;""book1""&lt;/item&gt;    &lt;item pages=""599""&gt;""book2""&lt;/item&gt;    &lt;item pages=""204""&gt;""book3""&lt;/item&gt;&lt;/string-array&gt;</code></pre>","454255","","","user357812","2010-09-23 13:50:39","2010-09-23 13:50:39","Multidimensional Array","<android><xml><arrays><xpath>","2","0","0","",""
"3763651","1","3763666","","2010-09-21 19:17:31","2","372","<p>I have multiple classes and threads that need to write to a Java Swing JScrollPane. In the Android/Eclipse environment I used android.os.Message. Is there something similar in the NetBeans/Windows environment? Here is where I would like to send the message from:</p><pre><code>public class PrintStatusTask extends Thread {    PrintStatusTask(String name) {        this.name = name;    }    private void sendMessage(String s) {        // TODO: send message to jTextArea    }    public void run() {        ...        sendMessage(""Any message"");        ...</code></pre><p>Here is an example of writing to the JScrollPane from the JFrame it lives in: </p><pre><code>public class Controller extends javax.swing.JFrame implements Observer {    ...    jTextArea.append(s);        ...</code></pre>","398460","","398460","","2010-09-21 20:34:09","2010-09-22 01:24:20","How is messaging between Java classes best accomplished?","<java><android><swing><netbeans><messaging>","2","0","","",""
"3763780","1","","","2010-09-21 19:34:38","1","908","<p>So I followed the tutorial at this site: <a href=""http://www.4feets.com/2009/03/2d-physics-on-android-using-box2d/"" rel=""nofollow"">http://www.4feets.com/2009/03/2d-physics-on-android-using-box2d/</a></p><p>As interesting as it is, they leave out one section and from their tutorial: How to display the shapes on the device's screen.</p><p>I have a MyTouch 3G running Android 1.6 (donut). What control and what events can I take advantage of to display the shapes from the above tutorial? I've hunted around, any tutorials I've found about JBox2D all point back to this tutorial.</p>","160527","","","","","2011-11-10 15:44:03","Displaying JBox2D animation in Android?","<android><graphics>","1","2","","",""
"3763935","1","","","2010-09-21 19:54:19","1","8598","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6068803/how-turn-on-camera-flash-light-programmatically-in-android"">How turn on camera flash light programmatically in Android?</a>  </p></blockquote><p>so how do you turn on the camera's ""flash"" LED in Android?  (like flashlight apps) - and is it possible to vary the brightness?</p><p>search results for ""android flash"" too polluted by adobe flash :(</p>","46478","","234938","","2010-09-21 20:25:41","2013-02-01 14:07:31","Turning on camera flash LED in Android?","<android>","1","3","0","2013-02-01 15:22:35",""
"3764040","1","","","2010-09-21 20:06:22","1","724","<p>Revision 7 broke my build. I need SDK tools revision 6 for Mac OS.</p><p>Revision 6 is listed here, <a href=""http://developer.android.com/sdk/tools-notes.html"" rel=""nofollow"">http://developer.android.com/sdk/tools-notes.html</a>But, I didn't find anywhere to download it. Anyone know?Thanks.</p>","445302","","445302","","2010-09-21 21:32:08","2011-03-25 05:47:14","Where can I find SDK Tools, Revision 6?","<android>","2","0","1","",""
"3764057","1","3765307","","2010-09-21 20:08:40","0","612","<p>I have an application that will need to make a call and play a recorded message. Is that even possible?</p>","21811","","","","","2010-09-21 23:45:28","Make a call and play a message? (Android 1.6)","<android><phonecalls><android-1.6-donut>","1","0","","",""
"3764061","1","3766129","","2010-09-21 20:09:03","5","3468","<p>I've been fiddling with android, and I've been following the menu sample, and it runs almost fine, but the ""title"" field of the menu items isn't displaying.</p><p>I think it's related to this question:<a href=""http://stackoverflow.com/questions/3286093/android-menu-item-not-showing-text"">http://stackoverflow.com/questions/3286093/android-menu-item-not-showing-text</a>but I'm not sure what his answer means.</p><p>Anyway, it properly gets that I have 2 menu items, it just isn't displaying the text. I'm not quite sure where the error is and figured extra sets of eyes would be good.</p><p>XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;menu xmlns:android=""https://schemas.android.com/apk/res/android""&gt; &lt;item android:id=""@+id/options""  android:title=""@string/main_options"" /&gt; &lt;item android:id=""@+id/options2""  android:title=""@string/main_options2"" /&gt;&lt;/menu&gt;</code></pre><p>Inflator:</p><pre><code>@Override    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.main_menu, menu);        return true;    }</code></pre><p>If anything else is needed, let me know.</p><p>edit:string file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""hello""&gt;Hello World!&lt;/string&gt;    &lt;string name=""app_name""&gt;LifeInColor&lt;/string&gt; &lt;string name=""main_options""&gt;Options&lt;/string&gt; &lt;string name=""main_options2""&gt;Something goes here&lt;/string&gt;&lt;/resources&gt;</code></pre><p>changing the xml to:</p><pre><code> &lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;    &lt;menu xmlns:android=""https://schemas.android.com/apk/res/android""&gt;     &lt;item android:id=""@+id/options""      android:title=""@string/main_options"" /&gt;     &lt;item android:id=""@+id/options2""      android:title=""Something goes here"" /&gt;    &lt;/menu&gt;</code></pre><p>gets the same result. I have a picture, but it won't let me post it because I'm new.</p>","453282","","453282","","2010-09-21 20:54:55","2012-08-09 11:17:19","Android Menu Item Title not displaying","<android><menu><title><item>","3","6","","",""
"3764065","1","","","2010-09-21 20:09:25","0","298","<p>I have an app that has only one Webview and some buttons. On the webview I show a website that contains one textbox.</p><p>Sometimes, when I tap the textbox the virtual keyboard does not show, and I have to tap again. This only happens on OS 2.1 </p><p>Has anyone else faced this? Anyone have any idea of what may be causing it?</p><p>I tryied removing focus, requesting focus, invalidating the screen, etc...</p><p>Please, any sugestions, or battle plans on how to defeat this bug would be greatly appreciated (Really, this bug is very annoying)</p><p>Thanks a lot!</p>","367342","","","","","2010-09-21 20:16:30","Virtual Keyboard only shows after two taps","<android><keyboard><webview><virtual-keyboard>","1","0","","",""
"3764092","1","","","2010-09-21 20:12:24","2","597","<p>I have run into a problem I don't understand. I'm using managedQuery with the only Cursor of an activity and when I quit the activity (the app in this case), I get the following error printed in logcat :</p><blockquote>  <p>I/dalvikvm(  420): Uncaught exception thrown by finalizer (will be discarded):</p>    <p>I/dalvikvm(  420):  Ljava/lang/IllegalStateException;:  Finalizing cursor  android.database.sqlite.SQLiteCursor@437b5f10  on contacts that has not been  deactivated or closed</p>    <p>I/dalvikvm(   420):     at  android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)</p>    <p>I/dalvikvm(  420):    at  dalvik.system.NativeStart.run(Native  Method)</p></blockquote><p>I was supposing that calling managedQuery would have close the cursor before. What am I missing here ?</p><p><strong>EDIT:</strong></p><p>This not on close but on re-open but this doesn't change anything to the problem, the cursor is not finalized on previous close</p>","179872","","179872","","2010-09-22 09:05:20","2011-04-27 20:55:08","managedQuery not closed cursor onDestroy?","<android><cursor>","1","0","","",""
"3764173","1","3771960","","2010-09-21 20:23:43","1","5634","<p>the following text is a bit lenghty as I wanted to make sure that people with similar problems that e.g. google this page can easily follow the exact problem and its solutions easily. But now on to my issue:</p><p>I recently started programming OpenGL ES on an Android smartphone and ran into problems understanding how gluPerspective and gluLookAt are used. I <em>think</em> I understand what they do, however I cannot see the triangle I draw. I run the following code in the onDrawFrame-method of my activity. Said activity implements GLSurfaceView.Renderer with the onDrawFrame marked with @Override. My code is:</p><pre><code>gl.glViewport(0, 0, screen_width, screen_height);gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); //set background to blackgl.glClearDepthf(1.0f); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);gl.glMatrixMode(GL10.GL_PROJECTION); // Change PROJECTION matrixgl.glLoadIdentity();float aspect_ratio = (float) screen_width / screen_height;GLU.gluPerspective(gl, 67, aspect_ratio, 1, 100);gl.glEnable(GL10.GL_DEPTH_TEST);gl.glMatrixMode(GL10.GL_MODELVIEW); // Change MODELVIEW matrixgl.glLoadIdentity();GLU.gluLookAt(gl, 0, 0, 20, 0, 0, 0, 0, 1, 0);// make triangle with vertices (-2,0,0), (2,0,0), and (0,.5,0)float[] vertices = { -2f, 0, 0, 2f, 0, 0, 0, .5f, 0 };ByteBuffer buffer = ByteBuffer.allocateDirect(vertices.length * 4);buffer.order(ByteOrder.nativeOrder());FloatBuffer vertex_buffer = buffer.asFloatBuffer();for (int i = 0; i &lt; 9; i++) {    vertex_buffer.put(vertices[i]);}gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertex_buffer);gl.glDrawArrays(GL10.GL_TRIANGLES, 0, 3);gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);gl.glDisable(GL10.GL_DEPTH_TEST);</code></pre><p>The next points are short notes on what I putatively know about camera settings in the above code. PLEASE correct me if I got something wrong in the following explanations, as that might already solve all of my issues!</p><ol><li>glMatrixMode(GL10.GL_PROJECTION) switches to changing the camera matrix (for which I load an identity matrix directly afterwards)</li><li>GLU.gluPerspective(gl, 67, aspect_ratio, 1, 100) sets a perspective projection with a view frustrum of 67 degree view angle in the y-dimension. Using ""aspect_ration=(float)width/height"" OpenGL computes the view angle in the x-dimension. Further the ""1"" is the near clipping plane, while ""100"" is the value of the far clipping plane in this case.</li><li>As far as I know it does not matter, where in the code gluLookAt is called, as long as it is done before the actual drawing (I'm unsure about this though). In this example I change to the MODELVIEW matrix first, load an identity matrix, and then gluLookAt is called.3.</li><li>""GLU.gluLookAt(gl, 0, 0, 20, 0, 0, 0, 0, 1, 0)"" actually consists of three 3-element vectors. The initial one ((0,0,20) in this example) sets the position of the camera in world coordinates (i.e. 20 units on the positive Z-axis, which means it is ""sticking out"" of the front of the phone's screen). The second vector determines the point in the world coordinate system the camera looks at (in this example the origin of the coordinate system, i.e. the camera looks along the negative z-axis). The third vector is the up-vector that defines the direction of the y-Axis of the cameras coordinate system (and therefore also the x-axis via cross product with the vector from camera position to the point it looks at).</li></ol><p>The triangle drawing code was copied from a tutorial (but I found similar code also in other tutorials, so I assume this is not the problem).</p><p>As far as I get it, the camera is now positioned on (0,0,20) and looks towards the origin of the coordinate system. Its drawing frustrum starts at z-value 19 and goes as far as -80 (the camera is at z-axis point 20 and looks along the negative z-axis; its viewing frustrum has near and far plane at 1 and 100 (both looking along the negative z-axis in this case), respectively). Therefore, the triangle should be visible, as its vertices are positioned around the origin on the z-axis=0 plane (i.e. the xy-plane), which is clearly within the viewing frustrum. Further the drawn vertices are arranged in counter-clockwise order; the default in OpenGL.</p><p>So after this long introduction into the problem my simple question is: What did I mess up so that this code does not do what I expect it to?</p>","454402","","","","","2010-09-22 17:28:45","Android OpenGL ES - I can't make gluLookAt/gluPerspective work","<java><android><opengl-es><3d>","2","3","0","",""
"3764210","1","3765894","","2010-09-21 20:29:04","0","629","<p>I have developed a google map app and the zoom controls will not appear automaticallyand will disappear after they are used.</p><p>So I want to see the zoom controls (_ , +) to appear with the map permanently.</p><p>Thanx in adv  </p>","412168","","241475","","2010-09-22 02:20:46","2010-09-22 02:22:20","How to make Google map zoom controls will appear automatically?","<android>","1","1","","",""
"3764796","1","3764920","","2010-09-21 21:53:47","0","351","<p>I want to display a play button (ImageView) ontop of a thumbnail (another ImageView). How can I place UI controls ontop of each other?</p><p>Programatically or in XML?</p>","19875","","","","","2010-09-21 22:24:20","How to place ImageView's ontop of each other?","<java><android><user-controls><uiimageview>","2","0","","",""
"3765161","1","","","2010-09-21 23:14:21","12","28052","<p>I have looked at every discussion and thread I can find on getting this to work but it is not. I have a simple timer that updates a text view (mTimeTextField in the example below). The mUpdateTimeTask run method is being executed correctly (every second) but the UI/text field is not being updated.</p><p>I have code based on the info found here:</p><p><a href=""http://android-developers.blogspot.com/2007/11/stitch-in-time.html"" rel=""nofollow"">http://android-developers.blogspot.com/2007/11/stitch-in-time.html</a><a href=""http://developer.android.com/resources/articles/timed-ui-updates.html"" rel=""nofollow"">http://developer.android.com/resources/articles/timed-ui-updates.html</a></p><p>Here is the code:</p><pre><code>package com.something.handlertest;import com.something.handlertest.R;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.Handler;import android.os.SystemClock;import android.view.View;import android.widget.Button;import android.widget.TextView;public class Test extends Activity {    private Handler mHandler = new Handler();     private int labelNo    = 0;    private long currTime  = 0L;    private long mStartTime = 0L;    TextView mTimeTextField;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mTimeTextField = (TextView)findViewById(R.id.timeTextFieldl);        Button startButton = (Button)findViewById(R.id.start_button);        startButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                   if (mStartTime == 0L) {                        mStartTime = System.currentTimeMillis();                        mHandler.removeCallbacks(mUpdateTimeTask);                        mHandler.postDelayed(mUpdateTimeTask, 100);                   }            }        });    }    private Runnable mUpdateTimeTask = new Runnable() {           public void run() {               final long start = mStartTime;               //long millis = SystemClock.uptimeMillis() - start;               long millis = SystemClock.uptimeMillis();               int seconds = (int) (millis / 1000);               int minutes = seconds / 60;               seconds     = seconds % 60;               //setContentView(mTimeTextField);  This will blow up if I use it               if (seconds &lt; 10) {                   mTimeTextField.setText("""" + minutes + "":0"" + seconds);               } else {                   mTimeTextField.setText("""" + minutes + "":"" + seconds);                           }               //mHandler.postAtTime(this,                   //    start + (((minutes * 60) + seconds + 1) * 1000));               mHandler.postAtTime(this, 1000);           }        };}</code></pre><hr><p>Per some suggestions, I have tried adding: </p><pre><code>setContentView(mTimeLabel);</code></pre><p>But this will crash complain about the view not having a parent. FYI, I do have a:</p><pre><code>setContentView(R.layout.main);</code></pre><p>call in my <code>onCreate()</code>.</p>","324322","","438992","","2013-05-14 16:57:48","2014-02-11 15:56:45","Updating UI with Runnable & postDelayed not working with timer app","<android><multithreading><timer><handler><postdelayed>","5","2","2","",""
"3765225","1","3765330","","2010-09-21 23:28:58","8","10295","<p>I am currently working on a Mobile App project for Ford company, and I am a newbie in Java Android.</p><p>I am just wondering, is there any way to decrease the size of rating bar in Android 2.1?</p><p>I want to preserve more spaces for other buttons and edittexts.</p><p>Thank you in advance for you help</p>","448732","","1140748","","2012-05-01 17:28:32","2012-05-01 17:28:32","Decrease the size of Rating Bar in Android 2.1","<android><size><rating>","2","0","4","",""
"3765276","1","3765315","","2010-09-21 23:38:26","0","161","<p>I implemented three (live, news, music) widgets for a radio application. For each widget I get the application name as the widget name.</p><p>How can I give different names to widgets?</p><p>E.g. live widget, news widget, music widget</p>","341443","","345078","","2012-02-20 12:46:50","2012-02-20 12:46:50","Give different names to app widgets","<android>","1","0","","",""
"3765395","1","","","2010-09-22 00:10:30","2","2731","<p>I'm trying to render custom buttons in Android. However, I'm having issues getting my bitmaps to render without scaling. I have a few constraints that are forcing me to forgo a few possible solutions. First, my bitmaps are being generated using a byte array through BitmapFactory; which I'm passing in bitmap options that specify inScaled=false for that. Second I must do everything in code, and am unable to use layout XML.</p><p>When I go to draw my custom button (which extends View), along with using the default behavior, I've tried calling <code>setDensity</code> on the canvas with both DENSITY_NONE and <code>bitmap.getDensity( )</code> (which is 160.) Despite this I can't get the bitmaps to render without scaling up. I've tried setting more options when creating my bitmaps (such as target density, screen density, etc.) However no combination of these has worked. This code 'fails' on the Samsung Galaxy S running 2.1 as well as HTC Droid Incredible on 2.1. When testing on an HTC Hero running 1.5 things work, but that was before the density stuff:/</p><p>Anyone out there have a suggestion?</p><p>Thanks!</p><p>Update:</p><p>I was a bit miss guided with my problem. It seems that the issue is with the underlying view. If I try to draw a normal line, I get scaling as well. This only happens in landscape, not portrait. Is there any way to disable the scaling between the two orientations?</p>","454540","","1140748","","2012-05-06 16:43:34","2012-05-06 16:43:34","Density on Android","<android>","1","1","","",""
"3765588","1","","","2010-09-22 00:57:46","2","585","<p>I’ve delved into the Android documentation that is somewhat nebulous regarding my question.  Is it possible to overlay an ImageButton over a ListView employing a SimpleExpandableListAdapter?  If so, pointing me in the right direction (code example or technical specs) would be most appreciative. </p><p>Additional clarification:  I’m designing/developing a prototype courseware app template to be used in advanced degree programs.  For this specific piece, the upper 2/3 of the screen will contain  a ListView employing a SimpleExpandableListAdapter that pulls such items as lesson orientation, activities, and assessment instruments from a resource file (text file to make it easier to populate/modify).  The lower 1/3 will be comprised of ImageButtons that control the flow of other lesson functions such as RSS feeds, access to school Websites, and arrow buttons that will change the contents of the upper 2/3 of the screen while leaving the lower 1/3 screen as is.  In essence, a customized GUI menu system at the lower 1/3 of the screen.  Thus, looking to determine if it is technically feasible to layer ImageButtons over a ListView.  Thanks in advance. </p>","454553","","454553","","2010-09-23 00:37:11","2010-09-23 00:37:11","Android: Employing ImageButton with ListView","<android><listview><imagebutton>","0","1","","",""
"3765679","1","4072679","","2010-09-22 01:21:27","2","372","<p>I need a product to simulate network latency for testing mobile applications (in particular iphone and android).  I plan to set up a wifi router connected to a linux box, and write a number of scripts to approximate different types of connectivity issues.</p><p>So far, I've taken a cursory look at <a href=""http://www.linuxfoundation.org/collaborate/workgroups/networking/netem"" rel=""nofollow"">Netem</a> and <a href=""http://www.isi.edu/nsnam/ns/"" rel=""nofollow"">ns-2</a> (<a href=""http://www.nsnam.org/"" rel=""nofollow"">or its offspring ns-3</a>).  Netem looks very easy to deploy and configure, but they both look like they'll require some in-depth investigation.</p><p>Does anyone have positive/negative experiences with either of those solutions that they could share?  Or maybe used a different solution for this problem?</p>","205192","","205192","","2010-09-22 02:21:07","2010-11-01 20:12:33","Best software product to simulate connectivity issues for mobile testing","<iphone><android><mobile><ns2>","1","2","1","",""
"3765714","1","3766844","","2010-09-22 01:30:11","2","5441","<p>I'm implementing a news application. I need to implement shared news links on gmail, twitter, or facebook etc.  How can I do this?</p>","341443","","23897","","2010-09-22 01:34:17","2013-08-05 22:18:54","How to share information links on twitter, gmail, facebook etc","<android>","2","2","4","",""
"3765748","1","3766101","","2010-09-22 01:38:35","3","1172","<p>My app connects to the net and populates a ListView. Sometimes nothing will be returned. What is the best way to notify the user the list is empty?</p><p>Some of my own suggestions:</p><ul><li>Show ""No Results"" in the first ListItem</li><li>Show a new view that says ""No Results""</li></ul>","19875","","","","","2010-09-22 03:24:41","Good UI Design: How to handle empty ListView?","<java><android><user-interface><listview>","3","0","5","",""
"3765763","1","","","2010-09-22 01:43:56","0","575","<p>Are these squares a representation of chinese characters being turned into unicode? </p><p>EDIT:[Here I entered the squares with numbers inside them into the post but they didn't render]</p><p>I'd like to either turn this back into the original characters when displayed in android (or to enable mysql to just store them as chinese characters not in unicode???)</p><pre><code>BufferedReader reader = new BufferedReader(new InputStreamReader(is, ""UTF-8""), 8);</code></pre><p>While debugging it shows the strings value as ""\u001a\u001a\u001a\u001a""</p><pre><code> byte[] bytes = chinesestringfromdatabase.getBytes();</code></pre><p>turns it into ""[26, 26, 26, 26]""</p><pre><code>String fresh = new String(bytes, ""UTF-8"");</code></pre><p>and then this turns it back intoEDIT:[Here I entered the squares with numbers inside them into the post but they didn't render]</p><p>My phone can display chinese text.</p><p>MySQL charset:  UTF-8 Unicode (utf8) </p><p>While typing my question I realize that perhaps I have the wrong charset all together.I'm lost as to whether or not my issue will even be anything coding related or if it is just related to a setting or if php cannot handle the character set??</p><p>I'd like to store and render multiple language character sets that could contain a mixture of languages.</p>","454583","","","","","2010-09-22 09:46:20","Android, mysql, and rendering non Latin Characters as well as Latin?","<java><php><mysql><android><unicode>","2","0","","",""
"3765860","1","","","2010-09-22 02:12:05","3","12324","<p>Is it possible to add a JavaScript interface to the Android Browser the same way one can be added to the WebView Component as <a href=""http://code.google.com/p/apps-for-android/source/browse/#svn/trunk/Samples/WebViewDemo"" rel=""nofollow"">illustrated in this demo</a>.  My particular use case only needs JavaScript -> android so that I can send it back to the previous activity.</p>","13892","","","","","2011-07-31 11:35:53","Adding JavaScript Interface to a Browser","<android>","2","5","2","",""
"3766225","1","3772413","","2010-09-22 04:06:03","2","2314","<p>I am trying to merge two examples from the ApiDemos so one overlay over the other.<br>1. CameraPreview.java<br>2. TranslucentGLSurfaceViewActivity.java<br></p><p>I guess GLSurfaceView is not really necessary, I saw demos that uses a GL layer as a Camera PreviewCallback, but since I am such a noob at OpenGL, I am kind of lost. Can someone points me toward the light (figuratively speaking)?</p>","125935","","44729","","2010-09-22 12:43:15","2010-09-22 18:21:02","How to overlay GLSurfaceView over a CameraPreview in Android?","<android><opengl-es>","1","0","","",""
"3766341","1","4663042","","2010-09-22 04:35:11","5","1964","<p>I'd like to be able to track the Version number of my application using Google Analytics Android SDK, and the Device Model name for people connecting to my application; What is the best way of achieving this?</p><p>I'm assuming that I might be able to do something like:</p><p>Device Model Name:</p><blockquote>  <p>tracker.trackPageView(""/testApplicationHomeScreen/""+Build.MODEL);</p></blockquote><p>Version Number:</p><blockquote>  <p>tracker.trackPageView(""/testApplicationHomeScreen/""+packageInfo.versionName);</p></blockquote><p>Will this work, and is this the best way of achieving this, or should I be using Events?</p>","454657","","","","","2013-07-29 12:41:43","Google Analytics Android SDK: Tracking My App Version & Device Model Name","<android><google-analytics>","3","0","2","",""
"3766355","1","3766522","","2010-09-22 04:37:04","2","2292","<p>I want to set a specific background image for all my buttons. </p><p>So, I changed my PNG file into a Ninepatch drawable using the ""draw9patch"" tool(by specifying the line of strecth).</p><p>Then, I applied this as background to my button using                       ""myBtn.setBackgroundResource(R.drawable.new_png);""</p><p>Now, the background appears for the button, but the lines of stretch are also visible on the android screen, wherever I'd specified them in the tool.</p><p>Can you help? Is there something wrong in how I'm using the tool?</p>","454660","","114066","","2010-09-22 07:53:26","2010-09-22 07:53:26","To create Nine patch drawable in Android?","<android><button><nine-patch>","1","0","1","",""
"3766396","1","3767374","","2010-09-22 04:49:15","1","3247","<p>I am trying to start an activity from the notification bar but it needs to get an int.  From activity to activity I would just put an int into the intent but I can't seem to figure out where to add the extra for the notification bar?  Is this possible?  If not is there a better way to do it?</p><pre><code>public void notifyMe() {    int icon = android.R.drawable.presence_away;    CharSequence tickerText = ""New Task Availible"";    long when = System.currentTimeMillis();    Notification notification = new Notification(icon, tickerText, when);    Context context = getApplicationContext();    CharSequence contentTitle = ""PRISM Task"";    CharSequence contentText = ""New Task Availible"";    Intent notificationIntent = new Intent(this, TextAnswerActivity.class);    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);    notificationIntent.putExtra(""taskId"", 20);  //unable to retrieve 20 later    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);    final int HELLO_ID = 1;    mNotificationManager.notify(HELLO_ID, notification);}</code></pre><p>How I am retrieving:</p><pre><code>Intent myIntent = getIntent();System.out.println(""#######TaskID from Intent ===== "" + myIntent.getIntExtra(""taskId"", -1));</code></pre>","451037","","451037","","2010-09-22 05:30:27","2010-09-22 08:17:06","Intents to activity from notification status bar?","<android><notifications><android-intent><statusbar>","1","2","","",""
"3766429","1","","","2010-09-22 05:00:27","0","875","<p>I am Having a table layout in that i am adding table rows dynamically.in that table row i am adding two image views and one text view.how to fix the size of the image displayed in the image view.Please any one can suggest the answer.</p><p>If this way is not suitable one for acheiving this task ,Please suggest another ways</p>","454670","","","","","2010-09-22 10:03:25","Android Dynamically adding ImageView","<android>","1","1","","",""
"3766608","1","","","2010-09-22 05:41:14","0","1025","<p>I've been studying Android Development for the past week or so. The xml stuff is pretty easy to understand. However, I have NO knowledge of java. Whenever the documentation says to do callbacks to the .java file and use oncreate() I get confused and see nothing but errors. Is there an easy way to understand the java stuff? I'm very motivated to learn android development and make applications, only thing holding me back is java.</p>","452238","","","","","2012-11-25 21:58:16","Trying to study Android Development, but I don't know Java","<java><android><xml><eclipse><sdk>","3","1","","2012-11-26 08:37:31",""
"3766688","1","7343721","","2010-09-22 06:03:09","7","3799","<p>At the moment I need to filter a Cursor/CursorAdapter to only show rows that match a specific condition in the ListView. I don't want to requery the db all the time. I just want to filter the Cursor I got from querying the DB. </p><p>I have seen the question: <a href=""http://stackoverflow.com/questions/3027428"">http://stackoverflow.com/questions/3027428</a></p><p>But I don't understand how to do the filtering by overwritting the ""move"" methods in my CursorWrapper. An example would be nice. </p><p>Thank you very much. </p>","391216","","","","","2012-01-06 17:34:24","Filtering a cursor the right way?","<android>","1","1","7","",""
"3766799","1","3766959","","2010-09-22 06:24:50","2","1931","<p>I need to draw a spinning globe using opengl es in android. I think we need to draw a sphere and then apply a texture map on it.  If I am correct, we cannot use the utility library glu in Opengl ES for drawing a sphere. I did find some code in objective C, but then I would have to make it work on android.</p><p><a href=""http://www.iphone4gnew.com/procedural-spheres-in-opengl-es.html"" rel=""nofollow"">http://www.iphone4gnew.com/procedural-spheres-in-opengl-es.html</a></p><p>Is there any other way to do this ? I'm no sure how to approach this problem, Could you give me some inputs that would set me looking in the right direction. </p><p>Thanks</p>","454711","","","","","2012-01-18 08:54:17","Spinning globe in Opengl-es","<android><opengl-es>","2","0","4","",""
"3766863","1","3767053","","2010-09-22 06:36:24","4","5277","<p>I implemented the lazy-loading images in my <code>ListView</code>.I use a <code>AsyncTask</code> to download the image from the internet and bind it to the ImageView in the UIThread.</p><p>It's working except that when I scroll the <code>ListView</code> vary fast, the downloaded images sometimes are binded into the wrong items in the list.</p><p>I guess the problem is from the reuse of <code>convertView</code> in the <code>BaseAdapter</code>.Any ideas to solve it?</p><p>Many thanks.</p><p>EDIT:I post the answer as following:</p><pre><code>public void setBitmap(int position, Bitmap image) {    View itemView = mListView.getChildAt(position - mListView.getFirstVisiblePosition());    if (itemView != null) {        ImageView itemImageView = (ImageView) itemView.findViewById(R.id.item_imageview);        itemImageView.setImageBitmap(image);    }}</code></pre>","428022","","114066","","2012-01-27 08:41:49","2012-07-28 19:56:44","Lazy-loading images in ListView on Android","<android><android-listview><lazy-loading>","2","1","3","",""
"3766900","1","3770250","","2010-09-22 06:43:08","2","13476","<p>i have a EditText in android in which i want the user to enter the text and checks for the condition ""BYE""</p><p>Code sample:</p><pre><code>EditText text = (EditText)findViewById(R.id.EditText01);String abc= text .getText().toString(); while( !(abc).equals(""bye"")){   abc = text.getText().toString();//user should enter the text from keyboard and the while loop should go and chech the condition.but not able to enter the text   //do some operation with abc }</code></pre><p>How can i make user to enter the text??The UI should wait for the text to be entered(something like we have InputStreamReader in java applications).</p>","375061","","375061","","2010-09-22 07:47:35","2013-06-27 15:19:27","how to take input from user in android","<android>","3","0","2","",""
"3767009","1","","","2010-09-22 07:05:13","0","1580","<p>i have this activity that holds 2 intent filters and my problem is not to use this activity for devices 1.6 and before since i wanted them to use the native contacts.</p><p>thanks!</p>","279560","","","","","2010-09-22 08:11:13","How to add IntentFilter in an Activity by code?","<java><android><android-2.2-froyo><android-sdk-2.2>","1","1","","",""
"3767124","1","","","2010-09-22 07:24:22","0","416","<p>when i click on edittext, keyboard appears.but the keyboard hides my view.how to resolve this.</p><p>is it possible show my view completely when key board appears.</p>","454670","","","","","2012-11-23 06:20:03","Android Keyboard","<android>","2","0","","",""
"3767155","1","4465260","","2010-09-22 07:30:07","0","594","<p>I have a little problem... I have made an Android application which extends the webview. The webview Html page with a map on like this: <a href=""http://dev.openlayers.org/sandbox/camptocamp/mobile/trunk/examples/iol-iui.html?rev=9962#_map"" rel=""nofollow"">Map example</a>, it was also here I got my inspiration. My onCreate method looks like this:</p><pre><code>super.onCreate(savedInstanceState);         //Removes the title bar in the application         requestWindowFeature(Window.FEATURE_NO_TITLE);         setContentView(R.layout.main);         //Creation of the Webview found in the XML Layout file         browserView = (WebView)findViewById(R.id.webkit);         //Removes both vertical and horizontal scroll bars          browserView.setVerticalScrollBarEnabled(false);         browserView.setHorizontalScrollBarEnabled(false);         myLocationManager=(LocationManager)getSystemService(Context.LOCATION_SERVICE);         //Enable Javascripts         url = ""http://www.my-homepage.dk/map_example.html"";         browserView.getSettings().setJavaScriptEnabled(true);         //The website which is wrapped to the webview         browserView.loadUrl(url);</code></pre><p>So when My application gets a GPS location, it invokes this method:</p><pre><code>LocationListener onLocationChange=new LocationListener() {  public void onLocationChanged(Location location) { StringBuilder buf=new StringBuilder(url); buf.append(""?""); buf.append(""lon=""); buf.append(String.valueOf(location.getLongitude())); buf.append(""&amp;""); buf.append(""lat=""); buf.append(String.valueOf(location.getLatitude()));    browserView.loadUrl(buf.toString()); }</code></pre><p>So it basically just loads another URL.... But, my problem is, 1. it keeps the orignal website ""map image"", i imagined it would ""unload"" the page, and 2. When the second url is loaded, it takes quite a long time before it is finished, and when i am testing on my HTC Desire, it sometimes doesnt show the second loaded page (the map with location) before it turns the screen off and lock, or if i go out and in the application, that sometimes helps too...</p><p>Hope you can help :)</p>","453562","","453562","","2010-09-22 08:25:20","2012-04-05 12:39:52","When Getting GPS Location, load another URL","<java><android><gps><android-webview>","2","2","","",""
"3767173","1","3767199","","2010-09-22 07:33:32","0","227","<p>I have a client who has a requirement for a chatting app. This app should make communication possible on Android and Blackberry.</p><p>Wonder if this is technically feasible? If yes then how? Any clue?</p>","2355649","","","","","2010-09-22 07:41:41","Are there any 3rd party chatting apps available for android,BB and iPhone?","<android>","3","7","","",""
"3767256","1","4049959","","2010-09-22 07:45:42","0","298","<p>I have Activity1 Activity2 Activity3 activities in my application.</p><p>now I want to switch from Activity3 to Activity1.</p><p>How do I proceed?</p><p>And also, how to finish an activity from another activity?</p>","454775","","417685","","2013-03-07 13:23:31","2013-03-07 13:23:31","Issue in switching from one activity to other","<android>","2","4","2","",""
"3767536","1","3767586","","2010-09-22 08:31:50","0","1236","<p>it's first time for me I use javaI need to use a stack in android funcionsbut if I define the stack out of the functiongive me the error (should be parametrized) and the application crashes</p><pre><code>public class Televideo extends Activity{    Stack pila = new Stack();    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        pila.push(mystring);    }    @Override    public boolean onOptionsItemSelected(MenuItem item){        mystring = pila.peek();    }}</code></pre><p>how can I use the stack through class functions in java? thanks </p>","280235","","47527","","2010-09-22 08:40:16","2010-09-22 08:40:16","Stack in android","<java><android><stack>","1","0","","",""
"3767568","1","3767777","","2010-09-22 08:35:59","0","191","<p>Hi I am using the EditText in my app.when i enter .(Period ) after then the cursor go to first position in EditText.but i want to display the characters after . when i enter . for this what can i do give me some suggestions. and i want to enter numbers only in EditText if no character is displayed when i type any special character from keyboard for this what can i do? give me some suggestions .Thanks in advance</p>","454808","","454808","","2010-09-23 03:51:45","2010-09-23 03:51:45","Cursor go to first place after period operator(.) in EditText","<android>","1","0","","",""
"3767588","1","","","2010-09-22 08:39:33","1","1233","<p>What is the best way of configuring a widget in android for entering a 4 digit PIN?</p><p>Currently I have:</p><pre><code>&lt;EditTextPreference   android:title=""PIN""   android:summary=""Your PIN number""  android:key=""password""  android:numeric=""integer""  android:maxLength=""4""  android:password=""true""/&gt;</code></pre><p>This works quite well, but there is no way of constraining the input to be at least 4 digits. Is this how you would have someone set a PIN in preferences? Or is there a better way?</p><p>By the way, before people comment on security implications, I didn't choose the 4 digit PIN, it is for connecting to a third party system and I can't change it. And no, this isn't for banking.</p>","5346","","225647","","2012-08-06 19:56:07","2012-08-06 19:56:07","PIN entry widget for android","<android><android-widget>","1","0","1","",""
"3767591","1","3767766","","2010-09-22 08:40:38","23","14588","<p>there is an Android Intent ACTION_XXX that notify me when Internet Connection is available?I would to instantiate a BroadcastReceiver that notify my application when user enable Internet Connection (by wifi, by GSM, etc...)</p><p>Could anyone help me?</p>","353030","","71059","","2010-09-22 09:13:27","2013-07-10 22:53:54","Check INTENT internet connection","<android><internet><android-intent><broadcastreceiver>","3","0","19","",""
"3767644","1","","","2010-09-22 08:49:32","3","1455","<p>Currently, I am using Android MediaRecorder class to record video and writing it to a file.</p><pre><code>recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);</code></pre><p>recorder.setOutputFile(""/sdcard/recordtest.m4e"");But is there anyway I can write it to a socket?</p>","254504","","","","","2011-01-25 17:41:01","Android MediaRecoder writing it to a socket","<android><video><video-capture>","1","0","2","",""
"3767652","1","","","2010-09-22 08:50:33","-1","502","<p>I want to delete image file in SD card after sending email...anybody knows,please give sample code for me...</p><p>Thanks All</p>","410757","","","","","2013-08-12 07:28:00","How can i delete image file in SD cardafter email sent?","<android>","2","2","","",""
"3767903","1","3768073","","2010-09-22 09:27:30","0","1497","<p>i searched on net for web apps compatibility on mobile and pc browser finally i decided.make 2 websites one is for mobile browser and other is for pc browser.how to find out requested is mobile or pc and how to redirect website for mobile or pc.</p><p>If there is any other way for compatibility.Please let me know and give your good suggestion for this</p><p>Thanks in advance</p>","1746300","","","","","2013-02-08 10:09:06","how to make website compatibility for mobiles as well as pc's","<java><iphone><android><website>","2","0","1","",""
"3768054","1","","","2010-09-22 09:49:02","0","423","<p>I created an android application and uploaded in my website. Is it possible to check from the web whether this application is installed in the device when someone is trying to download the application ? If it is installed, the user should get a prompt whether  to reinstall or not. If not the application should not be downloaded. </p><p>Thanks in advance...</p><p>regards, Vishakh</p>","454879","","","","","2011-01-08 10:12:50","How to find whether an application is installed in a device from web?","<android>","1","1","","",""
"3768136","1","3768550","","2010-09-22 09:59:18","2","853","<p>Ref: <a href=""http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android/"">http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android/</a></p><p>I have a bytestream with PDF contents and want to display the same in my android app. Is there a way I can do that without saving it as a physical file? For security reasons: I want the user to be able to just view the PDF and not store it in the phone memory or SDCard. </p><p>Does google doc viewer has the ability to take bytestream and render it? Or any other app that is installed in the android phone? </p>","207552","","","","","2012-06-29 18:02:46","Viewing pdf bytestream without saving it in Android","<android><pdf>","1","0","5","",""
"3768170","1","3768506","","2010-09-22 10:04:20","4","720","<p>I have created an app widget in Android and want to add some gesture-based functionality to it. For e.g: when user swipes up new set of data be displayed.AFAIK, gestures are not supported in AppWidgets and yet I have seen widgets which have similar functionality(e.g. HTC widgets photo album and weather widget).  </p><p>Please help me out and let men know if I am missing something.  </p><p>Link to tutorials, documentation or sample code are appreciated.</p><p>Thanks.</p>","236128","","","","","2012-02-05 11:11:28","Listening to gestures on an App widget","<android><appwidget>","2","0","1","",""
"3768463","1","","","2010-09-22 10:49:19","4","13077","<p>How to detect Memory leaks in Android JNI code? I am using Froyo</p>","28641","","810368","","2012-09-21 14:58:11","2013-12-19 11:42:50","Detecting native memory leaks in Android JNI code","<android><memory-leaks><jni>","2","2","5","",""
"3768921","1","","","2010-09-22 11:55:47","0","261","<p>I have a list of menus below the title bar, with menus like</p><pre><code>All Article   | Top10  | </code></pre><p>When I select the All Article menu it parses and lists the data, and below the last list row I have a button to load more data in the list. For that purpose I used a singleton class. When I click the Top10 menu I have to do the same, but here I need to clear the singleton class fields; I tried to set the singleton class instance to be null in <code>clear()</code>, but it doesn't clear the field values. It still shows the All Article list data. This is all in the same <code>Activity</code>. How do you suggest I do this? Thanks in advance.</p>","393953","","23649","","2011-08-15 08:41:23","2011-08-15 08:41:23","How to clear singleton class field ","<android>","0","3","","",""
"3768998","1","5315477","","2010-09-22 12:05:12","0","2167","<blockquote>  <p>can anybody tell me how to refresh or  reset a bitmap or canvas to draw  another image on it?</p></blockquote><p>actually i have a map binary file which contains bitmap tiles in bytes now problem is i have a buffer image with buffer image i get screen image to display. so when i move my screen image i need to refresh my buffer image and draw new tiles to display on screen.</p><p>here is code to display image.</p><pre><code>bitmap = Bitmap.createBitmap(screenWidth * (int)mapState.getiBufferMult(), screenHeight * (int)mapState.getiBufferMult(), Config.RGB_565);        canvas = new Canvas(bitmap);        image = new ImageView(this);</code></pre><p>this is not full source but i hope you guys can have idea. </p><p>thanks a lot</p>","397901","","641020","","2011-09-22 10:06:14","2011-09-22 10:06:14","refresh a bitmap or canvas in android","<android><image><bitmap><android-canvas>","1","0","0","",""
"3769105","1","14468426","","2010-09-22 12:19:01","26","19480","<p><a href=""http://stackoverflow.com/questions/1666736/android-textview-automatically-truncate-and-replace-last-3-char-of-string"">This property</a> makes </p><blockquote>  <p>""short and very-long-word""</p></blockquote><p>to </p><blockquote>  <p>""short and""</p></blockquote><p>. But I want to have smth. like </p><blockquote>  <p>""short and very-lon...""</p></blockquote><p>Right now I truncate the String in Java code. However, thats based on the number of characters and not the actual length of the link. So, the result isn't very nice.</p><pre><code>String title;    if(model.getOrganization().length() &gt; 19) {      title = model.getText().substring(0, 15).trim() + ""…"";    } else {      title = model.getText();    }    ((TextView) findViewById(R.id.TextViewTitle)).setText(title);</code></pre><p><strong>Update</strong></p><p>Just noticed, this property actually adds ""..."" in a few cases. But not in all of them:</p><blockquote>  <p>12345678901234567890 becomes  ""12345678901234...""</p></blockquote><p>However, </p><blockquote>  <p>""1234567890 1234567890""  becomes ""1234567890"" and not  ""1234567890 123...""</p></blockquote><p><strong>Update 2</strong></p><p>Now it really gets funky! I just set singleLine=true and removed maxLine (The bug appears with and without setting ellipsize attribute)...</p><p><img src=""http://i.stack.imgur.com/OAIfX.png"" alt=""alt text""></p><p>This is a screenshot take from Motorola Milestone with android 2.1 update 1. Same happens on HTC Desire with the same android version</p><p><strong>Update 3</strong></p><p>Now I use android:ellipsize=""marquee"". That seems to be the only properly working setting. It's also only moving, when focused. I see it in many other apps also. I guess its common practise.</p>","433718","","433718","","2010-10-24 20:56:34","2013-01-22 21:35:04","Android: Something better than android:ellipsize=""end"" to add ""..."" to truncated long Strings?","<android><string><layout><truncate><android-layout>","4","0","6","",""
"3769353","1","","","2010-09-22 12:50:52","0","590","<p>I'm very new to Android development and not sure yet how to solve this issue...</p><p>Is there a way to have the app launch button text set as a certain string, but the app text bar (horizontal bar accross the top of the app) set as something different?</p><p>For example, say my app button is labeled ""MyApp"".  Right now, the bar across the top also is labeled ""MyApp"".  I'd like it so the bar across the top is labeled ""MyApp Testing"".  </p><p>TIA!!</p>","455052","","","","","2010-09-22 14:37:32","Android - main app button text question","<android><text><button>","1","0","","",""
"3769404","1","","","2010-09-22 12:55:52","5","8926","<p>I'm starting on Android and got a beginner question on switching between multiple activities.</p><p>I understand i can go between two activities by invoking an intent and then returning with setResult(). What I want to know is how to jump between multiple activities. Specifically I want to learn about the process life-cycle. I understand how every activity is started ar onCreated(), but I'm not sure how to implement onResume() or onRestart() when I want to come back.</p><p>So basically I have 3 activities: Activity1, Activity2 and Anctivity3.</p><p>I start with Activity1 and then invoke Activity2 with an Intent, and Activity2 invokes Activity3. Using buttons. Now I want to come back to Activity1 from Activity3. I do the same thing here too. Make an Intent and call startActivity(Activity1_Intent). But it gives a runtime error.</p><p>I think I need to implement OnResume() or onRestart(), but I'm not sure how to do this. In onCreate() I make a gridView, so when I come back, do I need to make that gridView again?</p><p>If anybody could give a small explanation of refer to a tutorial it would be great.Thank you very much.</p>","455048","","","","","2014-01-12 20:35:29","Switching activities back and forth in Android","<android><switch>","3","2","4","",""
"3769762","1","7323234","","2010-09-22 13:33:56","195","168261","<p>Does anyone have or know where I might get an Android color xml resource file containing all the X11/w3c color codes?</p>","353616","","","","","2013-10-25 06:38:08","Android color xml resource file","<android><xml>","8","0","112","",""
"3769948","1","3770141","","2010-09-22 13:55:15","0","492","<p>I have the following code that shows a panel.  It displays a button on the panel but as soon as I assign a Click Handler to it the app crashes!</p><p>It crashes on the line .setOnClickListener</p><pre><code>Button button =  (Button)findViewById(R.id.buttonclick);button.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                  hide();                }              });</code></pre><p>LogCat shows...09-22 14:54:09.953: ERROR/Error(7786): java.lang.NullPointerException09-22 14:54:09.953: ERROR/Error(7786):     at com.pinkfroot.leefinder.leeFinderMain$PopupPanel.(leeFinderMain.java:598)</p><p>Adding a breakpoint further down shows that R.id.buttonclick has an id but button is null.</p>","103999","","103999","","2010-09-22 14:49:53","2010-09-22 15:47:56","Crash when adding a button to a panel view","<android><panel>","2","0","","",""
"3770021","1","","","2010-09-22 14:03:11","16","10407","<p>How can I get battery usage per application in Android.</p><p>I need to know % of battery spent by application.</p><p>Is it possible using SDK?</p><p>What I need is the information that's available on an Android device under ""Settings>About phone>Battery use"", but for specific applications</p><p>Thanks</p>","452538","","418613","","2012-06-07 03:02:25","2013-01-05 02:19:59","How to get information about android battery usage by application","<android><power-management>","3","1","5","",""
"3770100","1","3968752","","2010-09-22 14:11:42","43","22551","<p>I'm trying to set a defaultValue to a ListPreference item.</p><p>Here is an sample of my preference.xml file:</p><pre><code>&lt;ListPreference android:key=""notification_delay""    android:title=""@string/settings_push_delay""    android:entries=""@array/settings_push_delay_human_value""    android:entryValues=""@array/settings_push_delay_phone_value""    android:defaultValue=""????""&gt;&lt;/ListPreference&gt;</code></pre><p>The two arrays:</p><pre><code>&lt;string-array name=""settings_push_delay_human_value""&gt;    &lt;item&gt;every 5 minutes&lt;/item&gt;    &lt;item&gt;every 10 minutes&lt;/item&gt;    &lt;item&gt;every 15 minutes&lt;/item&gt;&lt;/string-array&gt;&lt;string-array    name=""settings_push_delay_phone_value""&gt;    &lt;item&gt;300&lt;/item&gt;    &lt;item&gt;600&lt;/item&gt;    &lt;item&gt;900&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>When i go into the preference activity, no item of the ListPreference is selected. I've tried to set an int value like 1 in the ""android:defaultValue"" fied to select ""10 minutes"" but it does not work.</p><pre><code>&lt;ListPreference android:key=""notification_delay""    android:title=""@string/settings_push_delay""    android:entries=""@array/settings_push_delay_human_value""    android:entryValues=""@array/settings_push_delay_phone_value""    android:defaultValue=""1""&gt;&lt;/ListPreference&gt;</code></pre><p>Any Idea?</p>","384483","","39709","","2011-08-08 21:22:49","2014-01-29 22:24:18","How-to init a ListPreference to one of its values","<android>","4","2","5","",""
"3770416","1","","","2010-09-22 14:45:48","1","1892","<p>I am very new to android. I tried to connect to internet behind proxy in windows.But I cant.I tried with the ""-http-proxy"" in command line and in eclipse but both did not worked for me :( Please suggest me a right way to enable proxy in emulator</p><p>Thanks in advance</p>","276149","","276149","","2010-09-22 15:00:48","2014-03-19 09:47:28","unable to connect with internet in android emulator behind proxy in windows","<android><android-emulator>","2","0","2","",""
"3770576","1","3770746","","2010-09-22 15:01:31","0","222","<p>I have a text field in SQLite database, which I want the user to be able to update.</p><p>So I extract and display the text in an EditText view. The user edits it and presses ""Update"" button. At this point I want to update the text field in database with whatever user has in the EditText.</p><p>Here's the problem, EditText returns the type <strong>Editable</strong>.<br>And the <em>put(String key, String value)</em>  function of ContentValues, that I use while updating the record, expects a <strong>String</strong>. So how to put an Editable in a String?</p><p>I tried upcasting the Editable to CharSequence and then casting that to String, but that gives me a runtime exception, ClassCastException, which it very well should (because the object was an Editable to begin with, I cannot make it a String).</p><p>So how to get around this? Here's the code I am using. I know it is wrong, but I cannot figure out how to do this.</p><pre><code>@Overridepublic void onClick(View v) {   // update logic   CharSequence strNewName = editTextName.getText();  //Update record in the table  ContentValues newRecord = new ContentValues();  newRecord.put(GIDatabase.Students.NAME, (String strNewName); //ClassCastException here  int rowsEffected = db.update(GIDatabase.Students.STUDENTS_TABLE_NAME, newRecord, GIDatabase.Students._ID + ""=?"", new String[]{strId});if (rowsEffected != 1) {    // This should never be reached                                  throw new RuntimeException(""Error updating name"");}</code></pre><p>}</p>","289918","","","","","2010-09-22 15:15:39","Updating database from an EditText","<java><android>","1","0","","",""
"3770618","1","3770719","","2010-09-22 15:05:29","4","2303","<p>I was working on a simple bubblewrap app in order to learn the android framework, and was wondering how I could play the 'pop' sound clip every time the user touches a bubble.</p><p>Thanks in advance</p>","388025","","","","","2010-09-22 15:40:39","Play a sound on touch?","<android>","2","0","","",""
"3770822","1","3770870","","2010-09-22 15:21:54","1","1018","<p>Is there a way to dynamically change the size of a widget?</p><p>Can an app have multiple widgets?</p><p>Thanks! </p>","424413","","","","","2012-01-16 07:39:30","Is there a way to dynamically change the size of a widget?","<android>","3","0","","",""
"3770954","1","3772239","","2010-09-22 15:35:18","1","4921","<p>As in my country (Belgium) a lot of operators settings are not included in default APN list, i would like to create an app that will fill all APN fields correctly with the user choice.</p><p>I just read all the doc and Google a lot of questions but no answer...</p><p>How should I do to create an APN profile?</p><p>Thank a lot for any clue.</p>","327402","","","","","2010-09-22 18:00:58","Android: Change APN settings by code","<android><settings><apn>","1","0","1","",""
"3771102","1","3771755","","2010-09-22 15:50:17","0","176","<p>Hello I would like to make a layout like the one displayed on the <a href=""http://developer.android.com/resources/articles/layout-tricks-merge.html"" rel=""nofollow"">this</a> link.just an image and 2 simple buttons on the button of the screen, I am trying using this code:</p><pre><code>&lt;merge xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;ImageView android:id=""@+id/maxsapImg"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:layout_alignParentTop=""true""        android:scaleType=""center"" android:src=""@drawable/golden_gate""&gt;    &lt;/ImageView&gt;    &lt;RelativeLayout android:id=""@+id/InnerRelativeLayout""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""&gt;        &lt;Button android:text=""@string/camera"" android:id=""@+id/camerBtn""            android:layout_alignParentBottom=""true"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content""&gt;        &lt;/Button&gt;        &lt;Button android:text=""@string/local"" android:id=""@+id/localBtn"" android:layout_width=""wrap_content""            android:layout_toLeftOf=""@+id/camerBtn"" android:layout_height=""wrap_content""&gt;        &lt;/Button&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;&lt;/merge&gt;</code></pre><p>but no lick so far any ideas? </p><p>regards maxsap.</p>","234898","","","","","2010-09-22 17:04:51","android layout help","<android>","2","0","","",""
"3771229","1","3776731","","2010-09-22 16:04:20","3","3361","<p>I'm trying to achieve a custom controller containing of various buttons in different shapes. I'm wondering how I can achieve this with Android.</p><p>The result should look similar like this, where every color is a different button.<img src=""http://i.stack.imgur.com/jOGrT.png"" alt=""alt text""></p><p>I suppose I have to subclass <code>View</code> so please don't write that as an answer ;-) Please give some methodical steps what's needs to be implemented, like drawing, sensing touches, etc or maybe point me to some examples (if exist).</p><p>Thanks</p>","184367","","","","","2010-12-12 11:24:37","Android: custom button shape","<android><touch><draw>","2","1","2","",""
"3771273","1","","","2010-09-22 16:08:40","0","126","<p>please have a look at this code and see if you could help me out. viewItem is populating from a database and the method fillRemindersData(long rowId) is only called from the reminder class. I don't know why i am getting a nullPointerException when calling the viewitems.fillRemindersData()method. if i comment the line, the code works fine and the rowId is correct. what could be the reason? thanks</p><pre><code>// this is a reminder classpublic void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.view_list);        adapter = new DBAdapter(this);        viewItems = new ViewItems();        fillReminder();         }    private void fillReminder() {        Bundle extra = getIntent().getExtras();        if(extra != null){            rowId = extra.getLong(DBAdapter.KEY_ID);            message = extra.getString(NewItem.Test);        }        Toast.makeText(this, message + ""its ok here"" + rowId, Toast.LENGTH_LONG).show();        viewItems.fillRemindersData(rowId); // having a null pointer exception here.}</code></pre><p>And important part of the viewItems class is: </p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.view_list);        adapter = new DBAdapter(this);        adapter.open();        fillData();        list = (ListView)findViewById(android.R.id.list);        list.setOnItemClickListener(this);    } protected void fillData() { Cursor c = adapter.retrieveItems(); // method in sqlitedatabase startManagingCursor(c);String[] from = new String[]{DBAdapter.NAME, DBAdapter.START_DATE, DBAdapter.START_TIME};int[] to = new int[]{R.id.viewNameId, R.id.viewDateId, R.id.viewTimeId};customCursorAdapter items = new customCursorAdapter(this, R.layout.view_items, c, from, to);                setListAdapter(items);              } protected void fillRemindersData(long Id) { long row = Id; Cursor c = adapter.retrieveRow(row); // method in sqlitedatabase startManagingCursor(c);String[] from = new String[]{DBAdapter.NAME, DBAdapter.START_DATE, DBAdapter.START_TIME};int[] to = new int[]{R.id.RemindNameId, R.id.remindDateId, R.id.remindTimeId};customCursorAdapter items = new customCursorAdapter(this, R.layout.remind_viewer, c, from, to);setListAdapter(items);              }</code></pre><p>method the logcat is referring to:</p><pre><code>public Cursor retrieveRow(long rowId){String[] resultColumns = new String[] {NAME,START_DATE,START_TIME};Cursor row = db.query(true,DATABASE_TABLE, resultColumns, KEY_ID +""="" +rowId, null, null, null, null,null);     if(row != null){    row.moveToNext();          return row;    }    return row;     }</code></pre><p>Logcat output:</p><pre><code>09-22 15:19:00.346: ERROR/AndroidRuntime(808): Uncaught handler: thread main exiting due to uncaught exception09-22 15:19:00.386: ERROR/AndroidRuntime(808): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.MemoBuzz/com.MemoBuzz.RemindViewer}: java.lang.NullPointerException      09-22 15:19:00.386: ERROR/AndroidRuntime(808): Caused by: java.lang.NullPointerException    09-22 15:19:00.386: ERROR/AndroidRuntime(808):     at com.MemoBuzz.ViewItems.fillRemindersData(ViewItems.java:57)    09-22 15:19:00.386: ERROR/AndroidRuntime(808):     at com.MemoBuzz.RemindViewer.fillReminder(RemindViewer.java:51)    09-22 15:19:00.386: ERROR/AndroidRuntime(808):     at com.MemoBuzz.RemindViewer.onCreate(RemindViewer.java:36)    09-22 15:19:00.386: ERROR/AndroidRuntime(808):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)    09-22 15:19:00.386: ERROR/AndroidRuntime(808):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)    09-22 15:19:00.386: ERROR/AndroidRuntime(808):     ... 11 more</code></pre>","316843","","316843","","2010-09-22 16:36:11","2010-09-22 16:56:18","NullPointException Don't Know Why?","<android>","3","2","","",""
"3771468","1","3772065","","2010-09-22 16:29:55","0","2194","<p>How can i check does image set in ImageView or no, exists standard methods?</p><pre><code>ImageView imgV;imgV = (ImageView)findViewById(R.id.imageView);if(imgV != set)  ///!!!!!   imgV.setImageBitmap(mBitmap);else   imgV.setImageBitmap(null);</code></pre>","278279","","278279","","2010-09-22 17:04:32","2010-09-22 17:40:07","How to check does image set in ImageView","<android>","1","0","","",""
"3771471","1","","","2010-09-22 16:30:03","1","402","<p>I'm configuring a new machine for Android development and moving my current project over. I did a fresh install of all the Android tools and SDKs, and under ""build targets"", the Google APIs' target supports Android 2.2.</p><p>Of course I need 1.5 as the base build target. My project doesn't build when I select that because the Google Maps stuff from maps.jar isn't there. In fact, after I did my full install I can't find maps.jar anywhere on my new machine. Is this jar file still required for Google Maps integration, or is it history? I'm using Eclipse 3.5.</p><p>I guess I'd presume there would be a ""google apis"" for Android 1.5 build target. I'm thinking my install must be hosed; but maybe it's my understanding.. :)</p>","455300","","73488","","2010-09-23 00:27:01","2010-09-23 00:27:01","With latest Android sdks, is there still a Google Apis build target for Android 1.5?","<android><eclipse><google-maps>","1","0","","",""
"3771474","1","3772208","","2010-09-22 16:30:16","2","1560","<p>I'm working on an Android app with a Java component and a C++ component via JNI. The C++ component is used on other platforms.</p><p>It would make my life considerably easier if the C++ component could query the existing SQLite database (via the SQLite C API), without having to shell calls out to the Java side.</p><p>I know it's a long shot, has anyone attempted this?</p>","82515","","","","","2010-11-24 16:54:15","Android JNI, is there any way C++ code can directly read the app's sqlite database?","<android><sqlite><jni>","3","0","1","",""
"3771527","1","","","2010-09-22 16:35:48","3","384","<p>android start Video recording upon starting an activity without using buttons ,ie when the activity starts video recording also should start without using any other component,its working with buttons,i tried putting video calling functions in onCreate,onStart() etcany idea any one</p>","413770","","","","","2010-12-28 11:14:29","android start Video recording upon starting an activity","<android>","0","4","","",""
"3771568","1","3771631","","2010-09-22 16:40:10","51","45488","<p>For some reason the empty view, a <em>TextView</em> in this case, always appears even when the <em>ListView</em> is not empty. I thought the <em>ListView</em> would automatically detect when to show the empty view.</p><pre><code>&lt;RelativeLayout android:id=""@+id/LinearLayoutAR""    android:layout_height=""fill_parent""    android:layout_width=""fill_parent""&gt;    &lt;ListView android:id=""@+id/ARListView""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;    &lt;ProgressBar android:id=""@+id/arProgressBar""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_centerHorizontal=""true""        android:layout_centerVertical=""true""&gt;&lt;/ProgressBar&gt;    &lt;!-- Here is the view to show if the list is emtpy --&gt;    &lt;TextView android:id=""@id/android:empty""        android:layout_width=""match_parent""        android:layout_height=""match_parent""        android:text=""No Results"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>How can I hook up the empty view properly?</p>","19875","","418183","","2013-02-13 18:44:49","2014-01-02 07:32:19","Showing empty view when ListView is empty","<android><listview><relativelayout>","7","0","17","",""
"3771632","1","3772024","","2010-09-22 16:48:40","2","842","<p>In the official Twitter Android app, the opening activity (the dashboard) and the Tweets tab activity have a live background/wallpaper (clouds moving, etc).</p><p>How do you accomplish that?</p><p>Is it as simple as setting your view's background to a live wallpaper drawable?</p><p>And then adding <code>&lt;uses-feature android:name=""android.software.live_wallpaper"" /&gt;</code> to your manifest?</p>","399890","","","","","2012-08-20 13:28:54","Add a live background to an Android View (like the Twitter App)","<android><background><activity>","2","2","","",""
"3772363","1","3772415","","2010-09-22 18:15:22","0","589","<p>On Android, the home screen has dots to indicate which screen you are on. I want to do something similar in my app. Is there a control that contains dots and lights up?</p>","19875","","","","","2010-12-10 10:53:07","How can I replicate the home screen dots?","<android><gui><user-interface>","2","0","","",""
"3772694","1","3772842","","2010-09-22 18:57:32","1","428","<p>In android, I have a TabActivity with 2 tabs and each tab has it own activity (say ActivityA and ActivityB). When I am on ActivityA, and I click on ActivityB's tab, how does the ActivityA knows it is no longer the active Tab?</p>","286802","","","","","2010-09-22 19:20:44","How does an activity in a tab knows it switch to another tab","<android>","1","0","","",""
"3772736","1","3774551","","2010-09-22 19:04:14","2","4898","<p>So all I'm trying to do is draw circles around two points that are being touched, and as the fingers drag along on the screen, have these circles follow each finger.</p><p>However, I'm getting some weird behavior that I can't figure out. So when I place two fingers on the screen I get my circles no problem. When I drag around with the two fingers everything works like I want it. However, if I lift the first finger, everything stops redrawing, and the second finger that is still on the screen stops being tracked. If I place the first finger back on, everything behaves good again. I figure I must be handling the two fingers poorly.</p><p>Can anyone see what I'm doing wrong?</p><p>Also, if I have two fingers on the screen, and I lift and touch the second finger, everything behaves well. It's only in the case where I have two fingers and I lift the first one do I see a problem.</p><pre><code>@Override    public boolean onTouchEvent(MotionEvent event) {           /*       * Log this touch event        */      String names[] = { ""DOWN"" , ""UP"" , ""MOVE"" , ""CANCEL"" , ""OUTSIDE"" ,                  ""POINTER_DOWN"" , ""POINTER_UP"" , ""7?"" , ""8?"" , ""9?"" };       StringBuilder sb = new StringBuilder();       int action = event.getAction();       int actionCode = action &amp; MotionEvent.ACTION_MASK;       sb.append(""OnTouchEvent ACTION_"" ).append(names[actionCode]);       if (actionCode == MotionEvent.ACTION_POINTER_DOWN             || actionCode == MotionEvent.ACTION_POINTER_UP) {          sb.append(""(pid "" ).append(          action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT);          sb.append("")"" );       }       sb.append(""["" );       for (int i = 0; i &lt; event.getPointerCount(); i++) {          sb.append(""#"" ).append(i);          sb.append(""(pid "" ).append(event.getPointerId(i));          sb.append("")="" ).append((int) event.getX(i));          sb.append("","" ).append((int) event.getY(i));          if (i + 1 &lt; event.getPointerCount())          sb.append("";"" );       }       sb.append(""]"" );       Log.d(TAG, sb.toString());        /*        * Track the touches that are on the screen        * Grab X,Y, and Size data        */        int action = event.getAction();        int actionCode = action &amp; MotionEvent.ACTION_MASK;        if (actionCode == MotionEvent.ACTION_POINTER_DOWN) {            if (0 == action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT){                p0Down = true;            }            if (1 == action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT){                p1Down = true;            }        }        else if (actionCode == MotionEvent.ACTION_POINTER_UP){            if (0 == action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT){                p0Down = false;            }            if (1 == action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT){                p1Down = false;            }        }        if(actionCode == MotionEvent.ACTION_DOWN){            if (0 == action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT){                p0Down = true;            }            if (1 == action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT){                p1Down = true;            }        }        else if (actionCode == MotionEvent.ACTION_UP){            if (0 == action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT){                p0Down = false;            }            if (1 == action &gt;&gt; MotionEvent.ACTION_POINTER_ID_SHIFT){                p1Down = false;            }        }        int pointCt = event.getPointerCount();        for(int i = 0; i &lt; pointCt; i++){            int pid = event.getPointerId(i);            if((pid == 0) &amp;&amp; p0Down){                curX1 = event.getX(pid);                curY1 = event.getY(pid);                size1 = event.getSize(pid);            }            if((pid == 0) &amp;&amp; (p0Down == false)){                curX1 = -1;                curY1 = -1;                size1 = -1;            }            if((pid == 1) &amp;&amp; p1Down){                curX2 = event.getX(pid);                curY2 = event.getY(pid);                size2 = event.getSize(pid);            }            if((pid == 1) &amp;&amp; (p1Down == false)){                curX2 = -1;                curY2 = -1;                size2 = -1;            }        }        return true;    }</code></pre>","425962","","","","","2010-09-23 00:11:44","Handling of Multitouch","<android><multi-touch>","1","0","3","",""
"3772751","1","3772822","","2010-09-22 19:06:58","7","4443","<p>I'm trying to create a context menu that changes the available options depending on which row was clicked.</p><p>But I can't figure out how to get the row position in the listview for row that was clicked, until after the menu is created.</p>","433825","","","","","2010-09-22 19:17:39","Get row position in onCreateContextMenu","<android><contextmenu>","1","0","1","",""
"3772779","1","3772972","","2010-09-22 19:11:34","10","20099","<p><em>I'm new to Eclipse/Java/Android</em></p><p>I have already created this project, but I wanted to start over.</p><ol><li>deleted the <code>HelloAndroid</code> folder from my <code>workspace</code> folder</li><li>restarted Eclipse</li><li>now I can't create a project with the same name, because <code>Finish</code> is greyed out, and it gives me the following message: <code>A project with that name already exists in the workspace eclipse</code></li></ol><p>How can I completely delete my old <code>HellowAndroid</code> project from Eclipse?</p><p><img src=""http://i.stack.imgur.com/eCuJi.png"" alt=""alt text""></p>","287311","","","","","2012-09-11 17:47:44","A project with that name already exists in the workspace eclipse","<eclipse><android>","1","0","2","",""
"3772910","1","3775338","","2010-09-22 19:30:13","0","396","<p>I'd like to take screenshots on my android phone.  I'm an app developer and have a pretty good understanding of the regular API, and I know this steps out of the ""regular"" thing quite a bit.</p><p>I would have root access.</p><p>I've seen a few apps that do this.  I'm just wondering how one goes about doing it.  Anybody know the general direction I should be looking in?</p>","227313","","","","","2013-03-04 18:20:33","Android rooted phone screenshots","<android>","3","1","1","",""
"3772955","1","","","2010-09-22 19:36:42","0","336","<p>I am trying to create a java program that takes the firstname mi last name input and outputs ""FI MI lastname""</p><p>thank you.</p><p>this is for a friend and i've not programed in ...... 15 years.</p>","455472","","","","","2010-11-16 09:06:16","Java - input first name middle initial and last name?","<android>","1","1","","",""
"3773092","1","","","2010-09-22 19:54:46","1","567","<p>I am working on the Notepad Tutorial on the Android dev site, part 1. I have done all the code as in the tutorial, also tried with the code form the downloaded solution. When i launch the app I don't see a button ""Add note"", and therefore I cannot continue with the tutorial. It seems like the methods aren't firing?</p><p>All i see is title and the note that says ""there are no notes here yet"". </p><p>Thanks so much for any help!</p>","455479","","1228","","2013-08-14 15:55:06","2013-08-14 15:55:06","Notepad Tutorial Android - menu problems","<android><menu><notepad>","0","3","0","",""
"3773120","1","","","2010-09-22 19:57:25","7","6809","<p>My app frequently throws exception like below:</p><blockquote>  <p>E/WindowManager( 6282): android.view.WindowLeaked: Activity  com.myActivity has leaked window  com.android.internal.policy.impl.PhoneWindow$DecorView@4479b710 that  was originally added here</p></blockquote><p>The app shows a progress dialog when the main activity starts and starts a task. When the task is done, it will dismiss the progress dialog.</p><p>My code is like below. Can someone help me?</p><pre><code>public class MyActivity extends Activity {private static int ID_DIALOG_PROGRESS = 2001;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);            setContentView(R.layout.my_activity);    showDialog(ID_DIALOG_PROGRESS);    new MyTask().execute(null, null, null);}@Overrideprotected Dialog onCreateDialog(int id) {    if (id == ID_DIALOG_PROGRESS) {        ProgressDialog loadingDialog = new ProgressDialog(this);        loadingDialog.setTitle("""");        loadingDialog.setMessage("""");        loadingDialog.setIndeterminate(true);        loadingDialog.setCancelable(false);        return loadingDialog;    }    return super.onCreateDialog(id);}private class MyTask extends AsyncTask&lt;Void, Void, Void&gt; {    @Override    protected Void doInBackground(Void... arg0) {            /* Do something expensive here...*/            /* Start other activity*/            Intent intent = new Intent(MyActivity.this, OtherActivity.class);            startActivityForResult(intent, 1000);        }        return null;    }    protected void onPostExecute(Void arg0) {        dismissDialog(ID_DIALOG_PROGRESS);    }}}</code></pre><p>Most of the time, the exception was thrown from showDialog() call. The other time, the exception was thrown from dismissDialog() call.</p><p>Thank you in advance!</p>","445302","","726863","","2012-02-06 11:00:21","2012-03-07 14:14:55","My app frequently throws android.view.WindowLeaked exception --","<android>","3","0","1","",""
"3773200","1","","","2010-09-22 20:09:51","0","1303","<p>I have a class which has implemented Parcelable. Can I do something like the following to create a new instance of a class?:</p><pre><code>Foo foo = new Foo(""a"", ""b"", ""c"");Parcel parcel = Parcel.obtain();foo.writeToParcel(parcel, 0);Foo foo2 = Foo.CREATOR.createFromParcel(parcel);</code></pre><p>I'd like foo2 to be a clone of foo. </p><p>---------------------- update -------------------------------</p><p>The above does not work (all Foo members are null in new instance). I'm passing Foos between activities just fine, so the Parcelable interface is implemented ok. Using the below which works:</p><pre><code>Foo foo1 = new Foo(""a"", ""b"", ""c"");Parcel p1 = Parcel.obtain();Parcel p2 = Parcel.obtain();byte[] bytes = null;p1.writeValue(foo1);bytes = p1.marshall();p2.unmarshall(bytes, 0, bytes.length);p2.setDataPosition(0);Foo foo2 = (Foo)p2.readValue(Foo.class.getClassLoader());p1.recycle();p2.recycle();// foo2 is the same as foo1.</code></pre><p>found this from the following q: <a href=""http://stackoverflow.com/questions/1626667/how-to-use-parcel-in-android"">http://stackoverflow.com/questions/1626667/how-to-use-parcel-in-android</a></p><p>This is working ok, I can go with this but it is extra code, not sure if there's a shorter way to do it (other than properly implementing a copy constructor...).</p><p>Thanks</p>","291701","","291701","","2010-09-22 20:46:52","2011-08-23 23:24:05","Using Parcel to clone an object?","<android>","2","1","1","",""
"3773222","1","","","2010-09-22 20:12:38","0","689","<p>I'm developing an android video uploading app and uploading large amounts of video is a problem, I get different type of exception sometimes (host not resolved, pipe broken), I do a multipart POST but I have a feeling if I upload chunk of bytes one at at time that'll increase upload speed as well as solve connection timeout and these type of problems. </p>","394675","","","","","2010-11-19 20:10:22","Improving upload speed by sending chunk of bytes","<android><http><networking><file-upload>","1","0","","",""
"3773252","1","3773317","","2010-09-22 20:15:46","6","7093","<p>I'm not entirely sure about what I'm reading in the documentation. Is it ok to leave a bunch of log.d pieces of code scattered about, or should I comment them out so that they don't impact my app's performance.</p><p>Thanks,</p><p>I'm a little confused because if you read about the log object (http://developer.android.com/reference/android/util/Log.html) you see this:</p><p>""The order in terms of verbosity, from least to most is ERROR, WARN, INFO, DEBUG, VERBOSE. Verbose should never be compiled into an application except during development. Debug logs are compiled in but stripped at runtime. Error, warning and info logs are always kept. ""</p><p>It almost sounded like it's ok to leave debug messages in there because they are ""stripped."" Anyway, thanks for the answers, I'll comment them out when I'm done. Not like I need them in there once the app is completed.</p><p>Thanks</p>","425962","","425962","","2010-09-23 15:22:52","2013-12-19 22:12:43","Log.d and impact on performance","<android><logging><debugging>","4","1","1","",""
"3773262","1","","","2010-09-22 20:17:25","5","1625","<p>When i record my audio from MIC and store file in /data/data/..... why MediaPlayer can't play this file ? If i change destination to / sdcard/..... - all works great. I do something wrong ? I not found limitation for MediaPlayer.  Device - Samsung T959 (Galaxy S) Thanks, i hope anybody know solution....</p>","455509","","","","","2013-09-29 18:14:53","MediaPlayer cant play audio files from program data folder?","<android>","5","1","2","",""
"3773338","1","3820549","","2010-09-22 20:25:55","10","6058","<p>I'm attempting to use an HttpDelete object to invoke a web service's delete method.  The web service's code parses JSON from the message's body.  However, I'm failing to understand how to add a body to an HttpDelete object.  Is there a way to do this?</p><p>With HttpPut and HttpPost, I call the setEntity method and pass in my JSON.  There doesn't appear to be any such method for HttpDelete.</p><p>If there is no way to set a body for an HttpDelete object, could you please link me to a resource that uses a super class of HttpDelete such that I can set the method (delete) and set a body.  I know that isn't ideal, but at this point I can't alter the web service.</p>","406790","","406790","","2010-09-22 20:32:20","2014-04-10 10:03:07","HttpDelete with body","<android><delete><httpclient><webservice-client>","4","0","4","",""
"3773409","1","3774545","","2010-09-22 20:35:43","0","507","<p>I'm looking for a way to find out which browsers are installed on the Android Smartphone and their package names. </p><p>Why do I need it? </p><p>Well basically, my App reacts on certain URLs, i.e. <a href=""http://bit.ly"" rel=""nofollow"">http://bit.ly</a>, so when the click such an he will get an choice in which App to open it. So far everything is working as intended. </p><p>If the user sets up this app as default for this kind of links, it will always open in this one without further asking the user. So far so good too. But by doing this, he will be completely unable to open this links in his browser.</p><p>So I need a way to send this intent directly to the browser, but to do so I have to know which app the user has set to be default for http/https scheme for example (as user can change it if there is more than 1 browser installed). </p><p>Sending the intend with </p><pre><code>intent.setComponent(new ComponentName(""com.android.browser"", ""com.android.browser.BrowserActivity""));</code></pre><p>should't be a problem I think. The problem is, I can't send a standard intent für URLs, because my App would catch it again if set as default by the user. </p>","455493","","","","","2013-12-12 12:26:50","[Android]Find out which browsers are installed?","<android><browser><android-intent>","1","2","","",""
"3773416","1","","","2010-09-22 20:36:33","3","11721","<p>I want to show the direction on the screen that phone is facing.  For example:</p><pre><code>   0   |- []   |_  South --- North</code></pre><p>In the above diagram the phone would display ""North"".  Since the user (the stick with 0 for his head) is holding out the phone (the [] in the diagram) pointing north.</p><p>I found <a href=""http://www.netmite.com/android/mydroid/cupcake/development/samples/Compass/src/com/example/android/compass/CompassActivity.java"" rel=""nofollow"">this example</a>.  I understand what it's doing except it seems to calculate yaw, pitch, roll, and inclination.  What are those and how would I use them to simply find which way the phone is pointing?</p><p>Also this <a href=""http://developer.android.com/reference/android/hardware/SensorManager.html#getOrientation%28float%5b%5d,%20float%5b%5d%29"" rel=""nofollow"">android documentation</a> mentions X, Y, and Z axises but I don't see anywhere that says how those axises correspond to the phone?  Is Z going from the bottom of the phone to the top?</p>","13009","","93848","","2011-07-27 17:39:44","2011-07-27 17:39:44","How to get compass direction","<android><compass-geolocation>","1","4","3","",""
"3773477","1","","","2010-09-22 20:45:39","0","452","<p>I have a button and I want to highlight it for a brief time. For e.g. it's a red button and it should be orange for a second and then turn red again.</p><p>My code for this looks like the following:</p><pre><code>button.setBackgroundResource(R.color.orange);    //highlight valuebutton.invalidate();            try {                Thread.sleep(3000);            } catch (InterruptedException e1) {            } button.setBackgroundResource(R.color.red);   //old valuebutton.invalidate();</code></pre><p>This doesn't work. The current thread pauses for 3 seconds, but the background image is not changed before. In fact it only changes afterwards to the ""old value"". </p><p>How can i build this highlight feature?</p>","424514","","","","","2010-09-22 20:50:32","Updating Button background for a brief time in Android (higlight it)","<java><android><multithreading>","1","0","","",""
"3773516","1","","","2010-09-22 20:50:22","1","5243","<p>I have been developing an app, and I need to close another app in my code. Does anyone know any api to call to close an app?</p><p>BTW: my app will be pre-installed.</p><p>thanks</p>","455544","","","","","2012-09-20 08:01:46","How to close another app in Android?","<java><android>","4","1","1","",""
"3773577","1","3773803","","2010-09-22 20:58:22","0","1333","<p>I'm trying to understand the Activity Testing tutorial on the Android site.  One of the tests sets a spinner in the SpinnerActivity example, forces a pause, then resets the spinner, forces a resume, and then verifies that the application properly restored the state.  I pasted the relevant code at the bottom of this question for reference.</p><p>I'm very confused why the person writing the test thinks that the spinner could have been corrupted between the OnPause() and OnResume().  Is this because the spinner could have been reused in some subsequent activity and thus lost its state?  That's the only reasonable explanation I can think of.  </p><p>I'm concerned about preserving my application's activities non-widget members such as Strings, ints, etc.  These are initialized during OnCreate and won't be changed by the user.  As a result, I don't see any reason to save them off during OnPause, because even if the OS directly terminates the activity after a pause, the OnCreate() will re-initialize these members.</p><p>Is it safe then to assume that these non-widget members will not be harmed when pausing (assuming that the application eventually resumes?)</p><pre><code> public void testStatePause() {    Instrumentation mInstr = this.getInstrumentation();    mActivity.setSpinnerPosition(TEST_STATE_PAUSE_POSITION);    mActivity.setSpinnerSelection(TEST_STATE_PAUSE_SELECTION);    mInstr.callActivityOnPause(mActivity);              mActivity.setSpinnerPosition(0);    mActivity.setSpinnerSelection("""");    mInstr.callActivityOnResume(mActivity);    int currentPosition = mActivity.getSpinnerPosition();    String currentSelection = mActivity.getSpinnerSelection();    assertEquals(TEST_STATE_PAUSE_POSITION,currentPosition);    assertEquals(TEST_STATE_PAUSE_SELECTION,currentSelection); }          </code></pre>","403455","","","","","2010-09-22 21:33:40","Android Activity Testing Example Has Confusing OnPause Expectations","<android><unit-testing><application-lifecycle>","1","0","1","",""
"3773738","1","","","2010-09-22 21:22:51","3","287","<p>In Android, is it possible to have a background that is repeated on the background of a view? Is it possible to apply a translation animation to that background?</p>","246793","","","","","2010-09-22 21:22:51","Animating background in Android?","<android><image><animation><view><background>","0","0","1","",""
"3773971","1","3774533","","2010-09-22 22:04:57","1","1336","<p>I've already written a game engine in java using eclipse and opengl es, I had one project (an android project) which contained both of my packages</p><pre><code>com.logic.enginecom.logic.testapp</code></pre><p>I wanted a way to keep my engine and test app seperate, I've made an earlier post about how this is done, and I figured out how to reference one project in the build path of another (or just creating a jar file).</p><p>My problem is that, lets say I now have my engine all wrapped up in an android project <code>com.logic.engine</code>, and now someone would like to use this engine to create a game, so they create an android project <code>com.someclient.game</code>, well now because we have one android project referencing another, it crashes everytime.</p><p>Now obviously i need the android sdk in my engine package in order to reference things, but its also required on the client app, since the activity is what is actually being run by android. </p><p>I guess my question is, how can i create a project for my game engine <strong><em>without</em></strong> it being an <em>android</em> project, but still referencing the android sdk, and without causing it to crash the client app using it?</p><p><em>edit:</em></p><p><em>note: the client app utilizes the engine flawlessly when its in the same project folder, it isn't until the engine is referenced from another project containing the android sdk that it crashes, so im 99.9% positive it has nothing to do with my code</em></p>","455537","","455537","","2010-09-22 22:19:44","2010-09-23 00:06:56","How would you write a library to be used on android?","<android><eclipse>","2","4","1","",""
"3774020","1","3774077","","2010-09-22 22:13:57","0","585","<p>I wrote simple Application for Android:</p><pre><code>public class Figures extends Activity {    DemoView demoview;    int figure_type = 1;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        //setContentView(R.layout.main);        demoview = new DemoView(this);        setContentView(demoview);    }    @Override    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.firstmenu, menu);        return true;    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch(item.getItemId()) {        case R.id.color_menu_item:            break;        case R.id.circle_menu_item:            figure_type = 0;            // How to call onDraw?!            break;        case R.id.square_menu_item:            figure_type = 1;            // How to call onDraw?!            break;        case R.id.triangle_menu_item:            figure_type = 2;            // How to call onDraw?!            break;        case R.id.exit_menu_item:            super.finish();            break;        default:            break;        }        return true;    }    private class DemoView extends View {        public DemoView(Context context) {            super(context);        }        @Override        protected void onDraw(Canvas canvas) {            super.onDraw(canvas);            Display display = getWindowManager().getDefaultDisplay();            int width = display.getWidth();            int height = display.getHeight();            Paint paint = new Paint();            paint.setStyle(Paint.Style.FILL);                            paint.setColor(Color.WHITE);            canvas.drawPaint(paint);            if (figure_type == 0)            {                                // circle                Random randomColor = new Random();                paint.setColor(randomColor.nextInt());                canvas.drawCircle(width/2, height/2-100, 100, paint);            }            else if (figure_type == 1)            {                                // square                Random randomColor = new Random();                paint.setColor(randomColor.nextInt());                canvas.drawRect(80, 80, 220, 220, paint);            }            else if (figure_type == 2)            {                // triangle                Random randomColor = new Random();                paint.setColor(randomColor.nextInt());                Path path = new Path();                path.moveTo(width/2, 30);                path.lineTo(width/2+100, height/2-50);                path.lineTo(70, 190);                path.close();                canvas.drawPath(path, paint);            }        }    }}</code></pre><p>Question: How to perform the event clicking the screen (or DemoView)?Thanks!</p>","211848","","211848","","2010-09-23 13:55:33","2010-09-23 13:55:33","Event Handling [Android]","<android><events><views><onclick>","1","0","","",""
"3774080","1","3774673","","2010-09-22 22:24:52","0","2357","<p>I would like to know, how do we get the access point name from an Android Phone.</p><p>Thanks,Sana.</p><p>EDIT:</p><pre><code>WifiManager mWiFiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);WifiInfo w = mWiFiManager.getConnectionInfo();Toast.makeText(this, ""APN Name = ""+w.getSSID(), Toast.LENGTH_SHORT).show();</code></pre><p>The above code snippet is for current active APN name.</p><p>Thanks tdelev</p>","402637","","402637","","2010-09-24 15:08:12","2010-09-24 15:08:12","How to get the Access Point Name in Android?","<android>","2","0","0","",""
"3774161","1","","","2010-09-22 22:41:41","1","4131","<p>During my activity I'm sending an intent to the browser in order to display a webpage :</p><pre><code>    Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(""http://ww.mywebpage.com"");    startActivity(i);</code></pre><p>I need to make sure that before sending the intent the browser cache and history are cleared so that the page get loaded from server directly and not from phone.</p><p>So far I've found the 2 following but I'm not sure they are used correctly :</p><pre><code>    Browser.clearHistory(getContentResolver());    Browser.clearSearches(getContentResolver());</code></pre><p>Also with that cache is not cleared.</p><p>Do you know how to do that ?</p>","455607","","","","","2010-11-30 10:22:41","Programmatically clear browser cache/history","<android>","2","0","1","",""
"3774189","1","3774246","","2010-09-22 22:49:07","1","202","<p>I'm using the following code to grab images from the web. It uses Gridview and depending on position, picks a URL from an array. It works but the loading of images is often hit or miss. Almost every time I start the app, a different number of images load.</p><p>It also has issues when changing from portrait to landscape view, 5 out of 10 images may be displayed then I'll turn the device and usually lose all the images. Sometimes a few do show up though.</p><p>Any ideas on making this more robust?</p><pre><code>try {                    URLConnection conn = aURL.openConnection();                    conn.connect();                    InputStream is = conn.getInputStream();                    BufferedInputStream bis = new BufferedInputStream(is);                    Bitmap bm = BitmapFactory.decodeStream(bis);                    bis.close();                    return bm;            } catch (IOException e) {                    Log.d(""DEBUGTAG"", ""error..."");            }            return null;</code></pre>","454255","","","","","2010-09-22 23:03:10","Pulling images from Web","<android><bitmap><gallery>","1","0","1","",""
"3774268","1","","","2010-09-22 23:07:52","1","982","<p>I'm making an alarm clock of sorts, and I was wondering what the best way to start an activity at a certain time would be. Would it be using the broadcast service or...</p>","455632","","","","","2010-09-22 23:28:38","Android: How to start an activity at a specified time?","<android><timer><activity><clock>","1","0","","",""
"3774282","1","5329490","","2010-09-22 23:10:10","35","15226","<p>This is for the record only.I received the above exception when trying to implement Sample Sync Adapter application. I have seen numerous posts related to this issue but no satisfactory response.So I will jot down my solution here in case anyone else gets into the same issue.</p><p>First, check the condition explained on this post <a href=""http://loganandandy.tumblr.com/post/613041897/caller-uid-is-different"">http://loganandandy.tumblr.com/post/613041897/caller-uid-is-different</a></p><p>Second, if you are like me and want to embed the sample into your existing app for testing then make sure you use Constants class that is part of this example and not under android.provider.SyncStateContract package. Because both classes use the same attribute name ACCOUNT_TYPE that is used when creating Account object.</p><p>HTH,Paul</p>","452397","","","","","2014-04-15 22:10:10","SecurityException: caller uid XXXX is different than the authenticator's uid","<android>","9","2","14","",""
"3774327","1","3776462","","2010-09-22 23:18:11","0","1122","<p>I have 2 ways of displaying ListView data.  I have a class for each type of row.  I do not create the rows in an xml layout.  (Each row is derived from View and does custom drawing).</p><p>When I switch from 1 type of row to another how do I get the ListView to layout properly with the correct row heights, and refresh?</p><p>Is View.forceLayout() on the right track?</p><p>Thanks,Gerry</p>","321594","","","","","2010-09-23 08:14:15","How to change size of ListView rows","<android><listview>","1","0","","",""
"3774436","1","6314225","","2010-09-22 23:41:43","0","1631","<p>I am using the <em>Gallery3D</em>-Code but want it to only display images from a sub-folder on the SD, not all of the images that are stored on it. To do this, I tried to change </p><p><code>public static final Uri STORAGE_URI = Images.Media.EXTERNAL_CONTENT_URI;</code></p><p>to</p><p><code>public static final Uri STORAGE_URI = Uri.fromFile(new File(ROOT_DIR));</code>,   </p><p>where<code>String ROOT_DIR =  Environment.getExternalStorageDirectory().toString() + ""/mySubDirectory"";</code></p><p>but I guess  this is transforming a <code>content://</code>-Uri to a <code>file://</code>-Uri and this may be a problem? </p><p>In any case, it doesn't work :-(! Instead of just showing images from the <code>ROOT_DIR</code>-directory and its sub-directories, it shows no images at all (""Gallery empty""). Could anyone point me in the right direction as to what I am doing wrong?</p>","241189","","241189","","2011-03-18 20:37:28","2011-06-11 05:10:12","Uri from FilePath","<android>","2","0","","",""
"3774616","1","3774946","","2010-09-23 00:31:09","1","818","<p>I have a problem with spinner. I am trying to create a spinner control which will do something on selection change.However I have noticed that when I call the <code>Spinner.setOnItemSelectedListner()</code> the inner <code>onItemSelected()</code> method gets called (even though no change has yet to have been made to the spinner).my code requires this method does not get called before it is actually changed. Is this a bug or am I doing something wrong?</p>","407133","","","","","2010-09-23 02:09:18","Problem with spinner on item selected","<android>","1","0","","",""
"3774621","1","","","2010-09-23 00:32:01","0","139","<p>I am a new Android developer, and though I have spent a LOT of time reading through the official developer guide/reference (as well has hours of guessing/checking), I'm still stumped about the best way to do my layout.  I am creating a board game, and here is an image of <a href=""http://techfeed.net/gameBoard.png"" rel=""nofollow"">the game board</a>. On that board, the game pieces live on (and move between) the small inner hexes.  From my limited understanding of Android development, I'm thinking I need to make each small hex a view.  And the overall board layout would be a stacking together of these small hex images to form the board shape.  The end result would look exactly like the gameBoard image I linked above.  IMPORTANT: I want the game board to be on the bottom of the screen, with game info (players, scores, etc.) at the top.  For now I am focusing on a portrait layout...I'll deal with landscape mode later.</p><p>The trouble I'm having is figuring out how to do the layout.  I want to use XML tags for this portion of the layout, because the board itself will never change during the game play.  Only the game pieces will move around on the static board.  I have spent hours so far researching and trying different layout types, and combinations of different layouts...nothing I've tried gives me that board design.  As you can see from the board image, the hexes don't line up into nice rows/columns.  I think this is why I am struggling to get my small hex views to look like the board.  Any ideas?  Or am I going about this in the wrong way altogether?</p>","449077","","","","","2010-09-23 15:01:37","Android Layout doesn't fit into contiguous rectangles","<android>","1","2","","",""
"3774625","1","3795429","","2010-09-23 00:33:30","0","1636","<p>I want to start an activity as a dialog, which can be simply done by:</p><pre><code>&lt;activity android:theme=""@android:style/Theme.Dialog""&gt;</code></pre><p>But I want to do control the dialog, so I've to do it programmatically. Basically I want to modify this property of dialog:</p><pre><code>mCanceledOnTouchOutside = true</code></pre><p>This will make the dialog cancel itself when touched outside of it's bounds. (Basically I want to replicate the popup behavior). The issue is I can't simply create a dialog and set it's layout since I need a call to activity (to initialized datasets)</p><p>Is this possible ?</p>","109603","","","","","2010-11-04 14:33:21","Starting an Android activity as a dialog without using a theme modifier","<android><dialog><themes><activity>","3","0","1","",""
"3774686","1","4411891","","2010-09-23 00:53:43","8","5680","<p>This is my first time making an app with XML layouts.  In the past I have always dynamically generated my layouts at runtime, so don't worry, I am NOT an Android newbie.  Still, this is my first time with static layouts.  So what's this message all about?</p><p><code>[2010-09-22 20:43:23 - Rockport] 'default' is not a best match for any device/locale combination.<br>[2010-09-22 20:43:23 - Rockport] Displaying it with 'Locale Language ___Region __, Normal Screen, Short screen aspect ratio, Landscape Orientation, No Dock, Day time, Medium Density, Finger-based touchscreen, Soft keyboard, Qwerty keybard, Trackball navigation, Screen resolution 480x320'</code></p><p>It gets printed to my Eclipse console every time I open up one of the layouts in the <code>layout/</code> folder.  If I open the layout from any other folder, such as <code>layout-land/</code> then I get no message.  Is it just the graphical layout editor saying, ""Here's how I'm going to display things for you?""  Can I safely ignore it?</p>","213525","","85950","","2013-10-30 20:34:17","2013-10-30 20:34:17","Eclipse and Android XML layouts gives ""'default' is not a best match for any device/locale combination""","<android><eclipse><eclipse-adt>","2","0","1","",""
"3774733","1","","","2010-09-23 01:07:50","2","824","<p>I have an app that obtains a list of available Calendars and displaysthem in the Spinner.</p><p>I have checks to ensure that if the available Calendar list is empty,then ListPreference will still display ""None available"" in the Spinner.</p><p>I am using the ListPreference to display the Spinner in thePreferences tab.</p><p>Here is the preferences.xml:</p><pre><code>&lt;ListPreference android:title=""Calendar""android:key=""calendars""android:summary=""Calendars to use for saving Appts""android:selectable=""true""android:entryValues=""@array/cal_entryvalues_list_preference""android:entries=""@array/cal_entries_list_preference""android:defaultValue=""0""android:enabled=""true""&gt;&lt;/ListPreference&gt;</code></pre><p>My users have reported the following error:</p><p>java.lang.NullPointerExceptionatandroid.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)at android.widget.AbsListView.obtainView(AbsListView.java:1294)at android.widget.ListView.measureHeightOfChildren(ListView.java:1198)at android.widget.ListView.onMeasure(ListView.java:1109)at android.view.View.measure(View.java:8171)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)atandroid.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)at android.view.View.measure(View.java:8171)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)atandroid.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)at android.widget.LinearLayout.measureVertical(LinearLayout.java:381)at android.widget.LinearLayout.onMeasure(LinearLayout.java:304)atcom.android.internal.widget.WeightedLinearLayout.onMeasure(WeightedLinearLayout.java:60)at android.view.View.measure(View.java:8171)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)at android.view.View.measure(View.java:8171)at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3132)at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)at android.view.View.measure(View.java:8171)at android.view.ViewRoot.performTraversals(ViewRoot.java:801)at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4627)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)at dalvik.system.NativeStart.main(Native Method)</p><p>The stack trace seems to be pointed all internal workings of Android.There is no reference to any of my code. This is happening on Android 2.1 as well as Android 2.2 platforms.</p><p>Unfortunately, I have not been able to reproduce the error on my MotoDroid. It appears from Developer Console logs that this is specific tocertain phones (e.g: HTC Incredible).</p><p>Any idea what is going on here? </p>","355614","","","","","2012-03-13 12:33:43","ListPreference is throwing a strange null pointer exception","<android><android-widget><nullpointerexception><android-preferences>","0","0","2","",""
"3774758","1","3774790","","2010-09-23 01:17:03","0","918","<p>I'm opening an image from the gallery, resizing it, and attempting to save the resized version to the apps data file so I can grab it in future. My problem is I keep getting a FileNotFoundException when I try to write it with an input stream.</p><p>This is the file it's trying to write too. ""/mnt/sdcard/Android/data/foundcake.myslide/files/IMG_20100918_133128.png""</p><p>Am I missing any important steps here?</p><pre><code>    File storagePath = new File(Environment.getExternalStorageDirectory() + ""/Android/data/foundcake.myslide/files/"");    storagePath.mkdirs();    Debug.print(""STORAGE PATH "" + storagePath);    Pattern pattern = Pattern.compile(""/([^/]+)\\.[^/]+$"");    Matcher matcher = pattern.matcher(filePath);    String fileName = """";    while (matcher.find()) {        fileName = matcher.group(1);    }    Debug.print(""FILE NAME "" + fileName);    File cached = new File(storagePath, fileName + "".png"");    Debug.print(""NEW FILE "" + cached.toString());    try {        FileOutputStream out = new FileOutputStream(cached);        bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);    } catch (Exception e) {        e.printStackTrace();    }</code></pre>","92259","","","","","2012-04-14 11:06:04","Save an edited image to the SD card","<android>","1","0","","",""
"3774770","1","5262418","","2010-09-23 01:20:16","6","2687","<p>Is there a way to display a View, such as a TextView sideways using the XML layout file?  I know you can rotate the view using code in an activity, but is there a way just to do it with layout?</p>","437226","","","","","2012-04-19 22:23:13","Sideways View with XML Android","<android><textview>","2","0","1","",""
"3774816","1","3776453","","2010-09-23 01:30:50","2","2361","<p>I am using the following to mock my location in Android.</p><pre><code>public class GPSwork extends Activity implements LocationListener{LocationManager locationManager;String mocLocationProvider;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    mocLocationProvider = LocationManager.GPS_PROVIDER;     setLocation(28.574853,78.063201);}public void setLocation(double latitude, double longitude) {       locationManager.addTestProvider(mocLocationProvider, false, true, false, false, false, false, false, 0, 5);    locationManager.setTestProviderEnabled(mocLocationProvider, true);    locationManager.requestLocationUpdates(mocLocationProvider, 0, 0, this);    Location loc = new Location(mocLocationProvider);    loc.setTime(System.currentTimeMillis());    loc.setLatitude(latitude);    loc.setLongitude(longitude);    locationManager.setTestProviderLocation(mocLocationProvider, loc);   }public void onLocationChanged(Location location) {    // TODO Auto-generated method stub      }public void onProviderDisabled(String provider) {    // TODO Auto-generated method stub}public void onProviderEnabled(String provider) {    // TODO Auto-generated method stub      }public void onStatusChanged(String provider, int status, Bundle extras) {    // TODO Auto-generated method stub      }   }</code></pre><p>But it's not working. I want to see it in real device and the bubble blinking in that location, but I didnt get anything. Please correct my code, and help me out. I used the permissions.</p><p>I want build an application similatiom to location spoofer.Actually when we open google maps it will show our current location with blue blinking at our location..similarly if i  changed the coordinates i.e, latitude and latitude it has to show that am at that location with blue blinking,</p><p>![alt text][1]this is the screen short..</p><p>My XML fine is </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>&lt;com.google.android.maps.MapView     android:id=""@+id/mapView""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:apiKey=""0Sy8vgJlQkFxcisUAkrxu3xN33dqFgBetCg4jxg""    /&gt;</code></pre><p></p>","455422","","455422","","2010-09-23 13:12:21","2010-10-26 16:05:02","mock location in android","<android>","3","0","","",""
"3774902","1","","","2010-09-23 01:56:16","3","7635","<p>I have a project that is compiles but throws a NoClassDefFoundError on a classname included from a sibling library project, but only when built from Eclipse.  When I build the project from the ant file, it runs just fine.</p><p>How do I tell the Eclipse build system that my application's .apk needs a copy of the .class files from the library project.</p><p>This page...  <a href=""http://developer.android.com/guide/developing/eclipse-adt.html#libraryReference"" rel=""nofollow"">http://developer.android.com/guide/developing/eclipse-adt.html#libraryReference</a>makes is sound like adding the library should ""just work"" with no other steps.  And I see it has updated my default.properties with the necessary link that makes my ant build work.</p><p>Despite following those steps (my library project is listed in the Android page of my application's project properties), Eclipse doesn't recognize the new classes in the editor.  So I did the standard Eclipse step of adding the library to the Java Build Path.  Now the compiler and IDE recognize the class, but my app still crashes with NoClassDefFoundError, even after checking the library in the Java Build Path, Order and Export.</p><p>What step am I missing?</p><p><strong>Some background...</strong>  I built the Eclipse project first.  Then, in a separate directory, I used <code>android create project ...</code> with all the parameters to create an identically configured project.  Finally, I copied the ant build.xml and *.properties files to the Eclipse project directory.  I did the same thing with the library project I'm trying to reference.</p>","152543","","","","","2013-07-11 01:26:17","Android: How to reference a library project from an Eclipse ADT application project?","<android><eclipse>","4","4","","",""
"3774957","1","3775044","","2010-09-23 02:13:46","1","373","<p>I'm working with integers and trying to do calculations that involve decimals at parts. I have used this same setup before and it had worked but for some reason this isn't working. </p><pre><code>package table.periodic;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.Spinner;import android.widget.TextView;import android.widget.AdapterView.OnItemSelectedListener;public class Gram2mol extends Activity implements AdapterView.OnItemSelectedListener {private Spinner Spinner01;private TextView elementnumber;private EditText grams;private Button calculate;private TextView moles5;String[] element={""Actinium"", ""Aluminum"", ""Americium"",         ""Antimony"", ""Argon"", ""Arsenic"", ""Astatine"", ""Barium"",         ""Berkelium"", ""Beryllium"", ""Bismuth"", ""Bohrium"", ""Boron"",         ""Bromine"", ""Cadmium"", ""Calcium"", ""Californium"", ""Carbon"",         ""Cerium"", ""Cesium"", ""Chlorine"", ""Chromium"", ""Cobalt"",         ""Copernicium"", ""Copper"", ""Curium"", ""Darmstadtium"", ""Dubnium"",         ""Dysprosium"", ""Einsteinium"", ""Erbium"", ""Europium"", ""Fermium"",         ""Fluorine"", ""Francium"", ""Gadolinium"", ""Gallium"", ""Germanium"",         ""Gold"", ""Hafnium"", ""Hassium"", ""Helium"", ""Holmium"",         ""Hydrogen"", ""Indium"", ""Iodine"", ""Iridium"", ""Iron"",         ""Krypton"", ""Lanthanum"", ""Lawrencium"", ""Lead"", ""Lithium"",         ""Lutetium"", ""Magnesium"", ""Manganese"", ""Meitnerium"", ""Mendelevium"",         ""Mercury"", ""Molybdenum"", ""Neodymium"", ""Neon"", ""Neptunium"",         ""Nickel"", ""Niobium"", ""Nitrogen"", ""Nobelium"", ""Osmium"",         ""Oxygen"", ""Palladium"", ""Phosphorus"", ""Platinum"", ""Plutonium"",         ""Polonium"", ""Potassium"", ""Praseodymium"", ""Promethium"", ""Protactinium"",         ""Radium"", ""Radon"", ""Rhenium"", ""Rhodium"", ""Roentgenium"", ""Rubidium"",         ""Ruthenium"", ""Rutherfordium"", ""Samarium"", ""Scandium"", ""Seaborgium"",         ""Selenium"", ""Silicon"", ""Silver"", ""Sodium"", ""Strontium"", ""Sulfur"",         ""Tantalum"", ""Technetium"", ""Tellurium"", ""Terbium"", ""Thallium"", ""Thorium"",         ""Thulium"", ""Tin"", ""Titanium"", ""Tungsten"", ""Ununpentium"", ""Ununquadium"",        ""Ununtrium"", ""Uranium"", ""Vanadium"", ""Xenon"", ""Ytterbium"", ""Yttrium"", ""Zinc"",        ""Zirconium""};public void onCreate(Bundle icicle){    super.onCreate(icicle);    setContentView(R.layout.grams2moles);    elementnumber = (TextView) findViewById(R.id.elementnumber);    grams = (EditText) findViewById(R.id.grams);    calculate = (Button) findViewById(R.id.calculate);    calculate.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {my_func01();}});    Spinner spin = (Spinner) findViewById(R.id.elements);    spin.setOnItemSelectedListener((OnItemSelectedListener) this);    ArrayAdapter&lt;String&gt; aa=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, element);    aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spin.setAdapter(aa);}void my_func01(){    int grams2;    int elementnumber2;    int moles2;        grams2 = Integer.parseInt(grams.getText().toString());        elementnumber2 = Integer.parseInt(elementnumber.getText().toString());        moles2 = (grams2 * (1 / elementnumber2));        moles5.setText("""" + moles2);    }    public void setSpinner01(Spinner spinner01) {        Spinner01 = spinner01;    }    public Spinner getSpinner01() {        return Spinner01;    }    public void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position, long id)    {    if (""Actinium"".equals(element[position]))    {elementnumber.setText(""227"");}    if (""Aluminum"".equals(element[position]))    {elementnumber.setText(""26.981538"");}    if (""Americium"".equals(element[position]))    {elementnumber.setText(""243"");}    if (""Antimony"".equals(element[position]))    {elementnumber.setText(""121.760"");}    if (""Argon"".equals(element[position]))    {elementnumber.setText(""39.948"");}    if (""Arsenic"".equals(element[position]))    {elementnumber.setText(""74.9216"");}    if (""Astatine"".equals(element[position]))    {elementnumber.setText(""210"");}    if (""Barium"".equals(element[position]))    {elementnumber.setText(""137.327"");}    if (""Berkelium"".equals(element[position]))    {elementnumber.setText(""247"");}    if (""Bismuth"".equals(element[position]))    {elementnumber.setText(""208.9804"");}    if (""Bohrium"".equals(element[position]))    {elementnumber.setText(""264"");}    if (""Boron"".equals(element[position]))    {elementnumber.setText(""10.811"");}    if (""Bromine"".equals(element[position]))    {elementnumber.setText(""79.904"");}    if (""Cadmium"".equals(element[position]))    {elementnumber.setText(""112.41"");}    if (""Calcium"".equals(element[position]))    {elementnumber.setText(""40.078"");}    if (""Californium"".equals(element[position]))    {elementnumber.setText(""251"");}    if (""Carbon"".equals(element[position]))    {elementnumber.setText(""12.0107"");}    if (""Cerium"".equals(element[position]))    {elementnumber.setText(""140.116"");}    if (""Cesium"".equals(element[position]))    {elementnumber.setText(""132.90545"");}    if (""Chlorine"".equals(element[position]))    {elementnumber.setText(""35.453"");}    if (""Chromium"".equals(element[position]))    {elementnumber.setText(""51.996"");}    if (""Copper"".equals(element[position]))    {elementnumber.setText(""63.546"");}    if (""Curium"".equals(element[position]))    {elementnumber.setText(""247"");}    }    public void onNothingSelected(AdapterView&lt;?&gt; arg0) {        elementnumber.setText(""227"");    }</code></pre><p>}</p><p>my error is this  </p><pre><code>09-22 20:02:58.353: ERROR/AndroidRuntime(17745): Uncaught handler: thread main exiting due to uncaught exception09-22 20:02:58.513: ERROR/AndroidRuntime(17745): java.lang.NullPointerException09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at table.periodic.Gram2mol.my_func01(Gram2mol.java:77)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at table.periodic.Gram2mol$1.onClick(Gram2mol.java:56)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.View.performClick(View.java:2364)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.View.onTouchEvent(View.java:4179)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.widget.TextView.onTouchEvent(TextView.java:6592)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.View.dispatchTouchEvent(View.java:3709)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1695)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.app.Activity.dispatchTouchEvent(Activity.java:2068)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1679)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1697)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.os.Handler.dispatchMessage(Handler.java:99)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.os.Looper.loop(Looper.java:123)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at android.app.ActivityThread.main(ActivityThread.java:4568)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at java.lang.reflect.Method.invokeNative(Native Method)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at java.lang.reflect.Method.invoke(Method.java:521)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)09-22 20:02:58.513: ERROR/AndroidRuntime(17745):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>line 77 is the ""moles5.setText("""" + moles2);""</p><p>I don't believe I'm getting any id's mixed up so I'm not worried about that and it doesn't seem to be that kind of error. If anyone has any ideas let me know. Thanks. </p>","288437","","","","","2010-09-23 02:30:01","Integers and Calculations","<android><integer>","2","0","","",""
"3774983","1","3775041","","2010-09-23 02:18:27","0","396","<p>I am using Mark Murphy's ThumbnailAdapter in a project to cache and display images from the web in a list view.  It works well, except that it caches to internal memory.  I can't figure out how to modify it to cache to external memory.</p><p>Any advice?</p><p>cwac-thumbnail: <a href=""http://github.com/commonsguy/cwac-thumbnail"" rel=""nofollow"">http://github.com/commonsguy/cwac-thumbnail</a></p>","241204","","","","","2010-09-23 02:29:37","How can I change the CommonsWare cwac thumbnailAdapter to cache to the SD Card?","<android><listview><caching><thumbnails><imageview>","1","2","","",""
"3775074","1","9715422","","2010-09-23 02:38:10","14","8085","<p>Is there anyway I can tell a Toast Notification to show up only for a specified amount of time.  Generally shorter then a regular toast message.</p>","445342","","","","","2013-12-18 06:06:57","Set Toast Appear Length","<android><time><toast>","7","1","6","",""
"3775451","1","","","2010-09-23 04:27:33","0","1385","<p>I need to implement my own main event loop in C++ which will be based on GLib library. I don't know where to begin. I studied some materials about GLib, but it doesn't help me to know, how implement event loop. Could somebody give me some advise about it or give me some source code? I basically need to implement GSource and GSourceFuncs from GLib. Event loop should be platform independent, but my application will be run on Android. I can't find how event loop is implemented in Android, could somebody explain it to me too? Thanks a lot.</p><p>Lukas</p>","455778","","","","","2010-10-27 00:34:40","GLib - main event loop in C++","<c++><android><glib><event-loop>","1","0","","",""
"3775536","1","","","2010-09-23 04:51:55","0","627","<p>I have started to port Android on TCC89XX board, I download Android SDK. and applied the patch with kernel 2.6.29, the Processor is having armv6 instruction set.</p><p>I am not able to see the network up ifconfig is not able to show the network devices.</p><p>Also I do not get why there is no ""on"" binary in the system/bin, system/xbin, the init.rc and init.goldfish.rc.</p><p>I cannot get the zygote process up. create_socket throws error.</p><p>If any one knows about this, please tell what i need to do correctly or point me to some correct URL's which will be help full</p><p>thanksSuman</p>","455792","","","","","2011-04-20 17:49:39","Android Porting on Telechips TCC89XX: Not able to start init process","<android><sockets><sdk><arm>","1","0","","",""
"3775568","1","","","2010-09-23 05:06:18","0","1929","<p>My home PC is an Intel E6300 with 4GB RAM. My company PC is an Intel i5 quadcore with 4GB RAM. I ran the latest Android emulator (came with SDK) on both PC's (both running Windows 7 x64), and it was unbearably slow on both PC's.</p><p>On my home PC, I ran Windows Phone 7 emulator and it worked smoothly. I booted up with my Hackintosh on the same PC and ran iPhone simulator and it also worked smoothly.</p><p>Anyways what kind of hardware is required to run Android emulator that smoothly, i7 with 16GB RAM? Or the Android emulator is so slow that even the top-of-the line desktop CPU's are not enough and I should get a real Android device?</p>","455796","","","","","2013-03-02 07:48:30","What hardware is needed to run the Android emulator fast?","<android><performance><emulator>","2","2","","",""
"3775587","1","","","2010-09-23 05:13:17","20","7511","<p>I used an attribute <code>layout_marginLeft=""30dip""</code> in a style defined for buttons. When I apply this style individually for each button, the left margin is placed as I wanted.</p><p>But then I defined a theme, where I assigned my button style to the attribute <code>android:buttonStyle</code> and applied it to my project.<br>However, the left margin property is ignored. Any idea what I must do here?</p><p>style.xml as follows:</p><pre><code>&lt;style name=""btnstyle"" parent=""@android:style/Widget.Button""&gt;    &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:layout_marginLeft""&gt;30dip&lt;/item&gt;    &lt;item name=""android:textColor""&gt;#FFFFFF&lt;/item&gt;       &lt;/style&gt; &lt;style name=""appstyle"" parent=""android:Theme""&gt;     &lt;item name=""android:buttonStyle""&gt;@style/btnstyle&lt;/item&gt; &lt;/style&gt;</code></pre>","454660","","234938","","2011-11-24 20:34:00","2014-01-04 00:11:42","To use layout_marginLeft in a button style applied as a theme?","<android><button><coding-style><themes><margins>","4","0","5","",""
"3775683","1","8275309","","2010-09-23 05:39:34","5","334","<p>If you try the Contact Manager that comes with Android 2.2 Froyo it will give you access to all contacts in the sqlite database via Contact ContentProvider.  But if you write an app that is not com.android.contacts you only get access to the restricted table because of this code here:</p><p><a href=""http://www.google.com/codesearch/p?hl=en#cbQwy62oRIQ/res/values/unrestricted_packages.xml&amp;q=unrestricted_packages&amp;sa=N&amp;cd=1&amp;ct=rc"">http://www.google.com/codesearch/p?hl=en#cbQwy62oRIQ/res/values/unrestricted_packages.xml&amp;q=unrestricted_packages&amp;sa=N&amp;cd=1&amp;ct=rc</a></p><p>If you try any of the samples like ContactManager or any app on the market it will not have access to the full list of contacts only access to the restricted view.</p><p>The restricted table seems to only contain contacts with phone numbers and excludes some facebook contacts.  I can't find any documentation on why a contact would be restricted anywhere in the developer docs?</p><p>Is there some way around this besides rooting and opening the the sqlite db manually or using a custom firmware?</p>","156196","","995926","","2012-05-05 13:54:43","2012-05-05 13:54:43","Why are some contacts censored from apps on android?","<android><contactscontract><android-2.2-froyo>","3","0","3","",""
"3775684","1","3775788","","2010-09-23 05:39:36","2","1382","<p>I am getting following encoded html as a json response and has no idea how to decode it to normal html string, which is an achor tag by the way.</p><pre><code>x3ca hrefx3dx22http:\/\/wordnetweb.princeton.edu\/perl\/webwn?sx3dstrandx22x3ehttp:\/\/wordnetweb.princeton.edu\/perl\/webwn?sx3dstrandx3c\/ax3e</code></pre><p>I have tried java.net.UrlDecoder.decode without anyluck.</p>","455814","","","","","2014-01-13 07:01:03","Decoding html returned as json response - android","<java><android><json>","3","2","1","",""
"3775705","1","3776227","","2010-09-23 05:45:31","49","57927","<p>I can use android:gravity=""bottom|center_horizontal"" in xml on a textview to get my desired results but I need to do this programmatically.</p><p>My textview is inside a tablerow if that matters in a relativelayout.</p><p>I have tried:</p><p><code>LayoutParams layoutParams = new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL);labelTV.setLayoutParams(layoutParams);</code></p><p>But if I understand that correctly, that would apply it to the tablerow? not the textview?</p><p>Please help, i'm lost.</p>","449133","","","","","2013-09-04 11:45:12","Android set the gravity for a TextView programmatically","<android><textview><gravity>","2","0","8","",""
"3775726","1","","","2010-09-23 05:49:28","9","9414","<p>How do I get one area in the middle of a image clickable (not the whole image)? Tried with a button set to invisible and clickable but the button does not work. What are the alternatives to an invisible / transparent button that works like a regular?</p><p>I've also thought of a completely transparent and clickable PNG that should work but maybe not the best way?</p>","446752","","","","","2014-02-19 15:59:56","Invisible / transparent button that works like a regular in android?","<android><image><button><invisible>","4","0","3","",""
"3775732","1","3888442","","2010-09-23 05:49:43","5","2881","<p>I am trying to implement Android c2dm. I have looked into documentation and seen the jump note and chrome to phone samples that are provided... </p><p>But i couldnt really figure out the process. It would be great if i could simple implementation of c2dm where in when we send a request from server, it displays simple notification... Plz help</p>","303155","","","","","2012-04-20 15:23:13","Simple implementation of Android C2DM required","<android><android-c2dm>","2","0","5","",""
"3775963","1","3775983","","2010-09-23 06:38:20","0","320","<p>hallo,</p><p>is their a way to get information of an android market account(my account) for other poeple ? So that other poeple have a look on how it is without permission to change something.. (e.g.that financier have a look on it).</p><p>find nothing until now</p><p>LG j</p>","372021","","65977","","2010-09-23 06:48:41","2010-09-23 06:48:41","android market account information tool","<android><google-play>","1","1","","",""
"3776001","1","3776014","","2010-09-23 06:48:16","0","1497","<p>I have a String countries[].</p><p>now when i click a button then on the onClick event this abc array is filled.suppose it is filled with the name of 10 countries.These 10 countries should be visible as a list so that i can choose any 1 country among the list. but i am not able to show them as a list.</p><p>My programme crashes if i use the following code :</p><p> ListView list = (ListView)findViewById(R.id.ListView);</p><p>list.setAdapter(new ArrayAdapter(this,               android.R.layout.simple_list_item_1, countries));</p><p>As countries is filled later on the click of a button.So initially the countries array is empty and as the onCreate() is executed first it crashes.</p><p>I found the examples on net where there is pre-defined array.so it works.My array is filled in a onClick event.how can i display List at that moment???</p>","375061","","","","","2010-09-23 06:51:35","how to display a list in android","<android><listview>","1","0","","",""
"3776026","1","3776223","","2010-09-23 06:54:45","2","4718","<p>I have followed the instructions from this SO question: <a href=""http://stackoverflow.com/questions/3438276/change-title-bar-text-in-android"">http://stackoverflow.com/questions/3438276/change-title-bar-text-in-android</a></p><p>I am able to successfully create my own titlebar, however when I apply a background color to my layout, the color doesn't span across the entire titlebar. There are still remnants of the android gray background color.</p><p>Here is my XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""400px""   android:layout_height=""fill_parent""  android:orientation=""horizontal"" android:background=""@color/solid_blue""&gt;&lt;ImageView android:id=""@+id/logo""             android:layout_width=""57px""             android:layout_height=""wrap_content""            android:background=""@drawable/icon""&gt;&lt;/ImageView&gt;&lt;TextView   android:id=""@+id/myTitle""   android:text=""StockDroid by""   android:layout_width=""fill_parent""   android:layout_height=""fill_parent""   android:textColor=""#FFFFFF""   /&gt;&lt;/LinearLayout&gt;</code></pre>","19875","","","","","2010-09-23 08:01:33","How to set the background of the titlebar?","<java><android><android-linearlayout><titlebar>","1","0","1","",""
"3776088","1","","","2010-09-23 07:07:39","1","3489","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2395661/android-tabs-at-the-bottom"">Android: Tabs at the BOTTOM</a>  </p></blockquote><p>How to add tabs at the bottom of the screen in android.Please any one tell the answer</p>","454670","","","","","2011-02-09 16:46:17","Android Tabs in Bottom of the Layout","<android>","2","0","","2011-09-27 13:38:10",""
"3776115","1","3776186","","2010-09-23 07:13:28","1","5377","<p>I have defined style for ""TabWidget"" as below:</p><pre><code>&lt;style name=""MyTheme"" parent=""@android:style/Theme.Light""&gt;        &lt;item name=""android:tabWidgetStyle""&gt;@style/LightTabWidget&lt;/item&gt;&lt;/style&gt;&lt;style name=""LightTabWidget"" parent=""@android:style/Widget.TabWidget""&gt;            &lt;item name=""android:textSize""&gt;12px&lt;/item&gt;&lt;/style&gt;</code></pre><p>In which i am setting font-size 12px for TabWidget Indicator(title) font.</p><p>Now, my problem: Same way of Tabwidget style modification, <strong>i want to modify style for Listview for incresing/decreasing font-size.I know we can modify font-size of listview by defining custom-layout for Listview. But if there is a way to do by styles.xml then pls help me and let me know.</strong></p>","379693","","","","","2010-09-23 07:55:28","Android - Changes in ""Style.xml"" for Listview font-size","<android><listview><font-size><android-listview>","1","0","1","",""
"3776125","1","","","2010-09-23 07:15:11","1","1809","<p>I am trying to run example of facebook android sdk , in that i have run stream example to fetch the data from facebook.</p><p>Now hen ever i click on ""fconnect"" button to log in into facebook i am getting following dialog box<img src=""http://i.stack.imgur.com/9VUrp.png"" alt=""alt text""></p><p>so is it possible to replace this dialog box with following to make it simple ???</p><p><img src=""http://i.stack.imgur.com/Fu5rM.png"" alt=""alt text""></p>","405383","","","","","2010-09-23 16:45:02","Replace facebook dialog with custom dialog in android","<android><facebook>","1","0","","",""
"3776152","1","","","2010-09-23 07:19:02","3","13491","<p>I am developing app which bust run on both Android 1.5 and Andoroid 2.x platforms.When I install it on Android 2.2 all is OK, but on emulator with Android 1.5 I get an error:</p><pre><code>Failure [INSTALL_FAILED_DEXOPT]</code></pre><p>What is the problem may be?</p><p><strong>UPD</strong> That is Logcat output:</p><pre><code>09-26 07:12:22.484: INFO/PackageManager(579): /data/app/vmdl23706.tmp changed; unpacking09-26 07:12:22.494: DEBUG/installd(557): DexInv: --- BEGIN '/data/app/vmdl23706.tmp' ---09-26 07:12:36.114: ERROR/dalvikvm(1362): LinearAlloc exceeded capacity, last=33609-26 07:12:36.114: ERROR/dalvikvm(1362): VM aborting09-26 07:12:36.265: INFO/DEBUG(551): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***09-26 07:12:36.265: INFO/DEBUG(551): Build fingerprint: 'generic/sdk/generic/:1.5/CUPCAKE/150240:eng/test-keys'09-26 07:12:36.265: INFO/DEBUG(551): pid: 1362, tid: 1362  &gt;&gt;&gt; /system/bin/dexopt &lt;&lt;&lt;09-26 07:12:36.265: INFO/DEBUG(551): signal 11 (SIGSEGV), fault addr deadd00d</code></pre><p>It seems that memory was not enough... If anybody knows how to fight with such problem? I would be very grateful for any help.</p>","299137","","1765573","","2013-07-26 20:33:04","2013-09-11 14:28:27","Android: INSTALL_FAILED_DEXOPT while install app on android 1.5","<android><android-install-apk>","2","0","","",""
"3776254","1","3776418","","2010-09-23 07:38:37","9","32930","<p>I am trying to make this VideoView to appear in full screen mode:</p><pre><code>public class ViewVideo extends Activity {  private String filename;  private static final int INSERT_ID = Menu.FIRST;  @Override  public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        System.gc();        Intent i = getIntent();        Bundle extras = i.getExtras();        filename = extras.getString(""videofilename"");        VideoView vv = new VideoView(getApplicationContext());        setContentView(vv);        vv.setVideoPath(filename);        vv.setMediaController(new MediaController(this));        vv.requestFocus();        vv.start();  }  @Override  public boolean onCreateOptionsMenu(Menu menu) {      super.onCreateOptionsMenu(menu);      menu.add(0, INSERT_ID, 0,""FullScreen"");      return true;  }  @Override  public boolean onMenuItemSelected(int featureId, MenuItem item) {      switch(item.getItemId()) {      case INSERT_ID:          createNote();      }      return true;  }  private void createNote() {        requestWindowFeature(Window.FEATURE_NO_TITLE);          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                                WindowManager.LayoutParams.FLAG_FULLSCREEN);    }}</code></pre><p>The video is playing from the sdcard. Only thing is when I click on the fullscreen menu button, the application ""stops unexpectedly"". Please help me out, how to get the video to run in full screen? Thanks in advance.</p>","366916","","1267661","","2012-10-12 21:48:06","2013-03-13 06:41:12","Android-Video View in Fullscreen","<android>","4","1","4","",""
"3776260","1","4455271","","2010-09-23 07:39:51","3","3759","<p>How can i draw a HUD (Text or Bitmaps) after drawing some 3d stuff in openGL ES ??</p><p>I tried this:  </p><blockquote>  <p>private void switchTo2D(GL10 gl){  </p>    <blockquote>    <p>gl.glDisable(GL10.GL_DEPTH_TEST);<br>    gl.glMatrixMode(GL10.GL_PROJECTION);<br>    gl.glPushMatrix();<br>    gl.glLoadIdentity();  </p>        <p>gl.glMatrixMode( GL10.GL_PROJECTION );<br>    gl.glLoadIdentity();<br>    GLU.gluOrtho2D( gl, 0, getViewportWidth(), 0, getViewportHeight() );</p>        <p>gl.glMatrixMode(GL10.GL_MODELVIEW);<br>    gl.glLoadIdentity();<br>    }</p>  </blockquote></blockquote><p>Someone know how to switch from Perspective to Ortho without destroying the scene??</p><p>Bartinger</p>","401171","","44729","","2010-09-23 15:08:56","2011-04-06 03:42:16","Android - Draw 3D then 2D with openGL ES","<java><android><3d><opengl-es>","1","2","5","",""
"3776329","1","","","2010-09-23 07:52:03","0","694","<p>Can anybody please solve my Issue regarding XML SAX Parsing:</p><p>I have a small issue that in my Android application when parsing is done, it goes through the whole response and parse the data.</p><p>My issue is that I just want to parse the data from the particular place. So that when I parse the XML Response, parsing should be done from the desired place and then it should not check further even if the ""same tag"" used to appear elsewhere in the response.</p><p>Is there any way to do this? I am stranded in this situation badly and have no clue for what to do.</p>","422859","","651104","","2012-06-13 04:57:39","2012-06-13 04:57:39","Xml Parsing using SAX parser in Android application.","<android><xml><saxparser>","2","0","","",""
"3776445","1","3779313","","2010-09-23 08:12:05","0","1566","<p>I have completed my one application in android. Then from the ddms I pull the .apk file when i installed it on my android its shows the error ""there is a problem parsing the package"".</p>","441224","","140185","","2010-09-23 08:15:03","2013-11-20 13:58:46","Android parsing the package problem","<android>","3","0","","",""
"3776523","1","","","2010-09-23 08:23:27","3","1238","<p>Like many others, I want to kill my Android application on ""exit"" button. Really kill, not just move to background and stop all active code (I know very well that Android does not like it).</p><p>I found <code>Process.killProcess(Process.myPid())</code> and <code>System.exit(0)</code> which both work fine (I have no problem with activity stack, the ""exit"" button is in my base Activity).</p><p>But there is a problem. When I kill my process and I am back in the shell, I press [Home] button. It shows list of applications that are on the background including my application which has been killed.</p><p>Is there a way how to do both: 1) kill the process and 2) remove it from the Android application list that is shown after user presses [Home] button ?</p><p>Thanks for all replies (with the exception of that stupid ""you should not exit applications explicitly on Android"" :-) )</p>","449293","","436938","","2012-10-24 08:55:27","2012-10-24 08:55:27","Activity of a killed process is still visible in list after [Home] pressed","<android><process><android-activity><exit><kill>","2","0","0","",""
"3776597","1","","","2010-09-23 08:34:42","0","319","<p>I am using SAXParser to parse an xml document having three different tagsBut in the result i get the value of only ""one tag  and not Other two tags..Can someone explain?My xml is :</p><pre><code> &lt;outertag&gt; &lt;innertag&gt; hello&lt;/innertag&gt;  &lt;othertag&gt;good morning&lt;/othertag&gt;  &lt;thirdtag Attribute=""its a pleasant day""/&gt;  &lt;/outertag&gt;</code></pre>","424831","","424831","","2010-09-24 07:41:06","2010-09-24 07:41:06","cannot read two different tags using SAXParser in android?","<android><xml-parsing>","0","2","","",""
"3776635","1","3788749","","2010-09-23 08:42:33","1","544","<p>I am working on an Android Application where I am trying to track movement of the device from a service. The service registers itself for the location updates, here we are making sure that we are asking for ""GPS Provider"" and not a network provider (which can be inaccurate.) </p><p>While calling</p><p>public void requestLocationUpdates (String provider, long minTime, float minDistance, LocationListener listener)</p><p>provider is ""gps""</p><p>and minTime and minDistance are both set zero to get best possible results. </p><p>Yet when the device is stationary lying on the desk it gets GPS updates which are different from each other so much so that we actually get an average speed (measured by dividing distance by time interval between location updates)  more than 5 miles/hr averaged on last 5 location updates. </p><p>This totally wrecks the application logic. What can be the reason for the android device (EVO 4, HTC MyTouch) to give different location updates while being completely stationary? Can anybody suggest a way to weed out these wrong location update from the correct ones?</p><p>Will appreciate your feedback greatly.</p><p>Thanks.</p><p>Pritam.</p><p>Update:</p><p>Finally ended up monitoring the GPS input for 30 seconds for regularity of updates, and stable average speed and time difference between the GPS updates.</p>","212923","","212923","","2010-09-30 16:26:20","2011-05-11 09:28:57","Problem: While stationary Android GPS gives different location updates - Closed","<android><gps>","1","2","","",""
"3776693","1","","","2010-09-23 08:49:57","6","3775","<p>i'm willing to develop a soccer game for <b>Android</b>.</p><p>Because the complexity of the AI, i really think i need to design it using a <b>FSM (Finite State Machine)</b> and not with a monster switch.</p><p>Googling around i found some FSM written in Java, but nothing explicitly compatible with Android: i wonder if there is someone here that used a FSM before for that platform.</p><p>Thanks in advance :)</p>","455953","","635608","","2013-06-22 05:26:20","2013-06-22 05:26:20","Finite State Machine (FSM) and Android's Java","<java><android><fsm>","2","0","1","",""
"3776706","1","3777508","","2010-09-23 08:51:01","0","647","<p>My application uses a list of media files on the phone, i.e. images, audio and video. It also allows the user to filter the list via some checkboxes in a menu, so the user can choose to show or hide each type of files. </p><p>The way I've been doing this is by putting this in the adapter's getView(): </p><pre><code>        // don't show unwanted file types        if (cmo.hasType(MediaType.AUDIO_FILE)){            if(!prefs.getBoolean(PREFS_SHOWAUDIO, true)){                return new ViewStub(mContext);;            }        }else if(cmo.hasType(MediaType.IMAGE_FILE)){            if(!prefs.getBoolean(PREFS_SHOWIMG, true)){                return new ViewStub(mContext);;            }        }else if( cmo.hasType(MediaType.VIDEO_FILE)){            if(!prefs.getBoolean(PREFS_SHOWVIDEO, true)){                return new ViewStub(mContext);;            }        }</code></pre><p>which is quite effective in the sense that the list doesn't show those elements. However, the ListView still renders a 1px grey line between each View, even if they are ViewStubs, meaning I see a thick grey line whenever a group of consecutive items are filtered away. </p><p>How can I get rid of those lines? Should I create a new data array, containing only the elements that should show a view? </p>","378158","","378158","","2010-09-23 12:07:12","2010-09-23 12:07:12","Android, Adapter: Filtering via getView() still leaves gray lines","<android><filtering><listadapter>","1","0","","",""
"3776876","1","3878680","","2010-09-23 09:14:26","0","191","<p>friend's       I have configured Flurry Analytics in my application,it points the users in the country well,but here i need to know the detailed view of the state wise users by clicking up the country from map showing but the corresponding users from that state is not showing.</p><p>I set <code>&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code> in my manifest file and set <code>FlurryAgent.setReportLocation(true);</code>before     FlurryAgent.onStartSession(Rss_Feed_Grid.this, brown_api); in OnStart() method.what i need to configure to view detail users by states from the country.</p><p>please help me..</p>","393953","","393953","","2010-10-12 14:18:37","2010-10-12 14:18:37","Flurry State level user Details","<android>","1","0","","",""
"3776934","1","3780608","","2010-09-23 09:21:02","-1","362","<p>Please Help me for creating an application for getting the current location of the android phone.</p><p>Thank you.</p>","436765","","356580","","2010-09-23 09:26:40","2010-09-23 16:41:50","Please Help me for gtting the current location of the Android phone","<android><location><locationmanager>","2","1","","",""
"3777058","1","5669144","","2010-09-23 09:39:39","13","5673","<p>i would like to know which Certification Authorities are ""allowed"" on android..</p><p>Since i'm going to buy a ssl certificate i would like to understand if i'll get some problems in android using it.</p><p>Thanks</p>","314407","","","","","2013-12-07 12:11:12","List of trusted CA in android?","<android><ssl><https>","2","0","","",""
"3777162","1","","","2010-09-23 09:52:21","0","1690","<p>I've built an app for the UK only which uses the device ID to uniquely identify the device.  The app is only being added to specific handsets (not via the market) so the control of who has the app is quite high.</p><p>We're now getting the data back from the devices, and finding that some of the device IDs are hexadecimal and not purely digits (as IMEI should be).</p><p>Some of the data is returning absolutely correctly and some appears to be invalid hexadecimal.</p><p>Because some of the data is correct, is there any way that European devices can return MEID numbers or not, because that appears to be what is happening.</p><p>Code to return device id (with appropriate permissions included):</p><pre><code>{  tm = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);  return tm.getDeviceId();}</code></pre><p>Any ideas?</p>","456015","","12388","","2010-09-23 09:57:36","2010-09-23 09:58:30","getDeviceId() is returning a hexadecimal... why?","<android><telephony><imei>","1","0","","",""
"3777195","1","3777472","","2010-09-23 09:57:02","0","416","<p>i'm kinda new to programs which feature an mvc architecture and i want to get the right idea right up front...</p><p>i have this (android) application, where a thread (separate from the UI thread) computes some data. when finished, the results are written to a member of an object. now: how do i get the UI thread to ""realize"" that there has been an update (i.e., that the UI thread has to redo the screen output).</p><p>the most obvious way - to run an endless loop in the UI thread that checks in every loop if there has been an update - is pretty lame. so how do i do this ""right""?</p><ul><li><p>should i use a handler, that is called by the computation thread every time new data is available. this handler would then trigger a function that redraws the UI.</p></li><li><p>should i use wait() and notify() for the UI thread to be made aware of the fact that there is new data available?</p></li></ul><p>i'm a bit lost here. although i know the basics of these concepts, i dont know which one is the ""best"" one to use here...</p><p>EDIT: to clarify:</p><p>i have a class A (which is an android Activity) and a class B which is instantiated by A. This class B has a member variable X and runs a thread, that computes the value of X. when the thread finishes, it sends a message (with the computed value) to a handler of B. this handler then sets the value of X.now: since B stores no reference of A, how do i ""notify"" A that there has been a change of the value of X? do i send another message object which is ""caught"" by a handler in class A?</p>","370969","","370969","","2010-09-23 10:45:34","2010-09-24 12:22:36","how to get the mvc right on android?","<java><android><multithreading><user-interface>","3","0","","",""
"3777253","1","","","2010-09-23 10:06:01","0","239","<p>Can any one tell me in detail : <br>what is mean by ""ContactsContract.CommonDataKinds.Nickname.CONTENT_ITEM_TYPE "". <br>In Android documentation it was given as ""MIME type used when storing this in data table."" <br>Does MIMETYPE in thi context mean ""string "" value ?</p>","429501","","","","","2010-09-23 13:27:26","what does ""ContactsContract.CommonDataKinds.Nickname.CONTENT_ITEM_TYPE "" mean for nick name?","<android>","1","0","","",""
"3777484","1","4042240","","2010-09-23 10:37:02","0","224","<p>I have an itemizedOverlay extended and I want to increase the hit detection on the OverLayItem's if this is possible?</p>","103999","","","","","2010-10-28 11:04:09","Increase Hit detection on ItemizedOverlay","<android><itemizedoverlay><overlayitem>","1","0","","",""
"3777531","1","","","2010-09-23 10:44:50","2","1021","<p>I have been searching for getting some solution using which I can easily get precise information regarding -</p><p>1) Youtube Most Viewed Videos2) Youtube Most Rated Videos3) Youtube Search</p><p>I know that this can be done with ease using gdata-java-client.</p><p>But, my requirement is that, I need to get the aforesaid three details using Google API Client Library for Java (http://code.google.com/p/google-api-java-client/)</p><p>Any help which can provide valuable information/ code which will help me get the youtube data precisely, will be well appreciated.</p><p>Looking forward for your valuable help, comments, suggestions,</p><p>Regards,Rony</p>","456066","","","","","2011-09-12 04:48:38","Retrieve Youtube most viewed, most rated video details using - Google API Client Library for Java","<java><android><google-api-java-client>","1","0","","",""
"3777596","1","3944857","","2010-09-23 10:55:40","1","3859","<p>I would like to know how could i block the dial, home , back and the end call button on an android device.</p><p>I know this is possible because there is an application : TheftAware which does block all the buttons so they have no effect at all.</p><p>And I also would like to know how to make a dialog window or any kind of window which would stay on top no matter what (this is also done in theftaware).</p><p>They are also able to block(hide) the call screen... does someone know how are they doing that ?</p><p>Note: Does all this means that android is not that secure after all ?</p>","1205130","","","","","2012-04-19 09:21:49","How to Block the Dial, Home, Back and End Call button on Android","<android>","4","2","1","",""
"3777606","1","","","2010-09-23 10:56:23","0","130","<p>how to create a class which not extended Activity &amp; how can i use it class?</p>","493397","","","","","2010-09-23 10:59:31","android non activity","<android>","1","0","","",""
"3777637","1","3778842","","2010-09-23 11:01:08","5","1519","<p>What is a widget in android?Can I develop a widget for my app? </p>","371301","","","","","2014-02-21 12:23:02","What is a widget in Android?","<android><widget>","3","0","","",""
"3777798","1","3777834","","2010-09-23 11:24:31","1","287","<p>New to Android before I port my application to this platform I wanted to know the lay of the land as far as restricted API's by each carrier.</p><p>With J2ME (Nextel aside) there was very little you could do (except pony up some serious cash) to get the carrier to allow you to access restricted API's.</p><p>With Blackberry things got much better, other than Verizon locking down GPS, you pay the developer fee of $99 and you can sign your apps.</p><p>Now Android, do we have free reign, or are the handcuffs put on us here????</p>","446347","","491044","","2011-03-10 15:15:46","2011-03-10 15:15:46","Android restricted API's by carrier?","<android>","1","0","1","",""
"3777999","1","3778030","","2010-09-23 11:47:21","2","646","<p>Howdy,I wrote an application using the Android 2.2 SDK (API level 8). It is running well in the emulator, but now I want it to be compatible to Android 1.5+ (API level 3)or Android 1.6+ (API level 4).</p><p>The problem is that it crashes in the emulator when I try to run it on these versions.</p><p>What is a good approach to make it compatible to these versions? Is there a way to see which classes/methods cause these incompatibility issues?</p>","453895","","","","","2010-09-23 11:49:39","Making 2.2 Android Application compatible for 1.5+","<android><version>","1","0","1","",""
"3778048","1","3778797","","2010-09-23 11:53:00","4","4841","<p>I am using intent for send email with attachment,it is work fine,i want to get this email intent result,i already used <code>startActivityforResult()</code>,but i can't get result for email intent,how can we use <code>startActivityforResult()</code> for Email intent?</p><p>Thanks All</p>","410757","","302328","","2010-09-23 13:45:13","2012-11-04 05:34:42","how can we use startActivityforResult() for Email intent?","<android><android-intent>","2","0","","",""
"3778117","1","","","2010-09-23 12:00:51","1","1785","<p>I seem to have some problems with my resource folder - Android chooses the wrong resource folder.</p><p>When in design mode, in the layout editor, I have the option to choose between different devices, to look at my design in different screen resolutions. I have specified three different devices, one for each resolution.The mdpi and hdpi shows the resources from the right folder, but when choosing my device with ldpi, it shows the resources from mdpi - which is wrong.</p><p><strong>The settings for ldpi device is:</strong></p><p>Small, Not Long, Portrait, Low Density, Finger, Soft, No Keys, Trackball, 320x240</p><p>When I run the program I get an InflateException , because it cannot find the right resources for my imageview in my layout: android:src=""@drawable/psbgtop""</p><p><strong>This is my res folder:</strong></p><ul><li>res/drawable-hdpi/icon.png</li><li>res/drawable-hdpi/psbgbottom.png</li><li>res/drawable-hdpi/psbgtop.png</li><li>res/drawable-ldpi/icon.png</li><li>res/drawable-ldpi/psbgbottom.png</li><li>res/drawable-ldpi/psbgtop.png</li><li>res/drawable-mdpi/icon.png</li><li>res/drawable-mdpi/psbgbottom.png</li><li>res/drawable-mdpi/psbgtop.png</li><li>res/layout/main.xml</li><li>res/layout/settings.xml</li><li>res/layout/settings2.xml</li><li>res/layout/synchronize.xml</li><li>res/values/strings.xml</li><li>res/xml/preferences.xml</li></ul><p>Can anyone figure out, why my folder structure seems to be wrong?</p><p>Best regardsFrederik</p>","392642","","","","","2010-09-26 15:49:04","Android picks wrong resource folder","<android><layout><resources>","3","1","","",""
"3778190","1","3780185","","2010-09-23 12:09:45","0","277","<p>The question is quite simple ""How do I remove the titlebar from a WebView, after adding content ? Normally you use <code>requestWindowFeature(Window.FEATURE_NO_TITLE);</code> But you can only use that method before adding content :(</p><p>So any ideas ? :)</p><p>Thanks</p>","453562","","453562","","2010-09-23 12:24:51","2010-09-23 15:55:24","Removing the Window titlebar after adding content [Android]","<java><android><android-webview>","1","0","","",""
"3778207","1","","","2010-09-23 12:12:16","0","660","<p>hi Can anyone tell me is there a way to monitor outgoing sms...i want to create an app which will monitor outgoing sms and block texting in a particular region or when user is driving...can anyone tell me how it is possible?</p>","450601","","","","","2013-06-13 19:56:05","monitor outgoing sms","<android>","2","1","","",""
"3778256","1","","","2010-09-23 12:19:04","3","2713","<p>I want to write testcases for my android application using JUnit.And I faced some problems.</p><p>Is it possible to check that activity displays some dialog at current moment?Here is a small piece of my test application:</p><pre><code>    ...    Instrumentation instr = getInstrumentation();    monitor = instr.addMonitor(MainActivity.class.getName(), null, false);    /* Click on login button */    TouchUtils.clickView(this, mLoginButton);    /* wait MainActivity */    mMainActivity = instr.waitForMonitorWithTimeout(monitor, 3);    assertNotNull(mMainActivity);     /* Here a want to check that progress dialog displayed on mMainActivity */</code></pre><p>Thanks in advance!</p>","456143","","456143","","2010-09-23 14:24:28","2011-05-02 22:13:27","How to check that activity displays dialog during android unit testing","<android><unit-testing><testing><junit>","1","0","1","",""
"3778401","1","3778416","","2010-09-23 12:35:58","0","1011","<p>How can I make my button's size to increase slightly when it is pressed and decrease again when it is released? This is for highlighting the pressed button, by using size in addition to a different color.</p><p>Regards,Kiki</p>","454660","","319618","","2010-09-24 15:55:32","2012-10-05 08:02:09","To increase a button's size when it is pressed in Android","<android><button><size><pressed>","2","0","1","",""
"3778489","1","5091315","","2010-09-23 12:46:56","3","1627","<p>i want to remove notification when SMS comes in general inbox. is it possible... if yes then how... i got many site where is metion this is not possible through code... </p>","304961","","","","","2011-02-23 13:06:53","Android sms notification","<android>","2","0","4","",""
"3778676","1","3779102","","2010-09-23 13:10:15","3","646","<p>I am developing an app for android mobiles that communicates with a json/rest web service. I need to make certain kinds of calls periodically to the server to check for some information.Within that context I might need also to query the GPS for the current position. I'm quite undecided to use a Local Service, since I don't know very well how to deal with them, in fact I need to retrieve those data periodically and refresh a MapView accordingly. I heard that I can use PendingIntents,in the service, associate this data as a payload and send them to a broadcast receiver which unpack the data and refresh the UI, I heard also that this is a bad design approach because of what broadcast receiver are intended to be used for.does anybody have some useful hints?</p>","201058","","","","","2011-01-25 23:24:01","Design approach: android and web service","<android><web-services><rest>","1","1","2","",""
"3778875","1","","","2010-09-23 13:32:58","2","4039","<p>XML Code is</p><pre><code>  &lt;?xml version=""1.0"" encoding=""UTF-8"" ?&gt;   &lt;opml version=""1""&gt;  &lt;head&gt;  &lt;title&gt;Radio&lt;/title&gt;   &lt;status&gt;200&lt;/status&gt;   &lt;/head&gt;  &lt;body&gt;  &lt;outline type=""link"" text=""Local"" URL=""http://..............."" key=""local"" /&gt;   &lt;outline type=""link"" text=""Music"" URL=""http://.............."" key=""music"" /&gt;   &lt;outline type=""link"" text=""walk"" URL=""http://...................."" key=""walk"" /&gt;   &lt;outline type=""link"" text=""Sports"" URL=""http://..........."" key=""sports"" /&gt;   &lt;outline type=""link"" text=""Place"" URL=""http://..............."" key=""Place"" /&gt;   &lt;outline type=""link"" text=""Verbal"" URL=""http://............."" key=""Verbal"" /&gt;   &lt;outline type=""link"" text=""Podcasts"" URL=""http://....................."" key=""podcast"" /&gt;   &lt;/body&gt;  &lt;/opml&gt;</code></pre>","456213","","604156","","2012-07-29 10:50:41","2012-11-09 17:15:19","SAX XML Parsing in android","<java><android><xml><parsing><sax>","3","0","","","2010-09-24 05:24:57"
"3778960","1","3794348","","2010-09-23 13:41:26","1","2728","<p>Thank you for reading my post:</p><p>I had C2DM working perfectly in my application.  To test a different scenario I unregistered my phone so that it would not receive pushes anymore, and then I re-registered my phone.  Since I have re-registered push does not work.  </p><p>Here are the steps I'm experiencing:</p><ol><li>My phone receives a registration_id with no erros</li><li>I do a post to Google with my registration_id within a few minutes of receiving the id</li><li>I get a response of Error=NotRegistered</li></ol><p>I don't see anything strange in LogCat during this process.  I'm at a loss and any help is much appreciated.</p><p>Thank you,Matt</p>","274817","","","","","2010-09-25 15:16:19","Android C2DM getting NotRegistered response","<android><android-c2dm>","1","1","","",""
"3779119","1","3781150","","2010-09-23 13:57:24","0","198","<p>I am creating an widget application and would like to send random ""words of encouragement"" to the user.  Something like positive affirmations would appear in the notification area, but not due to a user action, but rather a random action internal.  I would grab a ""words of encouragement"" randomly from a database full of quotes. </p><p>Not sure how clear this is, but if it is to someone and they can point me in the right direction...greatly appreciated.</p>","2186261","","","","","2010-09-24 14:12:04","Random Notifications Android","<android>","1","5","","",""
"3779173","1","3785971","","2010-09-23 14:02:48","33","31957","<p>I am trying to apply an animation to a view in my Android app after my activity is created.  To do this, I need to determine the current size of the view, and then set up an animation to scale from the current size to the new size.  This part must be done at runtime, since the view scales to different sizes depending on input from the user.  My layout is defined in XML.</p><p>This seems like an easy task, and there are lots of SO questions regarding this though none which solved my problem, obviously.  So perhaps I am missing something obvious.  I get a handle to my view by:</p><pre><code>ImageView myView = (ImageView)getWindow().findViewById(R.id.MyViewID);</code></pre><p>This works fine, but when calling <code>getWidth()</code>, <code>getHeight()</code>, <code>getMeasuredWidth()</code>, <code>getLayoutParams().width</code>, etc., they all return 0.  I have also tried manually calling <code>measure()</code> on the view followed by a call to <code>getMeasuredWidth()</code>, but that has no effect.</p><p>I have tried calling these methods and inspecting the object in the debugger in my activity's <code>onCreate()</code> and in <code>onPostCreate()</code>.  How can I figure out the exact dimensions of this view at runtime?</p>","14302","","","","","2014-01-27 06:01:36","Determining the size of an Android view at runtime","<android>","7","2","18","",""
"3779382","1","3782861","","2010-09-23 14:23:09","2","2904","<p>I am trying to send a pdf as an attachment from Android. Here is the code:</p><pre><code>String[] mailto = {""me@gmail.com""};Uri uri = Uri.parse(""android.resource://com.mywebsite.sendemail/raw/mypdf"");Intent emailIntent = new Intent(Intent.ACTION_SEND);emailIntent.putExtra(Intent.EXTRA_EMAIL, mailto);emailIntent.putExtra(Intent.EXTRA_SUBJECT, ""My Subject"");emailIntent.putExtra(Intent.EXTRA_TEXT, ""My Body"");emailIntent.setType(""application/pdf"");emailIntent.putExtra(Intent.EXTRA_STREAM, uri);startActivity(Intent.createChooser(emailIntent, ""Send email using:""));</code></pre><p>Now this works but the problem is that the attachment is called mypdf instead of mypdf.pdf. I cannot figure out how to send it with it's extension... That's what I need help with. Thanks.</p>","125615","","125615","","2010-09-23 14:33:23","2010-12-09 22:08:34","How to add .pdf extension when sending an attachment from Android?","<android><email><attachment>","2","0","4","",""
"3779383","1","","","2010-09-23 14:23:20","1","471","<p>I want to be able to add custom attributes to the Manifest.mf file that is created when I build and sign my APK file using Eclipse.  By default, I see in the source that the addDigestsToManfest() method of SignApk adds the two standard main attributes in the code:</p><p>main.putValue(""Manifest-Version"", ""1.0"");main.putValue(""Created-By"", ""1.0 (Android SignApk)"");</p><p>However, I can't figure out anyway in the Eclipse project to tell it to add additional attributes which I can use as custom metadata when interrogating the apk file programatically:</p><p>jar.getManifest().getMainAttributes().entrySet();</p><p>I'm sure this can be accomplished in an ANT task, but I really have my mind set on being able to do it using the Eclipse ADT plugin, and it seems like there should be some way of pointing to some additional metadata that should be inserted into the manifest.mf file.</p><p>Thanks in advance for any help</p>","456267","","","","","2010-09-23 14:23:20","Adding custom Main Attributes to Manifest.mf in APK for Android using Eclipse ADT","<android>","0","0","","",""
"3779457","1","","","2010-09-23 14:30:38","0","1194","<p>Does anybody know the relationship between the members of an Android Itemized Overlay list and when draw() is called.  Specifically, I'm trying to find out if draw is called once for each Overlay or once only for the whole set.</p><p>Thanks,R.</p>","453989","","","","","2012-04-18 18:10:06","Android ItemizedOverlay draw method question","<android><google-maps><draw><itemizedoverlay>","3","0","","",""
"3779554","1","3780485","","2010-09-23 14:42:10","3","535","<p>Hai friends,            I have a doubt now,</p><blockquote>  <ol>  <li><p>Has Android really replaced J2ME and  WML?</p></li>  <li><p>If Android has replaced these, then  please tell me, what is the reason for  that?</p></li>  <li><p>How Android has replaced the other two  mentioned above and  </p></li>  <li>what is the  reason that J2ME and WML cannot  withstand against Android in market?</li>  </ol></blockquote>","424413","","457982","","2010-12-22 01:39:16","2010-12-22 01:39:16","Why we are going for Android since we already have J2ME and WML for creating Mobile Applications?","<java><android><java-me><wml>","3","1","","","2010-09-23 17:32:18"
"3779571","1","4178007","","2010-09-23 14:44:57","0","1132","<p>I need to put a Notification in the Status bar while my app is running, but I don't want it to call back to my Activity if selected.  Its meant to just be info to the user that the app is running - basically a reminder in case they press the home button and minimize it.</p><p>Ideas?</p>","418714","","","","","2012-07-26 06:36:21","Possible to make an Android Notification that does not call an Intent?","<android><android-notifications>","3","3","","2013-04-22 06:22:25",""
"3779572","1","","","2010-09-23 14:45:01","18","5121","<p>How should I make the choice ? What are the parameters I should take into account ?</p>","456301","","","","","2012-02-04 19:39:20","What version of Android should I develop for?","<android><versions><google-play>","7","3","4","",""
"3779589","1","3789151","","2010-09-23 14:47:09","0","1473","<p>I have the following code in my application in res/xml/preferences.xml:</p><hr><pre><code>&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;PreferenceCategory android:title=""Wi-Fi settings""&gt;   &lt;EditTextPreference            android:key=""pref_voice_threshold_top""            android:title=""@string/title_pref_voicetopthreshold""            android:dialogTitle=""@string/dialog_title_pref_voicetopthreshold""             android:defaultValue=""20""            android:inputType=""number""/&gt;&lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><hr><p>And I was wondering is it possible for me to then use this preference in code so I can update it via downloading an xml file?</p><p>So I currently display the above preference in a PreferenceActivity, which works fine, however I want to be able to update the setting by downloading a new setting every week from the internet.</p><p>So my question is how do I open this preference in code and set its value to the new downloaded value?</p>","243999","","","","","2010-09-24 16:39:39","Android how to get specific preference?","<android><xml><android-preferences><preference>","2","0","","",""
"3779602","1","3780324","","2010-09-23 14:48:28","0","744","<p>I have GridView and I want to be able to switch between adapters.</p><p>Context:</p><p>I have data from two separate sources and I want to be able to easily switch between those.</p><p>Is it possible to just switch adapters or there is other solution?</p>","296427","","","","","2010-09-23 16:09:17","Switching adapters in GridView?","<android><gridview><listadapter>","1","0","","",""
"3779615","1","","","2010-09-23 14:50:05","2","1120","<p>My user can flick through a set of records. I save the last seen record _ID in Preferences, so that they can start off from where they left when they access the application next time.</p><p>The cursor that I have extracts _ID field too. However, I don't know how to move cursor to that particular row. The following functions of the cursor need a specific postion to go to :-  </p><p><em>moveToPosition(int position)<br>move(int offset)</em> </p><p>The _ID may not be sequential (due to deletes etc).</p><p>Any way to do this?</p>","289918","","","","","2012-04-10 16:21:24","Moving cursor position to a certain ID","<sql><android>","2","0","2","",""
"3779709","1","3779802","","2010-09-23 15:00:35","0","9465","<p>I'd like to extend Application in my Android app.  I've done this such that I've created an extended Application object called MyApplication and added it to the manifest.</p><p>I'd now like to add some getters and setters to hold some information.  It looks like I'll need to pass the application Context to any classes which do not contain a Context.</p><p>For example, say I create a class called MyObject (in its own java file):</p><pre><code>public class MyObject {  public void doStuff() {    // do stuff  }}</code></pre><p>How might I access MyApplication from doStuff()?  It looks like I'll need to pass the application Context to MyObject.  Is this typical?  Is there a possibility of leaks?</p><p>Also, to make sure I'm clear, will MyApplication (and the variables within) live throughout the application's lifecycle, or not?  Either way is fine.  I just want to make sure I account for this if I need to.</p><p>And lastly, any links to some example source to show what different things extending Application is useful for would be appreciated.</p>","406790","","406790","","2010-09-23 15:08:19","2010-09-23 15:52:44","Extending Application","<android><context><extend>","2","0","","",""
"3779789","1","7268695","","2010-09-23 15:12:29","8","11184","<p>In my app I'm making a basic HTML help document.I wanted my app's logo in the HTML img tag itself, but I don't know how I'd reference to the logo which will be stored in assets.</p><p>Is this possible, if so how?</p><p>Thanks for the help!</p>","427234","","427234","","2010-09-23 15:27:27","2014-03-13 05:28:13","Android Development: Using Image From Assets In A WebView's HTML","<android><image><webview><local>","5","3","1","",""
"3779879","1","","","2010-09-23 15:21:39","1","1167","<p>I have a gray gradient drawable (png image in res/drawable). If I draw it on a white Canvas it looks banded (not smooth). If I put the gradient on white background in GIMP, and then draw this drawable on the Canvas, it looks great. What's the problem? I tested this on Nexus One. Calling setDither(true) on the drawable has no noticable effect.</p>","243225","","","","","2010-09-23 18:40:11","Gradient drawn on Canvas looks banded","<android><drawable>","2","0","1","",""
"3779944","1","3779985","","2010-09-23 15:30:51","12","23635","<p>how to read a specific file from sdcard. i have pushed the file in sdcard through DDMS and i am trying to read it though this way but this give me exception. can anybody tell me how to point exactly on that file?</p><p>my code is this.</p><pre><code>String path = Environment.getExternalStorageDirectory().getAbsolutePath();FileInputStream iStream =  new FileInputStream(path);</code></pre>","397901","","244296","","2010-09-24 05:05:38","2012-03-18 09:08:42","reading a specific file from sdcard in android","<android><file><android-sdcard>","1","0","7","",""
"3780001","1","3780201","","2010-09-23 15:37:49","2","5138","<p>I am creating my SQLite database for my App at runtime if it does not exist and insert rows if it does. Since it is supposed to be created at runtime and I have implemented it by creating a subclass of SQLiteOpenHelper and overriding the onCreate() method - </p><p>""Do I need to put anything in the /assets folder of my project?""</p><p>I am not using any Content Provider ""Do I need to add any tags in the AndroidManifest.xml?""</p><p>Here is what I have done. The strings have been defined properly and I do not get any runtime exceptions.</p><p>Implementation of the SQLiteOpenHelper subclass.</p><pre><code>public class MyDB extends SQLiteOpenHelper {                   public MyDB(Context context) {                    super(context, DATABASE_NAME, null,  DATABASE_VERSION );                   }                @Override                public void onCreate(SQLiteDatabase db) {                db.execSQL(USERAUTH_TABLE_CREATE);                db.execSQL(USERPREF_TABLE_CREATE);                 }                @Override                public void onUpgrade(SQLiteDatabase db, int oldVersion, int                 newVersion) {                    Log.w(""Example"", ""Upgrading database, this will drop tables and                    recreate."");                    db.execSQL(""DROP TABLE IF EXISTS "" +  USERAUTH_TABLE_NAME);                    db.execSQL(""DROP TABLE IF EXISTS "" +  USERPREF_TABLE_NAME);                    onCreate(db);               }</code></pre><p>}</p><p>Here is where I create an instance of the MyDB subclass of the SQLiteOpenHelper.</p><pre><code>MyDB tdb = new MyDB(Activity.this); SQLiteDatabase db = tdb.getReadableDatabase();</code></pre><p>Everything runs and when I go to the sqlite shell and write the following query</p><p>select * from table_name - it just tells me no such record exist. I set breakpoints and it seems after the getReadableDatabase() is called the @Override OnCreate() method is never executed which is where I execute the Create table SQLs. I have tried getWritableDatabase()as well. </p><p>I dont understand why the tables are not being created. If anyone can help that would be awesome.</p><p>Thanks.</p><p>Query Text String#1</p><p>private static final String USERAUTH_TABLE_CREATE =      ""CREATE TABLE "" + USERAUTH_TABLE_NAME + "" ("" +     ""number INTEGER NOT NULL,"" +     ""dip TEXT NOT NULL,"" +     ""email TEXT NOT NULL,"" +     ""password TEXT NOT NULL,"" +     ""flag INTEGER"" + "");"" ;</p><p>Query Text String #2</p><pre><code>private static final String USERPREF_TABLE_CREATE =  ""CREATE TABLE "" + USERPREF_TABLE_NAME + "" ("" + ""tpd TEXT NOT NULL ,"" + ""cat TEXT NOT NULL"" + "");"";</code></pre>","447886","","447886","","2011-11-02 20:42:41","2012-07-30 20:37:35","SQLite Database creation for Android App","<android><sqlite>","5","3","0","",""
"3780062","1","","","2010-09-23 15:43:46","0","67","<p>On which Android version can I start using the geolocation feature for an application I develop?</p>","456301","","","","","2010-09-23 16:05:52","On which Android version can I start using the geolocation feature for an application I develop?","<android><geolocation><version>","1","0","","",""
"3780348","1","","","2010-09-23 16:11:48","1","177","<p>My application uses thumbnails downloaded from the internet. The thumbnails are generated by the server, and one specifies in the request what size the thumbnails should be. Is there a way for me to know, programmatically, while inside a ListAdapter's getView(), the dimensions of an ImageView inside the View that is returned, so my thumbnail comes perfectly scaled? I can always hardcode it, but I'd prefer not to. </p><p>Alternatively, is there some sort of listener or callback I can use to request the thumb once the View has been laid out? </p><p>EDIT: The ImageViews have fixed layout_height and layout_width, however, I'd want to reuse the same code for different parts of the app, which use different size images, which is why hardcoding is particularly bad. </p>","378158","","","","","2012-10-26 18:21:47","Android: Knowing ahead of time what size an ImageView will be?","<android><image><thumbnails><imageview>","1","0","","",""
"3780382","1","4451644","","2010-09-23 16:15:23","3","5131","<p>I am trying to increase the gain of the mic of an android phone so that it will be capable of hearing very minute sounds.Is it possible? Can you please help me with this.</p>","431092","","21234","","2010-12-08 11:33:48","2010-12-15 15:30:40","Can we Increase the gain of mic of an android phone?","<android><audio>","1","3","3","",""
"3780456","1","3780934","","2010-09-23 16:23:36","0","1245","<p>is it possible to populate a listview based on a row Id from a custom cursor adapter. I keep getting an error ""illegalArguementException column: _id does not exist"". but the database has it and is already being used correctly. I don't know what to do, because I would need to populate different listviews from the same database and i don't want to have to create multiple database which will still have the same column names. Any ideas will be greatly appreciated. thanks</p><p>HERE is the database code is being cold:</p><pre><code>public Cursor retrieveItemRow(long Id){        open();String[] Columns = new String[] {TITLE,DATE, TIME};Cursor row = db.query(true,DATABASE_TABLE, Columns, KEY_ID +""="" +Id, null, null, null, null,null);    if(row != null){    row.moveToNext();    return row;    }    return row;      }</code></pre><p>Here is a method i am trying to call it in:</p><pre><code> public void fillRowData(long Id) {Cursor cursor = adapter.retrieveRow(id);startManagingCursor(cursor);String[] from = new String[]{DBAdapter.TITLE, DBAdapter.DATE, DBAdapter.TIME};int[] to = new int[]{R.id.Name, R.id.Date, R.id.Time};customCursor items = new customCursor(this, R.layout.viewlist, cursor, from, to);setListAdapter(items);          }</code></pre>","447570","","447570","","2010-09-23 19:26:39","2012-03-24 11:09:00","possible to populate list view from cursor row id?","<android>","1","0","","",""
"3780508","1","3780528","","2010-09-23 16:30:02","0","187","<p>Is there something like a an Android file explorer so that the application could be installed from an SD card on versions older than 2.2 if the signed .apk file was manually copied onto the SD card? (Kind of like installing from a web page.)</p>","398460","","","","","2010-09-23 16:37:47","Can an android application be loaded from the SD card?","<android>","2","0","","",""
"3780545","1","","","2010-09-23 16:33:57","0","656","<p>I'm making a image gallery with infinite vertical and horizontal scrolling. I put images inside a ListView to make a column, and put the ListViews inside a TableRow. However, it seems that child views of TableRow is not selectable and as a result I can't select the images in my ListView (easily). Is there a way to pass the events down to child views of TableRow so they can be selectable? </p>","436323","","","","","2010-09-23 16:59:04","How to make children of TableRow selectable","<android><android-widget>","1","0","","",""
"3780566","1","3780736","","2010-09-23 16:37:05","0","49","<p>I have created a tabbed view with four tabs and attached four listviews to the tabs.  I have created separate classes with the list views in them and I now want to add a activity to the list view</p><pre><code>public class l2 extends ListActivity {/** Called when the activity is first created. */public void onCreate(Bundle icicle) {    super.onCreate(icicle);    // Create an array of Strings, that will be put to our ListActivity    String[] names = new String[] { ""Accrington Stanley"", ""Aldershot Town"", ""Barnet"", ""Bradford City"", ""Burton Albion"", ""Bury"", ""Cheltenham Town"", ""Chesterfield"", ""Crewe A"", ""Gillingham"", ""Hereford Utd"", ""Lincoln City"", ""Macclesfield T"", ""Morecombe"", ""Northampton T"", ""Oxford Utd"", ""Port Vale"", ""Rotherham Utd"", ""Shrewsbury T"", ""Southend Utd"", ""Stevenage"", ""Stockport C"", ""Torquay Utd"", ""Wycombe W""};    // Create an ArrayAdapter, that will actually make the Strings above    // appear in the ListView    this.setListAdapter(new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_checked, names));}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    names = new intent().setClass(this, Bradford.class);    // Get the item that was clicked    Object o = this.getListAdapter().getItem(position);    String keyword = o.toString();    Toast.makeText(this, ""You selected: "" + keyword, Toast.LENGTH_LONG)            .show();</code></pre><p>}</p><p>I have 24 teams in the listview and I have created a class for each one, but how can I make it so that when the user selects the team in the list it goes to the class in question i.e bury,bradfdord accrington ect.......?</p><p>What method should I use  and how do I implement it.Thanks in Advance</p>","445174","","","","","2010-09-23 16:57:49","Method for changing classes in Listview","<java><android><eclipse>","1","0","","",""
"3780576","1","","","2010-09-23 16:38:13","3","1929","<p>I'm trying to display a large (~> 1000x1000) image in a <code>WebView</code>.  The image is in the assets folder.  The problem is the image doesn't get loaded, instead I see the small blue square with a question mark (presumably meaning the image could not be loaded).  I made a copy of the image and resized it to ~500x500.  I'm loading both the original and resized images and the resized one shows up fine. </p><p>This is the code I'm using.  <code>largeimage.jpg</code> is around 1500x1100 and <code>smallimage.jpg</code> is the same image resized to around 500x300.</p><pre><code>public void loadImages() {    final String mimeType = ""text/html"";    final String encoding = ""utf-8"";    final String html = ""&lt;img src=\""file:///android_asset/largeimage.jpg\"" /&gt;"" +     ""&lt;img src=\""file:///android_asset/smallimage.jpg\"" /&gt;"";    // webView is defined elsewhere    webView.loadDataWithBaseURL(""fake://not/needed"", html, mimeType, encoding, """");} </code></pre><p>The <code>WebView</code> has the small blue box question mark followed by the small image properly loaded.</p><p>Why does this happen?  Is there a resolution restriction to <code>WebView</code>?  Is there a file size restriction to Android?  I'm fairly new to Android so I may have overlooked a simple implied limitation somewhere.  If the problem is some sort of limit, can someone tell me what the maximum acceptable image size (both in resolution and file size) would be?</p>","316891","","810368","","2012-10-24 07:58:09","2012-10-24 07:58:09","Android WebView: Large local image not loaded/shown","<android><image><webview><android-webview>","0","2","","",""
"3780587","1","","","2010-09-23 16:39:21","0","867","<p>I am trying to create an SSL connection from android client to the server over SSL.In the very beginning I was always getting </p><p>javax.net.ssl.SSLHandshakeException: no cipher suites in common on the server </p><p>when connection was attempted.</p><p>After some investigation I realized that Android uses Bouncy Castle SSL implementation and the cipher suites there are different from those SUN provides. So I've added Bouncy Castle provider to the server. The original problem went away, but I now get </p><p>Exception in thread ""main"" javax.net.ssl.SSLHandshakeException: NO SERVER CERTIFICATE FOUND </p><p>I am not sure why I get this. I have generated the certificate. Granted I am using JKS to store it, but why would it matter? It's just a format of storage, the certificate should be exactly the same.</p><p>If anyone has done non HTTP client server programming on Android using SSL I would really appreciate any pointers on what I need to do.</p>","456420","","","","","2011-03-29 09:49:05","Android Client connecting to the Server over SSL","<java><android><ssl><sun>","1","2","","",""
"3780616","1","3780666","","2010-09-23 16:42:22","0","903","<p>I have a ImageView acting as a top banner on top of a webview. The image of this banner is created in execution time dependending on the resolution of the device. The height of the banner is always the same for each resolution. The only thing that changes is the width, which changes according to the orientation. But, since the width changes and the height doesn't, I end up having sort of 2 images with different proportion. And this is way the scale down/up won't work out for me.</p><p>Another problem is that everytime the user rotates the screen, the banner image is created again but Android seems not to update the image and thus I have a banner missing part of it.</p><p>I thought about having a real big image that will fit for both landscape and portrait orientation. But this seems not to be a good idea since Android keeps resizing the image everytime so it will fit on the space of the ImageView.</p><p>I'm running out of ideas here. Can someone suggest something?</p><p>Thanks,Rafael Ramos</p>","456425","","","","","2010-09-28 16:42:55","Preventing scale on bitmap created in execution time for ImageView - Android","<android><image><bitmap><imageview><scale>","1","0","","",""
"3781055","1","3997185","","2010-09-23 17:37:31","1","409","<p>Is there anything wrong with this XML? I don't get any compile time errors, but anytime I try to edit it, Eclipse gives me a nullpointerexception. Why?</p><p><strong>/res/values/styles.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;resources&gt;      &lt;!-- Base application theme is the default theme. --&gt;      &lt;style name=""Theme"" parent=""android:Theme""&gt;      &lt;/style&gt;      &lt;!-- Variation on our application theme that has a translucent     background. --&gt;      &lt;style name=""Theme.Translucent""&gt;        &lt;item name=""android:windowBackground""&gt;@drawable/translucent_background&lt;/item&gt;        &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;        &lt;item name=""android:colorForeground""&gt;#fff&lt;/item&gt;      &lt;/style&gt;      &lt;!-- Variation on our application theme that has a transparent    background; this example completely removes the background,    allowing the activity to decide how to composite. --&gt;      &lt;style name=""Theme.Transparent""&gt;        &lt;item name=""android:windowBackground""&gt;@drawable/transparent_background&lt;/item&gt;        &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;        &lt;item name=""android:colorForeground""&gt;#fff&lt;/item&gt;      &lt;/style&gt;      &lt;style name=""TextAppearance.Theme.PlainText"" parent=""android:TextAppearance.Theme""&gt;        &lt;item name=""android:textStyle""&gt;normal&lt;/item&gt;      &lt;/style&gt;    &lt;/resources&gt;</code></pre>","19875","","","","","2010-10-22 13:21:20","Problems defining my own Android theme","<android><xml><themes>","2","2","","",""
"3781089","1","3781172","","2010-09-23 17:41:24","0","2921","<p>I am trying to solve an issue sort of similar to what was done here (<a href=""http://stackoverflow.com/questions/3623704/how-to-control-activity-flow-back-button-versus-home-button"">link text</a>)</p><p>Except in my case where Activity A, started Activity B, started Activity C, when the user resumes the app after pressing the home button - I want C, the last Activity, to be displayed.  Instead what is happening is I am back to A.  </p><p>Also on a side note I have discovered that even when I exit the application, if I hold down the Home button, my app is still listed as an active app even though in the LogCat I can see that it exited OK.</p><p>Also, in case it matters, I did recently add <code>android:launchMode =""singleTask""</code> in order to make some notification logic work correctly.  I was seeing the Home button behavior before that though.</p><p>I really appreciate any ideas you might have.  </p><p>[edit - adding some code snippets]</p><pre><code>        &lt;activity               android:name         ="".connection.ActivityA""              android:label        =""@string/app_name""              android:configChanges=""orientation|keyboardHidden""              android:theme        =""@android:style/Theme.NoTitleBar""              android:launchMode   =""singleTask""              android:screenOrientation=""portrait"" &gt;        &lt;intent-filter&gt;            &lt;action android:name  =""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name         ="".screens.AvtivityB""              android:label        =""@string/app_name""              android:configChanges=""orientation|keyboardHidden""              android:theme        =""@android:style/Theme.NoTitleBar""              android:launchMode   =""singleTask""              android:screenOrientation=""portrait""  &gt;    &lt;/activity&gt;    &lt;activity android:name         ="".screens.ActivityC""              android:label        =""@string/app_name""              android:configChanges=""orientation|keyboardHidden""              android:theme        =""@android:style/Theme.NoTitleBar""              android:screenOrientation=""portrait"" &gt;    &lt;/activity&gt;</code></pre><p>Then here is how I kick off each Activity:In Activity A:</p><p>private void startActivityB()   {      Intent activityBIntent = new Intent(this, ActivityB.class);      this.startActivityForResult(activityBIntent , ACTIVITYB_TAG);   }</p><p>Activity B actually has several Activities that it chooses from (it has a list of Intents) to display based on input it receives but launches them all the same way as Activty A launched B.  Once the first Activity is displayed the user swipe the screen to navigate to the left or right screen.  When the user swipes left or right, the current activity puts info in its return Intent that Activity B uses to display the next Activity.  Also since logic outside of the user's control could prompt a change in the screen displayed, each Activty calls finish on itself in onStop to avoid back-button issues.</p>","418714","","418714","","2010-10-21 19:38:52","2011-07-13 14:11:58","Android Home button not resuming last Activity","<android>","3","0","2","",""
"3781097","1","3781179","","2010-09-23 17:41:35","0","672","<p>Been trying to call Preferences.java class using:</p><pre><code>Intent settingsActivity = new Intent(getBaseContext(), Preferences.class);startActivity(settingsActivity);</code></pre><p>I have this in my Manifest.xml (outside the main app class activity):</p><pre><code>&lt;application&gt;   ........    &lt;activity android:name="".Preferences"" android:label=""Preferences""&gt;      &lt;/activity&gt;    &lt;/application&gt;</code></pre><p>And I still get force close for ""android.content.ActivityNotFound..."" :</p><pre><code>E/AndroidRuntime(25644): FATAL EXCEPTION: mainE/AndroidRuntime(25644): android.content.ActivityNotFoundException: Unable to find explicit activity class {com./java.util.prefs.Preferences}; have you declared this activity in your AndroidManifest.xml?E/AndroidRuntime(25644):        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)E/AndroidRuntime(25644):        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)E/AndroidRuntime(25644):        at android.app.Activity.startActivityForResult(Activity.java:2817)E/AndroidRuntime(25644):        at android.app.Activity.startActivity(Activity.java:2923)E/AndroidRuntime(25644):        at com.droidil.droidmarks.Dmarks.onOptionsItemSelected(Dmarks.java:337)E/AndroidRuntime(25644):        at android.app.Activity.onMenuItemSelected(Activity.java:2195)E/AndroidRuntime(25644):        at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730)E/AndroidRuntime(25644):        at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)E/AndroidRuntime(25644):        at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)E/AndroidRuntime(25644):        at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)E/AndroidRuntime(25644):        at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)E/AndroidRuntime(25644):        at android.view.View$PerformClick.run(View.java:8818)E/AndroidRuntime(25644):        at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime(25644):        at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime(25644):        at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(25644):        at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(25644):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(25644):        at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(25644):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(25644):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(25644):        at dalvik.system.NativeStart.main(Native Method)</code></pre><p>No Compiling errors... just this Runtime error...Any ideas why it's force closing even though I have the Activity defined in the Manifest.xml?</p><p>Appreciate any help!</p>","444324","","444324","","2011-02-23 08:52:52","2011-02-23 08:52:52","Android: Force close when trying to call Preferences.java","<android><android-manifest><android-preferences>","2","0","","",""
"3781108","1","","","2010-09-23 17:44:08","3","459","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2617266/how-to-adjust-text-font-size-to-fit-textview"">How to adjust text font size to fit textview</a>  </p></blockquote><p>I am trying to create an app that has a simple textview displaying a count down. All the menus and such will be hidden under a long press or with the menu button.</p><p>I'm trying to find away to make the text in that text view automatically scale and take up the whole screen something like android:textSize=""100%""</p><p>Despite lots of search I can't seem to find an easy way to do this</p>","456465","","246246","","2012-04-06 17:56:32","2012-04-06 17:56:32","android full screen textview","<android><textview><fullscreen>","0","0","","2012-11-25 15:38:56",""
"3781151","1","","","2010-09-23 17:49:23","30","48493","<p>I have created and published my first android app. It's very simple. It works fine on simulator and some phones, but I am getting this error:</p><pre><code>java.lang.RuntimeException: Unable to instantiate application cz.teamnovak.droid.Novak ESC Track guide: java.lang.ClassNotFoundException: cz.teamnovak.droid.Novak ESC Track guide in loader dalvik.system.PathClassLoader[/data/app/cz.teamnovak.droid-1.apk]    at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:649)    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4232)    at android.app.ActivityThread.access$3000(ActivityThread.java:125)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:123)    at android.app.ActivityThread.main(ActivityThread.java:4627)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:521)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)    at dalvik.system.NativeStart.main(Native Method)Caused by: java.lang.ClassNotFoundException: cz.teamnovak.droid.Novak ESC Track guide in loader dalvik.system.PathClassLoader[/data/app/cz.teamnovak.droid-1.apk]    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)    at java.lang.ClassLoader.loadClass(ClassLoader.java:573)    at java.lang.ClassLoader.loadClass(ClassLoader.java:532)    at android.app.Instrumentation.newApplication(Instrumentation.java:942)    at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:644)    ... 11 more</code></pre><p>Any idea what can cause this?</p>","456475","","422597","","2010-09-23 18:06:37","2014-04-07 07:06:09","java.lang.ClassNotFoundException on working app","<android><classnotfoundexception>","21","4","7","",""
"3781182","1","","","2010-09-23 17:53:07","48","51609","<p>I have a very simple android project. I got the following errormessage when I try to run it. The emulator is running but theapplication doesn't come up. I couldn't find any useful informationonline. Can anyone help me?</p><pre><code>Warning: Activity not started, its current task has been brought to the front</code></pre><p></p><pre><code>public class Profile extends Activity {        /*Button button1;        CheckBox check1, check2;        EditText text1;*/        /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);     }}</code></pre><p>        </p><pre><code>&lt;EditText android:text=""@+id/EditText01"" android:id=""@+id/EditText01""android:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:enabled=""false""&gt;&lt;/EditText&gt;&lt;CheckBox android:text=""@+id/CheckBox03"" android:id=""@+id/CheckBox03"" android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;CheckBox android:text=""@+id/CheckBox02"" android:id=""@+id/CheckBox02""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;/CheckBox&gt;&lt;CheckBox android:text=""@+id/CheckBox01"" android:id=""@+id/CheckBox01""android:layout_width=""fill_parent""android:layout_height=""wrap_content"" android:checked=""true""&gt;&lt;/CheckBox&gt;&lt;/LinearLayout&gt;&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.seiservices.blending""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Profile""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;categoryandroid:name=""android.intent.category.LAUNCHER"" /&gt;                &lt;categoryandroid:name=""android.intent.category.DEFAULT"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;/manifest&gt; </code></pre>","422065","","12048","","2012-06-16 12:32:08","2014-04-02 15:20:22","Activity not started, its current task has been brought to the front","<android>","7","0","5","",""
"3781265","1","3781765","","2010-09-23 18:07:25","1","2293","<p>I'm trying to generate the MD5 Fingerprint I will use with the release of my application. I used Eclipse to Compile and Sign my application, which gave me a keystore file and a .apk file. Now i need to generate the MD5 for my MapViews. I tried using the cmd prompt to generate it, but everytime it states that no such file exists. Is there somewhere special i need to be storing the keystore so the keytool has access to it? Also, once i get the MD5 fingerprint, all i have to do is insert it and re-compile and sign my application (the same way i previously did it). Am i correct on that assumption? I've read through the developer docs and I'm still unclear on the whole process. Any help would be awesome. </p>","356615","","","","","2012-09-06 08:21:31","Trouble generating MD5 fingerprint with new keystore","<android><eclipse><md5><keytool>","1","0","","",""
"3781286","1","","","2010-09-23 18:10:03","0","696","<p>I am dynamically creating an Editext in my code. i want to position it in my x and y position in my code itself in an absolute layout.can anyone help me to do this.</p>","655814","","","","","2010-09-24 16:24:03","How to poistion edittext in program in android?","<android>","1","0","","",""
"3781363","1","3781416","","2010-09-23 18:21:51","3","2742","<p>The ic_menu_info icon is properly displayed in the xml menu item that calls it but not in this AlertDialog.</p><pre><code>new AlertDialog.Builder(this).setMessage(menuInfo).setNeutralButton(""OK"", new DialogInterface.OnClickListener() {  public void onClick(DialogInterface d, int i) {   // do nothing – it will close on its own  } }) .setIcon(R.drawable.ic_menu_info).show(); ...</code></pre>","398460","","398460","","2012-12-17 15:11:04","2012-12-17 15:11:04","Why doesn't this AlertDialog.Builder.setIcon show the ic_menu_info icon?","<android><alertdialog>","1","0","","",""
"3781506","1","3783073","","2010-09-23 18:43:09","2","1088","<p>Does android reuse views during a orientation change?I have a progress bar in my activity. I set the progress to 50%, and then do an orientation change. But for some reason, the progress bar maintain 50% after the orientation.  I have call setprogress(0) in the onCreate() of my activity. And I have put 'printf' in anywhere I call setProgress(), i don't still don't understand why the progress bar maintains 50% everytime I do an orientation change?</p><p>Thank you for any help.</p>","286802","","","","","2010-09-23 22:51:01","Does android reuse views during a orientation change","<android>","2","0","1","",""
"3781708","1","","","2010-09-23 19:07:36","0","606","<p>I have a simple application that uses the Android system service LOCATION_SERVICE. On app close I need the service to stop. I have searched hard and long for how to do this but I must not be looking for the right thing. Does anybody know how to stop this service? </p><p>Here is what I'm doing.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     private LocationManager lm;    private LocationListener locationListener;    lm = (LocationManager)         getSystemService(Context.LOCATION_SERVICE);        locationListener = new MyLocationListener();    lm.requestLocationUpdates(        LocationManager.GPS_PROVIDER,         0,         0,         locationListener);    ...}@Overrideprotected void onDestroy() {    lm.removeUpdates(locationListener);    super.onDestroy();}</code></pre><p>The LocationManager class does not seem to have any methods to stop the service. That's where I thought you would be able to close or stop it.</p><p>Thanks for any help.</p>","244101","","244101","","2010-09-23 19:50:12","2012-12-03 03:15:55","Cannot stop LOCATION_SERVICE","<android><gps>","2","6","0","",""
"3781721","1","3781998","","2010-09-23 19:10:10","0","3227","<p>Welp, smooth move on my part. I can't update any applications in the Market now because I accidentally deleted my android keystore. Does anyone know how I could get it back? I've tried running a recovery program, but for whatever reason it's not showing up. </p>","420015","","234938","","2010-09-23 19:42:59","2010-09-24 04:01:40","I accidentally deleted my android keystore, how do I get it back?","<android><key>","2","1","","",""
"3781751","1","3789127","","2010-09-23 19:14:16","7","6066","<p>I just switched over from iPhone to Android and am looking for something similar to where in the iPhone SDK, when a class finishes a certain task, it calls delegate methods in objects set as it's delegates.</p><p>I don't need too many details. I went through the docs and didn't find anything (the closest I got was ""broadcast intents"" which seem more like iOS notifications).</p><p>Even if someone can point me to the correct documentation, it would be great.</p><p>Thanks!</p>","392178","","","","","2014-04-11 15:11:42","Android - Anything similar to the iPhone SDK Delegate Callbacks?","<android><delegates><callback>","3","2","4","",""
"3781790","1","3781990","","2010-09-23 19:21:22","12","11905","<p>So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android.  I'd like to fix the size of my ImageView so that it only shows a portion of the image if it's larger than a preset amount.  I've tried everything I can think of setting the setMaxWidth/setMaxHeight, setting the scale type to centerCrop, using ClipableDrawable wrapping my BitmapDrawable, setting using Drawable.setBounds().  I've tried setting in the XML and programmatically, but neither worked.  I'm very surprised setting max width/height didn't do anything.  Below is the XML I'm using ImageView definition in my layout file:</p><pre><code>    &lt;ImageView android:id=""@+id/recipeImage""           android:maxHeight=""64px""           android:maxWidth=""64px""           android:scaleType=""centerCrop""           android:layout_width=""wrap_content""           android:layout_height=""fill_parent""           android:layout_alignParentTop=""true""           android:layout_alignParentBottom=""true""           android:layout_marginRight=""6dip""/&gt;</code></pre><p>Nothing has worked.  Oooooouweee What up with dat? :-)</p>","155020","","","","","2010-09-23 19:47:18","How do I make my ImageView a fixed size regardless of the size of the bitmap","<java><android><bitmap><imageview>","1","0","2","",""
"3781885","1","","","2010-09-23 19:34:45","1","1786","<p>I am working on an application in which I need the user to set an array of 30 values and to make it user friendly and easy to use I have decided to use a series of SeekBars and EditText widgets. I am using eclipse and have used it to set up the layout.</p><p>I am looking for an efficient way to set up the application to automaticaly update the value of the SeekBar when the value of the EditText has been changed and then use that same value in a application integer array.<pre><code></p><p><code>&lt;SeekBar android:layout_height=""wrap_content""         android:layout_width=""wrap_content""         android:max=""255""         android:layout_gravity=""center_vertical""         android:layout_weight=""1""         android:padding=""10dp""         android:id=""@+id/seekX""&gt;&lt;/SeekBar&gt;&lt;EditText android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_weight="".01""          android:minWidth=""50sp""          android:maxWidth=""50sp""          android:gravity=""center_horizontal""          android:padding=""10dp""          android:layout_marginRight=""10dp""          android:inputType=""number""          android:id=""@+id/editX""&gt;&lt;/EditText&gt;</code></pre></code>The seek bars and EditText fields are named in a coresponding way editX should match seekX as editY should match seekY and so on. I am also storing the values in the int[] upgradeValues.  </p><p>I have also set the SeekBar to have a max of 255 but i need a way to automatically change any value set in the EditText field above 255 down to 255 and similarly any value below 0 to 0.  </p><p>Basicaly I need an efficient way of making ""(ValueOF)seekX = (ValueOf)editX = (ValueOf)upgradeValues[x] >= 0 &lt;= 255"" and be updated if seekX or editX is changed.</p><p>Any help you can offer would be great, thank you.</p>","456575","","","","","2011-04-01 19:30:40","Seekbars and EditTexts","<android><edittext><editable><seekbar>","1","0","","",""
"3781918","1","","","2010-09-23 19:37:54","2","798","<p>Most apps use ZXing, but all examples of ZXing I've seen use a dedicated full screen activity (whether via intent request or embedded Activity class).  Are there other bar code scanning libraries that encapsulate the barcode scanning in a View object?</p><p>If not, what are the components of ZXing I need to extract and/or rebuild?  Can I reuse the CameraManager in my own SurfaceView?  The CaptureActivity does not seem very modular for reuse.</p>","152543","","","","","2010-11-07 13:54:18","Android: Barcode scanning library in a UI View?","<android><barcode-scanner>","1","1","1","",""
"3781969","1","3782140","","2010-09-23 19:44:44","1","289","<p>I have a normal notification system that looks like this:</p><pre><code>Notification notification new Notification(        R.drawable.alerts_notification,        alertTitle,        System.currentTimeMillis());Intent intent = new Intent(mContext, MyActivity.class);intent.setAction(MyActivity.ONE_ACTION);PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);mNotifMan.notify(ID, notification);</code></pre><p>Notice that I'm using <code>ONE_ACTION</code> as the action of the intent. What I do is verify the action on the activity and select one of the tabs (it's a <code>TabActivity</code>).</p><p>All that works fine if the activity is closed, because the <code>Intent</code> will open the activity and then I will decide what to do depending on the action in the <code>Intent</code>. But, if the activity is already opened, it launches a new activity. On the other hand, if I add the flag <code>Intent.FLAG_ACTIVITY_SINGLE_TOP</code>, the activity is not launched twice but I can't the tab is not chosen either.</p><p>So, how can choose a tab by clicking on the notification?</p>","244296","","","","","2010-09-23 20:05:51","Modify activity after clicking on a notification","<android>","2","0","3","",""
"3782006","1","3783920","","2010-09-23 19:49:32","1","1462","<p>We are building a scrollable background, and currently have one large background image that we split up into 512x512 tiles, and want to load these tiles as they are needed, instead of all at once, when calling GLUtils.texImage2D within onDrawFrame, we have noticeable lag we think because of having to load the texture onto the hardware, is there a better way to do this?</p><p>Thanks.</p>","456589","","44729","","2010-09-23 20:08:48","2010-09-24 02:51:00","Android calling GLUtils.texImage2D within onDrawFrame very slow","<android><opengl-es>","2","2","1","",""
"3782038","1","","","2010-09-23 19:53:01","2","1122","<p>In my application I have a title(TextView) and an Image. The image is grabbed from the web and most of the images are different sizes. Some of these images are to tall and overlap on top of my textview, covering it up. Is there anyway to prevent this?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/screen""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;android.gesture.GestureOverlayView    android:id=""@+id/gestures""    android:layout_width=""fill_parent""     android:layout_height=""0dip""    android:layout_weight=""1.0""     &gt;&lt;TextView     android:id=""@+id/title""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""""    android:paddingBottom=""10px""    android:layout_weight=""1.0""/&gt;&lt;ImageView     android:id=""@+id/picview""       android:layout_width=""wrap_content""       android:layout_height=""fill_parent""       android:padding=""10px""       android:cropToPadding=""true""       android:layout_weight=""0.0""   /&gt;&lt;/android.gesture.GestureOverlayView&gt;&lt;/LinearLayout&gt;</code></pre>","456594","","","","","2011-01-28 12:01:11","How to prevent Android ImageView from Overlapping TextView","<android>","1","1","","",""
"3782046","1","3782095","","2010-09-23 19:54:07","3","4118","<p>I have defined a custom theme, where I am drawing a dark gradient on my window background. My ListView background is set to be transparent, however whenever I scroll, the background color turns black, and then after scrolling has stopped, goes back to the gradient color. Why is this?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;resources&gt;      &lt;!-- Base application theme is the default theme. --&gt;      &lt;style name=""Theme"" parent=""android:Theme""&gt;      &lt;/style&gt;      &lt;!-- Variation on our application theme that has a translucent     background. --&gt;      &lt;style name=""Theme.DarkGradient""&gt;        &lt;item name=""android:windowBackground""&gt;@drawable/dark_gradient&lt;/item&gt;      &lt;/style&gt;    &lt;/resources&gt;</code></pre>","19875","","19875","","2010-09-23 20:00:01","2012-04-24 07:53:52","ListView redraws background color whenever I scroll","<android><listview><themes>","2","0","","",""
"3782139","1","","","2010-09-23 20:05:33","0","1461","<p>Very new in Android app. Installed Eclipse, SDK, configured AVD but not able to debug my ""Hello World"" app in Eclipse running on Windows Vista Home Premium SP2.</p><p>When I am trying to debug - popup appears</p><p>The JRE Instance default XSLT processor does not support debugging would you like to debug using the default Xalan 2.7.1 processor instead?</p><p>If I click OK, the Android.Manifest.out.out.xml opens in Eclipse and it says ""Document is empty. Right mouse click here to insert content.""</p><p>What to do at this point. Any help?</p>","456610","","","","","2010-09-23 20:24:34","Android App Debugging in Win Vista Home - SP 2 - Processor Issue","<android><debugging><processor>","1","0","1","",""
"3782279","1","3794021","","2010-09-23 20:25:27","0","1922","<p>Im using a custom listView with a Title and a Subtitle where you can read a brief explanation of the item.</p><p>For each item on the list, im displaying an alertDialog to select an option (different for each case). When the option is selected, i want to change the Subtitle for the option selected by the user.</p><p>This is what i tried:</p><pre><code> listview.setOnItemClickListener(new OnItemClickListener() {          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {              switch(position){              case 0:   final CharSequence[] alertText1 = {""Area 1"", ""Area 2"", ""Area 3""};                        ventana.setTitle(""Choose an Area"");                        ventana.setItems(alertText1, new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int item) {                                TextView subTitulo = (TextView) findViewById(R.id.subTitulo);                                subTitulo.setText(alertText1[item]);                            }                        });                        ventana.show();                        break;              case 1:   final CharSequence[] alertText2 = {""1"", ""2"", ""3"", ""5"", ""10"", ""20"", ""60""};                        ventana.setTitle(""Max. duration"");                        ventana.setItems(alertText2, new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int item) {                                TextView subTitulo = (TextView) findViewById(R.id.subTitulo);                                subTitulo.setText(alertText2[item]);                            }                        });                        ventana.show();                        break;              case 2:   final CharSequence[] alertText3 = {""3"", ""5"", ""10"", ""20"", ""30"", ""60""};                        ventana.setTitle(""Time between events"");                        ventana.setItems(alertText3, new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int item) {                                TextView subTitulo = (TextView) findViewById(R.id.subTitulo);                                subTitulo.setText(alertText3[item]);                            }                        });                        ventana.show();                        break;</code></pre><p>For the first item on the list it works fine, when i select an option, the subtitle get replaced by that option, but when i make a selection in the alertDialogs of the other 2 items, the option selected replaces the subtitle of the first item!</p><p>Any idea of how can i fix that?</p>","446234","","","","","2010-09-25 13:33:38","Change dynamically items in a listView","<android><alertdialog><android-listview>","1","0","1","",""
"3782389","1","3782897","","2010-09-23 20:41:18","3","443","<p>The closest example of what i want to accomplish is the ""Engadget"" widget.It updates it's data from the internet every 5-10 minutes and ""scrolls"" to the stories every 5-7 seconds.I imagine it sets the 5 -10 minutes interval to the <code>widget's provider</code> to call the onUpdate without the inbuild limitations , something like that ..</p><pre><code>AlarmManager alarms = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE);alarms.setRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), updateRateSeconds * 1000, newPending); </code></pre><p>Then the real issue.. to update the widgets content without calling onUpdate.</p><p>Here i imaging that inside the widget provider exists a timer or a Runnable that everytime it get's called it reschedules itself with something like that</p><pre><code>public void onUpdate(Context context, AppWidgetManager appWidgetManager,            int[] appWidgetIds) {...    mHandler.removeCallbacks(mUpdateTimeTask);    mHandler.postDelayed(mUpdateTimeTask, 1000);}</code></pre><p>.</p><pre><code>private Runnable mUpdateTimeTask = new Runnable() {           public void run() {           final long start = mStartTime;           long millis = SystemClock.uptimeMillis() - start;           int seconds = (int) (millis / 1000);           int minutes = seconds / 60;               seconds     = seconds % 60;...     mHandler.postAtTime(this,start + (((minutes * 60) + seconds + 1) * 1000));}</code></pre><p>Then on widget provider inside<code>onDeleted</code> and <code>onDisabled</code></p><p>i removeCallbacks <code>mHandler.removeCallbacks(mUpdateTimeTask);</code></p><p>Is there anything wrong with that scheme?Do i need to make a service to update the widget from there and keep it alive without setting an  <code>AlarmManager</code>  to the widget's configuration?For some reason i get double calls on <code>onUpdate</code> and the runnable keeps running after i delete the widget.</p>","348058","","","","","2010-12-14 14:06:38","What is the right way to make a widget that changes content every 6-8 seconds ,Android","<android><widget>","2","1","","",""
"3782531","1","","","2010-09-23 21:06:16","0","806","<p>How can I set the number of homescreens to 1 instead of 3?</p><p>Android 1.6, rooted.  Would rather not install a launcher replacement. </p><p>Running Android 1.6 on a HTC MyTouch. I want to use this as a template for thirty other androids, so I am using Android Kitchen to make a custom ROM. </p>","456622","","244296","","2010-09-23 21:08:18","2010-09-24 14:43:43","Set Number of Homescreens to 1","<android>","3","1","","2011-07-05 12:58:58",""
"3782618","1","","","2010-09-23 21:19:52","6","4333","<p>I am trying to use the javax.xml.xpath package to run XPath expressions on a document with multiple namespaces, and I'm having goofy performance problems.</p><p>My test document is pulled from a real, production example.  It is about 600k of xml.  The document is a fairly complex Atom feed.</p><p>I realize that what I'm doing with XPath could be done without.  However, the same implementation on other, vastly inferior platforms performs absurdly better.  Right now, rebuilding my system to not use XPath is beyond the scope of what I can do in the time that I have.</p><p>My test code is something like this:</p><pre><code>void testXPathPerformance(){    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();    factory.setNamespaceAware(true);    DocumentBuilder builder = factory.newDocumentBuilder();    Document doc = builder.parse(loadTestDocument());    XPathFactory xpf = XPathFactory.newInstance();    XPath xp = xpf.newXPath();    NamespaceContext names = loadTestNamespaces();    //there are 12 namespaces in names.  In this example code, I'm using    //'samplens' instead of the actual namespaces that my application uses    //for simplicity.  In my real code, the queries are different text, but    //precisely the same complexity.    xp.setNamespaceContext(names);    NodeList nodes = (NodeList) xp.evaluate(""/atom:feed/atom:entry"",                     doc.getDocumentElement(), XPathConstants.NODESET);    for(int i=0;i&lt;nodes.getLength();i++)    {        printTimestamp(1);        xp.evaluate(""atom:id/text()"", nodes.item(i));        printTimestamp(2);        xp.evaluate(""samplens:fieldA/text()"", nodes.item(i));        printTimestamp(3);        xp.evaluate(""atom:author/atom:uri/text()"", nodes.item(i));        printTimestamp(4);        xp.evaluate(""samplens:fieldA/samplens:fieldB/&at;attrC"", nodes.item(i));        printTimestamp(5);        //etc.  My real example has 10 of these xp.evaluate lines     }}</code></pre><p>When I run on a Nexus One, (not in the debugger, but with USB connected), the first time through the loop, each xp.evaluate takes somewhere from 10ms to 20ms.  By the 15th time through the loop, each xp.evaluate takes somewhere from 200ms to 300ms.  By the end of the loop (there are 150 items in <code>nodes</code>), it takes about 500ms-600ms for each xp.evaluate.</p><p>I've tried using xp.compile().  The compiles all take &lt;5ms.  I've done xp.reset() (makes no difference).  I've done a new XPath object for each evaluate (adds about 4ms).</p><p>Memory usage does not appear to spiral out of control during execution.</p><p>I'm running this on a single thread in a JUnit test case that doesn't create an activity or anything.</p><p>I'm really puzzled.</p><p>Does anybody have any idea what else to try?</p><p>Thanks! </p><p><strong>update</strong></p><p>If I run the for loop backwards (<code>for(int i=nodes.getLength()-1;i>=0;i--)</code>), then the first few nodes take the 500ms-600ms, and the last ones go fast 10ms-20ms.  So, this seems like it has nothing to do with the number of calls, but instead that expressions whose context is near the end of the document take longer than expressions whose context is near the beginning of the document.</p><p>Does anybody have any thoughts on what I can do about this?</p>","397155","","","user357812","2010-09-23 21:50:58","2013-10-11 07:44:27","XPath.evaluate performance slows down (absurdly) over multiple calls","<java><android><performance><xpath>","2","7","2","",""
"3782676","1","3783295","","2010-09-23 21:28:11","1","8072","<p>I have an AlertDialog created within a switch case statement which is inside a for loop. On the AlertDialog there is an EditText for input. When the box pops up the for loop is run through in the background. I want the loop to wait until input is sent to continue. Here is the code for the AlertDialog:</p><pre><code>for(int i=0; i &lt; code.length(); i++){        switch(code.charAt(i)){                case '+':                    bytes[index]++;                    break;                case '-':                    bytes[index]--;                    break;                case '&lt;':                    if(index &gt; 0){                        index--;                    }else{                        Toast.makeText(this, ""Warning: Index is already at zero"", Toast.LENGTH_LONG).show();                    }                    break;                case '&gt;':                    if(index &lt;= 500){                        index++;                    }else{                        Toast.makeText(this, ""Warning: Maximum bytes reached"", Toast.LENGTH_LONG).show();                    }                    break;                case ']':                    if(loop == -1){                        Toast.makeText(this, ""ERROR: Close bracket before an open bracket!"", Toast.LENGTH_LONG).show();                        errors++;                        break;                    }else{                        if(bytes[index] == 0){                            loop = -1;                        }else{                            i = loop;                        }                        break;                    }                case '[':                    loop = i;                    break;                case '.':                    stdout(Character.toString((char)bytes[index]));                    break;                case ',':                    AlertDialog.Builder alert = new AlertDialog.Builder(this).setCancelable(false);                    alert.setTitle(""Enter Character"");                    alert.setMessage(""Script is requesting input"");                    final EditText input = new EditText(this);                    InputFilter[] FilterArray = new InputFilter[1];                    FilterArray[0] = new InputFilter.LengthFilter(1);                    input.setFilters(FilterArray);                    alert.setView(input);                    alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {                        public void onClick(DialogInterface dialog, int whichButton) {                            setByte(input.getText().toString().charAt(0));                        }                   });                   alert.show();                   break;                }                if(errors &gt; 0){                    break;                }            }</code></pre>","428740","","428740","","2010-09-23 21:56:38","2010-09-23 23:52:16","AlertDialog doesn't wait for input","<android>","1","3","","",""
"3782763","1","3784090","","2010-09-23 21:44:34","2","1271","<p>Is there an API in android to access the headphone hardware input? Ideally I'd like to be able to directly read the incoming voltage/current. Accessing this in either Java or the NDK would be fine. Preferably if there's a way to do this on non rooted phones.</p>","375874","","","","","2010-09-24 03:52:47","Low level (voltage) access of headphone input in android","<android><android-ndk><hardware-interface>","2","0","","",""
"3782786","1","3915181","","2010-09-23 21:48:07","13","13421","<p>I have android G1 firmware 1.6, I am trying to record voice from the app with the follow code.</p><pre>MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile(PATH_NAME); recorder.prepare(); recorder.start();  </pre><p>my manifest.xml has:</p><pre>&lt;uses-permission android:name=&quot;android.permission.RECORD_AUDIO&quot; /&gt;</pre><p>I got:</p><pre>09-23 14:41:05.531: ERROR/AndroidRuntime(1718): Uncaught handler: thread main exiting due to uncaught exception09-23 14:41:05.551: ERROR/AndroidRuntime(1718): java.lang.RuntimeException: setAudioSource failed.09-23 14:41:05.551: ERROR/AndroidRuntime(1718):     at android.media.MediaRecorder.setAudioSource(Native Method)</pre><p>how do I record voice properly?</p>","121196","","","","","2014-02-13 15:36:53","android mediaRecorder.setAudioSource failed","<android><voice>","7","0","1","",""
"3782808","1","3783076","","2010-09-23 21:51:36","0","667","<p>I have a texture.png which I would like to tile, to create a textured background for my window.</p><p>Will I run into any problems with different screen resolutions?</p><p>If so, what is the best way to support a textured background for multiple devices?</p><p>Should I have 1 image instead? How large should it be?</p>","19875","","19875","","2010-09-23 22:06:55","2010-09-23 22:51:17","How to display a tiled background for all resolutions?","<android><gui><themes><activity>","1","0","0","",""
"3782823","1","3782973","","2010-09-23 21:55:31","3","13370","<p>I have a class that is called when my app launches.</p><pre><code>public class MainActivity extends Activity implements NetworkEvent.</code></pre><p>In this situation, </p><pre><code>list = (ListView) findViewById(R.id.list);</code></pre><p>works perfectly. However if I then call a new intent via:</p><pre><code>   String[] names = object.names();</code></pre><p>Intent myIntent = new Intent(MainActivity.this, SimpleList.class);   myIntent.putExtra(""names"", names);   startActivityForResult(myIntent, 0);</p><p>where SimpleList is defined as:</p><pre><code>public class SimpleList extends ListActivity implements NetworkEvent</code></pre><p>then when I call</p><pre><code>   list=(ListView) findViewById(R.id.list);</code></pre><p>Log.i(""MyApp"", ""List:"" + list);</p><p>from within the SimpleList class, list is null :(</p><p>How come? Both classes are within the same package.</p><p>Thanks.</p>","456701","","","","","2012-08-27 05:13:37","Android - findViewById(R.id.list) returns null","<android><activity><listactivity>","5","0","1","",""
"3782882","1","","","2010-09-23 22:09:27","0","350","<p>I have an activity A which invokes Activity B on Button Click,and a Button click on Activity B invokes Class C. When button is clicked in Activity B , B calls a static method in Class C which passes its reference as one of the argument to method in C and other argument is path to the sound file that needs to be played. Once control reaches class C , Audio is played. But when Backkey is pressed Audio doesnot stop it continuous to play. How can I make the Audio to stop when BackKey is pressed. More over when Backkey is pressed control is coming to Activity A instead of Activity B. Can any one help me in solving this issue?</p><p>class activityA extends Activity  <br>{   startIntent(ActivityB)  on ButtonPress <br>}<br></p><p>class ActivityB extends Activity <br>{   classc.playAudio(ActivityB.this,audiopath); <br>} <br></p><p>class c <br>{  playAudio(Activity a, audiopath) <br>   {    sound code to play audio is done here. <br>    } <br>} <br></p>","429501","","","","","2010-09-24 03:21:46","Music doesnot stop after pressing backkey","<android>","1","1","","",""
"3783113","1","4930232","","2010-09-23 22:58:53","1","831","<p>I have been searching around for any info on creating a video player. Here is what I am looking for, I want to create a player to play videos (stream preferably) with my own custom playback buttons. The player will be set in a View (size of the view varies). Can i do this with just the MediaPlayer class, and can i add it in a View. If there are any examples or tutorials. I would greatly appreciate it. Thankx again in advance</p>","423305","","","","","2011-02-08 06:31:18","Is it possible to creating a custom Videoplayer and place it in a View on Android?","<android><media-player>","1","0","2","",""
"3783124","1","","","2010-09-23 23:01:07","5","10105","<p>I've written a program in Java that takes in an image file and manipulates the image. Now I'm trying to access the camera so that I can take the photo and give it to the image processing program however I'm lost as to how to do this. I've read the information about the camera class and how to ask for permissions but I don't know how to actually take the photo. If anyone has any tips on where I should begin or if they know of a good tutorial I'd really appreciate it. Thanks!</p>","456737","","","","","2012-11-28 10:50:40","How do I access the camera on Android phones?","<java><android><android-emulator>","4","0","2","",""
"3783271","1","3783994","","2010-09-23 23:44:05","0","304","<p>I am developing an Android app and I am using a library I wrote. This library has a class that contains some static fields. One of them is a API key. This key is used by other classes in my library to make calls on a remote service.</p><p>I initialize the API key on my main Activity once when it is created and the savedInstanceState is null.</p><p>My problem lies in other activities as they sometimes use the correct API key when making calls with my library and sometimes they do not. It seems as if the API key has not been set.</p><p>In particular there is one activity that i call from my preferences activity that always fails as the API key is not set.</p><p>Are not static fields maintained across Activities as they are on normal Java applications? I thought that for a specific jvm instance, all static fields are retained. Is the Android platform using new jvm instances for new Activities?</p>","56242","","","","","2010-09-24 03:16:59","Static parameters not retained across Activities","<android><static><jvm><static-members>","2","2","","",""
"3783277","1","3783366","","2010-09-23 23:46:44","0","434","<p>I have the following drawable:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;gradient         android:startColor=""#2F2F2F""         android:endColor=""#5A5A5A""        android:angle=""90""        android:dither=""true""     /&gt;&lt;/shape&gt;</code></pre><p>Is there anyway to start the startColor at 50% or the endColor at 50%?</p><p>Are there any links that show me all of the attributes I can apply to a gradient?</p>","19875","","","","","2010-09-24 01:21:56","How to get more control over gradients","<android><styles><gradient><drawable>","2","0","","",""
"3783294","1","","","2010-09-23 23:52:09","0","1663","<p>I have a ListView and an ExpandableListView inside of a TabActivity.  I have overridden the setOnItemClickListener for the ListView.  I have 2 tabs and one uses the ListView and the other uses the ExpandableListView.  For some reason I cannot click on any of the items in the first ListView.  If I change tabs to the ExpandableListView and then go back to the first tab it will then allow me to click on the items as usual.  Any ideas on why this is happening.  Is there some kind of weird focus thing going on?</p><p>I have this as part of my code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.listview);    listView = (ListView) findViewById(R.id.listview);    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {                @Override                public void onItemClick(AdapterView&lt;?&gt; av, View v, int pos, long id) {                    onListItemClick(pos, id);                    // return false;                }            });}</code></pre>","456766","","","","","2011-01-25 01:10:56","ListView OnClickListener not working within TabActivity","<android><listview><onclick><expandablelistview><tabactivity>","2","0","","",""
"3783318","1","","","2010-09-23 23:58:35","2","2629","<p>I've got an input popup that I'm displaying over my activities main view that has some edit boxes in it. When the popup is displayed the activities view stays dimmed in the background (like with an alert dialog).</p><p>The issue I'm having is that when the keyboard comes up the popup is ok, but activities view in the background is shifting up. That view should be paused and I wouldn't have thought it would be affected by the keyboard at all. Is there any way to stop this from happening?</p><p>I've tried adding android:windowSoftInputMode=""adjustPan"" to the activity and to the pop-up with no luck.</p><p>Here's my activity layout:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:orientation=""vertical"" android:background=""@drawable/main_bg""&gt;&lt;include android:id=""@+id/header"" layout=""@layout/common_header"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""/&gt; &lt;RelativeLayout  android:id=""@+id/contentLayout""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:layout_margin=""5dp"" &gt;&lt;include android:id=""@+id/btnBar"" layout=""@layout/common_button_bar"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true""/&gt;    &lt;LinearLayout   android:id=""@+id/webLayout""   android:layout_above=""@+id/btnBar""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:background=""@drawable/blk""  android:layout_margin=""10dp""&gt;   &lt;WebViewandroid:id=""@+id/WebView""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_margin=""1dp""android:background=""@drawable/white""   &gt;   &lt;/WebView&gt;  &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;</code></pre><p>and here is my pop-up layout:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_height=""wrap_content"" android:orientation=""vertical"" android:background=""@color/light_grey"" android:layout_width=""wrap_content""      android:minWidth=""300dp""&gt; &lt;LinearLayout  android:id=""@+id/main_inner_layout""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""vertical""  android:background=""@color/white""  android:layout_margin=""3dp"" &gt;  &lt;TextView   android:id=""@+id/enter_txt""   android:text=""Enter Cup Code Below:""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:gravity=""center_horizontal""   android:textColor=""@color/black""   android:layout_gravity=""left""   android:typeface=""sans""   android:textSize=""16dp""   android:layout_margin=""10dp""      &gt;  &lt;/TextView&gt;  &lt;RelativeLayout    android:id=""@+id/code_layout""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:layout_marginLeft=""10dp""   android:layout_marginRight=""10dp""   android:background=""@color/white""  &gt;   &lt;EditText    android:text=""12345""    android:id=""@+id/CodeInputOne""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginRight=""10dp""    android:layout_alignParentLeft=""true""   &gt;&lt;/EditText&gt;   &lt;EditText    android:text=""12345""    android:id=""@+id/CodeInputTwo""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginLeft=""10dp""    android:layout_marginRight=""10dp""    android:layout_centerHorizontal=""true""   &gt;&lt;/EditText&gt;   &lt;EditText    android:text=""12345""    android:id=""@+id/CodeInputThree""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginLeft=""10dp""    android:layout_alignParentRight=""true""       &gt;&lt;/EditText&gt;  &lt;/RelativeLayout&gt;  &lt;RelativeLayout   android:id=""@+id/btn_layout_top""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:layout_marginLeft=""10dp""   android:layout_marginTop=""10dp""   android:layout_marginRight=""10dp""   android:background=""@color/white""  &gt;   &lt;Button    android:id=""@+id/AccountBtn""    android:textStyle=""bold""    android:text=""My Account""    android:layout_marginRight=""5dp""    android:layout_alignParentLeft=""true""    android:onClick=""ClickHandler""    android:layout_height=""40dp""    android:layout_width=""130dp""   &gt;&lt;/Button&gt;   &lt;Button    android:id=""@+id/SubmitBtn""    android:textStyle=""bold""    android:text=""Submit""    android:layout_marginLeft=""5dp""    android:layout_alignParentRight=""true""    android:onClick=""ClickHandler""    android:layout_height=""40dp""    android:layout_width=""130dp""   &gt;&lt;/Button&gt;  &lt;/RelativeLayout&gt;  &lt;RelativeLayout   android:id=""@+id/btn_layout_bottom""   android:layout_width=""fill_parent""   android:layout_height=""wrap_content""   android:layout_marginLeft=""10dp""   android:layout_marginRight=""10dp""   android:background=""@color/white""  &gt;   &lt;Button    android:id=""@+id/RewardsBtn""    android:textStyle=""bold""    android:text=""Rewards""    android:layout_marginRight=""5dp""    android:layout_alignParentLeft=""true""    android:onClick=""ClickHandler""    android:layout_height=""40dp""    android:layout_width=""130dp""       &gt;&lt;/Button&gt;   &lt;Button    android:id=""@+id/CancelBtn""    android:textStyle=""bold""    android:text=""Cancel""    android:layout_marginLeft=""5dp""    android:layout_alignParentRight=""true""    android:onClick=""ClickHandler""    android:layout_height=""40dp""    android:layout_width=""130dp""   &gt;&lt;/Button&gt;   &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks!</p>","456771","","456771","","2010-09-24 00:05:35","2012-01-18 14:53:46","background layout moving when soft keyboard displayed - android","<android><android-layout><android-softkeyboard>","1","1","1","",""
"3783424","1","","","2010-09-24 00:34:14","0","4116","<p>I am building an app that will be an Android listview. Each listview object will be a title and a few sub-categories and ratings. I would like the user to be able to sort the listview by these ratings or sub-categories. Thank you in advance.</p>","413926","","","","","2012-02-28 03:54:59","How to Sort a Listview by a category","<android><listview>","1","0","","",""
"3783461","1","4620229","","2010-09-24 00:46:12","7","3945","<p>What's the current status of using the latest version of the Android ADT with the latest version of <a href=""http://www.eclipse.org/helios/"" rel=""nofollow"">Eclipse 3.6</a>?</p><p>Previously I've read that there were bugs/problems, and warned to continue using <a href=""http://www.eclipse.org/galileo/"" rel=""nofollow"">Eclipse 3.5 Galileo</a> for the time being.  Is this still the case, or have the issues been resolved?</p><p>I'm running Windows 7 64-bit, but I'm actually asking the question generically, regardless of OS/version.</p>","435519","","435519","","2011-02-08 18:28:51","2011-02-10 20:48:04","Are there any problems using Eclipse 3.6 with the Android SDK?","<android><eclipse>","3","4","1","",""
"3783790","1","","","2010-09-24 02:15:37","2","420","<p>How can i use a pipe channel to open and read a file on android? Can anyone give me an example?</p>","275674","","","","","2010-09-24 07:22:23","Android: Pipe channels","<java><android>","1","0","","",""
"3783828","1","","","2010-09-24 02:27:07","0","805","<p>I was trying to use this code below to run a native and i get a classnotfoundexception for android.os.exec in Class execClass = Class.forName(""android.os.Exec"")..any idea y?</p><pre><code>    try {    // android.os.Exec is not included in android.jar so we need to use reflection.    Class&lt;?&gt; execClass = Class.forName(""android.os.Exec"");    Method createSubprocess = execClass.getMethod(""createSubprocess"",            String.class, String.class, String.class, int[].class);    Method waitFor = execClass.getMethod(""waitFor"", int.class);    // Executes the command.    // NOTE: createSubprocess() is asynchronous.    int[] pid = new int[1];    FileDescriptor fd = (FileDescriptor)createSubprocess.invoke(            null, ""/system/bin/ls"", ""/sdcard"", null, pid);    // Reads stdout.    // NOTE: You can write to stdin of the command using new FileOutputStream(fd).    FileInputStream in = new FileInputStream(fd);    BufferedReader reader = new BufferedReader(new InputStreamReader(in));    String output = """";    try {        String line;        while ((line = reader.readLine()) != null) {            output += line + ""\n"";        }    } catch (IOException e) {        // It seems IOException is thrown when it reaches EOF.    }    // Waits for the command to finish.    waitFor.invoke(null, pid[0]);    return output;} catch (ClassNotFoundException e) {    throw new RuntimeException(e.getMessage());} catch (SecurityException e) {    throw new RuntimeException(e.getMessage());} catch (NoSuchMethodException e) {    throw new RuntimeException(e.getMessage());} catch (IllegalArgumentException e) {    throw new RuntimeException(e.getMessage());} catch (IllegalAccessException e) {    throw new RuntimeException(e.getMessage());} catch (InvocationTargetException e) {    throw new RuntimeException(e.getMessage());}</code></pre><p>Link: <a href=""http://gimite.net/en/index.php?Run%20native%20executable%20in%20Android%20App"" rel=""nofollow"">http://gimite.net/en/index.php?Run%20native%20executable%20in%20Android%20App</a></p>","275674","","","","","2010-09-24 20:05:31","Run native executable in Android error","<java><android>","1","2","","",""
"3783848","1","3784038","","2010-09-24 02:32:33","5","2882","<p>Is it possible to have multiple Shared Preferences per app? If you create a PreferenceActivity, the values by default are persisted to /data/data/[PACKAGE_NAME]/shared_prefs/[PACKAGE_NAME]_ preferences.xml</p><p>Is there a way to have multiple such files and which one to use for a given PreferenceActivity?</p>","440093","","","","","2010-09-24 03:33:12","Android: Possible to have multiple distinct Shared Preferences per app?","<android>","1","0","1","",""
"3784050","1","","","2010-09-24 03:36:45","2","186","<p>I'm trying to create a notification that uses a different sound than Notification.DEFAULT_SOUND. Is there an easy way I can pop up a Sound picker where the user can choose from? and how do I use the sound picked for my notification?</p>","456874","","","","","2010-09-24 03:53:00","Is there an easy way to prompt the user for his preferred notification tone?","<android><notifications>","1","0","","",""
"3784060","1","","","2010-09-24 03:39:31","4","1299","<p>When I click, the following code leads the two sounds to be played not simultaneously, but sequentially.  Why are they not played simultaneously?</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mytextview=(TextView) findViewById(R.id.textview);    mytextview.setOnClickListener(this);    sp=(SoundPool) new SoundPool(8,0x00000003,1);    upSound=sp.load(this, R.raw.sound1, 1);    downSound=sp.load(this, R.raw.sound2, 1);}    @Overridepublic void onClick(View v) {    sp.play(downSound, VOLUME, VOLUME, 1, 0, 1);    sp.play(upSound, VOLUME, VOLUME, 1, 0, 2);}</code></pre>","456878","","","","","2011-02-26 02:09:57","Why are my SoundPool sounds not playing simultaneously in onClick()?","<android><soundpool>","2","1","","",""
"3784178","1","","","2010-09-24 04:24:36","0","1667","<p>I was able to use ACTION_PICK with People.CONTENT_URI with the following part of code</p><pre><code>    Uri myPerson = People.CONTENT_URI;    Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,myPerson);    startActivityForResult(contactPickerIntent, CONTACT_ACTIVITY_CODE);</code></pre><p>with this i was able to launch the native contact book and on selecting a contact it returned th _ID of that contact. Now what i want is to display the next screen of contact book--the page specific to that selected contact. i tried with the following code. but did not work</p><pre><code>    Uri myPerson = ContentUris.withAppendedId(People.CONTENT_URI, 23);    Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,myPerson);    startActivityForResult(contactPickerIntent, CONTACT_ACTIVITY_CODE);</code></pre><p>Here if i change Intent.ACTION_PICK to ACTION_VIEW i am able to view the reqd screen. but i want that screen with ability to return my selection(which will be a phone number or email etc)</p><p>please reply if any one have a solution or suggestions to this.Thanks</p>","449383","","449383","","2010-09-27 07:37:48","2011-01-04 20:22:57","ACTION_PICK usage with contact book","<android><contacts><android-contacts>","1","0","","",""
"3784236","1","3784415","","2010-09-24 04:41:44","0","3076","<p>I have the following AlertDialog with an image inside it:</p><p><img src=""http://i.stack.imgur.com/PrYCD.png"" alt=""alt text""></p><p>As you can see there is a small gap just above and just below the image. I'd like to remove that gap.</p><p>My layout xml looks like:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:id=""@+id/alert_thumb_root""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content"" &gt;  &lt;ImageView android:id=""@+id/thumb""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre>","149166","","","","","2010-09-24 07:25:34","Resize AlertDialog to fit image exactly","<android><xml><imageview><alertdialog>","2","1","","",""
"3784292","1","3792554","","2010-09-24 04:57:57","10","4068","<p>I've got a ToggleButton that's set up like:</p><pre><code>final ToggleButton filterButton = (ToggleButton) findViewById(R.id.filterTags);        filterButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                if (filterButton.isChecked()) {                    // pop up the list of tags so the user can choose which to filter by                    // once one is chosen, the spinner will be updated appropriately                    showDialog(DIALOG_TAGS);                } else {                    // going unpressed, set the the spinner list to everything                    updateSpinner(db.itemNames());                }            }        });</code></pre><p>and the dialog looks like:</p><pre><code>   case DIALOG_TAGS:        final String[] tagNames = db.tagNamesInUse();        dialog = new AlertDialog.Builder(this)            .setItems(tagNames, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                        updateSpinner(db.getItemNamesForTag(tagNames[which]));                        final ToggleButton filterButton = (ToggleButton) findViewById(R.id.filterTags);                        filterButton.setTextOn(tagNames[which]);                        dialog.dismiss();                    }                })                .setNegativeButton(""Cancel"", UITools.getDialogCancellingListener())            .create();</code></pre><p>The idea is: if the ToggleButton is turned on, it pops up a single-choice listview dialog that's the list of tags.  Once a tag is chosen, it becomes the new textOn for the ToggleButton.  If the ToggleButton is turned off (unChecked), then the text reverts to the static TextOff.  </p><p>The problem is: the button isn't being redrawn once the dialog goes away.  The text showing is still the previous value of textOn. </p><p>How can I force a redraw?  I tried <code>filterButton.postInvalidate();</code> but that didn't help.</p>","8002","","8002","","2011-09-20 13:42:29","2011-09-20 13:42:29","How can I get working dynamic ToggleButton text under android?","<android><dynamic><togglebutton>","1","0","","",""
"3784390","1","3784396","","2010-09-24 05:18:30","0","1026","<p>Does the CursorAdapter run on a background thread and posts updates via the UI looper thread? If not what is the best pattern to load data asynchronously from a ContentProvider?</p>","42005","","","","","2012-12-31 13:28:56","Does Android's CursorAdapter run in a background thread?","<android><android-contentprovider>","2","0","","",""
"3784480","1","3784507","","2010-09-24 05:39:12","1","315","<p>It's possible to specify a particular function to be called when button is clicked by setting its onClick attribute in xml:                   <code>android:onClick=""function_name""</code>I want to do something similar for FocusChange of buttons, is this possible?</p><p>Specifically, I wish to increase my button's size when it has focus and make it normal sized when not focussed. To apply this to all my buttons, I hoped to call a specific function which does this and then specify this function name in my style.xml. But there is no onFocusChange attribute in android.</p><p>It works when I add overriden onSetFocusChangeListener for each of my buttons separately in the code. But is there any other solution? </p><p>Pls help.</p><p>-Kiki</p>","454660","","","","","2010-09-24 05:44:46","How to call a specific function on FocusChange of all buttons in android?","<android><button><focus>","1","0","1","",""
"3784514","1","3784691","","2010-09-24 05:46:20","16","9210","<p>Is it possible to capture release of a button just as we capture click using onClickListener() and OnClick() ?</p><p>I want to increase size of a button when it is pressed and move it back to the original size when the click is released...can anyone help me how to do this?</p>","456936","","","","","2013-10-25 08:45:06","Capture button release in Android","<android><button>","5","0","1","",""
"3784540","1","3784595","","2010-09-24 05:51:32","0","3811","<p>I'm currently learning android and java, and I am having some issues with importing a java file.</p><p>I am working with the time and date example in the android api demos, and I want to put all the code relating to creating the time and date dialogs setting the values etc into a separate java file, and in my main java file run when the application starts, just declare the buttons and onclick events.</p><p>What is the best way to do this? Do I need to put all the code inside a class(that extends activity) or method? How do I use this inside my main class?</p><p>The code for the example is:</p><pre><code>package com.datetest;import android.app.Activity;import android.os.Bundle;import android.app.Activity;import android.app.DatePickerDialog;import android.app.TimePickerDialog;import android.app.Dialog;import android.os.Bundle;import android.widget.TextView;import android.widget.Button;import android.widget.DatePicker;import android.widget.TimePicker;import android.view.View;import java.util.Calendar;public class datetest extends Activity {   // where we display the selected date and timeprivate TextView mDateDisplay;// date and timeprivate int mYear;private int mMonth;private int mDay;private int mHour;private int mMinute;static final int TIME_DIALOG_ID = 0;static final int DATE_DIALOG_ID = 1;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mDateDisplay = (TextView) findViewById(R.id.dateDisplay);    Button pickDate = (Button) findViewById(R.id.pickDate);    pickDate.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            showDialog(DATE_DIALOG_ID);        }    });    Button pickTime = (Button) findViewById(R.id.pickTime);    pickTime.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            showDialog(TIME_DIALOG_ID);        }    });    final Calendar c = Calendar.getInstance();    mYear = c.get(Calendar.YEAR);    mMonth = c.get(Calendar.MONTH);    mDay = c.get(Calendar.DAY_OF_MONTH);    mHour = c.get(Calendar.HOUR_OF_DAY);    mMinute = c.get(Calendar.MINUTE);    updateDisplay();}@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {        case TIME_DIALOG_ID:            return new TimePickerDialog(this,                    mTimeSetListener, mHour, mMinute, false);        case DATE_DIALOG_ID:            return new DatePickerDialog(this,                        mDateSetListener,                        mYear, mMonth, mDay);    }    return null;}@Overrideprotected void onPrepareDialog(int id, Dialog dialog) {    switch (id) {        case TIME_DIALOG_ID:            ((TimePickerDialog) dialog).updateTime(mHour, mMinute);            break;        case DATE_DIALOG_ID:            ((DatePickerDialog) dialog).updateDate(mYear, mMonth, mDay);            break;    }}    private void updateDisplay() {    mDateDisplay.setText(        new StringBuilder()                // Month is 0 based so add 1                .append(mMonth + 1).append(""-"")                .append(mDay).append(""-"")                .append(mYear).append("" "")                .append(pad(mHour)).append("":"")                .append(pad(mMinute)));}private DatePickerDialog.OnDateSetListener mDateSetListener =        new DatePickerDialog.OnDateSetListener() {            public void onDateSet(DatePicker view, int year, int monthOfYear,                    int dayOfMonth) {                mYear = year;                mMonth = monthOfYear;                mDay = dayOfMonth;                updateDisplay();            }        };private TimePickerDialog.OnTimeSetListener mTimeSetListener =        new TimePickerDialog.OnTimeSetListener() {            public void onTimeSet(TimePicker view, int hourOfDay, int minute) {                mHour = hourOfDay;                mMinute = minute;                updateDisplay();            }        };private static String pad(int c) {    if (c &gt;= 10)        return String.valueOf(c);    else        return ""0"" + String.valueOf(c);}</code></pre><p>}</p><p>Thanks for your help</p>","446963","","","","","2010-09-24 06:05:22","import class/method from java file","<java><android><class><import>","1","0","","",""
"3784548","1","3784893","","2010-09-24 05:55:49","1","1492","<p>iam running android 2.2 (froyo) on a x-86 based PC. How can I capture a logcat on the terminal console and save it to any specific location within the android, say notepad ? Whats is the keyboard command for it ?</p><p>What are the other generic keyboard shortcuts for android x-86?</p>","373049","","","","","2012-04-15 12:53:11","Capturing logcat on android x86","<android><keyboard-shortcuts><x86><logcat>","2","0","0","",""
"3784552","1","3784560","","2010-09-24 05:57:00","0","1655","<p>Can I have the Information of what is the difference between JSON &amp; GSON. I have read the word GSON at some places while looking for JSON particularly.</p><p>I don't know the clear difference between the two.</p><p>Another thing is the Words; ""Marshalling"" and ""Unmarshalling"" associated with JSON Parsing, I wonder what they are actually.</p>","422859","","244296","","2011-01-11 18:48:23","2011-03-04 00:50:21","Json and Gson in Android Application","<android><json><parsing><gson>","1","0","","",""
"3784558","1","","","2010-09-24 05:58:02","0","349","<pre><code>   I need a big help for this  issue...   I am not sure what i am doing is correct or not   i am doing a sample application for transfering realtime video</code></pre><p>from one android device to an emulator,in device side i can open video cam and a set an output file for it,while the recording is progressing, at the same time i am open a filestream and reading all the content  by bytes with respect toavilablity, and writing a socket which is communication with theemulator. At the emulator side i am writing this to another file</p><p>When i click the recording stop button, i read the rest of the filefrom the device side and writing to socket stream.When i check the file size at the both side it is same</p><p>But i cannot play the file at the emulator is side when i check withvlc, in the device side i can play recorded 3gp file</p><p>So my doubt, same file i cannot access at the same time when onethread(android camera) is writing to the file</p><p>or it will correupt?</p><p>please help me.......... i</p>","227413","","","","","2010-09-24 06:12:44","problem with the real time capturing of a video-android","<android>","1","0","","",""
"3784562","1","","","2010-09-24 05:58:51","0","807","<p>how can i get all the system notifications that are shown now?i want to write a programe that can intercept the notifications that other apps notified.</p>","443407","","","","","2011-05-10 17:32:05","how can i get all the system notifications that are shown now?","<android><notifications>","2","0","","",""
"3784596","1","","","2010-09-24 06:05:34","0","3655","<p>Either exit button or back button only can be implemented in my application.But i want both the implementations in my application. So,Please propose me a solution.</p><p>Thanks in Advance..:)</p>","452331","","","","","2011-11-24 00:47:33","exit and back button implementation","<android><button><widget><exit><back-button>","2","1","","",""
"3784607","1","3789676","","2010-09-24 06:07:15","3","3558","<p><strong>Purpose of the app:</strong></p><p>A simple app that draws a circle for every touch recognised on the screen and follows the touch events. On a 'high pressure reading' <code>getPressure (int pointerIndex)</code> the colour of the circle will change and the radius will increase. Additionally the touch ID with <code>getPointerId (int pointerIndex)</code>, x- and y-coordinates and pressure are shown next to the finger touch.</p><p>Following a code snipplet of the important part (please forgive me it is not the nicest code ;) I know)</p><pre><code>protected void onDraw(Canvas canvas){    //draw circle only when finger(s) is on screen and moves     if(iTouchAction == (MotionEvent.ACTION_MOVE)){        int x,y;        float pressure;        //Draw circle for every touch        for (int i = 0; i &lt; touchEvent.getPointerCount(); i++){            x = (int)touchEvent.getX(i);            y = (int)touchEvent.getY(i);            pressure = touchEvent.getPressure(i);            //High pressure            if (pressure &gt; 0.25){                canvas.drawCircle(x, y, z+30, pressureColor);                canvas.drawText(""""+touchEvent.getPointerId(i)+""  | ""+x+""/""+y, x+90, y-80, touchColor);                canvas.drawText(""""+pressure, x+90, y-55, pressureColor);            }else{ //normal touch event                 canvas.drawCircle(x, y, z, touchColor);                canvas.drawText(""""+touchEvent.getPointerId(i)+"" | ""+x+""/""+y, x+60, y-50, touchColor);                canvas.drawText(""""+pressure, x+60, y-25, pressureColor);            }        }               }}</code></pre><p><strong>The problem:</strong></p><p>A HTC Desire running Android 2.1 is the test platform. The app works fine and tracks two finger without a problem. But it seems that the two touch points interfere with each other when they get t0o close -- it looks like they circles 'snap'to a shared x and y axle. Sometimes they even swap the input coordinates of the other touch event. Another problem is that even though <code>getPressure (int pointerIndex)</code> refers to an PointerID both touch event have the same pressure reading. </p><p>As this is all a bit abstract, find a video here: <a href=""http://www.youtube.com/watch?v=bFxjFexrclU"" rel=""nofollow"">http://www.youtube.com/watch?v=bFxjFexrclU</a></p><p><strong>My question:</strong> </p><ol><li>Is my code just simply wrong? </li><li>Does Android 2.1 not handle the touch events well enough get things mixed up?</li><li>Is this a hardware problem and has nothing to do with 1) and 2)?</li></ol><p>Thank you for answers and/or relinks to other thread (sorry could find one that address this problem).</p><p>Chris</p>","400022","","","","","2012-06-27 18:37:36","MotionEvent multiple touch events get mixed up and influence each other (see demo video)","<android><events><multi-touch><motion><interference>","2","2","1","",""
"3784737","1","3784869","","2010-09-24 06:34:34","4","1045","<p>I am attempting to create a very graphically intensive android application. Almost all of the UI is based on bitmaps and I would like to support as many different devices as possible and to have the app look great in all of them.</p><p>Is it possible to embed different resolutions for each image and have a different image displayed on each device. I am aware of stuff like hdpi folders etc. as well has units like dip etc., but that still leaves too many variables as to how the image is displayed. I would like to not have the images scaled at all to avoid losing image quality.</p><p>For instance on my high resolution device I would like an image to be exactly 100px and then on a medium resolution device I would like a lower resolution image to display and be exactly 80px. If I use display independent units, I cannot ensure that the images will be of a particular size.</p><p>Anyone have any ideas or suggestions on how to go about this?</p>","80617","","","","","2013-05-02 11:29:37","Android Show Different Image on Different Resolution","<android><pixels>","1","0","1","",""
"3784914","1","3785357","","2010-09-24 07:10:25","1","862","<p>I am trying to implement a threaded circular buffer with PipedInputStream &amp; PipedOutputStream but it is locking everytime when I get to mHead.write in the Decoder runnable. I thought there was no chance for deadlocks when using separate threads.</p><pre><code>    private class DecoderTask implements Runnable{    @Override    public void run() {        while(!mStop){            try {                    Log.d(TAG,""trying to write"");        mHead.write(decode( 0, 1000));            mHead.flush();            Log.d(TAG,""Decoded"");            } catch (DecoderException e) {                Log.e(TAG,e.toString());            } catch (IOException e) {                Log.e(TAG,e.toString());            }        }    }}private class WriteTask implements Runnable{    @Override    public void run() {        while(!mStop){            try {                                 Log.d(TAG,""trying to read"");                 int read = mTail.read(mByteSlave, 0, mByteSlave.length);                 mAudioTrack.flush();                                 mAudioTrack.write(mByteSlave,0,read);                                 Log.d(TAG,""read"");                             } catch (IOException e) {                Log.e(TAG,e.toString());            }        }    }}//in some functionmTail = new PipedInputStream();mHead = new PipedOutputStream(mTail);mByteSlave = new byte[BUF];mT1 = new Thread(new DecoderTask(), ""Reader"");mT2 = new Thread(new WriteTask(), ""Writer"");mT1.start();mT2.start();return;</code></pre><p>edit:  here is the full source for my service <a href=""http://pastie.org/1179792"" rel=""nofollow"">http://pastie.org/1179792</a></p><p>logcat prints out :</p><p>trying to read<br>trying to write</p>","384306","","384306","","2010-09-24 20:32:56","2013-02-26 16:08:51","why is my PipedOutputStream deadlocking?","<java><android><inputstream><outputstream><blocked-threads>","3","0","","",""
"3784931","1","3793447","","2010-09-24 07:13:09","0","675","<p>I am working on Android application which  needs to play audio present in cal folder i.e sfdk folder. My doubt is wehere can I find SDK folder in File/Explorer option of ddms.I find data and system folders in File/Explorer, but didnot find SDK folder.Can  I be helped to sove this issue .Thanks N Regards</p>","429501","","429501","","2010-09-24 07:19:04","2010-09-25 10:40:48","where can I find SDK folder in Eclipse Android FileExplorer","<android>","2","0","","",""
"3784948","1","","","2010-09-24 07:18:21","5","8428","<p>In my android application I am using progress dialog in my splashscreen.I would like to see only the progressbar with loading message without the background.Is there any way that I can change the background to transparent in Android?</p><p>Please share your valuable suggestions.</p>","420261","","810368","","2012-10-03 16:53:52","2013-12-20 12:23:58","change progressdialog background","<android><android-layout><user-interface>","6","0","","",""
"3785082","1","3785341","","2010-09-24 07:42:05","1","7163","<p>What does ""deserializing Json"" mean, I have seen this term on the Web. I don't know the meaning of this particular term. It would be great if anybody could explain to me what it means.</p>","422859","","1627235","","2014-02-18 19:24:11","2014-02-18 19:24:11","JSON Deserializing with Json Parsing in Android Application","<android><json><serialization>","1","0","3","",""
"3785206","1","3785917","","2010-09-24 07:59:59","0","919","<p>I am writing my own SMS application that will display a toast of my message once it arrive. Now is it possible to delete the message after the display of the toast, so that it will not go into the native SMS application?</p><p>Thanks In Advance,Perumal</p>","426201","","","","","2010-09-24 09:52:04","Delete SMS after displaying","<android>","1","0","1","",""
"3785221","1","3785353","","2010-09-24 08:03:38","33","11266","<p>I want to have two <code>TextView</code> elements appear side by side (in a list item), one aligned to the left, one to the right. Something like:</p><pre><code>|&lt;TextView&gt;               &lt;TextView&gt;|</code></pre><p>(the <code>|</code> represent the screen's extremities)</p><p>However, the <code>TextView</code> on the left can have content that is too long to fit on the screen. In this case, I want to have it ellipsize but still show the entire right <code>TextView</code>. Something like:</p><pre><code>|This is a lot of conte...&lt;TextView&gt;|</code></pre><p>I have had numerous attempts at this, using both <code>LinearLayout</code> and <code>RelativeLayout</code>, and the only solution I have come up with is to use a <code>RelativeLayout</code> and put a <code>marginRight</code> on the left <code>TextView</code> big enough to clear the right <code>TextView</code>. As you can imagine, though, this is not optimal.</p><p>Are there any other solutions?</p><p><strong>Final, <code>LinearLayout</code> solution:</strong></p><pre><code>&lt;LinearLayout    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:orientation=""horizontal""    &gt;    &lt;TextView        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_weight=""1""        android:ellipsize=""end""        android:inputType=""text""        /&gt;    &lt;TextView        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_weight=""0""        android:layout_gravity=""right""        android:inputType=""text""        /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>Old, <code>TableLayout</code> solution:</strong></p><pre><code>&lt;TableLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:stretchColumns=""1""    android:shrinkColumns=""0""    &gt;    &lt;TableRow&gt;        &lt;TextView android:id=""@+id/title""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:ellipsize=""end""            android:singleLine=""true""            /&gt;        &lt;TextView android:id=""@+id/date""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:singleLine=""true""            android:ellipsize=""none""            android:gravity=""right""            /&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","180784","","180784","","2010-09-29 13:04:55","2013-07-29 11:39:58","Two TextViews side by side, only one to ellipsize?","<android><android-layout>","4","0","5","",""
"3785304","1","","","2010-09-24 08:16:15","16","17582","<p>I use  <code>Layout_width=""fill_parent</code>"" and <code>Layout_height=""wrap content""</code>. If an image is bigger than the ImageView, it will be downscaled perfectly. </p><p>However, I never got it working to upscale smaller images. I tried any combination of <a href=""http://developer.android.com/reference/android/widget/ImageView.ScaleType.html"">ScaleType</a> and ""AdjustViewBounds"": it always stays in its own size in the middle of the image view. Here is the code...</p><pre><code> &lt;LinearLayout        android:id=""@+id/LinearLayout02""        android:layout_height=""wrap_content""        android:background=""@drawable/content_bg""        android:orientation=""vertical""        android:padding=""5dp""        android:layout_width=""fill_parent""        android:layout_marginLeft=""1px""&gt;        &lt;ImageView          android:layout_height=""wrap_content""          android:src=""@drawable/test""          android:id=""@+id/ImageViewTest""          android:layout_width=""fill_parent""          android:adjustViewBounds=""true""          android:scaleType=""center""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre>","433718","","433718","","2010-10-24 20:53:01","2012-12-03 06:49:38","Does android:scaleType=""fitCenter"" only work with fix Layout_width and Layout_height attributes?","<android><imageview><android-layout><android-image>","4","4","3","",""
"3785442","1","","","2010-09-24 08:37:57","3","222","<p>Which version of Android is needed to create a working augmented reality application ?</p>","456301","","","","","2010-09-24 08:43:30","Augmented reality on Android: which version of the OS would be needed?","<android><version><augmented-reality>","1","0","1","",""
"3785499","1","3785552","","2010-09-24 08:48:09","0","1633","<p>I have created a an activity named Example which have 3 LinearLayouts . I want to start an activity.  So I used the following lines of code</p><pre><code>Intent jumpToStationModule = new Intent();jumpToStationModule.setClassName(""com.xxx"", ""com.xxx.Test"");startActivity(jumpToStationModule);</code></pre><p>Test is another activity. As a result of the above code a new activity is called in new page. But I want to get the same resule or start the activity inside 2nd layout of Example class.</p><p>How to achieve this.</p><p>ThanksSunil Kumar Sahoo</p>","111988","","","","","2010-09-24 08:55:46","How to start an activity inside any layout, android","<android><activity><android-intent>","1","0","","",""
"3785505","1","3790888","","2010-09-24 08:49:48","2","3335","<p>I am Developing an App that parses data from HTML. One of the data that is parsed is an integer that increases over time and rather than constantly requesting the data I would like to have a task that intervals the integer. Due to the fact that I need the value updated into a TextView I decided to go with an AsyncTask rather than a Timer.</p><p>My issue is I want to be able to restart my task once I know that it has finished, or if it is currently RUNNING simply avoid manipulating it.</p><p>Here is my AsyncTask:</p><pre><code>class TurnsUpdate extends AsyncTask&lt;Void, Integer, Exception&gt;{    protected void onPreExecute()    {        turns = Integer.parseInt(DATABASE.getValue(""turns"").replaceAll("" T"", """"));    }    protected Exception doInBackground(Void...voids)    {        while (turns &lt; maxTurns)        {            try            {                Thread.sleep(sleep);            }            catch (InterruptedException e)            {                return e;            }            turns++;            publishProgress(turns);        }        return null;    }    protected void onProgressUpdate(Integer... turns)    {        infoTurns.setText(Integer.toString(turns[0]) + "" T"");    }    protected void onPostExecute(Exception e)    {        vibrator.vibrate(500);    }}</code></pre><p>My attempt to start or avoid:</p><pre><code>  if ((HOME.updateTurns == null || HOME.updateTurns.getStatus() == AsyncTask.Status.FINISHED) &amp;&amp; HOME.updateTurns.getStatus() != AsyncTask.Status.RUNNING)    {        HOME.updateTurns = (UpdateTurns) new UpdateTurns();        HOME.updateTurns.execute();    }</code></pre><p>Am I going about this correctly?</p>","423519","","423519","","2010-09-24 20:36:51","2012-02-22 22:52:59","How to restart an AsyncTask or avoid if RUNNING","<java><android>","2","2","1","",""
"3785537","1","3785597","","2010-09-24 08:54:14","13","3169","<p>Hey, I'm new to Android/ADB</p><p>I've been asked to dump an adb bugreport log by someone.  I managed to do this, but the report was 640k and had a ton of crash dumps for various apps that I was playing with.  I'm trying to present just the information for the app we're interested in.</p><p>Is there a way to reset the log so that I don't have all this other cruft?</p><p>thanks!</p>","283781","","","","","2010-09-24 09:03:38","adb bugreport: Is there a way to reset the log?","<android><adb>","1","0","","",""
"3785671","1","3877429","","2010-09-24 09:14:30","-1","438","<p>In my android application I would like to block the user from changing the device time when my application is opened or minimised. The user should be able to change only once the app gets closed.</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","15825","","2010-09-24 15:14:20","2010-10-06 22:37:51","Time in android","<android>","2","3","1","",""
"3785725","1","7194221","","2010-09-24 09:23:50","5","10237","<p>in my app I should do some action when a call comes but not answered by the user. </p><p>I have searched in the <em>android.telephony</em> and the <em>NotificationManager</em>, but I haven't found a method to solve this problem.</p><p>Does someone have an idea of how to get to know if there is a missed call on the phone or not ?</p>","453676","","114066","","2011-11-08 15:03:34","2011-11-08 15:03:34","How to retrieve missed calls on Android SDK 2.2","<android><notifications><telephony>","3","0","8","",""
"3785919","1","3786144","","2010-09-24 09:52:09","0","286","<p>Basically, i have purchased HTC Hero (Android sdk 1.5) , but i just got the notification of ""System software update"" and i agreed to update the <strong>sdk to 2.1-update1</strong> .</p><p>I was developing application for android sdk 1.5 successfully, but now i have created a Hello world application for the Android sdk 2.1 and then when i am trying to run it on my updated phone, at that time below screen is showing up:</p><p><img src=""http://i.stack.imgur.com/OZxQ8.png"" alt=""alt text""></p><p><em><strong>where you can see ?????? in serial number and Taget is shown as ""unknown"".</em></strong></p><p>On console window, it is showing up an error: <strong>""Automatic Target Mode: Unable to detect device compatibility.""</strong></p><p><strong>(1st question):</strong> What i need to do to run the application(sdk 2.1) which i am developing ? pls let me know</p><p>And ya, when i am trying to connect phone using USB cable, it is showing an alert dialog regarding ""Choose a connection type:"" showing below options:</p><ol><li>Charge only</li><li>HTC Sync</li><li>Disk drive</li><li>Internet Sharing</li></ol><p><strong>(2dn question)</strong>: so which mode should i select for the development of application and running it on phone.</p>","379693","","379693","","2010-09-24 10:30:33","2010-09-24 10:30:33","Android - Run application on SDK 2.1","<android><android-2.1-eclair>","1","2","1","",""
"3786000","1","","","2010-09-24 10:04:02","2","316","<p>In my app, I should set up a ""real"" custom listview. For example : </p><hr><p>First line(Some Text)               Checkbox</p><p>Second line(Some Text)              Spinner</p><hr><p>What I mean is that each line has different widget. In the example, for the first line, we have a checkbox, for the second, it is a Spinner.</p><p>Does someone have any idea of how I can set it up?</p><p>Thanks a lot!</p>","453676","","","","","2010-09-24 12:05:40","How to set up a real custom Listview?","<android><listview>","2","0","1","",""
"3786037","1","","","2010-09-24 10:10:38","1","583","<p>Hi allI create a table like that</p><pre><code>private static final String CREATE_TABLE_PRODUCT = ""create table prod (id integer primary key,titre text not null, desc text, is_free integer);"";</code></pre><p>i update it this way</p><pre><code>    SQLiteDatabase db = getConnection();    ContentValues updateEvent = new ContentValues();    updateEvent.put(""is_free"", 1);    int ok = db.update(prod, updateEvent, ""id=?"",            new String[] { Long.toString(evenement.getId()) });    db.close();</code></pre><p>I do see the change in eclipse with DDMS questoid </p><p>but when i try to retrieve the value I get nothing ....</p><pre><code>        Cursor c = db.query(prod, new String[] { ""id"",                ""titre"", ""desc"", ""is_free"", },                  ""is_free=?"", new String[] {""1""}, null, null,                null);</code></pre><p>I've tried some variant like </p><pre><code>    String query = ""SELECT * FROM ""+EVENEMENT_TABLE+"" WHERE is_free=1;"";    Cursor c = sdb.rawQuery(query, null);</code></pre><p>with no success</p><p>is this problem come from the type (integer) of my column ?Any help</p>","384873","","21886","","2010-09-24 10:19:45","2010-10-26 18:27:51","No result on sqlite query","<android><sqlite>","1","1","","",""
"3786114","1","3786132","","2010-09-24 10:25:10","6","5839","<p>i need to let service sleep for 0.5 sec just as using Thread.sleep();</p><p>is there any method??</p>","422405","","","","","2010-09-24 10:27:11","android , is there any method to let service delay or sleep?","<android>","1","0","1","",""
"3786214","1","","","2010-09-24 10:38:49","3","2715","<p><img src=""http://i.stack.imgur.com/JBgeh.png"" alt=""alt text""> </p><p><img src=""http://i.stack.imgur.com/5ZzKa.png"" alt=""alt text""></p><p>i am developing gallery view using gridview,in small screen my layout design fixed very well,but large screen did not my design,In large screen have some spaces bellow ""load more picture"" button refer fig2,how can i solve this problem,my Manifest file added this lines for support various screen,please give some sample code for me..</p><pre><code>&lt;supports-screens android:largeScreens=""true"" android:normalScreens=""true"" android:smallScreens=""true"" android:anyDensity=""false"" /&gt; </code></pre><p>and my xml code </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge android:layout_width=""wrap_content"" android:layout_height=""340dp"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt; &lt;LinearLayout  android:id=""@+id/LinearLayout01""   android:layout_width=""fill_parent""  android:layout_height=""335dp"" android:orientation=""vertical""  android:background=""@color/black""&gt; &lt;GridView                     android:id=""@+id/jr_lookbook_grid"" android:layout_width=""fill_parent""                    android:layout_height=""335dp"" android:numColumns=""4""                    android:verticalSpacing=""10dp"" android:horizontalSpacing=""10dp""                    android:columnWidth=""90dp"" android:stretchMode=""columnWidth""                    android:adjustViewBounds=""true""                    android:background=""@drawable/shape""                      android:gravity=""center""  android:layout_weight=""1""/&gt;&lt;/LinearLayout&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/LinearLayout0209_img""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:gravity=""center""    android:paddingTop=""311dp""&gt;         &lt;Button  android:id=""@+id/click""                android:background=""#AA000000""                    android:text=""Load More Pictures...""                  android:textColor=""@color/white""                                     android:layout_width=""fill_parent"" android:layout_height=""30dp""/&gt;    &lt;/LinearLayout&gt;  &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/LinearLayout02_img""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""    android:layout_gravity=""center""    android:layout_alignParentBottom=""true""    android:background=""@color/black""                android:layout_alignParentLeft=""true""&gt;    &lt;WebView         android:id=""@+id/webview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""                 android:scrollbars=""none"" /&gt;    &lt;ImageView android:id=""@+id/ImageView01""     android:layout_gravity=""center_horizontal""    android:scaleType=""centerInside""    android:layout_width=""wrap_content""     android:layout_height=""fill_parent""    android:adjustViewBounds=""true""&gt;&lt;/ImageView&gt;      &lt;/LinearLayout&gt;   &lt;LinearLayout android:id=""@+id/LinearLayout02""     android:background=""#AA000000""          android:layout_width=""400px""        android:layout_height=""50dp""        android:layout_gravity=""bottom""&gt; &lt;Button    android:id=""@+id/back                android:layout_height=""wrap_content""               android:background=""@drawable/back1""                android:layout_alignParentRight=""true""                android:layout_marginLeft=""10dp"" /                 &lt;Button                  android:background=""@drawable/forward5""                android:id=""@+id/next""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:gravity=""center""                android:layout_alignParentRight=""true""                android:layout_marginLeft=""150dp""/&gt;                  &lt;Button                  android:background=""@drawable/menushare""                android:id=""@+id/photoshare""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:gravity=""center""                android:layout_alignParentRight=""true""                android:layout_marginLeft=""20dip"" /&gt;&lt;/LinearLayout&gt;&lt;/merge&gt;</code></pre><p>Thanks All</p>","410757","","410757","","2010-09-25 08:48:04","2013-03-18 22:27:48","how to layout support for various screen in android?","<android>","2","0","","",""
"3786250","1","3786663","","2010-09-24 10:43:53","0","2034","<p>I have problem with displaying bitmap image on imageview on high density screen (480x800). When the bitmap image  loaded from file on sdcard, the image does not scale to fit hdpi screen. On medium density screen it works normal (320x480).</p><pre><code>public static Bitmap getBitmapFromFile(String src) {    File file = new File(src);    if (file.exists()) {        return BitmapFactory.decodeFile(src);    }    return null; } mImage.setImageBitmap(Util.getBitmapFromFile(filePath));</code></pre><p>Screenshoot on hdpi &amp; mdpi<a href=""http://202.148.2.34/~lorenz/iview.jpg"" rel=""nofollow"">http://202.148.2.34/~lorenz/iview.jpg</a></p>","431041","","","","","2011-07-08 04:27:50","Bitmap image from file does not scale on high density device","<android><bitmap>","2","0","","",""
"3786511","1","3788120","","2010-09-24 11:18:20","1","2138","<p>I would like to change margin of my buttons in d applcn...suppose I have 5 buttons like this in a linear layout, one below d other...</p><p>When I focus on a button, its width should increase (which I know how to handle) and at the same time, width should increase linearly towards both left and right.</p><p>i.e. If the current width of the button is 250 with x co-ordinate as 50 (that means button's left is 50 and button's right is 300), when I focus on the button I should get x co-ordinate as 75 (left = 25 and right = 325). How to change the margin/x co-ordinate of the button?</p>","456936","","","","","2010-09-24 14:36:57","Changing X and Y position of button/ changing margin of button dynamically","<android><margin>","1","0","","",""
"3786627","1","","","2010-09-24 11:33:26","-1","999","<p>Has any one implemented C2dm succefullly,then please send the code, how to get registration_id form c2dm server for our application.</p><p>thanks in advance.</p>","457220","","","","","2012-04-11 10:50:01","Application in c2dm server","<android>","1","2","1","2014-02-22 04:53:17",""
"3786653","1","3788370","","2010-09-24 11:36:28","4","1781","<p>Since Objective-C exists and is supported even in MinGW, by passing <code>-x objective-c</code>, is there a hack to achieve this with Android SDK? I've did a rudimentary test on a colleague's machine where it appears that language <code>objective-c</code>is not supported.</p><p>I am not interested in getting UIKit or AppKit, or even Foundation, to work; I've written most of an OpenGLES game in Objective-C, and successfully ported it to Mac OS X and Windows; I am fairly certain I could easily port it to GNU/Linux once I get time to figure out enough of GNUStep (and even without it, I could create the classes to get the game running). </p><p>I'm just interested in the base language and basic runtime (including properties, if possible); even <code>NSObject</code> can be easily written to the extent I need it.</p><hr><p>In the meantime, I've managed to compile some Objective-C code, and have written a guide for this:</p><ul><li><a href=""http://blog.vucica.net/2011/06/developing-objective-c-apps-for-android-using-mac-os-x.html"" rel=""nofollow"">Developing Objective-C apps for Android using Mac OS X</a></li></ul><p>If you like it, you can upvote my answer below.</p>","39974","","39974","","2011-07-21 12:05:11","2013-07-25 16:47:38","gcc -x objective-c with Android SDK","<android><objective-c><gcc><objective-c++>","3","2","2","",""
"3786660","1","","","2010-09-24 11:37:25","3","1605","<p>I want to get the Information of the Music track playing on a android device?Is there any android powered api available for this?</p><p>Or do I have to write a plugin for respective android media players?</p>","457224","","","","","2011-05-19 18:09:23","How to get the Information of the Music track playing on a android device?","<android>","2","0","2","",""
"3786674","1","5192010","","2010-09-24 11:39:33","2","3255","<p>i try to connect (HttpClient) to an internal server in my app via wi-fi. But every time i got an UnknownHostException if I use the domain name of the server (http://domainname/..). If i use the Ip instead, it works well. This happens not only on the emulator but also on a real device (htc desire).</p><p>Did anyone got the same problem?Solutions i found in web only refer the problem to emulator.<a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg16951.html"" rel=""nofollow"">http://www.mail-archive.com/android-developers@googlegroups.com/msg16951.html</a></p><p>Thanks for your support</p>","457192","","","","","2011-03-04 09:38:11","Android name resolution in internal server doesn't work (device and emulator)","<android><nslookup>","1","1","","",""
"3786715","1","3786997","","2010-09-24 11:44:53","0","452","<p>Hi I have a listview and I am trying to start an activity from the listview by {startActivity(class.java);}</p><p>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;</p><pre><code>public class ll2 extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        String[] myList = new String[] {""Accrington Stanley"", ""Aldershot Town"", ""Barnet"", ""Bradford City"", ""Burton Albion"", ""Bury"", ""Cheltenham Town"", ""Chesterfield"", ""Crewe A"", ""Gillingham"", ""Hereford Utd"", ""Lincoln City"", ""Macclesfield T"", ""Morecombe"", ""Northampton T"", ""Oxford Utd"", ""Port Vale"", ""Rotherham Utd"", ""Shrewsbury T"", ""Southend Utd"", ""Stevenage"", ""Stockport C"", ""Torquay Utd"", ""Wycombe W""};                      ListView lv = new ListView(this);        lv.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,myList));        setContentView(lv); }        public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id) {        if (""Bradford City"".equals(MyList()[position]))        {startActivity(Bradford.java);}   }}</code></pre><p>I am getting a error with this line if (""Bradford City"".equals(MyList()[position]))  method myList() is undefined for the type ll2</p><p>I have tried allsorts of methods and I cannot get anything to work.  All I want to do is for each team in the list have a separate java file(Class) With activities in them, Help I'm at my wits end.</p>","445174","","25282","","2010-09-24 12:24:44","2012-04-16 08:46:46","Start an activity from a listview","<java><android><eclipse>","2","6","1","",""
"3786929","1","","","2010-09-24 12:11:58","0","158","<p>Can an Android application include a widget or is the widget an application itself and needs to be separated from the application ?</p>","456301","","","","","2010-09-24 12:30:20","Can an Android application include a widget or is the widget an application itself and needs to be separated from the application?","<android><widget>","1","0","","",""
"3787005","1","","","2010-09-24 12:22:05","4","1408","<p>As we know, we can rotate a bitmap through 2 ways. </p><p><strong>The 1st way is:</strong></p><pre><code>Matrix mt = new Matrix(); mt.postRotate(degree); Bitmap bitmap = CreateBitmap(src, 0, 0, w, h, mt, true); canvs.drawBitmap(bitmap, 0, 0, paint); </code></pre><p>In this way, we always need create new bitmap for every rotation, it is not good way for high performance game or app. </p><p><strong>The 2nd way is:</strong></p><pre><code>canvas.save(); canvas.rotate(degree); canvas.drawBitmap(bitmap, 0, 0, paint); canvas.restore(); </code></pre><p>In this way, we avoid creating new bitmap frequently, but the rotation bitmap is distortion, the bitmap quality is worse than first way. </p><p>So, Is there 3rd way to rotate bitmap with high performance and good quality? </p><p>Your any comments are really appreciated!</p>","457210","","180740","","2011-09-20 19:49:10","2013-03-20 12:55:28","Question about rotate bitmap with Canvas.rotate","<android>","2","0","2","",""
"3787269","1","4259623","","2010-09-24 12:59:09","6","5941","<p>With the new  tag of the AndroidManifest, is it also possible to define my application requires an accelerometer? It seems to me only light sensor and proximity sensor are supported in the  tag.</p><p>Thanks in advance.</p>","120309","","","","","2010-11-23 18:50:50","Uses-feature accelerometer in the manifest","<android><android-manifest>","2","0","1","",""
"3787329","1","","","2010-09-24 13:05:50","1","2231","<p>I want to create a mapview marker with 4 elements:- picture (of user)- background- text (username)- Arrow to show an direction</p><p>OverlayItem.setMarker() accept only a drawable. </p><p>How can I create an drawable with 4 Items? Or can i add an View as marker to overlayItem?</p><p>any ideas?</p>","457299","","457299","","2010-09-27 18:26:23","2010-10-07 07:21:06","how to create an custom android maps marker?","<android><android-mapview><drawable><google-maps-markers>","1","0","1","",""
"3787417","1","","","2010-09-24 13:14:44","2","518","<p>I have an Android project that I have been working on and debugging just fine for several months, but for some reason it is now consistently hanging at the ""Runnning tests..."" step.  I have experienced intermittent hangs from the beginning, but a simple retry and/or restart of Eclipse or the emulator usually resolves it.  But now I am just dead in the water.</p><p>I can run my tests fine, and I can debug my actual program, but I can't debug my tests.</p><p>I have tried creating a new emulator and that doesn't fix it.  I also cleared all my breakpoints and that had no effect.</p><p>As far as what has changed lately, the primary thing is that I upgraded to rev 7 of the SDK tools.  Also, I recently did some debugging (of the program not the tests) on an actual device (not the emulator).  Can't see how that would impact it but I thought I would mention it.</p><p>Actually I had to set Debuggable to ""true"" in the app manifest to get device debugging to work.  Although I have never had that set in my test project, I set it, and that also had no effect on the issue.</p><p>I'm running out of ideas, and I would greatly appreciate some pointers.  Thanks.</p>","457317","","","","","2010-09-28 12:03:06","Attempt to debug my test project consistently hangs at ""Running tests..."" step","<android>","1","0","","",""
"3787573","1","","","2010-09-24 13:29:19","-1","247","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3786715/start-an-activity-from-a-listview"">Start an activity from a listview</a>  </p></blockquote><p>I have 24 teams in a list, I have 24 separate .java classes for each team with information about those teams.  When the user click on an item(Team) in the list I want to goto that teams java file(Class) and display there information. below is the code,</p><pre>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;public class ll2 extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        String[] myList = new String[] {""Accrington Stanley"", ""Aldershot Town"", ""Barnet"", ""Bradford City"", ""Burton Albion"", ""Bury"", ""Cheltenham Town"", ""Chesterfield"", ""Crewe A"", ""Gillingham"", ""Hereford Utd"", ""Lincoln City"", ""Macclesfield T"", ""Morecombe"", ""Northampton T"", ""Oxford Utd"", ""Port Vale"", ""Rotherham Utd"", ""Shrewsbury T"", ""Southend Utd"", ""Stevenage"", ""Stockport C"", ""Torquay Utd"", ""Wycombe W""};                      ListView lv = new ListView(this);        lv.setAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1,myList));        setContentView(lv);    }    public void onItemClick(AdapterView parent, View view,int position, long id) {       Intent myList = new Intent();        myList.setClass(this, Bradford.class);        if (""Bradford City"".equals(myList))            startActivity(Bradford.java);    }}</pre><p>As you can see I have setup the Bradford class and I have registered this in android manifest but when I click on bradford nothing happens, also when I try to set up another intent for another team the mylist value cannot be used again.</p><p>How do I make this work</p>","445174","","300311","","2010-09-24 13:41:52","2012-04-16 09:05:49","Start an activity from a listview","<java><android><eclipse>","1","1","","2012-04-16 12:26:02",""
"3787695","1","4157361","","2010-09-24 13:44:31","1","510","<p>I have a ListView a row of which contains a couple of TextViews, an image and a button.My requirement is that when a row item is selected, the Text Style and color of the TextViews and the background drawable of the button should change.  </p><p>I am not sure of how to do this.  </p><p><strong>Questions/Assumptions/What I think:</strong>  </p><ol><li><p>Will having a state drawable for every item in the row work here? I have read some where that ListView has problems when there are focusable components present in its row.  </p></li><li><p>Should this be done programmatically? Like should I intercept the itemSelected/onRowFocus or equivalent method of the ListView object and make the necessary changes?   </p></li></ol><p>Please help.</p><p>Thanks.</p>","366053","","","","","2010-11-11 17:34:48","Formatting listview row items on Selection","<android><listview>","1","0","1","",""
"3787696","1","","","2010-09-24 13:44:41","0","532","<p>I did a simple program by overriding each of the lifecycle methods and everything works as I'd expect, except for <code>onRestoreInstanceState(Bundle savedInstanceState)</code>.</p><p>I overrode the method as</p><pre><code>@Override    protected void onRestoreInstanceState(Bundle savedInstanceState) {    super.onRestoreInstanceState(savedInstanceState);       Toast.makeText(getBaseContext(), ""onRestoreInstanceState - Activity1 "", Toast.LENGTH_SHORT).show();    }</code></pre><p>But it never gets called.</p><p>I overrode <code>onSaveInstanceState(Bundle outState)</code> too and I can see the system calling it, but never the <code>onRestoreInstanceState(Bundle savedInstanceState)</code>. When I press back button or so, I can see that the system calls <code>onRestore()</code>, <code>OnStart()</code> and <code>onResume()</code>, and the UI (just two buttons) are displayed correctly.</p><p>How is it possible that the UI is restored without calling <code>onRestoreInstanceState(Bundle savedInstanceState)</code>? I only do <code>setContentView(R.layout.main)</code> is <code>onCreate(savedInstanceState)</code>. So how does it restore the UI without calling either <code>onCreate()</code> or <code>onRestoreInstanceState()</code>?</p><p>Would really appreciate somebody shedding some light on this.</p><p>Thank you.</p>","455048","","","","","2011-06-20 22:50:59","Confusing Android Activity lifecycle bahavior","<android><activity><lifecycle>","1","0","","",""
"3787734","1","3788162","","2010-09-24 13:49:19","0","1158","<p>whats the difference between MyActivity.finish() and MyActivty.this.finish()?  I see an example where MyActivty.this.finish() is called from hitting the OK button on a dialog asking if you want to exit the app.  isn't the "".this"" part redundant?</p>","457358","","","","","2010-09-24 14:42:32","Question about the android .finish() method","<android>","1","0","","",""
"3787800","1","7668798","","2010-09-24 13:58:03","6","8206","<p>I have an application which loads urls from a website. Now I want that the application to use the cache when offline. But I just get the failure page which says that im not connected to the website. At first I set the Cachemode to Load_Normal but this doesn't help. Next I tried a realy ""silly"" approach using the ConnectivityManager:</p><pre><code>cm = (ConnectivityManager) this.getSystemService(Activity.CONNECTIVITY_SERVICE);if(cm.getActiveNetworkInfo().isConnected()){  mfnWebView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);  mfnWebView.loadUrl(url);}else{  mfnWebView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);  mfnWebView.loadUrl(url);}</code></pre><p>but this just leads to crashing the application.</p><p>Is there a simple way to load the cache when offline and existing and just if not existing showing the failure message.</p>","446842","","151019","","2012-07-16 10:57:23","2013-07-05 06:40:48","Loading Cache when Offline in Android Webview","<android><caching><webview><offline>","2","0","7","",""
"3787812","1","7554198","","2010-09-24 14:00:31","0","1792","<p>Im trying to strip all non standard letter characters from an edittext textbox on an android app im making.   I am successfully creating a listener, obtaining the value and removing bad chrs via a regex.  however, the .setText line below causes the app to crash.   Anyone got any ideas how to get around this and dynamically mask certain chrs?</p><p>filenameTextBox.addTextChangedListener(new TextWatcher() { </p><pre><code>  public void onTextChanged(CharSequence s, int start, int before, int count) {   FILENAME=s.toString();   FILENAME = FILENAME.replaceAll(""[^a-zA-Z]"", """");   filenameTextBox.setText(FILENAME);</code></pre><p>}}</p>","1022861","","","","","2014-01-22 23:46:04","setText for edittext causing crash in addTextChangedListener","<android><edittext>","3","0","1","",""
"3787841","1","3791519","","2010-09-24 14:05:02","0","843","<p>I don't know how to elegantly solve the following task:</p><ol><li>I have several blocks of code (operation) to execute. </li><li>Each block can return <code>true</code> of <code>false</code> to indicate that further execution is possible.</li><li>Inside of each block I have to use asyncronous methods calls (Because Android is completeley asynchronous).</li></ol><p>Example of processing operations (not working now as expected):</p><pre><code>      List&lt;Operation&gt; operations = command.getOperations();      for (Operation operation : operations) {          Log.d(TAG, ""Processing operation: "" + operation);          OperationResult result = operation.execute(activity);          Log.d(TAG, ""Operation result is: "" + result);          if (!result.canContinue()) {              break;          }      }</code></pre><p>The problem is that inside of the operation I need, for example, display AlertDialog and wait for the input. But after I call <code>dialog.show()</code> my method <code>execute</code> finishes and it returns incorrect result. </p><p>Example of the button listener, registerd with AlertDialog is below:</p><pre><code> final OperationResult result = new OperationResult(); final class ButtonListener implements DialogInterface.OnClickListener {    public void onClick(DialogInterface dialog, int id) {        switch (id) {        case DialogInterface.BUTTON_POSITIVE: {                result.setCanContinue(true);        }        case DialogInterface.BUTTON_NEGATIVE: {            dialog.cancel();                result.setCanContinue(false);        }    }}</code></pre><p>How should I modify processing of operations to support asynchronous model of Android?</p>","216764","","216764","","2010-09-24 14:14:37","2010-09-28 18:56:38","Perform several tasks synchronously in Android","<android><user-interface><asynchronous><interaction>","2","0","","",""
"3787893","1","","","2010-09-24 14:12:16","3","838","<p>I have a long text and i want it to be displayed with a TextView. The text i have is much longer than the available space. However i don't want to use scrolling, but ViewFlipper to flip to the next page. How can i retrieve the lines from the first TextView that are not shown because the view is to short so that i can paste them into the next TextView?</p><p>Edit: I found the Solution to my Problem. I simply have to use a custom View with a StaticLayout like this:</p><pre><code>public ReaderColumView(Context context, Typeface typeface, String cText) {        super(context);        Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();        dWidth = display.getWidth();         dHeight = display.getHeight();        contentText = cText;        tp = new TextPaint();        tp.setTypeface(typeface);        tp.setTextSize(25);        tp.setColor(Color.BLACK);        tp.setAntiAlias(true);        StaticLayout measureLayout = new StaticLayout(contentText, tp, 440, Alignment.ALIGN_NORMAL, 1, 2, true);        Boolean reachedEndOfScreen = false;        int line = 0;        while (!reachedEndOfScreen) {            if (measureLayout.getLineBottom(line) &gt; dHeight-30) {            reachedEndOfScreen = true;            fittedText = contentText.substring(0, measureLayout.getLineEnd(line-1));            setLeftoverText(contentText.substring(measureLayout.getLineEnd(line-1)));            }            line++;        }    }protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        StaticLayout textLayout = new  StaticLayout(fittedText, tp, 440, Alignment.ALIGN_NORMAL, 1, 2, true);        canvas.translate(20,20);        textLayout.draw(canvas);    }</code></pre><p>Thats not optimized yet but you get the point.I hope it might help somebody like me with a similar problem.</p>","457378","","457378","","2010-09-30 16:30:05","2010-09-30 16:30:05","If a text in a TextView is longer than the available space, how to get the remaining lines?","<android><android-widget>","0","0","1","",""
"3787934","1","","","2010-09-24 14:16:32","0","386","<p>I'm considering a UI change that will look like such:</p><p>There will be a list of items in an ExpandableListView.  Clicking on an item expands 1 more item below it.  This item will have its own view which will contain a number of things pertaining to the item it expanded from.  Basically, imagine clicking on the original list item and being taken to a new screen with information on that item.  The expanded item in the new list will essentially be that screen.</p><p>I know there are troubles with list items containing controls like buttons and checkboxes and such.  So long as only the list item those controls are resting on is not clickable, they should work, right?  The expanded item doesn't need clicking capabilities, but the parent item will (so it can be expanded/closed!)</p>","406790","","","","","2010-09-24 14:16:32","ExpandableListView with buttons","<android><listview><expandablelistview>","0","2","","",""
"3788018","1","","","2010-09-24 14:26:03","3","477","<p>I am simply trying to get the path of an image that the user selects and then convert it into a bitmap. The problem is, only some of the images in the gallery work when selected (by ""work"" I mean they are found to be a file that exists), while the others claim the file does not exist (even though the image is showing up in the gallery?). Even more strange is that this doesn't seem to be consistent, an image that was at one point considered to ""exist"" now claims to be nonexistent. My code is below:</p><p>-----The Intent-----</p><pre><code>Intent intent = new Intent(Intent.ACTION_PICK);intent.setType(""image/*"");startActivityForResult(intent, GALLERY_ACTIVITY);</code></pre><p>-----onActivityForResult-----</p><pre><code>Uri uri = intent.getData();String [] proj={MediaStore.Images.Media.DATA};Cursor cursor = managedQuery(uri,proj,null,null,null);int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);cursor.moveToFirst();BitmapFactory.Options opts = new BitmapFactory.Options();&lt;br/&gt;opts.inSampleSize = 2;&lt;br/&gt;Bitmap b = BitmapFactory.decodeFile(cursor.getString(column_index),opts);</code></pre><p>Any ideas on this will be greatly appreciated, thank you!</p><p>Matt.</p>","457393","","128165","","2011-05-28 11:48:14","2012-01-08 07:45:50","Getting Images From Gallery - Not All ""Exist""?","<android><image><android-intent><gallery><filenotfoundexception>","1","0","2","",""
"3788079","1","","","2010-09-24 14:33:10","0","215","<p>as an end user, can I surpress sms alerts in the notification bar on android 2.1 (alert - but not show the first line of text)?Is there a phone setting? Or an app out there that allows this choice?</p>","457403","","","","","2011-04-05 15:45:27","as a user, can I surpress sms alerts in the notification bar on android 2.1 (alert - but not show the first line of text)?","<android><android-2.1-eclair>","1","1","","",""
"3788105","1","3794108","","2010-09-24 14:35:50","0","1623","<p>I´m trying to rotate a sprite using drawtexture but nothing happens. I´m using the following code: </p><p>gl.glRotatef(90, 0, 0, 1.0f);gl.glBindTexture(GL10.GL_TEXTURE_2D, TextureID);(GL11Ext) gl).glDrawTexfOES(x, y, z, width, height);</p><p>The texture is drawn to the screen but it is not rotated... Anyone? :)</p>","457401","","44729","","2010-09-24 15:22:29","2010-09-25 13:59:48","Problems rotating a sprite using drawtexture (OpenGl ES Android)","<android><opengl-es><rotation><glrotate>","2","0","1","",""
"3788205","1","4425266","","2010-09-24 14:48:00","2","11169","<p>I wan to hide/show my caller id from my activity programmatically. I tried to find it in the android documentation but without the luck. Maybe you have any ideas?</p>","400493","","881229","","2014-03-18 20:07:47","2014-03-18 20:07:47","android Outbound caller id - on/off","<android><gsm>","5","1","1","",""
"3788281","1","","","2010-09-24 14:55:27","0","913","<p>In simplest terms, I feel that these texture compression schemes should be available on all android devices, but I'm not sure about 2, and even then, I'm not so sure about 1.</p><ol><li>compressed paletted texture</li><li>ETC1 (RGB 8 bit)</li></ol><p>I can't seem to find the docs on this at developer.android.com. :(</p><p>If anyone just knows this info off the top of their head, I bet they'd be here at StackOverflow. :)</p>","372603","","","","","2010-09-26 23:08:45","What common texture compression, if any, is available on the Android platform?","<android><compression><textures>","2","0","","",""
"3788497","1","3896948","","2010-09-24 15:19:59","1","1597","<p>I have some <code>AsyncTask</code> that loads a video stream into the player, so I want to show some Loading screen while it performs. Currently my <code>onCreate</code> code looks like this:</p><pre><code>final View loadingView = getLayoutInflater().inflate(R.layout.video_loading, null);final View playerView = getLayoutInflater().inflate(R.layout.player, null);final VideoView videoView = (VideoView) playerView.findViewById(R.id.canvas);Log.d(TAG, ""Running video player for video "" + videoId);new VideoPlayingTask(this, videoView.getHolder()) {    protected void onPreExecute() {        setContentView(loadingView);        super.onPreExecute(); // it creates or re-uses (resetting it before)                            // MediaPlayer instance inside and sets display using setDisplay to the passed holder    };    protected void onPostExecute(FileInputStream dataSource) {        setContentView(playerView);        videoView.requestFocus();        super.onPostExecute(dataSource); // it sets data source,                                         // prepares player and starts it    }; }.execute(videoId);</code></pre><p><code>loadingView</code> is displayed properly, then when changing content to <code>playerView</code>, screen goes black, but sound plays properly in background. </p><p>I get these two warnings from MediaPlayer in the logs:</p><pre><code>info/warning (1, 35)info/warning (1, 44)</code></pre><p>I've tried to use <code>ViewSwither</code> and to call <code>showNextView</code> inside <code>onPostExecute</code>, but the behavior was similar, black screen when changing to <code>videoView</code>.</p><p>I've tried the way with two inner layouts laying inside current and switch their visibility manually, and this also not helped to me. </p><p>When I use just single <code>VideoView</code> in this activity, it works perfectly and shows both image and sound. </p><p><code>video_loading.xml</code>:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""                             android:gravity=""center""&gt;    &lt;ProgressBar android:layout_width=""@dimen/small_progress_side""                 android:layout_height=""@dimen/small_progress_side"" /&gt;    &lt;TextView android:layout_width=""wrap_content""              android:layout_height=""wrap_content""              android:layout_marginLeft=""5dp""              android:text=""@string/caching_video"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><code>player.xml</code>:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""&gt;    &lt;VideoView android:id=""@+id/canvas""               android:layout_width=""fill_parent""               android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt; </code></pre><p><a href=""http://stackoverflow.com/questions/3681976/videoview-in-viewflipper-is-transparent-when-video-is-playing"">this question</a> seems a little bit similar, but switching <code>loadingView</code> visibility to <code>INVISIBLE</code> does not work in my case.</p>","167262","","167262","","2010-09-24 18:13:30","2010-10-09 16:46:24","VideoView plays ok, but not visible when swapping fullscreen views","<android><video><media-player><videoview>","1","0","","",""
"3788530","1","3788658","","2010-09-24 15:24:07","0","201","<p>Hopefully someone can give me a pointer.  I have an application that makes several web service calls.  I'm in the middle of a refactor and I've pulled the actual calls out to a new class.  The problem is that I can't seem to use:</p><p>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);or TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);</p><p>within my class.  I'm not extending anything, so I suppose the problem is that I don't have the application context. Is there a good base class that I should be extending to be able to use these or some secret to it?</p>","245634","","","","","2010-09-24 15:38:39","Android: getting system services from within a application level library class","<android>","1","0","","",""
"3788547","1","","","2010-09-24 15:28:00","0","503","<p>Is there any way to encrypt data passing between two android phones in j2me?</p><p>Not to mention I am using BT as medium.</p>","170986","","170986","","2010-09-24 15:38:42","2010-12-23 05:53:58","md5 hash or simpler hash implemtation in android j2me","<android><encryption><hash><bluetooth>","1","4","","",""
"3788804","1","3788882","","2010-09-24 15:52:06","1","356","<p>I've been playing about with the layout of a view with Android (lets say within the MainActivity) and I'm looking to create this sort of layout using 3 ImageView's (where each block represents an image):</p><p><img src=""http://i.stack.imgur.com/ZdKo6.png"" alt=""alt text""></p><p>This is rather easy to pull of using LinearLayout's but only if you specify the exact size and position of each ImageView. This then obviously causes problems when looking at different screen sizes.</p><p>Using AbsoluteLayout looked like it was going to work at first, but I've read that it's deprecated and it still causes problems with different screen sizes.</p><p>Then there is RelativeLayout, which I've tried using with <a href=""http://www.droiddraw.org"" rel=""nofollow"">DroidDraw</a>, but it doesn't seem to get me very far when I implement it :(</p><p>So, does anyone have an ideas of how to achieve this?</p><p>EDIT: I've got close to doing this using <code>dp</code> instead of <code>px</code> but this still gets screwed up when using larger resolution devices! :(</p><p>Thanks</p>","143979","","143979","","2010-09-28 15:28:55","2010-09-28 15:28:55","Android View Design Issues","<android><xml><design><gui>","4","0","","",""
"3788904","1","3789267","","2010-09-24 16:06:36","0","388","<p>Is it possible to customize the call screen in Android? Example would be, two users have the same application, user calls, but the other user cannot pick up, so they respond with some type of predetermined image baked into the application.</p><p>Is this possible?Does this break any rules?</p>","300972","","","","","2011-02-23 05:54:04","Android: Is it possible to add functionality to the call screen?","<android>","1","0","","",""
"3788916","1","","","2010-09-24 16:08:00","0","688","<p>There is a HTML page that has a javascript function in it.This function returns a frame with a random picture.Is there a way to call this function and get the HTML code that is hidding? (So i get the image)</p><p>Exactly i want to get a html stream from <a href=""http://partner.googleadservices.com/gampad/google_service.js"" rel=""nofollow"">GoogleServices.js</a>by calling:</p><pre><code>GS_googleAddAdSenseService(""ca-pub-YOURPUBIDHERE"");  GS_googleEnableAllServices();  GA_googleAddSlot(""ca-pub-YOURPUBIDHERE"", ""ADSLOT_NAME_HERE"");  GA_googleFetchAds();GA_googleFillSlot(""ADSLOT_NAME_HERE"");</code></pre>","348058","","348058","","2010-09-24 16:13:23","2010-09-24 18:33:40","How to call a javascript function and get the html code it returns ,Java,Android","<java><javascript><android>","1","2","","",""
"3789032","1","3789121","","2010-09-24 16:23:45","2","1120","<p>I have a TextView that is a single line. How can I add ellipses (...) if the text is too long?</p>","19875","","","","","2011-07-14 09:08:06","How to abbreviate a TextView?","<android><xml><textview>","2","0","","",""
"3789223","1","3789300","","2010-09-24 16:48:19","1","1656","<p>Here is my color XML</p><pre><code>&lt;resources&gt;    &lt;drawable name=""red""&gt;#7f00&lt;/drawable&gt;    &lt;drawable name=""blue""&gt;#770000ff&lt;/drawable&gt;    &lt;drawable name=""green""&gt;#7700ff00&lt;/drawable&gt;    &lt;drawable name=""yellow""&gt;#77ffff00&lt;/drawable&gt;    &lt;drawable name=""screen_background_black""&gt;#ff000000&lt;/drawable&gt;    &lt;drawable name=""translucent_background""&gt;#e0000000&lt;/drawable&gt;    &lt;drawable name=""transparent_background""&gt;#00000000&lt;/drawable&gt;    &lt;color name=""solid_red""&gt;#ED1C24&lt;/color&gt;    &lt;color name=""solid_blue""&gt;#0000ff&lt;/color&gt;    &lt;color name=""solid_green""&gt;#39B54A&lt;/color&gt;    &lt;color name=""solid_yellow""&gt;#ffffff00&lt;/color&gt;&lt;/resources&gt;</code></pre><p>Here is my Java code:</p><pre><code>if (floatedChange &lt; 0)                            changeText.setTextColor(R.color.solid_red); //red                        else                            changeText.setTextColor(R.color.solid_green); //green</code></pre><p>This works when I use Color.RED or Color.GREEN, but when I use my own colors. The color doesn't show up. </p><p>Why?</p>","19875","","","","","2011-05-20 19:34:57","Problem setting TextView color","<java><android><xml><textview>","2","0","","",""
"3789327","1","3789523","","2010-09-24 17:01:16","2","1272","<p>The ListView has a nice fade on the top/bottom.</p><p>I have a ListView in the top half of my app, and then a ViewFlipper on the bottom. Is it possible to add a fade/shadow to the top of the ViewFlipper? This would look nice.</p>","19875","","","","","2010-09-24 17:28:05","How can I add a shadow/fade for my views?","<android><listview><fade><shadow>","1","0","1","",""
"3789361","1","","","2010-09-24 17:06:11","3","365","<p>Each child in my ExpandableListView builds a context menu. In my OnCreateContextMenuListener() I need to access some of the TextViews that are displaying data associated with the child's group. ExpandableListView.getPackedPositionGroup() tells me which group is the child's parent, but I've been unable to figure out how to use this to get a handle to the group View that the TextViews live on. What API am I not seeing?</p><p>Or is there a better way to get handles to the Views associated with a child's parent group?</p>","267257","","","","","2010-09-24 17:06:11","How do I navigate from child View to it's group View in ExpandableListView on Android?","<android><expandablelistview>","0","0","","",""
"3789660","1","3789770","","2010-09-24 17:50:18","3","2288","<p>I was wondering if there was a way for a website to send an alert/notification to a cell phone (smart phone, android, iphone... stuff like that) where the notification will ask the user a question and they have to answer the question and the response is sent back to the website and their answer is logged in the database.</p><p>I would also like to know if this notification could have checkboxes? I am needing this for a project and would like to know if there is anything out there like this.</p><p>If you need more description, please let me know.</p><p>Thanks in advance!</p>","427763","","","","","2010-09-25 01:35:46","Sending ""alert/notification"" to cell phone from website","<php><iphone><android>","2","5","","",""
"3789721","1","","","2010-09-24 17:58:40","2","513","<p>my <code>AutoCompleteTextView</code> is created with a custom adapter to show suggestions for ~3000 Strings. while typing in the input view, suggestions are coming up as expected, except that sometimes a chunk of the dropdown view with suggestions is being clipped or looks like its detached from the <code>AutoCompleteTextView</code>.  this extra chunk of the dropdown apears to be holding previous suggestions that are no longer relevent.  upon clicking a suggestion or typing more letters - the ""stuck"" dropdown piece disapears.</p><p>edit: i find that once the <code>AutoCompleteTextView</code> is only showing one suggestion after showing more than one, the problem occurs</p><p>Why is this happening? How can i fix it?</p><p>Right now i am trying a few things(none of which are working):</p><p>-adding a <code>TextWatcher</code> on the <code>AutoCompleteTextView</code> and invalidating the <code>AutoCompleteTextView</code> in the <code>onTextChanged</code> method.</p><p>-<code>getWindow().getDecorView().invalidate();</code> on the <code>Activity</code> containing this <code>AutoCompleteTextView</code> in the <code>onTextChanged</code> method</p><p>edit: this is only happening on the samsung galaxy s phone running 2.1 sdk version 7</p>","416412","","416412","","2010-10-21 14:23:04","2010-10-21 14:23:04","AutoCompleteTextView suggestion results sticking to screen when they shouldn't","<android><autocompletetextview>","0","4","","",""
"3789746","1","3789972","","2010-09-24 18:01:30","1","701","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4545079/lock-the-android-device-programatically"">Lock the android device programatically</a>  </p></blockquote><p>I want to lock the screen through my program. i am using the following code to do the same..But its not working for me..I dont know where i am wrong..even i am not getting any errors in logcat..I am using 1.6</p><pre><code>public class KeyGaurd extends Activity {KeyguardManager keyguardManager;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     keyguardManager =         (KeyguardManager)getSystemService(Context.KEYGUARD_SERVICE);        KeyguardLock lock = keyguardManager.newKeyguardLock(KEYGUARD_SERVICE);         lock.reenableKeyguard();}</code></pre><p>And i used the permission also</p><pre><code>&lt;uses-permission android:name=""android.permission.DISABLE_KEYGUARD""&gt;&lt;/uses-permission&gt;</code></pre>","455422","","","","","2010-09-24 18:41:18","Locking the screen in android","<android>","1","0","","2011-09-29 11:14:15",""
"3789905","1","3794763","","2010-09-24 18:31:42","13","10106","<p>How can I turnoff suggestions in EditText in Android?</p>","655814","","651104","","2012-06-17 12:05:26","2013-07-23 15:47:21","How can I turnoff suggestions in EditText?","<android>","5","0","1","",""
"3789943","1","3791340","","2010-09-24 18:37:40","4","3979","<p>I have the following, very simple test program for using a ListView. I create a ListView and set it as the content view.  I set a ListAdapter which supplies the rows.  There are 30 rows, and each row consists of a LinearLayout ViewGroup.  Into that ViewGroup, I place a TextView and a Button.  When I run the program, I find that I cannot select rows of the list.  I can, however, scroll the list and click the button. </p><p>If I remove the button from the LinearLayout (so that it contains only the TextView), then I am able to select rows of the list.  I would like to be able to have buttons on my individual row views, and still be able to select rows of the list. On another forum, someone said that this was possible, but I am at a loss as to how to accomplish it. </p><p>Can anyone give me a clue? </p><p>Thanks. </p><pre><code>public class ListViewTest extends Activity implements ListAdapter { int    m_count; DataSetObserver m_observer; public ListViewTest() {  m_count  = 30;  m_observer = null; }    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        ListView lv = new ListView(this);        lv.setAdapter(this);        lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);        setContentView(lv);   } @Override public boolean areAllItemsEnabled() {  return true; } @Override public boolean isEnabled(int position) {  return true; } @Override public int getCount()  {  return m_count; } @Override public Object getItem(int position) {  return null; } @Override public long getItemId(int position) {  return 0; } @Override public int getItemViewType(int position) {  return 0; } @Override public View getView(int position, View convertView, ViewGroup parent)  {  LinearLayout vg = new LinearLayout(this);  TextView tv = new TextView(this);  tv.setText(""ListItem"");  Button bv = new Button(this);  bv.setText(""Button"");  vg.addView(tv);  vg.addView(bv);  return(vg); } @Override public int getViewTypeCount() {  return 1; } @Override public boolean hasStableIds() {  return false; } @Override public boolean isEmpty() {  return false; } @Override public void registerDataSetObserver(DataSetObserver observer)  {  m_observer = observer; } @Override public void unregisterDataSetObserver(DataSetObserver observer) { }}</code></pre>","457607","","390989","","2010-09-24 18:39:17","2010-09-24 22:01:00","Using Android, how can I select rows from a ListView which contains Button controls","<android>","1","1","6","",""
"3789986","1","3790125","","2010-09-24 18:44:04","0","1212","<p>Hey,Sorry if this is a dumb question.  I'm an amateur programmer and new to Android, though I've prided myself on not having to bother anyone for help until this point.</p><p>The problem I'm having is that my program randomly seems to hang on startup.  It doesn't happen all the time, and when does happen, it sometimes unfreezes within several seconds.  I haven't been able to see any pattern to the crashing.</p><p>I've looked at several LogCats and this seems to be the key error, as it always throws before I run the program (sometimes twice), freeze or no:</p><pre><code>Failure getting entry for 0x7f03001c (t=2 e=28) in package 0: 0xffffffb5updateAppWidget couldn't find any view, using error viewandroid.content.res.Resources$NotFoundException: Resource ID #0x7f03001c    at android.content.res.Resources.getValue(Resources.java:891)    at android.content.res.Resources.loadXmlResourceParser(Resources.java:1865)    at android.content.res.Resources.getLayout(Resources.java:730)    at android.view.LayoutInflater.inflate(LayoutInflater.java:318)    at android.widget.RemoteViews.apply(RemoteViews.java:900)    at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java:209)    at android.appwidget.AppWidgetHost.updateAppWidgetView(AppWidgetHost.java:243)    at android.appwidget.AppWidgetHost$UpdateHandler.handleMessage(AppWidgetHost.java:72)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:130)    at android.app.ActivityThread.main(ActivityThread.java:4425)    at java.lang.reflect.Method.invokeNative(Native Method)    at java.lang.reflect.Method.invoke(Method.java:521)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)    at dalvik.system.NativeStart.main(Native Method)showStatusIcon on inactive InputConnection</code></pre><p>I'm working in Eclipse with the Android-plug-in.  Tried searching for that string 0x7f03001c, but can't find it in my generated R file or anywhere.  I'm not using any XML, or at least I still get this error when I skip the parts that do use it, so I have no idea where these errors are coming from.</p><p>Lastly, I think this has only started recently, though since I've been an idiot and haven't been doing version control (hopefully learnt my lesson, this time) I don't see how to test whether it's even coming from my code, or not.</p><p>Thanks in advance for any responses.</p><p>-Sam</p>","457619","","422597","","2010-09-24 18:47:43","2010-09-24 19:07:06","What is this resource and why can't Android find it?","<java><android><eclipse><resources>","2","0","","",""
"3790051","1","3790078","","2010-09-24 18:51:46","5","1072","<p>I'm developing an Android project which currently has 4 packages:</p><pre><code>com.myapp.app.activitiescom.myapp.app.dbcom.myapp.app.wscom.myapp.app.utils</code></pre><p>Would I be able to create an additional package which is just</p><pre><code>com.myapp.app</code></pre><p>?</p><p>Eclipse isn't letting me create this package.  It tells me a package with this name already exists.</p><p>If I start a new project and create a package called ""com.testing.app"" and then create a new package called ""com.testing.app.activities"" afterward, it works fine.</p><p>For Android developers:</p><p>What I'm wanting to do is extend the Application class and have it in a separate package.  Suppose com.myapp.app can't be used, what's a good name for this new package?</p>","406790","","","","","2010-09-24 19:03:25","Java package convention","<java><android><packages>","4","0","1","",""
"3790190","1","","","2010-09-24 19:11:55","1","3077","<p>I've reviewed the docs and the sample BackupRestore app and written my own test app implementing <code>android:backupAgent</code>.  I extended the <code>BackupAgent</code> class because my main concern is being able to backup data from a database.  I can't seem to even make a simple proof-of-concept app work with this feature.</p><p>To make things exceptionally simple, I declared the <code>android:backupAgent</code> as <code>MyBackupAgent</code> in the manifest.  I then created a class MyBackupAgent.java, extending <code>BackupAgent</code>.  I then created overrides for the <code>onBackup()</code> and <code>onRestore()</code> methods within the <code>MyBackupAgent</code> class, just like in the examples and docs.  I added a <code>Log.i()</code> call to the very beginning of each function so that I could identify within LogCat when the functions were being called.  Likewise, I set breakpoints on both of these.  I then went on to implement my code to backup the database.</p><p>I created an emulator image using 2.2w/Google API's and even added a gmail account under Accounts &amp; Sync.  Running through the adb commands to enable <code>bmgr</code>, backup the app, run the backup, uninstall the app, reinstall the app etc.... I never once get a message in the log file from the <code>Log.i()</code> command in either of the <code>onBackup()</code> or <code>onRestore()</code> functions.</p><p>I tried again on my Evo 4g running 2.2.  Same result.  It does not appear that the backup manager is calling the <code>onBackup()</code> and <code>onRestore()</code> functions in the <code>MyBackupAgent</code> class.</p><p>The only odd message I get in my logs is one from the <code>BackupManagerService</code> stating ""Backup pass but e=true p=false"", I believe in response to the ADB command to backup the app.</p><p>Any suggestions?  Am I wrong to assume that a <code>Log.i()</code> statement in the <code>onBackup()</code> and <code>onRestore()</code> functions would show up in LogCat?</p>","442481","","810368","","2012-10-29 09:06:57","2012-10-29 09:06:57","BackupManager & BackupAgent in Android 2.2","<android><android-backup-service>","3","0","","",""
"3790289","1","","","2010-09-24 19:25:00","0","2834","<p>I am building a singleton service in Java for Android:</p><pre><code>final class MyService {    private static Context context = null;    // ...    private MyService() {        myObj = new MyObj(context);            // ...      }                           private static class Singleton {        private static final MyService INSTANCE = new MyService();    }    /**     *  a singleton - do not use new(), use getInstance().     */    static synchronized myService getInstance(Context c) {        if (context == null) context = c;        return Singleton.INSTANCE;    }</code></pre><p>To improve performance I use static variables and methods throughout.</p><p>My questions:</p><ul><li><p>for objects, new() ensures theopportunity to initialize that objectbefore its use.  Is there anequivalent for a static class?  Forexample: when static methods dependupon earlier initializations - suchas as for 'context' above - is therea means of ensuring that theinitialization happens first?  Must Ithrow an exception if they have not?</p></li><li><p>as this is all static I expect thatthere is only the class itself: isthat a singleton by definition?  Isthe recommended code above just theway of preventing instantiation ofobjects?</p></li></ul><p>Thanks in advance!</p>","294973","","","","","2010-09-24 20:10:37","Using static in Java singletons?","<java><android><static><singleton>","3","10","","",""
"3790308","1","3793396","","2010-09-24 19:26:24","0","1185","<p>I am writing my first simple Android App: It loads temperature samples from a Java based measurement system (CSV via HTTP), shows the available channels in a Spinner and when a channel is selected, it shows the corresponding value and a timestamp in two TextViews. The App works fine, except a little cosmetic problem: The items in the drop-down list are separated by a horizontal line (divider) and depending on the scroll position, some lines disappear and appear again, when I scroll some more pixels up or down. The phenomenon happens on the emulator screen as well as on the handheld display (HTC Wildfire). Seems to be a screen resultion problem. Does anyone have a hint how to avoid this? Please see my code below...</p><p>Thanks,gemue</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    loadData();    setContentView(R.layout.main);    Spinner spinner = (Spinner) findViewById(R.id.Spinner01);    ArrayAdapter adapter = new ArrayAdapter(this,            android.R.layout.simple_spinner_dropdown_item, channels);    spinner.setAdapter(adapter);    spinner.setOnItemSelectedListener(new SelectListener());}&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""          android:orientation=""vertical""          android:layout_width=""fill_parent""          android:layout_height=""fill_parent""&gt;    &lt;Spinner android:id=""@+id/Spinner01""          android:layout_height=""wrap_content""          android:layout_width=""fill_parent""          android:layout_margin=""15px""/&gt;    &lt;TextView android:text=""@+id/TextView01"" android:id=""@+id/TextView01""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_centerHorizontal=""true""          android:layout_below=""@+id/Spinner01""          android:textSize=""40sp"" android:textStyle=""bold""          android:layout_margin=""15sp""/&gt;    &lt;TextView android:text=""@+id/TextView02"" android:id=""@+id/TextView02""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_centerHorizontal=""true""          android:layout_below=""@+id/TextView01""/&gt;&lt;/RelativeLayout&gt;</code></pre>","457650","","457650","","2010-09-24 21:52:51","2010-10-05 12:12:14","Disappearing dividers in Spinner drop-down list","<android><spinner>","1","0","1","",""
"3790321","1","3790520","","2010-09-24 19:27:45","1","2116","<p>I am not using a SearchManager, but I have built my own custom search activity. I want this to be shown when the user clicks on the Search button. How can I do this?</p>","19875","","","","","2010-09-24 20:15:58","How to define an activity for the Search Button?","<android><search><activity><android-searchmanager>","3","1","1","",""
"3790336","1","3790387","","2010-09-24 19:29:56","0","1473","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1741628/can-we-delete-an-sms-in-android-before-it-reaches-the-inbox"">Can we delete an SMS in Android before it reaches the inbox?</a>  </p></blockquote><p>In my android application that is now working fine, I am sending custom SMS from a user to other one.</p><p>Once I detect the SMS come from my application, I do my stuff with the message and everything work fine.</p><p>But now, I do not want the SMS application to detect this message as it is totally useless for the user.</p><p>So what I would like to do:As soon I receive it, I get the text and avoid the system to get it ( or at least stop the notification for this message)</p><p>Any Idea on how to do?</p><p>Here is my current code:</p><p>(EDIT: Sorry for the formatting, I cannot understand how that work!)</p><pre><code>public class SmsReceiver extends BroadcastReceiver {@Overridepublic void onReceive(Context context, Intent intent) {// ---get the SMS message passed in---Bundle bundle = intent.getExtras();SmsMessage[] msgs = null;String str = """"; if (bundle != null) {// ---retrieve the SMS message received---Object[] pdus = (Object[]) bundle.get(""pdus"");msgs = new SmsMessage[pdus.length];String number = """";String body = """";for (int i = 0; i &lt; msgs.length; i++) {    msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);    number = msgs[i].getOriginatingAddress();    body = msgs[i].getMessageBody().toString();    str += ""SMS from "" + number;    str += "" :"";    str += body;    str += ""\n"";   }If(detectIfSmsComeFromMyApplication)// DELETE MESSAGE AND AVOID BROADCAST.// MAKE IT INVISIBLE TO USER</code></pre><p>}</p><p>}}</p>","327402","","327402","","2010-09-24 19:35:17","2010-09-24 19:36:53","Android: Receive a SMS from a defined number in an invisible way","<java><android><sms>","1","1","","2012-10-28 23:49:57",""
"3790511","1","","","2010-09-24 19:56:06","7","14054","<p>I want to put button above image view.</p><p>How can i do this?</p><p>(Please, don't offer to set Background, cause i need ImageView)</p>","457683","","","","","2012-11-03 14:04:43","How to add overlay view over other view in android?","<android><view><overlay>","2","0","1","",""
"3790729","1","","","2010-09-24 20:26:45","0","1697","<p>I am having problems creating a table layout with 4 columns, that span horizontally.</p><p>I want my Row to look like this:</p><p>AAPL | 200.00 | Image Divider | 1.53 (+1.5%)</p><p>I want the 200.00 to be right aligned, as well as the 1.53(+1.5%).</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:background=""@drawable/stocks_gradient"" android:orientation=""horizontal""&gt;    &lt;TableLayout android:layout_width=""wrap_content""        android:layout_toLeftOf=""@+id/priceText"" android:layout_height=""wrap_content""        android:id=""@+id/TableLayout01""&gt;        &lt;TableRow android:layout_width=""wrap_content""            android:layout_below=""@+id/nameText"" android:id=""@+id/TableRow01""            android:layout_height=""wrap_content""&gt;&lt;/TableRow&gt;        &lt;TextView android:id=""@+id/nameText"" android:layout_height=""wrap_content""            android:padding=""5dip"" android:layout_alignParentLeft=""true""            android:text=""Symbol"" android:textStyle=""bold"" android:textSize=""24sp""            android:layout_width=""100dp"" android:textColor=""#4871A8"" /&gt;        &lt;TextView android:id=""@+id/priceText"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:padding=""5dip""            android:layout_toRightOf=""@+id/nameText"" android:gravity=""right""            android:text=""100"" android:textStyle=""bold"" android:textSize=""24sp""            android:textColor=""#4871A8"" /&gt;        &lt;ImageView android:layout_toLeftOf=""@+id/changeText""            android:id=""@+id/verticalDivider"" android:background=""@drawable/vertical_divider""            android:layout_width=""wrap_content"" android:layout_height=""48dp""&gt;&lt;/ImageView&gt;        &lt;TextView android:id=""@+id/changeText"" android:layout_height=""wrap_content""            android:layout_toRightOf=""@+id/priceText"" android:gravity=""right""            android:textSize=""18sp"" android:text=""3.07(+1.08%)"" android:padding=""12dip""            android:layout_width=""fill_parent"" /&gt;    &lt;/TableLayout&gt;</code></pre>","19875","","","","","2010-09-25 06:43:18","How can I create a TableLayout with 4 columns?","<android><layout><android-linearlayout><tablelayout>","2","0","","",""
"3790929","1","","","2010-09-24 20:57:52","0","1339","<p>Is it possible to provide files int the data/data directory of an android application on install? If so, where would I put these files in my project?</p>","430890","","","","","2010-09-25 01:19:25","Android data directory","<android>","1","0","","",""
"3790963","1","3947740","","2010-09-24 21:02:27","4","1440","<p>I'm writing an Android JUnit test and want to copy/reset a test fixture file (it's an SQLite database file.)  If I were within the main application, I know I could just place the file in the assets directory and use <code>getResources().getAssets().open(sourceFile)</code></p><p>However, this API appears to be unavailable from the <code>ActivityInstrumentationTestCase2</code> class.</p><p>Is there an easy way to copy a file over from the testing PC, or should I just keep a fresh copy of a test fixture on the device and copy it over a temporary file?</p><p>Thanks!</p>","403455","","403455","","2012-08-24 14:13:25","2012-08-24 14:13:25","How can I transfer a database test fixture to device from my unit test application","<android><unit-testing><file><copy><assets>","2","0","1","",""
"3791104","1","","","2010-09-24 21:21:50","2","937","<p>I'm trying to put a spinner in a sub-tab in my android app.  Touching the spinner causes a crash.  </p><p>Searching seems to suggest that for some reason it is not possible to use spinners in sub-tabs, but this seems silly to me.  I've also tried using activity groups as an alternative to sub-tabs, but I get the same crash.  </p><p>Has anyone resolved this?</p>","457752","","","","","2010-09-24 22:19:51","Android: Use spinner in a sub tab","<android><crash><tabs><spinner>","1","4","","",""
"3791153","1","","","2010-09-24 21:31:02","2","1267","<p>In the call log, there is a feature that when you slide one direction it will call the number and in the other direction message the missed number.  In each case the missed number in the list view is pushed aside by either ""Call"" with a green background or ""Message"" with an orange background.  I think this is really need and would like to implement this type of interaction in an app.</p><p>First question, what is the actual term for this operation?  Is this a fling, swipe, slide, etc.?</p><p>Second question.  I have seen sporadic code snippets for handling fling gestures in list views but not a solid unified example for what I am looking for.  Perhaps I am just not searching using the right terms.   In any respect, does anyone know of a solid example implementing the functionality (i.e. handling the user input, painting the widget, etc.) ??</p><p>Thanks for the help.</p>","329174","","","","","2010-10-14 13:28:54","Implementation of slide gesture like is done in the call log list view","<android><listview><gesture>","1","0","1","",""
"3791164","1","","","2010-09-24 21:32:34","3","498","<p>I want to design a gameboard such as Checkers (but with the possibility of having different board tiles.</p><p>Now, OO logic and reason tell me I should have a 'tile' class which I can draw, and I draw x by y number of these on one canvas.</p><p>My question is what is the best performant way to draw such a board?Is it reasonable to do it the way I mentioned above and re-draw on changes?Is it better to have an image as my background and 'simulate' a board by snapping to where the tile would be?</p><p>Thanks!</p>","457760","","","","","2010-09-24 21:44:46","Drawing a gameboard like checkers in Android","<android>","1","0","1","",""
"3791255","1","4120298","","2010-09-24 21:48:15","0","3054","<p>I want to open a website in a WebView and then have it start a certain pixel distance down the page.</p><p>I see the WebView has a scrollTo() method, but when is the soonest I can call this and how do I detect that?</p><p>I would like to have it appear to the user, that the page opens up at the scroll position.  So I don't want to wait until the entire page is loaded.  If it did wait, then the user may have already started scrolling and once it loaded, the scrollTo() would appear to grab control from them.</p><p>Thanks</p>","445348","","","","","2011-02-09 15:15:41","When to call ScrollTo on a WebView","<android><scroll><webview>","2","0","","",""
"3791303","1","3791683","","2010-09-24 21:56:16","1","772","<p>I am just wondering about how android handles sms when it receives them. More precisely my question is when the android phone receives a sms message, which application saves the message to the mmssms database? Is this done by the OS or by the native sms application?</p>","439002","","","","","2010-09-24 23:14:44","Android SMS handling","<android><database><sms><broadcastreceiver><android-contentprovider>","1","0","","",""
"3791347","1","","","2010-09-24 22:02:33","2","3848","<p>I need to pull data from a REST web service in my android app.  The web service requires authentication.<br>I need to first call a login method, which will return me an authToken and JSESSIONID as part of the response header.  I need to pass these items back with every request.  I'm currently using: org.apache.http.impl.client.DefaultHttpClient.DefaultHttpClient() to call the login method.  I can see the authToken and JSESSIONID are being returned in the response header.Are there any existing tools or classes that might provide some sort of management functionality that I can easily integrate with my android app?</p><p>thanks!</p>","457784","","","","","2011-03-31 20:45:28","how to authenticate to REST web service from Android app?","<android><authentication><rest>","2","0","4","",""
"3791431","1","3796689","","2010-09-24 22:19:51","0","1415","<p>I have a activity with 3 <code>ImageView</code>s and a <code>Button</code>. Clicking on the <code>ImageView</code> shows an <code>AlertDialog</code> with a list of images (located in <code>/res/drawable</code>) that the user can select.</p><p>I've hit a wall where I don't know how to store the images to the database that were selected in the <code>ImageView</code>s.</p><p>Any pointers?</p>","443376","","119895","","2013-03-13 05:24:53","2013-03-13 05:24:53","Android: Saving Image to Database","<android><database><sqlite><imageview>","2","1","","",""
"3791448","1","","","2010-09-24 22:22:57","1","1189","<p>I'm making an application that grabs an RSSFeed from one location, parses it, and displays the items in a rich ListView. I've got it working synchronously, but it hangs on the initial download. I used ImageDownloader from the Google blog to asynchronously grab images to populate the ListView, but how do I go about threading the download process, making the display update wait until it's done before passing the RSS to the adapter, and display a dialog during the initial download? I'm totally new to threads and message handling!</p><p>Here's the code in my onCreate so far:</p><pre><code>    feedWait = new Handler() {        public void handleMessage(Message msg) {            Log.d(TAG, ""made it to handler"");            UpdateDisplay();        }    };    netThread.start();</code></pre><p>And here's the thread:</p><pre><code>private Thread netThread = new Thread() {      public void run() {              getFeed();            feedWait.handleMessage(new Message());    }};</code></pre><p>This throws an error, saying I have to invoke Looper.prepare() before creating a handler, but if I do Looper.prepare() in onCreate, it just fails.</p>","457805","","","","","2010-09-24 22:32:20","Creating a thread to asynchronously download xml for usage in UI elements","<android><multithreading><asynchronous><rss><task>","1","0","","",""
"3791495","1","","","2010-09-24 22:32:47","3","1008","<p>Made a very basic xml file to try and access a simple button widget.  The main.xml file is:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:background=""@color/white""&gt;  &lt;TextView android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:text=""@string/hello""/&gt;  &lt;TextView android:text=""Heading Text""             android:id=""@+id/TextView01""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""&gt;  &lt;/TextView&gt;  &lt;Button android:text=""Button Text""           android:id=""@+id/Button01""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""&gt;  &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>The Java program is</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.Button;public class TestButton extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button myButton = (Button)findViewById(android.R.id.Button01);    }}</code></pre><p>The error on the 'Button' line is:<br>Button01 cannot be resolved or is not a field</p><p>Any ideas, what very basic mistake am I making :( :(.</p>","457810","","634025","","2012-01-02 16:30:57","2012-01-02 16:30:57","Can't get widgets from main.xml referenced in the Java program","<java><android><xml>","1","0","1","",""
"3791607","1","3791698","","2010-09-24 23:01:00","34","26425","<p>I set sameting to invisible like this on Android:</p><pre><code>myImageView.setVisibility(View.INVISIBLE);</code></pre><p>And then visible like this:</p><pre><code>myImageView.setVisibility(View.VISIBLE);</code></pre><p>I don't know if myImageView is visible or not now, how can I check it like this:</p><pre><code>if (IF myImageView IS VISIBLE) {Do something} else {Do something else}</code></pre><p>How can I do that? What do I have to write within the brackets? </p>","450019","","61332","","2010-09-24 23:09:15","2014-03-24 05:28:11","How can I check if a view is visible or not in Android?","<android><user-interface><visible>","4","0","8","",""
"3791741","1","3792784","","2010-09-24 23:33:31","0","377","<p>I am a newbie in the Android world, having limited experience in Java from my varsity days decades ago. These days I am a pampered dev in the .NET world.</p><p>These days I am a proud owner of an HTC Desire and decided to try my hand at Android dev. Now I have struck a bit of a dilemma. I am writing an app which heavily uses XML chunks of data. I immediately notice there are two ways of doing this - I can laboriously navigate down from the root level, or (somewhat less laboriously) I can use XPath. The trouble is XPath is only supported at a minimum API level of 8 according to the docs. Ideally I would like to support down to 4 (which is 1.6 I think?)</p><p>What is the best way of doing this? Are there external libraries or packages I can use? Please remember I am a complete newbie so please correct me if I am mistaken in any of the above.</p><p>Many thanks,Dany.</p>","150061","","36305","","2010-09-25 18:10:18","2011-04-20 23:34:51","The various versions of Android and XPath support","<java><android><xpath>","1","0","","",""
"3791817","1","3791899","","2010-09-24 23:56:51","0","78","<p>I have create a list view within a tab with a list of teams within it, I want to create a activity which when clich goes to another class, I want to do this with 20 items that will be in thisa list, code is below</p><p>public class ll2 extends ListActivity {</p><p>static final String[] teams = new String[] {""Accrington Stanley"", ""Aldershot"", ""Barnet"", ""Bradford City"", ""Burton Albion"", ""Bury"", ""Cheltenham Town"", ""Chesterfield"", ""Crewe Alexandra""};</p><p>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);</p><pre><code>final String[] TEAMS = getResources().getStringArray(R.array.twoteams_array);setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, TEAMS));</code></pre><p>ListView lv = getListView();  lv.setTextFilterEnabled(true);</p><p>lv.setOnItemClickListener(new OnItemClickListener() {    public void onItemClick(AdapterView parent, View view,        int position, long id) {      // When clicked, show a toast with the TextView text      Toast.makeText(getApplicationContext(), ((TextView) view).getText(),          Toast.LENGTH_SHORT).show();</p><p>Intent intent;</p><p>intent = new Intent().setClass(this, Bradford.class);</p><pre><code>}</code></pre><p>});}</p><p>}</p><p>I have been messing around with intent but all the tutorials I tried do not mention intent in relation to making a clickable listview.</p><p>How can I achieve this</p>","445174","","","","","2010-09-25 00:26:13","How can I create an activities in a list view","<java><android><eclipse>","1","1","","",""
"3791830","1","3791866","","2010-09-25 00:01:55","0","537","<p>i have an application that has a tabActivity and 3 tabs. all off the tabs use a location listener and work with locations. i implement onPause and onResume for every tab to remove and start listening for location accordingly. is this the right way to go? i had another idea to work with and that was implementing a location listener to the tabActivity and doing broadcasts to the child tabs with the location, but it seemed more complicated.</p><p>the problem with my current solution is that whenever i switch tab i lose the location i got in the previous and i cant use getlastknown location because i dont want the last location on start of the application.(does this make sense?) what can i do to solve this problem.</p><p>a thing that will work better will be to have one variable that will hold the last location from the onLocationChanged and i can observe its changes and call methods onChange.</p><p>are there any suggestions about my issue, maybe some tutorials,examples, anything that might work. tnx</p>","448192","","","","","2010-09-25 00:13:38","Tabbed Application with location listener implemented in tabActivity tabHost","<android><android-intent><intentfilter>","1","0","","",""
"3791922","1","3792021","","2010-09-25 00:32:57","3","591","<p>I've looked up and down the SDK for this, but I can't find anything. I'm wondering if there's a way to transmit a sound, such as a WAV or OGG, during a call such that the person on the other end can hear it. (This sound should be heard in addition to, not in place of, the normal voice transmission.) Is there a possibility I may have overlooked?</p>","457876","","","","","2012-08-30 06:59:41","Android: Transmit sound to somebody during a call?","<android>","1","0","0","",""
"3791930","1","3792861","","2010-09-25 00:35:22","5","13888","<p>I am trying to use the code written and uploaded by Fedor posted in this thread <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview</a> (Source code: <a href=""http://open-pim.com/tmp/LazyList.zip"">http://open-pim.com/tmp/LazyList.zip</a>)</p><p>Fedor's project works well, but when I try to adapt the code to my project, things are not running well since I bumped to this exception (SocketException).</p><p>Somehow, I keep getting it even after setting the permission in  the manifest to have Internet permission (and yes, I have an Internet connection working):</p><pre><code>&lt;uses-sdk android:minSdkVersion=""8""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;     &lt;uses-permission android:name=""android.permission.WRITE_EXTERNAL_STORAGE""&gt;&lt;/uses-permission&gt;&lt;/uses-sdk&gt;</code></pre><p>The exception: SocketException: Permission denied. Watch the LogCat details.</p><pre><code>09-24 23:43:00.591: ERROR/File was not found.(1124): /mnt/sdcard/ListViewTest/-421624214 (No such file or directory)09-24 23:43:00.601: WARN/System.err(1124): java.net.SocketException: Permission denied09-24 23:43:00.611: WARN/System.err(1124):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method)09-24 23:43:00.611: WARN/System.err(1124):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186)09-24 23:43:00.622: WARN/System.err(1124):     at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265)09-24 23:43:00.632: WARN/System.err(1124):     at java.net.Socket.checkClosedAndCreate(Socket.java:873)09-24 23:43:00.632: WARN/System.err(1124):     at java.net.Socket.connect(Socket.java:1020)09-24 23:43:00.632: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:62)09-24 23:43:00.642: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)09-24 23:43:00.642: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)09-24 23:43:00.652: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)09-24 23:43:00.661: WARN/System.err(1124):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1152)09-24 23:43:00.661: WARN/System.err(1124):     at java.net.URL.openStream(URL.java:653)09-24 23:43:00.661: WARN/System.err(1124):     at fabiomilheiro.tests.ImageLoader.getBitmap(ImageLoader.java:80)09-24 23:43:00.671: WARN/System.err(1124):     at fabiomilheiro.tests.ImageLoader.access$0(ImageLoader.java:66)09-24 23:43:00.671: WARN/System.err(1124):     at fabiomilheiro.tests.ImageLoader$PhotosLoader.run(ImageLoader.java:173)</code></pre><p>The error /mnt/sdcard/ListViewTest/-421624214 (No such file or directory) is bugging me. I debugged my adaptation of Fedor's code and I don't see why the files are not found. I checked and confirmed the files I am trying to get do exist on the web.</p><p>By the way, the image uploader class is exactly the same. The main difference I see between my code and Fedor's code is that my main activity class extends ListActivity while and his extends BaseActivity.</p>","169034","","","","","2010-09-25 13:52:02","Android application: SocketException permission denied (No such file or directory)","<android><sockets>","2","0","","",""
"3792038","1","","","2010-09-25 01:21:11","2","1529","<p>I'm trying to rotate a bitmap (which is bigger than Canvas) keeping it centered with Canvas and repeatedly in time, in order to make it appears as spinning. I wanted to post an image explaining the situation, but I can't (not enough reputations; it's a pitty because I've spent a lot of time doing it :( ). I hope you understand what's the problem, anyway.</p><p>Since I don't want the rest of drawables drawn to the Canvas to be rotated as well, I can't use Canvas.rotate(). So I've tried all the different combinations using matrix, and drawing the bitmap to the Canvas using an offset, for example: </p><pre><code>Matrix matrix = new Matrix();matrix.postRotate(degree); //degree is increasing with timemrotatedbackground = CreateBitmap(mbackground, (mbackground.getWidth()-screenwidth)/2, (mbackground.screenHeight()-screenheight)/2, screenwidth, screenheight, matrix, true); canvas.drawBitmap(mrotatedbackground, -screenwidth/2, -screenheight/2, paint); </code></pre><p>And after lots of hours and many different unsuccessful attempts I'm quite desperate...Can anyone help me, please ? What am I doing wrong ?</p><p>Thank you in advance !!</p>","457867","","","","","2011-05-31 10:38:32","Android - Rotate Bitmap (bigger than Cavas) but centered with Canvas","<android><canvas><bitmap><rotation>","1","1","","",""
"3792090","1","3792395","","2010-09-25 01:37:18","0","770","<p>is there a way to tell Android that I would like subsequent calls to startActivity() all resume the target activity rather than creating it over and over again ? Any workarounds ?</p><p>Thanks</p>","243827","","404469","","2010-09-25 01:50:36","2010-09-25 03:43:35","android weird onCreate / onDestroy balance","<android><singleton><activity><oncreate><android-lifecycle>","1","0","1","",""
"3792096","1","3792246","","2010-09-25 01:41:54","0","1174","<p>I am currently trying to write a simple shoot them up game with top down perspective. I am using SurfaceView and Canvas to draw the graphics on the screen, but I cannot find out how to make the ""camera"" scrollable. The player character is always in the center of the screen and the camera(SurfaceView's canvas essentially) is supposed to be following him all the time(for example, like in Alien Swarm). However, I cannot figure out how to make that happen in a regular manner. The way I am doing it right now is by moving every other object in the game world according to the player's input - and drawing them if their coordinates happen to be on screen. The player stays on the same coordinates all the time.Is there any way to actually move(scroll) the SurfaceView itself? I saw the Scroll widget and the method SurfaceView.scrollBy(int x, int y), but my attempts to implement either of those result in Force Close.Any help is appreciated, thanks in advance!</p><p>P.S. Just a note - I am not interested in using open GL for this project.</p>","457899","","","","","2012-11-02 15:41:22","How to program a scrolling game camera in android?","<android><camera><scroll><surfaceview>","2","0","0","",""
"3792124","1","3792194","","2010-09-25 01:57:20","1","7860","<p>I've got an android application that I'm attempting to use to pass some data to a webservice using HTTPGet. If I just construct the string using the JSONArray.toString() method, I end up with a URL that looks something like the following:</p><pre><code>http://xxx.xx.xxx.xx/api?method=upload&amp;args[deviceID]=123456789&amp;args[data]=[""{element1=93295352, element2=235235, element3=3523523}"",""{element1=93295352, element2=235235, element3=3523523}""]</code></pre><p>This doesn't work because of the spaces and quotation marks in the URL. If I attampt to do something like the following:</p><pre><code>JSONArray ja = new JSONArray();// Add Data to JSONArrayString s = ja.toString();// Add array to StringBuilder urlHTTPGet httpget = new HTTPGet(UrlEncoder.encode(url.toString()));</code></pre><p>I get an error thrown because the entire URL gets encoded and ends up like this:</p><pre><code>http%3A%2F%2Fxxx.xx.xxx.xx%2Fapi%3Fmethod%3Dupload%26args%5BdeviceID%5D%3D123456879%26args%5Bdata%5D%3D%5B%22%7Belement1%3D915156028000%2C+element2%3D1651651%2C+element3%3D489461%7D%22%2C%22</code></pre><p>Obviously, this isn't what I'm looking for, and there's got to be a better solution than searching/replacing all the necessary characters in the JSONArray portion of that url, though I suppose doing it that way wouldn't be a huge hassle since I'm only worried about quotation and space characters.</p><p>Note that manually pasting this into my browser returned the results I expect:</p><pre><code>http://xxx.xx.xxx.xx/api?method=upload&amp;args[deviceID]=123456789&amp;args[data]=[%22{element1=915156028000,%20element2=0.0,%20element3=2.297444}%22,%22{element1=915156055000,%20element2=0.0,%20element3=2.2974419999999998}%22]</code></pre>","328283","","","","","2010-09-25 06:26:26","Encode a URL Containing a JSONArray","<java><android><json><url>","1","0","1","",""
"3792148","1","","","2010-09-25 02:04:25","15","11459","<p>My app just consists of a map with an overlay, but when I create my MapView, my app crashes with a NoClassDefFoundError.  I'm using the Google API AVD that matches my target, but apparently I'm still doing something wrong.  Any ideas?</p><p>EDIT: In case it helps, my NoClassDefFoundError is complaining about <code>[generic]</code>.  I can understand why there's no class definiton for <code>[generic]</code>, but I'm not sure where that's coming from.</p><p>Also, a later ClassNotFoundException complains of <code>com.google.android.maps.MapView in loader dalvik.system.PathClassLoader[/data/app/mathphreak.cellmap-1.apk]</code>, and that then goes on to cause a different NoClassDefFoundError for <code>java.lang.NoClassDefFoundError: com.google.android.maps.MapView</code>.</p>","346688","","346688","","2010-11-23 01:08:30","2012-10-12 15:37:28","Google Maps Android API gives a NoClassDefFoundError","<android><google-maps>","5","0","3","",""
"3792222","1","5028229","","2010-09-25 02:29:21","2","4441","<p>I've got an activity that launches a local service using the bindService() method. Everything works great while the app is running, but when I terminate the app and unbind from the service in the activity's onDestroy(), several seconds later I see the following errors show up in logcat:</p><pre><code>09-25 02:13:46.035: WARN/ActivityManager(60): Timeout executing service: ServiceRecord{4401dfc0 net.kicksass.shootingstarbbs.streamstar/.StreamStarService}09-25 02:13:46.055: INFO/Process(60): Sending signal. PID: 285 SIG: 309-25 02:13:46.055: INFO/dalvikvm(285): threadid=3: reacting to signal 309-25 02:13:46.103: INFO/dalvikvm(285): Wrote stack traces to '/data/anr/traces.txt'09-25 02:13:46.103: INFO/Process(60): Sending signal. PID: 60 SIG: 309-25 02:13:46.103: INFO/dalvikvm(60): threadid=3: reacting to signal 309-25 02:13:46.203: INFO/dalvikvm(60): Wrote stack traces to '/data/anr/traces.txt'...09-25 02:13:46.683: ERROR/ActivityManager(60): ANR in net.kicksass.shootingstarbbs.streamstar09-25 02:13:46.683: ERROR/ActivityManager(60): Reason: Executing service net.kicksass.shootingstarbbs.streamstar/.StreamStarService09-25 02:13:46.683: ERROR/ActivityManager(60): Load: 3.08 / 1.16 / 0.4109-25 02:13:46.683: ERROR/ActivityManager(60): CPU usage from 21237ms to 43ms ago:09-25 02:13:46.683: ERROR/ActivityManager(60):   rbbs.streamstar: 7% = 4% user + 2% kernel / faults: 4967 minor 14 major09-25 02:13:46.683: ERROR/ActivityManager(60):   system_server: 3% = 2% user + 1% kernel / faults: 434 minor 8 major09-25 02:13:46.683: ERROR/ActivityManager(60):   com.svox.pico: 1% = 0% user + 0% kernel / faults: 2817 minor 1 major09-25 02:13:46.683: ERROR/ActivityManager(60):   adbd: 0% = 0% user + 0% kernel09-25 02:13:46.683: ERROR/ActivityManager(60):   ndroid.launcher: 0% = 0% user + 0% kernel / faults: 353 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   m.android.phone: 0% = 0% user + 0% kernel / faults: 187 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   putmethod.latin: 0% = 0% user + 0% kernel / faults: 151 minor 1 major09-25 02:13:46.683: ERROR/ActivityManager(60):   .quicksearchbox: 0% = 0% user + 0% kernel / faults: 115 minor 1 major09-25 02:13:46.683: ERROR/ActivityManager(60):   m.android.email: 0% = 0% user + 0% kernel / faults: 140 minor 1 major09-25 02:13:46.683: ERROR/ActivityManager(60):   kswapd0: 0% = 0% user + 0% kernel09-25 02:13:46.683: ERROR/ActivityManager(60):   logcat: 0% = 0% user + 0% kernel / faults: 6 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   ndroid.settings: 0% = 0% user + 0% kernel / faults: 118 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   d.process.acore: 0% = 0% user + 0% kernel / faults: 90 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   id.defcontainer: 0% = 0% user + 0% kernel / faults: 103 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   m.android.music: 0% = 0% user + 0% kernel / faults: 109 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   d.process.media: 0% = 0% user + 0% kernel / faults: 110 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   com.android.mms: 0% = 0% user + 0% kernel / faults: 121 minor 1 major09-25 02:13:46.683: ERROR/ActivityManager(60):   events/0: 0% = 0% user + 0% kernel09-25 02:13:46.683: ERROR/ActivityManager(60):   roid.alarmclock: 0% = 0% user + 0% kernel / faults: 102 minor09-25 02:13:46.683: ERROR/ActivityManager(60):   android.protips: 0% = 0% user + 0% kernel / faults: 102 minor09-25 02:13:46.683: ERROR/ActivityManager(60): TOTAL: 7% = 3% user + 3% kernel + 0% iowait</code></pre><p>Not quite sure what's going on here considering both the activity and the service have terminated (onDestroy() has executed in both). I'm guessing there's still a thread running somewhere? The service does create and use the Android MediaPlayer.</p>","298511","","","","","2011-02-17 11:18:31","Getting ANRs after terminating android service","<android>","2","1","2","",""
"3792306","1","3792329","","2010-09-25 03:03:46","118","128832","<p>I am starting to develop android applications. Can anyone suggest to me which version of eclipse I should use? I see there are 11 versions.  I am confused with these:</p><ol><li>Eclipse IDE for Java Developers</li><li>Eclipse Classic 3.6.1</li><li>Eclipse IDE for Java EE Developers</li><li>Pulsar for Mobile Developers</li></ol>","431472","","403455","","2012-09-01 03:01:07","2014-03-12 13:09:13","Which Eclipse version should I use for Android app?","<android><eclipse><adt>","14","2","24","",""
"3792344","1","","","2010-09-25 03:17:39","2","4330","<p>I am a beginner who made a simple program to show how services work.</p><pre><code>.....toStartService = new Intent(this, SimpleService.class);    sc = new ServiceConnection() {                    @Override        public void onServiceConnected(ComponentName name, IBinder service) {            Toast.makeText(MoreService.this, ""SC: Binded"", Toast.LENGTH_SHORT).show();        }        @Override        public void onServiceDisconnected(ComponentName name) {            Toast.makeText(MoreService.this, ""SC: Unbinded"", Toast.LENGTH_SHORT).show();        }        };    startService.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            Toast.makeText(MoreService.this, ""Starting Service"", Toast.LENGTH_SHORT).show();            startService(toStartService);                }    });    stopService.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            stopService(toStartService);        }    });    bindService.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            if((isBound = bindService(toStartService, sc, BIND_AUTO_CREATE))) {            }        }    });    unbindService.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            if(isBound) {                unbindService(sc);                isBound = false;            }        }    });}</code></pre><p>Why didn't passing the sc variable (on bindService()) call the sc.onServiceConnected() method?Whats wrong with the code?</p><p>I met this following condition:</p><ul><li><p>When i press [startService] theservice started well, then[stopService] the service stoped well.</p></li><li><p>When i press [startService] then the [bindService] does nothing, neither the [unbindService].</p></li><li>When i press [bindService], its created the service, the [stopService] didnt work.  I press [unbindService] the service is calling the onDestroy() method.</li></ul><p>Why does the service that is created by bindService is destroyed when unbinded? I try to start the service with startService, but it cannot bind.</p><p>Arrgh help mee, sorry if i was wrong.</p>","448451","","3098","","2011-02-14 04:18:12","2011-04-21 03:50:23","Why isn't onServiceConnected called?","<android>","1","1","0","",""
"3792451","1","3797624","","2010-09-25 04:06:26","0","508","<p>My Django view generates a PDF via pycairo in response to a POST (I'm not redirecting in response to the POST). When I POST using desktop browsers I can save and/or view the PDF using Adobe Reader or Document Viewer. However, when I POST via my android browsers the Adobe PDF Reader and the ThinkFree viewers both report the file as corrupted.</p><p>Looking in the logfiles on my appserver both Android browsers are sending a POST followed immediately by a GET for the same page:</p><pre><code>[24/Sep/2010:22:49:20 -0500] ""POST /courses/blank/create/ HTTP/1.1"" 200 8895 ""http://example.com/create/"" ""Mozilla/5.0 (Linux; U; Android 2.1-update1; en-us; SPH-D700 Build/ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17""[24/Sep/2010:22:49:20 -0500] ""GET /courses/blank/create/ HTTP/1.1"" 200 9432 ""-"" ""Mozilla/5.0 (Linux; U; Android 2.1-update1; en-us; SPH-D700 Build/ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17""</code></pre><p>When I look at the file saved to the phone it is the HTML of the GET request.</p><p>Here's a skeleton of the view:</p><pre><code>def create(request, template=""blankgrids/create.html""):    if request.method == 'POST':        form = BlankGridForm(request.POST)        if form.is_valid():            response = HttpResponse(mimetype='application/pdf')            response['Content-Disposition'] = 'attachment; filename=example.pdf'            # snipped pycairo code that writes directly into response            return response    else:        form = BlankGridForm()    return render_to_response(template,                          {'form': form},                          context_instance=RequestContext(request))</code></pre><p>So I'm wondering what could be causing the android browsers to perform the GET?</p>","457935","","457935","","2010-09-25 04:19:18","2010-09-26 11:43:00","PDF in response to POST - android browsers perform additional GET and save that as file","<android><django><pdf><post><get>","1","0","","",""
"3792474","1","","","2010-09-25 04:16:06","0","139","<p>So I'm trying to rick-roll my comp. sci. teacher, but I can't get the video to work. Sound is working perfectly. This is my code so far (code, then XML). Can someone steer me in the right direction?</p><pre><code>public class RickRoll extends Activity {    MediaPlayer rickroll;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        rickroll = MediaPlayer.create(this, R.raw.rickroll);        SurfaceView view = (SurfaceView) findViewById(R.id.sv);        view.setMinimumHeight( rickroll.getVideoHeight() );        view.setMinimumWidth( rickroll.getVideoWidth() );        rickroll.setDisplay( view.getHolder() );        try{            rickroll.prepare();        }        catch(Exception e){        }    }    public void rollem(){        try{            rickroll.start();        }        catch(Exception e){            e.printStackTrace();        }    }    public void clicked(View myView){        ((TextView) findViewById(R.id.mytext)).setText(""MUAHAHAHAHA!!!"");        ((Button) findViewById(R.id.mybutton)).setText(""You got Rick Rolled!!!"");        //update button        rollem();    }}&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;TableLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""        &gt;        &lt;TableRow&gt;            &lt;TextView                  android:id=""@+id/mytext""                android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:text=""Click the button!""                /&gt;        &lt;/TableRow&gt;        &lt;TableRow&gt;            &lt;Button                android:id=""@+id/mybutton""                android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                 android:text=""Click me!""                android:onClick=""clicked""                /&gt;        &lt;/TableRow&gt;    &lt;/TableLayout&gt;    &lt;SurfaceView        android:id=""@+id/sv""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>Now, obviously he'd see the big title at the top that said ""Rick Roll,"" but that's beside the point. I'm moving this to another file once I get it working anyways. ;)</p>","728194","","","","","2010-09-25 04:16:06","How do I get video working with my MediaPlayer?","<android><android-emulator>","0","2","","",""
"3792612","1","","","2010-09-25 05:27:50","1","2297","<p>I use the google code from devloper.android.comI use that application but in the emulator it shows only the crossed lines not the mapso is there any settings in emulator for displaying maps HelloItemizedOverlay.java</p><pre><code>package com.HelloGoogleMaps;import java.util.ArrayList;import android.app.AlertDialog;import android.content.Context;import android.graphics.drawable.Drawable;import com.google.android.maps.ItemizedOverlay;import com.google.android.maps.OverlayItem;public class HelloItemizedOverlay extends ItemizedOverlay {    ArrayList&lt;OverlayItem&gt; mOverlays;    Context mContext;  public HelloItemizedOverlay(Drawable defaultMarker) {    super(boundCenterBottom(defaultMarker));    mOverlays = new ArrayList&lt;OverlayItem&gt;();    // TODO Auto-generated constructor stub  }  public HelloItemizedOverlay(Drawable defaultMarker, Context context) {    super(defaultMarker);    mContext = context;  }  @Override  protected OverlayItem createItem(int i) {    // TODO Auto-generated method stub    return mOverlays.get(i);  }  @Override  public int size() {    // TODO Auto-generated method stub    return mOverlays.size();  }  public void addOverlay(OverlayItem overlay) {    mOverlays.add(overlay);    populate();  }  @Override  protected boolean onTap(int index) {    OverlayItem item = mOverlays.get(index);    AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);    dialog.setTitle(item.getTitle());    dialog.setMessage(item.getSnippet());    dialog.show();    return true;  }}</code></pre><p>HelloGoogleMaps.java</p><pre><code>package com.HelloGoogleMaps;import java.util.List;import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;import com.google.android.maps.Overlay;import com.google.android.maps.OverlayItem;import android.app.Activity;import android.graphics.drawable.Drawable;import android.os.Bundle;public class HelloGoogleMaps extends MapActivity  {     /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        MapView mapView = (MapView) findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);        HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable);        GeoPoint point = new GeoPoint(19240000,-99120000);        OverlayItem overlayitem = new OverlayItem(point, ""Hola, Mundo!"",                                     ""I'm in Mexico   City!"");        itemizedoverlay.addOverlay(overlayitem);        mapOverlays.add(itemizedoverlay);   }   @Override   protected boolean isRouteDisplayed() {       return false;   }}</code></pre><p>Android Manifest.xml</p><p></p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".HelloGoogleMaps""              android:label=""@string/app_name""              android:theme=""@android:style/Theme.NoTitleBar""&gt;&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;uses-library android:name=""com.google.android.maps"" android:required=""true""&gt;&lt;/uses-library&gt;</code></pre><p>    </p><p> </p>","441224","","115890","","2012-12-29 23:56:24","2013-11-18 21:34:06","Android Google Maps","<android>","5","3","","",""
"3792647","1","3817688","","2010-09-25 05:41:28","2","1071","<p>In my application the user selects an image. When the ACTION_GET_CONTENT intent is launched it displays the dialog to select one of the available image viewers installed on the device. However I need the built in Gallery app to be chosen because upon selecting an image it launches the screen to crop the image (same thing that comes up when choosing the home screen wallpaper) which only the Gallery chooser offers.</p><p>Is it possible to skip this chooser dialog and launch the Gallery automatically? Or at least remove the other options from the list so only Gallery displays?</p><p>Thank you!</p><p>Matt.</p>","457534","","","","","2011-09-29 21:17:40","Set Default Chooser when Selecting Image?","<android><image><activity><android-intent><default>","3","0","","",""
"3792727","1","3793364","","2010-09-25 06:13:43","3","8777","<p>I have this this code for Android which is stuck at the synchronized statement. Even if i remove the process1.wait() i catch the exception.any help is appreciated?</p><pre><code> private class LongOperation extends AsyncTask&lt;String, Void, String&gt;   {      @Override      protected String doInBackground(String... params)      {         try         {     Process process1 = new ProcessBuilder(""sh"", ""/data/local/bin/tcpdump.sh"").start();                        synchronized(process1){               process1.wait();             }         }         catch (Exception e)         {            Log.e(""Tcpdump function error"", ""Unable to capture the packets into the buffer"");         }         return null;      }      /* (non-Javadoc)       * @see android.os.AsyncTask#onPostExecute(java.lang.Object)       */      @Override      protected void onPostExecute(String result)      {         try         {              StringBuffer output = new StringBuffer();            File file = new File(""/data/local/bin/dump.txt"");            BufferedReader br = new BufferedReader(new FileReader(file), 8 * 1024);            String line;            while ((line = br.readLine()) != null)            {               output.append(line + ""\n"");            }            tv.setText(output);            setContentView(tv);         }         catch (Exception e)         {            e.printStackTrace();         }      }      /* (non-Javadoc)      * @see android.os.AsyncTask#onProgressUpdate(Progress[])      */     @Override     protected void onProgressUpdate(Void... values)      {      }}</code></pre><p>The tcpdump.sh has this linetcpdump -c 10 > /data/local/bin/dump.txt</p>","275674","","275674","","2010-09-25 06:29:56","2014-04-11 02:01:32","Android: java.lang.IllegalMonitorStateException: object not locked by thread before wait()","<java><android>","1","0","1","",""
"3792744","1","3792759","","2010-09-25 06:21:24","0","1144","<p>I have a text field and when I use the IME (the default one for Nexus One) it doesn't display the auto-suggest line on top of the soft keyboard.</p><p>Ironically there are posts here on how to prevent the auto-suggest, but in my case it's the revert, it doesn't show up and it's not clear why.</p><p>Here's my layout tag. I'm in API 8.</p><pre><code>&lt;EditText  android:id=""@+id/user_text""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:layout_weight=""1""  android:gravity=""top""  android:singleLine=""false""  android:inputType=""textLongMessage|textCapSentences|textMultiLine|textAutoCorrect|textAutoComplete""  android:hint=""@string/errorreport_user_hint""  android:paddingLeft=""5dip""  android:paddingRight=""5dip""/&gt;</code></pre>","218258","","","","","2010-09-25 06:25:52","How to enable IME word auto-suggest in an Android EditText?","<android>","1","0","","",""
"3792766","1","3794873","","2010-09-25 06:29:04","4","2819","<p>I want my activity to appear in the list of activities (gallery. live wallpapers, etc) that you see when you try to choose a wallpaper from the home screen.</p><p>Im assuming this is done with intents but cant seem to find one that works. The closest one I can find is:</p><pre><code>&lt;action android:name=""android.intent.action.ACTION_SET_WALLPAPER&gt;</code></pre><p>but that doesn't work and seems to be used for something else.</p>","362476","","","","","2010-09-26 18:31:42","Make activity appear in the 'wallpaper chooser'","<android><android-intent>","3","0","2","",""
"3793093","1","6324350","","2010-09-25 08:44:43","25","30383","<p>Is it possible to catch the event that Soft Keyboard was shown or hidden for EditText?</p>","2556909","","2232148","","2011-06-03 08:49:41","2014-03-25 02:28:59","Android EditText, soft keyboard show/hide event?","<android><keyboard-events><android-softkeyboard>","5","3","4","",""
"3793194","1","3793207","","2010-09-25 09:16:57","9","34310","<p>I have implemented ""Sliding Drawer"" in my application using the below XML layout:(I got this example from androidpeople.com)</p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout01"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:background=""@drawable/androidpeople""&gt; &lt;SlidingDrawer   android:layout_width=""wrap_content""   android:id=""@+id/SlidingDrawer""   android:handle=""@+id/slideHandleButton""   android:content=""@+id/contentLayout""   android:layout_height=""75dip""  android:orientation=""horizontal""&gt;  &lt;Button    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:id=""@+id/slideHandleButton""    android:background=""@drawable/closearrow""&gt;  &lt;/Button&gt;  &lt;LinearLayout    android:layout_width=""wrap_content""    android:id=""@+id/contentLayout""    android:orientation=""horizontal""    android:gravity=""center|top""    android:padding=""10dip""    android:background=""#C0C0C0""    android:layout_height=""wrap_content""&gt;   &lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Content""&gt;&lt;/Button&gt;   &lt;Button android:id=""@+id/Button02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Content""&gt;&lt;/Button&gt;   &lt;Button android:id=""@+id/Button03"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""Content""&gt;&lt;/Button&gt;  &lt;/LinearLayout&gt; &lt;/SlidingDrawer&gt;&lt;/LinearLayout&gt;</code></pre><p>but what i am wanting is to Slide the drawer from Left-to-right(Horizontal) instead of this right-to-left, how do i make slide drawer to slide from left-to-right direction ???</p><p>pls share your idea/view/opinion/issue with me and catch me out of this problem.</p><p>Thanx</p>","379693","","","","","2012-07-11 08:51:33","Android - Making Sliding Drawer to slide from Left-to-Right","<android><android-widget><android-sliding>","4","1","5","",""
"3793221","1","","","2010-09-25 09:26:16","16","15449","<p>My application is launched on car docking event, i want to wake up phone (done by system) and unlock screen when i plug my device.Is it posssible ?</p>","431652","","429063","","2014-02-24 08:50:19","2014-02-24 08:50:19","How to display Activity when the screen is locked?","<android><locking><screen>","4","3","8","",""
"3793381","1","3793411","","2010-09-25 10:15:32","0","3102","<p>I've got the following layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:layout_width=""fill_parent""              android:layout_height=""wrap_content""              android:orientation=""vertical""&gt;    &lt;WebView xmlns:android=""http://schemas.android.com/apk/res/android""             android:id=""@+id/webview""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""    /&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""                  android:layout_width=""fill_parent""                  android:layout_height=""wrap_content""                  android:orientation=""horizontal""&gt;        &lt;Button android:id=""@+id/back""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:text=""Back"" /&gt;        &lt;Button android:id=""@+id/page_number""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:text=""1 / 100"" /&gt;        &lt;Button android:id=""@+id/next""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""                android:text=""Next"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Which results in the following</p><p><img src=""http://i.stack.imgur.com/YpiTj.png"" alt=""alt text""></p><p>How do I make the buttons fit the screen and stop the WebView pushing them off?</p>","149166","","","","","2011-01-29 21:11:29","WebView and buttons layout makes buttons invisible","<android><layout><button><webview>","2","0","","",""
"3793417","1","3793900","","2010-09-25 10:30:31","0","2701","<p>I have created four tabs with listview in each.  I have been attempting to make the list views clickable, I have used the listview tutorial from <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">Here</a> to create the list view using string.xml and R.array:</p><p>The problem is when I use my intent and onItemClickListener I get multiple marker errors, if I play around with the commas brackets and class body markers the errors move around, so is it the syntax that's the problem or is it the lay out or postion of the code;</p><pre><code>public class ll2 extends ListActivity {    static final String[] teams = new String[] {""Accrington Stanley"", ""Aldershot"", ""Barnet"", ""Bradford City"", ""Burton Albion"", ""Bury"", ""Cheltenham Town"", ""Chesterfield"", ""Crewe Alexandra""};    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final String[] TEAMS = getResources().getStringArray(R.array.twoteams_array);        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, TEAMS));        ListView lv = getListView();        lv.setTextFilterEnabled(true);        lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,              int position, long id) {            public void onListItemClick(ListView, parent, View v, int position, long id);            }            if (position == ""Braford City"") {                Intent intent = new Intent(this, Bradford.class);                startActivity(intent);            }}</code></pre><p>I get these errors here:</p><pre><code>static final String[] teams = new String[] {""Accrington Stanley"", ""Aldershot"", ""Barnet"", ""Bradford City"", ""Burton Albion"", ""Bury"", ""Cheltenham Town"", ""Chesterfield"", ""Crewe Alexandra""};</code></pre><blockquote>  <p>Syntax error, insert ""}"" to complete  ClassBody</p></blockquote><p>If I add to complete class body I get more erros here and in other places.</p><p>I get these errors here:</p><pre><code>  public void onListItemClick(ListView, parent, View v, int position, long id); }</code></pre><pre>Multiple markers at this line    - Syntax error on token(s), misplaced construct(s)      - Syntax error, insert "";"" to complete LocalVariableDeclarationStatement      - Syntax error on token "","", ; expected    - Syntax error on token ""("", = expected    - Syntax error on token "","", ; expected    - Syntax error, insert ""}"" to complete MethodBody    - Syntax error, insert ""}"" to complete ClassBody    - Syntax error on token ""}"", delete this token</pre><p>Same problem here I have tried different combinations and it gives me errors constantly with this setup I have the least amount of errors</p><p>Any help greatly appreciated</p>","445174","","234938","","2010-09-25 13:01:29","2010-09-25 13:08:55","Errors in Layout Cant figure it out","<java><android><eclipse>","1","0","","",""
"3793540","1","","","2010-09-25 11:04:58","1","95","<p>problem with mediaplayer.i pause the mediaplayer in one activity and go another activity and i have to play more videos so i have taken 2 mediaplayers.here the first video is played but the second video is not giving ""outofmemory"".vdec open failed.can any one solve this one.</p>","445917","","","","","2010-09-25 13:10:05","playing mediaplayer giving outofmeory and vdec open failed","<android>","1","0","","",""
"3793590","1","","","2010-09-25 11:20:52","0","745","<pre><code>public class SMSWidget extends AppWidgetProvider {private static final String queryString = ""@inpion"";private static final String SMS_RECEIVED = ""android.provider.Telephony.SMS_RECEIVED"";@Overridepublic void onReceive(Context context, Intent intent) {    //get SMS Message    if(intent.getAction().equals(SMS_RECEIVED)){                    Bundle bundle = intent.getExtras();        if(bundle != null){            Object[] pdus = (Object[])bundle.get(""pdus"");               int pduslen = pdus.length;            SmsMessage[] messages = new SmsMessage[pduslen];            String str= """";            for(int i=0; i&lt;pduslen; i++){                messages[i] = SmsMessage.createFromPdu((byte[])pdus[i]);                try {                    str += new String(messages[i].getMessageBody().getBytes(),""GB2312"");                } catch (UnsupportedEncodingException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }            for(SmsMessage message : messages){                String msg = message.getMessageBody();                Log.d(""======messages="", messages.toString());                if(msg.toLowerCase().startsWith(queryString)){                    Log.d(""======SMS RECIVED======"", ""OK"");                    //View new message                    RemoteViews rv ;                    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);                    ComponentName smsWidget = new ComponentName( context, SMSWidget.class );                                            rv = new RemoteViews(context.getPackageName(), R.layout.main);                    rv.setTextViewText(R.id.catch_sms, ""msg:""+msg);                    appWidgetManager.updateAppWidget(smsWidget, rv );                                           //Delete SMS                    try{                        Uri uriSms = Uri.parse(""content://sms/inbox"");                        Cursor c = context.getContentResolver().query(uriSms, null, null, null, null);                        if(c != null ){                            //do{                                int threadId = c.getInt(1);                                Log.d(""===threadId: "",threadId+"""");                                int a = context.getContentResolver().delete(Uri.parse(""content://sms/conversations/"" + threadId), null, null);                                Log.d(""===a: "", a+"""");                            //}while (c.moveToNext());                        }else{                            Log.d(""=no="", c.toString());                        }                    }catch(Exception e){                        e.printStackTrace();}}}}        android.xml :         &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;         &lt;receiver android:name="".SMSWidget"" android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED""/&gt;              &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE""/&gt;                    &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.appwidget.provider""            android:resource=""@xml/catch_sms_widget_provider"" /&gt;    &lt;/receiver&gt;&lt;/application&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_SMS""/&gt;&lt;uses-permission android:name=""android.permission.WRITE_SMS"" /&gt;&lt;uses-permission android:name=""android.permission.READ_SMS"" /&gt;&lt;uses-sdk android:minSdkVersion=""5"" /&gt;</code></pre><p>in my app,i send sms but in home screen ,AppWidget cannot receive it,only notification can notify me,i want to the message frist  was received in my AppWidget not appear in notification bar,thank you ?</p>","233618","","","","","2010-09-26 02:49:22","i cannot catch SMS","<android><sms>","1","3","","",""
"3793612","1","3793794","","2010-09-25 11:28:42","0","679","<p>Hello In my android application i would like to get Time since when the app is opened.Initially what i tried was getting the time when the app is loaded from the server and then taking the difference with the current time from the device.But by doing that if the user changes the time then i willnot be getting the actual time.Its not posiible to hit the server again for the same. </p><p>Is there any way to achieve this in android?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance:)</p>","420261","","","","","2012-06-22 04:41:55","Time since the app is open in android","<android>","3","0","","",""
"3794258","1","14525874","","2010-09-25 14:50:43","4","7558","<p>I need to apply different layouts for portrait and landscape orientations of my activity. Besides, I need to show alert if orientation is portrait.</p><p>I have specified <code>android:configChanges=""orientation|keyboardHidden""</code> in AndroidManifest. I also override onConfigurationChanged method like this:</p><pre><code>@Overridepublic void onConfigurationChanged(Configuration newConfig){    Log.d(""tag"", ""config changed"");    super.onConfigurationChanged(newConfig);    int orientation = newConfig.orientation;    if (orientation == Configuration.ORIENTATION_PORTRAIT)        Log.d(""tag"", ""Portrait"");    else if (orientation == Configuration.ORIENTATION_LANDSCAPE)        Log.d(""tag"", ""Landscape"");    else        Log.w(""tag"", ""other: "" + orientation);    ....}</code></pre><p>While rotating from landscape to portrait log looks like:</p><pre><code>config changedPortrait</code></pre><p>But while changing from portrait to landscape it looks like</p><pre><code>config changedPortraitconfig changedLandscape</code></pre><p>Why onConfigurationChanged is called twice? How can I avoid it?</p>","303212","","","","","2013-01-25 16:19:33","Handling activity rotating in Android","<android><activity><orientation><onconfigurationchanged>","5","0","1","",""
"3794281","1","","","2010-09-25 14:58:08","2","1977","<p>I am trying to learn opengl stuff on Android. In the gl.gltranslatef(x,y,z) call, I am shifting my texture by some units in the +ve x direction. But I am unable to find the number of pixels does 1 unit of x belong to?</p><p>Here is what I am doing:I call gl.glviewport(0,0,width,height); // This will set my rectangle with 0,0 as lowerleft corner and then extend it to accommodate width and height.</p><p>Then I call to gl.glfrustrum(-5,5,-7,7,3,7); // I am little confused how this call is using the dimensions I set in gl.glviewport.</p><p>How will -5 to 5 units from left to right in the above call, translate to pixels on the screen of android?</p><p>I mean if width = 320 and height = 533 pixels, then what will be the number of pixels occupied on the screen due to the gl.glfrustrum call?</p><p>I am experimenting in the gl.gltranslatef call by specifying xshift as 5.0, but it does not translate the bitmap at the right or left corner of the screen, when I increase it to 6, part of it is still visible on the screen.</p><p>ThanksSiddhesh</p><p><strong>In short, I am searching for the maximum number of units (in terms of X) which will represent extreme corners of my android phone screen.</strong> </p>","451655","","44729","","2010-09-25 23:41:28","2011-03-12 09:37:50","In opengl, How can I get relation between pixels and gl.gltranslatef(floatx,y,z)?","<android><opengl-es>","1","0","1","",""
"3794303","1","3794353","","2010-09-25 15:05:00","1","1667","<p>I have a TextView that has text Dynamically Added to it.  My problem is that when I use gravity for the centering the text, it doesn't move because the width is set to ""wrap_content"".</p><p>What should I do to resolve this issue?</p>","445342","","","","","2011-08-25 21:47:37","Centering Text In A TextView","<android><xml><layout><textview><center>","2","0","","",""
"3794389","1","3794676","","2010-09-25 15:31:24","0","282","<p>I was wondering how one might align two or more UI elements to the bottom of a screen instead of them just stacking as they normally do.</p>","445342","","142162","","2011-09-25 14:03:14","2011-09-25 14:03:14","Android Layouts: Moving Items","<android><user-interface><elements><alignment>","1","0","","",""
"3794468","1","","","2010-09-25 15:58:37","0","353","<p>Following is my scenario,</p><p>My Activity is running on the foreground and my Activity is getting pushed to background when I hit on the home button... I am trying to display the pop up at certain intervals, in this case as my activity is running on background when I try to display the pop up but thats not shown on the foreground.</p><p>Thanks,Ramesh</p>","330266","","","","","2010-09-25 16:00:47","Android - how do I bring my activity to foreground automatically from Address book","<android>","1","0","","",""
"3794492","1","3795475","","2010-09-25 16:07:20","0","110","<p>I'm writing a content provider, it will be part of my application. What does the ""icon"" attribute in the  element do though?:</p><p><a href=""http://developer.android.com/guide/topics/manifest/provider-element.html"" rel=""nofollow"">http://developer.android.com/guide/topics/manifest/provider-element.html</a></p><p>Where would anyone ever see this icon? Is there a way for users to list all the content providers in the system, and they might see it in this listview perhaps?</p>","291701","","114066","","2010-09-27 08:02:37","2010-09-27 08:02:37","What is the ""icon"" attribute in <provider> used for?","<android>","2","0","","",""
"3794552","1","","","2010-09-25 16:27:44","2","1112","<p>I am trying to connect an Android application with a secured HTTPS remote service that is hosted in Google App Engine for Java (https://applicationname.appspot.com), using the HTTPClient 4 implementation that comes with Android.  The certificate is signed and valid form *.appspot.com.</p><p>I am using Android 2.1 in a real device (HTC Hero), and I get the following error: <strong><code>SSL23_GET_SERVER_HELLO:unknown protocol</code></strong>.</p><p>This is part of my code:</p><pre><code>HttpParams params = new BasicHttpParams();        ...SchemeRegistry schemeRegistry = new SchemeRegistry();schemeRegistry.register(        new Scheme(""http"", PlainSocketFactory.getSocketFactory(), 80));schemeRegistry.register(        new Scheme(""https"", SSLSocketFactory.getSocketFactory(), 443));..ClientConnectionManager cm =         new ThreadSafeClientConnManager(params, schemeRegistry);DefaultHttpClient result = new DefaultHttpClient(cm, params);</code></pre><p>Any idea about what could be happening and any solution or workaround?</p><p>This is the complete stack trace:</p><pre><code>09-25 18:19:05.452: ERROR/OpenSSLSocketImpl(1195): Unknown error 1 during connect09-25 18:19:05.460: ERROR/ServerProxy(1195): HTTPHelp : IOException : java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol error09-25 18:19:05.460: ERROR/ServerProxy(1195): error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:585 0xaf586674:0x00000000)09-25 18:19:05.460: ERROR/ServerProxy(1195): java.io.IOException: SSL handshake failure: Failure in SSL library, usually a protocol error09-25 18:19:05.460: ERROR/ServerProxy(1195): error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:585 0xaf586674:0x00000000)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativeconnect(Native Method)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:305)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.&lt;init&gt;(OpenSSLSocketImpl.java:502)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:443)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.io.SocketInputBuffer.&lt;init&gt;(SocketInputBuffer.java:93)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:83)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:170)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:106)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:129)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)09-25 18:19:05.460: ERROR/ServerProxy(1195):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)</code></pre><p>Thank you very much.</p>","12388","","12388","","2010-09-26 17:04:42","2010-09-26 17:04:42","Android SSL failure trying to connect with GAE/Java","<android><ssl><httpclient><android-networking>","1","0","1","",""
"3794579","1","","","2010-09-25 16:39:08","1","1193","<p>I have a table called ""images"":</p><pre><code>CREATE TABLE images (    id      INTEGER PRIMARY KEY AUTOINCREMENT,     url     TEXT NOT NULL UNIQUE,    caption TEXT);</code></pre><p>On inserting a row, I'd like the URL column to be unique. At the same time, I'd like to find out the id of the row with that URL.</p><pre><code>INSERT OR IGNORE images (url, caption) VALUES (""http://stackoverflow.com"", ""A logo"");SELECT last_insert_rowid(); -- returns the id iff there was an insert.</code></pre><p>Of course, I'd like to do it as quickly as possible, though my first thought was along the the lines of the following pseudo code: </p><pre><code>int oldID = execSQL(""SELECT last_insert_rowid()"");execSQL(""INSERT OR IGNORE images (url, caption) VALUES ('http://stackoverflow.com', 'A logo')"");int newID = execSQL(""SELECT last_insert_rowid()"");if (newID != oldID) {     // there was an insert.      return newID;} else {     // we'd already seen this URL before     return execSQL(""SELECT id FROM images WHERE url = 'http://stackoverflow.com'"");}</code></pre><p>But this seems hopelessly inefficient. </p><p><strong>What is the most performant way of getting the Auto incremented row id from an INSERT OR IGNORE statement.</strong></p>","4737","","4737","","2010-09-26 14:32:56","2010-09-27 20:30:43","Finding Auto Incremented values from an INSERT OR IGNORE statement in SQLite","<sql><android><sqlite><sqlite3>","1","0","1","",""
"3794644","1","4749370","","2010-09-25 17:00:23","5","1322","<p>Is it possible to use per vertex data interleaved in OpenGL ES on Android?</p><p>I'm unable to get the correct offset pointers for the <code>normal</code> and <code>color</code> members.</p><p>In C++ I would do something like this:</p><pre><code>struct ColoredVertexData3D{    Vertex3D    vertex;    Vector3D    normal;    ColorRGBA   color;};const ColoredVertexData3D vertexData[] ={    {        {0.0f, 0.5f, 0.8f},       // Vertex |        {0.0f, 0.4f, 0.6f},       // Normal | Vertex 0        {1.0f, 0.0f, 0.0f, 1.0f}  // Color  |    },    {        {0.8f, 0.0f, 0.5f},       // Vertex |        {0.6f, 0.0f, 0.4f},       // Normal | Vertex 1        {1.0f, 0.5f, 0.0f, 1.0f}  // Color  |    },    // ... more vertexes.};const int stride = sizeof(ColoredVertexData3D);glVertexPointer(3, GL_FLOAT, stride, &amp;vertexData[0].vertex);glColorPointer(4, GL_FLOAT, stride, &amp;vertexData[0].color);glNormalPointer(GL_FLOAT, stride, &amp;vertexData[0].normal);</code></pre><p>Is the same thing possible on Android in Java? This is what I currently got:</p><pre><code>ByteBuffer vertexData = ...;int stride = 40;gl.glVertexPointer(3, GL10.GL_FLOAT, stride, vertexData);// This obviously doesn't work. ------------vgl.glColorPointer(4, GL10.GL_FLOAT, stride, &amp;vertexData[0].color);gl.glNormalPointer(GL10.GL_FLOAT, stride, &amp;vertexData[0].normal);</code></pre>","19100","","","","","2011-01-20 15:58:45","Offsets for per vertex data interleaved in OpenGL ES on Android","<java><android><opengl-es>","1","0","1","",""
"3794670","1","3794729","","2010-09-25 17:05:48","0","803","<p>I found a error that I dind't know about, Iam using a List, when Iam scrolling down to the bottom of the list it thows an error, why does this occur? Iamgeting the items from a service, and everything looks fine inte listview. </p><p>this is the error that it trows out.09-25 16:58:01.865: ERROR/AndroidRuntime(609): FATAL EXCEPTION: main09-25 16:58:01.865: ERROR/AndroidRuntime(609): java.lang.NullPointerException09-25 16:58:01.865: ERROR/AndroidRuntime(609):     at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)09-25 16:58:01.865: ERROR/AndroidRuntime(609):     at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)........</p>","371301","","","","","2010-09-25 17:18:01","Android: Error when scrolling down to the bottom of an ListView","<android><exception><listview>","1","0","","",""
"3794726","1","3794777","","2010-09-25 17:17:38","0","5353","<p>Wondering if there is any way to build and fire an event (e.g. on click event) in android applications programmatically. </p><p>Thanks.</p><p>sorry, it seems question is not clear enough, let me explain a bit more:</p><ul><li>I have an Activity (lets call it A) with multiple views (5 ImageView for example).</li><li>And a normal Java class (lets call it B) which is used by my Activity.</li><li>There is an instance of B in my Activity. </li><li>If user click on a View (Image View) the view OnClickListener calls a method in B  </li><li>In B, if operation is successful, it will call back a method in activity again. </li><li>in activity method, It will change image or state for clicked ImageView.</li></ul><p>in the other hand:</p><p>click on view (x) in Activity -------> B.doSomething() --------> A.bIsDone() -----> change image for view (x) </p><p>with normal execution, its working and there is no problem.</p><p>the problem is that I want to simulate this process to be automatic, my code looks like this:</p><pre><code>        while (!b.isFinished()) {            try {                b.doSomething(&lt;for View x&gt;);                Thread.sleep(1000);            } catch (InterruptedException e) {                e.printStackTrace();            }        }           </code></pre><p>The issue is that, it won't render anything, until the end of the loop. </p><p>I tried to put the loop in another Thread, but its throwing exception:</p><pre><code> android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</code></pre><p>what can i do for this issue? i was think generate an click event on view (by code), to see it can help or not.</p><p>what is your solution?Thanks </p>","393786","","393786","","2010-09-26 07:00:19","2013-05-30 01:06:39","firing an Event by code in android","<android>","3","0","","",""
"3794812","1","","","2010-09-25 17:40:58","1","1654","<p>I want to create 5 equally sized outer squares across the top of the screen, side-by-side. Each outer square should contain 3 equally sized mini squares, side-by-side, across the top of each outer square. Each of the 3 mini squares are TextViews.</p><p>The outer squares and the inner squares each need a border, which I want to use to differentiate each square, so that it is obvious to the user that there are 5 distinct outer squares, and 3 distinct inner squares within each outter square.</p><p>I was able to get 5 equally sized outer squares by declaring 5 separate TableLayouts, specifying layout_width=""0dp"" and layout_weight=""2"". Within each of these TableLayouts, I define a single  element with 3 TextViews.</p><p>How can I get each of the 3 inner squares containing the TextViews to be equally sized, independent of the screen size? I tried setting the layout_weight of each of the TextViews equal to "".3"" but this doesn't do the trick.</p><p>The only way I've been able to get 3 equally sized squares with TextViews is to set android:minWidth=""12dp"" (or some other number besides 12dp) for each of the 3 mini squares, but obviously this does not work for different sized screens.</p><p>My Tables are each setup like the TableLayout below. This layout that I've included is the Layout that allows me to create the mini squares correctly, but doesn't work for different sized screens. I used the margins to actually create the border around the TextViews(black background with white outline).</p><p>Besides this layout, I tried creating a Shape resource and setting the background of the 3 mini squares to that Shape, but that did not work either, but I've included that resource as well.</p><pre><code>&lt;TableLayoutandroid:layout_weight=""1""android:layout_width=""0dp""android:layout_height=""wrap_content""android:background=""#FFFFFF""&gt;&lt;TableRow android:background=""#FFFFFF""&gt;    &lt;TextView         android:background=""#000000""        android:layout_marginLeft=""1dip""         android:layout_marginRight=""1dip""         android:layout_marginBottom=""1dip""        android:minWidth=""12dp""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;    &lt;TextView         android:background=""#000000""        android:layout_marginLeft=""1dip""         android:layout_marginRight=""1dip""         android:layout_marginBottom=""1dip""        android:minWidth=""12dp""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;    &lt;TextView         android:background=""#000000""        android:layout_marginLeft=""1dip""         android:layout_marginBottom=""1dip""        android:layout_marginRight=""1dip""        android:minWidth=""12dp""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""/&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>The Shape resource I tried was:</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android"" android:shape=""rectangle""&gt;    &lt;solid android:color=""#000000""/&gt;    &lt;stroke android:width=""1dp"" color=""#000000""/&gt;    &lt;corners android:radius=""1dp""/&gt;    &lt;padding android:left=""2dp"" android:top=""1dp""        android:right=""2dp"" android:bottom=""1dp"" /&gt;&lt;/shape&gt;</code></pre>","449070","","","","","2010-09-25 17:40:58","Android Layout for a bordered-table containing bordered TextViews","<android><tablelayout><border>","0","1","1","",""
"3794842","1","4268797","","2010-09-25 17:48:47","0","1157","<p>I want to use this SDK, and I can not create project from existing source from the facebook dir.And at importing this project I always get this error:</p><pre><code>19:32:32 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read C:\AndroidManifest.xml: java.io.FileNotFoundException: C:\AndroidManifest.xml (System could not find the file)[2010-09-25 19:32:32 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read C:\AndroidManifest.xml: java.io.FileNotFoundException: C:\AndroidManifest.xml (System could not find the file)</code></pre>","","user408141","1904479","","2013-12-18 10:25:17","2013-12-18 10:25:17","Facebook android SDK","<android><facebook>","1","0","","2013-12-18 12:48:03",""
"3794891","1","3795531","","2010-09-25 18:02:33","3","2635","<p>I am pretty far into my first Android application, and I have the sneaking suspicion that I'm ""Doing It Wrong"".  My app talks to a Ruby on Rails server and serializes objects back and forth via XML.  Before I knew what was happening, I found myself knee deep in writing my own crappy ORM, a problem which is compounded by the fact that I haven't written any Java since high school.</p><p>My conflict here is that I want my client-side (android) app to be capable of serializing via a variety of methods, such as HTTP/XML, to a local database, or out to the local filesystem.  I started out with the Strategy pattern, but I feel like my solution is badly lacking.  </p><p>For one, should I re-implement all of Rails model validation on the client side, because I don't know if I'm always going to be working with Rails on the other side?  The even bigger issue is that right now I can only represent flat objects as key-values, as my code can't handle nested objects like a true ORM.</p><p>I'm sure Android devs deal with this all the time, so I'm interested to hear what other people do to cope with these issues.    </p>","458290","","","","","2011-01-17 15:02:48","Android object handling / persistence","<java><android><orm>","5","1","0","",""
"3794950","1","3795269","","2010-09-25 18:17:17","3","10945","<p>Hi am developing an app that will set the coordinates(latitude and longitude). And it has to show my location as i am at that coordinates..It is similar to location spoofer.. <a href=""http://www.androidzoom.com/android_applications/tools/location-spoofer_gkmc.html"" rel=""nofollow"">http://www.androidzoom.com/android_applications/tools/location-spoofer_gkmc.html</a>But I am failing to do that.. here is my code..Please any one help me.</p><pre><code>public class Mock extends MapActivity {      private LocationManager lm;  private LocationListener locationListener;  private MapView mapView;  String mocLocationProvider;  private MapController mc;  /** Called when the activity is first created. */  @Override  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     //---use the LocationManager class to obtain GPS locations---    lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);       locationListener = new MyLocationListener();    mocLocationProvider=LocationManager.GPS_PROVIDER;    lm.addTestProvider(mocLocationProvider, false, false,false, false, true, true, true, 0, 5);    lm.setTestProviderEnabled(mocLocationProvider,true);    lm.requestLocationUpdates(mocLocationProvider,0,0,locationListener);    mapView = (MapView) findViewById(R.id.mapview1);    mc = mapView.getController();  }  @Override  protected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;  }          private class MyLocationListener implements LocationListener   {    @Override    public void onLocationChanged(Location loc) {        loc = new Location(mocLocationProvider);         Double latitude = 1.352566007;         Double longitude = 103.78921587;         //Double altitude = Double.valueOf(parts[2]);         loc.setLatitude(latitude);         loc.setLongitude(longitude);         loc.setTime(System.currentTimeMillis());         lm.setTestProviderLocation(mocLocationProvider, loc);            mc.setZoom(16);                            mapView.invalidate();    }    @Override    public void onProviderDisabled(String provider) {        // TODO Auto-generated method stub    }    @Override    public void onProviderEnabled(String provider) {        // TODO Auto-generated method stub    }    @Override    public void onStatusChanged(String provider, int status,         Bundle extras) {        // TODO Auto-generated method stub    }}    }</code></pre>","458295","","184046","","2011-08-31 06:14:10","2011-09-06 18:36:56","Fake location using GPS in android","<android>","2","0","","",""
"3794998","1","","","2010-09-25 18:27:14","5","4727","<p>I'm at complete odds over configuring a proxy to inspect the HTTP(S) traffic for the app I'm developing. I've tried running Fiddler2 and Charles Web Proxy, both run on 127.0.0.1:888, and starting up the Android emulator with the parameter: </p><p><code>-http-proxy <a href=""http://127.0.0.1:8888"">http://127.0.0.1:8888</a></code> </p><p>To test it out I open the Android browser. I see in Fiddler2 that the request is routed through the proxy. However, only RARELY does the request receive a successful response. In most, and when I say most I mean 99% of the time, the request is retried and fails again with the Android browser telling me ""The server failed to communicate"".</p><p>Has anyone found a way to configure Fiddler2 or Charles for debugging HTTP(S) traffic through the Android emulator?</p>","32396","","","","","2014-04-01 06:43:21","How to configure an HTTP Proxy like Fiddler2 or Charles Web Proxy with the latest Android Emulator on Windows?","<android><windows><http><proxy>","3","0","4","",""
"3795016","1","4105742","","2010-09-25 18:34:32","0","734","<p>I would like to record from the device microphone and then be able to calculate the beats per second of the recorded audio, is it possible and how? is there any open source project I can look? regards maxsap</p>","234898","","","","","2010-11-05 12:14:16","android how to calculate beats per minute","<android>","1","0","","",""
"3795061","1","3795073","","2010-09-25 18:48:30","3","1786","<p>Does something exist for Android? I am looking for something equivalent to HTML's  tag. I see things like NumberPicker, but I can't see any way to have a basic drop down selector.</p><p>I am aware of ListPreference, but I want to use it outside the context of a PreferenceActivity and inside arbitrary views. Anyone?</p>","80617","","","","","2010-09-25 18:51:00","Text Picker Component","<android><drop-down-menu><widget><selector>","1","1","","",""
"3795276","1","10714744","","2010-09-25 19:41:04","4","4248","<p>I'm trying to very quickly port over an html application with plays sound (with soundmanager2) to a native android app using WebView. From my research, I haven't seen any evidence that sound, such as mp3s, can be played via javascript or any other methods using WebView. </p><p>My goal now is to quickly port over the html app and then eventually create a truely native application without using WebViews.</p><p>Please let me know if anyone has been able to successfully implement playing audio using WebViews and Javascript or if this is just not possible at this time.</p><p>Thank you.</p>","447577","","","","","2012-05-24 01:26:57","Android WebView playing audio with javascript","<javascript><android><audio><webview>","2","0","2","",""
"3795288","1","","","2010-09-25 19:44:31","1","249","<p>I am developing an application in which each Activity has a View which shows a PNG Image, followed by a TextView, an EditText and other views... The Activity's Content View is inflated using an XML layout file.</p><p>Depending on which options the user chooses/how he interacts with the application, I want to dynamically draw onto the PNG Image.</p><p>Is this possible? If so, how? If not, how else could I go about it? Could you point me towards a tutorial on this sort of thing?</p><p>Many thanksDarius</p>","448270","","1041533","","2012-06-13 08:58:21","2012-06-13 08:58:21","Draw on top of a ""View""?","<android>","0","2","","",""
"3795297","1","","","2010-09-25 19:49:16","1","435","<p>Is it possible to create android applications that can communicate with apps running on the computer through USB? Like some sort of reverse ""adb forward"".</p>","359825","","","","","2010-09-25 20:08:18","Reverse forwarding - in a way","<android>","1","0","","",""
"3795314","1","","","2010-09-25 19:54:34","1","200","<p>Does somebody knows how to make similar listview?How to split row?Image: <a href=""http://i.stack.imgur.com/lFZSC.png"" rel=""nofollow"">link text</a></p><p>Thanks for answers</p>","458347","","","","","2010-09-25 22:37:06","Specific Listview -> Android","<android><listview>","1","0","1","",""
"3795439","1","3795455","","2010-09-25 20:24:11","22","30857","<p>I find myself doing things like this all the time:</p><pre><code>    Button button1 = (Button) findViewById(R.id.button1);    Button button2 = (Button) findViewById(R.id.button2);    Button button3 = (Button) findViewById(R.id.button3);    button1.setOnClickListener(menuButtonListener);    button2.setOnClickListener(menuButtonListener);    button3.setOnClickListener(menuButtonListener);...</code></pre><p>and</p><pre><code>   private OnClickListener myButtonListener = new OnClickListener() {        @Override        public void onClick(View v) {      switch(v.getId()){       case R.id.button1 :    ...</code></pre><p>Is there a better way to set the OnClickListener?</p>","458361","","","","","2014-03-28 18:35:03","One OnClickHandler for multiple Buttons","<android><button><clicklistener>","5","0","11","",""
"3795707","1","3795879","","2010-09-25 21:47:51","2","1530","<p>I have a linear layout that contains 6 images, which span the linear layout horizontally.</p><pre><code>   &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""horizontal""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:background=""@layout/roundedcorner""&gt;        &lt;ImageView          android:id=""@+id/Icon""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:src=""@drawable/someImage""&gt;        &lt;/ImageView&gt;        ...</code></pre><p>The problem is, the first 5 images do not scale and take their pixel width, and the 6th images is scrunched down, because there is not enough space left horizontally.</p><p>Is there a way to scale all the images down so they have a uniform look?</p>","389041","","389041","","2010-09-25 21:54:14","2010-09-25 22:51:18","Scaling Images in a Linear Layout Evenly","<android><layout><imageview><android-linearlayout>","1","0","","",""
"3795720","1","","","2010-09-25 21:50:28","0","214","<p>Not sure if i can explain this well, but here it is. I'm trying to make an application that would load a map and save it as an image to the SD card, but I would like to do it in the background. I've gotten to the point where I can display a map in a foreground Activity and save it to a file, but I can't think of a way to make it happen in the background. In other words, i want to set it up so the app has, say, an icon on the home screen, and clicking on the icon would load a map at a specific geographic location and save it to a PNG file without ever displaying any UI or leaving the home screen. Would something like that be possible?</p>","421258","","","","","2010-09-25 21:50:28","Load a map in a background service","<android><google-maps>","0","2","","",""
"3795768","1","3795865","","2010-09-25 22:02:18","1","245","<p>In my android application, how can I forward user to android market to install another application and after they install it, they come back to my activity?</p>","286802","","429108","","2012-07-29 14:06:59","2012-07-29 14:06:59","How can I forward user to android market to install an application","<android>","1","0","","",""
"3795800","1","3795877","","2010-09-25 22:13:02","1","1706","<p>I wounder if there some example on how to create a searchbar just like twitter app in android?<a href=""http://2.bp.blogspot.com/_GTM_W5mVPTU/S-rmYdiUTCI/AAAAAAAAAEE/hIO9GD53SLc/s1600/search2.png"" rel=""nofollow"">http://2.bp.blogspot.com/_GTM_W5mVPTU/S-rmYdiUTCI/AAAAAAAAAEE/hIO9GD53SLc/s1600/search2.png</a><br>and also I wonder about the popup. </p><p>Are there any samples?</p>","371301","","55093","","2011-11-16 09:19:31","2011-11-16 09:19:31","Searchbar just like twitter app in android","<android><gui><twitter><searchbar>","1","0","1","",""
"3795834","1","3846644","","2010-09-25 22:32:15","8","7120","<p>I'm working on an application that displays the location of moving items on a Google MapView. I need a way to update the position of the icons that represent the items (as well as change the facing of the icons every two seconds as updated data comes in).</p><p>I currently have an activity in the app that extends MapActivity. On to this I have overlaid a static Overlay that draws some lines on the map and an ItemizedOverlay that draws a static icon. </p><p>There is a draw() method that claims to be used by animated overlays, but overriding it to do my animations still doesn't make anything animate. </p><p>Do I need to tell the app to make my overlay animate, or do I need to use a different type of overlay?</p>","28001","","28001","","2010-09-25 23:15:28","2011-10-05 21:07:34","Moving icons on a Android MapView","<android><google-maps><android-mapview><itemizedoverlay>","4","0","6","",""
"3795923","1","3795949","","2010-09-25 23:11:31","8","25726","<p>I am wondering how it's possible to create a buttom bar buttons in android, </p><p>I read something about this UI solution, are there any controls that can be used?</p>","371301","","55093","","2011-07-04 11:47:19","2013-05-21 15:56:31","Bottom button bar in android","<android>","4","0","3","",""
"3795936","1","3797770","","2010-09-25 23:14:06","2","735","<p>I'm wondering what is the highest level I can go in-order to know when the user interacts with my application</p><p>preface: I'd like to logout of my application after X seconds of user inactivity.so what I did is create a service with a timer, and a toggle function which resets the timer to X time.after X time has passed, an intent is raised, and a broadcast receiver catches that intent and preforms the logout (closing the open logged in activities as well...)</p><p>as for the actual question, I need to call the ""Timer Toggle"" function each time the user interacts with the application.where is the highest place in the android app that I can know when the user interacts with the phone</p><p>The only thing I found is to implement onClick and onKeyPress for each activity, is there another better way? maybe in the Application class?</p>","406682","","","","","2010-09-26 12:28:16","How do I test for activity inactivity time","<android><timeout><locking><android-widget>","1","0","1","",""
"3795988","1","3796467","","2010-09-25 23:34:14","0","77","<p>I would like to have a special listview with a title, couple of sub-categories, and a picture. The picture below is a rough idea of how I would like to lay it out. I am very new to android so keep in mind that details really helps me. Thank you in advance. </p><p><img src=""http://i.stack.imgur.com/Y5afV.png"" alt=""alt text""></p>","413926","","","","","2010-09-26 03:15:03","How can I make a listview with more than a title?","<android><listview>","1","0","","",""
"3796021","1","","","2010-09-25 23:47:09","10","3556","<p>In the Android manifest file, there is a field that specifies the application version.</p><p>How I can read that value programmically?</p>","141673","","418183","","2011-04-14 10:57:21","2011-04-14 10:57:21","How can I read the app version defined in the manifest file programmically?","<android>","2","0","2","",""
"3796125","1","3838729","","2010-09-26 00:32:26","2","1221","<p>I have a main page (main.html) in the assets folder that I am displaying with: </p><pre><code>webview.setWebChromeClient(new MyWebChromeClient());webview.getSettings().setJavaScriptEnabled(true);webview.addJavascriptInterface(new VersionCallbackScript(), ""demo"");webview.loadUrl(""file:///android_asset/main.html"");</code></pre><p>and I want to put a link in the document to another html file in assets folder.  When I similiarly put in the tag:</p><pre><code>&lt;a href=""file:///android_asset/secondpage.html""&gt;Touch here for page 2&lt;/a&gt;&lt;/font&gt;&lt;/h4&gt;</code></pre><p>and touch it in the client, the screen loads a blank page.</p><p>likewise, I want to have a table of contents that isA ListView and uses loadUrl with an html page suffixed with an anchor.  I tried and it is not working</p><pre><code>String anchor = ""subsection1"";webview.loadUrl(""file:///android_asset/main.html"" + ""#"" + anchor);</code></pre><p>this construct is not working either.</p>","157804","","157804","","2010-09-28 06:22:03","2010-10-01 11:29:27","How to hyperlink android html assets when using chrome client?","<html><android><assets><webchromeclient>","1","0","","",""
"3796134","1","3796444","","2010-09-26 00:36:06","0","861","<p>Is Exchange ActiveSync enabled by user? device? device type or device OS? </p><p>I'm asking because  I'm going to an employer who said they only support Exchange corporate email on Blackberry or iPhone.   I just purchased a Samsung Epic Android phone under Sprint. As far as I now there is no Enterprise email plan for that phone. But it does run ActiveSync.</p><p>Why would an employer limit the devices allowed to access email and can they really enforce that?  Is the limitation usually a function of what devices can run Active Sync?</p><p>Also, if they do allow my Android, what beyond entering the the user, pw and exchange server do they need to do on my phone? Can they put a policy on my personal phone?</p><p>Thanks.</p>","440279","","","","","2010-09-26 03:02:05","Is Exchange ActiveSync enabled by user? device? device type or OS?","<android><email><exchange-server><policy><activesync>","1","0","","",""
"3796176","1","","","2010-09-26 00:55:55","9","15797","<p>How can you manually change the font size of a webview? e.g. When the page loads up in the webview the font size is like 24pt. and way too large for my android's screen. I've looked into the ""websettings"" but it seems that the two are not related.</p><p>Thanks</p>","458452","","1590502","","2014-03-19 13:44:43","2014-03-19 13:44:43","How to change the FontSize in an Android WebView?","<android><android-webview><font-size><android-fonts>","3","0","7","",""
"3796311","1","3796539","","2010-09-26 02:03:07","1","7463","<p>For an Android application, I'm trying to use a Spinner which, when an option is selected, will hide/display relevant View objects. For my application, these objects are an EditText and an associated TextView label for the field. Unfortunately, I can't seem to get the EditText to hide/display, and when I add it code to hide/display the TextView, I get a NullPointerException. I presume that since I am laying out the view objects in a RelativeLayout, by hiding one of the view objects, I am removing its relationship with other view objects, hence the NullPointer.</p><p>Can anyone figure out why this might be happening?  Here's my code:</p><pre><code>public class FormFields extends Activity {    private Spinner mSpinner;    private EditText mTextField;    private TextView mLabel;    private static final int SPINNER_OPTION_FIRST = 0;    private static final int SPINNER_OPTION_SECOND = 1;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.form_fields);        mTextField = (EditText) findViewById(R.id.text_field);        mLabel = (TextView) findViewById(R.id.field_label)        mSpinner = (Spinner) findViewById(R.id.spinner);        ArrayAdapter adapter1 = ArrayAdapter.createFromResource(            this, R.array.spinnerOptions, android.R.layout.simple_spinner_item);        adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        mSpinner.setAdapter(adapter1);        mSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {            @Override            public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {                switch(position) {                    case SPINNER_OPTION_FIRST: {                        mLabel.setVisibility(View.GONE);                        mTextField.setVisibility(View.GONE);                    }                    case SPINNER_OPTION_SECOND: {                        mLabel.setVisibility(View.VISIBLE);                        mTextField.setVisibility(View.VISIBLE);                    }                }            }            @Override            public void onNothingSelected(AdapterView&lt;?&gt; parentView) {                // Do nothing            }        });    }}</code></pre><p>form_fields.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""#104667""&gt;        &lt;TextView            android:id=""@+id/spinner_label""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_centerHorizontal=""true""            android:layout_marginTop=""15dip""            android:textStyle=""bold""            android:text=""Please select an option"" /&gt;        &lt;Spinner            android:id=""@+id/spinner""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_below=""@+id/spinner_label""            android:layout_marginLeft=""25dip""            android:layout_marginRight=""25dip""            android:drawSelectorOnTop=""true""            android:prompt=""@string/spinnerPrompt"" /&gt;        &lt;TextView            android:id=""@+id/field_label""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_below=""@+id/spinner""            android:layout_centerHorizontal=""true""            android:layout_marginTop=""15dip""            android:textStyle=""bold""            android:text=""Enter text here: ""            android:visibility=""gone"" /&gt;        &lt;EditText            android:id=""@+id/text_field""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_marginLeft=""25dip""            android:layout_marginRight=""25dip""            android:layout_below=""@+id/field_label""             android:visibility=""gone"" /&gt;    &lt;/RelativeLayout&gt;&lt;/ScrollView&gt;</code></pre>","453354","","","","","2010-09-26 03:57:06","Android - how to use Spinner to hide/display View objects","<android><spinner><show-hide>","1","0","","",""
"3796331","1","3796346","","2010-09-26 02:12:27","0","6965","<p>Hello I have a bunch of text on my file which i display. I used the Hello World demo to insert this text. Now Whenever i try to edit main.xml it doesn't happen. If anybody knows why that would be cool but I want to know how to add simple scrolling to my text. I don't think I need to use main.xml right. Is there a way I can just add it to my project?</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.TextView;public class manifesto extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //Make a new text view passing Activity object    TextView tv = new TextView(this);    //Set a text into view    tv.setText(""A bunch of text."");    tv.setTextSize(12);    //set the view into activity view container    setContentView(tv);        }}    </code></pre><p>Here is the XML file in case you want to see it.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextView android:text=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""  android:id=""@string/hello""&gt;&lt;/TextView&gt;                         &lt;/LinearLayout&gt;</code></pre>","458474","","","","","2012-05-11 13:10:35","Main.xml in Android","<android><user-interface><scrolling><scroll>","1","0","","",""
"3796367","1","3796495","","2010-09-26 02:28:15","20","16648","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3260868/android-emulator-trouble-creating-user-accounts"">Android Emulator - Trouble creating user accounts</a>  </p></blockquote><p>I'm trying to register a Google Account with the Android emulator running 2.2 API level 8. Forums suggest that you can do this by going to Settings -> Accounts, however for me I only have the option to add a ""corporate"" account, i.e. an Exchange account, not a Google Account.</p><p>I wish to add this Google Account to test c2dm from the emulator.</p><p>Does anyone know how to associate a Google account with the emulator in this build?</p><p>Thanks,Eric</p>","61072","","","","","2012-05-06 04:21:42","How do I register my Google Account in the android emulator running 2.2 api level 8?","<android><android-emulator>","1","0","4","2012-11-02 16:24:15",""
"3796457","1","3796550","","2010-09-26 03:10:10","2","855","<p>I want to test my android app on a phone.  I do not have an android phone so I was going to purchase one.  Question, I can get a phone on eBay etc without a contract will this work to test my app?  Or must it be an unlocked or rooted phone? Can I install and test my apps on a phone that has not been unlocked and does not nave a contract?</p>","408112","","","","","2010-11-01 13:52:11","Want a phone to develop android apps on must it be unlocked?","<android>","2","0","","",""
"3796490","1","","","2010-09-26 03:25:53","35","33339","<p>Did a fresh install of Eclipse, JDK and android-sdk.</p><p>I am currently receiving this error when creating a new project</p><blockquote>  <p>[2010-09-26 16:07:56 - Test] ERROR: Unable to open class file C:\workspace\Test\gen\com\example\test\R.java: No such file or directory</p></blockquote><p>What's the reason for this and how do I fix it?</p><pre><code>Eclipse Helios 32 bitjava version ""1.6.0_21""Android sdk API 8</code></pre><p>P.S. I'm new to Android development.</p><p>EDIT: I tried most of your solutions, but nothing worked. So I started using my friend's install of Eclipse Ganymede.</p>","458493","","13531","","2011-02-11 17:32:55","2013-05-17 12:05:21","Error: Unable to open class file R.java","<java><android><eclipse><r.java-file>","21","5","3","2014-01-28 23:25:58",""
"3796589","1","4479836","","2010-09-26 04:24:46","0","1641","<p>I have 2 questions:</p><ol><li><p>How do some android app make their service restart even if killed from task manager? A good example is Lookout security app. What I guess is that it has registered for all common events that are announced like app installed - unistalled, interenet available ,etc.Is this a way to keep your service running ?Another solution I found was to make 2 services monitoring each other, so if one gets killed restart another.Which one would be a proper approach ? </p></li><li><p>Is there any way in android to start booting automatically(if device is switched off) once connected to power source ? I have never heard this on mobile platform.This is possible for PC through bios feature. Can it be done on android ? Any ideas welcome.</p></li></ol>","315619","","","","","2010-12-18 19:49:13","How do some app make their service running (relaunching it) even after killed ? Can android have any way to boot on power connect?","<android>","2","1","1","",""
"3796654","1","","","2010-09-26 05:06:21","0","1558","<p>How do I check any kind of network status in Android?</p>","489762","","651104","","2012-04-17 04:50:15","2014-02-10 17:40:05","Check network in Android","<android>","2","0","","",""
"3796670","1","10119462","","2010-09-26 05:16:43","1","511","<p>I am creating an application in Android for which I need to be able to enable or disable programmatically, the audible selection option that we see in the Sound and DIsplay settings.I am not able to find the API for this. Please help me with it.</p>","458535","","707795","","2012-07-23 08:51:35","2012-07-23 08:51:35","Set Audible selection option programmatically in Android","<android>","1","0","","",""
"3796732","1","","","2010-09-26 05:45:51","0","335","<p>I'm unable to resize and reposition the alert dialog box. Please help me do this!</p>","489762","","23897","","2010-09-26 05:49:09","2011-03-03 03:17:32","Repositioning the alert dialog on Android","<android>","2","0","","",""
"3796778","1","","","2010-09-26 06:04:41","0","525","<p>I am facing problem to customize Linear Layout. My xml is as follows:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#ffffff""    &gt;     &lt;LinearLayout android:id=""@+id/LinearLayout_LeftPanel""         android:layout_width=""wrap_content""         android:layout_height=""fill_parent""         android:background=""#0000ff""            &gt;        &lt;TextView android:id=""@+id/LeftPanel_Title""             android:text=""Frequently asked questions""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""             android:textColor=""#000000""            /&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout_MainContent""                android:layout_width=""fill_parent""         android:layout_height=""wrap_content""                android:gravity=""center""        android:layout_toRightOf=""@+id/LinearLayout_LeftPanel""              &gt;        &lt;TextView android:id=""@+id/MainContent_Title""             android:text=""Alabama Rules of Civil Procedure""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""              android:textColor=""#ff0000""             android:textSize=""19px""             android:textStyle=""bold""             /&gt;         &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>I want to set the width of @+id/LinearLayout_LeftPanel layout one third of the screen  width pro-grammatically on the onCreate().so how can do this ?</p>","424854","","244296","","2010-09-26 06:44:35","2010-09-26 17:06:15","LinearLayout problem","<android>","2","0","1","",""
"3797003","1","3797210","","2010-09-26 07:48:59","0","924","<p>I really like <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"" rel=""nofollow"">this</a> approach for handling sqlite database when developing for Android but I have a question when it comes to upgrading the database during an upgrade of the application. Is this method recommended or is it so much safer to do the standard procedure (as it seem to be) with drop table/create table/insert into, within a transaction instead, in order to being able to roll back in case of failure?</p>","287170","","","","","2010-09-26 09:28:50","OnUpgrade not using drop table/create table/insert into","<android><sqlite><upgrade>","1","0","1","",""
"3797201","1","3797935","","2010-09-26 09:25:20","1","1573","<p>I writing player, it has main activity that runs localservice.I can't find how bind localservice to widget.When i trying to bind it like in activity it fails.</p><p>Plz help me.</p><p>Adding #1How can I contact with background service when?<a href=""http://www.developer.com/ws/data/article.php/10944_3843561_1/Handling-Lengthy-Operations-with-Android-App-Widgets.htm"" rel=""nofollow"">http://www.developer.com/ws/data/article.php/10944_3843561_1/Handling-Lengthy-Operations-with-Android-App-Widgets.htm</a></p><p>here i found something, but it doen't work for me.</p>","382302","","382302","","2010-09-26 13:48:55","2012-10-31 04:48:08","android widget and localservice bind","<android><service><activity><media-player>","2","2","1","",""
"3797241","1","3797255","","2010-09-26 09:39:35","6","21695","<p>I thought ADT should come with a visual editor for building GUI : <a href=""http://stackoverflow.com/questions/851882/easy-way-to-build-android-ui"">http://stackoverflow.com/questions/851882/easy-way-to-build-android-ui</a></p><p>However, I just cannot find it. I was wondering where is the Visual Editor for Eclipse with the ADT plugin.</p><p>I can run HelloWorld application without problem. However, whenever I click on <code>main.xml</code> at the left navigation tree layout folder, here is what I get. What I wish to get is a WYSIWYG editor.<img src=""http://i.stack.imgur.com/PnZ4G.png"" alt=""alt text""></p>","72437","","","","","2013-06-21 13:50:59","Where is the Visual Editor for Eclipse with the ADT plugin","<android>","10","0","2","",""
"3797400","1","3797424","","2010-09-26 10:30:46","2","84","<p>I am new to android and only have a little experience with HTML and Basic, after much time and frustration I finally managed to make my listview clickable, I made an intent based on position like this;</p><pre><code> if (position == 3) {                Intent intent = new Intent(this, Bradford.class);                startActivity(intent); }</code></pre><p>problem is I have 4 lists in separate tabs and I have 92 options within those lists so I would have to do 92 intents(Very messy), so the first question is, is there a better way of achieving intents with less code whilst still using the position to determine the click</p><p>Also I have 92 classes in total they will all do more or less the same, first thing I want to do is put each list category in a folder, does this change the path for instance (this, com.ff.org.firstlist.Bradford.class)  do I need to do this in the code or just in the manifest.</p><p>Lastly I have 92 classes they will open urls with the app and use gps and some print and image functions would it be better to have all my information in one file instead of separate classes in terms of speed and reliability or should I keep the 92 classes.</p>","445174","","445174","","2010-09-26 10:38:55","2010-09-26 10:38:55","How to achieve better organisation","<java><android><eclipse>","1","1","","",""
"3797478","1","3797567","","2010-09-26 10:53:07","2","3425","<p>I am requesting information from a web service in my android app. The web service returns a list of items, each item having a base64 image and some info</p><p>First method: simply access the web service and get the result. This means freeze of UI until data is downloaded. Not a good solution</p><p>Second method: put the data download in a thread, and display a progress bar with a message. </p><pre><code> private void StartGettingData()    {        viewInfo = new Runnable(){            public void run() {                getData(); //from the web service            }        };        Thread thread =  new Thread(null, viewInfo, ""MagentoBackground"");        thread.start();        progressDialog = ProgressDialog.show(TracksListActivity.this,                  ""Please wait..."", ""Retrieving data from WEB..."", true);    }    private void getData(){    {      get data from web service into a list and then       runOnUiThread(returnRes);    }     private Runnable returnRes = new Runnable() {     public void run() {         populate the listview adapter with info from the web service result list and         progressDialog.dismiss();         generalTrackInfoAdapter.notifyDataSetChanged();     } };</code></pre><p>This shows a nice loading image and the message. The user will have to wait until all the download is complete. I don't know how to cancel the getdata() thread.</p><p>Third method: I would like to have something like, the user presses a button to get data, a thread downloads item by item from the web service and immediate shows it in the list. The use can always cancel the request with a button press. </p><p>But, how to do this ? Or is there another way ?</p>","379865","","","","","2010-09-26 11:35:43","Threaded web service call","<android><web-services><asynchronous>","1","0","2","",""
"3797600","1","3797687","","2010-09-26 11:35:59","1","385","<p>I have a ListView with let's say 5 items. When I click on one of these it automatically start a new activity based on the position of my ListView.</p><p>Then, in the new activity, it shows like ""1 of 5"".</p><p>I have two buttons (back and next) to show 2 of 5 etc, but how should I implement so it loads new content without starting a lot of activites for every ""2 of 5"", ""3 of 5"" etc..? It's meant to be done this way so the user don't need to go back to the ListView and then choose the second position..</p><p>My current code (From the ListView):</p><pre><code>        OnItemClickListener itemListener = new OnItemClickListener() {          public void onItemClick(AdapterView&lt;?&gt; parent, View v,          int position, long rowid) {            Intent intent = new Intent().setClass(ctx, Details.class);            Bundle b = new Bundle();            b.putInt(""id"", parent.getPositionForView(v));            intent.putExtras(b);            startActivity(intent);              }    };</code></pre><p>and then a piece of code in Details.java:</p><pre><code>       next = (Button)findViewById(R.id.next_button);       back = (Button)findViewById(R.id.back_button);       Bundle b = getIntent().getExtras();       id = b.getInt(""id"");       id_header_sum = id+1;       String string_id = Integer.toString(id_header_sum);       one_of_all.setText(string_id + "" of 5"");                    nextOnClick = new OnClickListener() {            public void onClick(View arg0) {                  if(id_header_sum==30){                   }               else {               }            }        };        backOnClick = new OnClickListener() {            public void onClick(View arg0) {                   if(id_header_sum==1){                   }                   else {                   }            }        };        next.setOnClickListener(nextOnClick);             back.setOnClickListener(backOnClick); </code></pre><p>I don't want to start a single activity for every detail.</p><p>Please tell me if the question is unclear and thanks in advance!</p>","386562","","","","","2010-09-26 13:50:27","How should this be achieved? Activity/ActivityGroup or ViewFlipper?","<android>","1","0","","",""
"3797734","1","3797787","","2010-09-26 12:17:31","1","15352","<p>I'm sure this has been answered somewhere, already, but I just can't find it:I have a TabHost with three tabs, each containing different views (not Activities). What I want is to make a swiping gesture from right to left and let the current view slide out to the left and the next view slide in from the right, thus changing the current tab. So, I want the switch between tabs to be triggered by a gesture (rather than only by clicking on the tab) and also want to show an animation when the current tab is changed. </p><p>I looked at the ViewFlipper examples and tutorials, but I can't find one that explains how to do this to slide between tabs.</p><p>Again, sorry if this has been answered before, I just can't find it.</p>","388826","","","","","2013-01-22 09:20:33","Android: Slide gesture and animation for switching between tabs","<android><animation><tabs><slide><gesture>","3","0","5","",""
"3797743","1","","","2010-09-26 12:20:21","5","861","<p>I need to fix a bug in an old app of mine. Part of the bug is how I select contacts. Here is what I need:</p><ol><li>The contact must be from the'normal' google contacts list, i.e.I don't want to get any contactsfrom facebook or similar.</li><li>The contact must have at least one phone number.</li><li>The contact must be from the old <code>android.provider.Contacts</code> provider.</li><li>If I can use an Intent to fetch the contact URI without having to create the selection list etc myself, then that is a bonus.</li></ol><p>Sounds simple, but I am really struggling. This is what I am trying:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Intent intent = new Intent(Intent.ACTION_PICK, Contacts.People.CONTENT_URI);    startActivityForResult(intent, PICK_CONTACT_REQUEST);}</code></pre><p>That works OK. I still see contacts without phone numbers, but I can live with that. Worse though is that I still see facebook contacts in the list! This seems to be in contradiction to the following quote found at the <a href=""http://developer.android.com/reference/android/provider/Contacts.html"">Froyo API for the deprecated Contacts content provider</a>:</p><blockquote>  <p>The APIs have been superseded by ContactsContract. The newer APIs allow access multiple accounts and support aggregation of similar contacts. These APIs continue to work but will only return data for the first Google account created, which matches the original behavior. </p></blockquote><p>That sounds like exactly what I wanted, but alas, not what I got. </p><p>Finally, here are my concrete questions that I hope someone can answer:</p><ol><li>Why am I seeing Facebook contacts when using the android.provider.Contacts content provider?</li><li>If this doesn't work, how else can I get the user to select a google contact with a phone number?</li></ol><p>Many thanks.Gustav</p>","458677","","","","","2011-09-27 13:01:38","How to pick contacts only from google contacts (not facebook etc) with phone numbers?","<android>","1","1","5","",""
"3797889","1","3867115","","2010-09-26 13:01:51","1","247","<p>I am following the android licensing documentation (<a href=""http://developer.android.com/guide/publishing/licensing.html"" rel=""nofollow"">http://developer.android.com/guide/publishing/licensing.html</a>) and when i get to the step that I add the reference of the licensing project (in eclipse) to my project, I get an error in the console (see below) and my project doesnt build. Any ideas on how i can around this? I tried a couple searches on google, but I didnt come up with anything. Thanks.</p><p>Error seen:</p><pre><code>[2010-09-26 05:54:41 - MyApp] ERROR: Unknown option '--auto-add-overlay'[2010-09-26 05:54:41 - MyApp] Android Asset Packaging Tool[2010-09-26 05:54:41 - MyApp] [2010-09-26 05:54:41 - MyApp] Usage:[2010-09-26 05:54:41 - MyApp]  aapt l[ist] [-v] [-a] file.{zip,jar,apk}[2010-09-26 05:54:41 - MyApp]    List contents of Zip-compatible archive.[2010-09-26 05:54:41 - MyApp] [2010-09-26 05:54:41 - MyApp]  aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]][2010-09-26 05:54:41 - MyApp]    badging          Print the label and icon for the app declared in APK.[2010-09-26 05:54:41 - MyApp]    permissions      Print the permissions from the APK.[2010-09-26 05:54:41 - MyApp]    resources        Print the resource table from the APK.[2010-09-26 05:54:41 - MyApp]    configurations   Print the configurations in the APK.[2010-09-26 05:54:41 - MyApp]    xmltree          Print the compiled xmls in the given assets.[2010-09-26 05:54:41 - MyApp]    xmlstrings       Print the strings of the given compiled xml assets....</code></pre>","354607","","","","","2010-10-05 20:41:33","LVL error - cant reference LVL in my project","<android>","1","0","0","",""
"3797896","1","3798227","","2010-09-26 13:03:23","0","1328","<p>I have been developing on the HTC Hero for a while now, and just got another testing phone: the Evo. However, when I plug it in, nothing that I can do will get the system to recognize the EVO as something worthy of testing on.</p><p>I got the USB drivers. I went to the device manager to tell the system where the drivers are, and to associate them with the Evo. But even though I give it the exact folder, Windows keeps telling me that no compatible drivers were found. The Hero works fine with these drivers, and there are not any updates available for them. I am able to access the SD card when I put the phone in the right mode. Debugging mode is definitely turned on.</p><p>Halp? </p>","391837","","","","","2010-09-26 14:31:30","eclipse (windows) cannot recognize HTC Evo","<android><htc>","1","7","","",""
"3797910","1","3798492","","2010-09-26 13:09:07","0","794","<p>Let's assume i got a list of ImageView and TextView with LinearLayout.Now i'm using simple ArrayAdapter extension that gets Strig[][] as items which is an array of double strings (each entry contains String[2] where the first string is a uri to the image and the second one is the text. i override getView to display the image and text , recyling views, of course :-).However since image loading, even from resources may be slow, i'm doing it in an async task, that means that i have a default image loaded and i use: startLoading (it's my method) that stakes the ImageView and the Uri and once the image is ready it places it in the image view.</p><p>However sometimes, since it's a list if the image is not loaded yet and I'm in the middle of the process it's worth while stopping the loading, and that's in case that the line i'm loading image for is no longer visible.</p><p>Since the views are recycled i can't check if ImageView is visible since it may be visible but with a different Drawable... is there a way for me to know at some point that my line in invalidated and not visible ? is there a simple way or shell i need to start using flags and tag pattern and stuff like that to discover that my line is no longer valid ? </p>","312288","","","","","2010-09-26 15:38:00","checking if android list item (Drawable) is still visible","<android><listview><imageview><invalidate>","1","0","","",""
"3797992","1","","","2010-09-26 13:32:06","1","1279","<p>Is there anyway I can create a dynamically filled <code>ListView</code> when the class does not extend <code>ListActivity</code>?</p><p>I appreciate the help.</p>","445342","","119895","","2010-09-26 13:34:36","2010-09-26 13:37:14","Dynamic ListView extends Activity","<android><listview><dynamic><activity><listactivity>","1","0","1","",""
"3798093","1","","","2010-09-26 13:53:26","0","564","<p>i have made a surfaceView to accept a OnTouchEvent,and in this view, i draw a Button manually with Button.draw(Canvas)(not make a ViewGroup).</p><p>now, this button can be drawn on my SurfaceView, but when i pass a keyEvent from OnTouchEvent to Button like Button.onTouchEvent(keyEvent), but this button cannot show the click effect</p><p>so the question is how can i pass the keyEvent to a View manully and it show what it shown in a Layout????</p><p>Any ideas?thx!!</p>","443407","","443407","","2010-09-27 03:32:38","2010-09-27 04:34:39","How to pass a keyEvent object to a Button to let it appears like clicked?","<android><surfaceview>","1","1","","",""
"3798179","1","3798258","","2010-09-26 14:18:07","1","934","<p>I would like to start my own SMS editor when user selects ""Send message"" from contacts application. How do I define intent in manifest file to allow passing contact details to the editor?</p><p>Thanks a lot</p>","367677","","","","","2010-09-26 14:40:19","Intent definition in Manifest file","<android><android-intent><android-manifest><intentfilter>","1","0","","",""
"3798185","1","3798198","","2010-09-26 14:18:56","0","1017","<p>I wounder how its possible to make a shape like the example, with round corners and padding from the screen borders, and also put text inside, how is this possible?<img src=""http://i.stack.imgur.com/e7eJW.jpg"" alt=""alt text""></p>","371301","","","","","2010-09-26 14:23:51","Design in Android, Shapes","<android><xml><design><shapes>","1","0","1","",""
"3798299","1","3798340","","2010-09-26 14:52:10","1","4289","<p>I know there are tons of questions about this already floating around SO but I've read a bunch of them and still cannot get my 3rd column to align to the right.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""  android:orientation=""horizontal""  android:background=""#FFFFFF""  android:stretchColumns=""2"" &gt;  &lt;TableRow&gt; &lt;ImageView   android:src=""@drawable/blue_light""   android:layout_height=""48px""   android:layout_width=""48px""   android:padding=""3dp""  android:layout_margin=""3dp""  android:layout_column=""1""/&gt;      &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:layout_marginLeft=""10px""   android:layout_gravity=""center_vertical""   android:layout_column=""2""&gt;   &lt;TableRow&gt;    &lt;TextView      android:id=""@+id/row_title""       android:textColor=""#000000""      android:layout_width=""wrap_content""       android:layout_height=""wrap_content""        android:textStyle=""bold"" /&gt;   &lt;/TableRow&gt;   &lt;TableRow&gt;    &lt;TextView      android:id=""@+id/row_author""       android:layout_width=""wrap_content""      android:layout_height=""wrap_content""       android:textColor=""#9E9E9E""        android:textStyle=""italic|bold""/&gt;   &lt;/TableRow&gt;   &lt;/TableLayout&gt;   &lt;TableLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_column=""3""    android:layout_gravity=""center_vertical|right""  android:gravity=""center_vertical|right""   &gt;   &lt;TableRow&gt;    &lt;TextView      android:textColor=""#1F9C29""      android:textSize=""15dp""      android:id=""@+id/row_txt1""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:textStyle=""bold"" /&gt;   &lt;/TableRow&gt;   &lt;View    android:layout_height=""1dp""    android:background=""#000000""    android:layout_marginRight=""3dp""    /&gt;   &lt;TableRow&gt;    &lt;TextView      android:textColor=""#1B27D1""      android:id=""@+id/row_txt2""     android:layout_width=""wrap_content""      android:layout_height=""wrap_content""      android:textStyle=""bold""/&gt;   &lt;/TableRow&gt;   &lt;/TableLayout&gt;  &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>What am I doing wrong?</p>","13688","","","","","2013-01-08 08:37:14","Android: Cannot set gravity of TableLayout to Right","<android>","2","0","","",""
"3798336","1","3798394","","2010-09-26 15:02:18","0","774","<p>As lots of people do, I use Map and SoftReference to create image cache to cache downloaded image. </p><p>In my implementation, the latest used bitmap will be putted at the first element of Map, so, when the image cache reach max cache size, the last element of the Map which is long-time not used will be removed, and SoftReference makes sure the bitmap will be recycled.</p><p>Here is the problem: how can I be sure the removed bitmap is not being used(like, draw on the screen, etc. etc.) when it is recycled. If the bitmap is being used, will SoftReference gc it? It is really difficult to understand what ""Reachability"" means in <a href=""http://download.oracle.com/javase/1.5.0/docs/api/java/lang/ref/package-summary.html#reachability"" rel=""nofollow"">the api doc</a>.</p><p>Thanks in advance!</p>","365030","","","","","2010-09-26 15:14:24","Problem about image cache on Android","<android><image><caching>","1","0","","",""
"3798463","1","7443567","","2010-09-26 15:30:34","5","663","<p>I want to rotate an <code>ImageView</code> with an arrow from the current user location to some previously saved GPS location. How do I do this?</p><p>Is the Initial Bearing got from the <code>Location.distanceBetween</code> method the right way to go on this?  If so, how do I use it with the compass readings?</p>","448192","","1288","","2011-06-16 19:59:39","2011-09-16 10:48:29","Compass guide to GPS destination","<java><android><gps><compass-geolocation>","1","1","2","",""
"3798489","1","3798523","","2010-09-26 15:36:53","2","387","<p>I am using SmartFoxServer for a multiplayer game.  I have it working fine when it loads up in the main chat room.  In my app you an create new game rooms and when you click on one it launches a new activity and enters that room.  It appears I have to connect to the server again after that.  Then I get already logged in error.</p><p>How can I maintain the smartfox client throughout my activities?</p>","458768","","","","","2010-09-26 20:34:59","Carrying SmartFoxServer connection across Android Activities","<android>","1","0","1","",""
"3798509","1","","","2010-09-26 15:42:13","2","1779","<p>I have a simple question which keeps me thinking for a few hours now.</p><p>Assume a canvas which is rotated by a specific (known) degree. I want to get the screen coordinates of a bitmap I have drawn on the rotated canvas. To achieve this, I need the canvas' clip bounds. This would be no problem for a non-rotated canvas. But it keeps giving me strange values for the rotated case. To be honest, I'm not really sure, what they're supposed to be for a rotated canvas, as top and bottom can't be simple Integer values representing the distance of the currently viewable part on the y-axis to the top and the bottom of the canvas. The same applies to left and right. So what do these values mean to me and how can I use them to get the screen coordinates?</p><p>Looking at the Android source didn't help, as they're using a native_getClipBounds() method which I couldn't find anywhere...</p>","304266","","304266","","2010-10-02 09:12:23","2010-10-02 09:12:23","What does Canvas.getClipBounds() return if the canvas is rotated?","<android><graphics><canvas>","1","0","","",""
"3798624","1","","","2010-09-26 16:08:11","0","579","<p>Some time gets ""Launch Cancelled"" error.  Gets stuck at 'Open Time Sheet ' Button <code>btn01</code>.Any help is appreciated.</p><p>TimeSheet.java  </p><pre><code>package com.example.TimeSheet;import android.app.Activity;import android.content.Intent;import android.os.Bundle;public class TimeSheet extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        startActivity(new Intent(this, MenuExample.class));    }}  </code></pre><p>MenuExample.java  </p><pre><code>package com.example.TimeSheet;import android.app.Activity;import android.os.Bundle;import android.view.ContextMenu;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.view.ContextMenu.ContextMenuInfo;import android.widget.Button;import android.widget.Toast;public class MenuExample extends Activity{        @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.menu);                Button btn = (Button) findViewById(R.id.btn1);                btn.setOnCreateContextMenuListener(this);    }    private void CreateMenu(Menu menu)    {        menu.setQwertyMode(true);        MenuItem mnu1 = menu.add(0, 0, 0, ""Fill Time Sheet"");        {            mnu1.setAlphabeticShortcut('a');            mnu1.setIcon(R.drawable.icon1);        }        MenuItem mnu2 = menu.add(0, 1, 1, ""Check Time Sheet"");        {            mnu2.setAlphabeticShortcut('b');            mnu2.setIcon(R.drawable.icon2);                    }        MenuItem mnu3 = menu.add(0, 2, 2, ""Exit Time Sheet"");        {            mnu3.setAlphabeticShortcut('c');            mnu3.setIcon(R.drawable.icon3);        }    }    private boolean MenuChoice(MenuItem item)    {                switch (item.getItemId())         {        case 0:            Toast.makeText(this, ""You clicked on Item 1"",                 Toast.LENGTH_LONG).show();            return true;        case 1:            Toast.makeText(this, ""You clicked on Item 2"",                 Toast.LENGTH_LONG).show();            return true;        case 2:            Toast.makeText(this, ""You clicked on Item 3"",                 Toast.LENGTH_LONG).show();            return true;        }        return false;    }      // Using Context Menu    /*    @Override    public boolean onCreateOptionsMenu(Menu menu)    {        super.onCreateOptionsMenu(menu);        CreateMenu(menu);        return true;    }*/    @Override    public boolean onOptionsItemSelected(MenuItem item)    {             return MenuChoice(item);        }    @Override    public void onCreateContextMenu(ContextMenu menu, View view,     ContextMenuInfo menuInfo)     {         super.onCreateContextMenu(menu, view, menuInfo);         CreateMenu(menu);    }    @Override    public boolean onContextItemSelected(MenuItem item)    {             return MenuChoice(item);        } }</code></pre><p>main.xml  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;/LinearLayout&gt;</code></pre><p>menu.xml   </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;Button android:id=""@+id/btn1""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""         android:text = ""Open Time Sheet""/&gt;            &lt;/LinearLayout&gt;   </code></pre><p>..................................<br>[2010-09-27 00:51:57 - TimeSheet] HOME is up on device 'emulator-5554'<br>[2010-09-27 00:51:57 - TimeSheet] Uploading TimeSheet.apk onto device 'emulator-5554'<br>[2010-09-27 00:52:08 - TimeSheet] Failed to upload TimeSheet.apk on device 'emulator-5554'<br>[2010-09-27 00:52:08 - TimeSheet] java.io.IOException: Unable to upload file: null<br>[2010-09-27 00:52:08 - TimeSheet] Launch canceled!  </p>","458787","","458787","","2010-09-27 00:01:26","2010-10-09 16:20:14","code not running properly ","<android>","1","6","","",""
"3798647","1","","","2010-09-26 16:14:19","0","621","<p>can i keep progress dialog anywhere in activity??if possible then how can i do it???</p>","489762","","489762","","2010-09-26 17:03:12","2010-09-26 17:08:12","Progress Dialog in Android","<android>","2","0","","",""
"3798718","1","3798868","","2010-09-26 16:27:36","2","1208","<p>I need an event executing when user plugs in/out wired headphones, it made in HTC sense player.</p><p>android.media.AudioManager doesn't generate an event, it even doesn't return a correct value with isWiredHeadsetOn()</p><p>How can i know if wired headset plugged or not?</p>","382302","","","","","2010-09-26 17:06:37","wired headphones pluged in and out","<android><audio><headphones>","1","0","1","",""
"3798823","1","3808432","","2010-09-26 16:52:50","1","4177","<p>I'm trying to upload an image from android to a PHP server by using MultiPartEntity but i have trouble to find the source of the problem , the progress dialog steel downloading without providing any response here my code :</p><pre><code>    public String postFunction(String s_v1, String s_v2, String s_v3)throws ParseException, ClientProtocolException, IOException {HttpClient httpclient = new DefaultHttpClient();HttpPost httppost = new HttpPost(s_v1);//required apache-mime4j-0.6, et httpmime-4.0.3MultipartEntity  mp = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);mp.addPart(""choix"", new StringBody(""2""));boolean exists = (new File(""/data/data/my.package/files/avatar.jpg"")).exists();  if (!exists){    Log.i(TAG,""no file"");} else{File tempImg = new File(""/data/data/my.package/files/avatar.jpg"");FileBody bin = new FileBody(tempImg, ""image/jpg"");mp.addPart(""photo_r"", bin);}mp.addPart(""myString1"", new StringBody(s_v2,  Charset.forName( ""UTF-8"" )));mp.addPart(""myString2"", new StringBody(s_v3, Charset.forName( ""UTF-8"" )));httppost.setEntity(mp);Log.i(TAG,""start "");HttpResponse response = httpclient.execute(httppost);Log.i(TAG,""end"");return response;}</code></pre><p>i don't know where's the problem !!many thanks befor ;)</p>","401663","","","","","2011-02-10 19:00:41","Uploading an image from android to a PHP server","<php><android><image><upload><multipart>","2","1","","",""
"3798848","1","3929515","","2010-09-26 17:01:20","7","3612","<p>I would like to make a game out of many cubes and am planning on putting it on mobile platforms and also on the web using webgl.  My problem is when I make a drawelements call per cube I take a hit on the frame rate. Is there a way I can make a single draw call to opengl es to draw them? The only difference between the cubes would be position and color.</p>","256062","","","","","2010-10-14 02:01:09","Most efficient way to draw multiple identical objects?","<iphone><android><graphics><opengl-es><webgl>","3","3","1","",""
"3798934","1","3798959","","2010-09-26 17:20:24","0","2106","<p>My widget launches a configuration screen when chosen to be put on screen. That works fine.I wanted to be able to touch a part of the widget to return to that configuration screen.I have created 2 pending intents in my widget's service but only one works. The code is below:</p><pre><code>remoteView.setOnClickPendingIntent(R.id.my_image,myWidget.makeControlPendingIntent(getApplicationContext(),BUTTON1,appWidgetId));remoteView.setOnClickPendingIntent(R.id.TextViewBat,myWidget.makeControlPendingIntent(getApplicationContext(),BUTTON2,appWidgetId));</code></pre><p>and before those 2 at the beggining of the service the code to choose what to do:</p><pre><code>if(command.equals(BUTTON1)){        Intent firstIntent = new Intent(this, anotherActivity.class);        firstIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        startActivity(firstIntent); //THIS WORKS    }else if(command.equals(BUTTON2)){        Toast.makeText(getApplicationContext(), ""the prefs button is clicked"",                Toast.LENGTH_SHORT).show(); //THIS WORKS        /*Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(""http://www.google.com""));        myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        startActivity(myIntent);*/  //THIS WORKS        Intent myIntent = new Intent(this,myConfiguration.class);        myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        startActivity(myIntent); //* * * THIS CRASHES * * * *    }</code></pre><p>For the life of me i cannot understand how i can launch again the configuration activity.Please help.</p>","364418","","","","","2010-09-26 17:27:53","How to launch widget configuration after is been put on screen","<android><button><widget><android-intent>","1","0","","",""
"3799031","1","3799222","","2010-09-26 17:44:46","3","902","<p>I notice that my app's data on external storage (i.e. SD card) gets deleted during an ""adb install -r"". While this is normal for uninstall (and then afterwards install optionally to notice it), I do not understand why this is the case for reinstall (and thus for Market updates as well). I could have sworn this was not always the case.</p><p>Referring to <a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesExternal"" rel=""nofollow"">http://developer.android.com/guide/topics/data/data-storage.html#filesExternal</a> I am specifically using ""Accessing files on external storage"" on Android 2.2, but not ""Saving files that should be shared"" or ""Saving cache files"". So I am writing and reading data in ""/sdcard/Android/data//files/somefolder/data"". My preferences do stick.</p><p>@Commonsware: The problem is not so much with getExternalFilesDir() IMHO as I see my data is written where I expect it. It just does not stick. I am using a.o.:</p><pre><code>public static File getDefaultDirectory(Context context, String packageName) {    File dir;    if(mActivity_getExternalFilesDir!=null){//API &gt;=8        dir = invokeGetExternalFilesDir(context, ""fortune"");    }else if(mEnvironment_getExternalStorageDirectory!=null){//API &lt;=7        dir = invokeGetExternalStorageDirectory();        dir = new File(dir.getPath() + ""/Android/data/"" + packageName + ""/files/"");    }else{        //should never occur        return null;    }    return dir;}</code></pre>","458813","","458813","","2010-09-26 18:47:46","2010-09-26 18:47:46","How to prevent data on external storage getting deleted on reinstall/update?","<android>","1","0","0","",""
"3799038","1","3799894","","2010-09-26 17:47:57","30","20659","<p>I've implemented <code>onSharedPreferenceChanged</code> in my main activity. </p><p>If I change the preferences in the main activity, my event fires. </p><p>If I change the preferences through my preferences screen (<code>PreferenceActivity</code>) my event does NOT fire when preferences are changed (because it's a separate activity and separate reference to sharedPreferences?)</p><p>Does anybody have a recommendation of how I should go about overcoming this situation? </p><p>Thanks!</p><p>EDIT1: I tried adding the event handler right in my preference activity but it never fires. The following method gets called during onCreate of my preference activity. When I change values, it never prints the message (<code>msg()</code> is a wrapper for <code>Log.d</code>). </p><pre><code>private void registerChangeListener () {SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);    sp.registerOnSharedPreferenceChangeListener(new OnSharedPreferenceChangeListener () {        public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {            msg ("" ***** Shared Preference Update ***** "");            Intent i = new Intent();            i.putExtra(""KEY"", key);            i.setAction(""com.gtosoft.dash.settingschanged"");            sendBroadcast(i);            // TODO: fire off the event        }    });}</code></pre>","268803","","268803","","2010-09-26 18:10:06","2013-12-02 22:57:30","onSharedPreferenceChanged not fired if change occurs in separate activity?","<android><sharedpreferences>","5","1","9","",""
"3799209","1","3801739","","2010-09-26 18:25:08","2","153","<p>I have a listview within an activity and at the bottom of the screen I have a scrollable gallery, my problem is making the listview clickable, I would normally use the listview position by doing if(position == 3) and then create the intent but postion is being used by my gallery.</p><p>I listview is in the main.xml populated by an array.xml, can I add an id i.e android:id in the arrays.xml and create an intent with that, or can I create a listactivity and still use position to fire an intent if so how would I do this.</p>","445174","","","","","2010-09-27 07:09:20","How to add an id to Listview","<java><android><eclipse>","1","0","","",""
"3799211","1","3814241","","2010-09-26 18:25:32","0","128","<p>I am new in Android dev, and I am trying to load image like in this link,- it doesn't work, only black screen. Can smb tell why? I tried in emulators with android 1.5 and 2.2.</p><p><a href=""http://www.androidpeople.com/android-load-image-from-url-example/"" rel=""nofollow"">http://www.androidpeople.com/android-load-image-from-url-example/</a></p><p><strong>UPDATE:</strong> I solve my problem, i should add <code>INTERNET to ""uses-permission""</code> before <code>application</code> tag, but i did after it</p>","278279","","278279","","2010-09-27 20:31:49","2010-09-28 15:14:40","?ndroid - Loading image fail!","<android>","1","2","","",""
"3799225","1","","","2010-09-26 18:28:27","7","682","<p>I have scoured the web, I can't seem to figure out how to make an Android service actually DO anything.  I have found lots of examples of how to create a basic one, but none of the examples seem to show how to call the service from an activity, and have the service do something.  </p><p>For example, I would like to have a service running that will send a TCP text message to a server when requested.  I can make the service, and have it run, but how the heck do I have the Activity make the call that passes a string to the method in the service that will send the TCP message?</p><p>This seems like it should be somewhat easy, but I just can't figure out, or find an example, of how to do it.  Maybe I am not understanding what a service should be used for?  I definitely want it running for a long period of time, no gui needed, and ""service"" requests to send TCP messages....hum...</p>","447832","","","","","2010-09-26 18:39:16","Android Service - Cant seem to find an example","<android>","1","1","","",""
"3799353","1","","","2010-09-26 19:06:55","1","759","<p>I want to add frame to image with title and subtitle. The thing that I want to do is as follows : There are number of styled frames available and user selects any picture from the phone memory or takes a picture from camera, now on selecting any frame that picture should be in that frame. Also below that frame there should be title and subtitle of the image.</p><p>I hope I have made it clear of what I want to know.</p>","445541","","","","","2010-09-26 19:40:14","insert frame title and subtitle for image in android?","<android><image><manipulation>","1","0","","",""
"3799356","1","","","2010-09-26 19:07:09","1","404","<p>I have been googling for a couple days now searching for a sortable list widget similar to the one provided by stock android music app.  What I would like is ability to sort a list similar to how you can sort your music playlist.  I am coming to the conclusion that I am obviously not using the proper keyword to find my answer.  Any help would rule.</p><p>Thanks.</p>","458869","","","","","2010-09-26 19:33:22","Android List widget question","<android><gui><widget>","1","0","","",""
"3799368","1","3802172","","2010-09-26 19:10:36","1","1522","<p>I configured my android project to use ant. When building using the keyword release it fails with this message: </p><pre><code>java.lang.NullPointerExceptionat com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:239)at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)</code></pre><p>It fails on build.xml line 249 which is included here:</p><pre><code>&lt;macrodef name=""package-helper""&gt;        &lt;attribute name=""sign.package"" /&gt;        &lt;element name=""extra-jars"" optional=""yes"" /&gt;        &lt;sequential&gt;            &lt;apkbuilder                    outfolder=""${out.absolute.dir}""                    basename=""${ant.project.name}""                    signed=""@{sign.package}""                    debug=""${manifest.debuggable}""                    verbose=""${verbose}""&gt;  **LINE 249 IS HERE**                &lt;file path=""${intermediate.dex.file}"" /&gt;                &lt;sourcefolder path=""${source.absolute.dir}"" /&gt;                &lt;sourcefolder refid=""android.libraries.src"" /&gt;                &lt;jarfolder path=""${external.libs.absolute.dir}"" /&gt;                &lt;jarfolder refid=""android.libraries.libs"" /&gt;                &lt;nativefolder path=""${native.libs.absolute.dir}"" /&gt;                &lt;nativefolder refid=""android.libraries.libs"" /&gt;                &lt;extra-jars/&gt;            &lt;/apkbuilder&gt;        &lt;/sequential&gt;    &lt;/macrodef&gt;</code></pre><p>That is called from line 401 which contains these lines:</p><pre><code>&lt;target name=""-package-release"" depends=""-dex, -package-resources""&gt;    &lt;package-helper sign.package=""false"" /&gt;&lt;/target&gt;</code></pre><p>It looks like there is some problem with ApkBuilderTask.java but I don't know how/where to get the source of ApkBuilderTask.java. Has anyone run into this problem and found a solution? I'm using android SDK tools revision 7 if that helps.</p><p>Note: Running ""ant debug"" or ""ant release"" all comes out to the same result.</p>","458865","","","","","2010-11-26 18:58:47","NullPointerException in com.android.ant.ApkBuilderTask.execute when building with ant","<android><ant>","3","0","0","",""
"3799390","1","3799447","","2010-09-26 19:15:51","1","1537","<p>I use custom xml attributes for preferences. The preferences are inflated from xml. </p><p>I managed to create and read custom xml attributes for EditTextPreference, ListPreference and CheckBoxPreference by creating custom classes which inherit from the respective preference class. </p><p>In the constructor of the class I can read the attributes like so:</p><pre><code>public class CustomTextPreference extends EditTextPreference {    public CustomTextPreference(Context context, AttributeSet attrs) {        super(context, attrs);        TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.PreferenceCustomAttrs);        x = a.getString(R.styleable.PreferenceCustomAttrs_x);        y = a.getString(R.styleable.PreferenceCustomAttrs_y);    }}</code></pre><p>My problem is that I can't do this for the PreferenceScreen class, as it is a final class. So my question is: Is there any way I can read the custom attributes of a PreferenceScreen?</p>","451540","","","","","2010-09-26 19:32:24","Android: Custom Xml Attributes for PreferenceScreen","<android><android-preferences>","1","0","","",""
"3799406","1","","","2010-09-26 19:21:14","2","1642","<p>I've successfully enabled scrolling for an Android TextView by either placing it within a ScrollView or, alternatively, using TextView's setMovementMethod (e.g., myTextView.setMovementMethod(new ScrollingMovementMethod()); ).</p><p>However, I would ideally like to see the TextView scroll in a fashion similar to the IPhone/IPod touch where the text overshoots and bounces back.  In the emulator, a TextView simply scrolls to the beginning or end without any animation effect.</p><p>Is there an easy way to enable this scrolling behavior or some other approach that uses Android's animation capabilities and the OvershootInterpolator?</p>","230388","","","","","2013-10-16 11:37:35","TextView scrolling and animation in Android","<android><scrolling><textview>","3","0","1","",""
"3799519","1","3914652","","2010-09-26 19:50:58","2","4913","<p>I am trying to convert my SurfaceView (camera preview) into a Bitmap for face detection on the fly. I am receiving a not null image but when I display it onto a view it appears to be plain black. Any ideas what might be the reason and how to proceed?</p><p>(I believe it is difficult but not impossible to extract the bitmap from a SurfaceView - but nobody has posted any solution)</p><pre><code>class BackgroundView extends SurfaceView implements SurfaceHolder.Callback {        public BackgroundView(Context context) {            super(context);                    // ...            setDrawingCacheEnabled(true);        }        // ...    }    private Runnable update = new Runnable() {        public void run() {                    // Following statement is sending a black/blank image            faceView.updateFaces(backgroundView.getDrawingCache());            mHandler.postDelayed(update, (long) (1000));        }    };</code></pre>","356580","","","","","2010-10-13 00:24:11","SurfaceView to Bitmap","<android><bitmap><surfaceview>","3","1","1","",""
"3799522","1","3799909","","2010-09-26 19:51:20","0","751","<p>There are a ton of activity stack related questions on StackOverflow, but I didn't really see any that answered the question I have.  I'm working on an online game that (for now) has 3 different activities:</p><ol><li>Login/Register</li><li>Menu (seen when logged in, includes ""new game"", ""my stats"", and a few other things...I'm just worried about the ""new game"" option for now.)</li><li>Game</li></ol><p>The socket connection occurs in the login/register activity, which creates a custom service that runs in the background.  Since data can arrive at any point, the socket class I'm using has asynchronous response handlers.  This means I won't have access to the current context any time a message is received.</p><p>I need a way to figure out what the current context is when various message types are received so that I can handle the message accordingly.  For example, If a user's reached the game screen (#3 above) and gets one kind of message, it should simply tell the game screen to update with the new game state.  However, the user could be at the same game screen and receive a different type of message that says ""close screens #3 and #2 and log the user out, returning them to screen #1"".</p><p>Basically, I'm trying to figure out the best way to get the current activity/context, determine if it's the right context for the current message, and how to handle it.</p>","107277","","","","","2010-09-26 21:33:11","Access Android activity stack from asynchronous thread?","<java><android><multithreading><sockets><context>","1","2","0","",""
"3799536","1","3800843","","2010-09-26 19:54:14","2","2867","<p>The situation is this. I have an application written in vb.net. it consists or two parts. One on a PC and the other on a handheld windows mobile 6 device . The desktop program transfers a SQLServer compact database to and from the handheld device using activesync via USB. Potentially we want to look into having android handheld devices also supported by this application. Now I know I can use SQLite with .net. I know I can use ADB to push and pull data (and therefore the database files) to and from the device.</p><p>What I need to know is can I access ADB directly from VB.NET as an API or SDK rather than having to do it manually. </p><p>Unless of course I'm missing something and I can copy databases to and from the device in some other way?</p><p>thanks in anticipation</p>","458872","","","","","2013-02-10 06:51:03","android: transfer sqlite database from pc to device via usb programatically","<android><vb.net><usb>","2","3","","",""
"3799555","1","","","2010-09-26 19:59:47","2","5132","<p>I started off with the tutorial <a href=""http://www.4feets.com/2009/03/2d-physics-on-android-using-box2d/"" rel=""nofollow"">here</a> and added drawing code for a view (covering the entire screen). The scene appears static and not dynamic even though I'm calling world.step(,). How does one make the scene dynamic and is my drawing the right implementation or is there a better way (using jBox2d functions)?</p><pre><code>private class PhysicsView extends View {        Paint mPaint;        public PhysicsView(Context context) {            super(context);            mPaint = new Paint();            mPaint.setColor(Color.BLUE);            mPaint.setStyle(Style.FILL_AND_STROKE);        }        @Override        public void onDraw(Canvas canvas) {            super.onDraw(canvas);            synchronized (canvas) {                Body[] b = mWorld.bodies;                for (int i = 0; i &lt; b.length; i++) {                    if (b[i] != null) {                        Float mass = b[i].getMass();                        Vec2 v = b[i].getPosition();                        canvas.drawCircle(v.x, v.y, 15, mPaint);                    }                }                Paint p2 = new Paint(mPaint);                p2.setColor(Color.GREEN);                Vec2 base = mWorld.groundBody.getPosition();                canvas.drawRect(new RectF((float) base.x - 25.0f,                        (float) base.y - 10.0f, (float) base.x + 25.0f,                        (float) base.y + 10.0f), p2);                canvas.drawLine(0.0f, 0.0f,                        mWorld.world.getWorldAABB().upperBound.x, mWorld.world                                .getWorldAABB().upperBound.y, p2);            }        }    }public class PhysicsWorld {    public int targetFPS = 40;    public int timeStep = (1000 / targetFPS);    public int iterations = 5;    public Body[] bodies = new Body[50];    public Body groundBody;    private int count = 0;    private AABB worldAABB;    public World world;    private BodyDef groundBodyDef;    private PolygonDef groundShapeDef;    private Vec2 screenDimensions;    public void create(Vec2 dimens) {        screenDimensions = dimens;        worldAABB = new AABB();        worldAABB.lowerBound.set(new Vec2((float) -1*dimens.x, (float) -1*dimens.y));        worldAABB.upperBound.set(new Vec2((float) dimens.x, (float) dimens.y));        Vec2 gravity = new Vec2((float) 0.0, (float) 0.0);        boolean doSleep = true;        world = new World(worldAABB, gravity, doSleep);        groundBodyDef = new BodyDef();        groundBodyDef.position.set(new Vec2((float) dimens.x/2, (float) dimens.y - 10.0f));        groundBody = world.createBody(groundBodyDef);        groundBody.m_mass = 200.0f;        groundShapeDef = new PolygonDef();        groundShapeDef.setAsBox((float) 50.0, (float) 10.0);        groundShapeDef.density = 1.0f;        groundShapeDef.friction = 0.3f;        groundBody.createShape(groundShapeDef);    }    public void addBall() {        float x = (float) Math.random() * screenDimensions.x;        float y = (float) Math.random() * screenDimensions.y;        BodyDef bodyDef = new BodyDef();        bodyDef.position.set(new Vec2((float) x, (float) y));        bodyDef.massData.mass = 20.0f;        bodies[count] = world.createBody(bodyDef);        bodies[count].m_type = Body.e_dynamicType;        bodies[count].m_linearVelocity = new Vec2(1.0f, 2.0f);        CircleDef circle = new CircleDef();        circle.radius = (float) 1.8;        circle.density = (float) 1.0;        circle.type = ShapeType.CIRCLE_SHAPE;        bodies[count].createShape(circle);        count++;    }    public void update() {        world.step(timeStep, iterations);    }    public void changeGravity(Vec2 gravity) {        world.setGravity(gravity);    }}</code></pre>","356580","","","","","2012-02-07 12:08:46","jBox2d android drawing dynamic bodies","<android><dynamic><box2d><physics-engine>","3","0","3","",""
"3799663","1","","","2010-09-26 20:24:23","1","411","<p>We have built a Android application using JQTouch. The GUI is built with HTML and javascript.We just found that there is an issue with runing our app on Android 2.2</p><p>The textfiled doesn't respond well with touch selection, wherease this problem doesn't happen on 1.5 Android Device.</p><p>I suspect that the problem is caused by <strong>jqtouch.css</strong>, becase if I disable importing for jqtouch.css, the textfield respond very well.</p><p>I am just wondering if somebody came accross with the same problem. or is there any solution to this problem, becase I know nothing about web programming (css) and don't know how to fix it.</p><p>Thanks very much!</p>","399820","","","","","2010-09-26 20:24:23","JQTouch on Android 2.2 has problem with TextFeild","<android><jqtouch>","0","1","","",""
"3799697","1","3799785","","2010-09-26 20:32:00","0","223","<p>Given the following code:</p><pre><code>    Rect pos = new Rect();    for (int i = 0; i &lt; mCols; i++) {        pos = mTiles[1][i].getmPos();        pos.top = pos.top - size;        pos.bottom = pos.bottom - size;        mTiles[0][i].setmPos(pos);    }</code></pre><p>What I want to do is get the value from</p><pre><code>mTiles[1][i].mPos</code></pre><p>modify it, and set it in</p><pre><code>mTiles[0][i].mPos</code></pre><p>The problem is this statement </p><pre><code>pos = mTiles[1][i].getmPos();</code></pre><p>is copying the reference to the object and not the value of the object.  Meaning, when I modify pos.top or pos.bottom, the original object gets modified.</p><p>I'm guessing I am missing a concept of pass object by reference vs value here...which I thought I understood.  What is the fix here?  Is it a problem with how I defined my custom class?</p><p>Thanks.</p>","432209","","4249","","2010-09-26 21:14:47","2010-09-26 21:14:47","Changing a variable affects an indirect variable (value vs reference)","<java><android><eclipse>","2","0","","",""
"3799703","1","","","2010-09-26 20:32:44","1","923","<p>I'd like to know how difficult it is to analyze and edit sound in android. My project would be a kind of DJ application. </p><p>I think AudioTrack is the most appropriate library, right ? How does the few android DJ apps work to display the spectrum of the sound, apply effect, change the speed, mix ect ... Do they use a more powerful external sound library ? </p><p>For the performances issue, is Java fast enough ( or is there a risk of latency )?</p><p>And a last question : How does Korg ported its syth to Ipad, Wormux being ported to android, AngryBird works now on Iphone AND android ,ect ... all these apps seem to be ported to any platform without being re-written... how do they do ? It is because they are written in ""Native Code"" ? Should I consider this option so I can use other sound library ?</p><p>Thanks.</p>","400695","","","","","2010-09-26 20:32:44","Sound Analysis/Editing in Android","<android><audio><analysis><editing><native-code>","0","2","","",""
"3799723","1","","","2010-09-26 20:38:17","0","1049","<p>I write a rpn calculator app for just for learning.The buttons are arranged in a table layout. The arithmetic buttons uses a bigger font size because the symbols are very small otherwise. This produced slightly displaced buttons, but they are all the same size. It works if all buttons use the same font size.</p><p>Look here for image:<a href=""http://img512.imageshack.us/img512/3871/unbenanntnc.png"" rel=""nofollow"">http://img512.imageshack.us/img512/3871/unbenanntnc.png</a></p><p>How can I prevent this?</p><p>Thanks!</p><p>Update:I also tried: android:layout_centerVertical but with no effect.</p><p>Latest result:<a href=""http://img836.imageshack.us/i/unbenanntas.png/"" rel=""nofollow"">http://img836.imageshack.us/i/unbenanntas.png/</a></p><p>Used styles:</p><pre><code>&lt;style name=""CalcButton"" parent=""@android:style/TextAppearance.Medium""&gt;    &lt;item name=""android:layout_width""&gt;53dp&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;50dp&lt;/item&gt;    &lt;item name=""android:textColor""&gt;#000050&lt;/item&gt;    &lt;item name=""android:typeface""&gt;serif&lt;/item&gt;    &lt;item name=""android:textSize""&gt;14sp&lt;/item&gt;       &lt;item name=""android:layout_centerHorizontal""&gt;true&lt;/item&gt;            &lt;item name=""android:layout_centerVertical""&gt;true&lt;/item&gt;&lt;/style&gt;&lt;style name=""EnterButton"" parent=""@android:style/TextAppearance.Medium""&gt;    &lt;item name=""android:layout_height""&gt;50dp&lt;/item&gt;    &lt;item name=""android:textColor""&gt;#000000&lt;/item&gt;    &lt;item name=""android:typeface""&gt;serif&lt;/item&gt;    &lt;item name=""android:textSize""&gt;14sp&lt;/item&gt;    &lt;item name=""android:layout_span""&gt;2&lt;/item&gt;       &lt;item name=""android:layout_centerHorizontal""&gt;true&lt;/item&gt;            &lt;item name=""android:layout_centerVertical""&gt;true&lt;/item&gt;&lt;/style&gt;&lt;style name=""NumberButton"" parent=""@android:style/TextAppearance.Medium""&gt;    &lt;item name=""android:layout_width""&gt;53dp&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;50dp&lt;/item&gt;    &lt;item name=""android:textColor""&gt;#500000&lt;/item&gt;    &lt;item name=""android:typeface""&gt;serif&lt;/item&gt;    &lt;item name=""android:textSize""&gt;20sp&lt;/item&gt;       &lt;item name=""android:layout_centerHorizontal""&gt;true&lt;/item&gt;            &lt;item name=""android:layout_centerVertical""&gt;true&lt;/item&gt;&lt;/style&gt;&lt;style name=""ArithmeticButton"" parent=""@android:style/TextAppearance.Medium""&gt;    &lt;item name=""android:layout_width""&gt;53dp&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;50dp&lt;/item&gt;    &lt;item name=""android:textColor""&gt;#005000&lt;/item&gt;    &lt;item name=""android:typeface""&gt;serif&lt;/item&gt;    &lt;item name=""android:textSize""&gt;20sp&lt;/item&gt;    &lt;item name=""android:baselineAligned""&gt;false&lt;/item&gt;    &lt;item name=""android:layout_centerHorizontal""&gt;true&lt;/item&gt;       &lt;item name=""android:layout_centerVertical""&gt;true&lt;/item&gt;&lt;/style&gt;</code></pre><p>Excerpt of main.xml:</p><pre><code>&lt;TableLayout android:id=""@+id/TableLayout01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:layout_marginTop=""10px"" android:baselineAligned=""false"" &gt;&lt;TableRow&gt;&lt;Button android:id=""@+id/BtEnter"" style=""@style/EnterButton"" android:text=""Enter"" &gt;&lt;/Button&gt;&lt;Button android:id=""@+id/BtBs"" style=""@style/CalcButton""  android:text=""?""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/BtSwap"" style=""@style/CalcButton""  android:text=""y?x""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/BtRoll"" style=""@style/CalcButton""  android:text=""R?""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/BtC"" style=""@style/CalcButton""  android:text=""Clr""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre>","458904","","458904","","2010-09-27 10:42:53","2010-09-27 10:42:53","How to arrange buttons with different text-sizes in a TableView so they are not displaced?","<android>","0","4","","",""
"3799773","1","","","2010-09-26 20:50:15","8","12692","<p>I'm trying to implement scroll animation for gallery programmatically.</p><p>Tried with <code>setSelection(int pos, Boolean animate)</code> and it's not working.</p><p>Is there anyway to override <code>setSelection()</code> method.</p>","458927","","944657","","2013-04-02 02:23:23","2013-04-02 02:23:23","How to have scrolling animation programmatically","<android><animation><gallery>","5","0","5","",""
"3799800","1","","","2010-09-26 20:59:13","5","448","<p>How can I programmatically read the system setting for the virtual keyboard? I want my app buttons to behave like it is set in the system settings for the virtual keyboard (beep, vibrate or nothing).</p>","458904","","","","","2013-10-22 09:14:37","Android: how to read system setting for vibration on key presses","<android>","1","0","1","",""
"3799840","1","10700730","","2010-09-26 21:09:47","9","5417","<p>My EditText needs to accept input consisting of partial words, names, etc. At least on my HTC Desire, this is difficult since the keyboard wants to suggest and/or correct some entries (e.g., changes ""gor"" to ""for""). I tried setting textNoSuggestions on the view, but that doesn't fix it.</p><p>Any simple solution to this?</p>","446874","","","","","2014-01-10 15:01:07","EditText without auto-correction, etc","<android>","3","0","1","",""
"3799858","1","6570385","","2010-09-26 21:14:50","4","255","<p>I am trying to log into you tube using the following code</p><pre><code>mService = new YouTubeService(""Nothing"", developer_key);//Authenticationtry{   mService.setUserCredentials(mUsername, mPassword);}catch (AuthenticationException e){   Log.v(TAG, e.toString());}</code></pre><p>but I am getting:<br>    <code>ConnectYouTube: com.google.gdata.util.AuthenticationException: Error connecting with login URI</code></p><p>This code seems pretty basic to me and I can't figure out what mistake am I making here.</p>","458942","","319618","","2010-09-26 21:17:20","2011-07-04 10:43:11","logging into youtube from android","<android><youtube>","1","2","1","",""
"3799887","1","3800011","","2010-09-26 21:24:04","4","4825","<p>I'm trying to draw a custom border by drawing a custom view.  Here is a sample of one side of the border:</p><pre><code>package com.sparkydev.guessaphrase;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.drawable.ShapeDrawable;import android.graphics.drawable.shapes.RectShape;import android.util.AttributeSet;import android.view.View;public class LeftBorder extends View {    private ShapeDrawable vertRect, horizRect;    public LeftBorder(Context context, AttributeSet attributeset) {        super(context, attributeset);        int width = this.getWidth();        int height = this.getHeight();        vertRect = new ShapeDrawable(new RectShape());            vertRect.getPaint().setColor(Color.RED);            vertRect.setBounds(0, 0, width/10, height);        horizRect = new ShapeDrawable(new RectShape());            horizRect.getPaint().setColor(Color.RED);            horizRect.setBounds(0, 0, width, height/9);    }    protected void onDraw(Canvas canvas){        vertRect.draw(canvas);        horizRect.draw(canvas);    }}</code></pre><p>And the other side is defined pretty much the same way.  The XML is defined as such:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:background=""@drawable/wallpaper""&gt;    &lt;!-- Declares left border's position, which is    drawn programmatically.--&gt;    &lt;com.sparkydev.guessaphrase.LeftBorder        android:id=""@+id/leftborder""        android:layout_alignParentLeft=""true""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        /&gt;        &lt;!-- Used a FrameLayout to contain        the menu buttons.--&gt;        &lt;FrameLayout         android:id=""@+id/FrameLayout01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        &gt;            &lt;!-- Menu buttons --&gt;        &lt;/FrameLayout&gt;    &lt;!-- Declares right border position (on right    of screen, below the left border) --&gt;    &lt;com.sparkydev.guessaphrase.RightBorder        android:layout_alignParentRight=""true""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@id/leftborder""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>The problem is, the borders are not showing up at all.  The background shows, but nothing else.</p>","437226","","","","","2011-06-08 08:26:43","Drawing a border using a custom view Android","<android><custom-view>","1","0","3","",""
"3799981","1","4315869","","2010-09-26 21:51:21","0","2663","<p>I'm having trouble with an ExpandableListView. What I want is for each group to be from column ""bond"", which is non-unique, but I want the groups to be unique (i.e. each value of ""bond"" should only have one group). Each value in the group has data in other columns which should be displayed. The problem is that it seems I can either use the SQL DISTINCT operator with one column (and then getChildrenCursor() throws an IllegalStateException), or not use the DISTINCT operator and have each group duplicated.</p><p>Can anyone suggest a fix for this?</p><pre><code>public void onCreate(Bundle saved) {    super.onCreate(saved);    DatabaseHelper dh = new DatabaseHelper(this);    dh.openDataBase();    db = dh.getReadableDatabase();    String query = ""SELECT DISTINCT bond FROM spectro"";    Cursor c = db.rawQuery(query, null); //throws exception when group opened    //Cursor c = db.query(""spectro"", new String[] { ""_id"", ""name"", ""bond"", ir },        //null, null, null, null, null) - gives duplicate groups    ExpandableListAdapter a = new IRCursorAdapter (this,            c, android.R.layout.simple_expandable_list_item_1, new String[] { ""bond"" },            new int[] { android.R.id.text1 }, R.layout.row_doubleend,            new String[] { ""name"", ""ir"" }, new int[] { R.id.double_item1, R.id.double_item2 });    this.setListAdapter(a);}protected class IRCursorAdapter extends SimpleCursorTreeAdapter {    public IRCursorAdapter(Context context, Cursor cursor, int groupLayout,            String[] groupFrom, int[] groupTo, int childLayout,            String[] childFrom, int[] childTo) {        super(context, cursor, groupLayout, groupFrom, groupTo, childLayout, childFrom,                childTo);    }    @Override    protected Cursor getChildrenCursor(Cursor groupCursor) {        Cursor c = db.query(""spectro"", new String[] {""_id"", ""name"", ""bond"", ""ir""},                ""bond=?"", new String[] { groupCursor.getString(0) }, null, null, null);        startManagingCursor(c);        return c;    }};</code></pre><p>here's what my table looks like- the bond is what I want to be unique:</p><p>_id | name | bond | ir<br>1 | name 1 | bond 1 | ir 1<br>2 | name 2 | bond 1 | ir 2<br>3 | name 3 | bond 2 | ir 3<br>4 | name 4 | bond 3 | ir 4</p><p>sorry if this isn't particularly clear, but thanks for your help!</p>","428665","","","","","2011-04-07 15:49:13","Distinct values in Android ExpandableListView","<android><sqlite><cursor><distinct><expandablelistview>","1","0","","",""
"3800001","1","4278015","","2010-09-26 21:58:45","0","1300","<p>I've figured out how to draw Arabic characters properly (connected and right to left) using string literals like this:</p><pre><code>textView.setTypeFace(Typeface.createFromAssets(getAssets(),""DejaVuSans.ttf""));textView.setText(""\uFEB3\uFE92\uFE98\uFE94"");</code></pre><p>But for some reason I cannot get the arabic to format properly if I read anything from a file using InputStreams like this:</p><p>arabictext.txt:</p><pre><code>????</code></pre><p>and the code:</p><pre><code>InputStream istream = as.open(""arabictext.txt"");     String string;        BufferedInputStream bis = new BufferedInputStream(istream);        /* Read bytes to the Buffer until         * there is nothing more to read(-1). */        ByteArrayBuffer baf = new ByteArrayBuffer(50);        int current = 0;        while((current = bis.read()) != -1){                baf.append((byte)current);        }        /* Convert the Bytes read to a String. */        string = new String(baf.toByteArray(), 0, baf.length(), ""UTF-8"");</code></pre><p>and then displaying the string in a textview. The letters are ordered correctly but are not connected nor are they in the proper form for end of word/middle of word. This makes no sense to me because I thought that each form of each letter is a different Unicode code point.</p><p>2) Putting the actual code values in the file just causes the textview to display the code point values as a string.</p><p>Any help would be appreciated! I started to make a custom view to just draw the text, but it got complicated, fast.</p>","458968","","","","","2011-03-30 19:59:30","How to draw Arabic Text on Android after reading from a file?","<android><file><arabic>","1","1","1","",""
"3800010","1","3801530","","2010-09-26 22:02:28","3","1748","<p>How do I close a whole hierarchy of activities and show a new activity not present in the current task?</p><p><strong>Context</strong></p><p>Consider a FTP browser that resumes the previous session on launch. Each folder is displayed in its own activity. When I click on a folder, a new activity is started for the folder. If I press the back button, the app returns to the previous activity, which corresponds to the the parent folder.</p><p>I can logoff from the menu at any time. Logging off should bring me to the login activity (not present the current task when the app has resumed the session), and close all the other activities. How can I do this?</p><p>From what I've read, if the activity were in the current task I could use <code>FLAG_ACTIVITY_CLEAR_TOP</code> in the intent, but this is not my case.</p>","143378","","","","","2010-09-27 06:27:11","Close activity hierarchy in Android","<android><activity><android-intent>","1","0","2","",""
"3800059","1","","","2010-09-26 22:17:59","1","156","<p>In my code I'm calling a preferences activity from my main activity which prompts the user to enter username/password, as below..</p><hr><p>// Launch Preference activity</p><p>Intent k = new Intent(application.this, settings.class);</p><p>startActivity(k);</p><hr><p>This calls settings.xml, but I want to re-initiate the main activity once the username/password is set and the back button is pressed.</p><p>Any pointers?</p>","458983","","","","","2010-09-26 22:27:57","Initiating activity for settings class","<android>","2","0","1","",""
"3800069","1","","","2010-09-26 22:20:36","1","566","<p>Is it possible to create a layout based on (background) images? For example, there is well know app called Appie that uses this picture as a homescreen:</p><p><img src=""http://i.stack.imgur.com/toH0P.jpg"" alt=""alt text""></p><p>I might be able to recreate the layout with a <code>TableLayout</code>, but this will be difficult to get it perfectly aligned with the buttons in the image. The default layout options make it very difficult, or maybe impossible, to allow for selection of the buttons on the image (especially when the buttons are in an arc-path).</p><p>Can anyone tell me how this is done?</p>","458987","","119895","","2010-09-26 23:45:37","2010-09-26 23:52:19","creating a custom image based layout on android","<android><image><layout>","1","0","","",""
"3800232","1","","","2010-09-26 23:12:12","0","2037","<p>This seems like it should be a simple solution to find, but I'm not having any luck. I want to write a simple ping/traceroute/dns troubleshooting app, but am simply not finding any documentation or examples on sending ICMP ECHO packets with set TTLs and interpreting their responses. I realize that Java likes to keep you away from ""low-level"" networking, but ICMP is a basic, major part of networking. Frankly, I'm shocked at the apparent difficulty. Am I making this more complicated than need be, or is there literally no good way to go about this? If the latter, in what ""bad"" way do you most often work around this shortcoming?</p>","459003","","","","","2010-09-26 23:37:07","How does one send ICMP packets (with associated TTL values) in Java on Android? Is it possible without a 3rd-party library? If not, what do you use?","<android><ping><traceroute><icmp><ttl>","1","0","","",""
"3800248","1","","","2010-09-26 23:17:42","0","75","<p>Greetings Fellow Coders.</p><p>My app downloads a set of images from a website but I need to figure out the how to display them to the user.  How can I display these to the user if they are coming from a ListView?</p><p>Also, they'll need to be able to get back to the ListView.</p><p>Cheers.</p>","445342","","","","","2010-09-27 06:56:08","Viewing a Set of Images","<android><image><listview><view>","1","1","","",""
"3800383","1","","","2010-09-27 00:11:43","14","6947","<p>I am a Cellular RF Engineer and have been trying to get some specific WCDMA/3G/UMTSsignal measurement values out of Android SDK environment.  Using the public class <code>SignalStrength</code> I have been successful in getting meaningful GSM values (with the assistance of a Software Engineer) using <code>getGsmSignalStrength()</code>, but only yield ""-1"" values for <code>getCdmaDbm()</code> and <code>getCdmaEcio()</code> respectively which are supposed to return relevant CDMA signal strength values.  -1 is definitely not right!</p><p>My phone was definitely on a UMTS at the time and I can read UMTS parameters in the field test software (to get the field test software going was a hassle in itself).</p><p>I think it is quite likely that <code>getCdmaDbm()</code> and <code>getCdmaEcio()</code> methods are for CDMA networks, not WCDMA (CDMA and WCDMA are different technologies) which leaves me high and dry in terms of trying to get 3G measurements out of the phone.  Alternatively, there is some other methods out there but I simply can't find them in the reference material on the web:</p><p><a href=""http://developer.android.com/reference/android/telephony/SignalStrength.html"">http://developer.android.com/reference/android/telephony/SignalStrength.html</a></p><p>Can someone please assist me? There must be a way (after all, field test s/w can get this information) but how?  Someone wrote an app called Cellumap which gets UMTS, GSM and CDMA measurement information.</p>","459026","","1288","","2011-06-16 19:58:08","2013-09-05 21:51:04","Android: How to Get 3G/UMTS Signal Strength Values","<java><android>","2","1","1","",""
"3800384","1","3861221","","2010-09-27 00:11:52","1","1611","<p>I know this is a noobish question, but I cannot get android-xmlrpc properly hooked into my android project in eclipse. The project website offers no advice and I have little experience developing with eclipse. Could someone please tell me the necessary steps to get the library properly into my android project?</p>","459018","","","","","2011-10-13 08:27:45","Eclipse using Android XML-RPC help","<android><eclipse><xml-rpc>","2","0","","",""
"3800656","1","","","2010-09-27 01:57:48","1","2684","<p>When I run the following line of code:</p><pre><code>MediaScannerConnection scanner = new MediaScannerConnection( this, null );    scanner.connect();    scanner.scanFile( szFinalFileName, null ); //&lt;---crash here</code></pre><p>I get a crash and this message in the console window:</p><pre><code>09-26 14:47:44.074: ERROR/MediaScannerService(10288): Failed to delete file /data/data/com.android.providers.media/pause_scan</code></pre><p>does anyone have any ideas why this isnt working and what i can do to fix it?</p><p>Thanks in advance :-)</p>","458972","","","","","2011-04-30 16:23:03","MediaScannerConnection scanFile scanner is crashing","<android>","2","0","","",""
"3800754","1","3800910","","2010-09-27 02:30:55","0","1501","<p>I am trying to rotate a canvas with canvas.rotate and move an object on it at the same time. The problem is that with the rotation, the coordinate system of the canvas rotates as well, so I get cases when my object is supposed to be moving along the y axis, but the y axis is rotated on place of the x axis. It is a mess. Is there a way to go around this?</p>","457899","","","","","2010-11-16 04:06:02","How do I rotate a canvas without disturbing the coordinate system in Android?","<android><canvas><rotation><surfaceview>","1","0","","",""
"3800781","1","3800817","","2010-09-27 02:46:17","1","1271","<p>How do I get started as an Android developer? I know that I need to pay a fee, but I'm unsure about other things. I have done iOS development, so forgive me for making comparisons or assumptions based on the Apple App Store.</p><ul><li><p>How do I distribute my apps?</p></li><li><p>Is there an app review process?</p></li><li><p>What do I gain by paying Google the $25.00 fee? </p></li><li><p>Does Google provide a dashboard where I can see statistics of my App downloads? </p></li><li><p>What percentage does Google take from my App sales?</p></li><li><p>What payment method does Android market use?</p></li><li><p>When does Google do pay-outs, or do I get paid immediately?</p></li><li><p>Is there a minimum pay-out threshold?</p></li></ul><p>Thanks.</p>","224988","","","","","2010-09-27 03:44:10","Getting started with Android Market?","<android><google-play>","2","0","1","",""
"3800887","1","3801480","","2010-09-27 03:18:48","2","462","<p>this question is a extension of one made in <a href=""http://stackoverflow.com/questions/3782849/best-solution-architecture"">http://stackoverflow.com/questions/3782849/best-solution-architecture</a>, basically i want to know what is the best architecture to deal with a solutions where both desktop and mobile applications are involved. in this time i would like to know, what if we decided to go over java technologies, how can we build this solution in order to reuse as much code as possible.</p><p>Solutions must run over a windows,linux and mac machines ( we know that using java and swing tech as business and GUI respectively , we can accomplish this requeriment). the problem comes when we decided to incorporate Android OS for mobile capability of our solutions, how can we reuse the code written for desktop application ? how can expose my business class as a service when we are trying to avoid web or application servers installations ?. is it possible to archive SOA avoiding web o application server ? what are the best developing techniques in order to reuse as much code as possible ?.</p><p>If you guy has any documention or any comments which point me in right direction to solve this problem i'd appriciate it.</p>","231532","","","","","2013-04-01 17:53:39","Good Mobile and Desktop Architecture","<java><android><architecture><mobile><projects-and-solutions>","2","0","","",""
"3800912","1","4142851","","2010-09-27 03:25:44","3","874","<p>How can I kill Android <code>activity</code> from asynchronous thread?In my android application, I start another activity using <code>startActivity</code>. Is there anyway for me to kill that <code>activity</code> I started after several minutes?</p><p>Or is there any way beside using thread?</p>","430926","","119895","","2010-09-27 03:29:38","2013-03-13 15:41:12","Kill activity in thread","<android><multithreading><activity>","2","6","","",""
"3800936","1","","","2010-09-27 03:30:24","0","183","<p>I want to be able to package data in a apk, which is read by my main app.</p><p>Is there a way that I can put the data in apk, and then upon install automatically hook that data into the ContentProvider in my main app?</p><p>The other possibility is to have each add-on be a content-provider, and have the app look for it, but then I fragment the authorities and I don't have a pre-built list, although I suppose I could ""reserve"" authorities for expansions if this is the best option. </p><p>The other option I understand I might be able to use for data sharing is to run the separate apk's with the same user_id? Any thoughts how I could get this to work would be great too, I tried this but reflection didn't show my addons classes, and it brings up all kinds of dynamic loading questions.</p><p>Edit: If it helps, I already have it working using zip files in a folder in the SD, but I want to be able to put that zip into a apk, and write a simple wrapper so that it can be read by my other app.</p>","459099","","","","","2011-01-28 04:08:33","Can a .apk be used to deliver data to a ContentProvider?","<android><data><add-on>","2","0","0","",""
"3800944","1","3810988","","2010-09-27 03:32:52","0","1467","<p>I know you can use python and other scripting languages in android. But I haven't seen weather or not it was possible to use python as an interface to sqlite in android. Is this possible? This is the first android app where I've needed sqlite, and using the java api's is retarded.</p><p>If this isn't possible, can someone point me to a good tutorial on sqlite in android? I've found a bunch, but all of them are entirely different and I'm totally lost on which is the best way to do it.</p><p>It's just hard to picture how google expects you to use the sqlite database. It seems like you need like 10 different classes just to query a database.</p>","375874","","135152","","2011-05-25 03:10:20","2011-05-25 03:10:20","Using python in android to interface to sql","<android><python><sqlite><android-scripting>","1","0","","",""
"3800949","1","3801106","","2010-09-27 03:33:22","3","251","<p>I am trying to build an app on my wife's phone that pranks her on April 01, April Fool's day of course. The app is going to change her background to look like the screen was cracked, the background is very convincing when I try it on my Droid (I was pranked similarly).</p><p>Anyway, digging into how this would work, I think its quite the process, however, I may be looking too far into this. I started diving into setting an alarm, however, I am confused about a couple things:</p><ol><li><p>Would it be necessary for my wife's phone to load this prank application in the background each time she reboots her phone? I am assuming yes, as I believe this prank application would most likely invoke a broadcast receiver to ""listen"" for April 01, 2011?</p></li><li><p>If the application doesn't need to load each time in the background, what facilitates Android alerting my application and firing it when April 01, 2011 comes around?</p></li></ol><p>I hope that makes any sense, basically, I want to ensure this application runs on April 01, 2011 even if my wife's phone crashes or reboots.</p><p>What would be the most straightforward method of making this work? I apologize if I don't understand broadcast receivers properly, this is quite the new concept which I am not use to. The Service and Broadcast Receiver functionality is native to Android and not any other language, no?</p><p>Thanks for helping this NEWB :)</p>","459095","","459095","","2010-09-27 03:58:37","2010-09-27 04:40:56","How can I make an app trigger a set of actions on April 01, 2011?","<android>","1","3","1","",""
"3800951","1","","","2010-09-27 03:33:42","3","1551","<p>I am using a custom Dialog that contains a text field, an image, and a button. The text can contain HTML. Sometimes the bottom of the dialog gets chopped off the bottom when the text is long enough. How can I prevent this? I want Android to determine the size of the dialog but it doesn't seem to be doing that. DO I need to size the Dialog myself in this case?</p><p>Here is the layout...</p><pre><code>&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:id=""@+id/alert_root_incorrect""  style=""@style/AlertDialogTheme""  android:background=""@drawable/rounded_alert""  android:orientation=""vertical""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:padding=""10dp""&gt;  &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/rounded_alert""  &gt;    &lt;TableLayout      android:stretchColumns=""0""      android:orientation=""horizontal""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""    &gt;      &lt;TableRow&gt;        &lt;TextView          android:layout_width=""fill_parent""          android:layout_height=""wrap_content""          android:gravity=""left""          android:textStyle=""bold""          android:text=""Sorry, that's wrong!""          android:textColor=""@color/gray_dark"" /&gt;        &lt;ImageView          android:id=""@+id/check""          android:background=""@drawable/xmark""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:layout_gravity=""right""          android:layout_marginRight=""10dp"" /&gt;      &lt;/TableRow&gt;    &lt;/TableLayout&gt;    &lt;TextView      android:id=""@+id/alert_text""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:ellipsize=""none""      android:text=""In fact, this is where the explanation will go. Something about how this passage related to the topic""      android:textColor=""#000000"" /&gt;    &lt;Button      android:id=""@+id/okay_button""      android:layout_width=""100dp""      android:layout_height=""wrap_content""      android:gravity=""center""      android:layout_gravity=""center_horizontal""      android:background=""@drawable/rounded_alert_button""      android:text=""Okay""      android:textColor=""@color/white""      android:textSize=""20sp"" /&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is the code I am using to load it...</p><pre><code>if ( null == layout ) {   this.layout = inflater.inflate(R.layout.alert_incorrect, (ViewGroup) findViewById(R.id.alert_root_incorrect));}TextView message = (TextView) layout.findViewById(R.id.alert_text);message.setText(Html.fromHtml(card.getConclusion()));((Button) layout.findViewById(R.id.okay_button)).setOnClickListener(new View.OnClickListener() {   public void onClick(View v) {      dismissDialog(INCORRECT_DIALOG);      nextQuestion();   }});layout.requestLayout();dialog = new Dialog(this, R.style.AlertDialogTheme);dialog.setContentView(layout);dialog.setCancelable(false);return dialog;</code></pre><p>And here's a snap of what I mean..</p><p><img src=""http://i.stack.imgur.com/lcQUQ.png"" alt=""alt text""></p><p>Thanks,</p><p>John</p>","4476","","","","","2012-10-12 16:26:58","Android not sizing Custom Dialog big enough","<android><dialog>","2","1","","",""
"3801050","1","","","2010-09-27 04:08:02","1","196","<p>I'm trying the HelloMapView example found here: <a href=""http://developer.android.com/guide/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/guide/tutorials/views/hello-mapview.html</a></p><p>Problem I'm having is that when I run my application, none of the map tiles will load... I heard this is usually do to my google maps api key not being correct. I tried signing my app with a key that I generated from google, but the application still wouldn't load the tiles into the map. I can zoom and effect other features of the map, everything except for actually loading the tiles. I was reading that the eclipse (which I'm using) will automatically generate a key for you, but that's not happening. Any suggestions on how to troubleshoot this problem? Thanks! </p>","459115","","","","","2010-12-07 10:28:18","How to verify / troubleshoot AVD debug key","<android><eclipse><debugging><signing><avd>","1","0","","",""
"3801083","1","","","2010-09-27 04:16:27","0","6227","<p>i have a list.When i click on any item in the list a popup should appear where i can send messages(something like what happens when we click a user in gmail.A popup window comes up in the bottom and we can chat with that user).</p>","375061","","","","","2010-09-27 05:19:29","how to create a popup in android?","<android>","2","0","","",""
"3801333","1","","","2010-09-27 05:32:08","0","602","<p>I have about 3 videos that i cannot install with my app on DROID due to their huge size. Now we have decided to host them on a private server or YouTube. How can i run these videos in Android? Thank you</p>","2355649","","","","","2010-09-29 07:45:51","How to run a video hosted on YouTube or a private server in Android?","<android>","3","0","","",""
"3801345","1","3801373","","2010-09-27 05:35:10","2","477","<p>how to find out mobile turn left and right.depending on left and right turn i need to one ball</p><p>Please help me</p><p>Thanks in advance</p><p>Aswan</p>","1746300","","491044","","2011-03-11 12:55:51","2011-03-11 12:55:51","find left and right turn in android mobile","<android>","1","1","1","",""
"3801407","1","","","2010-09-27 05:55:20","1","176","<p>I use an httpconnection to post some data to the server and wait for response.</p><p>The connection can be canceled by closing the inputstream, outputstream and connection.</p><p>But if I cancel the connection at a right timing, then though the is, os, connnection are closed, but the worker thread just hand there, for about one minute. And then a nullpointer will be thrown out.</p><p>Actually I encountered this kind of problem, but rearrange the order of the close fix the problem. But now it can not work no matter in what order I close the inputstream, outputstream, connection.</p><p>Is someone else encounter this problem? All the network related job is in worker thread instead of ui thread. </p><p>Below is the stacktrace in the hand thread while handing there.</p><p>Thread [&lt;17> Worker Threads-0] (Suspended)<br>    OSNetworkSystem.receiveStreamImpl(FileDescriptor, byte[], int, int, int) line: not available [native method]<br>    OSNetworkSystem.receiveStream(FileDescriptor, byte[], int, int, int) line: 236<br>    PlainSocketImpl2(PlainSocketImpl).read(byte[], int, int) line: 550<br>    SocketInputStream.read() line: 61<br>    HttpURLConnection.readln() line: 1181<br>    HttpURLConnection.readServerResponse() line: 1253<br>    HttpURLConnection.sendRequest() line: 1241<br>    HttpURLConnection.doRequestInternal() line: 1554<br>    HttpURLConnection.doRequest() line: 1547<br>    HttpURLConnection.getOutputStream() line: 1148<br>    AndroidHttpServerConnection.getOutputStream() line: 81<br>    AndroidHttpServerConnection(ServerConnection).send(byte[][]) line: 59<br>    ServiceCallImpl.invoke() line: 149<br>    AsynchronousServiceCallInvoker$1.run() line: 43     Worker.run() line: 213  </p>","441316","","","","","2010-09-27 05:55:20","android network block by cancelling","<android><networking><httpclient>","0","0","","",""
"3801471","1","3802043","","2010-09-27 06:10:49","5","5171","<p>Right now, i am developing Android Application using SDK 1.5 and testing application on HTC Hero, its firmware is Android 1.5.</p><p>Let me come to actual point: in application, i am having an imageview for displaying image (Image resolution is 320*480), now imageview is displaying image in full-screen perfectly, but when i am trying to test it on HTC EVO 4G (having resolution 480*800), image gets stretch.</p><p>So, what i like to do is want to display 320*480 resolution image in all screen-resolution mobile ? i means to say,if the mobile is of higher resolution(i.e. 480*800 , 480*854, or else) than the image should be displayed in ""Center"" portion of the screen. </p><p>So displaying image in Center in all screen (without stretching or cutting) resolution other than 320*480, what attributes i have to set ?</p>","379693","","379693","","2010-09-27 06:29:55","2010-09-27 08:17:54","Android - Imageview in center in all screen resolution","<android><imageview><android-imageview>","1","0","3","",""
"3801493","1","3809459","","2010-09-27 06:19:12","2","725","<p>I am working on a game for Android using OpenGL ES, and I have run into a performance problem.</p><p><em>What I am trying to do</em>: I have a bunch of objects on screen that all share the same mesh, but all have individual rotations and translations. You could compare it to Asteroids where you have a bunch of asteroids moving around on screen.</p><p><em>The actual problem</em>: I am taking the performance hit because I rotate and translate each object individually, and the overhead of sending the vertex array is too large compared to the number of vertices (tens of them per object).</p><p>What can I do? One solution I have thought of is to update the vertices in software myself, before putting them into the vertex buffer. That would probably spare me some overhead, but it seems counterintuitive.</p><p>Please share any ideas or suggestions you might have! Thanks!</p>","459170","","44729","","2010-09-27 14:19:55","2010-09-28 03:20:56","Rotate individual polygons in an Open GL vertex array?","<android><performance><opengl-es><vertex-buffer>","1","0","","",""
"3801509","1","3801665","","2010-09-27 06:23:01","2","3441","<p>hello i am new in android devlopment     i want to know how to upload an image in android     i dont found any usefull tutorial for this     can u give me some instruction,pls,help me out.</p>","441224","","603744","","2011-09-07 07:27:30","2012-07-03 09:55:47","android image upload","<android>","2","2","6","",""
"3801562","1","","","2010-09-27 06:30:52","4","2447","<p>I am using moveTasktoBack() function to send my activity to background.I want to bring my activity to front when a timer in my activity finishes. I am using the phone back key to send the activity to back. How do I do that? Help please.</p>","655814","","119549","","2012-01-25 03:43:36","2013-03-22 06:01:50","How to bring an activity to front in android?","<android>","2","1","","",""
"3801760","1","3801881","","2010-09-27 07:14:54","5","12366","<p>Hi stackoverflow team i have a problem in converting base64 string to bitmap in android. I am using the camera to fetch the image and i am convert the image to base64 string to post to the server. I want to show that image in the imageview so how can i show the image in the ImageView after fetching the image from the camera. please help me to solve the problem.</p>","339116","","","","","2010-09-27 07:37:17","Android code to convert base64 string to bitmap","<android><camera><base64>","1","1","2","",""
"3801779","1","","","2010-09-27 07:17:52","3","754","<p>I am trying to create an account in Accounts &amp; Sync which doesn't require authentication. I have already referred to <a href=""http://developer.android.com/resources/samples/SampleSyncAdapter/src/com/example/android/samplesync/index.html"" rel=""nofollow"">SampleSync</a> example. The key difference between the example and what I am trying to build is Authentication. I don't want to display an Authentication/Login activity to the user. Is it possible to create an account directly from Authenticator service without having an Authentication activity?</p>","257752","","","","","2011-03-13 11:13:44","Creating an Account with dummy authenticator","<android>","1","0","","",""
"3802198","1","3977985","","2010-09-27 08:36:10","3","5469","<p>So I am trying to sync to google docs, without having to ask the user for his credentials. I use this code to get an auth-token:</p><pre><code>AccountManager mgr = AccountManager.get(activity);authToken = mgr.blockingGetAuthToken(account, DocsService.DOCS_SERVICE, true);</code></pre><p>This returns a auth-token that looks well-formated. So on my DocsService I run:</p><pre><code>service.setAuthSubToken(authToken);</code></pre><p>However, when I try to use the API I just get a AuthenticationException. Any ideas on how to approach this error?</p><p>edit: I do have the USE_CREDENTIALS permission.</p>","249871","","249871","","2010-09-27 08:44:54","2012-03-19 04:47:29","Using Android AccountManager to get authtoken for gdata","<android><gdata-api><gdata><accountmanager><gdata-java-client>","3","0","4","",""
"3802291","1","5426584","","2010-09-27 08:54:01","1","2389","<p>I am developing an app which gets outgoing SMS content through content resolver but it is giving some problems.  Please help me.</p><pre><code>package com.company.cellSafetyZone.model;import android.app.Service;import android.content.ComponentName;import android.content.Context;import android.content.Intent;import android.database.Cursor;import android.net.Uri;import android.os.Handler;import android.os.IBinder;import android.util.Log;public class OutGoingSmsService extends Service{   Context context;    SmsObserver smsObserver;    Cursor cursor;    Handler handler=new  Handler();    private String TAG=""SMS SERVICE"";    boolean change;    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }    public OutGoingSmsService()     {        Log.d(TAG,""blank constructor"");        // TODO Auto-generated constructor stub    }    public OutGoingSmsService(Context context)    {        Log.d(TAG,""context constructor"");        this.context=context;    }    @Override    public void onCreate()    {   Log.d(TAG,""in on Create() of sms service"");        super.onCreate();        smsObserver=new SmsObserver(handler);         Log.d(TAG,""calling service"");        startService();    }    private void startService()    { Log.d(TAG,""registering resolver"");    cursor=this.getContentResolver().query(Uri.parse(""content://sms/sent""), null,null,null,null);        Log.d(TAG,""registering observer"");       cursor.registerContentObserver(smsObserver);        Log.d(TAG,""registerd"");    }    void setChangeValue(boolean selfChange)    {System.out.println(""in setChange"");        change=selfChange;        if(change==false)        {     try{       cursor=context.getContentResolver().query(Uri.parse(""content://sms/sent""), null,null,null,null);            cursor.moveToFirst();             }catch (Exception e)            {   System.out.println(""in catch.""+e.getMessage());                e.printStackTrace();            }            String protocol=cursor.getString(cursor.getColumnIndex(""protocol""));            Log.d(TAG,""protocol value.""+protocol);            if(protocol==null)                onSmsSend();            }}    private void onSmsSend()    { cursor.moveToFirst();        for (int i = 0; i &lt;cursor.getColumnCount(); i++)         {String column=cursor.getColumnName(i);            String msg=cursor.getString(i); }}}</code></pre><p>It is calling observer and get back in this service again in <code>onSmsSend()</code> method.  But now giving an exception.</p><pre><code>java.lang.NullPointerExceptionatcom.company.cellSafetyZone.model.OutGoingSmsService.setChangeValue(OutGoingSmsService.java:104)at com.company.cellSafetyZone.model.SmsObserver.onChange(SmsObserver.java:42)at android.database.ContentObserver$NotificationRunnable.run(ContentObserver.java:43)at android.os.Handler.handleCallback(Handler.java:587)at android.os.Handler.dispatchMessage(Handler.java:92)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:4203)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:521)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Why is the cursor null?  There is a small thing which I am unable to catch so help me out please.</p>","450601","","1288","","2010-11-30 12:16:05","2011-03-24 22:58:53","Cursor value null","<android>","2","2","","",""
"3802304","1","","","2010-09-27 08:56:04","19","41216","<p>I have a little problem with listview. How do i clear a listview content, knowing that it has a custom adapter?</p><p>edit :the custom adapter class extends BaseAdapter, it looks like this :</p><pre><code>import android.app.Activity;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.TextView;public class MyAdapter extends BaseAdapter {    private Activity activity;    private String[] data;    private static LayoutInflater inflater=null;    public MyAdapter(Activity _a, String[] _str)    {        activity = _a;        data = _str;        inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    }    public static class ViewHolder{        public TextView text;    }    @Override    public int getCount() {        return data.length;    }    @Override    public Object getItem(int position) {        return position;    }    @Override    public long getItemId(int position) {        return position;    }    @Override    public View getView(int position, View view, ViewGroup parent) {        View v = view;        ViewHolder holder;        if(v == null)        {            v = inflater.inflate(R.layout.rowa, null);            holder=new ViewHolder();            holder.text=(TextView)v.findViewById(R.id.dexter);            v.setTag(holder);        }else{            holder=(ViewHolder)v.getTag();        }        holder.text.setText(data[position]);        return v;    }}</code></pre>","426418","","114066","","2010-09-28 09:21:29","2011-08-19 12:03:11","Clear listview content?","<android><listview><adapter>","5","0","4","",""
"3802333","1","3803272","","2010-09-27 09:01:25","2","844","<p>I built a ListActivity and now I want to add Map Previews as the List Icons. I dont want to extend MapView because: 1st I just need a little static preview and 2nd I already extended to ListView.</p><p>I already looked into using the <a href=""http://www.google.de/url?sa=t&amp;source=web&amp;cd=1&amp;ved=0CCMQqwMoBDAA&amp;url=http%3A%2F%2Fcode.google.com%2Fapis%2Fmaps%2Fdocumentation%2Fstaticmaps%2F&amp;ei=6VmgTPT0GYGmOKfguKQM&amp;usg=AFQjCNEdZcmn2xxERbP4Wen5isuxeUvgbQ&amp;sig2=lYqVrtZcz781XoGH3RS7hQ"" rel=""nofollow"">static map api</a>, however that also doesnt look quite good in that small dimensions:</p><p><img src=""http://i.stack.imgur.com/KtdjL.png"" alt=""alt text""></p><p><a href=""http://maps.google.com/maps/api/staticmap?center=40.714728,-73.998672&amp;zoom=12&amp;size=65x65&amp;maptype=roadmap&amp;sensor=true"" rel=""nofollow"">http://maps.google.com/maps/api/staticmap?center=40.714728,-73.998672&amp;zoom=12&amp;size=65x65&amp;maptype=roadmap&amp;sensor=true</a></p>","433718","","","","","2010-09-27 11:17:02","How to implement a little static map preview as list icon?","<android><android-widget><google-maps-api-3><android-maps><google-static-maps>","1","0","","",""
"3802353","1","3802378","","2010-09-27 09:04:26","1","10872","<p>I have following in xml</p><p>          </p><p>I wanna put the second linear layout at the bottom of the screen.How will i do?I have set the property of second Relative layout to bottom but still not showing at bottom..</p><p>**</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_height=""fill_parent""     android:layout_width=""fill_parent""&gt;    &lt;RelativeLayout android:id=""@+id/RelativeLayout01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;   &lt;/RelativeLayout&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout02""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""&gt;   &lt;/RelativeLayout&gt;&lt;RelativeLayout android:layout_height=""wrap_content""     android:layout_width=""fill_parent""    android:layout_gravity=""bottom""&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>**Thanx in advance </p>","443075","","443075","","2010-09-27 09:23:17","2014-01-11 12:50:03","How to place Relative layout at bottom of screen(or linear layout).?","<android>","3","1","3","",""
"3802461","1","","","2010-09-27 09:22:07","2","1095","<p>Can anybody tell me if it is possible to execute programs using arm assembly language in the simulators?</p>","299831","","881229","","2014-01-28 09:02:30","2014-01-28 09:02:30","Is execution of ARM assembly in iPhone Simulator or Android Simulator possible?","<android><iphone><assembly><android-emulator><ios-simulator>","2","0","","",""
"3802486","1","3805844","","2010-09-27 09:25:09","9","906","<p>I need to heat up an android phone (don't ask...)</p><p>So far I tried running a max priority thread with a while loop which ROL-s an integer around, but that generates too little heat, even though the phone comes down almost to a halt. I tried doing complex math in the loop, but the results were same. I tried with more threads, but as expected it behaves exactly as it was with just one thread. </p><p>What can I do to tax it enough in order for it to generate more heat?</p><p><strong>Edit</strong>: Some additional info - It's basically an application that should run as a background service (android Service started with startService()) which uses notifications to indicate that it's running (or not). Ideally, it should have no UI at all, other than the control-activity to start/stop it. I already made the service, notifications and the controlling activity. The Service uses it's own thread for phone heating, so that it would not interfere with activity's UI (which is in the same android app), now I only need to write the ""meat"" of the thread, i.e. some code that would actually cause the phone to heat up.</p>","382783","","382783","","2010-09-27 09:59:30","2012-11-28 16:12:19","Generate heat on an android phone (from code, of course)","<android>","7","13","3","",""
"3802582","1","","","2010-09-27 09:38:35","1","1651","<p>When an item in my ListView is clicked, I have several options pop up in a dialog for the user to choose. However, there are varying scenarios where I'd like to disable one or more options so the user cannot choose them. Here's some code.</p><pre><code>public class MyApp extends ListActivity implements OnItemClickListener, OnItemLongClickListener {private static final int HOW_MANY = 4;private static final int ADD = 0;private static final int EDIT = 1;private static final int OPEN = 2;private static final int DELETE = 3;private String[] myItemClickDialog = null;...@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.mylayout);    this.myItemClickDialog = new String[HOW_MANY];    this.myItemClickDialog[ADD] = ""Add"";    this.myItemClickDialog[EDIT] = ""Edit"";    this.myItemClickDialog[OPEN] = ""Open"";    this.myItemClickDialog[DELETE] = ""Delete"";}@Overridepublic final boolean onItemLongClick(final AdapterView&lt;?&gt; parent,    final View view, final int position, final long id) {    final Context context = this;    Builder builder = new Builder(context);    builder.setTitle(""Options"");    String[] items = this.myItemClickDialog;    builder.setItems(items, new DialogInterface.OnClickListener() {        @Override        public void onClick(final DialogInterface dialog, final int which) {            switch (which) {                case ADD:                    //Do stuff                    break;                case EDIT:                    //Do stuff                    break;                case OPEN:                    //Do stuff                    break;                case DELETE:                    //Do stuff                    break;            }        }// Rest of code here</code></pre><p>I would like to be able to disable (by dimming) a particular option, such as the DELETE option or the OPEN option depending on which list item was clicked (I got that part covered, that is, the detection piece).</p>","442186","","","","","2010-10-01 20:52:53","How do I disabled (dim) an option in onItemLongClick from a ListView in Android?","<android><listview><listviewitem>","1","0","","",""
"3802586","1","3802621","","2010-09-27 09:39:15","2","96","<p>I wrote some code to save images on the SD Card a while back. Now I added the targetSDKVersion to my manifest and now my file saving code ceased to work. </p><p>I can reproduce it through removing the targetSdkVersion from my manifest from that on my App won't write anything to the SD Card.</p><p>Is there an API change between Android 1.5 and 1.6 that prevents me from writing to the SD-Card? </p><pre><code>File imageDirectory = new File(Environment.getExternalStorageDirectory()                 .getAbsolutePath()                 + File.separator                 + FOLDER_NAME);Log.d(ImageSaver.class.getSimpleName(), ""SD Card status: ""            + Environment.getExternalStorageState());if (!imageDirectory.exists()) {   boolean created = imageDirectory.mkdir();   Log.d(ImageSaver.class.getSimpleName(), ""Created image directory ""                + imageDirectory + "" "" + created);}File imageFile = new File(imageDirectory.getAbsolutePath() + File.separator                    + name + nameSuffix + FILE_ENDING);bitmap.compress(Bitmap.CompressFormat.PNG, FULL_QUALITY,         new FileOutputStream(imageFile));</code></pre><p>This is the test code for compressing an bitmap to the SD Card. With the following manifest entry it does not work: </p><pre><code>&lt;uses-sdk   android:minSdkVersion=""3""   android:targetSdkVersion=""8"" /&gt;</code></pre><p>I get the following exception: </p><blockquote>  <p>09-27 11:35:58.689:  ERROR/ImageSaver(8672): File not found  09-27 11:35:58.689:  ERROR/ImageSaver(8672):  java.io.FileNotFoundException:  /sdcard/FOLDER/1285580158662.png</p></blockquote><p>Removing the targetSdkVersion makes it work on all platforms again.</p><p>How can I make the code run with the targetSdkVersion set?</p>","114066","","114066","","2010-09-27 09:47:15","2010-09-27 09:47:15","What changes are made in the mass storage API between Android 1.5 and Android 1.6","<android><file-io><fragmentation>","1","0","","",""
"3802644","1","6308274","","2010-09-27 09:46:54","2","4939","<p>I want to get the device id that will be unique for each Android device. I am presently developing for a Tablet device. Want to get unique device id and store the corresponding values... </p><p>So, i want to know whether Tablet devices will return a value if i use TelephonyManager.getDeviceId()...???Or is there any other value that is unique for each device???</p>","303155","","","","","2014-01-07 15:15:36","Will TelephonyManger.getDeviceId() return device id for Tablets like Galaxy Tab...?","<android><tablet-pc>","2","1","3","",""
"3802686","1","","","2010-09-27 09:53:06","2","574","<p>i have a problem with the TextSwitcher.In my app i have 3 Textswitcher with wrap_content (width and higth) inside an LinearLayout!</p><p></p><p>Each TextSwitcher is declared with an in and outAnimation.My problem:When the text is switch the first time, i have spaces between the elements! like: 1.23 45 678but it has to: 1.2345678 without spaces</p><p>when the text switches the second or 3. time the spaces are gone.I cant imagine why there are spaces?? There is no other Element, no padding, no margin.</p><p>maybie the reason is the ViewFactory:ViewFactory for the middle part switche:</p><pre><code>public View makeView() {  TextView t = new TextView(SmartTraderFxTrading.this);  t.setTextColor(Color.BLACK);  t.setTypeface(null, Typeface.BOLD);  t.setTextSize(26f);  return t; }</code></pre><p>an for the switcher left and right from the middle part:</p><pre><code>    public View makeView() {  TextView t = new TextView(this);  t.setTextColor(Color.DKGRAY);  t.setTextSize(20f);  return t; }</code></pre><p>but i can change everything, the spaces are always there after the first switch, and also maybie after the second.</p><p>Is it a bug? Please help!</p><p>EDIT:Problem solved!The problem is that the Text befor has more digits as after! So the TextSwitcher has a larger width and after redraw of the activitie it wraps the TS.</p>","421901","","421901","","2010-09-27 11:21:52","2014-01-02 21:21:27","TextSwitcher bug","<android><text><animation><textview>","0","0","","",""
"3802695","1","","","2010-09-27 09:53:48","4","9968","<p>In my android application I an storing an image file in internal memory using below code-</p><pre><code>FileOutputStream fos = con.openFileOutput(fileName, con.MODE_PRIVATE);fos.write(baf.toByteArray()); // baf - ByteArrayBufferfos.close();</code></pre><p>Can any one please help me to read this image file from internal display it in an activty?</p>","453951","","272824","","2010-09-27 15:07:10","2012-06-20 08:50:00","How to read image file stored in internal memory?","<android><image>","1","0","1","",""
"3802727","1","","","2010-09-27 09:58:01","0","1763","<p>What should I do to remove only the selected tab in android?Is there anything like remove tab or anything that helps me to remove a tab in the TabWidget class or in another class of the Android API?</p>","459331","","114066","","2010-09-27 10:18:39","2010-09-27 10:36:57","How to remove the selected tab in Android?","<android><tabwidget>","1","3","","",""
"3802820","1","4040253","","2010-09-27 10:11:51","3","13521","<p>test image here:<a href=""http://images.plurk.com/tn_4134189_bf54fe8e270ce41240d534b5133884ee.gif"" rel=""nofollow"">http://images.plurk.com/tn_4134189_bf54fe8e270ce41240d534b5133884ee.gif</a></p><p>I've tried several solutions found on the internet but there is no working solution.</p><p>I'm using the following snippet code:</p><pre><code>Url imageUrl = new Url(""http://images.plurk.com/tn_4134189_bf54fe8e270ce41240d534b5133884ee.gif"");Bitmap image = BitmapFactory.decodeStream(imageUrl.openStream());</code></pre><p>Always getting this log:</p><pre><code>DEBUG/skia(1441): --- decoder-&gt;decode returned false</code></pre><p>Any help?Thanks.</p><p>EDIT:</p><p>Those images failed to be decoded are also can not be shown on a <code>WebView</code>. But can see if open in a Browser.</p>","428022","","428022","","2010-10-22 01:52:46","2013-12-11 11:30:35","BitmapFactory.decodeStream always returns null and skia decoder shows decode returned false","<android><image><bitmap><skia>","9","0","6","",""
"3802822","1","","","2010-09-27 10:12:05","0","153","<p>i am having some problems with services in android , here is the structure of Activities which i am loading in my app . </p><ol><li>FirstActivity--->MusicPlayer---->ServiceToPlayMusic</li></ol><p>when i navigate back from MusicPlayer Activity to firstActivity .</p><p>FirstActivity &lt;------MusicPlayer.</p><p>Service runs in background but the activity on which i bound that service was crashed (MusicPlayer)i want to update the UI of MusicPlayer Activity </p><p>any Suggestions ?</p><p>Thanks </p>","439397","","","","","2011-05-24 08:36:38","Android Services","<android>","1","0","1","",""
"3802887","1","4329972","","2010-09-27 10:20:42","15","3926","<p>I am using this code:</p><pre><code>public boolean onKey(View v, int keyCode, KeyEvent event) {msg = (EditText)findViewById(R.id.msg);String message = msg.getText().toString();            if(keyCode == 66)            {                //It's hitting here twice.                      }            return false;        };</code></pre><p>Can anyone please tell me why it's hitting twice when I press enter?</p>","375061","","815724","","2013-01-11 20:11:30","2013-01-11 20:11:30","Why is onKey() called twice?","<android>","1","1","2","",""
"3802923","1","","","2010-09-27 10:24:58","4","2713","<p>is there a way to filter audio in android system?I am interested to get only the audio of a fixed frequency.</p>","422688","","21234","","2010-12-08 11:34:18","2012-09-19 15:37:53","audio Filtering android","<android><audio>","3","0","1","",""
"3802948","1","3803077","","2010-09-27 10:28:39","0","1003","<p>I am using Button in main Activity. When i clicked this button it will go for another Activity. My question is.. when i clicked the Button it should not display another Activity window..For example..in my case when i clicked the button it will start another activity and in that Activity i have added functionality of Receiving Notification..Here What i want is When i clicked the button i should receive notification and it should display another Activity window. how can i do this..?I can do this my adding functionality of receiving Notification in Onclick. But I wont want in that way. I require two Activities..Please can any one suggest me how to do this.?</p><p>[CLARIFYING TEXT].</p><p>With in my first Acticity i had a Button. when i click that button it will start new Activity..ie.</p><pre><code>Intent intent = new Intent(this, SecondActivity.class); startActivity(intent);</code></pre><p>with in this second Activity i added the code for receiving notification..</p><p>Now my question is when i am clicking the button in first Activity a new window will be displayed as i am starting second activity..What i want is i wont want a new window to be displayed..But i have to receive notification..</p>","458295","","458295","","2010-09-27 11:50:24","2010-09-27 11:50:24","Two or More Activities in android","<android>","1","1","","",""
"3802950","1","3803040","","2010-09-27 10:28:54","0","3423","<p>I've tried to convert a UNIX Timestamp to todays date time.</p><p>Like I have a simple UNIX Timestamp and then I want to convert it like this:</p><p><em>Today at: theTimeFromMyTimestamp</em></p><p>Anyone that has a correct solution for this?</p><p>Thanks in advance!</p>","386562","","","","","2012-11-03 21:18:39","Convert from UNIX Timestamp to ""Today at: currentTime"" using Java","<java><android>","3","0","1","",""
"3803119","1","3803157","","2010-09-27 10:51:52","2","507","<p>I want to know how I can execute some action, or continue listening to sensor or battery change events when the phone is locked. (When the phone is locked it stops listening to sensor changes.)</p><p>I've tried with wakelocks but I it doesn't work (maybe I'm using it wrong).</p><p>Any help would be appreciated.</p>","439684","","15825","","2010-09-27 12:36:47","2013-05-16 17:24:37","Android - Execute action when phone is locked","<android>","2","0","1","",""
"3803162","1","3803593","","2010-09-27 11:02:11","5","6751","<p>I used this selector code for my custom button (simple.xml)</p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;  &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;      &lt;item android:state_focused=""true"" android:state_pressed=""false"" android:drawable=""@drawable/focused"" /&gt;      &lt;item android:state_focused=""true"" android:state_pressed=""true"" android:drawable=""@drawable/focusedpressed"" /&gt;      &lt;item android:state_focused=""false"" android:state_pressed=""true"" android:drawable=""@drawable/pressed"" /&gt;      &lt;item android:drawable=""@drawable/defaultbutton"" /&gt;  &lt;/selector&gt;</code></pre><p>But on my ImageButton I don't know how to remove border. I want to show only my images not to show border around button. </p><p>Thanks<img src=""http://i.stack.imgur.com/ZBWiu.jpg"" alt=""alt text""></p>","432848","","180538","","2010-09-27 11:44:48","2010-09-27 12:09:39","Android, remove custom button border","<android><background><imagebutton>","2","0","","",""
"3803166","1","","","2010-09-27 11:02:29","3","1183","<p>I want to find some resources about java programming for android. I have a little knowledge on java programming so the guide have to begin from novice.</p><p>In other words i need a tutorial/ebook to learn java programming that i can use latter for android development.</p><p>Can you suggest me something that you have read or you know that it is good ? Anything.. from amazon...or anywhere..</p><p>Thanks in advance</p>","459398","","265143","","2010-09-27 11:05:47","2013-07-24 12:59:23","Android - Learning Java","<java><android>","4","1","5","2013-07-24 14:54:56",""
"3803484","1","","","2010-09-27 11:51:07","2","7334","<p>I am developing an application in android which has a login Screen. Right now I am able to  receive the response from the server successfully. After a successful response it should take me to the next activity or class where I display a new screen/activity. what should I do in order to achieve this.</p>","459435","","114066","","2010-09-27 11:52:41","2013-05-19 19:38:04","Moving from One activity to next in Android","<android>","2","0","1","",""
"3803491","1","","","2010-09-27 11:53:01","2","1310","<p>I am trying to fetch photos from a Picasa album in Android.</p><p>I have used following link as a reference:</p><blockquote>  <p><a href=""http://gdata-java-client.googlecode.com/svn/tags/2.2.1-alpha/sample/picasa/picasa-atom-android-sample/instructions.html"" rel=""nofollow"">http://gdata-java-client.googlecode.com/svn/tags/2.2.1-alpha/sample/picasa/picasa-atom-android-sample/instructions.html</a></p></blockquote><p>But in the above example I think the user can only access <strong>albums</strong>, whereas I want to access photos also, which might need PhotoEntry Class, so can anyone suggest to me what files I need for Android previously to get photos from Picasa?</p>","405383","","2153784","","2011-12-13 15:11:29","2011-12-13 15:11:29","access photos from Picasa in Android using Google APIs","<android><picasa><google-api-java-client>","1","0","","",""
"3803495","1","3818931","","2010-09-27 11:54:15","5","2837","<p>I would be obliged, if you could kindly let me know  the means by which I can retrieve the youtube thumbnails using Google API Client Library for Java, similar to the way in which we fetched thumbnails using gdata.</p><pre><code>List&lt;String&gt; thumbnails = new LinkedList&lt;String&gt;();for (MediaThumbnail mediaThumbnail : mediaGroup.getThumbnails()) {    thumbnails.add(mediaThumbnail.getUrl());}</code></pre><p>Looking forward,Regards,Rony</p>","264953","","251173","","2010-09-27 12:30:24","2010-09-29 05:23:25","How to retrieve youtube thumbnails using Google API Client Library for Java","<java><android><google-api-java-client>","1","0","1","",""
"3803861","1","","","2010-09-27 12:43:41","4","4265","<p>I'm trying to detect the scroll event in Android browser (my specific version is 2.1, but U want it to work also on older versions). This seems impossible!</p><p>I first tried this:</p><pre><code>document.addEventListener('scroll', function(){ alert('test'); }, false);</code></pre><p>But nothing is triggered (except when the page load).</p><p>I thought: well, let's be crazy and emulate it by : 1. Detecting touchend 2. Polling the window.pageYOffset so we know when the window stops scrolling 3. Manually trigger a user function I want on scroll.</p><p>Unfortunately, the touchend event doesn't look to be triggered either... in fact, when we don't scroll and only tap the screen (touchstart + touchend), it works. As soon as we scroll the page in between (touchstart + touchmove + touchend), it breaks everything.</p><p>Now my most basic example only contains this:</p><pre><code>document.addEventListener('touchend', function(){ alert('test'); }, false);</code></pre><p>But the alert doesn't show up when we scroll with the finger and release the touch...</p><p>Does anyone has a suggestion?</p><p>Thanks.</p>","211204","","","","","2011-03-08 13:21:12","Detect scroll event on Android browser","<javascript><android><event-handling><scrolling><touch>","1","0","","",""
"3803862","1","","","2010-09-27 12:43:48","1","2269","<p>I have an application, which on the <code>onResume()</code> method takes some time to redraw. I want to cache some things, but I am unfamiliar how and what can I ""cache"" (preload) data and keep it when my app is not visible.</p><p>My question is - I have some data and I want it to be loaded in memory when my activity is not visible. My data is actually a little set of jpeg'. Problem - they are being redrawn. </p><p>How can I achieve that? Strategy, example with very simple things, anything would be very useful to me. </p><p>Thanks in advance. </p>","346583","","251173","","2010-09-27 13:54:24","2013-03-11 18:41:39","Caching and Android","<java><android><caching>","3","1","1","2013-03-15 18:50:20",""
"3803871","1","","","2010-09-27 12:45:06","24","22478","<p>I'm thinking about an Android app (with possibly an accompanying physical device), and i'm trying to figure out whether this is something that's feasible.</p><p>1) Let's say I plug my Android to my PC. Would it be possible for an app installed on the PC to communicate with an app running in the cell phone? I just need a very simplistic data exchange, it can even be one-way (just data pushed from the cell phone to the listening app on the PC, whenever the cell phone wants, I don't need any data sent from PC to phone).</p><p>When I plug it in, the phone gives me 4 options (charge, disk drive, HTC sync, tethering), which makes me think this is not doable, but still worth the shot.</p><p>2) Would it be possible for an app on the PC to talk to an app on the phone through any other way? (Wi-fi, bluetooth, etc). I'm guessing no on wi-fi since neither party has the other's IP (and I want this to kinda just work, not having to input IPs manually all the time). </p><p>3) If I make a device that's plugged to the little USB port at the bottom of the phone (and let's say this is a magical device that can do anything, I don't quite care about those details as long as it's doable). Can I have an Android app talk to that device?</p><p>4) Any other ideas to make the phone talk to a ""device"" that I make, or to an app in the PC are more than welcome. Going ""through the web"" could be an option (although there'd have to be a central server that I own as a middle man, I believe). But i'd prefer if the communication was direct between the two devices.</p><p>Thank you very much for any ideas!<br>Daniel</p>","3314","","","","","2013-04-06 09:16:36","Android apps, communicating with a device plugged in the USB port","<android><usb><communication><wifi>","5","0","15","",""
"3804034","1","4100547","","2010-09-27 13:04:28","1","721","<p>I am displaying a notification icon which is dark gray. It looks fine on Nexus One, where the notification area is light gray and is almost invisible on HTC Desire (Sense UI - dark gray notification bar). Is there a way to overcome that? (The icon cannot be changed).</p><p>Thanks a lot</p><p>EDIT: ""The icon cannot be changed meaning"" that I am using a custom set of icons which is a <strong>must</strong> for me.</p>","367677","","367677","","2010-09-27 13:28:16","2010-11-04 19:37:28","different sets of notification icons based on notification bar color","<android><gui><notifications>","1","1","","",""
"3804041","1","","","2010-09-27 13:05:12","0","399","<p>I am using mapview in a xml file and that xml file have to load many times according to user interaction. First time the map shows and pointing the correct place. But from the Second time onwards it shows ""android.view.inflateexception"". Please help me to clear this problem.Is there any problem with the apikey in the mapview for loading map twice..?this is the code for loading map into application.</p><hr><pre><code>mapView=(MapView)findViewById(R.id.mapview);    //mapView.setBuiltInZoomControls(true);    List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();    Drawable drawable = this.getResources().getDrawable(R.drawable.pinpoint);    HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this);    GeoPoint point = new GeoPoint((int)(latitude[event_id]*(1E6)),(int)(logintude[event_id]*(1E6)));    OverlayItem overlayitem = new OverlayItem(point, ""Laissez les bon temps rouler!"", ""I'm in Louisiana!"");    //LinearLayout zoomLayout=(LinearLayout)findViewById(R.id.zoom);    //View zoomView=mapView.getZoomControls();    //zoomLayout.addView(zoomView,new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    mapView.displayZoomControls(true);    itemizedoverlay.addOverlay(overlayitem);    // itemizedoverlay.addOverlay(overlayitem2);    mc=mapView.getController();    mc.animateTo(point);    mc.setZoom(13);    mapOverlays.add(itemizedoverlay);</code></pre>","436765","","","","","2010-09-27 13:05:12","MapView in android and ""android.view.inflateexception""","<android>","0","2","","",""
"3804233","1","","","2010-09-27 13:29:13","6","9743","<p>When ever we need to send an email in Android we will invoke registered email application using Intent.ACTION_SEND like below</p><pre><code>Intent i = new Intent(Intent.ACTION_SEND);startActivity(Intent.createChooser(i, ""Send mail...""));</code></pre><p>My doubt is why do we need to use Intent.createChooser in startActivity rather than using<code>startActivty(i)</code>.Is there any specific reason of using <code>Intent.createChooser()</code>?</p>","429501","","180538","","2013-03-09 13:57:00","2014-03-26 21:04:30","What is the purpose of using Intent.createChooser() in StartActivity() while sending email in Android","<android><android-intent>","3","0","0","",""
"3804251","1","","","2010-09-27 13:31:08","2","301","<p>I Have 2 htc tattoo, and I have the next problem, I've made an app and when I upload the app to the market the app is showing on one tattoo but not on the other. Any Ideas?</p><p>I have activated all available markets, and deactivated the protections.</p><p>My manifest has the next configuration:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.READ_PHONE_STATE"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.CAMERA"" /&gt;&lt;supports-screens android:largeScreens=""true""    android:normalScreens=""true"" android:smallScreens=""true""    android:anyDensity=""true"" /&gt;&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""7""/&gt;</code></pre>","345772","","436938","","2012-04-19 16:34:58","2012-04-19 16:34:58","my app do not show in android market but only in some cases","<android><android-market-filtering>","2","0","","",""
"3804295","1","4051355","","2010-09-27 13:36:16","4","1451","<p>I'm a problem with a HttpsURLConnection that I can't seem to solve. Basically, I'm sending up some info to a server and if some of that data is wrong, the server sends me a 500 response code. However, it also sends a message in the response telling me which bit of data was wrong. The problem is that the message is always empty when I read it in. I think this is because a filenotfound exception always gets thrown before the stream can be read. Am I right? I tried reading the errorstream as well but this is always empty. Here's a snippet:</p><pre><code>    conn = (HttpsURLConnection) connectURL.openConnection();    conn.setDoOutput(true);    conn.setConnectTimeout(30000);    conn.setReadTimeout(30000);    conn.setRequestMethod(""POST"");    conn.setRequestProperty(""Content-Length"",         Integer.toString(outString.getBytes().length));    DataOutputStream wr = new DataOutputStream(conn      .getOutputStream());    wr.write(outString.getBytes());    wr.flush();    wr.close();    if(conn.getResponseCode&gt;400{    String response = getErrorResponse(conn);    public String getErrorResponse(HttpsURLConnection conn) {    Log.i(TAG, ""in getResponse"");    InputStream is = null;    try {     //is = conn.getInputStream();    is = conn.getErrorStream();    // scoop up the reply from the server    int ch;    StringBuffer sb = new StringBuffer();    while ((ch = is.read()) != -1) {     sb.append((char) ch);    }    //System.out.println(sb.toString());    return sb.toString();    // return conferenceId;   }    catch (Exception e){    e.printStackTrace();    }    }</code></pre>","224977","","251173","","2010-09-27 13:48:59","2010-10-29 11:28:46","HttpsURLConnection Connection Problems","<java><android><httpurlconnection>","3","0","1","",""
"3804352","1","","","2010-09-27 13:41:58","0","224","<p>I have the following XML data. How do I track the error tag in case of an invalid request or input?  </p><p>If it is possible then can you please provide me proper code for this? </p><p>Login Request:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;soap:Body&gt;    &lt;Signin xmlns=""http://tempuri.org/""&gt;  &lt;card_number&gt; 123/321 &lt;/ card_number &gt;   &lt;dob&gt;MM|DD|YYYY &lt;/dob &gt;    &lt;/Signin&gt;  &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>Response:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;soap:Body&gt;    &lt;SigninResponse xmlns=""http://tempuri.org/""&gt;      &lt;user&gt;        &lt;user_id&gt;long&lt;/user_id&gt;        &lt;current_balance&gt;string&lt;/current_balance&gt;        &lt;card_iamge&gt;&lt;![CDATA[string]]&gt;&lt;/card_iamge&gt;      &lt;/user&gt;    &lt;/SigninResponse&gt;  &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>Transaction History Request:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;soap:Body&gt;    &lt;TransactionHistory xmlns=""http://tempuri.org/""&gt;  &lt; user_id &gt;1/2 &lt;/ user_id &gt;    &lt;/TransactionHistory&gt;  &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>Response:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;soap:Body&gt;    &lt;TransactionHistoryResponse xmlns=""http://tempuri.org/""&gt;      &lt;transactions&gt;        &lt;transaction&gt;  &lt;date&gt;&lt;![CDATA[08/30/2010]]&gt;&lt;/date&gt;  &lt;amt&gt;$10.50&lt;/amt&gt;  &lt;card&gt;ASYU763543&lt;/card&gt;      &lt;/transaction&gt;        &lt;transaction&gt;  &lt;date&gt;&lt;![CDATA[08/30/2010]]&gt;&lt;/date&gt;  &lt;amt&gt;$10.50&lt;/amt&gt;  &lt;card&gt;ASYU763543&lt;/card&gt;      &lt;/transaction&gt;&lt;transaction&gt;  &lt;date&gt;&lt;![CDATA[08/30/2010]]&gt;&lt;/date&gt;  &lt;amt&gt;$10.50&lt;/amt&gt;  &lt;card&gt;ASYU763543&lt;/card&gt;      &lt;/transaction&gt;      &lt;/transactions&gt;    &lt;/TransactionHistoryResponse&gt;  &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre><p>Error:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""&gt;  &lt;soap:Body&gt;    &lt;*Response xmlns=""http://tempuri.org/""&gt;  &lt; error&gt; string &lt;/ error &gt;    &lt;/&lt;*Response&gt;  &lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</code></pre>","489762","","199122","","2010-09-27 13:56:57","2010-09-27 17:28:48","parsing xml Data","<android>","1","0","","",""
"3804384","1","3804434","","2010-09-27 13:44:03","2","5291","<p>how to autoscroll a list view in android?I am adding data to the list so i want that  when i add it should autoscroll and the last added item should be visible.</p>","375061","","","","","2010-09-27 13:49:44","how to autoscroll a list view in android?","<android>","1","0","1","",""
"3804527","1","","","2010-09-27 13:58:19","0","3954","<p>I'm working with the HelloGoogleMaps tutorial on the Android Developers' Resource page (<a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-mapview.html</a>) and when I run part 1 of the application (""Creating a Map Activity"") on my emulator, I get the message ""The application HelloGoogleMaps (process com.example) has stopped unexpectedly. Please try again."" I'm pretty sure that I followed all of the instructions correctly, however I'm not sure that I set up my emulator environment correctly. Can anyone please help me figure out what's going on? Thanks.</p><p>Here's the output from logcat:  </p><pre>I/ActivityManager(   63): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example/.HelloGoogleMaps }I/ActivityManager(   63): Start proc com.example for activity com.example/.HelloGoogleMaps: pid=344 uid=10026 gids={3003, 1015}D/ddm-heap(  344): Got feature list requestW/dalvikvm(  344): Class resolved by unexpected DEX: Lcom/example/HelloGoogleMaps;(0x43d02e18):0x11fbb0 ref [Lcom/google/android/maps/MapActivity;] Lcom/google/android/maps/MapActivity;(0x43d02e18):0x11f510W/dalvikvm(  344): (Lcom/example/HelloGoogleMaps; had used a different Lcom/google/android/maps/MapActivity; during pre-verification)W/dalvikvm(  344): Unable to resolve superclass of Lcom/example/HelloGoogleMaps; (41)W/dalvikvm(  344): Link of class 'Lcom/example/HelloGoogleMaps;' failedD/AndroidRuntime(  344): Shutting down VMW/dalvikvm(  344): threadid=3: thread exiting with uncaught exception (group=0x4001b188)E/AndroidRuntime(  344): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime(  344): java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementationE/AndroidRuntime(  344):     at dalvik.system.DexFile.defineClass(Native Method)E/AndroidRuntime(  344):     at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:209)E/AndroidRuntime(  344):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:203)E/AndroidRuntime(  344):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)E/AndroidRuntime(  344):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)E/AndroidRuntime(  344):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)E/AndroidRuntime(  344):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)E/AndroidRuntime(  344):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)E/AndroidRuntime(  344):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)E/AndroidRuntime(  344):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)E/AndroidRuntime(  344):     at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  344):     at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(  344):     at android.app.ActivityThread.main(ActivityThread.java:4363)E/AndroidRuntime(  344):     at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(  344):     at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(  344):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)E/AndroidRuntime(  344):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)E/AndroidRuntime(  344):     at dalvik.system.NativeStart.main(Native Method)I/Process (   63): Sending signal. PID: 344 SIG: 3I/dalvikvm(  344): threadid=7: reacting to signal 3E/dalvikvm(  344): Unable to open stack trace file '/data/anr/traces.txt': Permission deniedW/ActivityManager(   63): Launch timeout has expired, giving up wake lock!W/ActivityManager(   63): Activity idle timeout for HistoryRecord{43dc9818 com.example/.HelloGoogleMaps}D/dalvikvm(  143): GC freed 2317 objects / 132032 bytes in 107ms</pre>","459550","","","","","2012-05-14 16:48:04","Android HelloGoogleMaps tutorial exception","<android><google-maps>","4","1","1","",""
"3804533","1","3804733","","2010-09-27 13:58:51","1","721","<p>I am trying to develop the map element of my app and I am having trouble obtaining a md5 fingerprint,  I am using Ubuntu and I have located the debug.keystore file, but when I enter the commands I get:</p><p>No command 'store' found, did you mean: Command '0store' from package 'zeroinstall-injector' (universe) Command 'stone' from package 'stone' (universe)store: command not found</p><p>or;</p><p>Illegal option:  -keyTry keytool -help</p><p>I think the first error maybe incorrect file path but I think the second error is when I got it right.  </p><p>Anyone Help with this</p><p>Thanks In Advance</p>","445174","","","","","2010-09-27 14:21:54","Cant obtain md5 Fingerprint for api key","<java><android><eclipse>","1","0","1","",""
"3804548","1","3804729","","2010-09-27 14:00:38","4","7514","<p>As per managing resources(images) in > Android 1.6 version, we need to keep different-resolutions image in Drawable-Hdpi, Drawable-Mdpi, Drawable-Lpi folder particularly.</p><p>And as per this page: <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a> ,</p><p>In Low density section - there are three resolutions used: 240*320 , 240x400 , 240x432 for the Small screen, Normal Screen, Large Screen particularly.</p><p>same way for Medium density section - there are three resolutions used: 320x480 , 480x800 , 480x854 for the Small screen, Normal Screen, Large Screen particularly.</p><p>and same way for High density ........</p><p>but i am confused here:</p><p>(1) How do i come to know that whether small, Normal or Large screen is used, i mean is there any way to know ?</p><p>(2) How do i come to know which type of density i am using ? </p><p>(3) And in Drawable-Hdpi, Drawable-Mdpi, Drawable-ldpi folder, which resolution's image we should keep particularly?</p><p>pls share your knowledge.</p>","379693","","","","","2013-05-13 09:06:53","Android - Screen Resolution and Screen Density","<android><android-screen><android-resolution>","4","0","1","",""
"3804578","1","3805714","","2010-09-27 14:04:25","2","1793","<p>I'm writing a Bookmark manager app and I got kinda stuck when trying to resort the Bookmarks (the ones being used by the default Browser with contentProvider).</p><p>I know I can query the Browser contentProvider and resort the data as I please (.TITLE + "" ASC"", .VISITS + "" DESC"", etc) but this will only sort the Bookmarks list shown on my app and not the actual Bookmarks shown on the Android Browser.</p><p>There are several app which does that (sort the Browser bookmarks) on the Market, ""Bookmark sort &amp; backup"" for example so I know it's possible.</p><p>Can anyone PLEASE give me a little direction on how this it possible? a line of code, a tutorial? anything will be appreciated!</p><p>Thank you,Lior</p><p><strong>UPDATE - Optional Solution:</strong> </p><p>Android sort its bookmarks by a specific column from the Bookmarks database.The database is located in ""Data -> Data -> com.android.browser -> databases -> browser.db"". You can use ADB to get there or apps like Root Explorer.</p><p>Android 2.2 sorts its Bookmarks according to ""visits"" column, therefore the most visited Bookmark will be placed first and so on.</p><p>If you want to alter the sort order, you would have to update the ""visits"" column of each Bookmark. For example: if you want to sort the Bookmarks Alphabetically you need to update the ""visits"" column in such a way that Bookmarks starting with the letter ""A"" will have the highest value of ""visits"".Android.com Bookmark will get 1000 visits, BestBuy.com Bookmark will get 900 visits and so on.</p><p><strong>Things to consider:</strong></p><ul><li>The total amount of Bookmarks (so you can determine the highest ""visits"" value, give it to the first Bookmark and subtract at least 1 visit from it for the second Bookmark).</li><li>The Android Browser continues to increase the ""visits"" number every time a user enters the website. Because you can't predict how much times a user will click on a certain Bookmark and in order to maintain the sort order the user selected on your app - you must make sure the ""visits"" value Bookmark number 1 has is much bigger than ""visits"" value Bookmark number 2 has (I recommend at least 1000 difference).</li></ul><p>On previous Android versions, the sort is ordered by the ""created"" column. see here for example: <a href=""http://www.netmite.com/android/mydroid/packages/apps/Browser/src/com/android/browser/BrowserBookmarksAdapter.java"" rel=""nofollow"">http://www.netmite.com/android/mydroid/packages/apps/Browser/src/com/android/browser/BrowserBookmarksAdapter.java</a></p><p>I hope this helps anyone ;)</p><p>If you have different ideas/solutions, PLEASE share!</p>","444324","","444324","","2010-11-04 08:58:18","2012-05-04 08:48:29","Change the way Android Browser sort its Bookmarks programmatically","<android>","1","0","","",""
"3804676","1","","","2010-09-27 14:15:49","2","918","<p>I would like to know if there is anyway to know the date at which an application was installed in an Android phone. I would like to know this in order to implement a time limited trial / demo version of an application.</p><p>I could save the date on the first usage, but a tech-savvy user could use ADB to change the database or delete support files.</p><p>Thanks for your help.</p>","425749","","","","","2010-09-27 14:23:15","Application installation date","<android><security><demo><time-trial>","1","0","1","",""
"3804833","1","","","2010-09-27 14:32:33","5","1025","<p>IIUC, there should only be one instance of a given Android service, it is a singleton.</p><p>However, my service gets instantiated multiple times, although Ido nothing for it.</p><p>When the service crashes (for example when I uninstall the app through adb), itgets scheduled for restart (""Scheduling restart of crashed service.. ""). Iunderstand this is an effect of the service being sticky.</p><p>After that, when my app starts, it calls startService() and bindService(), andthe service gets appropriately started and bound. But the service is thenreinstantiated and onCreate() is called repeatedly, as many times it wasscheduled for restart.</p><p>Each instance then wait for clients to bind and register, but onBind() is onlycalled in the ""main"" service instance. The additional instances wait a bit forclient to bind, and since that doesn't happen, they call stopSelf().</p><p>But stopSelf() has absolutely no effect in these ""dead"" instances, onDestroy()is never called.</p><p>The ""main"" service instance does work as expected, and when it decides to callstopSelf(), onDestroy() is indeed called.</p><p>Worse, all these dead instances accumulate, they never gets destroyed.Therefore, their only possible end is a crash (which happen every time Ilaunch/install through adb), and thus scheduled restart.</p><p>So that in the end I get many of these dead instances, which are restartedprogressively once by minute approximately.</p><p>Does anyone know what's going on?</p>","377478","","","","","2013-01-22 00:49:09","Why does my service get instantiated multiple times?","<android>","4","4","2","",""
"3804851","1","3805192","","2010-09-27 14:34:22","0","256","<p>I was trying to display a static html page in an android app having some images in it. I saved the image in assests folder and also in res/raw folder. I was loading html file with this technique and html file is also in res/raw folder.   </p><pre><code>    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    String data = ResourceUtils.loadResToString(R.raw.temp, this);    final String mimetype = ""text/html"";    final String encoding = ""UTF-8"";    mWebView.loadData(data, mimetype, encoding);</code></pre><p>I tried different ways to refer to image like.</p><ol><li><p>img1.png, /img1.png, file:///img1.png, content://img1.png</p></li><li><p>HtmlViewer/assets/img1.png, content:///HtmlViewer/assets/img1.png and     file:///HtmlViewer/assets/img1.png</p></li><li><p>PackageName/assets/img1.png, content:///PackageName/assets/img1.png and file:///PackageName/assets/img1.png</p></li></ol><p>Can anyone tell me how to get path for image?</p>","","user349026","","","","2010-09-27 15:14:27","How do i reference an Image from with in an HTML page locally package in an android App?","<android><image>","1","0","","",""
"3804896","1","","","2010-09-27 14:39:13","0","882","<p>I have a menu that is made up of a HorizontalScrollView that has a LinearLayout with TextViews. When a user swipes/scrolls I want to be able to show and not show a leading and trailing image that represents that there are more options. So, when the application starts, the far left image is not shown but the far right image is. Once the user swipes to go right, the far left image is shown. When you get to the very last option to the right, the right image is gone.</p><p>I have tried to use the SimpleOnGestureListener but it seems that the position reported is where the user is instead of the position of the list. I was thinking I could just do something like:</p><p>if(scrollX &lt; 200.0) {  tempL.setVisibility(View.INVISIBLE);} else tempL.setVisibility(View.VISIBLE);</p><p>I even implemented both onFling and onScroll methods to try but did not get the expected results. Also, the position is only reported when the user scrolls again. So, a fling position may be 1278 and go all the way to 0 but 0 is not reported until the user tries to fling again.</p><p>Thanks.</p>","362608","","362608","","2010-09-27 21:17:23","2010-09-27 21:17:23","HorizontalScrollView Menu for Android","<android><horizontalscrollview>","1","0","","",""
"3805429","1","","","2010-09-27 15:42:18","2","906","<p>is it possible to add any layout in progress dialog box in android??</p>","489762","","","","","2010-09-27 16:43:46","Progress Dialog in Android","<android>","1","1","1","",""
"3805521","1","3805880","","2010-09-27 15:53:52","1","380","<p>I have an application I am writing for Android that basically does a screen scrape of a large table on the web and presents it in a nicer way on the handset. Its 500k of html and takes about 20 seconds or so normally.</p><p>When I have my phone hooked up to the computer, I used to be able to just click on ""Run"" and my code would execute similiarly speedy, as opposed to Debug where it would take 10 minutes to complete.</p><p>Now, however, clicking ""run"" behaves just like debug mode.... I don't want this overhead, how do I get eclipse to stop sending my app to the debugger already? I have searched online and found a couple people with the same issue, but simply rebooting my phone doesn't fix it, and there have been no other solutions posted that I have found.</p><p>Thanks for any help you can give.</p>","459110","","86860","","2010-09-27 16:03:26","2010-09-27 16:38:04","Eclipse Debug Issues While Coding Android Applications","<android><eclipse><ddms>","1","3","","",""
"3805599","1","3805840","","2010-09-27 16:00:49","31","30803","<p>How can I add &amp; delete a view from a layout?</p>","443141","","2742371","","2014-01-15 22:04:06","2014-01-15 22:04:06","Add & delete view from Layout","<android>","5","3","4","",""
"3805622","1","3805686","","2010-09-27 16:03:42","4","6584","<p>I am getting strange results with the following code:</p><pre><code>iv = (ImageView) findViewById(R.id.iv);        iv.setImageResource(R.drawable.spinner_white_76);        Animation a = new RotateAnimation(0.0f, 360.0f,                Animation.RELATIVE_TO_SELF, iv.getDrawable()                        .getIntrinsicWidth() / 2, Animation.RELATIVE_TO_SELF,                iv.getDrawable().getIntrinsicHeight() / 2);        a.setRepeatCount(-1);        a.setDuration(1000);        iv.startAnimation(a);</code></pre><p>Whats the right way to specify the axis point (center of the drawable)?</p>","356580","","","","","2011-06-24 09:18:25","Drawable Rotating around its center Android","<android><rotation><drawable>","2","0","6","",""
"3805659","1","3805891","","2010-09-27 16:08:38","2","701","<p>I created a little texture drawing class from observing the LabelMaker example in the Android SDK.</p><p>One thing I can't find however is how to rotate textures drawn with glDrawTexiOES.</p><p>is it possible? I've just tried glRotatef but it has no effect.</p>","333361","","","","","2010-09-27 16:39:31","Rotating textures when using glDrawTexiOES","<java><android><opengl-es>","1","0","1","",""
"3805666","1","","","2010-09-27 16:09:07","2","645","<p>Does any one know if or when twitter is going to release the source code for the android app?</p><p>The release was <a href=""http://blog.twitter.com/2010/04/twitter-for-android-robots-like-to.html"" rel=""nofollow"">announced back in April</a></p><blockquote>  <p>We had a great time working with the Android team and are thrilled that Google will be open sourcing the code used in this app in the near future. We look forward to the amazing experiences developers will create using Twitter APIs in their upcoming Android apps.</p></blockquote><p>and it seems like they are not actually going to release it after all.</p>","371301","","243245","","2010-09-27 16:15:58","2011-06-26 07:31:14","Release of the source code for twitter app for android","<android><twitter>","1","5","2","",""
"3805700","1","","","2010-09-27 16:11:59","3","2119","<p>I've a quite simple list with 3 textview fields on each row. We are updating their values every 2 seconds or so with data coming from a background webservice call ( AsyncTask ) </p><p>We compare the coming values with the current ones, update them accordingly on the Adapter and finally calling notifyDataSetChanged() if needed</p><p>The thing is that the redraw gets really slow thus hanging the whole UI when we got more than 3 update rows at once. Of course we are using all ListView well-known optimizations such as the EfficientAdapter approach ( setTag() and holders ),  and getViewTypecount()/getItemViewType() . We have also tried to optimize our interface as much as possible with layoutopt and trying to avoid wrap_content widths and heights to lighten things up .</p><p>We don't do expensive operations on our updates either, just standard stuff: changing TextView text, textcolor, and backgroundcolor values.</p><p>The only weird thing I can see is that getView() is called 3-4-5 times for each row, although I've read all those Romain's messages [1] telling that is nothing wrong with that</p><p>Any ideas or hints on how can we speed it up?</p><p>Thank you very much!</p><p>[1] <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/4c4aedde22fe4594/aeb04288064f495e?show_docid=aeb04288064f495e"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse_thread/thread/4c4aedde22fe4594/aeb04288064f495e?show_docid=aeb04288064f495e</a></p>","459707","","459707","","2010-09-28 07:20:27","2012-12-12 09:43:49","Listview's ArrayAdapter notifydatasetchanged() very slow redraw","<listview><android><performance><android-arrayadapter><redraw>","2","5","2","",""
"3805761","1","3805945","","2010-09-27 16:20:47","2","384","<p>I have a ListView with a bunch of ListItem's. When the user selects an item, I would like to change that ListItem's background to an image. How can I accomplish this?</p><pre><code>listView.setOnItemClickListener(new OnItemClickListener() {    @Override    public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {    // how do I change the ListItem background here?    }});</code></pre>","19875","","243245","","2010-09-27 16:24:00","2010-09-27 16:46:24","How can I modify the background of a ListItem when it has been selected?","<java><android><listview><listviewitem>","1","0","","",""
"3805822","1","","","2010-09-27 16:31:12","3","1178","<p>I am having a problem capturing an image from the built-in camera app on the Samsung Galaxy S.</p><p>I have a button on my app that when pressed launches the camera:</p><pre><code>ContentValues values = new ContentValues();values.put(Images.Media.MIME_TYPE, ""image/jpeg"");mPicUri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);intent.putExtra(MediaStore.EXTRA_OUTPUT, mPicUri.getPath());startActivityForResult(intent, REQ_CODE_TAKE_PIC);</code></pre><p>From what I read on the interwebz, I can get the full-sized just-taken picture using the URI I passed to the intent. And so I have this on my onActivityResult:</p><pre><code>Uri selectedImage = mPicUri;String[] filePathColumn = {MediaStore.Images.Media.DATA};Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);cursor.moveToFirst();int columnIndex = cursor.getColumnIndex(filePathColumn[0]);String filePath = cursor.getString(columnIndex);cursor.close();</code></pre><p>And then using the variable filePath, I set the image in an ImageView.  I am getting no image, and when I stepped through the code, I found out that <code>BitmapFactory.decodeFile()</code> is returning <code>null</code>.</p><pre><code>Bitmap chosenPic = BitmapFactory.decodeFile(filePath);</code></pre><p>So I tried a little more debugging.  I found out that mPicUri returns a seemingly valid URI, such as: <code>content://media/external/images/media/90</code>.  After the picture is taken and the user chooses to save the picture, the cursor resolves to the following filePath: <code>/sdcard/DCIM/Camera/1285601413961.jpg</code>.  No bitmap is decoded though, BUT when I looked through the gallery, the picture I just took is there.  So I tried to take a look at the URI of that picture, and this is what I got:</p><pre><code>URI is:           content://media/external/images/media/91File path is:     /sdcard/DCIM/Camera/2010-09-27 23.30.30.jpg</code></pre><p>And so, it looks like the value I got from mPicUri is not the <em>final</em> URI that will be used.</p><p>Am I missing a step here? All I really want to do is retrieve the file of the just-taken picture.</p><p>Thanks in advance,Zarah.</p>","395576","","","","","2011-06-07 19:51:30","Getting full-sized image from the camera does not work on Galaxy S","<android><camera>","1","4","2","",""
"3805855","1","3806187","","2010-09-27 16:35:16","6","10676","<p>I am new to Android mobile application development. I would like to know, how can I handle exceptions like HttpConnection related exceptions or any other exceptions? Do I need to display an AlertDialog to the user?</p><p>Kindly provide a sample code or project source code on how can I handle HttpConnection or similar type of Exceptions.</p>","443141","","741249","","2012-09-19 14:01:19","2012-09-19 14:01:19","Sample code to handle Exceptions ","<android><exception>","3","0","5","",""
"3805938","1","3806047","","2010-09-27 16:45:07","11","9474","<p>I've followed a standard tutorial for building a database with Android.  I've created a class called DbHelper which extends SQLiteOpenHelper.  I've Overridden the create handler to execute a string.</p><pre><code>@Overridepublic void onCreate(SQLiteDatabase db) {    db.execSQL(DbDefinitions.DB_CREATE);}</code></pre><p>DbDefinitions.DB_CREATE is a static String I've created.</p><pre><code>public static final String TABLE_MESSAGES = ""messages"";public static final String TABLE_FRIENDS = ""friends"";public static final String STATE_OK = ""STATE_OK"";public static final String DB_CREATE =     ""create table "" + TABLE_MESSAGES + "" (_id integer primary key, user_id integer not null, created_on integer, subject text not null, summary text not null, messagetext text null, read integer not null, status text not null default '"" + STATE_OK + ""'); "" +    ""create table "" + TABLE_FRIENDS + "" (_id integer primary key, user_id integer not null, friend_id integer not null, created_on integer, status text not null default '"" + STATE_OK + ""');"";</code></pre><p>I'd like to use 1 String to execute multiple SQL statements.  How can I do this as SQLiteDatabase.execSQL only allows 1 statement?</p>","406790","","","","","2012-01-27 10:41:05","Executing multiple statements with SQLiteDatabase.execSQL","<android><database><sqlite><sqlite3>","3","0","4","",""
"3805987","1","","","2010-09-27 16:53:17","1","770","<p>An Android TextView can have its inputType parameter set to textNoSuggestions, which ""indicates that the IME should not show any dictionary-based word suggestions"". Presumably, if this is not specified, the default is for suggestions to be shown.</p><p>It can also have its AutoText parameter set to either true or false. ""If set, this specifies that this TextView has a textual input method and automatically corrects some common spelling errors. The default is ""false"".""</p><p>Does anyone know how these two parameters interact? For example, what happens if suggestions are not shown but autotext corrections are made?</p>","250845","","","","","2010-09-27 16:53:17","Android autotext and autosuggest ... how do these differ?","<android><textview><spell-checking><edittext>","0","0","","",""
"3806034","1","3806224","","2010-09-27 17:00:37","0","298","<p>Kindly provide me the code for handling the <strong>HttpConnection or related Exceptions &amp; how to display that to the user.</strong></p><p>Specifically , I would like to know how to handle <strong>TimeOut for HttpConnection &amp; how to display that alert to the user.</strong></p><p>Kindly provide the same code.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2012-01-07 09:21:32","Exception to be handled for HttpConnection","<android>","1","2","","",""
"3806051","1","3806085","","2010-09-27 17:03:44","8","15296","<p>I have some information stored as SharedPreferences. I need to access that information from outsite an Activity (in from a domain model class). So I created a static method in an Activity which I only use to get the shared preferences. </p><p>This is giving me some problems, since apparently it is not possible to call the method ""getSharedPreferences"" from a static method.</p><p>Here's the message eclipse is giving me:</p><pre><code>Cannot make a static reference to the non-static method getSharedPreferences(String, int) from the type ContextWrapper</code></pre><p>I tried to work around this by using an Activity instance, like this:</p><pre><code>public static SharedPreferences getSharedPreferences () {  Activity act = new Activity();  return act.getSharedPreferences(""FILE"", 0);}</code></pre><p>This code gives a null point exception.</p><p>Is there a work-around? Am I going into an android-code-smell by trying to do this?</p><p>Thanks in advance.</p>","425749","","","","","2013-07-16 04:45:22","Accessing SharedPreferences through static methods","<android><activity><static-methods><sharedpreferences>","3","0","12","",""
"3806084","1","3806125","","2010-09-27 17:08:25","0","382","<p>I have an activity that calls the</p><pre><code>new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);setListAdapter(notes);</code></pre><p>I would like to add a button to the notes_row.xml that displays at the bottom of the screen ""on top of"" the actual notes_row allowing the user to still scroll through the list but hit the button if they want.  Every time I try to change the layout of notes_row, I get the button on each item in the list. I am pretty new to Android and I think I need to inflate the button somehow so that it is layered in front of the list but doesn't impede the list, how do I go about doing that?</p>","436204","","199122","","2010-09-27 17:11:11","2010-09-27 17:16:06","Using notepad example, add a back button","<android>","3","0","","",""
"3806147","1","3806526","","2010-09-27 17:15:11","1","437","<p>I have an app which I want to run on as many Android phones as possible. My current solution is to just compile it with the newest version and doing the critical code in sections that will only be used on devices with the correct Android version. This worked fine until I started using Android 2.2. Now running the app on older phones gives me an error.</p><p>So I am thinking about using reflections, this would mean however that I would be compiling for version 1.5. So my question is will I suffer from any disadvantages? Apparantly compiling for a different version makes a difference as I can see at my error. So would I for example loose the JIT support or something?</p><p>Some insight from you guys on this topic would be great! Thanks in advance.</p>","410647","","","","","2010-09-27 18:04:54","Will I suffer from disadvantages when using reflections in Android?","<android><reflection>","2","0","","",""
"3806177","1","3806223","","2010-09-27 17:18:15","1","1791","<p>I'm trying to initialize an instance of class <code>consoleDroid</code> with <code>consoleDroid console = new consoleDroid();</code>, but it throws a <code>class, interface, or enum expected</code> compile error. What's the right way to initialize the class?</p><p><strong>caseSelector.java:</strong></p><pre><code>package com.caseselector;import android.app.Activity;import android.os.Bundle;consoleDroid console = new consoleDroid();public class caseSelector extends Activity{    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        console.create();    }}</code></pre><p><strong>consoleDroid.java:</strong></p><pre><code>package com.caseselector;import android.view.View;import android.widget.TextView;import android.widget.EditText;import android.widget.Button;public class consoleDroid {    private static String output;    private Button consoleButton;    private TextView consoleView;    private EditText consoleInput;    public static void create() {    }    public static void write(String input) {    }    public static void writeLine(String input) {    }    public static String readLine(boolean print) {        return output;    }}</code></pre>","365807","","62848","","2010-09-27 17:25:12","2010-09-27 17:25:12","Initialize a class instance?","<java><android>","4","1","","",""
"3806308","1","3807360","","2010-09-27 17:33:10","2","1937","<p>Trying to get a count of the rows in a database from a separate activity.  I have been messing with the methods to do so, but I can't seem to instantiate them from another activity if the method is built in the database adapter class.  Ideally, I would like the method in the adapter to return an int that I can then use in a number of different activities down the chain.  Is there a way to do this that I am not thinking of?  </p>","436204","","","","","2010-09-27 20:00:24","Count the number of rows in a database from an activity outside the adapter","<android>","1","3","1","",""
"3806330","1","3806415","","2010-09-27 17:36:17","0","5522","<p>How can I center ImageButton in the this LinearLayout</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""@drawable/main""&gt;</code></pre><p>ImageButton</p><pre><code>              &lt;ImageButton android:id=""@+id/btnBut""                      android:background=""@drawable/button""                      android:layout_width=""wrap_content""                      android:layout_height=""wrap_content"" /&gt;</code></pre><p>I don't want to use fixed sizes.</p><p>Thanks</p>","432848","","539542","","2012-01-15 05:31:40","2013-06-30 20:57:44","Android: Center ImageButton in LinearLayout","<android>","4","0","","",""
"3806444","1","","","2010-09-27 17:52:49","1","555","<p>So I'm struggling a bit here trying to create a 2D map of icons, where each icon is 48x48 pixels and the map is a 9x9 grid (thus, 432x432 pixels in size).  I tried, unsuccessfully, starting with a GridView and have since decided to try using an AbsoluteView inside of a LinearView.  Here's the beginning of the XML file (I've not added all 81 icons for now just to keep it somewhat brief for this question):</p><p></p><pre><code>&lt;AbsoluteLayout     xmlns:android=""http://schemas.android.com/apk/res/android""       android:orientation=""vertical""       android:layout_width=""442px""       android:layout_height=""442px""      android:padding=""5px""      android:layout_gravity=""center_horizontal""      android:background=""#008000""&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""0px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""48px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""96px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""144px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""192px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""240px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""288px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""336px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""384px""        android:layout_y=""0px""        /&gt;    &lt;ImageView        android:background=""@drawable/water2""        android:layout_width=""48px""        android:layout_height=""48px""        android:layout_x=""0px""        android:layout_y=""48px""        /&gt;              &lt;/AbsoluteLayout&gt;</code></pre><p></p><p>When I try this in Eclipse, it looks utterly perfect.  When I load this onto my Samsung Captivate, it is just wrong.  Its as if the icons are being stretched even though I've specified exact dimensions in pixels.</p><p>I'm sure I'm probably making some noob mistake, but no matter what I try, I cannot seem to make the icons/drawables display at their exact dimensions.  If someone can point out what I'm doing wrong, I would greatly appreciate it.</p><p>Thanks.</p><p>So I changed the XML file to try and use the TableLayout as follows:</p><p></p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""center_horizontal""    &gt;    &lt;TableRow&gt;            &lt;LinearLayout              xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""horizontal""              android:layout_width=""wrap_content""              android:layout_height=""wrap_content""                android:paddingTop=""0px""&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;ImageView                android:src=""@drawable/water2""                android:scaleType=""fitXY""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;/LinearLayout&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p></p><p>Even if I specified the exact dimensions of the ImageViews, they still got stretched such that only about 5 or so icons were displayed.</p>","459783","","459783","","2010-09-27 19:37:07","2010-09-27 19:37:07","Using ImageView to make a 2D Map of Icons","<android><imageview>","2","0","","",""
"3806454","1","","","2010-09-27 17:54:48","1","4646","<p>I am currently playing about with lesson 08 here </p><p><a href=""http://insanitydesign.com/wp/projects/nehe-android-ports/"" rel=""nofollow"">http://insanitydesign.com/wp/projects/nehe-android-ports/</a></p><p>I would like to change the background colour from black to white. In order to do this at the start of onDrawFrame() I have called </p><p>gl.glClearColor(1.0f, 0.0f, 0.0f, 0.0f);</p><p>This does indeed set a white background screen, but also results in nothing else showing up on the screen! Clearly this is therefore an incorrect method, but why, and how do I fix it?!</p><p>Many thanks in advance.</p><p>Edit (5 days later): Does nobody know at all?!!</p>","455141","","455141","","2010-10-03 14:48:55","2012-12-18 09:25:06","How to set background colour on Open GL ES Android","<android><opengl-es><background><blending>","2","2","","",""
"3806457","1","3892641","","2010-09-27 17:55:47","1","2412","<p>I'm trying to reduce the number of queries I do to the Android's database.  Basically I want to get any email or IM address that contains a user defined search term.  Right now I'm doing two separate queries:</p><p>Email:</p><pre><code>Cursor emails = cr.query(     ContactsContract.CommonDataKinds.Email.CONTENT_URI,     null,     ContactsContract.CommonDataKinds.Email.DATA + "" LIKE ?"",     new String[] {searchTerm},     null);</code></pre><p>IM:</p><pre><code>Cursor cursor = cr.query(    ContactsContract.Data.CONTENT_URI,     null,     ContactsContract.CommonDataKinds.Im.DATA + "" LIKE ?"",     new String[] {searchTerm},     null); </code></pre><p>Does anyone know of an easy way to combine both queries?  The crux of the problem seems to be that the two content URI's are different.</p><p>Simon</p>","41679","","562073","","2011-11-17 15:38:52","2012-09-27 17:42:12","Can you query two tables in one statement in Android?","<sql><android>","4","0","1","",""
"3806536","1","3806991","","2010-09-27 18:07:02","12","30205","<p>HI all,</p><p>I want to enable/disable bluetooth through the program..I has the following code.</p><pre><code>BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();    if (!mBluetoothAdapter.isEnabled()) {        Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);        startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);</code></pre><p>But this sort of code is not working in SDK 1.5..How can i do the same in SDK 1.5.?</p>","458295","","662025","","2011-03-22 07:20:43","2014-01-20 17:39:39","How to enable/disable bluetooth programmatically in android","<android><bluetooth>","6","2","6","",""
"3806771","1","","","2010-09-27 18:41:55","1","75","<p>I wrote an email application in Android , that uses <code>Action_SEND</code> intent. When I <code>call startActivity(i);</code> where i is intent, along with email Application , messaging application is also popping up. But when I wrote an application for email why should messaging application also should pop up.can I be explained clearly regarding this concept.</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);String[] mailto = recipients;sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto);String[] mailCc = recipientsToBeCopied;sendIntent.putExtra(Intent.EXTRA_CC, mailCc);String[] mailBcc = recipientsToBeBlindCopied;sendIntent.putExtra(Intent.EXTRA_BCC, mailBcc);String subject = strSubject;sendIntent.putExtra(Intent.EXTRA_SUBJECT, subject);String body = strBody;sendIntent.putExtra(Intent.EXTRA_TEXT, body);sendIntent.setType(""text/plain"");startActivity(Intent.createChooser(sendIntent, ""send mail..""));</code></pre><p>Can any one tell me reason for using <code>createChooser</code> of intent and also reason for this application popping up messaging activity. </p>","429501","","244296","","2010-09-27 18:45:27","2010-09-27 18:45:27","Messaging Activity pops up along with mail application in Android","<android>","0","0","","",""
"3806818","1","3810132","","2010-09-27 18:49:50","3","3286","<p>I am currently developing an image processing application for android mobile phones and I would like to know what libraries would you guys recommend me based on your experience.<br>I have heard of <a href=""http://code.google.com/p/jjil/"" rel=""nofollow"">JJIL</a> but I do not know how good it might be for what i want to achieve.<br>I need something that implements the basic image processing functions from Matlab toolbox, and i would also like to know if there are any alternatives to JJIL.<br>Additionally, i have heard it is possible to use Matlab's compiler to generate C code that would be useable in a standalone application, but has anybody ever did this before, for Java, adapting it to work in android environment?Thanks in advance.</p>","371388","","","","","2010-09-28 06:13:11","Image Processing Libraries for Android","<java><android><matlab><image-processing>","1","0","2","",""
"3806847","1","","","2010-09-27 18:53:04","6","2617","<p>I have an xml layout that will display a grid made up of textviews within tablerows.  The textview names are cell00, cell01, etc.  At runtime, my program will determine which cell needs to be changed.  </p><p>Is there a way get format a name so that it can be passed to the findViewById method at runtime?  For example, if cell00 is needed, how can I generate the parm in this code?</p><pre><code>TextView currcell = (TextView) findViewById(R.id.cell00) </code></pre><p>Something like “cell”+00 doesn’t compile because the findViewById method doesn’t accept a String type.  I don’t want have every textview name in the grid hardcoded in the program – there must be a better way. </p><p>Thank you for any help you can provide.</p>","459831","","141661","","2010-09-27 18:57:36","2010-09-27 19:23:27","How to create findViewById parm dynamically or programmatically at runtime","<android>","2","4","","",""
"3806849","1","3807016","","2010-09-27 18:53:26","2","767","<p>What is the best way to set an long-term alert/reminder from an Android application? I'd like to display notification in a few weeks after current date. I believe there is no need to write a service for such task. Will AlarmManager do the trick? Or should application be started daily and performing check?</p><p>After countdown was started, upcoming alert should survive upgrading application from Android Market.</p>","7162","","","","","2010-09-27 19:14:39","Android - how to raise an alert after a long time (a month or more)","<android><notifications><alert><alarm><alarmmanager>","1","0","","",""
"3807120","1","3807608","","2010-09-27 19:27:42","2","3316","<p>I am using a <code>translate</code> animation:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;translate    android:fromXDelta=""-75%p""    android:toXDelta=""0%p""    android:duration=""1000"" /&gt;&lt;/set&gt;</code></pre><p>on a basic <code>ImageView</code>.  This animation will slide the image out from the left until it reaches the right edge of the screen.  I have an <code>OnClickListener</code> set on the <code>ImageView</code> which toggles it from sliding out and in - works great.</p><p>Problem: It seems that the <code>ImageView</code> is not <em>actually</em> moving it's coordinates, but it just <em>looks</em> like it's moving.  When the <code>ImageView</code> is only partly visible(waiting to be animated out into the screen), if I click on an area where the <code>ImageView</code> would be if it were slid out, the animation starts(<code>OnClickListener</code> is fired off).</p><p>I wasn't clicking on the <code>ImageView</code>!</p><p>Question:So, components with an animation such as this do not actually move?How can I handle this onClick event, as it would be unexpected for an animation to occur when pressing on the screen where the <code>ImageView</code> is not visible to the user?</p>","416412","","","","","2012-03-11 12:10:23","Animations: How should I translate an ImageView out of/into visibility on the screen","<android><animation>","2","0","","",""
"3807140","1","","","2010-09-27 19:31:00","0","398","<p>I would like to do something like the android market when you view screen shots.</p><p>I have a list view and when they click on any one it takes them to a separate view where they can open several images related to the item then picked.</p><p>Is there a way to do this and if so how?  Sample code would be greatly appreciated!</p>","445342","","445342","","2010-09-28 00:25:16","2011-12-13 23:14:38","Android Market Image View","<android><image><list><view><screenshots>","1","2","","",""
"3807208","1","","","2010-09-27 19:38:55","2","477","<p>Reading the documentation: <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a>. I judged that Droid X is a large screen phone, since it's physical dimension is 4.3"". But reading/exploring further I'm realizing that <strong>large</strong> modifier has little to do with screen size. </p><p>As there's quoted in documentation:</p><blockquote>  <p>Note that the density and the screen size are independent parameters and are interpreted by the system individually. For example, WVGA high density is considered a normal screen because its physical size is about the same as one of T-Mobile G1. On the other hand, a WVGA medium density screen is considered a large screen — it offers the same resolution but at lower pixel density, meaning that it is both physically larger than the baseline screen and can display significantly more information than a normal screen size.</p></blockquote><p>I'm confused, can anyone clarify.</p><p>Thanks.</p>","109603","","","","","2010-10-19 22:38:50","Droid X is large screen?","<android><portability>","3","0","0","",""
"3807245","1","3807387","","2010-09-27 19:44:46","0","723","<p>In my layout.xml file, is it possible to set text with style?e.g. <b>this is bold</b> This is default</p><p>Can I do that?</p>","141673","","","","","2010-09-27 20:04:46","Is it possible to set text in a TextView with format","<android>","2","0","","",""
"3807282","1","3807389","","2010-09-27 19:51:04","1","2137","<p>Some guys gave me the idea to add donate button in  mobile apps instead  of adding ads.I search in google, but i couldn't find useful information. It seems that this is impossible for iPhone. There isn't information for BB and i found one discussion for Android. Do you have experience with such implementation? Is it possible? I have an idea to add link to web page(simplified for web) where i will place paypal donate button. What you think about this idea?</p>","446132","","","","","2010-09-28 18:04:00","Is it possible to add donate button in mobile application (iOS,BB,Android)?","<iphone><android><blackberry>","4","1","","",""
"3807671","1","3807906","","2010-09-27 20:39:41","5","3118","<p>I am trying to write an android app for root users that runs a series of shell commands, or a shell script if that is preferable, and displays the output... can anyone point me in the right direction?</p>","459921","","","","","2012-11-28 00:27:42","How do you run a shell script inside of an Android app?","<android>","1","0","6","",""
"3807677","1","","","2010-09-27 20:40:52","0","603","<p>When I try to open a dialog in a worker thread, thedialog opens and then the whole application crashes.It is an android app.</p><p>I get the following <a href=""http://www.megaupload.com/?d=AY3K8XSJ"" rel=""nofollow"">error</a> (i cant post the imagebecause i have less then 10 points :(()</p><p>Any help will be appreciated :)</p><p>Best Regards</p>","173738","","","","","2012-11-13 04:43:12","Open dialog in worker thread","<java><android><memory>","3","2","","",""
"3807686","1","5387569","","2010-09-27 20:42:06","2","206","<p>I've being trying this all night through.    Is there any good solution to do this? Having a sample code is better!</p>","218275","","","","","2011-03-22 06:20:11","How to view a big picture by dragging on Android? Just like we do on Google Maps","<android><imageview>","1","2","1","",""
"3807830","1","","","2010-09-27 21:00:47","0","930","<p>I'm having trouble changing the data held within a TextView inside of a listView.I can access the data and send a toast of the text, but the list isn't updated whenI change it.</p><pre><code> public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, presidents));    ListView lv = getListView();    lv.setTextFilterEnabled(true);    ListAdapter list_adapter = lv.getAdapter();    TextView var_x = (TextView) list_adapter.getView(0,null,null);    ListView list = getListView();    int count = list.getChildCount();    Toast.makeText(getApplicationContext(),(var_x).getText(),Toast.LENGTH_SHORT).show();    var_x.setText(""not a president"");}</code></pre><p>How can I change the text/styling of a row once I've already created it?</p><p>Thanks for any help</p>","459935","","","","","2010-09-28 14:11:55","Accessing rows in a ListView","<android>","3","0","","",""
"3808068","1","","","2010-09-27 21:32:55","1","196","<p>I am trying to embed an xml layout resource onto a custom view created in code.</p><p>So for instance I have an xml file called about.xml</p><p>i was trying the inflate method, but i am getting a NULL POINTER EXCEPTION CALL and kills my app.</p><p>in my onCreate method, i am calling </p><pre><code>    linearOut = new LinearLayout(this);    linear = new LinearLayout(this);    linear.setOrientation(LinearLayout.VERTICAL);               scroll = new ScrollView(this);    linearOut.addView(scroll);    scroll.addView(linear);    text=new TextView(this);    text.setHeight(250);    text.setWidth(320);    text.setBackgroundColor(Color.argb(255,255,255,255));    text.setTextColor(-16777216); // BLACK    text.setText(""Lorem ipsum dolor sit amet, consectetur adipiscing elit. "" +            ""Nulla eu magna lorem, at posuere elit. Cum sociis natoque "" +            ""penatibus et magnis dis parturient montes, nascetur ridiculus "" +            ""mus. Donec accumsan, tortor dictum sodales euismod, erat felis "" +            ""molestie dui, tincidunt sagittis diam est quis quam. Maecenas "" +            ""pulvinar risus at turpis vestibulum vitae interdum ante facilisis. "" +            ""Duis sed justo sodales elit consequat varius pharetra vel purus. "" +            ""Phasellus sem ipsum, placerat a cursus a, pellentesque eu turpis. "" +            ""In posuere fermentum dui, quis sagittis tortor congue sed. "" +            ""Vestibulum accumsan purus et nulla aliquet tristique. "" +            ""arcu ac suscipit ullamcorper, ipsum nunc congue massa."");    // lets add more Object View    View itemView = inflater.inflate(R.layout.about, linear); // this is the layout    linear.addView(itemView);    linear.addView(text);    setContentView(linearOut);</code></pre><p>Stack Trace:</p><pre><code>   09-27 14:23:53.947: ERROR/AndroidRuntime(1672): FATAL EXCEPTION: main   09-27 14:23:53.947: ERROR/AndroidRuntime(1672): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.adunit.android/com.adunit.android.BannerIDs}: java.lang.NullPointerException   09-27 14:23:53.947: ERROR/AndroidRuntime(1672):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)   09-27 14:23:53.947: ERROR/AndroidRuntime(1672):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)   09-27 14:23:53.947: ERROR/AndroidRuntime(1672):     at </code></pre><p>I know i am doing this all wrong, but is there a way by example can fix my problem.</p><p>Thanks again in advance </p><ul><li>Rob</li></ul>","423305","","423305","","2010-09-27 21:56:32","2010-09-27 21:56:32","Android Layout Resources Question","<android><android-layout>","0","7","","",""
"3808167","1","3810062","","2010-09-27 21:47:25","24","67611","<p>I'm trying to install a platform but when I open Android Manager then I click Available Software then select the<a href=""https://dl-ssl.google.com/android/repository/repository.xml"">https://dl-ssl.google.com/android/repository/repository.xml</a> repository</p><p>I get this error:</p><blockquote>  <p>Failed to fetch URL <a href=""https://dl-ssl.google.com/android/repository/repository.xml"">https://dl-ssl.google.com/android/repository/repository.xml</a></p></blockquote><p>I have also tried downloading by clicking on force ""http:"" for all ""https:"" downloads on settings panel but it still doesn't help.</p><p>I'm working on Windows Vista.</p>","172543","","811","","2011-09-22 22:08:40","2013-11-27 11:03:32","Android SDK Manager gives ""Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml"" error when selecting repository","<android><android-sdk-2.2><avd>","14","4","3","",""
"3808175","1","3809644","","2010-09-27 21:48:42","1","2732","<p>I have a ListView. When I click on a ListItem, I set the background of the ListItem (it's view) to another color:</p><pre><code>  listView.setOnItemClickListener(new OnItemClickListener() {                @Override                public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                    setupDetailView(position);                    setupChartView(position);                    setupARView(position);                    emptyView.setVisibility(View.INVISIBLE);                    quotesAdapter.isSelected = true;                    //v.setBackgroundResource(R.drawable.stocks_selector);                }            });</code></pre><p>here is my adapter:</p><pre><code>private class QuoteAdapter extends ArrayAdapter&lt;Quote&gt; {        private ArrayList&lt;Quote&gt; items;        public boolean isSelected = false;        public QuoteAdapter(Context context, int textViewResourceId, ArrayList&lt;Quote&gt; items) {            super(context, textViewResourceId, items);            this.items = items;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.mainrow, null);                if(isSelected)                    v.setBackgroundResource(R.drawable.red);                else                    v.setBackgroundResource(R.drawable.transparent_background);            }</code></pre><p>The problem is, if I select multiple rows, then multiple rows have a colored background. I only want the clicked item to have a colored background. So if I click on row 2, I want it to turn red, then if I click row 1, I want row 2 to go back to normal, and row 1 to turn red. </p><p>How can I do this?</p>","19875","","19875","","2010-09-27 22:59:02","2010-09-28 04:17:21","ListView selector problem: Selection does not get removed","<android><listview><selector><listviewitem>","2","0","","",""
"3808197","1","3819483","","2010-09-27 21:53:54","1","2097","<p>What is the best way to deal with web services in Android? I have been looking at KSoap2 library and RESTful web services.</p><p>I got one working with KSoap2, but only when the web service is on a remote server, not on localhost. I have tried to redirect the ports for incoming and outgoing as it says on the android dev site, i have used the ip of the network i am on, my own ip and the localhost-ip (it says on the site that one cannot use localhost cause that is the emulators own loop-back network. None works. </p><p>With RESTful webservices, i have only tried a tutorial where a google app engine is used as server if i understood it right. Is it easy to connect a RESTful web service to a database. I need to have a database connection in my applikation, which one is normally used with REST?</p><p>Sorry for the confused question, it's been many days of trying to sort just the alternatives out, and the more I look the confused I get. </p><p>THanks in advance for any help!/AK</p>","455479","","","","","2011-07-28 09:58:43","KSoap2 or RESTful web services with android","<android><web-services><rest><ksoap2><ksoap>","3","0","1","",""
"3808532","1","4322209","","2010-09-27 23:02:08","38","47868","<p>I am trying to get the WebView to have similar behavior as the android browser.  The browser opens all pages in a way that tries to fit their width to the screen.  However, the default behavior of the WebView is to start at a 100% pixel scale so it starts zoomed in on the top left corner.  </p><p>I have spent the last couple hours trying to find a way to get the WebView to scale the page to the screen like it does in the browser but I'm not having any luck.  Has anyone found a way to accomplish this?</p><p>I see is a setting called setLoadWithOverviewMode, but that didn't appear to do anything at all.  I also experimented with setInitialScale but on different screen sizes and web page sizes that won't be as graceful as the browsers scaling.</p><p>Any one have any leads?</p><p>Thanks</p><p>EDIT:  Brian's method seems to work when the phone in landscape but not in portrait.  In portrait it is close but still does not fit the whole screen in the page.  I starting this bounty with the hope there is a sure-fire way to get the initial zoom to fit the page to the width of the page in any orientation or screen size.</p>","445348","","486243","","2011-09-20 05:22:17","2013-07-12 09:04:26","How to set the initial zoom/width for a webview","<android><webview><width><scale><android-webview>","5","4","20","",""
"3808572","1","3815738","","2010-09-27 23:14:52","1","2124","<p>When executing a PostMethod with httpclient , the request is not stopped at the defined timeout.Running on the acer liquid with 3G network ,but in the emulator it works fine and it generate a SocketTimeoutException</p><pre><code>    HttpParams httpParameters = new BasicHttpParams();    // Set the timeout in milliseconds until a connection is established.    int timeoutConnection = 3000;    HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);    // Set the default socket timeout (SO_TIMEOUT)     // in milliseconds which is the timeout for waiting for data.    int timeoutSocket = 5000;    HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);DefaultHttpClient  httpclient = new DefaultHttpClient(httpParameters);</code></pre><p>help !!! many thanks befor !! all the best .</p>","401663","","","","","2010-09-28 18:06:48","HttpClient timeout not working on my phone","<android><timeout><httpclient>","0","2","","",""
"3808681","1","","","2010-09-27 23:44:20","0","312","<p>I am using the Android 2.2 platform. My problem is that when I attempt to run map application it displays grids, and also when I run the emulator and choose the map icon from the home screen, it shows the grids followed by message ""network failure"".</p>","460047","","364708","","2012-01-30 06:05:05","2012-01-30 06:05:05","map icon network failure","<android>","0","2","","",""
"3809107","1","","","2010-09-28 01:40:09","1","3232","<p>I have a ListViewItem with a custom gradient background. The default selector no longer highlights these rows anymore.</p><p>Highlight only works if I set the background to transparent. How can I get the highlight without this change?</p><p>Here is my ListView:</p><pre><code>&lt;ListView android:id=""@+id/symbolsListView""    android:layout_width=""fill_parent""    android:background=""@drawable/transparent_background""    android:layout_height=""390dp""    android:divider=""@drawable/ui_divider_line""    android:cacheColorHint=""#00000000""    android:listSelector=""@drawable/blue""    android:drawSelectorOnTop=""true""    &gt;</code></pre>","19875","","414581","","2013-08-23 06:18:53","2013-08-23 06:18:53","ListViewItem does not get highlighted if the background isn't transparent","<android><listview><listviewitem>","3","0","1","",""
"3809147","1","","","2010-09-28 01:51:27","2","2963","<p>I have an activity here. </p><p>I want to click a button and then hide the activity GUI.</p><p>That is, GUI is needed and you can hide it by clicking a ""Hide App"" button. How can i </p><p>implement this ""Hide App""? </p><p>Somebody help!  Thanks in advance!</p>","449034","","","","","2010-09-28 17:42:20","How to hide activity GUI in android 2.2","<android><gui><activity><hide>","3","1","1","",""
"3809173","1","","","2010-09-28 01:57:17","0","800","<p>I downloaded the sdk and added the library to my workspace, then the sample for market licensing.  The sample app seems to force close somewhere after/during the instantiation of LicenseChecker.  I tried running on the emulator with Google API 8 and on a droid x with froyo and it force closes.  The stack shows PerformLaunchActivity as the top item.Both emulator and phone had a registered gmail account.</p><p>Any ideas how to get this to work?</p>","460091","","","","","2010-09-28 02:27:51","How to get Android Market licensing sample to work?","<android>","1","1","1","",""
"3809361","1","","","2010-09-28 02:54:00","2","232","<p>It seems like the example they give for the licensing server uses the main activities window to display licensing.  I'm wondering what is a realworld example that uses the licensing server.  </p><p>Use their main sample activity and if it allows go right to your actual main activity?  </p><p>It seems like there should be a sample that checks access with NO UI but pops up a UI only in the case of a licensing problem.  That sounds more realworld to me.</p><p>Is there some example code that shows an example like that somewhere?</p><p>Thanks</p>","460091","","","","","2010-11-22 05:32:11","Android licensing server real use scenario?","<android>","1","0","","",""
"3809536","1","3809593","","2010-09-28 03:45:12","1","1428","<p>I'm having trouble setting up the Android SDK. I've set up Eclipse before but it didn't work, so I uninstalled it, but I'm trying again. </p><p>Does Eclipse need to be extracted to a particular folder for it to work? Where should I extract to?</p><p>Edit:</p><p>I'm using Eclipse 3.5 on Win7 Ultimate x64</p>","224988","","538613","","2012-03-12 04:28:48","2012-03-12 04:28:48","Setting Up Eclipse for Android SDK?","<android><eclipse>","3","0","","",""
"3809588","1","","","2010-09-28 03:59:36","1","11952","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1083527/how-to-block-calls-in-android"">How to block calls in android</a>  </p></blockquote><p>Can any one tell me how to reject incoming call programatically in android ?</p>","414777","","948041","","2012-06-25 09:00:41","2012-06-25 09:00:41","How to reject incoming call programatically in android?","<android><phonecalls>","1","1","7","2011-08-25 13:40:54",""
"3809689","1","","","2010-09-28 04:30:11","1","599","<p>how can we automatically turn on airplane mode when radio signal is very low in android???</p>","458084","","","","","2010-09-28 07:01:02","how can we automatically turn on airplane mode when radio signal is very low in android?","<android>","2","3","","",""
"3809697","1","3811971","","2010-09-28 04:31:45","0","348","<p>I haven't done any work with the Android or iOS platforms, but I have recently been pitched a project and I'm trying to see if it is even feasible.</p><p>Is there currently API hooks in the iOS and Android platforms for accessing / manipulating the voice / data streams?  What I would like to do is encrypt all outgoing steams and decrypt all incoming streams before they reach and other processes that need that data.</p><p>I would assume that because the Android platform is open source one should be able to do this, it just may have to be hacked together. I'm more worried about iOS.</p><p>Thank you all for sharing your knowledge of this platforms with me,</p><p>Eric</p>","127629","","","","","2010-09-28 10:54:21","Accessing the data / voice streams for the Android and iOS platforms","<iphone><android><ios><iostream>","2","1","0","",""
"3809742","1","3811925","","2010-09-28 04:45:24","8","11156","<p>I want to draw a straight vertical line in my Android activity when a button is pressed. Please explain how I can draw the line with a position &amp; length I want.</p><p><strong>Elaboration:</strong>I have a linear layout with vertical orientation. A set of buttons constitute this linear layout. When I press one button, I want a line to appear to the right of these buttons, as if dividing the screen halfway - a straight line of width=2dip and height=200dip.</p>","454660","","496830","","2011-03-25 00:31:18","2012-06-25 07:06:12","How can I draw a vertical line in an Activity when a button is pressed?","<android><line><draw>","3","2","8","",""
"3809772","1","3809781","","2010-09-28 04:51:00","3","6371","<p>I want to be able to make a TextView bold. This is how I am setting it's appearance (I need to do this in code):</p><pre><code>nameText.setTextAppearance(getApplicationContext(), R.style.BlueText);priceText.setTextAppearance(getApplicationContext(), R.style.BlueText);changeText.setTextAppearance(getApplicationContext(), R.style.BlueText);</code></pre><p>Here is my style.xml</p><pre><code>  &lt;!-- Blue Color --&gt;   &lt;style name=""BlueText""&gt;        &lt;item name=""android:textColor""&gt;#4871A8&lt;/item&gt;    &lt;/style&gt;</code></pre><p>How can I make sure my TextView is bolded?</p>","19875","","","","","2013-10-22 23:39:57","How to make a TextView bold?","<java><android><textview><bold>","2","0","1","",""
"3809866","1","3809894","","2010-09-28 05:15:44","5","23619","<p>I'm setting up Eclipse for Android and when attempting to install the ADT plugin, I encounter the following error:</p><p><strong>Edit:</strong> Notice the more complete error message here.</p><blockquote>  <p>Cannot complete the install because one or more required items could not be found.    Software being installed: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953)    Missing requirement: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953) requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found</p></blockquote><p>I'm on Win7 x64 and using Eclipse 3.5.</p><p>What could be wrong? </p><p>EDIT:</p><p>Did I not set my Path correctly? This is what the relevant part looks like.</p><blockquote>  <p>Path...;C:\Users\Moshe\Development\android-sdk-windows\tools</p></blockquote><p>Do I need to reboot after modifying the path?</p><p><strong>EDIT:</strong></p><p>I am looking to install this package:</p><blockquote>  <p>org.eclipse.wst.sse.core 0.0.0</p></blockquote>","224988","","644450","","2012-01-03 07:44:55","2013-04-15 07:54:21","How do I set up Android (ADT-Plugin) for Eclipse?","<android><eclipse><adt>","10","2","1","",""
"3809884","1","3813779","","2010-09-28 05:20:53","1","1126","<p>I've written an OBJ loader which parses the vertices, texture coords, and normals, each are stored in a FloatBuffer, and passed to opengl:</p><pre><code>gl.glVertexPointer(3, GL10.GL_FLOAT, 0, fbVertices);gl.glNormalPointer(GL10.GL_FLOAT, 0, fbNormals);</code></pre><p>However I am stumped as to how i am supposed to pass my index buffer to glDrawElements, I've read that the index will refer to the index in the array for the vertices, texture, and normals, but upon reading the OBJ file description, it seems that faces are stored in a format such as this:</p><pre><code>f 1/2/3 4/5/6 7/8/9</code></pre><p>with the format being</p><pre><code>vertice/texture/normal</code></pre><p>glDrawElements only accepts 1 index, which should refer to all 3, but when i look at an actual OBJ file, this doesn't seem possible. How do you pass the index for all 3?</p><p>You can find a copy of the code here:<a href=""http://codepad.org/melc1HIC"" rel=""nofollow"">http://codepad.org/melc1HIC</a></p>","455537","","44729","","2010-09-28 18:41:17","2012-01-08 12:39:09","How would you pass an OBJ files face definitions to openGL","<java><android><eclipse><opengl-es><blender>","2","0","","",""
"3810077","1","","","2010-09-28 06:00:29","0","356","<p>how do i get access to the audio recorded by the microphone before it is accessed by the other applications.</p>","451965","","","","","2010-09-28 10:53:06","modify the audio recorded with microphone","<android><audio>","1","0","","",""
"3810122","1","","","2010-09-28 06:10:57","2","650","<p><br>I would like to design a layout for my android app which has imageviews/Textviews placed as shown in the figure below. <img src=""http://i.stack.imgur.com/2rylN.png"" alt=""alt text""><br>Right now, i tried to use Absolute layout, but i know that will create problems as the screen size changes.<br>Please help me with your ideas.<br>All comments are welcomed.  </p><p>Thanks &amp; Regards,<br>Sen</p>","449378","","","","","2010-09-28 07:50:19","How to create this layout?","<android>","2","2","1","",""
"3810156","1","","","2010-09-28 06:18:28","3","1128","<p>How to decode the .apk files, I followed <a href=""http://dedexer.sourceforge.net/"" rel=""nofollow"">http://dedexer.sourceforge.net/</a>    but ddx.jar didnot produce any output file.</p>","460238","","","","","2013-02-27 21:26:36","Decompiling of .apk files","<android>","2","1","","",""
"3810284","1","","","2010-09-28 06:41:33","1","1309","<p>I have a requirement for an app, in android, which requires 2 images to be populated one above another.</p><p>This image has to be rotated, based on the Compass sensors.I am rotating the image,using matrix, and creating the new bitmap, and setting thebitmap on Imageview.</p><p>I am repeating the same, for 2 images.But as a result, i am getting a delay, can this be avoided, is there any other way.</p><p>If i am using canvas, can i use multiple images, out of which i want only 2 images to be rotated, is it possible??</p>","419685","","","","","2012-03-27 11:44:39","Multiple image rotation in canvas","<android>","1","0","1","",""
"3810372","1","","","2010-09-28 06:55:42","0","1469","<p>Hi friends      I am using ksoap2 in android can anybody tell how to pass parameter value to webservice in android</p><p>Thanks</p>","426344","","","","","2011-03-03 04:12:22","How to pass parameter value to webservice in android","<android>","1","0","","",""
"3810403","1","3810424","","2010-09-28 07:02:46","0","130","<p>I got an error <code>error: Error parsing XML: unbound prefix</code> when i did not add an attribute <code>xmlns:android=""http://schemas.android.com/apk/res/android""</code> for my Layout. <strong>Why we want to set this attribute for a layout?Any Specific Reasons?</strong> what i put the <a href=""http://schemas.android.com/apk/res/android"" rel=""nofollow"">url mentioned</a> as a value for <code>xmlns:android</code>. I got the server not found Exception. Please Share your knowledge about this?</p>","267269","","267269","","2010-09-28 09:10:16","2010-09-28 09:13:49","Layout in Android?","<android><layout><android-layout>","2","0","","",""
"3810432","1","","","2010-09-28 07:08:44","0","191","<p>I am trying to make List View but i get following error can any one tell me the what wrong with my code.</p><p>so please help me.</p><p>09-28 10:52:28.918: ERROR/AndroidRuntime(383): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'09-28 10:52:28.918: ERROR/AndroidRuntime(383):     at android.app.ListActivity.onContentChanged(ListActivity.java:245)09-28 10:52:28.918: ERROR/AndroidRuntime(383):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:201)09-28 10:52:28.918: ERROR/AndroidRuntime(383):     at android.app.Activity.setContentView(Activity.java:1647)09-28 10:52:28.918: ERROR/AndroidRuntime(383):     at com.unundoinc.FaceBook.Activity.NewsFeedActivity.onCreate(NewsFeedActivity.java:51)09-28 10:52:28.918: ERROR/AndroidRuntime(383):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-28 10:52:28.918: ERROR/AndroidRuntime(383):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)</p><p><em><strong></em>**<em>*</em>**</strong><em>THIS IS MY XML FILE WHICH CONTAIN LIST VIEW <strong></em>**<em>*</em>**<em>*</em>*</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/newsfeedactivity"" android:orientation=""horizontal""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;ListView android:id=""@+id/list"" android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;    &lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><hr><p><em><strong></em>**<em>*</em>**<em>*</em>***</strong><em>THIS IS MY .JAVA FILE <strong></em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em></strong></p><pre><code>public class NewsFeedActivity extends ListActivity{       public ArrayList&lt;UserDetail&gt; mData ;    private ListView feedbookListView;    OAuth oauth = new OAuth();      public static final String TAG = ""NewsFeedActivity"";    public static final String FaceBookURL = ""http://graph.facebook.com/"";    private ListAdapter objListAdapter;    private TextView textMessage = null;    private ImageView backThumbnail = null;    private ImageView urlThumbnail = null;    private String access_token = """";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstance)     {        super.onCreate(savedInstance);        access_token = getIntent().getExtras().getString(""ACCESS_TOKEN"");        setContentView(R.layout.newsfeedactivity);        // Setting Context of the ThumbnailManager        ThumbnailManager.context = this;        feedbookListView = (ListView) findViewById(R.id.list);        textMessage = (TextView)findViewById(R.id.facebook_text);        mData = new ArrayList&lt;UserDetail&gt;();        this.objListAdapter = new ListAdapter(this, R.layout.newsfeedactivitycell, mData);        setListAdapter(objListAdapter);        onComplete();    }    //////////////////////////////////////////////////////////////////////////////      public void onComplete()     {               Bundle parameters = new Bundle();        String response = null;        /*Inserts a String value into the mapping of this Bundle,             replacing any existing value for the given key. Either key or value may be null.         */        parameters.putString(""access_token"", access_token);        //parameters.putString(""method"", ""platform/posts"");        Log.v(TAG, ""PARAMETERS  :: ""+parameters);        try        {            response = oauth.request( ""platform/posts"" , parameters);              android.util.Log.v(TAG, ""RESPONSE :: "" + response );        }        catch (MalformedURLException e)        {            // TODO Auto-generated catch block            e.printStackTrace();        }        catch (IOException e)        {            // TODO Auto-generated catch block            e.printStackTrace();        }        /**         * To parse the FeedBook using JSON parsing         */        try         {            JSONObject temp = new JSONObject(response);            JSONArray arrayOfJsonObjs = temp.getJSONArray(""data"");            Log.v(TAG, ""ARRAY SIZE :: "" + arrayOfJsonObjs.length());            UserDetail objUserDetail = new UserDetail();            for(int i = 0; i&lt; arrayOfJsonObjs.length(); i++)            {                try                 {                    JSONObject objFromArr = arrayOfJsonObjs.getJSONObject(i);                    JSONObject objFromObj = objFromArr.getJSONObject(""from"");                    if(objFromObj.has(""id"") == true)                    {                        objUserDetail.setUserId(objFromObj.getString(""id""));                    }                    else                    {                        objUserDetail.setUserId("""");                    }                    if(objFromObj.has(""name"") == true)                    {                        objUserDetail.setUserName(objFromObj.getString(""name""));                    }                    else                    {                        objUserDetail.setUserName("""");                    }                    if(objFromArr.has(""picture"") == true)                    {                        objUserDetail.setUserStatusImage(objFromArr.getString(""picture""));                    }                    else                    {                        objUserDetail.setUserStatusImage("""");                    }                    if(objFromArr.has(""caption"") == true)                    {                        objUserDetail.setUserStatus(objFromArr.getString(""caption""));                    }                    else                    {                        objUserDetail.setUserStatus("""");                    }                    objUserDetail.setUserProfileImageUrl                    (FaceBookURL+                            objUserDetail.getUserId()+                            ""/picture""                    );                    Log.v                    (                            TAG,                            //"" Array Of Json Objects : ["" + i+""] is::"" + arrayOfJsonObjs.getJSONObject(i)                            //""ICON URL [""+i+""] is ::""+objFromArr.getString(""icon"")                            ""OBJECT [""+i+""]""+ ""\n""+                            ""Picture URL is ::""+objUserDetail.getUserStatusImage() + ""\n""+                            ""This is your id  :: ""+objUserDetail.getUserId()+ ""\n""+                            ""This is your name ::""+objUserDetail.getUserName()+ ""\n""+                            ""This is Status Message ::""+objUserDetail.getUserStatus()+ ""\n""+                            ""Profile picture image URL is ::""+objUserDetail.getUserProfileImageUrl()                    );                }                catch (JSONException e)                 {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }        }        catch (JSONException e)         {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    ////////////////////////////////////////////////////////////////////////////    public class ListAdapter extends ArrayAdapter&lt;UserDetail&gt;    {        LayoutInflater inflater;        private ThumbnailManager objThumbnailManager = new ThumbnailManager();        private ArrayList&lt;UserDetail&gt; items;        //private Bitmap back =  null;        //private Bitmap type = null;        public ListAdapter(Activity context, int textViewResourceId,ArrayList&lt;UserDetail&gt; items)         {            super(context, textViewResourceId, items);              this.items = items;        }        @Override        public View getView(int position, View convertView, ViewGroup parent)         {                       //View row = inflater.inflate(R.layout.newsfeedactivitycell, null);            View objView= convertView;            if (objView == null)             {                LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                objView = vi.inflate(R.layout.newsfeedactivitycell, null);            }            UserDetail objUserDetail = items.get(position);            if (objUserDetail != null)             {                textMessage = (TextView)findViewById(R.id.facebook_text);                if(textMessage != null)                {                    textMessage.setText(""StatusMessage: ""+ objUserDetail.getUserStatus());                }            }            return objView;             //          textMessage = (TextView) row.findViewById(R.id.facebook_text);  //id                        //          //backThumbnail = (ImageView) row.findViewById(R.id.facebook_thumbnail);    //drawable            //          textMessage.setText(objListAdapter.getItem(position).getUserStatus());                  }           }   }</code></pre>","343678","","368003","","2010-09-28 07:23:44","2010-09-28 10:53:31","ListView using Layout Infleter in android","<android>","1","0","","",""
"3810480","1","","","2010-09-28 07:17:35","1","919","<p>I'm trying to create a custom preference for an Android application that limits the number of items the user can select. Once the limit is reached the unselected items should be disabled and only the currently selected items are enabled.. If there are less items selected than the limit all items should be enabled.</p><p>Here are the two classes I've cobbled together. The code runs fine but no the CheckedTextView is not checked. As a result no state is maintained.</p><p>First the view class...</p><pre><code>import android.content.Context;import android.os.Bundle;import android.os.Parcelable;import android.util.AttributeSet;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.CheckedTextView;import android.widget.ListView;public class LimitedMultiChoiceView extends ListView     implements AdapterView.OnItemClickListener{    private static final String SEPARATOR = ""OV=I=XseparatorX=I=VO"";    private static final String LIMITEDSELECTION=""limitedSelection"";    private static final String SUPERSTATE=""superState"";    private String mSelection = """";    public LimitedMultiChoiceView(Context context, CharSequence[] items, int limit)    {        this(context, null, 0, items, limit);    }       // LimitedMultiChoiceView(Context context)    public LimitedMultiChoiceView(Context context, AttributeSet attrs, CharSequence[] items, int limit)    {        this(context, attrs, 0, items, limit);    }       // LimitedMultiChoiceView(Context context, AttributeSet attrs)    public LimitedMultiChoiceView(Context context, AttributeSet attrs            , int defStyle, CharSequence[] items, int limit)     {        super(context, attrs, defStyle);        setAdapter(new ItemAdapter(context, android.R.layout.simple_list_item_multiple_choice, items, limit));    }       // LimitedMultiChoiceView(Context context, AttributeSet attrs, int defStyle)    public String getSelection()    {        return mSelection;    }       // String getSelection()    public void onItemClick(AdapterView&lt;?&gt; parent, View child, int position, long id)     {        // For now we don't need anything...        // we think the ItemAdapter manages what we need for each item.    }       // void onItemClick(AdapterView&lt;?&gt; parent, View child, int position, long id)     @Override    public void onRestoreInstanceState(Parcelable toParce)     {      Bundle state=(Bundle)toParce;      super.onRestoreInstanceState(state.getParcelable(SUPERSTATE));      mSelection = state.getString(LIMITEDSELECTION);    }       // void onRestoreInstanceState(Parcelable toParce)     @Override    public Parcelable onSaveInstanceState()     {      Bundle state=new Bundle();      state.putParcelable(SUPERSTATE, super.onSaveInstanceState());      state.putString(LIMITEDSELECTION, mSelection);      return(state);    }       // Parcelable onSaveInstanceState()     public void setSelection(String value)    {        mSelection = value;    }       // void setSelection(String value)    class ItemAdapter extends ArrayAdapter&lt;CharSequence&gt;     {        CharSequence[] mItems = null;        int mLimit = 1;        public ItemAdapter(Context context, int viewResId, CharSequence[] items, int limit)         {            super(context, viewResId, items);            mItems = items;            mLimit = limit;        }       // ItemAdapter(Context context, int viewResId, CharSequence[] strings, int limit)         public boolean areAllItemsEnabled()         {            // Since we are in a limited selection list not all items can be            // selected so this always returns false, there is no calculating            // to do.            return false;        }       // boolean areAllItemsEnabled()         public boolean isEnabled(int position)         {            boolean[] clickedIndexes = new boolean[this.getCount()];            boolean result = false;            int selectedCount = 0;            mSelection = """";            for (int item=0; item &lt; clickedIndexes.length; item++ )            {                View itemView = this.getView(item, null, LimitedMultiChoiceView.this);                if (itemView instanceof CheckedTextView)                {                    CheckedTextView check = (CheckedTextView)itemView;                    // First we turn the check mark on or off...                    if (item == position)                    {                        check.setChecked(!check.isChecked());                    }       // (item == position)                    // Now we count how many are checked and mark our tracking array                    if (check.isChecked())                    {                        clickedIndexes[item] = true;                        mSelection += check.getText() + SEPARATOR;                    }                    else                    {                        clickedIndexes[item] = false;                    }       // (check.isChecked())                }       // (itemView instanceof CheckedTextView)                if (clickedIndexes[item])                    selectedCount++;            }       // (int item=0; item&lt; clickedIndexes.length; item++ )            if (selectedCount &gt;= mLimit)            {                if (clickedIndexes[position])                {                    result = true;                }                else                {                    result = false;                }       // (clickedIndexes[position])            }            else            {                result = true;            }       // (selectedCount &gt;= mLimit)            return result;        }       // boolean isEnabled(int position)     }       // class ItemAdapter extends ArrayAdapter&lt;CharSequence&gt;}       // class LimitedMultiChoiceView extends ListView </code></pre><p>This is the preference class...</p><pre><code>import android.content.Context;import android.preference.ListPreference;import android.util.AttributeSet;import android.view.View;public class ListPreferenceLimitedMultiSelect extends ListPreference{    int mLimit = 3;    LimitedMultiChoiceView mList = null;    String mSelection = """";    public ListPreferenceLimitedMultiSelect(Context context)     {        this(context, null);    }       // ListPreferenceLimitedMultiSelect(Context context)    public ListPreferenceLimitedMultiSelect(Context context, AttributeSet attr)    {        super(context, attr);    }       // ListPreferenceLimitedMultiSelect(Context context, AttributeSet attr)      @Override     protected void onBindDialogView(View v)      {        super.onBindDialogView(v);        mList.setSelection(mSelection);     }      // void onBindDialogView(View v)     @Override    protected View onCreateDialogView()     {        mList = new LimitedMultiChoiceView(getContext()                , this.getEntries(), mLimit);        return(mList);    }       // View onCreateDialogView()    @Override    protected void onDialogClosed(boolean positiveResult)     {        super.onDialogClosed(positiveResult);        if (positiveResult)         {            if (callChangeListener(mList.getSelection()))             {                mSelection = mList.getSelection();                persistString(mSelection);            }       // (callChangeListener(mList.getSelection()))         }       // (positiveResult)     }       // void onDialogClosed(boolean positiveResult)     @Override    protected void onSetInitialValue(boolean restoreValue, Object defaultValue)     {        mSelection =(restoreValue ? getPersistedString(mSelection) : (String)"""");    }       // void onSetInitialValue(boolean restoreValue, Object defaultValue) }       // class ListPreferenceLimitedMultiSelect extends ListPreference</code></pre><p>Thanks,</p><p>\ ^ / i l l </p>","214020","","","","","2010-09-28 07:17:35","Android Limited Multi Select Preference, why no checkmark?","<java><android><listview><android-preferences>","0","2","","",""
"3810491","1","","","2010-09-28 07:19:47","0","210","<p>I have been trying to add a map to my application, I have followed instructions on the android developers HelloGoogleMaps tutorial but my map is just force closing when I run the maps option.  I have obtained my api key logged permissions in manifest (Internet, Maps) and logged intent.  When I look at the debugger the intent line always shows up but I have put in  test code and the intent is fine but it seems to be saying it cannot locate the class;  </p><p>09-28 07:09:13.960: DEBUG/dalvikvm(308): VFY: replacing opcode 0x1c at 0x0013</p><p>09-28 07:09:14.000: DEBUG/dalvikvm(308): VFY: dead code 0x0015-001b in Lcom/ff/org/ll2;.onListItemClick (Landroid/widget/ListView;Landroid/view/View;IJ)V</p><p>09-28 07:09:29.240: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.ff.org/.Bradford }</p><p>09-28 07:09:29.350: WARN/dalvikvm(308): Unable to resolve superclass of Lcom/ff/org/Locate; (67)</p><p>09-28 07:09:29.350: WARN/dalvikvm(308): Link of class 'Lcom/ff/org/Locate;' failed</p><p>09-28 07:09:29.350: ERROR/dalvikvm(308): Could not find class 'com.ff.org.Locate', referenced from method com.ff.org.Bradford.onListItemClick</p><p>09-28 07:09:29.350: WARN/dalvikvm(308): VFY: unable to resolve const-class 37 (Lcom/ff/org/Locate;) in Lcom/ff/org/Bradford;</p><p>09-28 07:09:29.360: DEBUG/dalvikvm(308): VFY: replacing opcode 0x1c at 0x0012</p><p>09-28 07:09:29.360: DEBUG/dalvikvm(308): VFY: dead code 0x0014-001a in Lcom/ff/org/Bradford;.onListItemClick (Landroid/widget/ListView;Landroid/view/View;IJ)V</p><p>09-28 07:09:29.990: INFO/ActivityManager(59): Displayed activity com.ff.org/.Bradford: 674 ms (total 674 ms)</p><p>The applicatiuon code is <a href=""http://stackoverflow.com/questions/3807522/maps-force-closing"">here:</a></p>","445174","","","","","2010-09-28 10:02:30","Google Maps Force closing","<java><android><eclipse>","1","0","","",""
"3810523","1","","","2010-09-28 07:24:57","2","1266","<p>I have an Application (Operator Widget) which Displays the Name of the Network you are currently Connected to. </p><p>The Problem is that some Providers either share their Network with others (eg. T-Mobile UK uses 3's Network in some areas) or don't have an own Network and use the one of another Provider (eg. ""bob"" uses the Network of ""A1"").</p><p>The Problem is that the getNetworkOperatorName() always returns the Name of the Wireless Network (so T-Mobile Users will see 3 as their network...) which confuses Users.Android itself on the Other hand shows the Service Providers name, what is the Function to do this? </p>","459936","","","","","2012-01-16 11:59:20","How to get Service Provider, not the Network Name","<android>","1","0","","",""
"3810641","1","3841192","","2010-09-28 07:42:23","0","2215","<p>I am new to android.I am working on voice recognition.I got a sample program</p><h2>main.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextView  android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:text=""@string/hello""/&gt;&lt;Button android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:text=""Speak""android:id=""@+id/speakButton""/&gt;&lt;ListViewandroid:id=""@+id/list""android:layout_width=""fill_parent""android:layout_height=""fill_parent""/&gt;      &lt;/LinearLayout&gt;</code></pre><h2>VoiceRec:</h2><pre><code>public class VoiceRec extends Activity implements OnClickListener {private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;private ListView mList;/** * Called with the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Inflate our UI from its XML layout description.    setContentView(R.layout.main);    // Get display items for later interaction    Button speakButton = (Button) findViewById(R.id.speakButton);    mList = (ListView) findViewById(R.id.list);    // Check to see if a recognition activity is present    PackageManager pm = getPackageManager();    List&lt;ResolveInfo&gt; activities = pm.queryIntentActivities(            new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);    if (activities.size() != 0) {        speakButton.setOnClickListener(this);    } else {        speakButton.setEnabled(false);        speakButton.setText(""Recognizer not present"");    }}/** * Handle the click on the start recognition button. */public void onClick(View v) {    if (v.getId() == R.id.speakButton) {        startVoiceRecognitionActivity();    }}/** * Fire an intent to start the speech recognition activity. */private void startVoiceRecognitionActivity() {    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,            RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);    intent.putExtra(RecognizerIntent.EXTRA_PROMPT, ""Speech recognition demo"");    startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);}/** * Handle the results from the recognition activity. */@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {        // Fill the list view with the strings the recognizer thought it could have heard        ArrayList&lt;String&gt; matches = data.getStringArrayListExtra(                RecognizerIntent.EXTRA_RESULTS);        mList.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,                matches));    }    super.onActivityResult(requestCode, resultCode, data);}}</code></pre><p>I got the output like</p><p><img src=""http://i.stack.imgur.com/do1Ci.png"" alt=""alt text""></p><p>Please help out where i went wrong.....</p>","366916","","109302","","2011-12-20 15:50:36","2013-05-11 12:45:27","Android-Voice recognition","<android>","2","0","","",""
"3810710","1","8896069","","2010-09-28 07:52:24","4","4292","<p>I list out files in '/' by:</p><pre><code>File directory = new File(""/"");fill_listview(directory.listFiles());</code></pre><p>And I get those in list:</p><pre><code>sqlite_stmt_journalsconfigcachesdcarddetcsystemsyssbinprocinit.rcinit.goldfish.rcinitdefault.propdatarootdev</code></pre><p>I have two questions:</p><p>1.Why cann't I access '/data' folder just like Eclipse DDMS file explorer?</p><p>2.Why it is different from the DDMS which show only:</p><pre><code>datasdcardsystem</code></pre><p>Thanks!</p>","354459","","3098","","2011-03-08 06:26:24","2012-01-17 14:14:17","Why can't 'data' folder be displayed just like in DDMS file explorer? ","<android><eclipse><file><ddms>","2","0","4","",""
"3810854","1","3811115","","2010-09-28 08:13:57","2","5230","<p>I'm a newbie in Java so I'm not sure if this is possible. Basically I need to de-serialise a file into an object of a given type. Basically the method will do this:</p><pre><code>FileInputStream fis = new FileInputStream(filename);    ObjectInputStream in = new ObjectInputStream(fis);    MyClass newObject = (MyClass)in.readObject();    in.close();    return newObject;</code></pre><p>I would like this method to be generic, therefore I can tell it what type I want to <code>in.readObject()</code> to cast its output into, and return it.</p><p>Hope this makes sense...then again, I probably didn't understand generics properly and this is not actually possible, or advisable.</p><p>Thanks,D.</p>","150061","","","","","2010-09-28 08:56:22","Using generics in Android Java code","<java><android><generics><serialization>","2","2","2","",""
"3810882","1","5334945","","2010-09-28 08:18:29","0","868","<p>The buttons in my layout are not getting pressed on Enter key. When I click on them using mouse, the code inside onClick() is getting executed. But when I press the Enter key, onClick() is not getting called.</p><p>I know that for keys, I must be using onKeyListener instead. However, does onClick() not work for both mouse click and keyboard 'Enter'? Also, the up and down navigation using arrow keys are working just fine, it is only ""Enter"" key that is not working!</p><p>In my app, I am using nested linear layouts, a theme(button styling), a selector and an anonymous implementation of OnFocusChangeListener. Also, I am using an emulator with  specified aspect ratio. Could any of this be attributed to this issue? </p><p>Any help would be much appreciated!</p><p>-Kiki</p>","454660","","","","","2011-03-18 06:29:55","Is pressing Enter key on the keyboard not equivalent to a mouse click in Android?","<android><onclick><keyboard-events>","1","0","2","",""
"3811005","1","3978131","","2010-09-28 08:37:52","1","1346","<p>I have a view and I want to add a chronometer onto it. Then, on draw I want to display the current time. Here is how I did:</p><pre><code>    public class MyView extends View {    private Chronometer chrono;    private long elapsedTime=0;    private String currentTime=""00:00:00"";    public MyView(Context context) {    super(context);    // TODO Auto-generated constructor stub    init(context);    }    private void init(Context ctx){    chrono= new Chronometer(ctx);    chrono.setText(""Time: 00:00:00"");    chrono.setOnChronometerTickListener(new OnChronometerTickListener()    {           public void onChronometerTick(Chronometer arg0) {             String HH =((elapsedTime / 3600) &lt; 10 ? ""0"" : """") + (elapsedTime / 3600);             String MM =((elapsedTime / 60) &lt; 10 ? ""0"" : """") + (elapsedTime / 60);              String SS =((elapsedTime % 60) &lt; 10 ? ""0"" : """") + (elapsedTime % 60);             String currentTime = HH+"":""+MM+"":""+SS;              elapsedTime = (SystemClock.elapsedRealtime() - arg0.getBase()) / 1000;             arg0.setText(currentTime);           }    }    );    }    chrono.setBase(SystemClock.elapsedRealtime());    chrono.start();}    @Override    protected void onDraw(Canvas canvas) {        canvas.drawText(currentTime, someWidth , someHeight, somePaint);    }</code></pre><p>The initial text 00:00:00 gets drawn but it doesn't change. I must be doing something wrong. Any ideas ?</p>","379865","","379865","","2010-09-28 11:29:48","2010-10-20 13:06:32","Android Chronometer doesn't start","<android><view><chronometer>","1","5","","",""
"3811082","1","","","2010-09-28 08:49:10","1","1576","<p>I found this code to generate a sphere in Opengl es. I am unable to understand the logic,  could someone please give me some insights on this.</p><p>private void generateData() {</p><pre><code>            slicesBuffers = new FloatBuffer[slices];            normalsBuffers = new FloatBuffer[slices];            texCoordsBuffers = new FloatBuffer[slices];            for (int i = 0; i &lt; slices; i++) {                    float[] vertexCoords = new float[7 * (stacks + 1)];                    float[] normalCoords = new float[4* (stacks + 1)];                    float[] textureCoords = new float[10 * (stacks + 1)];                    double alpha0 = i * (2 * Math.PI) / slices;                    double alpha1 = (i + 1) * (2 * Math.PI) / slices;                    float cosAlpha0 = (float) Math.cos(alpha0);                    float sinAlpha0 = (float) Math.sin(alpha0);                    float cosAlpha1 = (float) Math.cos(alpha1);                    float sinAlpha1 = (float) Math.sin(alpha1);                    for (int j = 0; j &lt;= stacks; j++) {                            double beta = j * Math.PI / stacks - Math.PI / 2;                            float cosBeta = (float) Math.cos(beta);                            float sinBeta = (float) Math.sin(beta);                            Utils.setXYZ(vertexCoords, 6 * j,                                            radius * cosBeta * cosAlpha1,                                            radius * sinBeta,                                            radius * cosBeta * sinAlpha1);                            Utils.setXYZ(vertexCoords, 6 * j + 3,                                            radius * cosBeta * cosAlpha0,                                            radius * sinBeta,                                            radius * cosBeta * sinAlpha0);                                    Utils.setXYZ(normalCoords, 6 * j,                                                    cosBeta * cosAlpha1,                                                    sinBeta,                                                    cosBeta * sinAlpha1);                                    Utils.setXYZ(normalCoords, 6 * j + 3,                                                    cosBeta * cosAlpha0,                                                    sinBeta,                                                    cosBeta * sinAlpha0);                                    Utils.setXY(textureCoords, 4 * j,                                                    ((float) (i + 1)) / slices,                                                    ((float) j) / stacks);                                    Utils.setXY(textureCoords, 4 * j + 2,                                                    ((float) i) / slices,                                                    ((float) j) / stacks);                    }                    slicesBuffers[i] = FloatBuffer.wrap(vertexCoords);                            normalsBuffers[i] = FloatBuffer.wrap(normalCoords);                            texCoordsBuffers[i] = FloatBuffer.wrap(textureCoords);            }    }</code></pre><p>Thankyou</p>","454711","","","","","2010-12-28 12:46:59","Spinning globe in Opengl-es","<android><opengl-es>","1","0","","",""
"3811111","1","","","2010-09-28 08:54:08","0","1013","<p>I have been working on c2dm for push API application. I am new to android and I dont understand the tut given at <a href=""http://code.google.com/android/c2dm/index.html"" rel=""nofollow"">http://code.google.com/android/c2dm/index.html</a>. Can anyone please guide me here? How would I start making an application that sends and receive the messages on emulator( I am working on emulator first and then want to test it on the device)</p><hr><p>Alright, here is the code that I used</p><pre><code>public void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  setContentView(R.layout.main);  mytext = (TextView) findViewById(R.id.mytext);  mytext.setText(""app started"");  try {    Intent registrationIntent = new Intent(""com.google.android.c2dm.intent.REGISTER"");    registrationIntent.putExtra(""app"", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); // boilerplate    registrationIntent.putExtra(""sender"", ""scorechase@gmail.com"");    startService(registrationIntent);    mytext.setText(""Grabbing your device registration ID....."");  } catch(Exception e) {     mytext.setText(""error in retrievening the registration id""+e);  }}</code></pre><p>Why do I get application stopped unexpectedly error. i tried to put it in the try n catch statements and even checked the logs. But no help. Anyone knows how to deal with it???</p>","460385","","298479","","2012-06-21 13:30:46","2012-06-21 13:30:46","Push API using C2DM","<android><android-emulator><android-widget><push><android-c2dm>","1","2","","",""
"3811155","1","","","2010-09-28 09:00:04","0","226","<p>i am using a web service to retrieve data inside a thread.so i start thread and call website in it.problem is i called service and INTERNET was present and then disconnected how can i stop that request and stop that thread in order to show message to user that there is not INTERNET coverage.</p><p>here is code of mine please help me out what should i do?</p><pre><code>new Thread(new Runnable() {                public void run() {                    while (serviceData == null) {                        DalMessages dal= new DalMessages();                        serviceData = dal.getInboxConversationPosts(Session_ID, PageSize, 0);                        callComplete = true;                    }                    mHandler.post(loadActivity());                }                private Runnable loadActivity() {                    return new Runnable() {                        public void run() {                            if(callComplete)                            {HideLoadingAnimation();}}                    };                }            }).start();</code></pre>","249991","","302328","","2010-09-28 09:58:06","2010-09-28 09:58:06","how to implement request time while calling service in android?","<android><ksoap>","1","0","","",""
"3811234","1","","","2010-09-28 09:09:25","1","800","<p>I have drawn a sphere and I am able to rotate it using java and opengl libraries for an android application. This part works perfectly. Now I am trying to texture a globe image onto the sphere. The image covers the entire sphere but then the continents are compressed and appear as a single line. What do I have to do to get the image properly textured on to my sphere?</p><p>For implementing the texture I am using the following code</p><pre><code>gl.glEnable(GL10.GL_TEXTURE_2D);texturesBuffer = IntBuffer.allocate(1);gl.glGenTextures(1, texturesBuffer);Bitmap texture = SphereTexture.getTexture(mContext,R.drawable.earth);gl.glBindTexture(GL10.GL_TEXTURE_2D, texturesBuffer.get(0));gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST);gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, texture, 0);texture.recycle();public static Bitmap getTexture(Context context, int resourceId) {    Bitmap bitmap = null;    try {        bitmap = BitmapFactory.decodeResource(context.getResources(), resourceId);        return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),  bitmap.getHeight(), yFlipMatrix, false);    }    finally {        if (bitmap != null) {            bitmap.recycle();        }    } }</code></pre>","460401","","","","","2010-09-28 09:16:36","How to texture an image onto a sphere without distortion","<java><android><opengl-es>","1","3","","",""
"3811302","1","3811561","","2010-09-28 09:19:19","3","1573","<p>I'm writing an application for Android that uses symmetric key encryption to protect sensitive data. As far as I can tell, Android only directly supports ""PBEWithMD5AndDES"". How secure is this algorithm? Also, I've included my code below (non-andriod). Is my code correctly encrypting the data?</p><pre><code>import java.io.UnsupportedEncodingException;import java.security.InvalidAlgorithmParameterException;import java.security.InvalidKeyException;import java.security.NoSuchAlgorithmException;import java.security.SecureRandom;import java.security.spec.InvalidKeySpecException;import java.security.spec.InvalidParameterSpecException;import javax.crypto.BadPaddingException;import javax.crypto.Cipher;import javax.crypto.IllegalBlockSizeException;import javax.crypto.NoSuchPaddingException;import javax.crypto.SecretKey;import javax.crypto.SecretKeyFactory;import javax.crypto.spec.IvParameterSpec;import javax.crypto.spec.PBEKeySpec;import javax.crypto.spec.SecretKeySpec;public class CipherTest{    private static class EncryptInfo    {        private final byte[] encryptedData;        private final byte[] initVector;        private final byte[] salt;        public EncryptInfo(byte[] encryptedData, byte[] initVector, byte[] salt)        {            this.encryptedData = encryptedData.clone();            this.initVector = initVector.clone();            this.salt = salt.clone();        }        public byte[] getEncryptedData()        {            return encryptedData;        }        public byte[] getInitVector()        {            return initVector;        }        public byte[] getSalt()        {            return salt;        }    }    private static final String keyGenAlgorithm = ""PBEWithMD5AndDES"";    private static final String keyAlgorithm = ""DES"";    private static final String cipherTransform = ""PBEWithMD5AndDES/CBC/PKCS5Padding"";    private static EncryptInfo encrypt(char[] password, byte[] data)            throws NoSuchAlgorithmException, InvalidKeySpecException,            NoSuchPaddingException, InvalidKeyException,            InvalidParameterSpecException, IllegalBlockSizeException,            BadPaddingException, UnsupportedEncodingException    {        byte[] salt = new byte[16];        new SecureRandom().nextBytes(salt);        PBEKeySpec keySpec = new PBEKeySpec(password, salt, 1024);        SecretKeyFactory secretKeyFactory = SecretKeyFactory                .getInstance(keyGenAlgorithm);        SecretKey secretKey = secretKeyFactory.generateSecret(keySpec);        keySpec.clearPassword();        byte[] key = secretKey.getEncoded();        SecretKeySpec secretKeySpec = new SecretKeySpec(key, keyAlgorithm);        Cipher cipher = Cipher.getInstance(cipherTransform);        cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);        byte[] initVector = cipher.getParameters().getParameterSpec(                IvParameterSpec.class).getIV();        return new EncryptInfo(cipher.doFinal(data), initVector, salt);    }    public static byte[] decrypt(byte[] data, char[] password, byte[] salt,            byte[] initVector) throws NoSuchAlgorithmException,            InvalidKeySpecException, NoSuchPaddingException,            InvalidKeyException, InvalidAlgorithmParameterException,            IllegalBlockSizeException, BadPaddingException    {        PBEKeySpec keySpec = new PBEKeySpec(password, salt, 1024);        SecretKeyFactory secretKeyFactory = SecretKeyFactory                .getInstance(keyGenAlgorithm);        SecretKey secretKey = secretKeyFactory.generateSecret(keySpec);        keySpec.clearPassword();        byte[] key = secretKey.getEncoded();        SecretKeySpec secretKeySpec = new SecretKeySpec(key, keyAlgorithm);        Cipher cipher = Cipher.getInstance(cipherTransform);        cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, new IvParameterSpec(                initVector));        return cipher.doFinal(data);    }    public static void main(String[] args) throws Exception    {        char[] password = ""password"".toCharArray();        EncryptInfo info = encrypt(password, ""Message"".getBytes());        byte[] decyptedText = decrypt(info.getEncryptedData(), password, info                .getSalt(), info.getInitVector());        System.out.println(new String(decyptedText));    }}</code></pre>","427923","","","","","2011-09-13 04:37:40","Is this a secure encryption method","<java><android><security><encryption><encryption-symmetric>","2","1","","",""
"3811416","1","8870239","","2010-09-28 09:33:15","5","3758","<p>I am having an issue with a task I'm supposed to do,I'm supposed to send MMS using our own interface on android 2.1so as you can guess calling the default Activity is out of the question.So my question, is there a way to programatically send MMS using the android SDKwithout calling their intent, I tried importing the MMS app in eclipse but most of the classes are com.google.androidwhich means they are not open sourced, so I have no idea how to get them if possible,or, how to mimic them. I was even thinking of using reflection to load them from Dalvik, but I think that this is a final effort and may not bring results.</p><p>any ideas?</p><p>btw, I found </p><p><a href=""http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android"">http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android</a></p><p><a href=""http://stackoverflow.com/questions/2165516/sending-mms-into-different-android-devices"">http://stackoverflow.com/questions/2165516/sending-mms-into-different-android-devices</a></p><p>but they do not work.. (with out the proprietary classes)</p>","240864","","","","","2012-01-15 14:08:06","Sending MMS programatically on Android","<android><mms>","2","2","1","",""
"3811529","1","3813349","","2010-09-28 09:46:57","5","7098","<p>I would like to draw a curve connecting three points in my screen<br>PointA = (480,46)PointB = (160,137)PointC = (0,228)</p><p>How to draw the curve using Android APIs ?<br>Please Help..</p><p>Thanks,<br>Sen</p>","449378","","","","","2011-11-27 19:57:23","Draw a perfect curve connecting three points","<android>","1","3","4","",""
"3811570","1","","","2010-09-28 09:51:35","2","519","<p>Based on the doc, </p><p><a href=""http://developer.android.com/reference/android/graphics/LightingColorFilter.html"" rel=""nofollow"">http://developer.android.com/reference/android/graphics/LightingColorFilter.html</a></p><p>it seems like the LightingColorFilter class only has a constructor. (Same to its parent class, ColorFilter)</p><p>How do i keep only ONE instance of LightingColorFilter while having the flexibility to modify the color properties for that filter instance? </p>","126446","","","","","2011-10-23 03:18:58","How do i change the color multiplier of a lightingColorFilter instance","<android><canvas>","1","0","","",""
"3811588","1","3819653","","2010-09-28 09:54:37","2","6732","<p>I need to create fixed size sqare buttons with relatively large characters on them for a calculator app.When I increase text size, the character is no more displayed in the center of the button and the button's position gets shifted some pixels to the top (very strange).</p><p><a href=""http://img9.imageshack.us/i/buttontest.png/"" rel=""nofollow"">http://img9.imageshack.us/i/buttontest.png/</a></p><p>If it's possible I don't want to use images for the buttons.</p><p>Update:</p><p>I use this xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/TableLayout01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;TableRow&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""1"" android:textSize=""8dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""2"" android:textSize=""10dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""3"" android:textSize=""12dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""4"" android:textSize=""14dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""5"" android:textSize=""16dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""6"" android:textSize=""18dp""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;TableRow&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""7"" android:textSize=""20dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""8"" android:textSize=""22dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""9"" android:textSize=""24dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""A"" android:textSize=""26dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""B"" android:textSize=""28dp""&gt;&lt;/Button&gt;&lt;Button android:layout_width=""50dp"" android:layout_height=""50dp"" android:text=""C"" android:textSize=""30dp""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;TableRow&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>And get this result:</p><p><img src=""http://i.stack.imgur.com/RcJ2g.png"" alt=""alt text""></p><p>how do I get all buttons equallly arranged with centered text?</p>","458904","","458904","","2010-09-28 17:52:18","2012-04-20 18:13:50","How to create small buttons with large text in Android 2.2?","<android><android-layout>","3","0","1","",""
"3811608","1","","","2010-09-28 09:58:45","2","2966","<p>I have four questions regarding Android default email program.  Please help me to answer the questions respectively.Thanks in Advance</p><p>1) How can we access the Device Database?</p><p>2) How can we setup email on Emulator?</p><p>3) Can we read Email Content Through Email Content Provider like (AttachementProvider.java) I have found in Git</p><p>4) Can anyone tell me the correct Email URII have found the URI that is not working""content://com.android.email.attachmentprovider""</p>","321373","","82118","","2011-01-13 17:47:49","2011-01-13 17:47:49","Access Android Emails through Content Provider","<android><email>","1","0","1","",""
"3811612","1","","","2010-09-28 09:59:09","4","3112","<p>I am using color picking in opengl es on android and i am calculating a color key to compare it to the values i get from glReadPixels:</p><pre><code>ByteBuffer PixelBuffer = ByteBuffer.allocateDirect(4);PixelBuffer.order(ByteOrder.nativeOrder());gl.glReadPixels(x, y, 1, 1, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, PixelBuffer);byte b[] = new byte[4];PixelBuffer.get(b);String key = """" + b[0] + b[1] + b[2];</code></pre><p>This key can be calculated manually for any color with:</p><pre><code>public static byte floatToByteValue(float f) {    return (byte) ((int) (f * 255f));}</code></pre><p>First the float value is converted to an intvalue and then castet to byte. The float values describe the colorchanels red green blue (from 0.0f to 1.0f).Example: 0.0f is converted to 255 (now integer) and then from 255 to -1 in byte</p><p>This works fine but opengl seems to make rounding errors some times. Example:</p><pre><code>0.895 -&gt; -28  and opengl returns -270.897 -&gt; -28  and opengl returns -270.898 -&gt; -28  and opengl returns -270.8985 -&gt; -27 and opengl returns -270.899 -&gt; -27  and opengl returns -260.9 -&gt; -27    and opengl returns -260.91 -&gt; -24   and opengl returns -24</code></pre><p>maybe my calculation method isnt correct? Does anyone have an idea how to avoid these deviations?</p>","165106","","","","","2011-12-21 15:52:44","Color picking on android - glReadPixels rounding errors","<android><opengl-es><color-picker><picking>","2","0","1","",""
"3811730","1","3811749","","2010-09-28 10:15:40","2","297","<p>I'm trying to develop an RPG for Android, so I need to paint a scenario where i'll move my character.</p><p>My idea is to do it 2D. I've developed 3D games and Java games for desktop, but in Android i don't get how to star the scenario.</p><p>Coul'd it be developed whith a matrix of information, so I coul'd know where my character steps?</p><p>Thank you in advance!</p>","460458","","21234","","2010-12-08 11:01:59","2010-12-08 11:01:59","Designing a videogame for android","<android><graphics><animation>","1","0","1","",""
"3811797","1","3812278","","2010-09-28 10:28:51","2","400","<p>I am using the following android fb connect library.</p><p><a href=""http://github.com/facebook/facebook-android-sdk/"" rel=""nofollow"">http://github.com/facebook/facebook-android-sdk/</a></p><p>problem is after successful login, if you logout and then click again on login button it open window asking for username and password but it already displays login and password of previous user. i think it is store login and password in the cookie how can i enforce to do not remember the login and password after logout ?</p>","216431","","","","","2011-09-20 11:46:41","Android fbconnect how to forget login and password","<android><fbconnect>","2","0","","",""
"3811874","1","3811940","","2010-09-28 10:41:03","0","1344","<p>I want to know that 100MEDIA folder in the DCIM is created byDefault or not. when i save the Image byDefault where it will stored.</p>","339116","","","","","2010-09-28 10:50:33","Android DCIM Folder Details","<android><camera>","1","0","","",""
"3811956","1","","","2010-09-28 10:52:54","1","1357","<p>I'm testing my app on different AVD setups in the emulator and ran into problems with zoom controls in MapView on Android 1.6 using QVGA resolution only (lcd.density=120). </p><p>When tapping on the screen so the zoom controls are displayed, the zoom in/plus sign is displayed much larger than zoom out, which seem to have the correct resolution. Image of emulator can be found <a href=""http://yfrog.com/ehcmjj"" rel=""nofollow"">here</a></p><p>I've tested different combination of Android versions and resolutions but only 1.6 with QVGA resolution seem to be having this issue. I've searched on Google but only found two Tattoo user reporting the same problems on their phones that seem to use QVGA.</p><p>Is this a known issue with the emulator only or is it still an issue on real phones? Why I want to support 1.6 is because SE X10-Mini has gained huge success here in Sweden and this phone run exactly 1.6 with QVGA until SE finally upgrade the phone.</p>","287170","","","","","2010-09-28 10:52:54","Zoom controls on emulator running Android 1.6 with QVGA","<android><emulator><fragmentation>","0","0","","",""
"3811974","1","3812040","","2010-09-28 10:54:36","1","981","<p>I am developing an application that needs to capture a barcode Image using Camera of the phone and scan the Barcode of that Application and return us its value.I have seen an application called ZXing in Internet.I got the corresponding .apk file of that app and also its source.But I am not able to find how to implement that API in my application.Can any one help me in sorting out this issue ? Also I also need information regarding where can I find BarCode Scanner ZXing application documentation.I will be waiting for reply.</p><p>Thanks in Advance</p>","429501","","","","","2010-09-28 11:02:27","BarCode Scanner in Android","<android>","1","0","1","",""
"3812092","1","3812161","","2010-09-28 11:09:00","1","3957","<p>I want when a user clicks a row, that row grows to show more items with an scale animation, but I can't find how can I do that.<br><strong>First</strong>: I don't know how can I change a height row at runtime. I've tried making the items visible, but this didn't work even if I inflate with another XML layout.<br><strong>Second</strong>: If I achieve the first one, I think I could make the scale animation, but any suggestion is well apreciated.</p><p>Thanks.</p>","383628","","","","","2010-09-28 11:18:45","Change the height of a row in a listview","<android><listview>","1","0","","",""
"3812124","1","3860753","","2010-09-28 11:14:11","0","4528","<p>I have an android application(Android 2.2) accessing internet behind proxy.</p><p>I have tried setting an APN with proxy host &amp; port and it works fine in emulator browser. But the application fails to connect to internet.</p><p>I have also tried command line option of -http-proxy, it doesn't work.</p><p>Can somebody help me with it?</p>","296257","","","","","2010-11-22 09:08:17","Android Application Internet Access Behind Proxy","<android><proxy><android-emulator>","3","1","1","",""
"3812279","1","","","2010-09-28 11:35:16","0","146","<p>How my application is structured... </p><pre><code>Class A extends Activity {    Button cButton = (Button) findViewById(...);    Button dButton = (Button) findViewById(...);    //invoked when cButton is clicked    methodButtonC() {         //Here I want to go to the activity of class C and this is how I have tried to solve it...          Intent intent = new Intent(A.this, C.class);        startActivity(intent);    }    //invoked when dButton is clicked    methodButtonD() {          //Same problem as above but with Class D    }} // Base Class for C &amp; D, No real purpose except sharing som methods to C &amp; D (should probobly be abstract?)Class B extends A {      // vairables and methods for inheritance} Class C extends B {    // uses derived methods and variables from Class B}Class D extends B {    // uses derived methods and variables from Class B}</code></pre><p>When I run the application and click the Button C or D error occurs. How shall I do it?</p>","460512","","460512","","2010-09-28 12:23:56","2010-09-28 12:50:17","How to go to a specific activity?","<java><android><activity><android-intent>","1","4","","",""
"3812282","1","3812304","","2010-09-28 11:35:59","0","190","<p>For my design i have in the xml file something like:</p><p>            </p><p>The design is like a row that have two cells. I want one of them to be autosize and fill the row and one of them to have fixez size. I want that the second linearlayout to wrapp its content and the first one to fill the rest of the space.Something like in css having two divs floating left and one having fixed size and one filling the rest of the row.</p><p>Is something like that possible using the xml file without changing the sizes manually?</p>","334207","","","","","2010-09-28 12:40:31","Android linearlayout design problem","<android><design><layout><android-linearlayout>","1","0","","",""
"3812331","1","3819091","","2010-09-28 11:43:56","0","3227","<p>I have created a ListView and applied a selector to it as follows</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_pressed=""true""    android:drawable=""@drawable/my_btn_pressed"" /&gt;         &lt;item android:state_focused=""true""    android:drawable=""@drawable/my_btn_focussed"" /&gt; &lt;item android:drawable=""@drawable/my_btn_normal"" /&gt;      &lt;/selector&gt;</code></pre><p>When focussed or pressed, the background of the ListView item comes as specified in the selector. But the default background is never applied, can you tell me what is wrong?</p><p>By the way, this is the customised row xml I've used:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10dip""    android:textColor=""#FFFFFF""    android:textStyle=""bold""    android:textSize=""20sp"" &gt;&lt;/TextView&gt;</code></pre><p>Thanks,Kiki</p>","454660","","454660","","2010-09-29 05:36:56","2012-10-20 06:46:09","Problem with selector for a ListView in Android","<android><listview><selector>","3","0","3","",""
"3812381","1","","","2010-09-28 11:51:48","1","621","<p>I have a web service that returns a image in Base64 format. The body response, as Fiddler says has a Content-Length: 383143. </p><p>The response is like: {... two strings... and... ImageBase64"":""iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAAAXNSR0IArs4c.....}</p><p>I request data from the web service and I receive it in a string format. When I try the following:</p><pre><code>LargeImage trackLargeImage = new Gson().fromJson(webServiceStringResponse, LargeImage.class);</code></pre><p>It takes a while and I get this error: </p><pre><code>n.JsonParser.parse(JsonParser.java:54)n.JsonParser.parse(JsonParser.java:54)&gt; 09-28 13:21:08.844:&gt; ERROR/AndroidRuntime(217): Uncaught&gt; handler: thread main exiting due to&gt; uncaught exception 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):&gt; java.lang.RuntimeException: Unable to&gt; start activity&gt; ComponentInfo{com.vorienteering.virtualorienteering/com.vorienteering.virtualorienteering.TrackDetailsActivity}:&gt; com.google.gson.JsonParseException:&gt; Failed parsing JSON source:&gt; java.io.StringReader@437ddd18 to Json&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.app.ActivityThread.access$2100(ActivityThread.java:116)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.os.Handler.dispatchMessage(Handler.java:99)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.os.Looper.loop(Looper.java:123)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.app.ActivityThread.main(ActivityThread.java:4203)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; java.lang.reflect.Method.invokeNative(Native&gt; Method) 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; java.lang.reflect.Method.invoke(Method.java:521)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; dalvik.system.NativeStart.main(Native&gt; Method) 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217): Caused by:&gt; com.google.gson.JsonParseException:&gt; Failed parsing JSON source:&gt; java.io.StringReader@437ddd18 to Json&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParser.parse(JsonParser.java:63)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.Gson.fromJson(Gson.java:443)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.Gson.fromJson(Gson.java:396)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.Gson.fromJson(Gson.java:372)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.vorienteering.virtualorienteering.TrackDetailsActivity.getData(TrackDetailsActivity.java:51)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.vorienteering.virtualorienteering.TrackDetailsActivity.onCreate(TrackDetailsActivity.java:37)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     ... 11&gt; more 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217): Caused by:&gt; java.lang.OutOfMemoryError 09-28&gt; 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.SimpleCharStream.ExpandBuff(SimpleCharStream.java:43)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.SimpleCharStream.FillBuff(SimpleCharStream.java:102)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.SimpleCharStream.readChar(SimpleCharStream.java:196)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavaccTokenManager.jjMoveNfa_0(JsonParserJavaccTokenManager.java:769)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavaccTokenManager.jjStartNfaWithStates_0(JsonParserJavaccTokenManager.java:379)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavaccTokenManager.jjMoveStringLiteralDfa0_0(JsonParserJavaccTokenManager.java:194)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavaccTokenManager.getNextToken(JsonParserJavaccTokenManager.java:1104)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavacc.jj_ntk(JsonParserJavacc.java:635)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavacc.JsonValue(JsonParserJavacc.java:204)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavacc.Pair(JsonParserJavacc.java:112)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavacc.JsonObject(JsonParserJavacc.java:88)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParserJavacc.parse(JsonParserJavacc.java:36)&gt; 09-28 13:21:08.874:&gt; ERROR/AndroidRuntime(217):     at&gt; com.google.gson.JsonParser.parse(JsonParser.java:54)n.JsonParser.parse(JsonParser.java:54)n.JsonParser.parse(JsonParser.java:54)</code></pre><p>If the image is a not complex, then it works fine, if the image is complex the out of memory error occurs. Any ideas ? Thank you for your time.</p>","379865","","","","","2010-09-28 11:51:48","Gson from JSon OutOfMemmoryError","<android><out-of-memory><gson>","0","3","","",""
"3812406","1","3824093","","2010-09-28 11:56:50","0","418","<p>I am looking to create a map application.  I want it to show a location that user selects from a list and show here the location is, then add a button on the map so that the user can navigate from there current location to the one selected.</p><p>I have looked at tutorials but cannot find anything that does this.</p><p>Anyone know where I might find a tutorial that shows this or how I can extend my simple map to show a given location.</p><pre><code>import com.ff.org.R;</code></pre><p>import com.google.android.maps.MapActivity;import com.google.android.maps.MapView;</p><p>public class Locbrad extends MapActivity {</p><pre><code>@Overrideprotected boolean isRouteDisplayed() {    return false;}@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.map1);      MapView mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);}</code></pre><p>}</p>","445174","","","","","2010-09-29 17:07:54","How to show set locations in a google map and add navigate button","<java><android><eclipse>","1","0","","",""
"3812511","1","","","2010-09-28 12:12:23","0","996","<p>I have a service that spawns a thread which runs a task every 3 seconds.</p><pre><code>class MyService extends Service {  private Timer timer = new Timer();  public int onStartCommand(Intent intent, int flags, int startId) {    TimerTask task = new TimerTask() {      public void run() {        // something important      }    };    timer.scheduleAtFixedRate(task, 0, 3000);    return Service.START_STICKY;  }  ...}</code></pre><p>My service runs fine when my phone is on, but when my phone is on standby, the service is often not responding.</p><p>Any clues as to how I can ensure my service is running while on standby?</p>","456874","","","","","2010-09-28 12:50:17","how do i ensure that a service is running even if the phone is on standby?","<android>","1","3","1","",""
"3812698","1","","","2010-09-28 12:33:37","0","3354","<p>I want to load e.g. LinearLayout with some Buttons from xml and draw it on Canvas in a way that the Views behave normally (I can set onClick actions for the Buttons <em>and when I press a Button, it changes it's background drawable</em>). Can I do this?</p>","243225","","243225","","2010-09-28 13:12:45","2013-03-29 22:43:13","How to draw Views on Canvas","<android>","1","2","","",""
"3812807","1","3812846","","2010-09-28 12:46:04","1","709","<p>Can someone tell me what is the minimum requirement a phone should obey so that an android OS can be installed over it.</p><p>thank you</p>","333239","","","","","2010-09-28 12:50:13","Minimum requirements for a phone for android support","<android>","1","0","","",""
"3812885","1","","","2010-09-28 12:54:11","0","311","<p>I am trying to publish into faceboook by using fbconnect-android sdk.I am new to android programming.</p><p>I stuck up at the fallowing error. Please help me out.</p><p>fbconnect-sample] trouble processing ""javax/net/SocketFactory.class"":[2010-09-28 18:06:19 - fbconnect-sample] Attempt to include a core VM class in something other than a core library.It is likely that you have attempted to include the core library from a desktopvirtual machine into an application, which will most assuredly not work. Ifyou really intend to build a core library -- which is only appropriate aspart of creating a full virtual machine binary, as opposed to compiling anapplication -- then use the ""--core-library"" option to suppress this errormessage. If you go ahead and use ""--core-library"" but are in fact buildingan application, then please be aware that your build will still fail at somepoint; you will simply be denied the pleasure of reading this helpful errormessage.[2010-09-28 18:06:19 - fbconnect-sample] 1 error; aborting[2010-09-28 18:06:19 - fbconnect-sample] Conversion to Dalvik format failed with error 1</p>","460617","","1288","","2011-04-27 01:12:25","2011-04-28 18:13:05","Error in fbconnect example (rouble processing ""javax/net/SocketFactory.class"":)","<android>","1","0","","",""
"3812919","1","3813009","","2010-09-28 12:58:22","0","2856","<p>I am trying to aquire a wake lock however when I call <code>PowerManager.newWakeLock()</code> I receive a IlleglArgumentException.</p><p>Here is the code I use to get the </p><pre><code>private void setWakeLock(Context context){    PowerManager pm = (PowerManager) context    .getSystemService(Context.POWER_SERVICE);    SoundAlarmActivity.WakeLock = pm.newWakeLock(    PowerManager.ACQUIRE_CAUSES_WAKEUP            | PowerManager.ON_AFTER_RELEASE, ""Alarm"");    SoundAlarmActivity.WakeLock.acquire();}</code></pre><p>And here is the logcat:</p><pre><code>09-28 12:53:09.704: ERROR/AndroidRuntime(702): java.lang.IllegalArgumentException09-28 12:53:09.704: ERROR/AndroidRuntime(702):     at android.os.PowerManager$WakeLock.&lt;init&gt;(PowerManager.java:223)09-28 12:53:09.704: ERROR/AndroidRuntime(702):     at android.os.PowerManager.newWakeLock(PowerManager.java:365)</code></pre>","407133","","407133","","2013-12-18 16:47:56","2013-12-18 16:47:56","PowerManager.newWakeLock() throws IlleagelArgumentException","<android>","2","0","2","",""
"3812935","1","3813435","","2010-09-28 12:59:29","1","584","<p>I read the <a href=""http://developer.android.com/resources/articles/avoiding-memory-leaks.html"" rel=""nofollow"">Avoiding Memory Leaks</a> article with interest, and am concerned about danging references to the context object.  I have a class like the following.</p><pre><code>public class MessageAdapter extends ArrayAdapter&lt;Message&gt; {    private ArrayList&lt;Message&gt; items;    private LayoutInflater inflater;    public MessageAdapter(Context context, int textViewResourceId, ArrayList&lt;Message&gt; items) {        super(context, textViewResourceId, items);        this.items = items;        inflater = LayoutInflater.from(context);    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                v = inflater.inflate(R.layout.message_row, null);            }            Message o = items.get(position);            if (o != null) {                TextView content = (TextView) v.findViewById(R.id.content);                TextView date = (TextView) v.findViewById(R.id.date);                content.setText(Html.fromHtml(""&lt;b&gt;"" + o.getSender() + ""&lt;/b&gt;: "" + o.getContent().replace(""\n"", ""&lt;br/&gt;"")));                date.setText(o.getReceived().toString());            }            return v;    }}</code></pre><p>Is it a problem to have a reference to a LayoutInflater object, since it must be using the context object somehow?  Is there a better design pattern for what I'm trying to do here? (Use the context only to initially inflate the XML; from then on just use the View that's passed in to <code>getView</code>)</p>","155392","","","","","2010-09-28 13:55:49","How to avoid leaking context in ArrayAdapter","<java><android>","1","1","1","",""
"3812955","1","","","2010-09-28 13:01:20","0","346","<p>I have a TabHost activity with 2 child activities. My problem is that when I'm overriding the onTouchEvent method (for any of these two child activities) only the MotionEvent.ACTION_DOWN event is received. Any help would be appreciated.</p>","460611","","180538","","2010-09-28 13:02:51","2010-09-28 13:02:51","Tab content doesn't receive touch events","<android><android-tabhost><ontouchevent>","0","2","","",""
"3812987","1","3813140","","2010-09-28 13:04:10","27","20276","<p>I am trying to run my project but eclipse is saying I have errors but there are no errors just a red cross where the project name is.  I have tried deleting the R.java and generating a new one but that didnt work</p><p>Thanks In Advance</p>","445174","","109880","","2010-09-28 13:10:29","2013-03-04 14:45:05","Eclipse shows errors but I can't find them","<java><android><eclipse>","5","2","2","",""
"3813049","1","3814580","","2010-09-28 13:12:05","9","8636","<p>Is it possible to create a view that is bigger than the screen? </p><p>I need a view that has a bigger width then the screen of the device. I use this view in a rotation animation. During the rotation the parts that were not on the screen before animating the view will become visible. </p><p>Is there a way to achieve this effect with the android framework?</p><p><strong>Update</strong></p><p>I tried to set my parent layout much bigger then the screen and it is working. This will make somethings a little bit uncomfortable but it could work. The next problem now is that my layout still starts at the left side of the screen. I can't think of a method to make the layout to expand itself to the left and the right of the screen.</p>","114066","","114066","","2010-09-28 13:35:25","2013-09-30 07:30:31","How to create a view that is bigger than the screen?","<android><layout>","7","1","3","",""
"3813095","1","3813134","","2010-09-28 13:18:09","0","125","<p>how do i come to know which device is compatible to be overhauled with Android OS.I wanted to know what is the basic hardware requirement.</p><p>thanks</p>","333239","","","","","2010-09-28 13:22:14","Android Device Compatibility","<android>","1","1","","",""
"3813108","1","3813179","","2010-09-28 13:19:37","10","6223","<p>I have a ViewFlipper implementation that needs to be improved. This ViewFlipper has three child views. Basically, I want an indicator on which child view is currently active. My ViewFlipper is just a part of a complex layout which also has list views, etc.</p><p>Switching of views is also automatic and done in a specified interval.</p><p>From Android's SDK reference, I haven't seen any listener for when the ViewFlipper changes the child view.</p><p>Do you guys know of a way I can have a listener for that event?</p><p>Or are there alternative ways I can implement this feature besides using ViewFlipper ?</p><p>Thanks!</p>","411597","","","","","2011-10-02 14:28:28","Listener for ViewFlipper widget flipping events","<android><viewflipper>","1","0","","",""
"3813119","1","","","2010-09-28 13:20:41","7","7588","<p>How to set Max and Min zoom levels for Pinch-Zoom? </p><hr><p>Here is my code://</p><pre><code>public class TouchImageView extends ImageView {     private static final String TAG = ""Touch"";        // These matrices will be used to move and zoom image        Matrix matrix = new Matrix();        Matrix savedMatrix = new Matrix();        static PinchZoomExample sPinchZoomExample = null;        // We can be in one of these 3 states        static final int NONE = 0;        static final int DRAG = 1;        static final int ZOOM = 2;        int mode = NONE;        static Bitmap sCurrentImage;        // Remember some things for zooming        PointF start = new PointF();        PointF mid = new PointF();        float oldDist = 1f;        Context context;        public TouchImageView(Context context) {            super(context);            super.setClickable(true);            this.context = context;            matrix.setTranslate(1f, 1f);            setImageMatrix(matrix);            setScaleType(ScaleType.MATRIX);            setOnTouchListener(new OnTouchListener() {                @Override                public boolean onTouch(View v, MotionEvent rawEvent) {                    WrapMotionEvent event = WrapMotionEvent.wrap(rawEvent);                    // Dump touch event to log                   /* if (Viewer.isDebug == true){                        dumpEvent(event);                    }*/                    // Handle touch events here...                    switch (event.getAction() &amp; MotionEvent.ACTION_MASK) {                    case MotionEvent.ACTION_DOWN:                        savedMatrix.set(matrix);                        start.set(event.getX(), event.getY());                        Log.d(TAG, ""mode=DRAG"");                        mode = DRAG;                        break;                    case MotionEvent.ACTION_POINTER_DOWN:                        oldDist = spacing(event);                        Log.d(TAG, ""oldDist="" + oldDist);                        if (oldDist &gt; 10f) {                            savedMatrix.set(matrix);                            midPoint(mid, event);                            mode = ZOOM;                            Log.d(TAG, ""mode=ZOOM"");                        }                        break;                    case MotionEvent.ACTION_UP:                        int xDiff = (int) Math.abs(event.getX() - start.x);                        int yDiff = (int) Math.abs(event.getY() - start.y);                        if (xDiff &lt; 8 &amp;&amp; yDiff &lt; 8){                            performClick();                            sPinchZoomExample.displayGallery();                        }                    case MotionEvent.ACTION_POINTER_UP:                        mode = NONE;                        Log.d(TAG, ""mode=NONE"");                        break;                    case MotionEvent.ACTION_MOVE:                        if (mode == DRAG) {                            // ...                            matrix.set(savedMatrix);                            matrix.postTranslate(event.getX() - start.x, event.getY() - start.y);                        } else if (mode == ZOOM) {                            float newDist = spacing(event);                            Log.d(TAG, ""newDist="" + newDist);                            if (newDist &gt; 10f) {                                matrix.set(savedMatrix);                                float scale = newDist / oldDist;                                matrix.postScale(scale, scale, mid.x, mid.y);                                //Canvas canvas = new Canvas();//                              Bitmap bm = Bitmap.createBitmap(sCurrentImage,0, 0, sCurrentImage.getWidth()//                                      , sCurrentImage.getHeight(), matrix, true);                                Log.d(""SCALE"", ""scale="" + scale + ""  "" + getWidth() + ""  "" + getHeight());                                //bm.recycle();                            }                        }                        break;                    }                    setImageMatrix(matrix);                    return true; // indicate event was handled                }            });        }        public void setImage(Bitmap bm, int displayWidth, int displayHeight , PinchZoomExample pze) {             super.setImageBitmap(bm);            sCurrentImage = bm;            sPinchZoomExample = pze;            //Fit to screen.            float scale;            if ((displayHeight / bm.getHeight()) &gt;= (displayWidth / bm.getWidth())){                scale =  (float)displayWidth / (float)bm.getWidth();            } else {                scale = (float)displayHeight / (float)bm.getHeight();            }            savedMatrix.set(matrix);            matrix.set(savedMatrix);            matrix.postScale(scale, scale, mid.x, mid.y);            setImageMatrix(matrix);            // Center the image            float redundantYSpace = (float)displayHeight - (scale * (float)bm.getHeight()) ;            float redundantXSpace = (float)displayWidth - (scale * (float)bm.getWidth());            redundantYSpace /= (float)2;            redundantXSpace /= (float)2;            savedMatrix.set(matrix);            matrix.set(savedMatrix);            matrix.postTranslate(redundantXSpace, redundantYSpace);   //matrix.postTranslate(50, 50);            setImageMatrix(matrix);        }        /** Determine the space between the first two fingers */        private float spacing(WrapMotionEvent event) {            // ...            float x = event.getX(0) - event.getX(1);            float y = event.getY(0) - event.getY(1);            return FloatMath.sqrt(x * x + y * y);        }        /** Calculate the mid point of the first two fingers */        private void midPoint(PointF point, WrapMotionEvent event) {            // ...            float x = event.getX(0) + event.getX(1);            float y = event.getY(0) + event.getY(1);            point.set(x / 2, y / 2);        }}</code></pre>","460641","","189950","","2012-05-16 22:20:39","2013-08-29 01:10:12","Scale limits on pinch zoom of android","<android>","4","2","2","",""
"3813131","1","3814239","","2010-09-28 13:22:02","2","3209","<p>I am trying to show a activity or a dialog when the phone is locked.I have tried using a WakeLock but it did not work and I can only see the activity once my phone is unlocked?</p><p>What is the proper way to do this?</p>","407133","","","","","2012-02-14 01:47:51","how to show popup Activity or Dialog when phone is locked?","<android>","2","0","2","",""
"3813160","1","","","2010-09-28 13:26:20","0","715","<p>It is giving error at runtime : <code>Application stopped unexpectedly</code> - Am I  going wrong anywhere ?<br>Please help. Any help is appreciable.  </p><pre><code>public Cursor getdata(String passTask)  {    //Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""totalHr"" },     //        ""where task = "", passTask ,"""", """", """");    //return cursor;   String p_query = ""select totalHr from table1 where task = ?"";    Cursor cursor = this.db.rawQuery(p_query, new String[] {passTask} );   return cursor;  }  </code></pre><hr><p>LogCat Output -</p><p><img src=""http://i.stack.imgur.com/AqQ58.jpg"" alt=""alt text""></p>","460652","","1232277","","2013-01-04 06:09:36","2013-01-04 06:09:36","SQLite Query in Android Application","<android><sqlite>","0","12","","",""
"3813180","1","3814332","","2010-09-28 13:28:53","5","8428","<p>Kindly provide me the steps to <strong>obfuscate an Android application from Eclipse IDE</strong>.Is <strong>Proguard jar best for this obfuscation purpose or do we have better obfuscator</strong>?</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2013-10-27 16:35:55","Code Obfuscation using Eclipse IDE in Android","<android>","1","3","0","",""
"3813579","1","3815328","","2010-09-28 14:04:13","2","100","<p>My question is suppose i have to views(Screen).  when i open my application from the emulator first screen should stay for just 5 secs and automatically new screen should appear(2nd).i Know i can do this through timer concept but dnt know hwto do that in android?So pls help me in this problem.</p>","383597","","345717","","2010-09-28 14:12:50","2010-09-28 17:28:55","Android view problem","<android>","1","2","","",""
"3813628","1","","","2010-09-28 14:09:12","1","1460","<p>Does anyone know of a good tutorial for any of the above?</p><p>I need to send data to Drupal from and Android phone.</p><p>Data is stored in XML but can be converted to JSON easily.</p><p>Then it needs to be stored in a user's profile.</p><p>thanks</p>","381258","","1228","","2013-08-14 15:55:07","2013-08-14 15:55:07","Android, Drupal & DrupalCloud or Android-xmlrpc tutorial?","<android><json><drupal><xml-rpc>","2","0","3","",""
"3813667","1","3813773","","2010-09-28 14:14:38","0","197","<p>I am creating a few layouts with the root element being <code>merge</code>.  inside the <code>merge</code> element i have a <code>ScrollView</code> containing a <code>TextView</code>.  Here is the file:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;merge  xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;ScrollView    android:id=""@+id/scroll""    android:padding=""6dp""    android:layout_below=""@id/headingLayout""    android:layout_above=""@id/tabsLayout""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView      android:id=""@+id/aboutTxt""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content"" /&gt;  &lt;/ScrollView&gt;&lt;/merge&gt;</code></pre><p>I am getting 2 errors: there is no resource to match the <code>layout_below</code> and <code>layout_above</code> names i have put in.</p><p>I have another layout xml file including very similar components, some of which also reference <code>@id/headingLayout</code> and <code>@id/tabsLayout</code>.  Both of these XML layout files do not contain the component with name <code>headingLayout</code> or <code>tabsLayout</code></p><p>Why is it that one layout file has no errors about these references and the other layout file does?  What the crap am i doing wrong, the app will build and run like i expect, until i add this merge to another layout?</p><p>I have even tried copying the xml from the working layout file, to find that it gives the same errors, something must be wrong with my new layout file.  I have tried cleaning, rebuilding, opening/closing eclipse..</p>","416412","","416412","","2010-09-28 14:20:00","2010-09-28 14:26:17","using merge with layouts giving error for one file, no error on other. same code!","<android>","1","2","","",""
"3813805","1","","","2010-09-28 14:29:38","3","1003","<p>Okay so I am a very low level programmer and happy to admit it.  I can write simple programs things like VB and python etc given the basic syntax.  I want to write simple programs for android, for instance a calculator that handles feet and inches and a program that simply searches a database of products and tells me the details of them.  Is there a simple solution where I can drag and drop some buttons and text boxes and execute code or do I have to learn the whole gui drawing code and start from scratch?  If I do have to start from scratch is there a book out there that doesn't assume that I know any of the advanced coding techniques or do I have to learn the whole language and then learn the SDK?  I want to be able to write a program quick and dirty, here are the variables here's the formula, do your thing...</p>","460716","","","","","2010-09-28 19:05:59","A non-programmers guide to programming","<android>","3","1","","",""
"3814005","1","","","2010-09-28 14:49:35","51","18860","<p>I'm building an app where I have a table for events and a table for venues. I want to be able to grant other applications access to this data. I have a few questions related to best practices for this kind of problem.</p><ol><li><p><strong>How should I structure the database classes?</strong>I currently have classes for EventsDbAdapter and VenuesDbAdapter, which provide the logic for querying each table, while having a separate DbManager (extends SQLiteOpenHelper) for managing database versions, creating/upgrading databases, giving access to database (getWriteable/ReadeableDatabase). Is this the recommended solution, or would I be better off either consolidating everything to one class (ie. the DbManager) or separation everything and letting each Adapter extends SQLiteOpenHelper?</p></li><li><p><strong>How should I design content providers for multiple tables?</strong>Extending the previous question, should I use one Content Provider for the whole app, or should I create separate providers for Events and Venues?</p></li></ol><p>Most examples I find only deal with single table apps, so I would appreciate any pointers here.</p>","184844","","","","","2012-11-16 02:24:02","Best practices for exposing multiple tables using content providers in Android","<android><sqlite><android-contentprovider>","4","0","34","",""
"3814074","1","","","2010-09-28 14:57:56","1","666","<p>I am using Android to develop an application.</p><p>I connected to hotspot, after then, I sent http request to the ""http://www.google.com"" web page using HttpURLConnection or HttpClient. It should not response, because the connection is not made yet, so it will be redirected to authentication page ot the hotspot.</p><p>I wish to get the authentication page html data. But the code throws IOException. The error message is ""IOException: Socket is not connected"". It connected to the hotspot. I know, it can not be connected to the google.</p><p>How can I get the html data???? Anyone know, please let me also know. Thanks in advance.</p>","417294","","246246","","2013-11-15 18:27:28","2013-11-15 18:27:28","how to get the redirected page html in hotspot","<android><httprequest>","0","2","","",""
"3814085","1","3814337","","2010-09-28 14:58:50","1","1938","<p>I am new to android programming and wanted to know if there is a list of content URI available for reference </p><p>for eg. content://sms/inbox   - is content URI to access SMS inbox. </p><p>is there any such list which provides all the content URIs which can be used with the android system to get the data. I have searched the android SDK documentation and could not find all of them , for eg. the above SMS inbox one is not listed there. </p><p>Thanks.</p>","388044","","","","","2010-09-28 15:25:42","Android : How to get Content URIs","<android><content><uri>","1","0","1","",""
"3814126","1","3912748","","2010-09-28 15:04:14","12","8724","<p>I have issue with displaying AlertDialog from Service. I am able to display custom layout window using Toast or using WindowManager(TYPE_SYSTEM_ALERT or TYPE_SYSTEM_OVERLAY). But, I do not want to use custom layout, I prefer to use nice AlertDialog GUI directly.</p><p>Scenario:</p><ul><li>Running Service. No active Activity present.</li><li>On some external event, Service sends Notification</li><li>When user press Notification, Service is informed via PendingIntent and AlertDialog should be displayed (created with <code>AlertDialog.Builder(this)</code>)</li></ul><p>Error:</p><pre><code>ERROR/AndroidRuntime(1063): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</code></pre><p>Searching for the answer lead me to impression that I am trying something that is currently not possible (Android 2.2). Or maybe it is.</p>","423823","","760489","","2011-09-27 10:26:43","2013-01-15 05:43:09","Display AlertDialog as system overlay window from Service","<android>","2","0","10","",""
"3814132","1","3879545","","2010-09-28 15:04:37","1","785","<p>I am using Ksoap from Android to access a .net web service.</p><p>The wsdl is formatted like this</p><pre><code> &lt;filter&gt; &lt;DateFrom&gt; Date1 &lt;/DateFrom&gt; &lt;DateTo&gt;   Date2 &lt;/DateTo&gt; &lt;/filter&gt;</code></pre><p>I use addProperty(""DateFrom"", date1) same for DateTo.How do I tell ksoap about filter.</p><p>The service has a helloword that I can access correctly. When I try the dateservice, ksoap replies with an error: ""Object reference not set to an instance of an object""</p>","327415","","","","","2010-10-07 07:31:12","setting up a ksoap request","<android><ksoap2>","1","0","","",""
"3814166","1","3814312","","2010-09-28 15:08:08","0","810","<p>I'm trying to use the Amazon Web Services Java SDK jar in an Android project in Eclipse, but it has references to <em>org.apache.commons.httpclient</em>.  All I seem to have in my Android SDK (2.2) is <em>org.apache.commons.http.client</em>, which is a different namespace and obviously causes the build to fail.</p><p>I'm new to Java, Eclipse, and Android dev... is there a way to ""map"" one name space to the other or create some sort of symbolic link?  If not, does that mean I have to import a ""standard"" org.apache.commons library?</p>","460747","","","","","2010-09-28 15:22:41","External library needs org.apache.commons.httpclient instead of org.apache.commons.http.client","<android><eclipse>","1","0","","",""
"3814258","1","","","2010-09-28 15:16:39","16","2913","<p>What is the procedure to detect if an Android device has SMS send capability? I want my app to know if the device has the capability to send an SMS message before trying to actually trying to send it. Thanks.</p>","246887","","","","","2014-03-07 23:40:57","What is the procedure to detect if an Android device has SMS send capability?","<android>","1","0","6","",""
"3814503","1","","","2010-09-28 15:39:28","12","3436","<p>I'm running mac osx. I downloaded the latest version of the SDK starter package (platform api7, revision 2). I use processing version of the build (190).When I try to run I get the errors below.I don't know what is it ?I hope who can help me getting started with android processing,please.Thanks.</p><hr><pre>BUILD FAILED/Users/ed_crub/Documents/Android SDK/tools/ant/ant_rules_r3.xml:395: The following error occurred while executing this line:/Users/ed_crub/Documents/Android SDK/tools/ant/ant_rules_r3.xml:209: com.android.sdklib.build.ApkCreationException: Debug Certificate expired on 28/9/2497, 9:17 ?.Total time: 17 seconds/Users/ed_crub/Documents/Android SDK/tools/ant/ant_rules_r3.xml:395: The following error occurred while executing this line:/Users/ed_crub/Documents/Android SDK/tools/ant/ant_rules_r3.xml:209: com.android.sdklib.build.ApkCreationException: Debug Certificate expired on 28/9/2497, 9:17 ?.    at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:541)    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)    at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)    at org.apache.tools.ant.Task.perform(Task.java:348)    at org.apache.tools.ant.Target.execute(Target.java:357)    at org.apache.tools.ant.Target.performTasks(Target.java:385)    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)    at org.apache.tools.ant.Project.executeTarget(Project.java:1298)    at processing.app.tools.android.Build.antBuild(Unknown Source)    at processing.app.tools.android.AndroidMode.runSketchOnDevice(Unknown Source)    at processing.app.tools.android.AndroidMode.access$600(Unknown Source)    at processing.app.tools.android.AndroidMode$RunHandler.run(Unknown Source)    at java.lang.Thread.run(Thread.java:637)</pre>","460784","","808884","","2012-12-06 02:32:08","2012-12-06 02:32:08","com.android.sdklib.build.ApkCreationException: Debug Certificate expired error","<android><ant>","1","1","2","",""
"3814512","1","3815115","","2010-09-28 15:40:10","0","457","<p>I have the following layout. This defines a row in my ListView. I noticed that the text is not centered in the row. There seems to be extra bottom padding. How can I make the text appear in the center, vertically, so there is no padding?</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""@drawable/stocks_gradient""&gt;       &lt;TextView        android:id=""@+id/nameText""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:text=""Symbol"" android:textStyle=""bold"" android:textSize=""24sp"" android:layout_width=""100dp"" android:textColor=""#4871A8"" android:paddingLeft=""5dp""/&gt;    &lt;TextView        android:id=""@+id/priceText""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@+id/nameText""        android:gravity=""right""             android:text=""100"" android:textStyle=""bold"" android:textSize=""24sp"" android:textColor=""#4871A8""/&gt;      &lt;TextView        android:id=""@+id/changeText""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@+id/priceText""        android:gravity=""right""             android:textSize=""18sp"" android:text=""3.07(+1.08%)"" android:padding=""7dip""/&gt;  &lt;/RelativeLayout&gt;</code></pre>","19875","","","","","2010-09-28 16:51:58","Why is there extra padding on the bottom of my row?","<android><listview><layout><relativelayout>","1","0","","",""
"3814530","1","","","2010-09-28 15:42:04","-2","194","<p>I have a number of images in drawable folder. I want to show  images randomly from drawable. Please anyone provide me with an example.</p><p>Thanks.</p>","418980","","418980","","2010-09-30 15:52:06","2010-09-30 15:52:06","selecet images randomly from drawble","<android>","1","3","","",""
"3814548","1","3814783","","2010-09-28 15:44:03","2","8088","<p>My code looks as follows..</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    try {        Thread.sleep(3000);        } catch (InterruptedException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }     finish();    }</code></pre><p>And my XML is</p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout01""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical"" android:layout_gravity=""center""&gt;&lt;Button android:id=""@+id/Button01"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:text=""Button""    android:layout_gravity=""center""    android:layout_marginTop=""80px""&gt;&lt;/Button&gt;</code></pre><p></p><p>In my XML i had a button. Now what i want is After starting the activity i have to wait for 3 seconds and then the Activity has to be stopped..Through my code the Activity is stopped after 3 seconds. But am not seeing any Button when the activity is started..Only Black screen is appearing for 3 seconds..But i also want to display that button..can any one help with sample code..please...I am need of it..</p>","458295","","","","","2011-08-02 11:03:54","How to stop an Activity in android","<android>","2","0","","",""
"3814610","1","3815255","","2010-09-28 15:51:02","14","3718","<p>I am developing an application that involves some sensitive user information. I retrieve this information via a private web API. I am trying to determine the best way to get this data into my app. Right now I'm exploring creating a content provider that can do so; my hesitation is in making it secure. I want this data to be usable only by my application. Ideally, no other apps would even know it exists.</p><p>Do you have any pointers or advice on how to do this effectively and securely?Any info on content providers who's data source is a remote OAuth'd API?</p><p>Thanks!</p><p>Edit: I say content provider, but if that isn't the best way to do what I need, by all means let me know what else to look into.</p>","57414","","57414","","2010-09-28 19:32:43","2010-09-28 19:32:43","Android private content provider?","<android><web-services><security><android-contentprovider><sensitive-data>","2","0","5","",""
"3814689","1","3816206","","2010-09-28 15:58:57","2","790","<p>I'm interested in developing an android app that makes use of an <code>OpenCV</code> android port at <a href=""http://code.google.com/p/android-opencv/"" rel=""nofollow"">http://code.google.com/p/android-opencv/</a>. Particularly, I want to use <code>SURF</code> features which comes embedded in the <code>OpenCV</code> framework but I'm not sure if then I will be able to sell this app.</p><p>Anyway, is there any non-free app making use of any of the <code>OpenCV</code> android ports?</p>","216511","","119895","","2010-09-28 16:38:40","2010-09-28 19:11:06","Is it possible to sell a commercial android app using OpenCV android port?","<android><open-source><opencv><augmented-reality>","2","0","1","",""
"3814852","1","4069673","","2010-09-28 16:16:49","7","1628","<p>My app periodically checks the location using an alarm to a <code>BroastcastReceiver</code> that starts a service. I know I should acquire a wakelock before I start the service but my question is when can I release it? </p><p>If I release the wakelock after calling <code>requestLocationUpdates</code>, can the device go to sleep and not call my <code>LocationListener</code> or will the device always wake to deliver updates and stay awake until the callback has returned? I'm reluctant to hold onto the wakelock because that would prevent the device from sleeping between updates until I'm done with the location.</p>","12034","","","","","2010-11-26 22:49:27","Android - When using LocationManager.requestLocationUpdates, do I need a WakeLock?","<android><android-wake-lock>","1","7","2","",""
"3814972","1","3824043","","2010-09-28 16:31:24","7","1395","<p>I'm looking to use the new licensing (LVL) stuff with Android Marketplace, but I'm running into a performance problem with the stock AESObfuscator.  Specifically, the constructor takes several seconds to run on a device (pure agony on emulator).  Since this code needs to run to even check for cached license responses, it puts a serious damper on checking the license at startup.</p><p>Running the LVL sample app, here's my barbarian-style profiling of AESObfuscator's constructor:</p><pre><code>public AESObfuscator(byte[] salt, String applicationId, String deviceId) {        Log.w(""AESObfuscator"", ""constructor starting"");        try {            Log.w(""AESObfuscator"", ""1"");            SecretKeyFactory factory = SecretKeyFactory.getInstance(KEYGEN_ALGORITHM);            Log.w(""AESObfuscator"", ""2"");            KeySpec keySpec =                new PBEKeySpec((applicationId + deviceId).toCharArray(), salt, 1024, 256);            Log.w(""AESObfuscator"", ""3"");            SecretKey tmp = factory.generateSecret(keySpec);            Log.w(""AESObfuscator"", ""4"");            SecretKey secret = new SecretKeySpec(tmp.getEncoded(), ""AES"");            Log.w(""AESObfuscator"", ""5"");            mEncryptor = Cipher.getInstance(CIPHER_ALGORITHM);            Log.w(""AESObfuscator"", ""6"");            mEncryptor.init(Cipher.ENCRYPT_MODE, secret, new IvParameterSpec(IV));            Log.w(""AESObfuscator"", ""7"");            mDecryptor = Cipher.getInstance(CIPHER_ALGORITHM);            Log.w(""AESObfuscator"", ""8"");            mDecryptor.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(IV));        } catch (GeneralSecurityException e) {            // This can't happen on a compatible Android device.            throw new RuntimeException(""Invalid environment"", e);        }        Log.w(""AESObfuscator"", ""constructor done"");    }</code></pre><p>The output on a Nexus One:</p><pre><code>09-28 09:29:02.799: INFO/System.out(12377): debugger has settled (1396)09-28 09:29:02.988: WARN/AESObfuscator(12377): constructor starting09-28 09:29:02.988: WARN/AESObfuscator(12377): 109-28 09:29:02.999: WARN/AESObfuscator(12377): 209-28 09:29:02.999: WARN/AESObfuscator(12377): 309-28 09:29:09.369: WARN/AESObfuscator(12377): 409-28 09:29:09.369: WARN/AESObfuscator(12377): 509-28 09:29:10.389: WARN/AESObfuscator(12377): 609-28 09:29:10.398: WARN/AESObfuscator(12377): 709-28 09:29:10.398: WARN/AESObfuscator(12377): 809-28 09:29:10.409: WARN/AESObfuscator(12377): constructor done09-28 09:29:10.409: WARN/ActivityManager(83): Launch timeout has expired, giving up wake lock!09-28 09:29:10.458: INFO/LicenseChecker(12377): Binding to licensing service.</code></pre><p>7 seconds of thrashing (about 20 in emulator, ugh).  I can spin it off on an AsyncTask, but it doesn't do much good there, since the app can't really run until I've validated the license.  All I get is a nice, pretty seven seconds of progress bar while the user waits for me to check the license.</p><p>Any ideas?  Roll my own obfuscator with something simpler than AES to cache my own license responses?</p>","460831","","","","","2014-03-09 16:32:52","Any way around awful SecretKeyFactory performance with LVL and AESObfuscator?","<android><performance><licensing>","5","0","1","",""
"3815090","1","3882736","","2010-09-28 16:49:24","68","64476","<p>I'm piecing together a cheapo app that amongst other things ""frames"" some of our websites...  Pretty simple with the WebViewClient... until I hit the video.</p><p>The video is done as HTML5  elements, and these work fine and dandy on Chrome, iPhones, and now that we fixed the encoding issues it works great on Android... in the native browser.</p><p>Now the rub: WebView doesn't like it.  At all.  I can click on the poster image, and nothing happens.</p><p>Googling, I found <a href=""http://www.codelark.com/2010/05/12/android-viewing-video-from-embedded-webview/"">http://www.codelark.com/2010/05/12/android-viewing-video-from-embedded-webview/</a> which is close, but seems to be based on a 'link' (as in a href...) instead of a video element.  (onDownloadListener does not appear to get invoked on video elements...)</p><p>I also see references to overriding onShowCustomView, but that seems to not get called on video elements... nor does shouldOverrideUrlLoading.. </p><p>I would rather not get into ""pull xml from the server, reformat it in the app"".. by keeping the story layout on the server, I can control the content a bit better without forcing people to keep updating an app.  So if I can convince WebView to handle  tags like the native browser, that would be best.</p><p>I'm clearly missing something obvious.. but I have no clue what.</p>","460832","","467900","","2011-10-21 07:38:50","2013-09-30 14:33:47","WebView and HTML5 <video>","<android><html5><video><webview><android-webview>","13","3","68","",""
"3815123","1","3815148","","2010-09-28 16:52:39","2","1332","<p><br/><br/>I want to write an Android remote control application that allows people to navigate back and forth on a PowerPoint slideshow presentation in Microsoft Office (preferably 2007/2010) on my PC. In this case, I have to make a small PowerPoint navigation client on the Android, and also I have create a PC server to access Microsoft Office PowerPoint and manipulate its slideshow. I know it is possible for a java application to gain access to Microsoft Office PowerPoint's slideshow. Some applications for Android are already made (Gmote 2.0 and such) and they can be used to navigate PowerPoint slideshows.<br/><br/>Is there any extension or any library that can be used to gain access to Microsoft Office PowerPoint? Thank you.</p>","460866","","","","","2012-09-27 20:28:06","How to control an office 2010 PowerPoint presentation remotely using an android application?","<java><android><powerpoint>","2","0","1","",""
"3815139","1","","","2010-09-28 16:54:31","7","4508","<p>Is there a changelog available for Android 2.2.1?</p>","460868","","","","","2011-03-28 00:32:00","Android 2.2.1 changelog","<android><changelog>","4","0","1","",""
"3815266","1","3815287","","2010-09-28 17:08:04","2","730","<p>I'm coding an audio player where a thread updates the TextView representing the track's elapsed time, every 250 milliseconds.</p><p>The display looks like this:</p><p>1:30/2:30&lt;-----Progress Bar-----></p><p>TextView 1 is 1:30/ and TextView 2 is 2:30.</p><p>Both are set to wrap_content for width.</p><p>What happens is that on every 250 millisecond cycle, the thread checks the current time and updates TextView 1. For this brief moment, TextView 2 and the progress bar get pushed momentarily to the right by about 2-4 pixels. Then they come back to place until the same thing happens during the next cycle.</p><p>I don't know what's happening. There are no trailing space characters, etc and everything should, theoretically, be working smoothly but it's not.</p><p>Can anyone help me out? I'm hoping someone else may have faced a similar problem....</p><p>PS: I initialize TextView 1 to 0:00/ and TextView 2 to 0:00 in the layout XML file and the code handles it from there.</p>","392178","","","","","2010-09-28 17:11:03","Calling TextView.setText() periodically causes the UI to jerk","<android><textview><settext>","1","0","1","",""
"3815269","1","3815311","","2010-09-28 17:08:15","15","15778","<p>Help!</p><p>When I install my app on the phone to test, <strong>it is showing up to be a HUGE size, 11.35 MB</strong>. It is a very simple app that lets user browse through fun-facts. The only reason I can think of is that there are 14 JPEG files in the drawables which serve as background images of the fun-facts. The average size of these is about 500 KB.</p><p>I'd like to trim the size of my app, so as not to use up the precious resources on the user's device. Other than just getting rid of the pictures, are there ways to optimize the size of apk file?</p><p>EDIT: The pictures are photos taken by me using the Android phone itself.</p>","289918","","289918","","2010-09-28 19:56:42","2013-10-06 01:12:50","How to reduce App (.apk) Size","<android>","6","3","3","",""
"3815341","1","3815726","","2010-09-28 17:17:35","0","668","<p>When I change the background color of a list item it no longer flashes green when selected.  Is there a way to retain this default behavior when the background is changed?</p>","460887","","","","","2010-09-28 18:05:20","List Item Selected Behavior","<android>","2","0","","",""
"3815522","1","3815708","","2010-09-28 17:41:20","9","10947","<p>I am working on my first Android Application. Now wat I want to do is to make a POST request to a restfull service running on server and I want the BODY of this request to be a JSon String. </p><p>I am using GSon to generate the JSon to send to server. The code I am using to make the POST request follows: </p><pre><code>HttpPost requisicao = new HttpPost();requisicao.setURI(new URI(uri));requisicao.setHeader(""User-Agent"", sUserAgent);requisicao.setHeader(""Content-type"", ""application/json"");HttpResponse resposta = null;//I can see the json correctly print on log with the following entry.Log.d(TAG, ""JSon String to send as body in this request ==&gt;&gt; "" + jsonString);//than I try to send JSon using setEntityMethodStringEntity sEntity = new StringEntity(jsonString, ""UTF-8"");requisicao.setEntity(sEntity);resposta = httpClient.execute(requisicao);resultado = HttpProxy.leRespostaServidor(resposta);</code></pre><p>The response code is 400 BAD REQUEST and from the server log I can read the info. where it says the body was not correctly sent: </p><pre><code>13:48:22,524 ERROR [SynchronousDispatcher] Failed executing POST /peso/cadastrar/maia.marcos@gmail.comorg.jboss.resteasy.spi.BadRequestException: Could not find message body reader for type: class java.io.Reader of content type: application/json</code></pre><p>The code for the server side is a simple Seam Rest Service: </p><pre><code>    @POST @Path(""/cadastrar/{userEmail}"") @Consumes(MediaType.APPLICATION_JSON) public String cadastraPeso(@PathParam(""userEmail"") String email, Reader jsonString) {  LineNumberReader lnr = new LineNumberReader(jsonString);  try {   String json = lnr.readLine();   if(json != null)   {    log.debug(""String json recebida do device ==&gt;&gt; "" + json);   }   } catch (IOException e) {   // TODO Auto-generated catch block   e.printStackTrace();  }   return ""OK - o e-mail processado foi ==&gt;&gt; "" + email; }</code></pre><p>What could be wrong with the Android client code? I have researched the web and did not find any really useful information on this subject.</p><p>[]s</p>","442041","","442041","","2010-09-28 18:05:36","2011-12-16 13:35:07","How do I send JSon as BODY In a POST request to server from an Android application?","<android><json><rest><post><seam>","1","0","1","",""
"3815530","1","3817657","","2010-09-28 17:42:04","0","1328","<p>I have the following code:</p><pre><code>String response = webService.webGet("""");  the response of the web serviceString LargeImage = new Gson().fromJson(response,String.class);byte[] imageByteArray = Base64.decode(LargeImage);</code></pre><p>response is like: ""iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCA... "" a Base64 encoded image having around 400.000 characters.</p><p>The response comes very quick from the web service. When it tries to parse it with Gson after a while (like 20-30 seconds) I get an error with out of memory. How can I parse this simple string without Gson, it should be fairly simple but I don't know how to do it.Please advise me. Thank you for your time</p>","379865","","","","","2010-09-28 23:07:32","Parse simple string JSon in Android","<android><gson>","2","0","","",""
"3815551","1","","","2010-09-28 17:45:40","12","789","<p>I have an application based on the MapActivity.  The application dropsItemizedOverlay items on the map as you start to move about.  It hasbeen running with no problems until I dropped it into a Nexus 2.2phone.</p><p>I'm running into a weird problem where sometimes when I zoom in/outtoo fast, or pan too fast, the MapView will go ""white"" and my Overlayitems will get shoved into the upper left hand corner.</p><p>The only error I've seen in my log is:</p><p>E/PixelConverter( 4881): Setting singular matrix Matrix{[0.0, 0.0,152.0][0.0, 0.0, 347.0][0.0, 0.0, 1.0]}</p><p>My Map keys are working fine.  I have internet permissions setup onthe phone too.</p><p>I'm scratching my head over this one.</p>","460911","","459812","","2011-02-03 00:02:13","2011-02-03 00:02:13","Weird MapView problem; PixelConverter Error","<android><map><android-mapview>","1","2","2","",""
"3815791","1","","","2010-09-28 18:12:30","1","896","<p>I currently have an app with a regular layout of buttons and widgets. On top of this I'd like to draw some animated sparks and particles and whatnot going on in response to events, so I've got it in a <code>FrameLayout</code> with another <code>View</code> on top to draw the animations. The problem is I can't work out a way of getting smooth movement out of it. I've tried a few options:</p><ul><li><strong><code>SurfaceView</code></strong>: because of the way it takes over the screen, you can't see anything behind a <code>SurfaceView</code> so the background is fully black.</li><li><strong>Override <code>View.onDraw</code> and call <code>invalidate()</code></strong>: this almost works, but invalidate isn't a very reliable way of getting a redraw to happen soon, so the motion is very jerky.</li><li><strong><code>Animation</code> framework</strong>: Testing with <code>TranslateAnimation</code>, it seems a bit smoother than using <code>onDraw()</code>, but animations are designed to run for a specific duration and I want to draw indefinitely.</li></ul><p>Anybody know any tricks to make one of these work properly, or something completely different?</p>","21399","","","","","2010-09-28 18:12:30","Smooth animation on top of regular Android View","<android><animation>","0","3","","",""
"3815899","1","3816545","","2010-09-28 18:27:26","0","456","<p>I have some images (.png format) that I use as drawables on the surface of canvas in my android app.  The problem I have is mspaint only allows a rectangular image file, so whatever I draw on the screen always shows up in a box.</p><p>Is there a (free) program or way I can edit the png files so that when they are drawn on the surface of my canvas, they are drawn to shape?</p><p>Thanks.</p>","432209","","432209","","2010-09-28 18:43:51","2010-09-28 19:57:35","Building drawable images to use on a surface canvas on android","<java><android><eclipse>","1","0","","",""
"3816121","1","3823944","","2010-09-28 19:00:21","3","2018","<p>this is the class that calls my Service:</p><pre><code>public class TicketList extends ListActivity{private ArrayList&lt;Tickets&gt; alTickets = new ArrayList&lt;Tickets&gt;();private boolean listCreated = false;private static Drawable background = null;private Resources res;private Tickets ticket = null;private TicketConnector localService;/**  * Called when the activity is first created.  *  */@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.ticketlist);    if(!listCreated)    {        connectService();        //populateList();        res = getResources();        background = res.getDrawable(R.drawable.background);        listCreated = true;    }    TicketAdapter StatisticsAdapter = new TicketAdapter(this, alTickets);    setListAdapter(StatisticsAdapter);}/** * Populates the ListView. * This needs to be done once the Activity is created and if the menu entry refresh is hit. */private void populateList(){    try    {                   String jsonString = localService.queryData(new String[] {""getTicketList""}, new String[] {""Offen""});        //String jsonString = new TicketConnector().queryData(new String[] {""getTicketList""}, new String[] {""Offen""});        JSONObject jsonObj = new JSONObject(jsonString);        JSONArray ticketArray = jsonObj.getJSONArray(""tickets"");        Tickets[] tickets = new Tickets[ticketArray.length()];        for (int i=0;i&lt;ticketArray.length();i++)        {            JSONObject object = ticketArray.getJSONObject(i).getJSONObject(""ticket"");               ticket = new Tickets(object.getString(""id""), object.getString(""color""), object.getString(""priority""));            alTickets.add(ticket);        }    }    catch (Exception e)    {        Log.e(""DayTrader"", ""Exception getting JSON data"", e);    }}private void connectService() {     Intent intent = new Intent(getApplicationContext(), TicketConnector.class);     bindService(intent, connection, Context.BIND_AUTO_CREATE);}public void getData() {     String s = localService.queryData(new String[] {""getTicketList""}, new String[] {""Offen""});}ServiceConnection connection = new ServiceConnection() {     @Override     public void onServiceConnected(ComponentName name, IBinder binder)      {         Toast.makeText(TicketList.this, ""Service connected"",Toast.LENGTH_SHORT).show();         localService = ((TicketConnector.LocalBinder)binder).getService();         Log.i(""INFO"", ""Service bound: TicketConnector"");     }     @Override     public void onServiceDisconnected(ComponentName name)      {         Toast.makeText(TicketList.this, ""Service disconnected"",Toast.LENGTH_SHORT).show();         localService = null;         Log.i(""INFO"", ""Service unbound: TicketConnector"");     } };}</code></pre><p>And this is the service:</p><pre><code>public class TicketConnector extends Service{   private SharedPreferences settings = null;// This is the object that receives interactions from clients.  See// RemoteService for a more complete example.private final IBinder binder = new LocalBinder();private String username = null;private String password = null;private String server = null;private String port = null;private String urlStr = null;private String result = null;@Overridepublic void onCreate(){    settings = CMDBSettings.getSettings(this);    username = settings.getString(""username"", """");    password = settings.getString(""password"", """");    server = settings.getString(""server"", """");    port = settings.getString(""serverport"", """");}@Overridepublic IBinder onBind(Intent intent){    return binder;}@Overridepublic void onDestroy(){}public String queryData(String[] actions, String[] category){    //http://localhost:8080/MobileCMDB/TicketListener?format=json&amp;actions=getTicketList&amp;ticketcategory=Open    urlStr = ""http://""+server+"":""+port+""/MobileCMDB/TicketListener?format="";    new jsonParser().execute(actions);    return result;}abstract class BaseParser extends AsyncTask&lt;String, Integer, String&gt;{       protected BaseParser(String format)    {        urlStr += format;    }    private String makeUrlString(String[] actions, String[] category)    {        StringBuilder sb = new StringBuilder(urlStr);        for (int i=0;i&lt;actions.length;i++)        {            sb.append(""&amp;actions="");            sb.append(actions[i]);            sb.append(""&amp;ticketcategory="");            sb.append(category[i]);        }        return sb.toString();    }    protected InputStream getData(String[] actions, String[] category) throws Exception    {        URI uri = new URI(makeUrlString(actions, category));        HttpClient client = new DefaultHttpClient();        HttpGet request = new HttpGet(uri);        request.addHeader(""Accept-Encoding"",""gzip"");        HttpResponse response = client.execute(request);        InputStream content = response.getEntity().getContent();        Header contentEncoding = response.getFirstHeader(""Content-Encoding"");        if (contentEncoding != null &amp;&amp; contentEncoding.getValue().equalsIgnoreCase(""gzip""))        {            content = new GZIPInputStream(content);        }        return content;    }    @Override    protected void onPostExecute(String jsonString)    {        result = jsonString;    }   }private class jsonParser extends BaseParser{    public jsonParser()    {        super(""json"");    }    @Override    protected String doInBackground(String... actions)     {        String[] category = new String[] {""Open""};        StringBuilder json = null;        try        {            json = new StringBuilder();            BufferedReader reader = new BufferedReader(new InputStreamReader(getData(actions, category)));            String line = reader.readLine();            while (line != null)            {                json.append(line);                line = reader.readLine();            }        }         catch (Exception e)        {            Log.e(""PrimeCMDB - Network"", ""Exception getting JSON data"", e);        }        return json.toString();    }}/** * Class for clients to access.  Because we know this service always * runs in the same process as its clients, we don't need to deal with * IPC. */public class LocalBinder extends Binder {    public TicketConnector getService()     {        return TicketConnector.this;    }}}</code></pre><p>This are the two activities in the AndroidManifest.xml:</p><pre><code>&lt;activity    android:name="".ticket.TicketList""    android:label=""@string/ticket""/&gt;&lt;service     android:name="".network.TicketConnector""     android:enabled=""true""/&gt;</code></pre><p>onServiceConnected is never executed. Did I miss something?</p><p>Here is the output of LogCat at verbose mode while activating the TicketList Activity:</p><pre><code>09-28 23:22:11.420: INFO/ActivityManager(795): Starting activity: Intent { cmp=org.mw88.cmdb/.gui.TicketListActivity }09-28 23:22:12.340: WARN/ActivityManager(795): Binding with unknown activity: android.os.BinderProxy@4410bf3009-28 23:22:16.090: INFO/ActivityManager(795): Displayed activity org.mw88.cmdb/.gui.TicketListActivity: 4606 ms (total 4606 ms)</code></pre>","102893","","174261","","2011-04-05 12:04:24","2011-04-05 12:04:24","Why are my ServiceConnection methods never executed?","<android><android-listview><android-service><android-tabhost>","2","5","1","",""
"3816457","1","4508681","","2010-09-28 19:46:22","5","3539","<p>I have made a custom preference (i.e. a preference with a custom layout) which displayed in the preferences list of a <code>PreferenceActivity</code>. </p><p>The layout is created in code. The problem is that the font of the TextView created in code looks somewhat different than Android's standard preference font. </p><p>So the solution would be to apply the style attributes of android's preference to my <code>TextView</code>. The respective styles should be <a href=""http://developer.android.com/reference/android/R.attr.html#preferenceScreenStyle"">preferenceScreenStyle</a> or <a href=""http://developer.android.com/reference/android/R.attr.html#preferenceStyle"">preferenceStyle</a> (I'm not sure).</p><p>My problem is I can't figure out how to read out android's standard style attributes, so I could set them in code. </p>","451540","","","","","2013-01-27 19:47:03","Android: Preference Style","<android><coding-style><styles><sharedpreferences>","2","0","","",""
"3816497","1","","","2010-09-28 19:50:00","0","678","<p>I am trying to programmatically resize a custom view in android.  The custom view contains a Button and an EditText in a LinearLayout.  I want to make several instances of this custom view and alter the width of each one slightly narrower than the last so that they overlap each other.  At what point can I do this and how?</p><p>If I override the custom view's <code>onWindowFocusChanged()</code> to set the width using <code>this.setLayoutParams( newWidth, LayoutParams.FILL_PARENT);</code> it crashes later on with a <code>ClassCastException</code> in the <code>LinearLayout</code>.  Like this...</p><pre><code>@Override public void onWindowFocusChanged( boolean changed ){    super.onWindowFocusChanged( changed );    // reset the width    int fullWidth = this.getWidth();    if( fullWidth &gt; 0 )    {        int width = fullWidth - (20 * (viewNumber));        this.setLayoutParams(new LinearLayout.LayoutParams( width, LayoutParams.FILL_PARENT));    }}</code></pre><p>So, obviously, this is not the way to do it.  How then?</p><p>Thanks.</p>","461023","","415347","","2011-09-05 12:34:51","2014-03-31 16:40:20","Programmatically resizing a custom view?","<android><custom-view>","0","2","","",""
"3816501","1","3817057","","2010-09-28 19:50:45","0","1078","<p>I want to dynamically load a ListView, for example, load them during the scrolling so its not loading all 100 posts I have. How can I achieve this?</p><p>I have looked at similiar solutions here at SO, but since I not got it to work, I asked this question.</p><p>My code:</p><pre><code>//orders is my is my ArrayList&lt;WithMyOwnOrderClass&gt; that handling orders/* adapter is my inner private class in this piece of code, that triggingthe getView */if(orders != null &amp;&amp; orders.size() &gt; 0){ for(int i=0;i&lt;orders.size();i++){               adapter.add(orders.get(i)); }            adapter.notifyDataSetChanged();            progressDialog.dismiss(); }</code></pre><p>I have in the same .java file, functions to download the info from the web and loop through 100 items, like this:</p><pre><code>JSONObject jObject = new JSONObject(queryResult);SONArray docsArray = jObject.getJSONArray(""array"");   for (int i = 0; i &lt; 100; i++) {      try {                  title = docsArray.getJSONObject(i).optString(""title"");             } catch (JSONException e) {}          }</code></pre><p>and then it add a new order correctly and so on.But now!(?) I want to have so when the first item is loaded, it should appear and when scrolling it loads gradually.</p><p>Hope that this can be achieved and thanks in advance for any help!</p>","386562","","","","","2010-09-28 21:05:58","Dynamically loading ListView","<android>","1","0","1","",""
"3816552","1","","","2010-09-28 19:58:03","0","1551","<p>I have subclassed Overlay as LandMarkOverlay (and implemented an onTap(GeoPoint) method).</p><p>In the main activity I do this: </p><pre><code>    setContentView(R.layout.main);    MapView mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    landmarkOverlay = new LandmarkOverlay();    //add the landmarkOverlay to the list    mapView.getOverlays().add(landmarkOverlay);</code></pre><p>What else do I need to do so that when the user taps the screen, <code>landmarkOverlay</code>'s <code>onTap(GeoPoint)</code> method gets called?</p>","224428","","224428","","2010-09-28 20:24:01","2011-09-05 12:34:19","Android: add overlay to MapView?","<android><android-mapview><android-maps>","1","0","","",""
"3816561","1","3833186","","2010-09-28 19:59:17","4","2679","<p>is there any way to navigate to multiple destinations? like you can do on google maps?</p>","219554","","","","","2012-11-19 17:54:04","android intent to navigate to multiple destinations?","<android><navigation><android-intent>","2","2","3","",""
"3816642","1","3819991","","2010-09-28 20:11:19","5","8182","<p>I'd like to create an app for iOS that does VOIP, presumably by interacting with a website. I can start with Android too.</p><p>Does anyone know of any tutorials, suggestions or libraries that would be of any use. </p><p>(The app would need to be rewritten for BB and android eventually, too.)</p><p><strong>EDIT:</strong></p><p>Bonus: What is SIP?</p>","224988","","224988","","2010-09-29 06:22:04","2013-12-04 06:31:17","Getting started with a VOIP app for iOS or Android?","<iphone><android><blackberry><voip><sip>","4","0","6","",""
"3816943","1","3817266","","2010-09-28 20:50:38","0","1312","<p>Is there any event triggered on an activity when I call </p><pre><code>startActivity(""activity_id"", myIntent);</code></pre><p>If the Activity exists already.</p><p>I pass a parameter to the activity via </p><pre><code>i.putExtra(""someID"", someSerializableObject );  </code></pre><p>and would like to call a method to refresh a WebView.</p><p>Right now, the call on startActivity brings the activity in the foreground but the webview does not display what i want.</p>","271395","","","","","2010-09-28 21:44:45","Activity events on startActivity","<android><activity>","1","1","","",""
"3816946","1","","","2010-09-28 20:50:56","0","761","<p>I am trying to create a table of 7 rows and 7 columns of ImageButtons - buttons with image resource added from the drawable folder.The problem is I can only see the first button and the rest go off screen. How do I scale the image or the buttons so all 49 can be viewed on screen?The following is the main.xml file. Any help would be great!! Thank you!</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TableRow&gt;    &lt;ImageButton      android:id=""@+id/r0c0""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/frog""     android:scaleType=""centerInside""    /&gt;    &lt;ImageButton      android:id=""@+id/r0c1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:src=""@drawable/frog""        android:scaleType=""centerInside""    /&gt;    &lt;!--  5 more ImageButtons go here --&gt;&lt;/TableRow&gt;&lt;TableRow&gt;    &lt;ImageButton      android:id=""@+id/r1c0""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:src=""@drawable/frog""     android:scaleType=""centerInside""    /&gt;    &lt;ImageButton      android:id=""@+id/r1c1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:src=""@drawable/frog""        android:scaleType=""centerInside""    /&gt;    &lt;!--  5 more ImageButtons go here --&gt;&lt;/TableRow&gt;&lt;!-- 5 more TableRows go here --&gt; &lt;/TableLayout&gt;</code></pre>","461085","","","","","2010-09-28 22:20:22","Android: Problem fitting a table of ImageButtons within the screen","<android>","1","0","","",""
"3817030","1","3945100","","2010-09-28 21:01:59","7","6136","<p>We're planning to use Google Analytics to track ad click-through referrals, through the Android Market, to our application.</p><p>According to the <a href=""http://code.google.com/apis/analytics/docs/mobile/android.html#google-play-tracking"" rel=""nofollow"">Google Documentation</a> the referrer tag comes through via an intent, and is automatically recorded by the Google Analytics library.</p><p>That's great, but we need to extract that referral tag for our own internal analytics.  The documentation is shy on details about how to grab it out of the initial launch intent, and instructions on how to simulate this before going live.</p><p>Does anyone have experience with this?</p>","205192","","229091","","2012-03-19 22:54:07","2013-10-02 08:15:45","Get Android Google Analytics referrer tag","<android><google-analytics><google-play>","2","0","11","",""
"3817141","1","","","2010-09-28 21:19:50","0","2794","<p>The following code snippet draws a red rectangle:</p><pre><code>RectF rectangle = new RectF(50, 100, 100, 50);Paint paint = new Paint();paint.setColor(Color.RED);canvas.drawRoundRect(rectangle, 0, 0, paint);</code></pre><p>However if i change rx and ry both to a positive value, say 5, than nothing is shown. Any ideas?</p>","461103","","","","","2010-09-29 05:30:36","drawRoundRect not showing rounded corners or nothing at all","<android>","1","0","","",""
"3817159","1","3818577","","2010-09-28 21:23:42","1","1188","<pre><code>public class XPBN extends Activity{private Map _map;@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    final Map data = (Map)getLastNonConfigurationInstance();    if (data == null) {        Toast.makeText(this, ""New Map"", Toast.LENGTH_SHORT).show();        _map = new Map(this);    } else {        Toast.makeText(this, ""Old Map"", Toast.LENGTH_SHORT).show();        _map = (Map)data;    }    setContentView(_map);}@Overridepublic Object onRetainNonConfigurationInstance() {    Toast.makeText(this, ""Saving Configuration..."", Toast.LENGTH_LONG).show();    return _map;}}</code></pre><p>I am going to suppose that the title I gave this forum-thread states the problem I am experiencing pretty thoroughly.  I have also edited the code to try to save a string object and then recover the string object through the getLastNonConfigurationInstance(), just to see to what extent I could get it to work for me, but it still seemed to return null.  I have not tried calling it from onStart() or onRestart() or onResume(), but from what I have read, it is usually only called from onCreate(Bundle) anyways.  This has got me really confused... :/</p><p>I figured it may be of some help to know a little about my Map class object, so here's (some of) the code from it:</p><pre><code>public class Map extends SurfaceView implements SurfaceHolder.Callback{private MapThread _mapThread;private int _terrain[][];private ArrayList&lt;Player&gt; playerList;private Bitmap _blueback;private Bitmap _bluefront;private Bitmap _blueleft;private Bitmap _blueright;private Bitmap _greenback;private Bitmap _greenfront;private Bitmap _greenleft;private Bitmap _greenright;private Bitmap _redfront;private Bitmap _redback;private Bitmap _redleft;private Bitmap _redright;private Bitmap _robot1;private Bitmap _forest;private Bitmap _grass;private Bitmap _mountain;private Bitmap _tree;@SuppressWarnings(""unused"")private boolean _mapLoaded = false;private int _viewX = 0;private int _viewY = 0;Map(Context context){    super(context);    getHolder().addCallback(this);    _mapThread = new MapThread(this);    setFocusable(true);    _terrain = new int[100][100];    playerList = new ArrayList&lt;Player&gt;();    addPlayer(0, 0, 0);    _blueback = BitmapFactory.decodeResource(context.getResources(), R.drawable.blueback);    _bluefront = BitmapFactory.decodeResource(context.getResources(), R.drawable.bluefront);    _blueleft = BitmapFactory.decodeResource(context.getResources(), R.drawable.blueleft);    _blueright = BitmapFactory.decodeResource(context.getResources(), R.drawable.blueright);    _greenback = BitmapFactory.decodeResource(context.getResources(), R.drawable.greenback);    _greenfront = BitmapFactory.decodeResource(context.getResources(), R.drawable.greenfront);    _greenleft = BitmapFactory.decodeResource(context.getResources(), R.drawable.greenleft);    _greenright = BitmapFactory.decodeResource(context.getResources(), R.drawable.greenright);    _redback = BitmapFactory.decodeResource(context.getResources(), R.drawable.redback);    _redfront = BitmapFactory.decodeResource(context.getResources(), R.drawable.redfront);    _redleft = BitmapFactory.decodeResource(context.getResources(), R.drawable.redleft);    _redright = BitmapFactory.decodeResource(context.getResources(), R.drawable.redright);    _robot1 = BitmapFactory.decodeResource(context.getResources(), R.drawable.robot1);    _forest = BitmapFactory.decodeResource(context.getResources(), R.drawable.forest);    _grass = BitmapFactory.decodeResource(context.getResources(), R.drawable.grass);    _mountain = BitmapFactory.decodeResource(context.getResources(), R.drawable.mountain);    _tree = BitmapFactory.decodeResource(context.getResources(), R.drawable.tree);    TouchScreenHandler handler = new TouchScreenHandler(); // This includes 2 other nested-class threads    this.setOnTouchListener(handler);}</code></pre><p>Perhaps there lies something in the complexity of the Object returned by onRetainNonConfigurationInstance() that might be contributing to my problems?</p><p>Or lastly is there something (like a Activity or Application property) in my Manifest.xml file that is the problem?</p><p>If any further information is required, please let me know, as I will be checking back on this post frequently until I can get past this little bump in the road.<br>PS: I have this problem with both ADB and my device.<br>PSS: most importantly, a big THANKS to this community for the help and support, as it is greatly appreciated! :D</p>","461074","","415347","","2011-09-05 12:29:28","2012-10-23 21:30:41","Problem with getLastNonConfigurationInstance() - Seems to only ever return null","<java><android><state><resume>","2","2","","",""
"3817252","1","3817552","","2010-09-28 21:42:15","1","2989","<p>I was wondering what the best approach is on Android to retrieve information from a HTML page hosted on the internet?</p><p>For example I'd like to be able to get the text from the following page at the start of each day:</p><p><a href=""http://www.met.ie/forecasts/sea-area.asp"" rel=""nofollow"">http://www.met.ie/forecasts/sea-area.asp</a></p><p>I have been downloading and parsing XML files but I have never tried to parse information from a HTML type file before.</p><p>Is there a native way to parse the information I want?</p><p>Or do I need a third party library?</p><p>Or do I need to look into screen scraping?</p>","243999","","","","","2011-03-09 14:15:30","Android - Options for pulling data from a website? (HTML)","<html><android><html-parsing>","3","1","1","",""
"3817272","1","","","2010-09-28 21:45:36","34","9430","<p>I'm designing an android app which will need to do the following steps:</p><ol><li>user pushes a button or otherwise indicates to ""sync data"".</li><li>sync process will use REST web services to move data to and from the server.</li><li>the data will be stored locally in a sqlite database.</li><li>the sync process should provide status updates/messages to the UI </li><li>the user should not be allowed to wander off to other parts of the application and do more work during the sync process.</li></ol><p>The first time the sync process runs, it may take 10-20 minutes.After the initial sync, less data will be transferred and stored andI expect the process to take 1-2 minutes or less.</p><p>I've been doing a lot of reading about android's <code>AsyncTask</code> and various examples of using a Service ... But I don't fully understand the design considerations and trade-offs of choosing one design over the other.  I currently have my demo project stubbed out using an AsyncTask.  After watching (most of) Developing Android REST client applications:  <a href=""http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html#"">http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html#</a> I'm left confused the design patterns described here feel overlycomplex, perhaps because I just ""don't get it"" yet.</p><p>I come from a java, spring, web and desktop application background.  Thinking and designing in terms of a handheld device is quite new to me. (What happens when the screen layout is changed? What happens when the phone rings while I'm running a sync?)  Taking 2 steps back, if the initial sync IS going to be such a long running process, is there a better way for me to think about the problem->solution, the user experience, the user expectations of an application running on a phone? </p><p>Would love to hear from some more experienced android developers out there who have already wrestled with these questions.</p>","457784","","44133","","2012-03-14 00:20:43","2013-02-25 23:05:52","android design considerations: AsyncTask vs Service (IntentService?)","<android>","4","2","26","",""
"3817304","1","","","2010-09-28 21:52:53","1","79","<p>I have a app with a list of urls, I can create a class that will link to the urls and open the link within the browser, trouble is I have more than 100 urls and I dont think it would be practical to create a class for each of those urls.  So I want to create a class that will get the correct url based on the users selection from a list.  I have 92 chioces with 4 or 5 links attached to each, which is the best way to do this??</p><p>Thanks in advance</p>","445174","","","","","2010-09-28 22:31:13","Creating a list of URL's","<java><android><eclipse><url-routing>","1","0","","",""
"3817480","1","3817602","","2010-09-28 22:29:32","1","893","<p>I'm writing a customized view similar to Grid which will be used to hold a large amount of images. I'm using ImageButton to display the images, and I only want to load images onto the buttons once they are on the screen (and just display a static background image when they are not). The reason for it is that I'm fetching images from some back-end service and I only want to fetch them when the buttons are on the screen. </p><p>To do that, I'd like to know if the widget is on the screen. Is it possible to detect if a widget like button is on/off screen? If not, any suggestions on how to achieve what I'm trying to do?</p>","436323","","436323","","2010-09-28 23:09:41","2011-07-03 10:03:34","How to detect if a widget is on/off screen?","<android><android-widget>","2","0","1","",""
"3817628","1","3817686","","2010-09-28 22:59:06","6","6398","<p>When overriding the baseadapter on an android listview, you have to implement this method <code>public View getView(int position, View convertView, ViewGroup parent)</code>. The convertview is the view that was previously pushed off the list when scrolling, and it's given so that you can reuse that view instead of creating a new view.</p><p>My question is, is it really necessary to reuse the view? I can understand reusing it if only a piece of the data is changed. But is the overhead of creating a view really THAT significant? Every tutorial on using listviews I've seen tells you to recycle the view, even on trivially simple views like a textview.</p><p>I guess my question is why did google decide to make this the default behavior of the <code>getView</code> method?</p>","375874","","","","","2010-09-29 03:40:59","Recycling views in a listview, worth it?","<android><listview><android-arrayadapter>","2","1","3","",""
"3817658","1","","","2010-09-28 23:07:59","0","400","<p>I need to import a couple of jars that where compiled under the full implementation of java. I know that Android doesn't use all the packages that java has to offer. My question is: Is it possible to import them without creating errors? Is there a tool that can convert jars to android jars? if so, can some examples be provided. Any help is much appreciated.</p>","461176","","","","","2010-09-29 00:04:39","How can I use jar libraries in Android compiled with packages that Android doesn't have","<android><jar><import><dex><dx>","1","1","","",""
"3817662","1","5640142","","2010-09-28 23:09:01","2","2271","<p>In my android application, I use a listview and some linear layout on wich the user can click.</p><p>Of course, I had to set the background of my LinearLayout to a xml file where the stated pressed, selected are defined:</p><pre><code> myView.setBackgroundDrawable( getDrawable(android.R.drawable.list_selector_background));</code></pre><p>So no problem I set the drawable to transparent when normal use and orange when clicked.</p><p>My only problem is that on the galaxy S and some other customized phone (Sense UI) the color of the listview clicked is blue or green!</p><p><img src=""http://i.stack.imgur.com/UUiKP.jpg"" alt=""http://img.skitch.com/20100928-fuq6ie4uxipguxug9yyinwher.jpg"">    <img src=""http://i.stack.imgur.com/uTKsc.jpg"" alt=""alt text""></p><p>So I need to pick this color to set it to the background of my linearlayout.I don't want to mix orange and blue, or orange and green for my user!</p><p>Where can I get this color???That woule be really helpfull!</p>","327402","","","","","2011-04-12 19:12:19","Getting the Listview default clicked color, depending on the Device","<android><listview><colors><default><device>","1","2","","",""
"3817667","1","","","2010-09-28 23:10:27","9","8669","<p>Can someone point me to a tutorial on using the android scripting enviornment? I've seen plenty of tutorials on how to write python code using the android API especially from <a href=""http://code.google.com/p/android-scripting/wiki/Tutorials"">http://code.google.com/p/android-scripting/wiki/Tutorials</a>. </p><p>But none of what I've seen gives a good example of how this all works inside android or how to call your python stuff from an android application. I'm looking for a tutorial that basically can bring it all together just so I can see an example of an actual android app running python scripts.</p>","375874","","","","","2014-02-18 08:08:50","Writing python (or any other SL4A) in android","<python><android><android-scripting><sl4a>","2","2","6","2014-02-19 11:15:21",""
"3817668","1","10783306","","2010-09-28 23:10:43","1","2915","<p>Im having problems with the MapView because its not loading the map. I've been reading around, and find many people with the same issue. I checked all the possible issues and it seems that everything is ok :P</p><ul><li><p>On the Manifest, the  is inside the  tag</p></li><li><p>I have the  before the  tag</p></li><li><p>In the emulator the 3G is working properly since i can navigate with the browser and Google Maps loads perfectly</p></li><li><p>I checked twice my ApiKey, and seems to be ok. Im using Windows, so in the cmd i navigate to the folder where the Java Keytool is located, once there i execute the next command to get the fingerprint and then my ApiKey: </p></li></ul><blockquote>  <p>keytool -list -alias androiddebugkey  -storepass android -keypass android -key store c:\path\where\the\file\is\located\debug.keystore</p></blockquote><p>Here is some of my code:</p><pre><code>public class mapa extends MapActivity { private MapView mMapView = null;   private MapController mc = null; /** Called when the Activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  setContentView(R.layout.mapa);  GeoPoint gPoint = new GeoPoint(40331175,-3765780);  mMapView = (MapView) findViewById(R.id.mView);  mMapView.setSatellite(true);  mMapView.setBuiltInZoomControls(true);  mc = mMapView.getController();  mc.setZoom(15);  mc.setCenter(gPoint);     }</code></pre><p>The XML layout:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:orientation=""vertical""&gt; &lt;com.google.android.maps.MapView  android:id=""@+id/mView""  android:layout_width=""fill_parent""   android:layout_height=""375dp""  android:padding=""5dp""  android:enabled=""true""   android:clickable=""true""   android:apiKey=""My_Api_Key"" /&gt; &lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""3dp""    android:orientation=""vertical""&gt;    &lt;TextView     android:id=""@+id/tMapa""   android:text=""Último dato""   android:layout_width=""wrap_content""       android:layout_height=""wrap_content"" /&gt;     //Here i have some other info, but its not relevant to the problem, since all this views loads properly :P   &lt;/RelativeLayout&gt;       &lt;/LinearLayout&gt;</code></pre><p>AndroidManifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.pfc.android""      android:versionCode=""1""      android:versionName=""1.0""&gt;         &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE"" /&gt;    &lt;uses-permission android:name=""android.permission.INERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.WRITE_GSERVICES"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;     &lt;uses-library android:name=""com.google.android.maps"" /&gt;                &lt;!-- I've got here some others Activities declared --&gt;  &lt;!-- This is the map Activity --&gt;  &lt;activity android:name="".mapa""      android:label=""@string/app_name""      class="".mapa""&gt;  &lt;/activity&gt; &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""4"" /&gt;&lt;/manifest&gt; </code></pre><p>So, i dont know what else can i do to solve the issue.</p><p>Can anybody help me? :D</p>","446234","","","","","2012-05-28 10:44:21","Android MapView is not loading","<android><google-maps><android-mapview><android-manifest>","3","0","0","",""
"3817689","1","","","2010-09-28 23:14:53","1","1223","<p>Howdy, I am trying to combine the <a href=""http://developer.android.com/resources/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">TabWidget</a> and <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">ListView</a> Tutorials. Also I added a couple of buttons with no functions right now. Each tab is supposed to be a ListView (for right now). I run the app and it launches as just a ListView and no tabs. Here is the main.xml used in TabaWidget.java:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dp""&gt;    &lt;LinearLayout    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""50dp""    android:gravity=""center_horizontal"" &gt;    &lt;Button        android:id=""@+id/MainMenu""        android:layout_width=""120dp""        android:layout_height=""wrap_content""        android:layout_gravity=""center_horizontal""        android:text=""Main Menu"" /&gt;    &lt;Button        android:id=""@+id/Sort""        android:layout_width=""120dp""        android:layout_height=""wrap_content""        android:layout_gravity=""center_horizontal""        android:text=""Sort"" /&gt;   &lt;/LinearLayout&gt;&lt;TabHost    android:id=""@android:id/tabhost""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;        &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;&lt;/LinearLayout&gt;</code></pre><p>If the problem doesn't lye in there, then I can post other code as well. Thanks in advance.</p>","413926","","244296","","2010-09-28 23:43:35","2010-09-28 23:43:35","Tab Widget and Listview combo","<android><listview><tabwidget>","0","2","0","",""
"3817724","1","","","2010-09-28 23:21:17","0","967","<p>I am dynamically serving an image from my server, and attempting to display it in an img tag on an Android phone. This works perfectly in the normal Android browser, but when I try it in my app's Webview I just get a question mark.</p><p>Running Android 2.1.1 on a Nexus One</p>","266255","","85950","","2012-03-22 19:09:40","2012-03-22 19:09:40","Image with dynamic src loads in Android browser, but not in Webview","<java><android><webview>","1","5","","",""
"3817776","1","","","2010-09-28 23:33:58","3","4930","<p>I have the following ListView, and have followed the answer from this SO Question w/ no luck: </p><p><a href=""http://stackoverflow.com/questions/2038040/android-listview-selector-color"">http://stackoverflow.com/questions/2038040/android-listview-selector-color</a></p><pre><code>&lt;ListView android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""            android:id=""@+id/ARListView""             android:background=""@drawable/transparent_background""             android:cacheColorHint=""#00000000""             android:listSelector=""@drawable/ar_selector""             android:drawSelectorOnTop=""true""&gt;</code></pre><p></p><p><strong>Here is my ar_selector.xml</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;item android:state_enabled=""false"" android:state_focused=""true""        android:drawable=""@android:color/transparent"" /&gt;  &lt;item android:state_pressed=""true""        android:drawable=""@color/solid_red"" /&gt;  &lt;item android:state_focused=""true""        android:drawable=""@android:color/transparent"" /&gt;&lt;/selector&gt;</code></pre><p>When I press down on a ListViewItem nothing appears.</p>","19875","","","","","2013-06-29 02:32:35","Problem setting ListView selector color when pressed","<android><listview><selector><listviewitem>","1","1","2","",""
"3817846","1","","","2010-09-28 23:51:27","1","325","<p>I am working on learning Android programming. I am attempting to build an app that shows a list of items, and when the user clicks on an item, it will display an image of that item, as well as information about it. I'm not sure the best way to present this information. Would using the Toast widget be best? Or TextView? Or, is there another way, like creating a new activity, that makes more sense? </p><p>After the user clicks on the list item, and reads the presented info, they should be able to return to the list.</p><p>Any advice on next steps is greatly appreciated!</p><p>Thanks,</p><p>Mark</p>","461197","","","","","2010-09-28 23:59:44","Ways To Show Info Related To ListActivity Items (Toast, New Page, etc)","<android><listactivity><listadapter><toast>","1","0","","",""
"3817866","1","","","2010-09-28 23:58:06","0","621","<p>I've seen questions like this asked before on here, but for my next app creation I would like to bring back the Apple click wheel used for scrolling on the old iPods and I've seen it in Iron Man 2 when Tony Stark used his futuristic phone and a touch screen click wheel on his smartphone. There must be an easy way to copy the iPod click wheel. I've seen the rolling time selectors but that's not what I am looking for.</p>","458474","","881229","","2014-01-21 21:20:20","2014-01-21 21:20:20","Designing an Apple Ipod scrollwheel on Android?","<android><ipod>","0","2","","",""
"3817886","1","3818631","","2010-09-29 00:03:24","0","1120","<p>I've narrowed down the problem to WebView; my application force closes every time.  If I take out the WebView and put in a color change button or something, the case switching works and the application loads.  I'm fairly new to the plaform, but I'm (mostly) copying directly from examples here for WebViews.</p><p>Application.java</p><pre><code>package com.xxxx.xxxxx;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.webkit.WebView;public class Application extends Activity {  @Override  public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);  }  public void myClickHandler(View view) {   WebView engine = (WebView) findViewById(R.id.webview);   switch (view.getId()) {       case R.id.Button1:        engine.loadUrl(""http://digg.com"");        break;       case R.id.Button2:        engine.loadUrl(""http://reddit.com"");        break;    }     }} </code></pre><p>main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView    android:id=""@+id/ScrollParent""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;  &lt;LinearLayout android:id=""@+id/MainMenuLayout""  android:layout_width=""310px""   android:layout_height=""fill_parent""   android:orientation=""vertical""&gt;   &lt;TextView     android:id=""@+id/Application""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:text=""Application Name..."" /&gt;   &lt;Button android:id=""@+id/Button1""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""Digg""         android:onClick=""myClickHandler""/&gt;        &lt;Button android:id=""@+id/Button2""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""Reddit""         android:onClick=""myClickHandler""/&gt; &lt;/LinearLayout&gt; &lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""  &gt;       &lt;WebView      android:id=""@+id/webview""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""/&gt; &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>AndroidManifest.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.qxmd.ecgguide""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".Application""                  android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre>","375566","","","","","2010-09-29 04:02:04","Android 1.6 SDK WebView Issue","<java><android><android-webview><android-sdk-1.6>","1","0","","",""
"3818013","1","3868898","","2010-09-29 00:36:30","2","5414","<p>I have A game to which I recently added a global high score functionality which made a lot of people upset so I want to add the option of disabling it.What I did was this: in my settings activity view, I added the following:</p><pre><code>&lt;!-- High Score Tracking --&gt; &lt;LinearLayout android:layout_weight=""40""  android:layout_width=""fill_parent"" android:layout_height=""wrap_content""  android:orientation=""vertical"" android:padding=""5dip""&gt;  &lt;LinearLayout android:layout_width=""fill_parent""   android:layout_height=""wrap_content""&gt;   &lt;CheckBox android:text=""@string/EnableHighscoreCBText""    android:id=""@+id/EnableHighscoreCB"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;   &lt;/CheckBox&gt;  &lt;/LinearLayout&gt;  &lt;!-- High score specific settings --&gt;  &lt;LinearLayout android:layout_width=""fill_parent""   android:layout_height=""wrap_content"" android:orientation=""horizontal""   android:weightSum=""100"" android:padding=""5dip""&gt;   &lt;CheckBox android:text=""@string/EnableShareScoresCBText""    android:id=""@+id/EnableShareScoresCB"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;   &lt;/CheckBox&gt;   &lt;TextView android:id=""@+id/DefaultPlayerNameTv""    android:layout_width=""wrap_content"" android:layout_weight=""30""    android:layout_height=""wrap_content"" android:text=""@string/pDefName""    android:textSize=""18sp""&gt;   &lt;/TextView&gt;   &lt;EditText android:id=""@+id/PlayerNameEt""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    android:text=""@string/pNameDefVal"" android:layout_weight=""70""    android:textSize=""18sp"" android:maxLength=""20""&gt;   &lt;/EditText&gt;  &lt;/LinearLayout&gt; &lt;/LinearLayout&gt;</code></pre><p>What I want to do is to disable the entire ""High score specific settings"" layout when the user unchecks the enable high score tracking check box.I tried disabling it by setting the <code>setEnabled</code> to false, but that didnt work at all...Should I be using a viewgroup or something?Is there a refresh method I should run to apply the change?Thanks,e.</p><p>[bump?]</p>","380168","","380168","","2010-10-01 21:34:25","2011-03-10 09:28:51","Is there a way to disable all the items in a specific layout programmaticaly?","<android><gui>","3","2","","",""
"3818051","1","","","2010-09-29 00:47:48","3","1192","<p>I saw the Android app ""Mobisle Notes Free"" implement a really cool ListView, where a row gets moved to the bottom if its checkbox is checked. It's not just a simple refresh, but an actual animation where you see the row travel to the bottom. Does anyone know how to implement this?</p>","456208","","456208","","2011-01-11 20:03:44","2011-01-11 20:03:44","Animate rows within a ListView","<android><listview><animation>","1","2","2","",""
"3818245","1","","","2010-09-29 01:53:25","0","733","<p>Hi am new to android my requirement is to taking picture and storing it into an sdcard and retriving it as an object. Is there any code? plz help me</p>","461255","","","","","2010-09-29 05:41:37","capturing picture storing into sdcard","<android>","1","0","","",""
"3818255","1","3818724","","2010-09-29 01:58:07","0","1296","<p>Initially I use hashtable in my android application. The key point I love hashtable is it is able to store complex item such as: coordinate-->float[2], velocity-->float[2].</p><p>But from many samples, using SQLlite table in android seems more efficient but it may only store all the values in one row defined by rowID. </p><p>So can anyone enlighten me on this problem? using hash table or SQL lite is more feasible?Can hashtable keep the data if I exit the application?</p>","306103","","","","","2010-09-29 04:29:25","Using hashtable or SQL Lite in my android application","<android><hashtable><sqlite>","2","0","","",""
"3818284","1","","","2010-09-29 02:10:01","5","3513","<p>I'm implementing a fairly standard app with the Android sdk that involves drawing using the SurfaceView, SurfaceHolder, Callback setup.</p><p>In my main thread (UI thread) I have no drawing or handling of the SurfaceHolder (or the canvas you retrieve with it).</p><p>In a separate thread I have the following:</p><pre><code>Log.i(""GAME.DrawThread"", ""run()"");        Log.i(""GAME.DrawThread"", Thread.currentThread().getName());        Canvas canvas = null;        try {            canvas = holder.lockCanvas();            synchronized(holder) {                Log.i(""GAME"", ""draw():synchronized"");                Paint paint = new Paint();                paint.setColor(R.color.draw_color);                canvas.drawColor(R.color.draw_color);                canvas.drawLine(0, 0, 500, 500, paint);            }        } catch (SurfaceHolder.BadSurfaceTypeException e) {            Log.e(""GAME"", ""onDraw():  BadSurfaceTypeException"");        } finally {            if (canvas != null) {                holder.unlockCanvasAndPost(canvas);            }        } </code></pre><p>This code is being executed, throws no exceptions, and has no negative side effects that I can find; however, the unlockCanvasAndPost() call never causes onDraw() to be called.</p><p>In other words, unlockCanvasAndPost() does not cause a redraw of the SurfaceView.</p><p>Any ideas what could cause this symptom?  I have plenty of java experience, a fair amount of android experience, and a lot of debugging experience and cannot track this one down.</p><p>Thanks in advance.</p>","21305","","","","","2011-03-20 18:35:07","Android SurfaceHolder.unlockCanvasAndPost() does not cause redraw","<java><android><draw><surfaceview>","3","1","2","",""
"3818359","1","3818373","","2010-09-29 02:30:09","0","1932","<p>I have a file called <code>nochart.png</code> in <code>/drawable</code>.</p><p>How can I set this to an ImageView?</p><pre><code>chartImageView.setImageDrawable(R.drawable.nochart);</code></pre><p>Does not compile.</p>","19875","","","","","2010-09-29 04:52:39","How to set a PNG file to an ImageView?","<android><png><imageview><drawable>","2","0","","",""
"3818531","1","3819471","","2010-09-29 03:29:36","2","2604","<p>I have a list view with 100 different images. My cache looks like the following,</p><pre><code>public class ImageCache {    HashMap&lt;String, SoftReference&lt;Drawable&gt;&gt; myCache;    ....    ....    public void putImage(String key, Drawable d) {        myCache.put(key, new SoftReference&lt;Drawable&gt;(d));    }    public Drawable getImage(String key) {        Drawable d;        SoftReference&lt;Drawable&gt; ref = myCache.get(key);        if(ref != null) {            //Get drawable from reference            //Assign drawable to d        } else {            //Retrieve image from source and assign to d            //Put it into the HashMap once again        }        return d;    }}</code></pre><p>I have a custom adapter in which I set the ImageView's icon by retrieving the drawable from my cache.</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    String key = myData.get(position);    .....    ImageView iv = (ImageView) findViewById(R.id.my_image);    iv.setImageDrawable(myCache.getImage(key));    .....}</code></pre><p>But when I run the program, most of the images from the ListView disappears after a while and some of them are not even there at the first place. I replaced the HashMap with a hard reference instead. Like,</p><pre><code>HashMap&lt;String, Drawable&gt; myCache</code></pre><p>And that piece of code works. I want to optimize my code. Any suggestions.</p>","421372","","","","","2013-03-19 13:16:06","Lazy loading of Drawable fails in SoftReferences","<android><optimization><user-interface><listview><lazy-loading>","2","0","2","",""
"3818545","1","3857438","","2010-09-29 03:34:48","3","1496","<p>I'm writing a widget with a configuration activity which calls the following method when its <code>OK</code> button is clicked:</p><pre><code>private void ok(){    // ...Do Widget Configuration...    // Force an update    Context context = getApplicationContext();    RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);    AppWidgetManager.getInstance(context).updateAppWidget(widget_id, views);    // Return the expected result    Intent result = new Intent();    result.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget_id);    setResult(RESULT_OK, result);    finish();}</code></pre><p>This is almost verbatim from <a href=""http://developer.android.com/guide/topics/appwidgets/index.html#Configuring"" rel=""nofollow"">the documentation</a>.  <code>widget_id</code> holds the widget ID that was dug up during the activity's <code>onCreate()</code>.</p><p>When I place an instance of the widget on the home screen, I've verified that I get the expected sequence of events:</p><ul><li><code>onReceive()</code> gets an <code>ACTION_APPWIDGET_ENABLED</code> if it's the first one.</li><li><code>onUpdate()</code> gets called (in which I detect that the widget isn't configured and draw something as a default action).</li><li>The configuration activity appears.</li><li>When I press <code>OK</code>, the <code>ok()</code> method above gets called.</li></ul><p>The method gets all the way through to the <code>finish()</code> and the configuration activity goes away, but there's no call to <code>onUpdate()</code> or <code>onReceive()</code> after this point.  (The widget itself has no <code>updatePeriodMillis</code>.)  I end up with a widget on the screen that has the results of my default action but never gets updated.</p><p>If I set the widget up without a configuration activity, it gets updated when created and everything works as expected (just without the configured bits).</p><p>Am I missing something in the way I force an update?</p><p>Thanks!</p>","180674","","","","","2013-05-01 12:09:05","How do I force an update in a configuration activity?","<android><android-widget>","1","2","1","",""
"3818568","1","3818611","","2010-09-29 03:45:10","2","2249","<p>i have a String displayed on a WebView as  ""Siwy &amp; Para Wino""</p><p>i fetch it from url , i got a string ""Siwy%2B%2526%2BPara%2BWino"".     // be corrected</p><p>now i'm trying to use URLDecoder to solve this problem :</p><pre><code>String decoded_result = URLDecoder.decode(url); // the url is ""Siwy+%26+Para+Wino""</code></pre><p>then i print it out , i still saw  ""Siwy+%26+Para+Wino""</p><p>Could anyone tell me why?</p>","422405","","415347","","2011-09-05 12:22:10","2011-09-05 12:22:10","android java URLDecoder problem","<android>","2","0","1","",""
"3818713","1","","","2010-09-29 04:24:53","0","1055","<p>I have 2 <code>ListView</code> in a layout. I want each <code>ListView</code> show all their items. And scroll the whole layout.</p>","461323","","415347","","2011-09-05 12:21:49","2011-09-05 12:21:49","I want to scroll two ListView in a layout","<android><listivew>","1","1","","",""
"3818745","1","3819146","","2010-09-29 04:32:50","16","11159","<p>I am trying to pass a HashMap to a new activity using the intent.puExtra function.  Stepping through the debugger it seems that it adds the HashMap no problem, however when startActivty() is called I get a runtime error stating that Parcel: unable to marshal value com.appName.Liquor.</p><p>Liquor is a custom class that I created, and I believe it, in combination with a HashMap, is causing the problem.  If I pass a string rather than my HashMap it loads the next activity no problem.</p><p>Main Activity</p><pre><code>lv.setOnItemClickListener(new OnItemClickListener() {   public void onItemClick(AdapterView&lt;?&gt; parent, View view,      int position, long id) {      String cat = ((TextView) view).getText().toString();      Intent i = new Intent(OhioLiquor.this, Category.class);      i.putExtra(""com.appName.cat"", _liquorBase.GetMap());      startActivity(i);</code></pre><p>Liquor Class</p><pre><code>public class Liquor{public String name;public int code;public String category;private HashMap&lt;String, Bottle&gt; _bottles;public Liquor(){    _bottles = new HashMap&lt;String, Bottle&gt;();}public void AddBottle(Bottle aBottle){    _bottles.put(aBottle.size, aBottle);}}</code></pre><p>Sub Activity</p><pre><code>public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    HashMap&lt;Integer, Liquor&gt; map = (HashMap&lt;Integer, Liquor&gt;)getIntent().getSerializableExtra(""com.appName.cat"");    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, GetNames(map)));    ListView lv = getListView();    lv.setTextFilterEnabled(true);</code></pre><p>When the runtime error exists it never makes it into the sub activity class.  So I'm pretty sure the problem exists in the adding of the HashMap to the intent, and based off the error I believe my Liquor class is the cause, but I can't figure out why.</p><p>Your help will be much appreciated.  Thanks!</p>","280980","","","","","2010-09-29 06:06:35","AndroidRuntime error: Parcel: unable to marshal value","<java><android>","1","0","3","",""
"3818775","1","3818811","","2010-09-29 04:40:51","1","390","<p>I have web application for mobile (developed in .net), I want to use iPhone maps application from web application( i.e. from web browser on button click)..how to do it? I want to do same in android to.</p>","459000","","","","","2010-09-29 05:00:44","how to load iPhone application from web application","<iphone><android>","2","0","","",""
"3818799","1","","","2010-09-29 04:45:40","0","1038","<p>A web page:- 5 first seconds. It shows an advertisement picture.- After, its show main page.If I get content by common way. It only gets page content with advertisement.How to load main page content?</p>","461323","","415347","","2011-09-05 12:21:27","2011-09-05 12:21:27","How to get content of a web page (android)?","<android>","1","0","","",""
"3818835","1","3818935","","2010-09-29 04:58:05","2","301","<p>Can someone give info on the review procedure followed by Google to publish an App in Android Market.</p>","189006","","","","","2010-09-29 05:30:14","what is the review procedure for Android Market?","<android>","3","1","","",""
"3818838","1","3818882","","2010-09-29 04:58:20","1","507","<p>I am putting together a bundle for an activity and sometimes my <code>boolean</code> <code>isLive</code>is null. When I do the following.</p><pre><code>Bundle b = new Bundle();b.putBoolean(""isLive"", isLive);</code></pre><p>The docs for the SDK clearly say both arguments are allowed to be null, however if <code>isLive</code> is null I get a <code>NullPointerException</code> have I found a bug in the SDK?</p>","384306","","384306","","2010-09-29 05:41:54","2010-09-29 05:41:54","bundle.putBoolean() bug?","<android><bundle>","1","0","","",""
"3818887","1","3819008","","2010-09-29 05:12:04","0","808","<p>I created a project from the ContactManager sample code and installed it on my DX.  When I click the account spinner, in addition to the 2 accounts I have on the device, it displays 33 seemingly random characters followed by ""@random.svcmot.com"".  </p><p>Does anyone know what this account is?</p>","421305","","1131435","","2013-04-11 19:28:19","2013-04-11 19:28:19","ContactManager Sample Code displays odd account","<android><accounts>","2","0","","",""
"3818890","1","3819596","","2010-09-29 05:12:33","2","258","<p>What do you guys think about other iPhone development platforms like appmobi, Rhomobile, Titanium, PhoneGap and others.</p><p>I already have objective c/ iphone experience &amp; some experience on Android. How will these platforms effect my performance in long run if I start using one of them. How customizable are they..?</p><p>And which one of them do you think is a better platform for development &amp; why?</p>","197688","","114066","","2010-09-29 07:33:05","2011-09-05 12:21:12","Other development platforms for iPhone","<iphone><android><cross-platform>","4","0","2","",""
"3818998","1","3819090","","2010-09-29 05:35:33","0","818","<p>Recently I updated my Nexus One to Froyo (2.2) and I've noticed some significantly different behavior with SQLite.</p><p>For example, I had been using a subquery (returning string data) as part of an IN clause, and the subquery portion no longer appears to function correctly. I've attached an example SQL query working with the contacts database below (Direct query shown for illustrative purposes only):</p><pre><code>SELECT _id FROM data WHERE display_name IN (SELECT display_name FROM contacts);</code></pre><p>Up until Android 2.1 this was not a problem. After the update however, this returns an empty record set unless I run the subquery separately, surround each of the resulting values in single quotes and append those values directly into the IN clause. </p><p>I have noticed this loss of functionality in multiple applications I'm working on, but I should note that it does appear to work when the results would be numeric rather than string based.</p><p>Has anyone else run into this issue?</p>","461367","","995926","","2012-05-05 13:55:16","2012-05-05 13:55:16","Android 2.2 (Froyo) SQLite missing some IN clause functionality?","<android><sqlite><android-2.2-froyo><in-clause>","1","0","","",""
"3819065","1","3819119","","2010-09-29 05:50:23","0","2818","<p>I want priceText to be right aligned. It is appearing left aligned.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""@drawable/stocks_gradient""&gt;       &lt;TextView        android:id=""@+id/nameText""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:text=""Symbol"" android:textStyle=""bold"" android:textSize=""24sp"" android:layout_width=""100dp"" android:textColor=""#4871A8"" android:paddingTop=""2dip"" android:paddingLeft=""5dip"" android:paddingBottom=""1dip""/&gt;    &lt;TextView        android:id=""@+id/priceText""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@+id/nameText""        android:gravity=""right""             android:text=""100"" android:textStyle=""bold"" android:textSize=""24sp"" android:textColor=""#4871A8"" android:paddingTop=""2dip"" android:paddingBottom=""1dip""/&gt;      &lt;TextView        android:id=""@+id/changeText""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@+id/priceText""        android:gravity=""right""             android:textSize=""18sp"" android:text=""3.07(+1.08%)"" android:paddingTop=""9dip"" android:paddingRight=""5dip"" android:paddingBottom=""1dip""/&gt;  &lt;/RelativeLayout&gt;</code></pre>","19875","","","","","2010-09-29 06:26:37","My TextView is not appearing right aligned","<android><layout><textview><relativelayout>","1","0","","",""
"3819107","1","3819331","","2010-09-29 05:58:32","0","795","<p>I am new in androidI have created 2 classes.first extends activity and 2nd extends View.I want to add buttons,image Views etc. into the second classHow can I do this?</p>","461386","","415347","","2011-09-05 12:20:24","2011-09-05 12:20:24","load an xml into the Class View","<android>","1","3","","",""
"3819158","1","","","2010-09-29 06:09:49","1","839","<p>How to set position of icon in the alert dialog? below is the code I am using:</p><pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(context);builder.setIcon(int id);</code></pre>","431505","","415347","","2011-09-05 12:19:56","2011-09-05 12:19:56","how to set position of icon in the alert dialog","<android>","1","0","","",""
"3819189","1","3819203","","2010-09-29 06:17:08","15","16242","<p>I can not scroll down the screen to view the data in the Replyby section. How can I make my layout scrollable?</p><p><img src=""http://i.stack.imgur.com/BFAOo.png"" alt=""alt text""></p>","438864","","114066","","2010-09-29 07:48:44","2013-06-15 04:34:17","How to make my layout able to scroll down?","<android><layout>","2","0","5","",""
"3819248","1","","","2010-09-29 06:29:47","1","1978","<p>I'm getting an error when trying to use an external jar file to access Forward facing camera in Android. But when we try to load, i get error <code>Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY</code> on my console window of myeclipse. ""when i saw a log file, the error was ""unavailable shared library <code>com.sprint.hardware.twinCamDevice</code></p>","461405","","415347","","2011-09-05 12:19:37","2011-09-05 12:19:46","Getting Error ""Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY""","<android>","1","0","","",""
"3819273","1","3820062","","2010-09-29 06:34:22","1","872","<p>After completing the XML SAX Parsing now I am working on JSON Parsing in my application. Here I am providing you the Json  </p><pre><code>Response : {""menu"": {              ""id"": ""file"",              ""value"": ""File"",              ""popup"": {                ""menuitem"": [                  {""value"": ""New"", ""onclick"": ""CreateNewDoc()""},                  {""value"": ""Open"", ""onclick"": ""OpenDoc()""},                  {""value"": ""Close"", ""onclick"": ""CloseDoc()""}                ]              }            }}</code></pre><p>Now I had referred one example of Json Parsing in which they had created a jString Object and I had a doubt in that particular line which is as under :</p><pre><code>private String jString = ""{\""menu\"":    {\""id\"": \""file\"", \""value\"": \""File\"", \""</code></pre><p>Can anyone make me clear about it please. The Link of the Complete Example is as Under:</p><p><a href=""http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/"" rel=""nofollow"">http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/</a></p>","422859","","415347","","2011-09-05 12:18:54","2011-09-05 12:18:54","Json Parsing in Android Application","<android><json><parsing>","2","0","","",""
"3819294","1","","","2010-09-29 06:37:04","0","365","<p>How can I lock the current state of settings like wifi,gps,bluetooth,vibration,etc...after clicking on button1.and it should be unlock when button2 is pressed.</p>","458084","","415347","","2011-09-05 12:18:40","2011-09-05 12:18:40"," lock and unlock settings like wifi,vibration,etc.. after clicking on button","<android>","1","0","","",""
"3819332","1","3820671","","2010-09-29 06:43:16","1","3011","<p>How can i draw a view on a canvas by giving the x,y position in the canvas.  </p><p>For example,<br>I have custom view myView, which was created by inflating one of my layout.xml file.Now i want to draw this myView on the canvas at position (x, y).  </p><p>How can i do that?  </p><p>Please help with your ideas.  </p><p>Thanks,<br>Sen</p><p><strong>Updated:</strong>  </p><p>To be more specific,<br>I have </p><pre><code>myView extend view { ... protected void onDraw(Canvas canvas) {  super.onDraw(canvas);      { Inside which i will draw a curve }  </code></pre><p>Then I will obtain 8 set of co-ordinates along the path and will store it in a list.  </p><p>Then i have created a new view by using Absolute layout and its name is myinfo.xml(which contains two text views) present inside the res/layouts folder.  </p><p>Now i want to inflate this view inside the onDraw method and want to place them in the above collected co-ordinates.  </p><p>But i tried to inflate the view in this class(myView) but it is not working.  </p><p>Please tell where am i wrong??  </p><p>If you have some other suggestion, do update me.  </p><p>Thanks &amp; Regards,<br>Sen</p>","449378","","883033","","2012-06-15 09:23:16","2012-06-15 09:23:16","How to draw a View on a canvas by giving the x , y postion?","<android>","1","0","","",""
"3819482","1","","","2010-09-29 07:12:01","1","1273","<p>After extensive use of Email database (there were more than 1000 mails), Email App crashed. If i come back to App again all mails started deleting automatically.</p><p>The error logs obtained are as below:</p><pre><code>E/AndroidRuntime(  417): java.lang.OutOfMemoryErrorE/AndroidRuntime(  417):    at java.lang.String.&lt;init&gt;(String.java:468)E/AndroidRuntime(  417):    at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:659)E/AndroidRuntime(  417):    at java.lang.StringBuilder.toString(StringBuilder.java:664)E/AndroidRuntime(  417):    at com.android.email.mail.transport.DiscourseLogger.addReceivingLineToBuffer(DiscourseLogger.java:57)E/AndroidRuntime(  417):    at com.android.email.mail.transport.DiscourseLogger.addReceivedByte(DiscourseLogger.java:70)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapResponseParser.readByte(ImapResponseParser.java:71)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapResponseParser.expect(ImapResponseParser.java:332)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapResponseParser.parseToken(ImapResponseParser.java:199)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapResponseParser.readToken(ImapResponseParser.java:165)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapResponseParser.readTokens(ImapResponseParser.java:141)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapResponseParser.readResponse(ImapResponseParser.java:92)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapStore$ImapConnection.readResponse(ImapStore.java:1491)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapStore$ImapFolder.fetchInternal(ImapStore.java:887)E/AndroidRuntime(  417):    at com.android.email.mail.store.ImapStore$ImapFolder.fetch(ImapStore.java:810)E/AndroidRuntime(  417):    at com.android.email.MessagingController.synchronizeMailboxGeneric(MessagingController.java:898)E/AndroidRuntime(  417):    at com.android.email.MessagingController.synchronizeMailboxSynchronous(MessagingController.java:396)E/AndroidRuntime(  417):    at com.android.email.MessagingController.access$2(MessagingController.java:384)E/AndroidRuntime(  417):    at com.android.email.MessagingController$2.run(MessagingController.java:372)E/AndroidRuntime(  417):    at com.android.email.MessagingController.run(MessagingController.java:171)E/AndroidRuntime(  417):    at java.lang.Thread.run(Thread.java:1096)</code></pre><blockquote>  <p>W/Database(  497): Reached MAX size for compiled-sql statement cache for database /data/data/com.android.email/databases/EmailProvider.db; i.e., NO space for this sql statement in cache: SELECT _id FROM Attachment WHERE messageKey=996. Please change your sql statements to use '?' for bindargs, instead of using actual values</p></blockquote><p>I want to know what is the behavior that I get the above error.</p><p>I mean what will android do if the Maximum cache size is exceeded? If you could tell where the implementation for that is done, it will be very helpful.</p>","237577","","2621536","","2012-11-30 13:07:11","2012-11-30 13:07:11","Want to know database behavior when Maximum cache size is exceeded","<android><sqlite3><email-client>","2","0","1","",""
"3819492","1","","","2010-09-29 07:15:09","6","2594","<p>I have an application here that has a feature of showing a POI on the map. It's only one POI and it is only drawn when it's actually within the visible screen area. It works perfectly for a while but if I play around zooming in and out and dragging, it will eventually crash. According to Logcat, the reason is always an OutOfMemory error.</p><p>At first, I thought it was a bug on the Google Maps API. After some researching and seeing some Romain Guy posts, I was kind of convinced that I had done something stupid on my app that kept me running out of memory from time to time.Then I ran some more detailed tests with Heap Analyzer (Eclipse) on and I saw that even though I had 2+, sometimes 3+ megabytes left of free memory, I was still getting those annoying Force Close messages caused by OutOfMemoryError. Most of the times it crashes when trying to allocate some 614kb chunk of memory regardless of how much I have left. </p><p>This problem happens a lot on Nexus One 2.2.1 and on HTC Evo 2.1. After some little testing, I got no crash neither on G1 1.6 nor Samsung Galaxy S i9000 2.1. But I cannot say for sure the G1 and Galaxy will not show this problem after more testing.</p><p>I can only think of a memory fragmentation problem. I hope this problem has a solution. I will also be glad if I can just catch this error and prevent the app from crashing.</p><p>If it helps, here's the logcat:</p><pre><code>09-29 08:58:06.661: ERROR/dalvikvm-heap(1552): 648000-byte external allocation too large for this process.09-29 08:58:06.661: ERROR/dalvikvm(1552): Out of memory: Heap Size=9991KB, Allocated=6980KB, Bitmap Size=14510KB09-29 08:58:06.661: ERROR/(1552): VM won't let us allocate 648000 bytes09-29 08:58:06.672: DEBUG/AndroidRuntime(1552): Shutting down VM09-29 08:58:06.672: WARN/dalvikvm(1552): threadid=3: thread exiting with uncaught exception (group=0x4001b390)09-29 08:58:06.672: ERROR/AndroidRuntime(1552): Uncaught handler: thread main exiting due to uncaught exception09-29 08:58:06.681: ERROR/AndroidRuntime(1552): java.lang.OutOfMemoryError: bitmap size exceeds VM budget09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.graphics.Bitmap.nativeCreate(Native Method)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.graphics.Bitmap.createBitmap(Bitmap.java:569)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:422)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.google.android.maps.ZoomHelper.beginZoom(ZoomHelper.java:186)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.google.android.maps.MapView$2.onScaleBegin(MapView.java:371)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.view.ScaleGestureDetector.onTouchEvent(ScaleGestureDetector.java:208)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.google.android.maps.MapView.onTouchEvent(MapView.java:646)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.view.View.dispatchTouchEvent(View.java:3709)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:874)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:924)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1701)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.app.Activity.dispatchTouchEvent(Activity.java:2068)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1685)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1708)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.os.Handler.dispatchMessage(Handler.java:99)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.os.Looper.loop(Looper.java:123)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at android.app.ActivityThread.main(ActivityThread.java:4595)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at java.lang.reflect.Method.invokeNative(Native Method)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at java.lang.reflect.Method.invoke(Method.java:521)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)09-29 08:58:06.681: ERROR/AndroidRuntime(1552):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","456425","","415347","","2011-09-05 12:17:01","2011-12-20 10:19:11","Out of memory error when using Google Maps API","<android><memory><bitmap><google-maps-api-3>","2","3","2","",""
"3819498","1","","","2010-09-29 07:16:04","0","1444","<p>I have an app which is loading upcoming dates (like Birthdays) from an <code>SQLite</code> databaseand showing it on a <code>ListView</code>. That works fine.What I now want is to inform the user regular by an <code>Alarm</code> or <code>Toast</code> or something withoutstarting the application. The user has the only option when to inform: on the <strong>same day</strong> or <strong>1 day before</strong> and the <strong>time</strong>!Has someone an idea how to realize this? Maybe a <code>Service</code> or a <code>Timer</code>, or both?I would be very pleased about some tips.</p>","461407","","1300995","","2012-09-02 11:48:35","2012-09-02 11:48:35","Android Alarm Reminder","<android><alarm>","1","2","","",""
"3819504","1","4921287","","2010-09-29 07:17:08","0","673","<p>I am trying to get OAuth working for a service provider website. Everything goes well with the authentication until the callback. It's actually calling back with the proper URL (the one I specified both on the provider's registration site as well as the call to provider.retrieveRequestToken()</p><p>I am doing this:</p><p>provider.retrieveRequestToken(consumer, ""my-app:///"" );</p><p>And the URL I actually get back is exactly what I'd expect - ""my-app:///?[a bunch of params including my access token]""</p><p>But at this point the browser says I do not have permission to access that URL. My manifest is set up like so:</p><pre><code>&lt;activity android:name="".Selector""            android:label=""@string/app_name""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.intent.action.MAIN"" /&gt;                &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;            &lt;/intent-filter&gt;        &lt;intent-filter&gt;             &lt;action android:name=""android.intent.action.VIEW"" /&gt;             &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;             &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;             &lt;data android:scheme=""my-app""/&gt;        &lt;/intent-filter&gt;        &lt;/activity&gt;</code></pre><p>Am I missing something? Maybe a permission?</p>","424554","","244296","","2010-09-29 07:19:15","2011-02-07 12:30:05","Why is Android Browser denying me permission to callback from OAuth?","<java><android><oauth>","2","0","1","",""
"3819505","1","3829339","","2010-09-29 07:17:18","0","2596","<p>I am having a problem in getting GPS coordinates in 2.1.</p><p>The code i am using right now is working well in 1.6 but when i testthis same apk in 1.6 device is showing null values</p><p>please help me to find a way to work with 2.1 devices also</p><p>Here is my code.</p><pre><code>public class GpsLocator {   private static String PROVIDER=""gps"";   private LocationManager myLocationManager=null;   public GpsLocator(Context context) {      myLocationManager=(LocationManager)context.getSystemService(Context.LOCATION_SERVICE);   }   public void myOnresume() {      myLocationManager.requestLocationUpdates(PROVIDER, 0,   0, onLocationChange);   }   public void myonPause() {       myLocationManager.removeUpdates(onLocationChange);   }   public double getLatitude() {      Location loc=myLocationManager.getLastKnownLocation(PROVIDER);      if (loc==null) {         return(0);      }      return(loc.getLatitude());   }   public double getLongitude() {      Location loc=myLocationManager.getLastKnownLocation(PROVIDER);      if (loc==null) {         return(0);      }      return(loc.getLongitude());   }   LocationListener onLocationChange=new LocationListener() {      public void onLocationChanged(Location location) {      }      public void onProviderDisabled(String provider) {         // required for interface, not used      }      public void onProviderEnabled(String provider) {         // required for interface, not used      }      public void onStatusChanged(String provider, int status,Bundle extras) {         // required for interface, not used      }   };}</code></pre><p>in the manifest file i add permission for accessing file they are</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></pre>","400942","","415347","","2011-09-05 12:15:21","2012-11-29 03:12:10","problem in getting gps coordinates in android 2.1(Found Answer)","<android><gps><android-emulator>","3","0","","",""
"3819539","1","3819563","","2010-09-29 07:23:38","2","2220","<p>i think you may get the idea of wat i'm trying to do if you look at the code:</p><p>here the complication is that i cannot create another textview for another line....</p><pre><code>s8=""hello"";t12=(TextView) findViewById(R.id.solid);     t12.setText(""check""+""/n""+s8);</code></pre>","438864","","415347","","2011-09-05 12:15:05","2011-09-05 12:15:05","how to create a new line in the same text view?","<android>","1","0","1","",""
"3819664","1","3819682","","2010-09-29 07:44:46","1","141","<p>I mean widgets that are not going to be touched through program code.</p>","433718","","","","","2010-09-29 07:47:47","Is it necessary to give each Widget (TextView, LinearLayout...) an Id?","<android><android-widget><android-layout>","1","0","1","",""
"3819676","1","3819721","","2010-09-29 07:46:46","14","17311","<p>I am having problems running a timer in a service I have created. The task that the timer calls simply isn't called. I know that the service starts as I have put toasts within it and they are called, but not when they are within the timer. Help appreciated.</p><p>service class:</p><pre><code>public class LocalService extends Service{    private static Timer timer = new Timer();     private Context ctx;    public IBinder onBind(Intent arg0)     {          return null;    }    public void onCreate()     {          super.onCreate();          ctx = this;           startService();    }    private void startService()    {                   timer.scheduleAtFixedRate(new mainTask(), 0, 5000);    }    private class mainTask extends TimerTask    {         public void run()         {            Toast.makeText(ctx, ""test"", Toast.LENGTH_SHORT).show();        }    }        public void onDestroy()     {          super.onDestroy();          Toast.makeText(this, ""Service Stopped ..."", Toast.LENGTH_SHORT).show();    }    }</code></pre><p>Main class:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    startService(new Intent(RingerSchedule.this, LocalService.class));      }   </code></pre>","444707","","","","","2012-02-15 18:25:39","Android Timer within a service","<android>","1","0","10","",""
"3819760","1","3820554","","2010-09-29 08:02:53","1","4611","<p><img src=""http://i.stack.imgur.com/q5jKg.png"" alt=""alt text""></p><p>How can I prevent this overlapping from occurring without reducing the font size? Here is my XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;       &lt;TextView        android:id=""@+id/nameText""        android:layout_height=""wrap_content""        android:layout_alignParentLeft=""true""        android:text=""Symbol""        android:textStyle=""bold""        android:textSize=""24sp""        android:layout_width=""100dp""        android:textColor=""#4871A8""        android:paddingTop=""2dip""        android:paddingLeft=""5dip""        android:paddingBottom=""1dip""/&gt;    &lt;TextView        android:id=""@+id/changeText""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:gravity=""right""             android:textSize=""18sp""        android:paddingTop=""9dip""        android:paddingRight=""5dip""        android:paddingBottom=""1dip"" android:text=""13.07(+43.08%)"" android:paddingLeft=""5dip""/&gt;      &lt;ImageView android:layout_toLeftOf=""@+id/changeText"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:id=""@+id/verticalDivider"" android:background=""@drawable/stocks_selected_gradient""&gt;&lt;/ImageView&gt;&lt;TextView        android:id=""@+id/priceText""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""@+id/changeText""        android:gravity=""right""             android:textStyle=""bold""        android:textSize=""24sp""        android:textColor=""#4871A8""        android:paddingTop=""2dip""        android:paddingBottom=""1dip""        android:paddingRight=""25dip"" android:text=""15000""/&gt;  &lt;/RelativeLayout&gt;</code></pre>","19875","","","","","2011-09-05 12:14:41","How can I prevent my TextView from overlapping?","<android><textview><android-layout><relativelayout>","2","0","","",""
"3819856","1","3820008","","2010-09-29 08:22:03","0","3893","<p>can my activity broadcast this intent from itself</p><blockquote>  <p>Intent i = new Intent(""android.provider.Telephony.SMS_RECEIVED"");</p>    <p>sendBroadcast(i);</p></blockquote><p>I am able to send this broadcast and receive it back (from a broadcast receiver setup in the application) , but this is not a global broadcast , i.e. it is not received by  the default SMS application. furthermore i am getting this error in the logcat</p><blockquote>  <p>Permission Denial: broadcasting Intent  {  act=android.provider.Telephony.SMS_RECEIVED  } from com.smartanuj.scale (pid=3572,  uid=10029) requires  android.permission.BROADCAST_SMS due  to receiver  com.android.mms/com.android.mms.transaction.PrivilegedSmsReceiver</p></blockquote><p>I have already specified </p><pre><code> &lt;uses-permission&gt; android:name=""android.permission.BROADCAST_SMS""&gt;&lt;/uses-permission&gt;</code></pre><p>in my manifest file</p>","388044","","415347","","2011-09-05 12:12:33","2011-12-11 22:30:05","Permission denial on BroadCast SMS intent","<android><android-intent><broadcastreceiver>","2","0","1","",""
"3819970","1","3820432","","2010-09-29 08:36:55","1","129","<p>Is it possible to generate .apk file from our application?</p><p>If yes then please give me some guidance</p>","461503","","415347","","2011-09-05 12:13:01","2011-09-05 12:13:08","Android apk genration","<android>","1","3","","",""
"3820256","1","3820274","","2010-09-29 09:19:53","2","31353","<p>I'm writing an Android app for work that shows the status of our phone lines, but thats neither here nor there.</p><p>I make a call to one of our servers and get returned JSON text of the status. I then parse this putting each line into a SortedMap (TreeMap) with the Key being the name of the line and my own class as the value (which holds status and other details).</p><p>This all works fine.</p><p>When the app runs it should then show each line and the info I have retrieved, but nothing gets updated.</p><p>The JSON is returned and added to the Map correctly.</p><p>This is a snapshot of the code that isn't working. I simply iterate through the map and depending on the value of key update the relevant TextView. The problem I am having is that when it gets to the IF statement that matches it never runs that code. It skips it as if values don't match.</p><p>I can't see any errors. Is this the only way to do this as I know you can't use Switch..Case etc?</p><p>Can anyone see my error? I've been coding on Android for 1 week now so its probably a newbie error!!</p><p>ThanksNeil</p><pre><code>Iterator iterator = mapLines.entrySet().iterator();while(iterator.hasNext()){// key=value separator this by Map.Entry to get key and valueMap.Entry&lt;String, Status&gt; mapEntry = (Map.Entry&lt;String, Status&gt;)iterator.next();// getKey is used to get key of MapString key = (String)mapEntry.getKey();// getValue is used to get value of key in MapStatus value = (Status)mapEntry.getValue();if(key == ""Ski""){    TextView tvStatus = (TextView)findViewById(R.id.SkiStatus);    tvStatus.setText(value.Status);}else if(key == ""Cruise""){    TextView tvStatus = (TextView)findViewById(R.id.CruiseStatus);    tvStatus.setText(value.Status);}else if(key == ""Villas""){    TextView tvStatus = (TextView)findViewById(R.id.VillasStatus);    tvStatus.setText(value.Status);}}</code></pre>","67419","","","","","2011-02-03 02:53:42","ANDROID: If...Else as Switch on String","<java><android>","3","0","1","",""
"3820307","1","","","2010-09-29 09:29:32","4","668","<p>I am using the following code for dialing programmatically under Android. </p><pre><code>try {    Intent callIntent = new Intent(Intent.ACTION_CALL);    callIntent.setData(Uri.parse(""tel:123456789""));    startActivity(callIntent);} catch (Exception exception) {    log.e(""dialing-example"", ""Call failed"", Exception);}</code></pre><p>But how can I terminate the call programmatically?</p>","399046","","840960","","2011-09-05 12:55:22","2011-09-05 12:55:22","How to terminate a call programmatically under Android?","<android>","1","0","2","",""
"3820375","1","3821243","","2010-09-29 09:39:59","1","346","<p>I'm currently working on a consumer mobile application project and have read that 40% of smart phones in use are Blackberry's. This seems very high and surely shouldn't be ignored for development. I understand that the type of application is relevant here, but has anyone found themselves considering adding Blackberry development to a project?</p><p>I can justify developing for the iPhone and Android OS because of the growing use of the App Store / Marketplace, but are Blackberry's being used as much for this too? I can't really tell as I've never used one!</p>","143979","","918414","","2013-03-16 03:09:36","2013-03-16 03:09:36","Blackberry development","<android><iphone><mobile><blackberry><mobile-phones>","1","0","0","",""
"3820377","1","4411260","","2010-09-29 09:40:01","6","9115","<p>On my website, which is loaded in the webview, there is a map. There are also java scripts that detects double tap for zoom, dragging etc. But is it possible to have a javascript that detects the use of pinch zoom ? there are several examples of it working on an iphone, and on my website there is a script for the pinch zoom but it is only working on iphone.....</p><p>Is it possible to get it to work on Android ? </p><p>Thanks</p>","453562","","","","","2012-10-26 22:39:37","Pinch Zoom in webview [Android]","<javascript><android><zoom><pinch>","4","0","3","",""
"3820393","1","","","2010-09-29 09:41:20","2","2923","<p>I'm using the <code>MediaStore.Video.Thumbnails.getThumbnail()</code> method tofetch thumbnails for files that I am displaying in a list.  This workswell to begin with, but after a while the thumbnails that I get backare not the ones that match the file.  Once <code>GetThumbnail()</code> startsfailing it seems to return only the same Bitmap over and over again,regardless of which file I try.  This happens on my HTC Desire,running Android 2.2, and is very hard to reproduce - it will just start happening after some time.</p><p>Here is (a cut back version of) my source code:</p><pre><code>static public Bitmap GetThumbnailForFile(File p_File, Activityp_activity){    long imageID = GetImageID(p_File, p_activity);    if (imageID &lt; 0)    {        return null;    }    returnMediaStore.Images.Thumbnails.getThumbnail(p_activity.getContentResolver(),imageID, Thumbnails.MICRO_KIND, null);}public static long GetImageID(File p_File, Activity p_activity){    long result =-1;    Cursor c =p_activity.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,        new String[]{MediaStore.Images.Media._ID +""""},        MediaStore.Images.Media.DATA +"" like '"" + p_File.getAbsolutePath(),        null, null);    c.moveToNext();    if (!c.isAfterLast())    {        result = c.getLong(0);    }    c.close();    return result;}</code></pre><p>I'm also doing the same thing to load video thumbnails.  I've usedsome debugging code to inspect the values returned by GetImageID(),and I'm pretty sure that they are correct.</p><p>Can anyone see what I might be doing wrong?  Or know any reason whythe thumbnails stop being properly generated after some time?</p>","461568","","415347","","2011-09-05 12:11:48","2013-01-16 14:30:52","Android 2.2 GetThumbnail returns incorrect Bitmap","<android><thumbnails><mediastore>","1","0","","",""
"3820401","1","3820640","","2010-09-29 09:42:25","2","6763","<p>I am having a class that extends View. I have another class that extends activity and I want to add the first class to be loaded inside the activity class.I tried the following code</p><pre><code>package Test2.pack;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.View;public class Test2 extends Activity {    /** Called when the activity is first created. */    static view v;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                try{            v = (view) View.inflate(Test2.this, R.layout.main2, null);        }catch(Exception e){            System.out.println("" ERR "" + e.getMessage()+e.toString());        }           }}class view extends View{    public view(Context context) {        super(context);         }   }</code></pre>","655814","","461439","","2012-02-16 09:27:16","2012-02-16 09:27:16","How to load an XML inside a View in android?","<android>","2","2","1","",""
"3820420","1","","","2010-09-29 09:45:48","0","1014","<p>Facebook and Twitter made a sync option to sync my contacts list with my friends, so when I click on one of my synced contacts from the regular phone app, I get to see their last status, pictures, etc.</p><p>I would like to use this data from fb and twitter instead of building the sync process on my own, for both fb and twitter. because they already built it and me doing this again is inefficient.</p><p>Can I find it in ContactsContract (the same database of my contacts)? if yes, then where?</p>","178016","","","","","2011-04-22 23:55:01","syncing facebook friends with Contacts - Android","<android><facebook><twitter-api><contacts>","1","0","","",""
"3820422","1","","","2010-09-29 09:46:04","0","599","<p>I am having problem while passing string argument using javascript injection in my android application.. I am using the  </p><pre><code>webview.loadUrl(""javascript:(function() { "" +                        "" document.getElementById()</code></pre><p>, but m not getting the exact output..</p><p>I want to connect my login form (locally created) with website, so that whenever user enter userID &amp; password in my login form, it automatically get added to that website login form..</p><p>please help me with some simplified sample code.</p>","461571","","415347","","2011-09-05 12:10:28","2011-09-05 12:10:28","How to pass String argument?","<android>","1","2","","",""
"3820515","1","3820673","","2010-09-29 09:59:01","1","107","<p>I have a list view and I have to design a row layout to be used in adapter. The layout is like this.</p><pre><code>First column we have an icon on left most side. Second column we have a string of about 4-30 characters Last column, the date with time. </code></pre><p>I tried to design in relative layout but it gave issues like the last two columns' strings were overlapped. I want to specify certain percentage of width to a column, if string doesn't fit, it must start in new line (same row, with gravity as center). This is row layout, so I dont want it to be very heavy. And I dont want to hard code the width in dp.</p>","368084","","415347","","2011-09-05 12:10:06","2011-09-05 12:10:06","Android layout help","<android>","3","0","","",""
"3820517","1","5722984","","2010-09-29 09:59:39","3","7783","<p>I am experiencing an annoying problem with an Android project in Eclipse. All my other Android projects are okey (at the moment). Whenever I perform a clean (Menu:Project->Clean...) the project gives an error and I can't compile/run the app. The error is:</p><p><em>Project 'Project Name' is missing required source folder: 'gen'</em></p><p>As soon as I edit some code the problem disappears until I perform a clean again. I can also right-click on the gen-folder and delete it. Eclipse will recreate the gen-folder and the problem disappears until I perform a clean. This is not a showstopper but it is really annoying since I sometimes have to do a clean before I run the app.</p><p>I'm using the following:<br>OS: Ubuntu 10.04 (Linux CYLON 2.6.32-24-generic)<br>Eclipse: Helios Release (Build id: 20100617-1415)<br>Android dev tools: 0.9.7.v201005071157-36220 (the latest as of today)  </p>","5896","","","","","2011-05-25 18:22:07","Clean in Eclipse temporarily destroys Android project with error message: missing required source folder: 'gen'","<android><eclipse>","4","3","1","",""
"3820551","1","7307930","","2010-09-29 10:03:49","0","131","<p>I am accessing <strong>.NET webservice methods from my Android application</strong> using Java SOAP jar. I am getting response for a specific webservice method as an array .Do we have an API within the Java SOAP library to convert the response from array to XML(String) ?</p><p>Also , since using the <strong>external SOAP jar is around 90 KB in size</strong> , would like to know of an alternative approach by which we can access webservice , maybe a <strong>RESTful Web Services implementation</strong> or anything of a similar type, which wont require to add an external jar to the Android application &amp; hence <strong>reduce the application size</strong>.</p><p>It would be nice if someone can come up with the changes to be done on the server end for implementing the <strong>RESTful WebServices in .NET &amp; the client code for the same which I think will be only a HTTP connection .</strong></p><p>Kindly provide your valuable *<em>comments/code snippet</em>*s on the same.</p>","443141","","415347","","2011-09-05 12:09:40","2011-09-05 12:14:16","Need advice on .NET webservice method from Android application","<android>","1","1","2","","2010-09-29 10:06:54"
"3820651","1","3821113","","2010-09-29 10:15:39","2","1584","<p>The question seems quite stupid, but I spent quite a lot of time trying to solve it successfully. The problem is that Eclipse IDE throws me a various number of different errors if I try any solutions that I used in normal Java. Another thing is that just after implementing an interface I receive an error, and Eclipse change my class to abstract. So the source code is:</p><pre><code>public class analyzer extends Activity {TextView dateAndTimeLabel;private Button closeButton;private int signalDBm = 0; public class GetParams extends PhoneStateListener  {     @Override       public void onSignalStrengthsChanged(SignalStrength signalStrength)     {          super.onSignalStrengthsChanged(signalStrength);          signalDBm = signalStrength.getGsmSignalStrength();     } }@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    TextView tv = (TextView)findViewById(R.id.text);    tv.setText(""Greetings, My Lord"");    EditText fld=(EditText)findViewById(R.id.field);    fld.setText(""Nothing here at the moment"");      new GetParams();    Button btn=(Button)findViewById(R.id.start);    btn.setOnClickListener(this);    btn=(Button)findViewById(R.id.stop);    btn.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {        }    });    /**updateLabel();*/    /**Zakritie programmi*/    this.closeButton = (Button)this.findViewById(R.id.end);      this.closeButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {          finish();        }      });    /**Prosmotr loga*/    Button btn_log=(Button)findViewById(R.id.viewlog);    btn_log.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            TextView tv = (TextView)findViewById(R.id.text);            tv.setText(""U pressed the button, now you will die!"");            EditText fld=(EditText)findViewById(R.id.field);            fld.setText(""Power: ""  + signalDBm +"" dBm\n"" + ""BER:... \n"" + ""Coordinates: ... \n"");                   };    });}@Overridepublic void onClick(View v) {switch (v.getId()) {        case R.id.start:                Toast.makeText(this, ""GSM signal strength is "" + signalDBm, Toast.LENGTH_SHORT).show();        break;        }}};</code></pre><p>So there is a class GetParams with its method signalStrength.getGsmSignalStrength() that I want to use. One more thing I can add is that SignalStrength() class does not have a public constructor and this is the only way i can get to the method getGsmSignalStrength(). I would be very glad, if someone could help me because all my work stopped until I find a solution.</p>","458024","","415347","","2011-09-05 12:09:29","2011-09-05 12:09:29","How to assign a method to the button?","<java><android><methods><button>","1","5","0","",""
"3820678","1","","","2010-09-29 10:20:13","0","2354","<p>Hello for Android developers,</p><p>I am working on a project to extract the pictures taken from the Android camera and display. </p><p>Let me be little descriptive: I have 2 points to be clarified:<br>1> whether the concept I am following is correct? and<br>2> If yes, the problem in the subtask related to adb needs to be solved.</p><p>Let me write the steps , which I am following: I am using the Android 2.2 emulator<br>My understanding is the android camera pictures will be saved to the DCIM folder of the<br>SD Card.</p><p>a> Since , the emulator doesn't have a SD card, I need to make one which I did using mksdcard    </p><p>b> After, step a> , I had to copy some of the image files to the SD Card image, which I tried using adb push, but I got the access is denied, Read only. After thorough searching, and spending few hours, I could find a solution to make the SD   card image writeable, by mount and remount command, I could not get the usage of the   command, and there is no complete description and usage of the command.  </p><p>c> Then , I use the MediaStore to extract the images and thereon display. </p><p>My questions are :</p><ol><li>Is the sequence I am following to approach the solution is correct;  </li><li>If yes, please how do I push the image files to the SD card image created. I want a   detail mount, remount adb command with description for the filepath.   </li><li>If the approach itself is not correct, can I know how to go about for the solution.  </li></ol>","461602","","415347","","2011-09-05 12:08:41","2011-09-05 12:08:41","adb push command failing permission denied, Read only","<android>","1","0","","",""
"3820767","1","3820876","","2010-09-29 10:34:03","0","1145","<p>When a user tries to launch an application I want to suppress that application and then call another application. Example I want the user to authenticate himself before launching a particular system application (settings application etc). The authentication application should pop up every time the user launches the settings application</p><p>I know you will have to use broadcast receivers and intents but have no clue how to do it. </p>","434260","","114066","","2010-09-29 11:50:17","2010-09-29 11:50:17","Password protect system application android","<android><launcher>","2","0","1","",""
"3820790","1","","","2010-09-29 10:36:46","0","1117","<p>I have a hosting account at godaddy ruinning Linux. Is has MySQL. I am creating a J2ME application that runs on android and I was wondering if there is any simpler way to connect from j2me application to my MySQL server? </p><p>Is it required to install anything at my server? which I cannot do because of the shared account. Any way to just open the connection, update some data in the MySQL from j2me application?</p>","170986","","415347","","2011-09-05 12:07:58","2011-09-05 12:08:10","how to connect mysql server on external server in j2me application","<mysql><android><java-me>","2","3","","",""
"3820927","1","","","2010-09-29 10:57:48","3","1931","<p>I am not able to view SDCard folder in FileExplorer of DDMS in Android.But I was able to view SDCard folder when I used adb command from command prompt like below:  </p><pre><code>androidsdk\tools&gt;adb shell$ ls</code></pre><p>I am able to view list of folders when I typed ls in which I can see sdcard folder from the list of folders .my doubt how can we view the sdCard option in Eclipse using FileExplorer.Also I want I want to delete or insert some files in sdcard.How can this be possible for me.can anyone hel me in sorting out this issue.Thanks in advance.</p>","429501","","415347","","2011-09-05 12:07:42","2013-12-03 18:12:05","Not able to view SDCard folder in the FileExplorer of Android Eclipse","<android>","3","3","","",""
"3820949","1","3986498","","2010-09-29 11:00:59","5","4489","<p>File is present in <code>sdcard/image.jpg</code><br>I would like to create my own application (activity).On a button press, the image stored in the sdcard needs to be displayed using the built-in image viewer.On pressing the back button from the Image viewer, it should go back to my running application.</p><p>Need some help.</p>","461269","","415347","","2011-09-05 12:07:03","2013-02-28 17:33:37","Android How to preview an image, using its file path from SDcard, from my application","<android><image><view><preview>","2","0","2","",""
"3821079","1","","","2010-09-29 11:17:12","0","636","<p>I'm new to android platform , I'd like to settext using textviews , I tried to write set text into two textviews but its just draws one textview why?I can't draw two textviews</p><pre><code>TextView tv1;TextView tv2;@Overridepublic void onCreate(Bundle savedInstanceState){     super.onCreate(savedInstanceState);     layout = new LinearLayout(this);     tv1 = new TextView(this);     tv2 = new TextView(this);     tv1.setText(""Hello"");     tv2.setText(""How are you?"");}</code></pre>","375666","","415347","","2011-09-05 12:06:52","2011-09-05 12:06:52","Android:Drawing Many Text Views","<android>","2","0","","",""
"3821115","1","3821157","","2010-09-29 11:22:13","3","692","<p>Is it a good practice to develop an app that uses the full screen?</p><p>It is not a game, full screen would be just nice to have more space on the screen for GUI elements. But I have the dim feeling, that a full screen app could break some recommandations for good app design. The developer guide gives no answer to this. Who knows more?</p><p>I'm learning how to develop on android and it is very important for me to learn it right.</p>","458904","","415347","","2011-09-05 12:07:13","2011-09-05 12:07:13","Full screen App in Android: a good practice?","<android><design>","2","0","","",""
"3821162","1","3887907","","2010-09-29 11:29:02","1","887","<p>I have applied the follwoing selector to all my buttons by specifying it in my theme:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:drawable=""@drawable/my_btn_pressed""    android:state_pressed=""true"" /&gt;&lt;item android:drawable=""@drawable/my_btn_focussed""    android:state_focused=""true"" /&gt;     &lt;item android:drawable=""@drawable/my_btn_normal"" /&gt;&lt;/selector&gt;</code></pre><p>This works fine. But I want the background of the button to remain ""@drawable/my_btn_pressed"" when the button is pressed, as if to highlight that this was the last button pressed. Hence, I added the code in my <code>onClick()</code> to set the background resource:</p><pre><code>infoButton.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            infoButton.setBackgroundResource(R.drawable.my_btn_pressed);            otherButton.setBackgroundResource(R.drawable.my_btn_normal);        }    });</code></pre><p>This also works to highlight the last pressed button with ""my_btn_pressed"". However after this, my selector properties do not seem to work on the other buttons. Mainly, the state focussed is not distinguishable, at all. </p><p>Any idea how I can do both, i.e distinguish focussed, pressed and normal states of the button, as well as highlight the last pressed button?</p>","454660","","415347","","2011-09-05 12:05:02","2011-09-05 12:05:23","Selector for Buttons not working after setting backgroundResource of the button in Android","<android><button><background><selector>","1","0","2","",""
"3821271","1","","","2010-09-29 11:44:22","0","235","<p>How to create a <code>ListView</code> as a part of a form in Android using <code>ListView</code> as a part of the form something similar to select option in <code>html</code> is what I am looking for.</p>","448023","","337426","","2012-06-06 02:35:45","2012-06-06 02:35:45","How to create a list view as a part of a form in android","<android>","1","0","","",""
"3821306","1","4312562","","2010-09-29 11:49:35","6","4848","<p>I create a <code>ProgressDialog</code> in <code>onCreateDialog()</code> like so:</p><pre><code>protected Dialog onCreateDialog(int id) {  if (id == DIALOG_PROGRESS_ID)  {      ProgressDialog dialog = new ProgressDialog(this);      dialog.setMessage(getResources().getString(R.string.MyLabel));      dialog.setCancelable(false);      dialog.setIndeterminate(true);      return dialog;  }}</code></pre><p>Android, in its wisdom (or serious lack of it) decides to cache every dialog created through onCreateDialog(). Because of that, any subsequent call to <code>showDialog(DIALOG_PROGRESS_ID)</code> results in the same ProgressDialog instance being used but the animation has stopped working.</p><p>I've tried to re-set indeterminate in <code>onPrepareDialog()</code>, but that doesn't do anything. There is likewise no obvious method to call on the dialog instance that will reset the animation.</p><pre><code>protected void onPrepareDialog(int id, Dialog dialog){  //This doesn't do anything  if (id == DIALOG_PROGRESS_ID)     ((ProgressDialog)dialog).setIndeterminate(true);  super.onPrepareDialog(id, dialog);}</code></pre><p>EDIT: But maybe there is a way to get the ProgressBar itself and start it animating? so I tried the following after I asked this question:</p><pre><code>@Overrideprotected void onPrepareDialog(int id, Dialog dialog){  if (id == DIALOG_PROGRESS_ID)  {     ProgressBar p = (ProgressBar) dialog.findViewById(android.R.id.progress);     if (p.getAnimation() != null)        p.startAnimation(p.getAnimation());  }  super.onPrepareDialog(id, dialog);</code></pre><p>}</p><p>But it didn't work <em>either</em>!</p><p>So, does anyone know if there is a way to restart animation on a ProgressDialog? <strike>If not, is there a way that I can force every showDialog() call to call onCreateDialog()?</strike> (this second question was answered by @TuomasR, but after pondering it I don't think this is a very good solution to my problem)</p>","631","","415347","","2011-09-05 12:04:20","2013-01-25 16:44:36","ProgressDialog created from onCreateDialog stops animating on second run","<android><progressdialog>","4","0","4","",""
"3821345","1","","","2010-09-29 11:56:56","0","476","<p>I want to have the parent linearlayout as clickable which i have done, but its only child is list view disabled which will not pass the event to parent any one?</p><p>further more i actually want to notify the user to wait for loading data and should not allow the scrolling, of the list </p><p>can any one help me with this thanks</p>","392574","","415347","","2011-09-05 12:04:06","2011-09-05 12:04:06","linearlayout clickable? having listview disabled as only child","<android><listview><scrolling><android-linearlayout>","0","2","","",""
"3821423","1","3821998","","2010-09-29 12:08:50","141","32902","<p>I download some data from internet in background thread (I use <code>AsyncTask</code>) and display a progress dialog while downlaoding. Orientation changes, Activity is restarted and then my AsyncTask is completed - I want to dismiss the progess dialog and start a new Activity. But calling dismissDialog sometimes throws an exception (probably because the Activity was destroyed and new Activity hasn't been started yet).</p><p>What is the best way to handle this kind of problem (updating UI from background thread that works even if user changes orientation)? Did someone from Google provide some ""official solution""?</p>","243225","","415347","","2011-09-05 12:03:18","2014-01-01 09:15:04","Background task, progress dialog, orientation change - is there any 100% working solution?","<android>","5","2","206","",""
"3821440","1","3821927","","2010-09-29 12:10:51","0","992","<p>I have an <code>EditText</code>. The softkeypad should popup as ""Caps on"" state,  when I want to edit the editText. Is there any way to do this ?  </p>","405747","","415347","","2011-09-05 12:03:09","2011-09-05 12:03:09","Control Caps-Lock of android softkeypad","<android>","1","0","","",""
"3821539","1","6280607","","2010-09-29 12:26:12","35","19085","<p>The <code>inputType</code> <code>numberDecimal</code> in <code>EditText</code> uses the dot '.' as decimal separator. In Europe it's common to use  a comma ',' instead. Even though my locale is set as german the decimal separator is still the '.'</p><p>Is there a way to get the comma as decimal separator?</p>","458361","","415347","","2011-09-05 12:02:05","2014-01-26 20:45:43","Decimal separator comma (',') with numberDecimal inputType in EditText","<android><edittext>","7","0","8","",""
"3821572","1","","","2010-09-29 12:32:09","0","981","<p>I have the following program  i got the exception below,</p><pre><code>     package com.contacts;      import java.util.ArrayList;       import android.app.ListActivity;     import android.content.ContentResolver;   import android.content.Intent;    import android.database.Cursor;   import android.net.Uri;    import android.os.Bundle;    import android.provider.ContactsContract;    import android.provider.Contacts.People;    import android.provider.Contacts.People.Phones;  import android.provider.ContactsContract.PhoneLookup;   import android.view.View; import android.widget.ArrayAdapter;  import android.widget.ListAdapter;  import android.widget.ListView;   public class PickContact extends ListActivity {  private ListAdapter adapter;  private Cursor c;Uri contactUri; String contact; String number;     ContentResolver contentResolver;   @Override       public void onCreate(Bundle icicle)             {             super.onCreate(icicle);             setContentView(R.layout.main);             ArrayList&lt;String&gt; names = new ArrayList&lt;String&gt;();             Cursor people = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);             try             {             while(people.moveToNext()) {              int nameFieldColumnIndex = people.getColumnIndex(PhoneLookup.DISPLAY_NAME);               contact = people.getString(nameFieldColumnIndex);              int numberFieldColumnIndex = people.getColumnIndex(PhoneLookup.NUMBER);              number = people.getString(numberFieldColumnIndex);             }             people.close();             }             catch(Exception e)             {                 e.printStackTrace();             }           /*  ContentResolver cr = getContentResolver();             c = cr.query(ContactsContract.Contacts.CONTENT_URI, null,                     null, null,null);             while(c.moveToNext()){                     String id =              c.getString(c.getColumnIndex(ContactsContract.Contacts._ID));                      String name =              c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));                      String number =              c.getString(c.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));                      if(number.equals(""0"")) continue;                      names.add(name);              }*/             names.add(number+""""+contact);              adapter = new ArrayAdapter&lt;String&gt;    (this,                      android.R.layout.simple_list_item_1, names);             setListAdapter(adapter);             getListView().setTextFilterEnabled(true);      }</code></pre><p>}</p><p>I got the Following Exception</p><pre><code>09-29 17:59:18.672: WARN/System.err(302): java.lang.IllegalStateException: get field slot from row 0 col -1 failed09-29 17:59:18.721: WARN/System.err(302):     at android.database.CursorWindow.getString_native(Native Method)09-29 17:59:18.721: WARN/System.err(302):     at android.database.CursorWindow.getString(CursorWindow.java:329)09-29 17:59:18.731: WARN/System.err(302):     at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:49)09-29 17:59:18.731: WARN/System.err(302):     at android.database.CursorWrapper.getString(CursorWrapper.java:135)09-29 17:59:18.741: WARN/System.err(302):     at com.contacts.PickContact.onCreate(PickContact.java:42)09-29 17:59:18.741: WARN/System.err(302):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-29 17:59:18.741: WARN/System.err(302):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)09-29 17:59:18.764: WARN/System.err(302):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)09-29 17:59:18.764: WARN/System.err(302):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)09-29 17:59:18.764: WARN/System.err(302):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)09-29 17:59:18.771: WARN/System.err(302):     at android.os.Handler.dispatchMessage(Handler.java:99)09-29 17:59:18.792: WARN/System.err(302):     at android.os.Looper.loop(Looper.java:123)09-29 17:59:18.792: WARN/System.err(302):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-29 17:59:18.792: WARN/System.err(302):     at java.lang.reflect.Method.invokeNative(Native Method)09-29 17:59:18.792: WARN/System.err(302):     at java.lang.reflect.Method.invoke(Method.java:521)09-29 17:59:18.822: WARN/System.err(302):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-29 17:59:18.822: WARN/System.err(302):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-29 17:59:18.822: WARN/System.err(302):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","441224","","289396","","2010-09-29 12:36:12","2010-09-29 12:36:43","Android Illegal Argument Exception","<android>","1","0","","",""
"3821624","1","3821680","","2010-09-29 12:39:49","2","2547","<p>I wish to have a transluscent background for an activity, so that the previous activity can be seen beneath this activity. Something like a transluscent menu that pops up over a videa being played in the background.</p><p>Is this possible? Can you tell me how?</p><p>Note:I cannot use the default transluscent theme from android, since I am using my own customised background and theme for my application.</p><p>Pls help. Below is my style.xml wherein my_btn and my_list are selectors : </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;     &lt;style name=""btnstyle"" parent=""@android:style/Widget.Button""&gt;        &lt;item name=""android:textColor""&gt;#FFFFFF&lt;/item&gt;         &lt;item name=""android:background""&gt;@drawable/my_btn&lt;/item&gt;             &lt;/style&gt;        &lt;style name=""liststyle"" parent=""@android:style/Widget.ListView""&gt;        &lt;item name=""android:listSelector""&gt;@drawable/my_list&lt;/item&gt;    &lt;/style&gt;     &lt;style name=""theme"" parent=""android:Theme.Translucent""&gt;         &lt;item name=""android:windowBackground""&gt;@drawable/background&lt;/item&gt;           &lt;item name=""android:windowIsTranslucent""&gt;true&lt;/item&gt;        &lt;item name=""android:buttonStyle""&gt;@style/btnstyle&lt;/item&gt;        &lt;item name=""android:listViewStyle""&gt;@style/liststyle&lt;/item&gt;      &lt;/style&gt;    &lt;/resources&gt;</code></pre>","454660","","415347","","2011-09-05 12:02:36","2011-09-05 12:02:36","To have a transluscent background for an android activity?","<android><background><translucency>","1","2","2","",""
"3821671","1","","","2010-09-29 12:45:06","11","24066","<p>I am trying to change linear layout or any other widget width or height dynamically but throwing exception.</p><p>My layout is:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/abc""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView       android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""ghghjkgj ghjg hjgj ghj g hjgjgh jhg ""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>and My activity is:</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        LinearLayout ll = (LinearLayout)findViewById(R.id.abc);        ll.setLayoutParams(new LinearLayout.LayoutParams(30,60));    }</code></pre><p>Throwing following exception:</p><pre><code>E/AndroidRuntime(16052): java.lang.ClassCastException: android.widget.LinearLayout$LayoutParamsE/AndroidRuntime(16052):    at android.widget.FrameLayout.onLayout(FrameLayout.java:288)E/AndroidRuntime(16052):    at android.view.View.layout(View.java:7035)E/AndroidRuntime(16052):    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)E/AndroidRuntime(16052):    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)E/AndroidRuntime(16052):    at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)E/AndroidRuntime(16052):    at android.view.View.layout(View.java:7035)E/AndroidRuntime(16052):    at android.widget.FrameLayout.onLayout(FrameLayout.java:333)E/AndroidRuntime(16052):    at android.view.View.layout(View.java:7035)E/AndroidRuntime(16052):    at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)E/AndroidRuntime(16052):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)E/AndroidRuntime(16052):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(16052):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime(16052):    at android.app.ActivityThread.main(ActivityThread.java:4627)E/AndroidRuntime(16052):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime(16052):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime(16052):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/AndroidRuntime(16052):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/AndroidRuntime(16052):    at dalvik.system.NativeStart.main(Native Method)</code></pre><p>So how can I change the dimensions dynamically?</p>","434652","","366904","","2011-04-11 13:35:42","2013-05-09 04:45:50","Dynamically changing the linearlayout width or height on Android","<android>","3","0","1","",""
"3821684","1","3821724","","2010-09-29 12:46:46","5","3053","<p>Can we place a small view over another large view? For example, i have a VideoView which is playing a file in the background. Over this, somewhere in the middle/corner, I want to place another ImageView. </p><p>But in Linear/Relative Layout, views can be placed only one after another or relativ to each other. And Absolutelayout is advised against. So what do I do?</p>","454660","","415347","","2011-09-05 11:59:08","2011-09-05 11:59:18","Is it possible to place one view over another in android?","<android><views><videoview><overlapping>","1","1","","",""
"3821699","1","","","2010-09-29 12:49:16","12","30499","<p>I'm currently learning how to create android applications so I started with the basic ""Hello World"" tutorial over at the Android Developers home page. The code is quite simple but when I run it(I'm using Eclipse and a AVD v2.2), it only shows ""Android."" It does not go to the Home Screen. I updated everything and I still get the same problem. Is there something I did not or </p><p>New errors:</p><pre><code>[2010-09-29 09:35:04 - DeviceMonitor]Sending jdwp tracking request failed![2010-09-29 09:41:50 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch[2010-09-29 10:16:23 - HelloAndroid] Uploading HelloAndroid.apk onto device 'emulator-5554'[2010-09-29 10:16:28 - HelloAndroid] Installing HelloAndroid.apk...[2010-09-29 10:20:27 - HelloAndroid] Failed to install HelloAndroid.apk on device 'emulator-5554![2010-09-29 10:20:27 - HelloAndroid] (null)[2010-09-29 10:20:29 - HelloAndroid] Launch canceled!</code></pre>","461729","","180538","","2011-03-19 01:23:15","2012-05-03 10:58:21","Android-Hello World","<android><emulator><hello-world><avd>","11","5","1","",""
"3821923","1","3822434","","2010-09-29 13:14:19","3","9335","<p>I want to run this query in Android Application :  </p><pre><code>SELECT field1 FROM table1  where field1 = ?(enteredField1) AND field2 = ?(enteredField2)  AND enteredField3 BETWEEN field3 , field4  ;</code></pre><p>my DB schema  </p><pre><code>table1(field1, field2, field3, field4, field5)  </code></pre><p>enteredField1 , 2 , 3 = are parameters which is to be checked.</p><p>I hope I am clear with my question.  </p><p>here is the function -  </p><pre><code>public boolean checkData(String task1, String dte1, String startTime1 )  {           // field 1 = task , fiels 2 = dte, field 3 = startHr, field 4 = endHr          // enteredField 1,2,3 = task1, dte1, startTime1           // here I want to insert the query      int a = cursor.getCount();      if(a&gt;0)      {          return true;      }      return false;  }  </code></pre>","460652","","479863","","2011-09-05 18:27:38","2013-10-04 09:49:48","SQLite Query : Select Query with BETWEEN clause","<android><sqlite><select>","3","2","","",""
"3822065","1","3822091","","2010-09-29 13:31:03","1","3559","<p>I have a <code>Textview</code> with location:</p><p>eg. ""Mountain View, CA""</p><p>What I want to achieve is to create this text to act like a Link - color,underline, focusability etc.</p><p>This link doesn't need to direct anywhere - surrounding view has attached onClick listener that fires google maps intent.</p>","296427","","415347","","2011-09-05 12:00:53","2014-04-08 21:26:40","How to create TextView that will act as a link","<android><hyperlink><textview>","4","0","4","",""
"3822077","1","","","2010-09-29 13:32:44","0","1614","<p>The preference activity gets inflated by invoking </p><blockquote>  <p>addPreferencesFromResource(R.xml.preferences);</p></blockquote><p>and here are the preferences.xml:</p><p></p><pre><code>&lt;PreferenceCategory android:title=""@string/pref_categ_update_label""&gt;    &lt;ListPreference android:title=""@string/pref_label""        android:key=""update_interval""         android:entries=""@array/update_names"" android:entryValues=""@array/update_values"" /&gt;&lt;/PreferenceCategory&gt;&lt;PreferenceCategory android:title=""@string/pref_categ_evernote_label""&gt;    &lt;EditTextPreference android:title=""@string/pref_dialog_edit_username""        android:key=""prefUsername""         android:positiveButtonText=""@string/save_pref""        android:negativeButtonText=""@string/cancel_pref""  /&gt;    &lt;EditTextPreference android:title=""@string/pref_dialog_edit_password""        android:key=""prefPassword""          android:positiveButtonText=""@string/save_pref""        android:negativeButtonText=""@string/cancel_pref""                     android:password=""true"" /&gt;&lt;/PreferenceCategory&gt;</code></pre><p></p><p>everything looks okay, but EditTextPreference entries (2 and 3) have arrow-down icons next to them, just like ListPreference (1) does. Why is it so and how can I remove these icons as they look irrelevant?</p><p>The screenshot is here: <a href=""http://i.stack.imgur.com/BZUr7.png"" rel=""nofollow"">http://i.stack.imgur.com/BZUr7.png</a></p>","461774","","","","","2012-06-22 11:15:18","Android: How to remove arrow down icon next to EditTextPreference entry?","<android><listpreference>","4","0","1","",""
"3822123","1","","","2010-09-29 13:39:40","0","625","<p><img src=""http://i.stack.imgur.com/XZnwL.jpg"" alt=""alt text""></p><p>The image above is the first page of my game. Normally the big blue 'button' background image should not show up there.</p><p>I declare my custom background image for my buttons in layout file like this:</p><pre><code>&lt;Button android:id=""@+id/id_button_startgame""                             android:layout_width=""wrap_content""                             android:layout_height=""48dp""                             android:layout_weight=""1""                             android:textSize=""26sp""                             android:text=""@string/start_game""                             android:textColor=""@color/solid_red""                             android:background=""@drawable/button_bg""                             /&gt;</code></pre><p>And here's button_bg.xml in drawable folder</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt; &lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;     &lt;item android:state_focused=""true"" android:state_pressed=""false"" android:drawable=""@drawable/button01_focused"" /&gt;     &lt;item android:state_focused=""true"" android:state_pressed=""true"" android:drawable=""@drawable/button01_pressed"" /&gt;     &lt;item android:state_focused=""false"" android:state_pressed=""true"" android:drawable=""@drawable/button01_pressed"" /&gt;     &lt;item android:drawable=""@drawable/button01_idle"" /&gt; &lt;/selector&gt;</code></pre><p>As you can see the attached image. The three button below is the normal case. I use them everywhere in my apps. But sometimes the one on the center of the screen shows up. This big button cannot be pressed or anything. It's just up there hovering over my game. I can start the game but obviously can't see the content because this big blue thing cover it all.</p><p>I can reproduce this bug by keep launching/exiting my game several times.</p><p>I'd love to include more info. But don't know what info should I be giving you. I use <code>FrameLayout</code> to lay the UI above a SurfaceView.</p><p>And most of the time this bug DON'T happen. It seems to happen randomly after I launch/exit my game and repeat for several times.</p><p>Anyone have seen something like this before? If so please let me know how did you manage to fix it?</p>","461783","","244296","","2010-09-29 13:43:19","2010-09-30 08:05:33","Weird layout problem. (please see the attached image)","<android><layout><button><surfaceview>","2","5","","",""
"3822149","1","3822217","","2010-09-29 13:42:38","0","165","<pre><code>    public class MyActivity extends Activity {        /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            //R.layout.main has an illegal element (e.g. no layout_height attribute)             //But no exception is thrown at this line.            setContentView(R.layout.main);         } //Exception will be thrown after this line. Where to catch it?    }</code></pre>","433718","","133","","2011-08-19 14:49:51","2011-08-19 14:49:51","How to catch exceptions caused by a malformed layout-xml file?","<android><exception-handling><android-widget><android-layout><android-xml>","1","0","","",""
"3822193","1","3845118","","2010-09-29 13:46:03","8","1216","<p>I have a view that is round and hovering above (-> in z-axis direction coming out of the screen) the main content. When the someone taps the screen I want either the main content to be selected or the view hovering above, when it covers the main view.</p><p>So far that works perfectly. I have a round shaped item on a transparent canvas. Meaning you can see everything of the background that is outside of that circle. However, you cannot select it, because it is still the hovering canvas, just with a transparent paint.</p><p>Now I'm wondering, to solve this issue, if it is possible to make the view/canvas itself round shaped?</p><hr><p><strong>Update</strong></p><p>I added an image for better explanation what I try to achieve.<img src=""http://i.stack.imgur.com/mWXgT.png"" alt=""alt text""></p>","184367","","184367","","2010-09-30 15:08:24","2010-10-02 09:22:27","Android: can I create a view/canvas that is not rectangular, but e.g. round?","<android><view><canvas><round>","2","4","3","",""
"3822259","1","3822309","","2010-09-29 13:52:50","0","176","<p>I am trying to create a information based application, I have 92 subjects, for these subjects I have 92 map locations and maybe as much as 400 url links.  Currently I have created a class for each map location and a class for each url link, but this would mean I would have in excess of 500 classes, so what I want to do is split the subjects in four catergories ie. listview of about 23 in four tabs which I have done and create a class that gets the url based on the selection the use makes and do the same for the map locations.</p><p>Do I need to put these in a xml using the id method and how do you call individual entries, i.e. would I need 500 android:id, is there an easier way?</p><p>Thanks in Advance</p>","445174","","","","","2010-09-29 14:29:50","Creating strings and arrays","<java><android><eclipse>","2","1","","",""
"3822446","1","","","2010-09-29 14:15:53","0","394","<p>I'm using the android SDK in Eclipse on Linux.  I've used the code at itp.nyu.edu/~sve204/mobilemedia_spring10/androidCamera101.pdf to write an app to store an image captured through the camera onto SD card (there are various examples of this around). It works ok except that the image returned by the camera is not what's on the preview surface. Instead of getting the checkerboard image I expect, I get different versions of the android icon depending on which version of target I choose. If I render the image to an ImageView this is confirmed as it's the same as on the SD card.</p><p>Any ideas</p><p>Ta</p><p>J</p>","461825","","","","","2011-01-19 23:49:30","Camera/SurfaceView app returns android icon not emulator checkerboard image","<android>","1","0","","",""
"3822555","1","3822628","","2010-09-29 14:26:40","0","641","<p>I have 4 buttons in a horizontal linear layout. I'd like the right edge of the 4th button to align with the right edge of the linear layout (equal to screen width) I've tried using android:layout_gravity=""right"" but it doesn't work - the right button is to the right of the 3rd one but not right aligned . Am I missing something obvious?</p><p>main.xml with only the relevant layout params only is:</p><pre><code>&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;       &lt;Button           android:layout_height=""fill_parent""           android:layout_width=""wrap_content""&gt;       &lt;Button SAME LAYOUT AS BUTTON 1&gt;       &lt;Button SAME LAYOUT AS BUTTON 1&gt;       &lt;Button           android:layout_height=""fill_parent""           android:layout_width=""wrap_content""           android:layout_gravity=""right"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>This doesn't seem to match the stated behaviour for layout_gravity in the SDK reference :""Defines how to place the view, both its x- and y-axis, within its parent view group."" </p>","440010","","","","","2010-09-29 14:33:41","android:layout_gravity effect in main.xml?","<android>","1","0","","",""
"3822666","1","3824243","","2010-09-29 14:36:52","2","7204","<p>Hello i  wanna do apliacation which every 1 second call function or do something else.I have this code which is not working can you tell what is wrong?</p><pre><code>public class App5_Thread extends Activity implements Runnable {            @Override        public void onCreate(Bundle savedInstanceState) {                super.onCreate(savedInstanceState);                setContentView(R.layout.main);                Thread thread = new Thread(this);                    thread.start();        }        @Override                            public void run() {                                TextView tv1 = (TextView) findViewById(R.id.tv);                showTime(tv1);                                                                                try {                    Thread.sleep(1000);                }catch (Exception e) {                    tv1.setText(e.toString());                }                    }         public void showTime(TextView tv1 ){                            String DATE_FORMAT_NOW = ""yyyy-MM-dd HH:mm:ss"";            Calendar cal = Calendar.getInstance();            SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);            tv1.setText(sdf.format(cal.getTime())+"" ""+System.currentTimeMillis());                            }           </code></pre><p>}</p>","461790","","15168","","2013-11-23 06:12:04","2013-11-23 06:12:04","How do i make Android app which do something every X second","<android><multithreading><action>","4","3","1","",""
"3822693","1","","","2010-09-29 14:39:43","1","228","<p>I am trying to debug rild.c deamon with gdb.I followed the steps given in developer site with respect to gdbserver and gdb.After the connection is established between gdbserver and gdb in localhost iam not able to step in GDB i,e when i give next or Step command in gdb it simply hangs.can anyone tell me what's the problem?   </p>","461855","","","","","2010-09-29 14:39:43","Debugging Android with GDB","<android>","0","0","","",""
"3822732","1","3822756","","2010-09-29 14:43:24","2","10236","<p>When programming for Android sometimes you have to use static methods. But when you try to access you resources in a static method with <code>getString(R.string.text)</code> you'll get an error. Making it static doesn't work.</p><p>Does anyone knows a good way around this? The resource files in Android are very helpful for creating things in different languages or making changes to a text.</p>","461864","","1542891","","2014-02-28 11:13:09","2014-03-30 05:21:30","Android: getString(R.string) in static method","<android><static><getstring>","5","0","","",""
"3822735","1","3822783","","2010-09-29 14:43:41","2","1032","<p>i want to launch an intent from android website what code do i need to add in the HTML , for example how could i launch the dialer intent after the user click on number in the website .</p><p>i saw some example in the web like when you click download app in website and it launches the android market . </p><p>thanks  </p>","302707","","271917","","2010-09-29 14:46:02","2010-09-29 14:47:35","Calling Android intent from Web page?","<android><android-intent>","1","0","","",""
"3822764","1","","","2010-09-29 14:46:30","0","2079","<p>Actually, what I want is a textview which can show the progress of something, I know progressbar in android,however,so far as I know, it can not contain any text(am I right?), so, I want to change the background color of the textview to show progress,from left to right gradually.</p><p>Is there any other way to do this ?</p><p>Thanks in advance?</p>","461867","","","","","2010-09-29 16:02:02","How to change the background color of a TextView in android?","<android><colors><textview><progress>","3","0","","",""
"3822911","1","","","2010-09-29 15:03:31","0","1362","<p>I have one screen. it consists of an edit text.I want when this screen shown  on the screen, keypad automatically shown by default without clicking on the edit text.</p>","383597","","244296","","2010-09-29 15:11:16","2010-09-29 16:31:10","How to enable on-screen keyboard?","<android><android-widget>","2","0","","",""
"3822955","1","3822979","","2010-09-29 15:09:11","1","895","<p>I have set a button onTouchListener and I would like to replace it with another listener.  I believe that I need to use the removeCallbacks call before setting the new listener for the button, but I'm not sure how to use removeCallbacks and I'm not even sure if it's the right method to use.  I originally set the listener like this:</p><pre><code>mybutton.setOnTouchListener(new View.OnTouchListener() {            public boolean onTouch(View v, MotionEvent event) {                some code here            }});</code></pre><p>Please advise.</p>","265877","","","","","2010-09-29 15:15:30","Using removeCallbacks","<android><callback>","1","0","","",""
"3822969","1","3823151","","2010-09-29 15:10:40","1","2867","<p>I am using an ActivityGroup to spawn multiple activities and switch views from within the same tab in a TabActivity.</p><p>When I press the back key this method is called inside my ActivityGroup</p><pre><code>public void back() {          if(history.size() &gt; 0) {              history.remove(history.size()-1);            if (history.size() &gt; 0)             setContentView(history.get(history.size()-1));             else              initView();        }else {              finish();          }      }  </code></pre><p>this method allows me to keep a stack of my activities and go back to the previous one when the back key is pressed.</p><p>this is working well on all my nested activities, except on a ListActivity where a press on the back key will simply exit the application.</p>","271395","","","","","2011-07-05 03:22:07","ActivityGroup not handling back key for ListActivity","<android><activity><lifecycle>","3","1","","",""
"3823053","1","3934953","","2010-09-29 15:22:49","0","314","<p>Using Android2.1 when I try to use solo's searchText or findText it isn't able to find text in text notifications created with makeToast, has anyone ran into this problem before and know a fix?</p>","198034","","3043","","2011-12-09 19:01:54","2011-12-09 19:01:54","searchText and findText not working for android solo tests when there is a message notification?","<android>","1","0","","",""
"3823163","1","3826875","","2010-09-29 15:34:05","0","650","<p>I am creating a <code>Splash</code> screen(<code>Activity</code>) in my Android app.  I have an inner class which extends <code>AsyncTask</code>.  The constructor for this inner class accepts a <code>Context</code> object, which is being sent inside the <code>Splash</code> activity's <code>onCreate</code> method.  There is also reference to a constant <code>String</code> field.  </p><pre><code>public class Splash extends Activity {private static final String TAG = ""Splash"";/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.splash);    new SplashAsyncTask(this).execute(new Void[] {});}private class SplashAsyncTask extends AsyncTask&lt;Void, Void, Void&gt; {    private Context context;    public SplashAsyncTask(Context context) {        this.context = context;    }    @Override    protected Void doInBackground(Void... params) {        try {            Thread.sleep(1500);        }        catch(InterruptedException e) {            if(Constants.LOGGING)                Log.e(TAG, e.toString());        }        return null;    }    @Override    protected void onPostExecute(Void result) {        super.onPostExecute(result);    }}}</code></pre><p>what scope should i be using for the <code>private static final String TAG = ""Splash"";</code> variable? all scopes seem to work fine, but what is proper/more efficient? I notice that eclipse automatically creates the variable with the <code>public</code> scope declaration</p><p>Also, Do i really need to send the <code>Context</code> object to the <code>SplashAsyncTask</code> constructor? or can i/should i just use <code>Splash.this</code> in all cases where i need a <code>Context</code> reference?</p>","416412","","416412","","2010-09-29 15:51:22","2010-09-30 00:25:35","variable scope with inner classes","<java><android><variable-scope>","1","3","","",""
"3823532","1","3823777","","2010-09-29 16:08:47","0","1407","<p>I have created two activities say A and B. Activity A lists list of songs. When we press in any of these songs, the activty B will be called by using startActivity(). Now the activity B will start one thread to create and start mediaplayer with selected song and also show song progress. Everything works fine if we press the back button in activity B,obviously, we will come to activity A and the media player never stops the playing, this is also fine. My problem is after pressing the back button if we select another song,the activity B will be called, then another instance of media player object will be created instead of stopping previously running media player object..So anyone just tell me how can i stop that media player object???Thanks in advance</p>","461975","","13070","","2010-09-29 16:09:54","2010-09-29 16:36:58","How to stop already running media player instance when again start that activity, after pressing the back button","<android>","1","0","","",""
"3823595","1","3823624","","2010-09-29 16:16:26","0","1709","<p>I want to develop facebook client in android using fbrocket api.but,this api only allows input as facebook api key not the username and password.is there any solution?..Thanks in advance</p>","461972","","405906","","2010-09-29 16:19:42","2010-09-29 16:30:39","FaceBook Api for Android","<android><facebook>","1","0","1","",""
"3823607","1","3824427","","2010-09-29 16:18:42","27","14920","<p>I have the following gradient: </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;gradient             android:startColor=""#ECECEC""            android:centerColor=""#F6F6F4""            android:endColor=""#F8F8F6""            android:angle=""90""            android:dither=""true""         /&gt;    &lt;/shape&gt;</code></pre><p>I want this to be transparent because in my ListView I am setting this as my ListSelector:</p><pre><code>&lt;ListView android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" xmlns:android=""http://schemas.android.com/apk/res/android""                android:id=""@+id/ARListView""                 android:background=""@drawable/transparent_background""                 android:cacheColorHint=""#00000000"" android:drawSelectorOnTop=""true""                 android:listSelector=""@drawable/stocks_selected_gradient""&gt;&lt;/ListView&gt;</code></pre>","19875","","","","","2010-10-19 18:07:24","How to make transparent gradient?","<android><listview><transparency><gradient>","2","0","9","",""
"3823612","1","3824400","","2010-09-29 16:19:07","0","837","<p>Is it possible, with an IntentService, to send another intent to the IntentService from within the IntentService?</p><p>For example, say my IntentService is processing an Intent which has it write a bunch of data to the database.  During this time, several other Intents to write other data may [or may not] have been queued up in the IntentService.  Suppose, after processing that Intent by writing the data to the application's database, I want to queue up another Intent to send that data via web service to ""the cloud.""  Perhaps I want to queue this processing in another Intent because sending to the cloud is secondary.</p><p>Is it possible?  Would it cause any problems if the Intent being processed is the only Intent in the queue at the time the IntentService is trying to queue another Intent?</p>","406790","","","","","2010-09-30 14:45:51","Queuing Intent for IntentService from within IntentService","<android><service><android-intent>","2","0","","",""
"3823638","1","3823685","","2010-09-29 16:20:58","0","961","<p>I need to make HTTP request on Android using GSM connection, not Wifi.</p><p>My current solution is to disconnect from all wi-fi connections and perform a request. Is there any better solution? I could not find any relevant methods in the API (I looked in package <code>org.apache.http</code>, but it seems it is completely unaware of what type of connection should be used).</p>","216764","","","","","2011-09-05 12:10:49","Make HTTP connection using GSM network, not WiFi","<android><http><wifi><gsm>","2","0","1","",""
"3823677","1","","","2010-09-29 16:24:47","1","2354","<p>I'm using Eclipse 3.6.0 with JDK 6. My build target is Android 2.2. I'm developing under Windows 7.</p><p>I'm trying to fetch an XML file like the following: </p><pre><code>SAXParserFactory spf = SAXParserFactory.newInstance();try {    //get a new instance of parser    SAXParser sp = spf.newSAXParser();    //parse the file and also register this class for call backs    sp.parse(""http://ipaddress/my/valid/path.xml"", this);}catch(SAXException se) {    se.printStackTrace();}catch(ParserConfigurationException pce) {    pce.printStackTrace();}catch (IOException ie) {    ie.printStackTrace();}</code></pre><p>But I'm getting a permission denied error (caused by socket exception) in the debugger. Apart from that, I also get <code>sntpclient error: address family not supported by protocol.</code>Here are the detailed logs:</p><pre><code>09-29 16:13:40.181: WARN/System.err(304): java.io.IOException: Couldn't open http://213.137.198.141:8085/MarketDataServiceV3.asmx/GetIntraday?instrument=FSPAA.ST&amp;from=2010-09-01&amp;to=2010-09-20&amp;authentication=D41D8CD98F00B204E9800998ECF8427E&amp;nocache=true09-29 16:13:40.200: WARN/System.err(304):     at org.apache.harmony.xml.ExpatParser.openUrl(ExpatParser.java:759)09-29 16:13:40.210: WARN/System.err(304):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:291)09-29 16:13:40.210: WARN/System.err(304):     at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)09-29 16:13:40.220: WARN/System.err(304):     at javax.xml.parsers.SAXParser.parse(SAXParser.java:268)09-29 16:13:40.230: WARN/System.err(304):     at aiCharts.GettingStarted.MySAXParser.parseDocument(MySAXParser.java:45)09-29 16:13:40.239: WARN/System.err(304):     at aiCharts.GettingStarted.DataFactory.getChartDataByWebService(DataFactory.java:30)09-29 16:13:40.249: WARN/System.err(304):     at aiCharts.GettingStarted.GettingStartedActivity.onCreate(GettingStartedActivity.java:42)09-29 16:13:40.249: WARN/System.err(304):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-29 16:13:40.260: WARN/System.err(304):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)09-29 16:13:40.270: WARN/System.err(304):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)09-29 16:13:40.279: WARN/System.err(304):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)09-29 16:13:40.279: WARN/System.err(304):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)09-29 16:13:40.289: WARN/System.err(304):     at android.os.Handler.dispatchMessage(Handler.java:99)09-29 16:13:40.289: WARN/System.err(304):     at android.os.Looper.loop(Looper.java:123)09-29 16:13:40.301: WARN/System.err(304):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-29 16:13:40.301: WARN/System.err(304):     at java.lang.reflect.Method.invokeNative(Native Method)09-29 16:13:40.320: WARN/System.err(304):     at java.lang.reflect.Method.invoke(Method.java:521)09-29 16:13:40.320: WARN/System.err(304):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-29 16:13:40.331: WARN/System.err(304):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-29 16:13:40.339: WARN/System.err(304):     at dalvik.system.NativeStart.main(Native Method)09-29 16:13:40.351: WARN/System.err(304): Caused by: java.net.SocketException: Permission denied09-29 16:13:40.370: WARN/System.err(304):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method)09-29 16:13:40.390: WARN/System.err(304):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186)09-29 16:13:40.390: WARN/System.err(304):     at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265)09-29 16:13:40.399: WARN/System.err(304):     at java.net.Socket.checkClosedAndCreate(Socket.java:873)09-29 16:13:40.409: WARN/System.err(304):     at java.net.Socket.connect(Socket.java:1020)09-29 16:13:40.409: WARN/System.err(304):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:62)09-29 16:13:40.419: WARN/System.err(304):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)09-29 16:13:40.431: WARN/System.err(304):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)09-29 16:13:40.441: WARN/System.err(304):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)09-29 16:13:40.441: WARN/System.err(304):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1152)09-29 16:13:40.450: WARN/System.err(304):     at org.apache.harmony.xml.ExpatParser.openUrl(ExpatParser.java:757)09-29 16:13:40.450: WARN/System.err(304):     ... 19 more09-29 16:14:26.580: DEBUG/SntpClient(59): request time failed: java.net.SocketException: Address family not supported by protocol`</code></pre><p>I can parse the file when I run it separately as a Java application. I have also permitted internet access in the manifest. The manifest entry is:</p><pre><code>uses-permission android:name=""INTERNET""</code></pre>","461996","","496830","","2011-10-11 17:39:03","2011-10-11 17:39:03","How do I fix this ""address family not supported by protocol"" error?","<java><android><eclipse>","0","2","1","","2010-09-30 08:59:47"
"3823684","1","","","2010-09-29 16:25:26","0","2112","<p>based on Hello-ListView turorial in Android, <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/views/hello-listview.html</a></p><p>on the </p><pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, COUNTRIES));</code></pre><p>had an error because there is no R.layout.list_item </p><p>previously i had followed the tutorial, created the file list_item.xml on the res/layout folder</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:padding=""10dp""android:textSize=""16sp""&gt;&lt;/TextView&gt;</code></pre><p>it doesnt work with different name neither (main_list_view.xml)</p><p>this is the complete source</p><pre><code>String[] appList;ListView mainLv;    @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);     appList = this.getResources().getStringArray(R.array.for_main_layout);    mainLv = (ListView)findViewById(R.id.ListView01);     mainLv.setAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, appList)); //&lt;&lt;}</code></pre><p>Updated!Ah its works now when creating new project! When i use File>new>Android XML File in the first project, it doesnt work, but now in different project, i use file>new>File, maybe is this a possible bug? </p>","448451","","1228","","2013-08-14 15:55:10","2013-08-14 15:55:10","Android there is no ListView adapter resourceId","<android><xml><android-arrayadapter><listadapter>","3","3","","",""
"3823704","1","","","2010-09-29 16:27:59","0","467","<p>I would like to be able to program the Android to send a short voice recording (approx 10 word message) to a land line (i.e non mobile) phone.  Is this possible?   I have googled re this and it appears that though I can send a text message I cant do the voice message thing.  Is this still the case?</p>","442245","","415347","","2011-09-05 11:56:59","2011-09-05 11:56:59","can I send a short voice recording to another non mobile phone","<android>","1","0","","",""
"3823765","1","","","2010-09-29 16:35:04","4","5668","<p>What is the Activity Creator in Android?</p>","489762","","844882","","2012-03-22 20:11:54","2012-03-22 20:12:42","Activity Creator","<android>","3","0","1","",""
"3823799","1","3827048","","2010-09-29 16:39:05","37","40548","<p>Lets say i have loaded an image in a bitmap object like</p><pre><code>Bitmap myBitmap = BitmapFactory.decodeFile(myFile);</code></pre><p>Now what will happen if i load another bitmap like</p><pre><code>myBitmap = BitmapFactory.decodeFile(myFile2);</code></pre><p>What happens to the first myBitmap does it get Garbage Collected or do i have to manually garbage collect it before loading another bitmap , eg.  <code>myBitmap.recycle()</code></p><p>Also is there a better way to load large images and display them one after another recycling on the way</p>","388044","","278488","","2011-09-28 01:25:48","2014-01-20 15:15:17","Android: Bitmap recycle() how does it work?","<android><bitmap>","5","0","18","",""
"3823807","1","3823894","","2010-09-29 16:39:34","6","1120","<p>I have a file that contains about 200,000 long values that I want to read as fast as possible into a long[]. It's for an Android app; function calls are slow (so anything involving reading a long at a time with a ""for"" loop will be super slow) and I need loading to be fast. What can I use? Everything I look at seems to read only bytes fast.</p><p>I've used <code>ByteBuffer</code> and <code>FileChannel</code> from the NIO package before and this seems a really fast way to load arrays of values from files. However, I cannot work out how to use this to read  data into a long[]. I've tried wrapping a long[] as a LongBuffer, but I cannot see any way I can feed data from a file into a LongBuffer. </p><p>Edit: Whatever method I use, I need to be able to use <code>Arrays.binarySearch</code> on the <code>long[]</code> array at the end.</p>","461841","","415347","","2011-09-05 11:55:50","2011-09-05 11:55:50","Fastest way to read long[] from file?","<java><android><file><optimization><io>","2","1","1","",""
"3823934","1","","","2010-09-29 16:50:56","5","4092","<p>So how can I fix this problem. It seems my DDMS is broken down.</p>","462019","","","","","2012-12-20 13:55:29","Android- the DDMS shows the message: logcat read: Invalid argument","<android><ddms>","5","0","1","",""
"3823987","1","","","2010-09-29 16:56:53","2","8447","<p>I'm trying to end a new outgoing call after few seconds. Here is my code:</p><pre><code>public class phonecalls extends Activity {    ComponentName cn;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        call();    }    private void call() {        try {            Intent callIntent = new Intent(Intent.ACTION_CALL);            callIntent.setData(Uri.parse(""tel:123456789""));            startActivity(callIntent);            cn = new ComponentName(getApplicationContext(), Receiver.class);        } catch (ActivityNotFoundException activityException) {            Log.e(""dialing-example"", ""Call failed"", activityException);        }    }}</code></pre><p>My receiver class is:</p><pre><code>public class Receiver extends BroadcastReceiver {    public void onReceive(Context context, Intent intent) {        if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {            setResultData(null);        }    }}</code></pre><p>I am unable to abort the outgoing call. I'm new to Android and can't seem to get this to work. </p>","458295","","154306","","2011-01-26 11:51:43","2012-04-27 05:14:45","End Call in Android","<android><android-intent><telephony>","4","0","1","",""
"3824007","1","3833107","","2010-09-29 16:58:48","0","3171","<p>I created a custom AlertDialog to display a Spinner and some EditText elements. When I select a menu option, this custom AlertDialog gets launched. Everything works fine until I actually select the spinner to try and select an item, at which point I get the BadTokenException. I've read other StackOverflow posts saying that similiar exceptions were the result of trying to display a diaglog using getApplicationContext() rather than passing Activity.this. I'm not explicitly passing getApplicationContext() to anything related to this AlertDialog.</p><p>To setup this custom AlertDiaglog, I created a layout file containing the Spinner and EditText elements, and then made the AlertDialog use that layout:</p><pre><code>LayoutInflater inflater = (LayoutInflater)getApplication().getSystemService(LAYOUT_INFLATER_SERVICE);View layout = inflater.inflate(R.layout.custom_layout, (ViewGroup)findViewById(R.id.custom_layout_root));spinner = (Spinner)layout.findViewById(R.id.custom_layout_spinner);ArrayAdapter adap = ArrayAdapter.createFromResource(Activity.this, R.array.data, android.R.layout.simple_spinner_item);adap.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);spinner.setAdapter(adap);spinner.setOnItemSelectedListener(new SpinnerItemListener());AlertDialog.Builder dialog = new AlertDialog.Builder(Activity.this);dialog.setTitle(""Title"");dialog.setPositiveButton(""Ok"", new Dialog.OnClickListener() ......dialog.show();</code></pre><p>This code all works fine for displaying the AlertDialog. However, when I actually touch the Spinner, I get the following problem:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception WindowManager$BadTokenException)) ViewRoot.handleMessage(Message) line: 1704ViewRoot(Handler).dispatchMessage(Message) line: 99 Looper.loop() line: 123 ActivityThread.main(String[]) line: 4203Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]Method.invoke(Object, Object...) line: 521ZygoteInit$MethodAndArgsCaller.run() line: 791ZygoteInit.main(String[]) line: 549NativeStart.main(String[]) line: not available [native method]</code></pre><p>Does anyone have an idea  of what's going on? The exception message says:</p><pre><code>Unable to add window -- token null is not for an application</code></pre><p>I believe this is the message others have seen for this type of problem, so I'm assuming that ApplicationContext is somewhere in the mix, but I'm not sure where. My manifest is setup with minSdk of 1.5 with a Target SDK of 1.6.</p>","449070","","","","","2012-10-15 21:50:33","Selecting Android Spinner Causes WindowManager$BadTokenException","<android><exception><spinner>","2","0","1","",""
"3824279","1","","","2010-09-29 17:30:56","0","546","<p>i test this tutorial with the sample images they have and work's ok</p><p>but when i put my own images then application crash (stopped unexpectedly)</p><p>why? the only i do is to put my own images with the same name than sample images....</p><p>for example, i erase sample image <code>sample_0.jpg</code> and i put my own image from my harddisk with the same name <code>sample_0.jpg</code></p><p>but then the application crash</p><p>why?</p><p>thanks</p>","462055","","415347","","2011-09-05 11:55:21","2011-09-05 11:55:21","Problems with HelloGridView tutorial from Android Developer site","<android><gridview><view><grid>","0","9","","",""
"3824324","1","3846201","","2010-09-29 17:39:06","1","559","<p>I am trying to download a zipped file from the web on the first instance of the application; can someone point me to a tutorial for this (I don't see good documentation on developer.android)?  I understand how to check if it's the initial start or not, and also how to use java.util.zip once I get the file, but it's the in-between where I'm lost.</p>","375566","","12113","","2013-03-14 17:25:33","2013-03-14 17:25:33","How to download a file from the web using Android 1.6","<android>","1","0","0","",""
"3824337","1","3835167","","2010-09-29 17:41:07","1","1400","<p>For some reason the onpause method is not always getting called when my app is put into the background. Either that or the <code>MyLocationOverlay</code> is not properly disabling. </p><p>My app uses google maps and the <code>MyLocationOverlay</code>. When starting the app, I call <code>MyLocationOverlay.enableMyLocation()</code> in the <code>onResume</code> method. In the <code>onPause</code> method I call <code>MyLocationOverlay.disableMyLocation()</code>. However, when I hit the home key or the back key to go to the home screen, the GPS stays running as indicated by the top of the status bar with the gps icon.</p><p>EDIT: It does not work on either the  emulator or the phone. </p><p>EDIT2: the gps icon only goes away when I use Advanced Task Killer to kill it.</p><p>EDIT3: onPause is definitely being called as I put a Log statement in it, but the gps icon remains. Therefore it looks like either the gps service isn't shutting down, or the <code>MyLocationOverlay</code> has a bug with the <code>disableMyLocation()</code> method.</p><p>Here is my manifest file and excerpts from my Activity:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""xmlns:myapp=""http://schemas.android.com/apk/res/com.tfb""  package=""com.tfb""  android:versionName=""1.2.2"" android:versionCode=""11""&gt;&lt;application android:icon=""@drawable/globe_search""      android:label=""@string/app_name""    android:theme=""@android:style/Theme.NoTitleBar""&gt;    &lt;activity android:name="".activity.GarageSaleMap""              android:label=""@string/app_name""              android:configChanges=""keyboardHidden|orientation""              android:launchMode=""singleTop""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.SEARCH"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.app.searchable""                   android:resource=""@xml/searchable""/&gt;   &lt;/activity&gt;   &lt;uses-library android:name=""com.google.android.maps"" /&gt;&lt;meta-data android:value=""xxxxxxxxxxx"" android:name=""ADMOB_PUBLISHER_ID""/&gt;&lt;meta-data android:value=""true"" android:name=""ADMOB_ALLOW_LOCATION_FOR_ADS""/&gt;&lt;/application&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""/&gt;&lt;uses-sdk android:minSdkVersion=""4"" android:targetSdkVersion=""8""/&gt;&lt;/manifest&gt; </code></pre><p>Activity    </p><pre><code>private void doMain() {    mapView = (MapView) findViewById(R.id.mapview);    MapView localMapView = mapView;    localMapView.setBuiltInZoomControls(true);    final MapController controller = localMapView.getController();    localMapView.getZoomButtonsController().setAutoDismissed(false);    lastSearchButton = (ImageButton) findViewById(R.id.lastSearchButton);    lastSearchButton.setOnClickListener(new LastSearchButtonListener(this));    GeoPoint point = new GeoPoint((int)(40.8138 * 1e6), (int)(-96.6831 * 1e6));//Lincoln, NE    controller.animateTo(point);    controller.setZoom(13);    pushPinItemizedOverlay = getPushPinOverlay();    localMapView.getOverlays().add(pushPinItemizedOverlay);    new PopulateMapTask(this).execute();     locationOverlay = new FixedMyLocationOverlay(this, localMapView);    localMapView.getOverlays().add(locationOverlay);}@Overrideprotected void onPause() {    locationOverlay.disableMyLocation();    super.onPause();}@Overrideprotected void onResume() {    locationOverlay.enableMyLocation();    super.onResume();}</code></pre><p>Any help would be greatly appreciated. </p>","32965","","32965","","2010-09-30 15:49:43","2011-03-24 21:30:18","activity.onPause not always getting called","<android>","2","0","","",""
"3824340","1","3824700","","2010-09-29 17:41:46","2","1953","<p>Im tring to simulate a slideup animation.The idea is to slideup and slidedown the tablelayout with the id searchForm when pressing the button so that i can use the extra space for a list. I managed to slideup the searchForm and the button and the list seems to be visible but after this i cant click the button, here's the code responsible for the slideup animatio:</p><pre><code>TranslateAnimation slide = new TranslateAnimation(0, 0, 0,  -findViewById(R.id.searchForm).getHeight());   slide.setDuration(500);   slide.setFillAfter(true);   findViewById(R.id.searchForm).startAnimation(slide);   findViewById(R.id.listBut).startAnimation(slide);adapterSearch.add(new NotificationEntry("""",""444/2010"",""TEste"",""Etapa de teste2"",""2010""));</code></pre><p>Here's the xml that has the view elements:</p><pre><code>&lt;TableLayout android:id=""@+id/search""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:layout_alignParentBottom=""true"" android:stretchColumns=""1""&gt;&lt;TableLayout  android:id=""@+id/searchForm""    android:layout_width=""fill_parent""  android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true""  android:stretchColumns=""1""&gt; &lt;TableRow android:paddingTop=""5px""&gt;  &lt;TextView android:text=""Nº Processo:"" /&gt;  &lt;EditText android:id=""@+id/processNr"" /&gt; &lt;/TableRow&gt; &lt;View android:id=""@+id/View01""   android:layout_width=""wrap_content""  android:background=""#B5B5B5""   android:layout_height=""1px""  android:paddingBottom=""2px""&gt; &lt;/View&gt; &lt;TableRow android:paddingTop=""5px""&gt;  &lt;TextView android:text=""Etapa:"" /&gt;  &lt;EditText android:id=""@+id/tasksearch"" /&gt; &lt;/TableRow&gt; &lt;View android:id=""@+id/View01""   android:layout_width=""wrap_content""  android:background=""#B5B5B5""   android:layout_height=""1px""  android:paddingBottom=""2px""&gt; &lt;/View&gt; &lt;TableRow android:paddingTop=""5px""&gt;  &lt;TextView android:text=""Data inicio:""    android:id=""@+id/datepick"" /&gt;  &lt;EditText android:id=""@+id/datebegvalue"" /&gt; &lt;/TableRow&gt; &lt;View android:id=""@+id/View01""   android:layout_width=""wrap_content""  android:background=""#B5B5B5""   android:layout_height=""1px""  android:paddingBottom=""2px""   android:paddingTop=""5px""&gt; &lt;/View&gt; &lt;TableRow android:paddingTop=""5px""&gt;  &lt;TextView android:text=""Data Fim:""    android:id=""@+id/dateendpick"" /&gt;  &lt;EditText android:id=""@+id/dateendvalue"" /&gt; &lt;/TableRow&gt; &lt;View android:id=""@+id/View01""   android:layout_width=""wrap_content""  android:background=""#B5B5B5""   android:layout_height=""1px""  android:paddingBottom=""2px""   android:paddingTop=""5px""&gt; &lt;/View&gt;  &lt;/TableLayout&gt;&lt;TableLayout android:id=""@+id/listBut""&gt; &lt;TableRow android:paddingTop=""5px""&gt;   &lt;Button android:id=""@+id/send""     android:text=""Procurar""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent"" /&gt; &lt;/TableRow&gt; &lt;ListView android:id=""@+id/processlistsearch""  android:layout_width=""fill_parent""   android:layout_height=""fill_parent"" /&gt;&lt;/TableLayout&gt;</code></pre><p></p>","382115","","","","","2010-09-29 18:36:23","Button not working after TranslateAnimation ends","<android><animation>","1","0","2","",""
"3824378","1","3824420","","2010-09-29 17:46:15","4","1054","<p>I know you need root access if you want to capture a screenshot by using a background application. However is it possible to just grab the screen content of your current visible activity owned by your process? This does not seem like a security constraint since the user has already installed your app is currently using your app. If so how does this work?</p>","307990","","","","","2010-09-29 17:52:38","Android: How do you capture a screenshot of your own app programatically","<android>","1","0","3","",""
"3824504","1","3825593","","2010-09-29 18:03:56","0","10822","<p>I am writing an android app to give the user the option to call a different alternative number based on the number he tried to call.To do that I have BroadCastReceiver that gets the number being called, checks if there are alternatives and then to show the dialog it starts a new activity to do that as it can not do on its own.Everything is ok except the activity get closed before the dialog appears, so I get a window leaked exception but I can not see how I can make it works, waiting for the result of the dialog (uncomment the loop in the NumberDialog class) results in no exception but no dialog.</p><p>The sources are:</p><pre><code>package com.frisco.hello;import java.io.IOException;import java.util.ArrayList;import java.util.List;import android.app.AlertDialog;import android.content.BroadcastReceiver;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.database.SQLException;import android.net.Uri;import android.util.Log;import android.widget.Toast;import com.frisco.hello.util.DataBaseHelper;public class Caller extends BroadcastReceiver {    private static final String TAG = ""HelloWorld"";    @Override    public void onReceive(Context context, Intent intent) {        String intentAction = intent.getAction();        String number = getResultData();        if (intentAction.equals(Intent.ACTION_NEW_OUTGOING_CALL) &amp;&amp; number != null)        {            Log.d(TAG, ""Recibido evento por el numero"" + number);            DataBaseHelper myDbHelper = new DataBaseHelper(context);                     try {                            myDbHelper.createDataBase();                         } catch (IOException ioe) {                          throw new Error(""Unable to create database"");                        }                        try {                            myDbHelper.openDataBase();                       }catch(SQLException sqle){                           throw sqle;                      }            String[] results = myDbHelper.getAlternateNumbers(number);            if (results.length &gt; 1) {                intent = new Intent(Intent.ACTION_CALL,                        Uri.fromParts(""com.frisco.hello.number"", Uri.decode(number),null));                number = null;                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                context.startActivity(intent);              }        }    }   }</code></pre><p>Number dialog:</p><pre><code>package com.frisco.hello;import java.io.IOException;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.content.DialogInterface.OnCancelListener;import android.database.SQLException;import android.net.Uri;import android.os.Bundle;import android.util.Log;import android.view.Window;import com.frisco.hello.util.DataBaseHelper;public class NumberDialog extends Activity {    private static final String TAG = ""HelloWorld"";     private CharSequence[] alternates;    private CharSequence selected = null;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        Uri uri = getIntent().getData();        String target = uri.getSchemeSpecificPart();        Log.d(TAG,""Decodificado el numero como ""+target);        DataBaseHelper myDbHelper = new DataBaseHelper(this);                try {                        myDbHelper.createDataBase();                     } catch (IOException ioe) {                      throw new Error(""Unable to create database"");                    }                    try {                        myDbHelper.openDataBase();                   }catch(SQLException sqle){                       throw sqle;                  }          String[] results = myDbHelper.getAlternateNumbers(target);        alternates = results;        new AlertDialog.Builder( this)            .setTitle( ""Select number"" )            .setItems( results, new DialogSelectionClickHandler())            .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int whichButton) {                        finish();                    }                })            .setOnCancelListener(new OnCancelListener() {                public void onCancel(DialogInterface dialog) {                    finish();                }            })                      .show(); /*      while (selected == null) {            try {                Thread.sleep(500);            } catch (InterruptedException e) {                ;            }        }        Log.i( TAG, ""Seleccionado "" + selected );*/          }    public class DialogSelectionClickHandler implements DialogInterface.OnClickListener, DialogInterface.OnDismissListener    {        @Override        public void onClick(DialogInterface dialog, int which) {            Log.i( TAG, which+""_""+alternates[which] );            selected = alternates[which];        }        @Override        public void onDismiss(DialogInterface dialog) {            Log.i( TAG, ""Dismissed"" );            selected = alternates[0];        }    }    }</code></pre><p>LogCat</p><pre><code>09-29 17:52:28.309: ERROR/WindowManager(4464): Activity com.frisco.hello.NumberDialog has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43e48270 that was originally added here09-29 17:52:28.309: ERROR/WindowManager(4464): android.view.WindowLeaked: Activity com.frisco.hello.NumberDialog has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@43e48270 that was originally added here09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:247)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.view.Window$LocalWindowManager.addView(Window.java:424)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.app.Dialog.show(Dialog.java:241)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.app.AlertDialog$Builder.show(AlertDialog.java:802)09-29 17:52:28.309: ERROR/WindowManager(4464):     at com.frisco.hello.NumberDialog.onCreate(NumberDialog.java:56)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.os.Handler.dispatchMessage(Handler.java:99)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.os.Looper.loop(Looper.java:123)09-29 17:52:28.309: ERROR/WindowManager(4464):     at android.app.ActivityThread.main(ActivityThread.java:4627)09-29 17:52:28.309: ERROR/WindowManager(4464):     at java.lang.reflect.Method.invokeNative(Native Method)09-29 17:52:28.309: ERROR/WindowManager(4464):     at java.lang.reflect.Method.invoke(Method.java:521)09-29 17:52:28.309: ERROR/WindowManager(4464):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)09-29 17:52:28.309: ERROR/WindowManager(4464):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)09-29 17:52:28.309: ERROR/WindowManager(4464):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","454332","","","","","2010-09-29 20:29:57","Problem with ""has leaked window"" on dialog","<android><dialog><broadcastreceiver>","2","4","","",""
"3824613","1","3992111","","2010-09-29 18:17:06","6","5033","<p>I'm adding the ability to share scores from my app using android's share intent:</p><pre><code>Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);shareIntent.setType(""text/plain"");shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""My Score"");shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""I scored ""+score+"" on ""+difficultyString+"" difficulty."");context.startActivity(Intent.createChooser(shareIntent, ""Share your score""));</code></pre><p>When I choose Facebook from the chooser, it goes to m.facebook.com and says ""Your link could not be shared"". What's going wrong here?</p>","319618","","319618","","2010-10-16 19:26:16","2011-12-15 21:10:27","facebook: Your link could not be shared","<android><facebook>","5","4","5","",""
"3824622","1","","","2010-09-29 18:18:17","0","1092","<p>How do I create a header for every expanded <code>ChildView</code> without affecting my underlying data and onClick / onLongClick events on the <code>ChildView</code>. Below is the skeleton implementation of my <code>ExpandableListView</code> adapter:</p><p>private class EAdapter extends CursorTreeAdapter {</p><pre><code>public EAdapter(Cursor cursor, Context context) {   super(cursor, context);  }  @Override  protected void bindChildView(View view, Context context, Cursor cursor,    boolean isLastChild) { }  @Override  protected void bindGroupView(View view, Context context, Cursor cursor,    boolean isExpanded) { }  ChildHolder childHolder;  @Override  protected View newChildView(Context context, Cursor cursor,    boolean isLastChild, ViewGroup parent) {  view.setTag(childHolder);   registerForContextMenu(view);   return view;  }  GroupHolder groupHolder;  @Override  protected View newGroupView(Context context, final Cursor cursor,    boolean isExpanded, ViewGroup parent) {view.setTag(groupHolder);   return view;  }  @Override  protected Cursor getChildrenCursor(Cursor groupCursor) { return cursor;  }}</code></pre><p>Any help/pointers will be most helpful.</p>","356580","","415347","","2011-09-05 11:54:20","2011-09-05 11:54:20","Child headers for ExpandableListView using CursorTreeAdapter","<android><header><expandablelistview>","1","1","","",""
"3824763","1","3824802","","2010-09-29 18:35:16","1","749","<p>Just a random question. I'm learning a bit of Android right now, and in most examples, it seems a lot of common items (such as buttons, editboxes etc) get requested within each function using <code>(cast) findViewById()</code>.</p><p>Is it considered good or bad practice to store the result of that in an Activity's member values? Simple example:</p><pre><code>public class MyActivity extends Activity {    private EditText myText;    public void onCreate(blah blah) {       // blah       this.myText = (EditText) findViewById(R.id.mytext);    }}</code></pre><p>and use the myText field from there on. I think it'd be good for performance (depending on findViewById's inner workings, I'm quite sure it's already very fast), but I haven't seen it be encouraged yet. Also, it wouldn't be the first time I encountered a situation where 'caching' something like this leads to problems (had a case where database connections weren't released properly because I remembered a <code>ConnectionManager</code> or something in that fashion).</p><p>Secondly, somewhat related, if you want to remember something across methods in your Activity (and later on too, when the Activity is restarted later), is it wiser to keep up both a class field and a value in SharedPreferences, or would calling SharedPreferences each time for setting / getting the value where it's needing be a better solution? (better being 'cleaner, without impacting performance significantly)</p>","204840","","","","","2010-09-29 18:40:21","Using SharedPreferences and/or class variables in an Activity","<android><sharedpreferences>","1","0","1","",""
"3824946","1","","","2010-09-29 19:02:53","0","4096","<p>I have a simple program that sends an HTTP POST.</p><p>It works <strong>only</strong> if the line <code>httpost.addheader(""Content-Length"",""18"")</code> is <strong>not</strong> present. Otherwise it fails. In the code, it's the line with ""--->""<br>Commenting this line out makes the POST succeed.</p><p>Android does not send the POST if that line is in the code and returns with a Protocol Exception error. I used Wireshark to verify that nothing is sent.</p><p>Any ideas why setting the Content-Length generates an exception?</p><p>The code:</p><pre><code>HttpClient httpclient = new DefaultHttpClient();HttpPost httppost = new HttpPost(""http://test.com/a_post.php"");try {    List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);    // DATA    nameValuePairs.add(new BasicNameValuePair(""mydata"", ""abcde""));    nameValuePairs.add(new BasicNameValuePair(""id"",""29""));    StringEntity se = new UrlEncodedFormEntity(nameValuePairs);    httppost.setEntity(se);    int seLength = (int) se.getContentLength();    String seLengthStr = Integer.toString(seLength);    httppost.addHeader(""Content-Type"",""application/x-www-form-urlencoded"");    ----&gt; httppost.addHeader(""Content-Length"", ""18"");    ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();    String httpResponse=httpclient.execute(httppost, responseHandler);    responseV.setText(responseV.getText()+ "" "" + httpResponse);} catch (ClientProtocolException e) {    // TODO Auto-generated catch block    e.printStackTrace();} catch (IOException e) {    // TODO Auto-generated catch block    e.printStackTrace();}</code></pre>","327415","","1765573","","2013-07-27 06:45:07","2013-07-27 06:45:07","Android HTTP POST Content-Length Exception","<android><http-post><content-length>","2","4","","",""
"3824997","1","3825692","","2010-09-29 19:09:24","3","3535","<p>How can you blit a non-rectangular (e.g. oval) part of a bitmap into a canvas on Android?</p><p>Consider how you'd blit a rectangular part of a bitmap:<a href=""http://developer.android.com/reference/android/graphics/Canvas.html#drawBitmap%28android.graphics.Bitmap,%20android.graphics.Rect,%20android.graphics.Rect,%20android.graphics.Paint%29"" rel=""nofollow""><code>canvas.DrawBitmap(src,src_rect,dest_rect,paint)</code></a>.  Sadly there is no corresponding methods for non-rectangular regions.</p><p>Four approaches present themselves (maybe you know a fifth?):</p><ol><li><p>copy the rectangular bounds you want to blit into an intermediate bitmap, and go setting the pixels you don't want to blit to be transparent, then draw that bitmap</p></li><li><p>make a mask bitmap - there are ways to blit with a separate mask?</p></li><li><p>use a <a href=""http://developer.android.com/reference/android/graphics/BitmapShader.html"" rel=""nofollow""><code>BitmapShader</code></a> with <a href=""http://developer.android.com/reference/android/graphics/Canvas.html#drawArc%28android.graphics.RectF,%20float,%20float,%20boolean,%20android.graphics.Paint%29"" rel=""nofollow""><code>drawArc()/drawCircle()</code></a>; however, I can't work out how to get the <strong><em>matrix</em></strong> to be properly aligned; how would you initialize the matrix for this operation?</p></li><li><p>use a very very complicated clipping region</p></li></ol><p>Of these, <strong><em>option 3</em></strong> is the one that I would most like to work; however, I cannot work out how to do so; can you?</p>","15721","","15721","","2010-09-29 20:12:42","2011-09-05 11:53:37","drawing part of a bitmap on an Android canvas","<android><graphics><canvas><matrix>","1","0","3","",""
"3825187","1","3825217","","2010-09-29 19:37:01","2","4458","<p>Ok, I am trying to get the right three characters of a string in an Android app I'm writing.</p><p>Based on the research I've done in the SDK and online I should be able to use something like the following to do it.</p><pre><code>millisecondsD = millisecondsD.substring(millisecondsD.length() -3, millisecondsD.length());</code></pre><p>However, I get a force close whenever I try to use to use the code above.  Am I just missing something super simple?</p>","462175","","115145","","2010-09-29 19:37:49","2010-09-29 19:46:26","Get right part of string in Android app","<java><android><substring>","1","1","","",""
"3825358","1","5523518","","2010-09-29 19:57:40","2","756","<p>I'm trying to add my own drawable and use it in a series of overlays on a MapView. The drawable is basically a rounded box with a black outline and a number in the middle. </p><p>I have managed to achieve this using the code below, however there is what looks like a flag to the left of my box, which I certainly don't think I have drawn - so I'm wondering what it can be. </p><p>This is an example of the image: <img src=""http://i.stack.imgur.com/KrjVe.png"" alt=""alt text""></p><hr><p>Edit - this is what happens if a circle is drawn:<img src=""http://i.stack.imgur.com/FuVsJ.png"" alt=""alt text""></p><hr><p>My code is below:</p><p>Custom Drawable:</p><pre><code>public class BikeDrawable extends Drawable {  int colour;  String bikes;public BikeDrawable (int bikes){    this.bikes = Integer.toString(bikes);    if (bikes &lt; 4) {        colour = Color.RED;    }    else if (bikes &gt; 3 &amp;&amp; bikes &lt; 9){        colour = Color.argb(244, 255, 127, 42);    }    else {        colour = Color.GREEN;    }}@Overridepublic void draw(Canvas canvas) {      Paint rectanglePaint = new Paint();      rectanglePaint.setColor(colour);      rectanglePaint.setStyle(Style.FILL);      RectF rectangle = new RectF(0.0f, 0.0f, 20.0f, 20.0f);      Paint strokepaint = new Paint();      strokepaint.setStyle(Paint.Style.STROKE);      strokepaint.setStrokeWidth(2);      strokepaint.setARGB(255, 0, 0, 0);      canvas.drawRoundRect(rectangle, 4.0f, 4.0f, rectanglePaint);      canvas.drawRoundRect(rectangle, 4.0f, 4.0f, strokepaint);      Paint textpaint = new Paint();      textpaint.setARGB(255, 0, 0, 0);      textpaint.setTextAlign(Paint.Align.CENTER);      canvas.drawText(bikes, 10, 14, textpaint);}@Overridepublic int getOpacity() {    return 0;}@Overridepublic void setAlpha(int alpha) {}@Overridepublic void setColorFilter(ColorFilter cf) {}}</code></pre><p>Use in MapView:</p><pre><code>bikeOverlay = new PointsOverlay(start_icon);BikeDrawable start_1_drawable = new BikeDrawable (start_1.capacity);OverlayItem start_1_overlayitem = new OverlayItem(new GeoPoint(start_1.lat,start_1.lon), null, null);start_1_overlayitem.setMarker(start_1_drawable);mapOverlays.add(bikeOverlay);bikeOverlay.addOverlay(start_1_overlayitem);</code></pre><p>Does anyone have any idea what is going on here? Is it an artefact from OverlayItem?</p>","278638","","278638","","2010-09-29 21:17:52","2011-04-02 13:47:16","Strange drawing artefact using custom drawable with MapView","<android><android-mapview><drawable>","1","4","","",""
"3825377","1","5309884","","2010-09-29 20:00:55","4","284","<p>I want to create list with different types of items. They should call different intents or do other things (display a map etc.) . It should act like contact details. Numbers of items and actions is predefined.</p><p><img src=""http://i.stack.imgur.com/V2F7i.jpg"" alt=""conact dteails""></p><p>How to achieve this effect elegantly? I don't need exact code but guidelines and information where to look. Any help will be appreciated :)</p><hr><p>UPDATE:</p><p>By ""this effect"" I mean creating a list of different types of items (onClickListener, layout). On picture above you can see that you have a contact with various options: calling somebody, emailing, chatting, looking at google maps etc. All of those options are grouped at list.</p><p>I'm wondering if it could be achieved by xml layout without defining custom <code>Adapter</code> class. I want also be able to add some static header rows with eg. category name.</p>","296427","","415347","","2011-09-05 11:52:39","2011-09-05 11:52:39","How to create list with different elements and actions?","<android><list><android-intent>","1","2","2","",""
"3825548","1","","","2010-09-29 20:23:37","2","240","<p>Hi is it possible to add new feature in existing address book??</p><p>What i am trying to do is i want to add my application shortcut just like there is a shortcut for sms into every contact, whenever user opens any contact he can see my application option there, he taps to it and my application will launch with that contact information is it possible?</p><p>We have options like link to facebook, flicker in the contact list how they have implemented this?? can i create similar thing?? </p><p>Can i do it in 1.6 or any higher version has support??</p>","443694","","1228","","2013-05-29 16:57:34","2013-05-29 16:57:34","Adding new feature in address book in android","<android><contacts>","0","0","","",""
"3825645","1","","","2010-09-29 20:36:39","10","26076","<p>I have a <code>ListView</code> with a custom adapter. The <code>ListView</code> allows multiple select, but somehow it's not recognising when an item is selected.</p><p>I've already made the adapter items extend Checkable, but still the <code>getCheckedItemPositions()</code>returns an array of falses.</p><p>I guess there's something fundamental I'm doing wrong, but I have been unable so far to find examples of multiple select ListViews where the adapter was not an ArrayAdapter using the default layout for multiple selects.</p><p>Any help would be much appreciated.</p><p>Code is below:</p><p>Main class:</p><pre><code>listView = (ListView) findViewById(R.id.cardlist);tca = new TextCardAdapter(mInflater);listView.setAdapter(tca);</code></pre><p>Adapter:</p><pre><code>public class TextCardAdapter extends BaseAdapter {private int count = 0;private List&lt;CheckableCard&gt; cardList = new ArrayList&lt;CheckableCard&gt;();private LayoutInflater mInflater;public TextCardAdapter(LayoutInflater inflater) {    this.mInflater = inflater;}@Overridepublic int getCount() {    return count;}@Overridepublic Object getItem(int position) {    return cardList.get(position);}@Overridepublic long getItemId(int position) {    return position;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    final ViewHolder holder;    if (convertView == null) {        convertView = mInflater.inflate(R.layout.textlayout_row, null, false);        convertView.setClickable(true);        holder = new ViewHolder();        holder.text = (TextView) convertView.findViewById(R.id.card_name);        holder.checkbox = (CheckBox) convertView.findViewById(R.id.checkbox);        convertView.setTag(holder);    } else {        holder = (ViewHolder) convertView.getTag();    }    final CheckableCard card = cardList.get(position);    holder.text.setText(card.card.toString());    holder.checkbox.setChecked(card.isChecked());    holder.checkbox.setOnClickListener(card.checkListener);    convertView.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            card.checkListener.onClick(v);            holder.checkbox.setChecked(card.isChecked());        }    });    return convertView;}public void add(Card card) {    cardList.add(new CheckableCard(card));    count++;    notifyDataSetChanged();}public void addAll(Collection&lt;Card&gt; cardColl) {    for (Card c : cardColl)        add(c);}public void removeAll() {    count = 0;    cardList.clear();    notifyDataSetChanged();}public Card getCard(int position) {    CheckableCard cc = (CheckableCard) getItem(position);    if (cc == null) return null;    return cc.card;}public class CheckableCard implements Checkable {    private boolean checked = false;    public final Card card;    public final OnClickListener checkListener;    public CheckableCard(Card card) {        this.card = card;        checkListener = new OnClickListener() {            @Override            public void onClick(View v) {                toggle();            }        };    }    @Override    public boolean isChecked() {        return checked;    }    @Override    public void setChecked(boolean checked) {        this.checked = checked;    }    @Override    public void toggle() {        checked = !checked;    }}static class ViewHolder {    TextView text;    CheckBox checkbox;}}</code></pre>","462235","","415347","","2011-09-05 11:52:08","2013-03-04 13:41:34","Android ListView with multiple select and custom adapter","<android><listview><listadapter><multiple-select>","3","4","1","",""
"3825696","1","","","2010-09-29 20:44:44","1","144","<p>I'm new to Android and I want to write a widget that contains (about)100 columns, each column contains various amount of child views (will be determined at run time via some service call). Users can scroll horizontally and vertically (similar behavior as <code>GridView</code> but with horizontal scrolling). The child views will be customized widgets like <code>ImageButton</code>, which will be used to load images and data via service call when they are exposed on the screen. </p><p>I have implemented a 2D scroll view that enables users to scroll vertically and horizontally. I'm using a Horizontal Linear Layout as a container for the columns. However, I'm having trouble designing the columns. I've thought about implementing in the following ways:</p><ol><li><p>Use a Vertical Linear Layout as column and a subclass of <code>ImageButton</code> as child view. The challenging part is how to load data and image only when the button become visible and how to dereference them once they are scrolled off the screen. From what I know Android doesn't have a method to tell whether a widget is on/off screen (like the <code>onExpose(</code>) method), so I'm not sure if it's possible to do this (easily).</p></li><li><p>Use some sort <code>AdapterView</code> as column. <code>ListView</code> is very close to what I'm trying to do but each list view handles its own scrolling and it's hard to have all columns to scroll vertically together. I'd really prefer to use Adapter if possible since it recycles the views, which is really desirable since I'll potentially have thousands of child views and I'm not sure if I'll run out of memory otherwise.</p></li></ol><p>I'd really appreciate some advice from more experienced Android developers on how to implement what I described above. </p>","436323","","415347","","2011-09-05 11:51:40","2011-09-05 11:51:40","Widget Implementation Advice Needed","<android><android-widget>","1","0","","",""
"3825752","1","","","2010-09-29 20:51:43","2","1225","<p>I'm new to developing Android applications, and have only a little experience with Java in school. I was redirected to StackOverflow from the Google groups page when I was looking for the Android Beginners group. I have a question about what is best practice to pull content from a web source and parse it.</p><p>Firstly, I would eventually like to have my application threaded (by use of Handler?), however, my issue now is that the class I have created (Server) to connect and fetch content often fails to retrieve the content, which causes my JSON parser class (JSONParser) to fail, and my View to display nothing. After navigating to the previous Activity, and attempting to call the connect(), fetch(), and parse() methods on the same remote URI, it will work.</p><p>Why does this (sometimes retrieve the remote data) happen <em>sometimes</em>, but not always? What is the best practice, including the use of ProgressDialog and the internal Handler class, to make my application seamless to the user. Is this the best place to ask this question? Thanks for your help</p><p>Here is the code I'm using now.</p><pre><code>import java.io.BufferedInputStream;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.net.URL;import java.net.URLConnection;import org.apache.http.util.ByteArrayBuffer;import android.util.Log;public class Server { public static final String HTTP_PROTOCOL = ""https://""; public static final String EXAMPLE_NET_DOMAIN = ""example.domain.net/""; private final String API_KEY = ""1234567890""; private static final String API_ENDPOINT = ""api.js?""; public final String FORMAT = ""json""; public String API_VERSION; public String METHOD; public String OPTIONAL_ARGUMENTS; public String json; public URL jURL; public URLConnection jConnection; public BufferedReader jIn;    public InputStream is = null; /**  * @param aPIVERSION  * @param mETHOD  * @param oPTIONALARGUMENTS  */ public Server(String aPIVERSION, String mETHOD, String oPTIONALARGUMENTS) {  super();  API_VERSION = aPIVERSION;  METHOD = mETHOD;  OPTIONAL_ARGUMENTS = oPTIONALARGUMENTS;  connect();  Log.i(""DEBUG:"",""connect();""); } /**  * @param aPIVERSION  * @param mETHOD  */ public Server(String aPIVERSION, String mETHOD) {  super();  API_VERSION = aPIVERSION;  METHOD = mETHOD;  OPTIONAL_ARGUMENTS = """";  connect(); } /**  * @param aPIVERSION  * @param mETHOD  */ public void connect(){  try {         jURL = new URL(HTTP_PROTOCOL            + EXAMPLE_NET_DOMAIN            + API_ENDPOINT            + ""api="" + this.API_VERSION            + ""&amp;method="" + this.METHOD           + ""&amp;format="" + FORMAT           + ""&amp;apikey="" + API_KEY           + this.OPTIONAL_ARGUMENTS);         jConnection = jURL.openConnection();        } catch (IOException e) {         Log.e(""USER: "", ""Error in server connection."");         Log.e(""DEBUG:"", ""Error in server connection"");  }        Log.i(""USER: "", ""Connection success!""); } public String fetch() {  try {   is = jConnection.getInputStream();  } catch (IOException e) {   // TODO Auto-generated catch block   Log.e(""DEBUG:"", ""fetch-1() error"");  }      BufferedInputStream bis = new BufferedInputStream(is);      ByteArrayBuffer baf = new ByteArrayBuffer(50);     int current = 0;     try {   while((current = bis.read()) != -1){       baf.append((byte)current);   }   Log.i(""DEBUG:"",new String(baf.toByteArray()));  } catch (IOException e) {   // TODO Auto-generated catch block   Log.e(""DEBUG:"",""fetch() ERROR!"");  }     /* Convert the Bytes read to a String. */  Log.i(""DEBUG:"",new String(baf.toByteArray()));     return new String(baf.toByteArray()); } /* Returns a string containing a concise, human-readable description of jURL  *   */ public String showUrl() {  return jURL.toExternalForm(); }}</code></pre><p>and the code from my ListActivity</p><pre><code>/* Called when the activity is starting. This is where most initialization should go: calling setContentView(int) to inflate the activity's UI, using findViewById(int) to programmatically interact with widgets in the UI, calling managedQuery(android.net.Uri, String[], String, String[], String) to retrieve cursors for data being displayed, etc.   * @see android.app.Activity#onCreate()  */ @Override public void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  Log.i(""LIFECYCLE: "", ""RS.class onCreate()"");  Server serverConnection = new Server(API_VERSION, METHOD, OPTIONAL_ARGUMENTS);     json = serverConnection.fetch();     JSONParser jParser = new JSONParser(json);     groupData = jParser.parseJsonForRecentShowList();     SimpleAdapter adapter = new SimpleAdapter( this, groupData, android.R.layout.simple_list_item_2, new String[] { ""venue"",""showdate""},                new int[]{ android.R.id.text2, android.R.id.text1 } );     setListAdapter( adapter );  registerForContextMenu(getListView()); }</code></pre><p>Here is my JSON Parser class</p><pre><code>/** *  */import java.util.ArrayList;import java.util.Collections;import java.util.HashMap;import java.util.List;import java.util.Map;import org.json.JSONArray;import org.json.JSONException;import org.json.JSONObject;import android.util.Log;/** * @author  * */public class JSONParser {    public List&lt;Map&lt;String, String&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, String&gt;&gt;(); private String jString; private Map&lt;String, String&gt; group; private JSONArray jArray; private String setlistData; public String notesString = """"; public String[] splitSetsArray; public String[] splitEncoreArray; public String[] extraWork; public String[] notesArray; public String pVenue_text; public String pCity_text; public String pState_text; public String pCountry_text; public String pDate_text; public String pSet1_text; public String pSet2_text; public String pSet3_text; public String pEncore1_text; public String pEncore2_text; public String pNotes_text; public int totalNumberOfSets; public int totalNumberOfEncores; public int totalNumberOfNotes; public JSONObject jObject; public JSONParser(String json) {  // TODO Auto-generated constructor stub  jString = json; } /**  * @return  */ public List&lt;Map&lt;String, String&gt;&gt; parseJsonForRecentShowList(){  try {   jArray = new JSONArray(jString);   for(int i=0;i&lt;jArray.length();i++) {    jObject = jArray.getJSONObject(i);    group = new HashMap&lt;String, String&gt;();    group.put(""showdate"", jObject.getString(""showdate""));    group.put(""venue"", jObject.getString(""venue""));    groupData.add(group);   }  } catch (JSONException e) {   Log.e(""DEBUG: "", ""JSON Parse error!"");  }  return groupData; } /**  *   */ public void parseJsonForSetlistData(){  if(jString != null){      try {    jArray = new JSONArray(jString);    jObject = jArray.getJSONObject(0);    pVenue_text  = jObject.getString(""venue"")  ;    pCity_text   = jObject.getString(""city"") + "", "" ;    pState_text  = jObject.getString(""state"") + "", "" ;    pCountry_text  = jObject.getString(""country"") ;    pDate_text   = jObject.getString(""nicedate"")  ;    setlistData = nohtml(jObject.getString(""setlistdata""));    splitSetsArray = setlistData.split(""Set..:."");       totalNumberOfSets = splitSetsArray.length-1;       String[] splitEncoreArray = splitSetsArray[splitSetsArray.length-1].split(""Encore:."");       totalNumberOfEncores = splitEncoreArray.length-1;       splitSetsArray[splitSetsArray.length-1] = splitEncoreArray[0];       splitEncoreArray[0] = """";       extraWork = splitEncoreArray[splitEncoreArray.length-1].split(""\\[1\\]"");    notesArray = extraWork[extraWork.length-1].split(""\\[.\\]"");    totalNumberOfNotes = notesArray.length-1;    splitEncoreArray[splitEncoreArray.length-1] = extraWork[0];    //notesArray[0] = """";    for(int i=0;i&lt;notesArray.length;i++){     int number = i+1;     notesString += ""[""+number+""] ""+notesArray[i] + ""\n"";    }    if(totalNumberOfSets != 0) {     pSet1_text = ""Set 1: "" + splitSetsArray[1];     if (totalNumberOfSets &gt; 1){      pSet2_text = ""Set 2: "" + splitSetsArray[2];     } else {      pSet2_text = """";     }     if (totalNumberOfSets &gt; 2){      pSet3_text = ""Set 3: "" + splitSetsArray[3];     } else {      pSet3_text = """";     }    }    pEncore1_text = ""Encore: "" + splitEncoreArray[1];    if (totalNumberOfEncores &gt; 1) {     pEncore2_text = ""Encore 2: "" + splitEncoreArray[2];    } else {     pEncore2_text = """";    }    pNotes_text = notesString;    Log.e(""DEBUG: "", ""JSON Parsed!"");   } catch (JSONException e) {    Log.e(""ERROR:"",""caught JSON Exception at parseForSetlistData()"");   }  } else {   Log.e(""ERROR:"", ""jString = null"");   pVenue_text = ""I'm Sorry, the Setlist Data could not be retrieved from server. Please try again."";  }    }    public void parseJsonForReviews(){  try {   jArray = new JSONArray(jString);   for(int i=0;i&lt;jArray.length();i++){    jObject = jArray.getJSONObject(i);    group = new HashMap&lt;String, String&gt;();    group.put(""author"", jObject.getString(""author""));    group.put(""review"", jObject.getString(""review""));    groupData.add(group);    }  } catch (JSONException e) {   Log.e(""DEBUG: "", ""JSON Reviews parse error!"");  }    }    public List&lt;Map&lt;String, String&gt;&gt; parseJsonForYears(){  try {   jArray = new JSONArray(jString);   for(int i=0;i&lt;jArray.length();i++){    JSONObject jObject = jArray.getJSONObject(i);    group = new HashMap&lt;String, String&gt;();    group.put(""showdate"", jObject.getString(""showdate""));    group.put(""venue"", jObject.getString(""venue""));    groupData.add(group);   }  } catch (JSONException e) {   Log.e(""DEBUG: "", ""JSON Years parse error!"");  }  Collections.reverse(groupData);  return groupData;    }    public String nohtml(String json){     return json.toString().replaceAll(""\\&lt;.*?&gt;"", """");    }}</code></pre>","462244","","415347","","2011-09-05 11:50:40","2011-09-06 23:25:10","Best practice to pull content from the web?","<android>","3","0","","",""
"3825820","1","3825850","","2010-09-29 21:02:58","3","3683","<p>I feel stupid asking such a simple question, but is there an easy way to determine whether an Integer is even or odd?</p>","408178","","","","","2010-09-29 21:08:04","Determining even/odd numbers (integers)?","<android><math>","5","0","","",""
"3825862","1","","","2010-09-29 21:08:17","2","819","<p>I'm really new with this thing of ""Android development"" and I was really excited when I found <a href=""http://en.wikipedia.org/wiki/Appcelerator_Titanium"" rel=""nofollow"">Appcelerator Titanium</a>, but now I got the big surprise, it doesn't work on my computer. What other alternatives are there for Android development specially if they include HTML, JavaScript and CSS for creating such applications?</p>","462255","","63550","","2010-10-02 23:25:45","2010-10-06 21:28:47","How develop Android applications?","<android><titanium>","6","2","","",""
"3825918","1","3828646","","2010-09-29 21:15:16","3","1709","<p>Is there a way to be notified when the keyboard is about to show, or has shown?  The following events would be great:</p><p>keyboardWillShowkeyboardDidShowkeyboardWillHidekeyboardDidHide</p>","238849","","","","","2010-09-30 07:31:19","Way to be notified when the software keyboard is showing/hiding?","<android>","2","1","2","",""
"3825952","1","","","2010-09-29 21:20:30","1","844","<p>I have multiple <code>ListActivity</code>(s) with a custom <code>ArrayAdapter</code>. I have to load an XML file from the Web, and the user moves to a new activity by selecting a list item.</p><p>What is best practice for:</p><ol><li>Displaying a loading indication to the user.</li><li>Threading the networking stuff so that the user can cancel the loading of the data if need be / move to the previous activity.</li></ol><p>Example/source code would be greatly appreciated - I've used <a href=""http://www.helloandroid.com/tutorials/newsdroid-rss-reader"" rel=""nofollow"">http://www.helloandroid.com/tutorials/newsdroid-rss-reader</a> as an introduction, however it doesn't display a loading indication.</p><p>Thanks</p>","462267","","415347","","2011-09-05 11:49:41","2011-09-05 11:49:41","Android ActivityList - Loading data from network best practice","<android><multithreading><listactivity>","1","0","1","",""
"3825957","1","3826362","","2010-09-29 21:21:03","2","1188","<p>I have a user's twitter handle. Right now I'm opening it through a web page like:</p><pre><code>String url = ""http://www.twitter.com/"" + ""example_handle"";Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));startActivity(intent);</code></pre><p>If the user has the Twitter android app installed, is there a different intent I can use which gives the user the option to view that user's twitter feed in the Twitter app, instead of forcing them directly to a browser? I'm not sure if the author's of the Twitter app have exposed any such intent,</p><p>Thanks</p>","291701","","","","","2011-05-22 12:36:30","View user's twitter feed in Twitter app?","<android>","3","0","","",""
"3825972","1","","","2010-09-29 21:23:12","2","675","<p>I am trying to develop an app to supplement the built-in music player.  I've used git to download the com.android.music package and looked around at its code.  I can launch the music player by copying some of its code and launching activities with intents.</p><p>Now what I need to do is get a handle to its current view.  In the MusicUtils.java file, I see a line that says</p><pre><code>View nowPlayingView = a.findViewById(R.id.nowplaying);</code></pre><p>I'd like to do the same thing.  Only I don't have access to the <code>R.java</code> file, so I can't write e.g. <code>R.id.nowplaying</code>.  How do I do this?  How do I reference the music players R.java?  I do know the R.java stuff is declared public so that shouldn't be a problem.  Right?</p><p>Is it even possible?  I saw this related question and am now wondering: <a href=""http://stackoverflow.com/questions/2437271/how-to-load-com-android-music-code-into-eclipse-and-compile"">http://stackoverflow.com/questions/2437271/how-to-load-com-android-music-code-into-eclipse-and-compile</a></p><p>Btw, I'm working against the Android 2.2 SDK, but it'd be helpful to know if the answer is different for older versions such as 1.5.  Thanks.</p>","135101","","","","","2011-09-05 11:49:08","How to reference R.java of other apps in Android, like com.android.music?","<android><reference>","3","0","","",""
"3825987","1","3886084","","2010-09-29 21:25:37","3","2411","<p>My app has many activities that can be called in any order</p><p>Example Activity History:A -> B -> C -> D -> A -> B -> E</p><p>Now in activity E, I am 'deregistering' the device (logging the user out, and deleting any data they might have downloaded to their sdcard).  The desire behavior is that the app 'starts over' and the user is prompted with a login activity and hitting back will return the user to the home screen.</p><p>So now, activity E should clear the activity stack in some way.  Currently, I am setting FLAG_ACTIVITY_CLEAR_TOP when launching A's intent from E.  The problem is, when the user had visited A and then gone to intermediate activities and revisited A before going to E, there are still activities on the stack.</p><p>A -> B -> C -> D -> A</p><p>So the user has been logged out and can't use activities B-D, but if the user hits back from activity A, they can access activities B-D.  Is there a simple way to have all the activities other than the login activity be cleared from the stack?</p><p>Update:</p><p>So I've tried updating my BaseActivity (each activity in my app subclasses this one) to contain a static flag isDeregistering that tells the activity to destroy itself if true.  The problem is, every activity calls finish(), and I get booted to the homescreen and cannot restart the app until force closing the app.  Is there a better way to do this?</p>","462252","","462252","","2010-10-07 15:31:42","2011-09-05 11:48:32","How to clear all activities in Android app","<android>","1","2","1","",""
"3826004","1","","","2010-09-29 21:27:43","0","281","<p>I have few questions about getting current location of the device.</p><p>I believe only way to do that is using <code>requestLocationUpdates(....)</code>.</p><ol><li>if I subscribe to requestLocationUpdates... with duration set to 1 hour and after 1 hour if my phone is sleeping (or during that 1 hour I rebooted my phone), does the listener still work? </li></ol><p>A. If yes - After 1 hour, when I get update about location, I want to change duration to 2 hours. Is there a way to do that? If not, can I call <code>removeUpdate</code>s, and immediately call requestLocationUpdates with duration as 2 hours?</p><p>B. If No - I was planning to set an alarm to go off after 1 hour, and call removeUpdates &amp; requestLocationUpdates in the alarm receiver. Is that right strategy.</p>","462271","","415347","","2011-09-05 11:48:10","2011-09-05 11:48:10","Question about getting current location in Android","<android><gps><alarmmanager><locationmanager>","1","0","","",""
"3826032","1","3828225","","2010-09-29 21:32:19","0","1643","<p>Does anyone know any good tutorials for this please?Or could anyone run me through some basic code for making this?</p>","427234","","415347","","2011-09-05 11:47:13","2011-09-05 11:47:35","Android Development: File Browser For Reading/Saving Files","<android><file><browser>","1","1","","",""
"3826138","1","","","2010-09-29 21:50:48","1","1613","<p>I have custom ListView item with ImageView and TextView. TextView contains HTML string with urls and some regular text. Im my adapter I have code similar to </p><p><code>tv.setText(Html.fromHtml(""&lt;a href='http://google.com'&gt;google&lt;/a&gt;""));tv.setMovementMethod(LinkMovementMethod.getInstance());</code></p><p>and this works great but <code>onListItemClick</code> isn't executed when I click on item outside url,  whole item looks like inactive. </p><p>When I click on url I want to fire default action form urls and when I click on regular text or on ImageView I want to execute <code>onListItemClick</code> is it possible?</p><p>Second question, is it possible to start activity using <code>&lt;a href=""...""&gt;start some activity&lt;/a&gt;</code>?</p>","157827","","","","","2011-09-05 11:47:04","Clickable item with clickable urls in ListView","<android><listview>","2","1","","",""
"3826374","1","","","2010-09-29 22:31:38","9","1777","<p>Is there any difference between what happens when you use a Task Killer App to kill an app vs. what happens when the Android OS kills an app due to scarce resources?</p><p>The Android SDK says that the <code>Application.onTerminate()</code> method isn't called when the OS kills an app due to scarce resources. So it sounds like the OS doesn't cleanly close apps and that it does exactly what the much-debated task killers do.</p><p>If they do the same thing, then task killers don't do any more harm than the OS itself, right?</p>","462297","","415347","","2011-09-05 11:46:17","2011-09-05 11:46:17","Difference Between a Task Killer Killing an App and the Android OS Killing an App","<android><task>","3","1","3","",""
"3826402","1","3826422","","2010-09-29 22:37:15","2","6321","<p>I have a thread in java/Android like this:</p><pre><code>Handler handler = new Handler() {    @Override    public void handleMessage(Message msg) {        // TODO Auto-generated method stub        update_i();    }};@Overrideprotected void onStart() {    // TODO Auto-generated method stub    super.onStart();    Thread myThread = new Thread(new Runnable() {        public void run() {            while (true) {                try {                    handler.sendMessage(handler.obtainMessage());                    Thread.sleep(timer);                } catch (Throwable t) {                }            }        }    });    myThread.start();}</code></pre><p>The thread works fine when I run my application. But I want to start/restart the thread with a button. </p><pre><code>Button.OnClickListener StartButtonOnClickListener = new Button.OnClickListener() {    @Override    public void onClick(View v) {        //start/restart the thread    }};</code></pre><p>If I copy the thread into the button I just make a new thread every time the user clicks on the button. I want to run the thread when the user first time click on the button, ""kill it"" and start from the beginning if the user click on the button a second time (I don’t want to start a second thread).  </p>","450019","","","","","2011-09-05 11:46:02","How can I restart a thread in java/Android from a button?","<java><android><multithreading>","2","0","","",""
"3826420","1","3826468","","2010-09-29 22:40:15","0","1287","<p>My keystore has gone missing. I most likely deleted it by mistake, but I can't find it in my recycling bin.<br>My keystore was originally in my bin folder, not a good place for it as files get automatically deleted when publishing </p><p>I know the details for the previous keystore. except maybe the date of expiry.</p><p>I want to put an update onto the market, but because the new certificate is different, it won't let me.</p><p>I was hoping that I could add an additional certificate to the current published file so that it would accept the updated version with just the new certificate. Similar to what is described here. <a href=""http://stackoverflow.com/questions/2881904/how-to-sign-an-apk-with-more-than-one-certificate"">How to sign an APK with more than one certificate?</a></p><p>I skip the first line in the above description because it is already signed through eclipse, but when I do the second line I get a ZipException due to ""invalid entry compressed size (expected X but got Y bytes)""</p><p>Is there a way to put a second certificate on my apk?</p><p>Is there a way to recreate the original keystore from the information I know?</p><p>I'm not yet ready to believe, that I will have to submit the update as a completely new application.</p>","344169","","415347","","2011-09-05 11:45:38","2011-09-05 11:45:38","How to get an APK into the market with an extra certificate... because I lost my first keystore","<android><keystore>","2","0","","",""
"3826510","1","","","2010-09-29 23:01:20","0","1940","<p>I thought when you passed objects to methods in Java, they were supposed to be by value.</p><p>Here is my code:</p><pre><code>public class MyClass{    int mRows;    int mCols;    Tile mTiles[][];     //Custom class    //Constructor    public MyClass(Tile[][] tiles, int rows, int cols) {        mRows = rows;        mCols = cols;        mTiles = new Tile[mRows][mCols];        for (int i=0; i &lt; mRows; i++) {            for (int j=0; j &lt; mCols; j++) {                mTiles[i][j] = new Tile();                mTiles[i][j] = tiles[i][j];            }        }    }</code></pre><p>At this point, any changes to the <code>mTiles</code> object are reflected back to the tiles object.  Any ideas how to fix this?</p><p>Thanks all.</p>","432209","","415347","","2011-09-05 11:44:45","2012-10-21 07:36:38","Passing object to method in java appears to be by reference (and Java is by val)","<java><android><eclipse><pass-by-reference><pass-by-value>","4","1","0","",""
"3826543","1","","","2010-09-29 23:09:01","2","7596","<p>I have a simple app that I'm putting together for my company. I have 4 buttons that I've created but can't seem to get them to link correctly. One button should open our mobile site, another button to call us, another button to map to us, and the final button linked to our ""News"" site. Any help would be greatly appreciated!</p>","462327","","","","","2012-08-23 05:31:16","Android: Image button as a hyperlink, phone call, map directions?","<android><image><button><hyperlink>","2","1","","",""
"3826604","1","","","2010-09-29 23:23:51","3","1519","<p>I am building Froyo, is it possible that during building, make/python can output the file and the command it is calling right now.</p><p>For example, in one of the Android.mk, there is a line, says,echo build success.On the monitor it will show ""build success"", what I want is that in addition, it shows ""Android.mk line 20: echo build success"".</p><p>Is it possible?</p>","455544","","597607","","2012-02-24 09:38:07","2012-02-25 11:25:32","Android.mk debug output","<python><android><debugging><build><trace>","2","0","1","",""
"3826905","1","3888560","","2010-09-30 00:35:37","152","58105","<p>Recalling this <a href=""http://www.antonioshome.net/blog/2006/20060906-1.php"">post enumerating several problems of using singletons</a>and having seen several examples of Android applications using singleton pattern, I wonder if it's a good idea to use Singletons instead of single instances shared through global application state (subclassing android.os.Application and obtaining it through context.getApplication()).</p><p>What advantages/drawbacks would have both mechanisms?</p><p>To be honest, I expect the same answer in this post <a href=""http://stackoverflow.com/questions/2709071/singleton-pattern-with-web-application-not-a-good-idea"">http://stackoverflow.com/questions/2709071/singleton-pattern-with-web-application-not-a-good-idea</a> but applied to Android. Am I correct? What's different in DalvikVM otherwise?</p><p>EDIT: I would like to have opinions on several aspects involved:</p><ul><li>Synchronization</li><li>Reusability</li><li>Testing</li></ul><p>Thanks in advance.</p>","368544","","368544","","2010-10-07 14:39:00","2014-03-26 08:53:18","Singletons vs. Application Context in Android?","<java><android><patterns>","8","0","121","",""
"3826991","1","3827123","","2010-09-30 01:00:15","1","1180","<p>In my activity, I show a dialog under some condition like this:</p><pre><code>public void showADialog(String title, String msg) {    if (mIsActivityRunning) {        new AlertDialog.Builder(this)        .show();    }} </code></pre><p>My question is what do I need to do to ensure there is no resource leak? From the logcat, i see there is a case where it said a window is leaking or something like that.</p>","286802","","","","","2010-09-30 08:05:48","Do I have to clean up all dialogs 'show' by my activity","<android>","1","0","","",""
"3827130","1","","","2010-09-30 01:37:33","0","195","<p>I want to write game for Android and I need to use inside AI phone slope in some way ( in degree or any other measure). Can anybody tell me how to do that(link or code sample) ?</p>","462393","","","","","2010-09-30 02:40:08","Phone slope Android","<android>","1","0","","",""
"3827179","1","","","2010-09-30 01:52:59","2","1158","<p>I've been using the ContactsContract api for some time now and I've come across two ""columns"" listed in the API page for ContactsContract.Contacts that do not appear to actually be assessable.</p><p>The values are (under the columns heading):""NAME_RAW_CONTACT_ID"" and ""DISPLAY_NAME_PRIMARY""</p><p>By my reading of the API these two values would seem to connect to the Structured Name (in DATA) used to construct the display name for the given contact. Having access to this directly from the contact table would be incredibly useful to me at the moment, but as far as I can tell they are not actually in the working api (I've tested against both 2.1 and 2.2).</p><p>The associated constants do not exist in the Contacts object, and attempting to access the fields directly (by using the lower case string versions I've seen in code dumps online) turns up with an sql error -- invalid column, as you might expect.</p><p>Has anyone had any better luck with accessing these? Are these actually in the API?</p><p>Edit:I did some more checking and here's some related values from RawContacts that are listed on the API but appear to not actually be in it: DISPLAY_NAME_ALTERNATIVE, DISPLAY_NAME_PRIMARY, DISPLAY_NAME_SOURCE, PHONETIC_NAME, PHONETIC_NAME_STYLE, SORT_KEY_ALTERNATIVE, and SORT_KEY_PRIMARY. </p><p>All of these appear to be features not yet in the API that are mistakenly not filtered out when the javadoc was released. If other folks are unable to access these features as well it might be worth filing a bug report over.</p>","461367","","21234","","2010-10-01 08:45:18","2011-06-08 03:04:56","Android ContactsContract.Contact missing constants from the API?","<android><android-2.2-froyo><contactscontract><android-2.1-eclair>","3","0","","",""
"3827356","1","4003898","","2010-09-30 02:51:15","6","10673","<p>New to Android, I have some code when the user changes a preference I update the Summary field in the UI preference to be the value they entered.  However, when the preference activity is created I'd like to set the Summary fields to be the values in the corresponding preferences.Please advise. Thanks.  </p><pre><code>public class MyPreferenceActivity extends PreferenceActivity implements        OnSharedPreferenceChangeListener {    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.xml.preference);        SharedPreferences sp = getPreferenceScreen().getSharedPreferences();        sp.registerOnSharedPreferenceChangeListener(this);    }    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,            String key) {        Preference pref = findPreference(key);        if (pref instanceof EditTextPreference) {            EditTextPreference etp = (EditTextPreference) pref;            pref.setSummary(etp.getText());        }    }}</code></pre>","446347","","281545","","2013-03-24 18:58:07","2013-12-03 08:57:47","Setting UI preference Summary field to the value of the preference","<android>","3","1","3","",""
"3827363","1","3827977","","2010-09-30 02:53:41","5","1788","<p>I have a website designed for the android browser using jquery/jqtouch.  As a part of it, i have a map page that loads.  In the process of displaying my data, I found that some of my customer's addresses, when clicked kick of the google app map, with the data sent to it.  It also seems to load and run a ton faster (as well as having all the benefits of navigation, etc).</p><p>So I've searched and searched, but am unable to ""emulate"" that built in function of kicking off the address.  I've tried links with geo: and maps:, etc, but to none will open the installed app.  Yet, just having a <code>&lt;li&gt;&lt;/li&gt;</code> item with an address, the browser will detect a ""proper"" address and open the app.</p><p>I don't care if i have to kick it off with javascript, or a href, it just has to be embedded in the html.</p>","113212","","3383428","","2014-03-07 18:59:30","2014-03-07 18:59:30","Trigger Google Maps from Android browser","<javascript><android><html>","1","0","1","",""
"3827400","1","","","2010-09-30 03:04:49","2","916","<p>I'm trying to figure out how to animate in and out of <code>Imageviews</code>.</p><p>Basically I have a <code>LinearLayou</code>t with an <code>ImageView</code> and a <code>Button</code> at the bottom. Everytime the button is pressed, <code>onClick()</code> is invoked and I do</p><pre><code>image.setImageResource(imageArray[imageCounter]);</code></pre><p>I simply change the image displayed on the <code>ImageView</code> by selecting different photos in the @drawable. Now I want to put an animation when these imageviews are changed (when button pressed). I used</p><pre><code>inAnimation = AnimationUtils.makeInAnimation(this,true);</code></pre><p>and in onClick() I do</p><pre><code>image.setImageResource(imageArray[imageCounter]);   image.startAnimation(inAnimation);</code></pre><p>This works fine too. The new image comes to the screen animated. But how can put an <strong>out</strong> animation too? It seems only one animation can be assigned with  startAnimation().</p><p>What is the best way to animate an imageview OUT and then animate another imageview IN?Because I want to change the animation depending on the button pressed, I cannot use ViewFlipper. For example, if I press button_Anim1, current image will slideout from right and the new image will fade in. But if I press button_Anim2, current image will slideout from top and the new image will slidein from left. And so on.</p><p>I see that I cannot use two different<code>image.startAnimation()</code> in the <code>onClick()</code> method to make the current image <code>View.INVISIBLE</code> and then make the new image <code>View.VISIBLE</code>.</p><p>Any suggestion is appreciated.Thank you.</p>","455048","","415347","","2011-09-05 11:08:13","2011-09-05 11:08:13","ImageView animation help","<android><animation><imageview>","1","0","","",""
"3827416","1","","","2010-09-30 03:09:47","17","18877","<p>When my <code>ListViewItem</code> is highlighted, I want the text to turn white. How can I define this?</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;   &lt;item android:state_focused=""true"" android:color=""@color/testcolor1""/&gt;   &lt;item android:state_pressed=""true"" android:state_enabled=""false"" android:color=""@color/testcolor2"" /&gt;   &lt;item android:state_enabled=""false"" android:color=""@color/testcolor3"" /&gt;   &lt;item android:color=""@color/testcolor5""/&gt; &lt;/selector&gt;</code></pre>","19875","","415347","","2011-09-05 11:08:27","2011-09-05 11:08:44","How to define ColorStateList for TextView?","<android><listview><colors><listviewitem>","1","4","16","",""
"3827435","1","3828195","","2010-09-30 03:15:59","1","2544","<p>When a user selects a <code>ListViewItem</code>, I am changing that row's background image. This seems to happen very slowly. I'm not sure why?</p><p><strong>OnItemClickListener</strong></p><pre><code>listView.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                //quotesAdapter.setSelectedPosition(position);                setupDetailView(position);                setupChartView(position);                setupARView(position);                emptyView.setVisibility(View.INVISIBLE);                ViewGroup vg = (ViewGroup)v;                TextView nameText = (TextView) vg.findViewById(R.id.nameText);                TextView priceText = (TextView) vg.findViewById(R.id.priceText);                TextView changeText = (TextView) vg.findViewById(R.id.changeText);                //change the old row back to normal                if(oldView != null){                    oldView.setBackgroundResource(R.drawable.stocks_gradient);                    nameText.setTextAppearance(getApplicationContext(), R.style.BlueText);                    priceText.setTextAppearance(getApplicationContext(), R.style.BlueText);                    changeText.setTextAppearance(getApplicationContext(), R.style.BlueText);                }                //change the selected row                v.setBackgroundResource(R.drawable.stocks_selected_gradient);                nameText.setTextColor(Color.WHITE);                priceText.setTextColor(Color.WHITE);                changeText.setTextColor(Color.WHITE);                //keep a reference to the old row, for the next time user clicks                oldView = v;            }        });    }</code></pre><p><strong>Original Code:</strong></p><pre><code>private class QuoteAdapter extends ArrayAdapter&lt;Quote&gt; {        private ArrayList&lt;Quote&gt; items;        // used to keep selected position in ListView        private int selectedPos = -1; // init value for not-selected        public QuoteAdapter(Context context, int textViewResourceId, ArrayList&lt;Quote&gt; items) {            super(context, textViewResourceId, items);            this.items = items;        }        public void setSelectedPosition(int pos) {            selectedPos = pos;            // inform the view of this change            notifyDataSetChanged();        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            if (v == null) {                LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.mainrow, null);            }            TextView nameText = (TextView) v.findViewById(R.id.nameText);            TextView priceText = (TextView) v.findViewById(R.id.priceText);            TextView changeText = (TextView) v.findViewById(R.id.changeText);            // change the row color based on selected state            if (selectedPos == position) {                v.setBackgroundResource(R.drawable.stocks_selected_gradient);                nameText.setTextColor(Color.WHITE);                priceText.setTextColor(Color.WHITE);                changeText.setTextColor(Color.WHITE);            } else {                v.setBackgroundResource(R.drawable.stocks_gradient);                nameText.setTextAppearance(getApplicationContext(), R.style.BlueText);                priceText.setTextAppearance(getApplicationContext(), R.style.BlueText);                changeText.setTextAppearance(getApplicationContext(), R.style.BlueText);            }            Quote q = items.get(position);            if (q != null) {                if (nameText != null) {                    nameText.setText(q.getSymbol());                }                if (priceText != null) {                    priceText.setText(q.getLastTradePriceOnly());                }                if (changeText != null) {                    try {                        float floatedChange = Float.valueOf(q.getChange());                        if (floatedChange &lt; 0) {                            if (selectedPos != position)                                changeText.setTextAppearance(getApplicationContext(), R.style.RedText); // red                        } else {                            if (selectedPos != position)                                changeText.setTextAppearance(getApplicationContext(), R.style.GreenText); // green                        }                    } catch (NumberFormatException e) {                        System.out.println(""not a number"");                    } catch (NullPointerException e) {                        System.out.println(""null number"");                    }                    changeText.setText(q.getChange() + "" ("" + q.getPercentChange() + "")"");                }            }            return v;        }    }</code></pre><p><strong>UPDATE: Adapter with ViewHolder pattern</strong></p><pre><code>   private class QuoteAdapter extends ArrayAdapter&lt;Quote&gt; {        private ArrayList&lt;Quote&gt; items;        // used to keep selected position in ListView        private int selectedPos = -1; // init value for not-selected        public QuoteAdapter(Context context, int textViewResourceId, ArrayList&lt;Quote&gt; items) {            super(context, textViewResourceId, items);            this.items = items;        }        public void setSelectedPosition(int pos) {            selectedPos = pos;            // inform the view of this change            notifyDataSetChanged();        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            View v = convertView;            ViewHolder holder; // to reference the child views for later actions            if (v == null) {                LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                v = vi.inflate(R.layout.mainrow, null);                // cache view fields into the holder                holder = new ViewHolder();                holder.nameText = (TextView) v.findViewById(R.id.nameText);                holder.priceText = (TextView) v.findViewById(R.id.priceText);                holder.changeText = (TextView) v.findViewById(R.id.changeText);                // associate the holder with the view for later lookup                v.setTag(holder);            }            else {                // view already exists, get the holder instance from the view                holder = (ViewHolder)v.getTag();            }            // change the row color based on selected state            if (selectedPos == position) {                v.setBackgroundResource(R.drawable.stocks_selected_gradient);                holder.nameText.setTextColor(Color.WHITE);                holder.priceText.setTextColor(Color.WHITE);                holder.changeText.setTextColor(Color.WHITE);            } else {                v.setBackgroundResource(R.drawable.stocks_gradient);                holder.nameText.setTextAppearance(getApplicationContext(), R.style.BlueText);                holder.priceText.setTextAppearance(getApplicationContext(), R.style.BlueText);                holder.changeText.setTextAppearance(getApplicationContext(), R.style.BlueText);            }            Quote q = items.get(position);            if (q != null) {                if (holder.nameText != null) {                    holder.nameText.setText(q.getSymbol());                }                if (holder.priceText != null) {                    holder.priceText.setText(q.getLastTradePriceOnly());                }                if (holder.changeText != null) {                    try {                        float floatedChange = Float.valueOf(q.getChange());                        if (floatedChange &lt; 0) {                            if (selectedPos != position)                                holder.changeText.setTextAppearance(getApplicationContext(), R.style.RedText); // red                        } else {                            if (selectedPos != position)                                holder.changeText.setTextAppearance(getApplicationContext(), R.style.GreenText); // green                        }                    } catch (NumberFormatException e) {                        System.out.println(""not a number"");                    } catch (NullPointerException e) {                        System.out.println(""null number"");                    }                    holder.changeText.setText(q.getChange() + "" ("" + q.getPercentChange() + "")"");                }            }            return v;        }    }</code></pre>","19875","","415347","","2011-09-05 11:09:22","2011-09-05 11:10:32","getView() for ArrayAdapter is slow","<java><android><listview><android-arrayadapter>","2","0","2","",""
"3827550","1","4366174","","2010-09-30 03:43:21","2","2490","<p>it seen i can't write to settings in LG-P500 (Android 2.2).This is my code:</p><pre><code>android.provider.Settings.System.putInt(getContentResolver(), android.provider.Settings.System.AUTO_TIME, 1); </code></pre><p>Value to specify if the user prefers the date, time and time zone to be automatically fetched from the network (NITZ). 1=yes, 0=no</p><p>It work fine in my emulator android 2.2I also try in other phone, HTC android 2.1 it works fine too.</p><p>Could anyone know what would be the problem?Thank you very much.</p>","430926","","415347","","2011-09-05 11:11:13","2011-09-05 11:11:31","update Android provider.Settings.System value","<android><system><settings.settings>","1","0","","",""
"3827657","1","3828779","","2010-09-30 04:09:20","0","659","<p>In fact, only the <code>touch_down</code> event will fire. Basically, I'm trying to implement a drag feature in my app so I need the <code>touch_move</code> event. I have a method that writes out the touch events to the LogCat in Eclipse but the <code>touch_down</code> is the only event that shows up. not even <code>touch_up</code> shows up. I have this problem when I debug on the device or in the avd.</p><p>This isn't really a code question. But has anyone had an issue getting different touch events to fire? If so, how did you resolve them? I'm using the latest Android SDK and Eclipse version. I'm using a simple ImageView.</p><p>Any ideas?</p>","462440","","415347","","2011-09-05 11:11:58","2011-09-05 11:11:58","Android TOUCH_MOVE event not firing in avd or device","<android><events><touch>","1","0","","",""
"3827762","1","","","2010-09-30 04:33:23","1","820","<p>In android there is A to Z selector on right side of the contacts. one can just select on of the alphabet and only those contacts will be displayed which are starting with that selected alphabet.I want to implement such kind of list.Any idea?</p>","240737","","415347","","2011-09-05 11:12:30","2011-09-05 11:12:53","how to implement contact like A to Z list items viewer","<android><list><contacts>","1","0","1","",""
"3827877","1","3827930","","2010-09-30 05:00:36","0","660","<p>Android will call <code>onCreate()</code> of my activity whenever it is launched.</p><p>In the <code>onCreate()</code> of my activity can I tell what intent launches my activity?</p><p>Thank you.</p>","286802","","415347","","2011-09-05 11:13:25","2011-09-05 11:13:49","In the oncreate() of my activity can I tell what intent launches my activity?","<android>","1","0","1","",""
"3827882","1","3860244","","2010-09-30 05:03:10","0","313","<p>Hi all this one surely is a simple one but I haven't made sense of is yet.</p><p>I'm working on an app in opengl es on android</p><p>everything goes well except when I load the textures.</p><p>I manage to open load and create all the textures without any problem, but the image displays itself rotated of 90.it looks as if the application does not consider that its is in landscape when opening the image...</p><p>I solved the problem by turning all my textures of 90 degrees but I would sure like to figure this one out</p><p>because it is the only thing that is not rotated,the top bar is rotated,the touch coordinated are rotated,the h and w of the surface are good,</p><p>here are some code snippets that I think are relevant</p><p>in the manifest<code>android:screenOrientation=""landscape""</code></p><p>on Create of the application </p><p><code>getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);</code></p><p><code>InputStream is = context.getResources().openRawResource(id);</code></p><p><code>bitmap = BitmapFactory.decodeStream(is);</code></p><p><code>GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);</code></p><p>Any ideas</p><p>Jason</p>","440336","","","","","2010-10-05 01:09:44","Image Resource aren't rotated in Landscape with Android","<android><opengl-es>","1","0","","",""
"3827889","1","3830848","","2010-09-30 05:04:39","0","659","<p>How can the home screen be customized? and also how can the springboard layout be customized? </p><p>I want to make an application which makes a clone of users current theme and allows user to customize content that he wants to view such as phonebook, pics and etc.</p>","261566","","","","","2010-09-30 13:16:08","Customize springboard in Android?","<android><widget><homescreen>","1","1","","",""
"3827951","1","3828435","","2010-09-30 05:17:42","0","561","<p>i have an application where it displays a list of items in <code>ListView</code>. These items(strings) are coming from the server which are stored in English language. I want to display these English characters in Chinese language in my application. Is it default if the user selects Chinese lang for their device or should i have to do something else.. I know how to localize images, strings that are stored in resources, but i want to localize the strings coming from internet that are stored in a single language in database. </p><p>EDIT:If the administrator enters the data to the database in chinese language, will it be displayed in chinese in my ListView? </p>","365184","","415347","","2011-09-05 11:14:47","2011-09-05 11:14:47","localize android application where data coming from server","<android><localization><internationalization>","1","0","","",""
"3828043","1","","","2010-09-30 05:37:19","2","1872","<p>How to set footer in android on each page</p><p>I have used:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""   android:background=""@color/mcolor""   android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""fill""&gt;&lt;ImageButton android:id=""@+id/iconbtn""            android:layout_height=""wrap_content""            android:src=""@drawable/all_icon_138""            android:layout_marginRight=""4px""            android:layout_gravity=""fill""            android:clickable=""true""            android:layout_width=""wrap_content""             android:background=""@color/mcolor""             android:layout_marginLeft=""60px""              android:layout_marginTop=""12px"" android:saveEnabled=""true""&gt;&lt;/ImageButton&gt;&lt;TextView android:text=""@+id/TextView01""      android:id=""@+id/label""      android:textColor=""@color/mbcolor""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:layout_gravity=""center""     android:scrollbars=""vertical""      android:layout_marginBottom=""30px""     android:layout_marginTop=""30px""      android:textSize=""12px""     android:layout_marginRight=""30px""     android:layout_marginLeft=""130px""&gt;&lt;/TextView&gt;&lt;LinearLayout android:layout_marginTop=""50dip""     android:gravity=""bottom""     android:layout_height=""wrap_content""      android:layout_width=""fill_parent""     android:layout_alignParentBottom=""true""&gt;     &lt;ImageButton android:id=""@+id/previous""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:src=""@drawable/newfox_footer_320""            android:layout_alignParentBottom=""true""             android:layout_alignParentRight=""false""               android:layout_alignParentLeft=""false"" android:layout_marginLeft=""190px"" android:layout_marginRight=""2px""&gt;            &lt;/ImageButton&gt;&lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>It is showing 6 images of footer after each <code>TextView</code>.How do I set it?</p>","459161","","415347","","2011-09-05 11:15:18","2013-09-25 11:40:22","How to set footer in android","<android><android-layout>","3","1","","","2010-09-30 11:11:31"
"3828071","1","3829391","","2010-09-30 05:43:37","0","121","<p>I am using a handler inside my service to display notifications at a certain time using the <code>Handler.postDelayed</code> method. My application runs fine on the emulator just as expected satisfying all cases. But when I installed the same on my HTC Wildfire, it simply doesn't happen as anticipated. Notifications are displayed at a random manner after the scheduled time and some notifications even fail. I'm monitoring my service from the Applications > Running Services and still my service is active. Any ideas?</p>","421372","","415347","","2011-09-05 11:16:26","2011-09-05 11:16:26","Inconsistent Handler behavior","<android><service><handler>","1","0","","",""
"3828111","1","","","2010-09-30 05:54:47","11","4463","<p>Is there a way to <strong>always</strong> show the vertical scroll bar of the <code>ListView</code>?</p>","462504","","785215","","2013-03-14 16:56:11","2014-03-10 10:23:19","Is there a way to show the scrollbar of ListView all the time?","<android><android-widget><android-listview>","3","0","","",""
"3828227","1","3828254","","2010-09-30 06:14:16","1","2797","<p>I wanna draw a route on the basis of the entered source &amp; destination address. I need to get lat/log on the basis of address to draw a map in android. So how can i get lat/log on the basis of entered address.</p><pre><code> Geocoder geoCoder = new Geocoder( getBaseContext(), Locale.getDefault()); try {     List&lt;Address&gt; addresses = geoCoder.getFromLocationName(""Loc"",1);     String add = """";     if (addresses.size() &gt; 0)      {         add = addresses.get(0);     }     Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show(); } catch (IOException e) {                     Toast.makeText(getBaseContext(), e.getMessage(), Toast.LENGTH_LONG).show(); }</code></pre>","443075","","180538","","2010-09-30 09:57:49","2012-03-30 19:02:08","How to get latitude/longitude based on entered address in android?","<android>","2","1","","",""
"3828308","1","","","2010-09-30 06:32:25","0","777","<p>I have a problem about onItemSelected method of Spinner. There is no problem if I only have one Spinner. I can set a listener on that. I have a DB stored in sqlite. There is a table in which a column field contains date with year-month-date format. Then I created two Spinner views. One for month, and other for year. My program wants to show the database queries based on selection from month and year.</p><p>The problem now, if I set listener only on month Spinner, it shows queries based on month. If I set listener on year Spinner, it shows queries based on year. Actually I already prepared sql queries matching both year and month queries. But it seems that the OnItemSelected listener only can accept ""ONE"" spinner instance at a time. I try to use monthview.getItemAtPosition(position) &amp;&amp; yearview.getItemAtPosition(position) to match both requirements for month and year. But it failed. </p><p>I use public class xxx extends xxx implements OnItemSelected listener and add two methods.</p><pre><code>spinner.setOnItemSelectedListener(new OnItemSelectedListener() {    @Override    public void onItemSelected(AdapterView&lt;?&gt; parent,            View view, int pos, long id)     {            // Do some stuff based onItemSelected           }}</code></pre><p>Does anyone know how to achieve this goal ?</p><p>In simple words, I have two spinners, one for month, one for year, values are populated via arrayadapter. Then I use SimpleCusrsorAdapter to get sql result from sqlite DB. Then I put cursor result into listadapter and associated with listview. It works without problem if I operate it individually either by month or year but not both. But it seems that listener only listen on one spinner instance not two or more at the same time. May be it is common problem. May be some of you already encountered this problem before.</p><p>Or can I use anonymous inner class ? But I think that it is different approach with same result. If not may be I need to use another technique if only one listener is available ?</p><p>I want to show, for example: -I select April and All years, it displays all entries in April (April in all years)-I select 2010 and All Months, it displays all entries in 2010 (Jan to Dec 2010)-I select April and 2010, it only displays all entries in April 2010</p><p>Thanks for explaination and suggestions !!</p><p>TomBest Regards,</p>","462529","","415347","","2011-09-05 11:42:30","2011-09-05 11:59:27","Does it possible to create two ""setOnItemSelectedListeners"" on Spinner?","<android><spinner>","2","0","","",""
"3828331","1","3830890","","2010-09-30 06:35:57","0","167","<p>I have developed an android service. Any android app can use it's API's to get some kind of news updates from this service. I want to distribute this service so that any android app on the phone can use this service. My questions here are :</p><ol><li>When some android application try to use its API on the phone and suppose that service is not available on the phone then what will happen ?</li><li>How will android application developer will make sure that the service is available on the phone ?</li><li>Does application developer has to bundle service with his application ? If yes then wont be there multiple instances of same service on phone if multiple application contains same service on the phone ?</li></ol><p>ThanksDalvin</p>","462534","","180538","","2010-09-30 13:48:11","2010-09-30 13:48:11","Android Service Distribution","<android>","1","0","","",""
"3828345","1","3948834","","2010-09-30 06:38:02","2","4675","<p>Is it possible to place the <code>TextView</code> in some position which I calculate within my code.<br>I have the x and y position with me (which i get after the calculation) and I just want to place the <code>TextView</code> in that position.  </p><p>How can i implement it?<br>Please Help.</p><p>Thanks,<br>Sen </p>","449378","","415347","","2011-09-05 11:43:02","2011-09-05 11:43:17","How to position the TextView from code?","<android>","2","0","1","",""
"3828362","1","","","2010-09-30 06:41:50","0","857","<p>I am building an application in which the front page of the app should have a animated imageview. There are about 5-6 images and it should be scrolling either from left to right, the direction doesnt matters but it should scroll anyway.</p><p>I tried searching from the net but i found only bring the pic set relevant to time and they seems they dont scroll through the layouts. So if u come to know scrolling the images with time duration let me come to know. I have been moving with this a long time so any suggestions on this is greatly appreciable.</p>","431655","","","","","2011-12-15 21:07:47","Scrolling Image View with time Duration in Android","<android><animation><uiimageview>","1","0","","",""
"3828389","1","","","2010-09-30 06:47:19","0","529","<p>I have one google maps application it does not show the maps it only shows the linesIt does not show the mapview,and i also have the internet Connection </p><pre><code>      And it also genrate the following error    09-30 12:01:12.934: WARN/Resources(587): Converting to string:                 TypedValue{t=0x12/d=0x0 a=2 r=0x7f050002}    09-30 12:01:13.094: WARN/GpsLocationProvider(59): Duplicate add listener for uid        10042   09-30 12:01:13.334: INFO/MapActivity(587): Handling network change    notification:CONNECTED  09-30 12:01:13.334: ERROR/MapActivity(587): Couldn't get connection factory client</code></pre><p>Showmap.java        package de.vogella.android.locationapi.maps;</p><pre><code>     import android.content.Context;     import android.location.Location;     import android.location.LocationListener;     import android.location.LocationManager;     import android.os.Bundle;     import android.widget.RelativeLayout;    import com.google.android.maps.GeoPoint;    import com.google.android.maps.MapActivity;    import com.google.android.maps.MapController;    import com.google.android.maps.MapView;     public class ShowMap extends MapActivity {private MapController mapController;private MapView mapView;private LocationManager locationManager;public void onCreate(Bundle bundle) {    super.onCreate(bundle);    setContentView(R.layout.main); // bind the layout to the activity    // create a map view    RelativeLayout linearLayout = (RelativeLayout) findViewById(R.id.mainlayout);    mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    mapView.setStreetView(true);    mapController = mapView.getController();    mapController.setZoom(14); // Zoon 1 is world view    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 13,            14, new GeoUpdateHandler());}@Overrideprotected boolean isRouteDisplayed() {    return false;}public class GeoUpdateHandler implements LocationListener {    @Override    public void onLocationChanged(Location location) {        int lat = (int) (location.getLatitude() * 1E6);        int lng = (int) (location.getLongitude() * 1E6);        GeoPoint point = new GeoPoint(lat, lng);        mapController.animateTo(point); //  mapController.setCenter(point);    }    @Override    public void onProviderDisabled(String provider) {    }    @Override    public void onProviderEnabled(String provider) {    }    @Override    public void onStatusChanged(String provider, int status, Bundle extras) {    }}</code></pre><p>}</p><p>This is My mainfest?xml version=""1.0"" encoding=""utf-8""?>              </p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;uses-library android:name=""com.google.android.maps"" /&gt;    &lt;activity android:name="".ShowMap""              android:label=""@string/app_name""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;&lt;uses-library android:required=""true"" android:name=""com.google.android.maps""&gt;&lt;/uses-library&gt;</code></pre><p>    </p><p> </p><p>And main.xml</p><pre><code>           &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;         &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""         android:id=""@+id/mainlayout""         android:orientation=""vertical""          android:layout_width=""fill_parent""         android:layout_height=""fill_parent"" &gt;        &lt;com.google.android.maps.MapView            android:id=""@+id/mapview""             android:layout_width=""fill_parent""             android:layout_height=""fill_parent""             android:enabled=""true""                android:clickable=""true""             android:apiKey=""0cHF-o_cvW1DEz3ocWAyybGqUsg8aUlwKMoyr4A""             /&gt;</code></pre><p></p>","441224","","","","","2010-09-30 07:41:48","Android google maps showing greed lines","<android>","2","3","","",""
"3828498","1","","","2010-09-30 07:05:04","0","558","<p>I'm trying to modify an existing notepad example from the Android Developer site. I have a database with an existing column named <code>CREATED_DATE</code>(of the note) but the data for that column is presented as <code>System.currentTimeMillis()</code>. This is all good and probably in line with conventions since it's created by the developers. </p><p>But my problem is that I want to present the date in a <code>ListView</code> using the format <code>""30 sep""</code>. My problem, how do I convert the data to that format before presenting it in the <code>ListView</code>? Right now I'm using this kind of adapter:</p><pre><code>SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.noteslist_item, cursor,        new String[] { Notes.TITLE, Notes.CREATED_DATE }, new int[] { R.id.note_title, R.id.note_date });setListAdapter(adapter);</code></pre><p>Now, I've figured out how to convert <code>currentTimeMillis()</code> to today's date but how can I convert the data coming from the cursor before I toss it into the adapter?</p>","462555","","493939","","2012-06-03 06:09:33","2012-06-03 06:09:33","Converting sql data before presenting it in ListView","<android><android-listview><simplecursoradapter>","2","0","1","",""
"3828544","1","3829148","","2010-09-30 07:12:51","0","601","<p>I want to be able to access my ArrayAdapter's view:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent)</code></pre><p>I'm not sure how I can access this:</p><pre><code>View myView = myArrayAdapter.getView(myPosition, myView, ?);</code></pre><p>I am not sure how I can get a ViewGroup parent?</p>","19875","","","","","2010-09-30 09:16:26","How can I update one view at a time in an ArrayAdapter?","<java><android><listview><android-arrayadapter><listadapter>","2","0","","",""
"3828661","1","","","2010-09-30 07:34:23","0","614","<p>i have listview and i call intent from the listview onitem selected method</p><p>but when i get linkfy textview in my listrow than i am not able to call intent from the onItem selected method.</p><p>Any suggestion would be helpful to me.</p>","336004","","1471203","","2013-01-09 11:02:53","2013-01-09 11:02:53","Linkify TextView","<android>","1","0","","",""
"3828838","1","3830901","","2010-09-30 08:06:19","1","446","<p>How do I check whether the local service inside my application is running?</p>","421372","","","","","2010-12-24 00:53:20","Check the state of a local Service","<android><service>","2","0","","",""
"3828897","1","","","2010-09-30 08:16:59","0","343","<p>Hey all one of my friend suggested me this (Tony), am I going wrong anywhere here ?because this is giving runtime error. application stopped unexpectedly.<br>I may b wrong in syntax.<br>just help me out, thanks in advance. I am gratefull for your response.</p><p><pre><code>public boolean checkData(String task1, String dte1, String startTime1){ </p>SQLiteQueryBuilder qb = new SQLiteQueryBuilder();//SQLiteDatabase db = null; // get your database instance here.qb.setTables(""table1"");qb.appendWhere(""task = ? AND dte = ?"");Cursor c = qb.query(this.db, new String[] { ""task"" }, startTime1+"" BETWEEN stTime AND enTime"",        new String[] { task1, dte1}, null, null, null);int a = c.getCount();if(a&gt;0){    return true;}return false;</code></pre><p>}</p>","460652","","","","","2010-09-30 13:51:44","SQLite Query in Android Application giving error","<android><sqlite>","1","2","1","",""
"3828906","1","3829035","","2010-09-30 08:18:28","0","244","<p>how could i get an image and a text from the Internet and made a button for my android application dynamically?And draw them in th position i want. i.e by Java code</p><p>thinks</p>","462023","","","","","2010-09-30 08:39:07","Button contains text & image from the Internet [android]","<android><button><bitmap>","1","1","","",""
"3828930","1","4614342","","2010-09-30 08:23:31","2","1321","<p>My goal is to collect all unknown phone numbers from the Call Log. This can be achieved by the following code:</p><pre><code>private static final String[] CALLOG_PROJECTION = {CallLog.Calls._ID,        CallLog.Calls.CACHED_NAME, CallLog.Calls.NUMBER};private static final String CALLOG_WHERE = CallLog.Calls.CACHED_NAME + "" is null"";Cursor c = getContentResolver().query(CallLog.Calls.CONTENT_URI, CALLOG_PROJECTION,        CALLOG_WHERE, null, CallLog.Calls.DATE + "" DESC"");</code></pre><p>This works well, but after i've created a contact from an unknown number, the result of the query still contains the unknown number. </p><p>If i open the Call Log activity window, i can see as the number changes to the name of the contact within a few seconds. So, the activity refreshes the CACHED_NAME column. </p><p>My question is, how can i programatically refresh (actualize) the Call Log ?</p>","416956","","","","","2011-12-01 09:19:34","How to force refresh on CallLog.Calls.CACHED_NAME column?","<android><caching><calllog>","1","1","","",""
"3829002","1","","","2010-09-30 08:35:05","1","4441","<p>I want to add an ImageView dynamically or from an xml into a class which extends View.....pleas helpthis is my code ...but it doesn't show any image...first class</p><pre><code>public class Draw extends Activity {    DrawView drawView;    ImageView imageView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);               drawView = new DrawView(this, null);         setContentView(drawView);    }}</code></pre><p>2nd class</p><pre><code>public class DrawView extends View implements OnTouchListener {    Path path;    Paint paint = new Paint();    private ShapeDrawable mDrawable;    ImageView imageView; // image img=new image();    private ArrayList&lt;Path&gt; graphics = new ArrayList&lt;Path&gt;();    public DrawView(Context context,AttributeSet attrs) {        super(context,attrs);        setFocusable(true);        setFocusableInTouchMode(true);        this.setOnTouchListener(this);        paint.setDither(true);        paint.setColor(0xFFFFFF00);        paint.setStyle(Paint.Style.STROKE);        paint.setStrokeJoin(Paint.Join.ROUND);        paint.setStrokeCap(Paint.Cap.ROUND);        paint.setStrokeWidth(3);        ImageView iv = (ImageView)findViewById(R.id.image_id); /* Load your ImageView         based on your id from your XML file */        iv.setImageDrawable(        this.getResources().getDrawable(R.drawable.yourimageinyourdrawablefolder)        );      //  img.showImage();     }    @Override    public void onDraw(Canvas canvas) {        System.out.println(""onDraw""+graphics);        for (Path path : graphics) {            //canvas.drawPoint(graphic.x, graphic.y, mPaint);            canvas.drawPath(path, paint);        }    }public boolean onTouch(View view, MotionEvent event) {        // if(event.getAction() != MotionEvent.ACTION_DOWN)        // return super.onTouchEvent(event);        if(event.getAction() == MotionEvent.ACTION_DOWN){            path = new Path();            System.out.println(""ACTION_DOWN"");            path.moveTo(event.getX(), event.getY());            path.lineTo(event.getX(), event.getY());            }        else if(event.getAction() == MotionEvent.ACTION_MOVE){            path.lineTo(event.getX(), event.getY());            graphics.add(path);             System.out.println(""ACTION_MOVE"");            path = new Path();            path.moveTo(event.getX(), event.getY());            }else if(event.getAction() == MotionEvent.ACTION_UP){            path.lineTo(event.getX(), event.getY());            graphics.add(path);            }       invalidate();        return true;    }}</code></pre><p>xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:id=""@+id/main""     &gt;&lt;ImageViewandroid:layout_width=""wrap_content""android:layout_height=""wrap_content""android:id=""@+id/image_id""  /&gt;&lt;/LinearLayout &gt;</code></pre><p>I am trying with the above code and it crashes in the emulator. Is there any syntax error or something that I have made mistake. Please help.</p>","461386","","180538","","2010-09-30 10:37:38","2011-07-06 16:25:07","add ImageView in a View?","<android><view><imageview>","0","3","","",""
"3829013","1","","","2010-09-30 08:36:55","0","601","<p>I've to make an application which has 2 parts:</p><p>1) It should record the audio from Android application layer and through JNI it should send the audio data to C library.</p><p>2) The C library processes this audio data and send its back to application layer where the processed audio song is played back.</p><p>i know how to use the Audio Recorder and Audio Track ...but i 'm having problem regarding sending the data from application layer and sending it back to application layer...How to send Audio data as bytes to lower layer and then retrive it back as bytes?  </p>","396437","","396437","","2010-09-30 19:22:41","2010-09-30 19:22:41","How do i play Audio using JNI?","<java><android><jni>","0","4","","",""
"3829090","1","","","2010-09-30 08:49:51","0","1091","<p>can anybody give example of rest webservice in android</p>","426344","","","","","2011-04-08 20:32:14","rest webservice in android","<android>","1","1","","",""
"3829154","1","","","2010-09-30 09:00:19","0","192","<p>I am having a Srollview in for my entire layout.In that i added a listview.when i scrolling the page ,tha page scrolls normally,but when it reaches listview listview only scrolls how to overcome this problem.</p><p>Please any one can suggest the answer.</p><p>I am looking that when i scroll the listview the whole page gets scrolled.</p>","454670","","180538","","2010-09-30 09:12:30","2012-04-11 12:12:24","Android Customized ListView","<android><listview>","2","1","","",""
"3829408","1","","","2010-09-30 09:41:10","0","617","<p>I have a fresh install of python25 with xwidgits for it just like the instructions say.  When I try to run the py file I get the following error.</p><p>C:\development\android-sdk-windows\tools\Jet\JetCreator>python -v JetCreator.py</p><h1>installing zipimport hook</h1><p>import zipimport # builtin</p><h1>installed zipimport hook</h1><p>'import site' failed; traceback:ImportError: No module named sitePython 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] onwin32Type ""help"", ""copyright"", ""credits"" or ""license"" for more information.Traceback (most recent call last):  File ""JetCreator.py"", line 23, in     from <strong>future</strong> import with_statementImportError: No module named <strong>future</strong></p><h1>clear <strong>builtin</strong>._</h1><h1>clear sys.path</h1><h1>clear sys.argv</h1><h1>clear sys.ps1</h1><h1>clear sys.ps2</h1><h1>clear sys.exitfunc</h1><h1>clear sys.exc_type</h1><h1>clear sys.exc_value</h1><h1>clear sys.exc_traceback</h1><h1>clear sys.last_type</h1><h1>clear sys.last_value</h1><h1>clear sys.last_traceback</h1><h1>clear sys.path_hooks</h1><h1>clear sys.path_importer_cache</h1><h1>clear sys.meta_path</h1><h1>restore sys.stdin</h1><h1>restore sys.stdout</h1><h1>restore sys.stderr</h1><h1>cleanup <strong>main</strong></h1><h1>cleanup[1] zipimport</h1><h1>cleanup[1] signal</h1><h1>cleanup[1] exceptions</h1><h1>cleanup sys</h1><h1>cleanup <strong>builtin</strong></h1><h1>cleanup ints</h1><h1>cleanup floats</h1><p>I can't think of anything else to do and I would like to have the flexibility in the JetEngine since MOD libs don't seem to have the dynamic control I need.  I haven't begun to learn python yet so I'm not sure, but I can't really see where it's looking for the module site or future.</p>","462674","","","","","2010-10-01 06:22:46","How do I get JetCreator for android to run?","<android><audio><music>","1","0","","",""
"3829495","1","","","2010-09-30 09:52:18","0","3031","<p>Here I am posting the Json Response:</p><pre><code>{  ""ResultSet"": {    ""Result"": [{      ""Phone"": ""(650) 473-9999"",      ""Distance"": ""2.59"",      ""MapUrl"": ""http://maps.yahoo.com/maps_result?q1=441+Emerson+St+Palo+Alto+CAgid1=28734629"",      ""Categories"": {        ""Category"": [{          ""content"": ""Salad Restaurants"",          ""id"": ""96926225""        }, {          ""content"": ""Vegetarian Restaurants"",          ""id"": ""96926239""        }, {          ""content"": ""Pizza"",          ""id"": ""96926243""        }, {          ""content"": ""Wine"",          ""id"": ""96926864""        }, {          ""content"": ""Alcoholic Beverages"",          ""id"": ""96929810""        }]      },</code></pre><p>Now I just want to parse the data </p><pre><code>{  ""content"": ""Salad Restaurants"",  ""id"": ""96926225""}, {  ""content"": ""Vegetarian Restaurants"",  ""id"": ""96926239""}, {  ""content"": ""Pizza"",  ""id"": ""96926243""}, {  ""content"": ""Wine"",  ""id"": ""96926864""}, {  ""content"": ""Alcoholic Beverages"",  ""id"": ""96929810""}</code></pre><p>from the Category Tag.Can anybody please help me, I am able to parse from the Result Tag. Here is my code :</p><pre><code>private String connect(String url) {  // Create the httpclient  HttpClient httpclient = new DefaultHttpClient();  //Prepare a request Object  HttpGet httpget = new HttpGet(url);  //Response Declaration  HttpResponse response;  //Return String Declaration  String returnString = null;  try {    // Open the webpage.    response = httpclient.execute(httpget);    if (response.getStatusLine().getStatusCode() == 200) {      // Connection was established. Get the content.       HttpEntity entity = response.getEntity();      // If the response does not enclose an entity, there is no need      // to worry about connection release      if (entity != null) {        // A Simple JSON Response Read        InputStream instream = entity.getContent();        // Load the requested page converted to a string into a JSONObject.        JSONObject myAwway = new JSONObject(convertStreamToString(instream));        Log.e(DATA, ""myData"");        System.out.println(""Response : - - "" + myAwway);        // Get the query value'        // String phone = myAwway.getString(""Phone"");/*   String resultset = myAwway.getString(""ResultSet"");                       JSONObject temp = new JSONObject(resultset);                       String string = temp.getString(""Result"");                       JSONArray result = new JSONArray(string);                       */        String resultset = myAwway.getString(""ResultSet"");        JSONObject temp = new JSONObject(resultset);        String string = temp.getString(""Category"");        JSONArray result = new JSONArray(string);/* JSONObject temp1 = new JSONObject(string);                       String string1 = temp1.getString(""Category"");                       JSONArray result1 = new JSONArray(string1);                       */        //JSONArray result = myAwway.getJSONArray(""Result"").getString(resultset);        // JSONArray result = myAwway.getJSONArray(""Result"");        // Build the return string.        returnString = ""DataFound: "" + result.length();        for (int i = 0; i &lt; result.length(); i++) {          //returnString += ""\n\t"" + result.getString(i);          returnString += ""\n\t"" + result.getJSONObject(i).getString(""Phone"");          returnString += ""\n\t"" + result.getJSONObject(i).getString(""Distance"");          returnString += ""\n\t"" + result.getJSONObject(i).getString(""BusinessUrl"");          returnString += ""\n\t"" + result.getJSONObject(i).getString(""Rating"");/*for (int j = 0; j &lt; result1.length(); j++)                            {                                returnString += ""\n\t"" + result1.getJSONObject(j).getString(""Category"");                            } */          System.out.println(""JsonOutPut:---"" + result);        }        // Close the stream.        instream.close();      }    } else {      // code here for a response other than 200.  A response 200 means the webpage was ok      // Other codes include 404 - not found, 301 - redirect etc...      // Display the response line.      returnString = ""Unable to load page - "" + response.getStatusLine();    }  } catch (IOException ex) {    // thrown by line 80 - getContent();    // Connection was not established    returnString = ""Connection failed; "" + ex.getMessage();  } catch (JSONException ex) {    // JSON errors    returnString = ""JSON failed; "" + ex.getMessage();  }  return returnString;}</code></pre>","422859","","505893","","2011-03-03 10:41:48","2013-01-03 07:50:26","Parsing the Data in JSON Response","<android><json><parsing>","1","0","1","",""
"3829531","1","3830401","","2010-09-30 09:59:09","0","136","<p>i asked the question about haw to create a button by a text &amp; an image</p><p><a href=""http://stackoverflow.com/questions/3828906/button-contains-text-image-from-the-internet-android"">http://stackoverflow.com/questions/3828906/button-contains-text-image-from-the-internet-android</a></p><p>it was very helpful.But, the problem is :i want a button contains the image &amp; under it the text (not as background)am looking how to add this image as the text and specify their place??</p><p>thanx</p>","462023","","","","","2010-09-30 12:19:20","specify the postion of a text & and an image in a botton [android]","<android><image><button>","1","0","","",""
"3829556","1","3829564","","2010-09-30 10:01:47","0","486","<p>I have installed usb driver, selected the android device's debugging mode but i can't access the android device in the target android device's list.I am using htc wildfire as my android device. i chose the connection type of my device to my pc as Disk Drive.</p>","462695","","","","","2010-09-30 10:03:47","can't find the android device in target android device's list","<android>","1","0","","",""
"3829601","1","3836066","","2010-09-30 10:09:59","0","1397","<p>Hello I have this code:`public class MaxsapListAdapter extends BaseAdapter {</p><pre><code>    private LayoutInflater mInflater;    private Bitmap mIcon1;    private Bitmap mIcon2;    private Bitmap mIconCall;    private String[] DATA;    MaxsapListAdapter(Context context, String[] DATA) {        // Cache the LayoutInflate to avoid asking for a new one each time.        mInflater = LayoutInflater.from(context);        // Icons bound to the rows.        mIcon1 = BitmapFactory.decodeResource(context.getResources(),                R.drawable.icon48x48_1);        mIcon2 = BitmapFactory.decodeResource(context.getResources(),                R.drawable.icon48x48_2);        mIconCall = BitmapFactory.decodeResource(context.getResources(), R.drawable.call);        this.DATA = DATA;    }    /**     * The number of items in the list is determined by the number of speeches     * in our array.     *      * @see android.widget.ListAdapter#getCount()     */    public int getCount() {        return DATA.length;    }    /**     * Since the data comes from an array, just returning the index is sufficent     * to get at the data. If we were using a more complex data structure, we     * would return whatever object represents one row in the list.     *      * @see android.widget.ListAdapter#getItem(int)     */    public Object getItem(int position) {        return position;    }    /**     * Use the array index as a unique id.     *      * @see android.widget.ListAdapter#getItemId(int)     */    public long getItemId(int position) {        return position;    }    /**     * Make a view to hold each row.     *      * @see android.widget.ListAdapter#getView(int, android.view.View,     *      android.view.ViewGroup)     */    public View getView(int position, View convertView, ViewGroup parent) {        // A ViewHolder keeps references to children views to avoid unneccessary        // calls        // to findViewById() on each row.        ViewHolder holder;        // When convertView is not null, we can reuse it directly, there is no        // need        // to reinflate it. We only inflate a new View when the convertView        // supplied        // by ListView is null.        if (convertView == null) {            convertView = mInflater.inflate(R.layout.list_item_icon_text, null);            // Creates a ViewHolder and store references to the three children            // views            // we want to bind data to.            holder = new ViewHolder();            holder.text = (TextView) convertView.findViewById(R.id.text);            holder.icon = (ImageView) convertView.findViewById(R.id.icon);            holder.btn = (ImageButton) convertView.findViewById(R.id.button);            convertView.setTag(holder);        } else {            // Get the ViewHolder back to get fast access to the TextView            // and the ImageView.            holder = (ViewHolder) convertView.getTag();        }        // Bind the data efficiently with the holder.        holder.text.setText(DATA[position]);        holder.icon.setImageBitmap((position &amp; 1) == 1 ? mIcon1 : mIcon2);        holder.btn.setImageBitmap(mIconCall);        holder.btn.setId((int)this.getItemId(position));        holder.btn.setFocusable(false);        holder.btn.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                      Log.e(""maxsap"",""--------*ButtonClicked*---------"");              Log.e(""maxsap"",""--------""+v.setTag(key, tag)+""---------"");        Intent callIntent = new Intent(v.getContext(),PhoneCall.class);                Log.e(""maxsap"",PhoneCall.class.toString());                startActivity(callIntent);              }        });        return convertView;    }     class ViewHolder {        TextView text;        ImageView icon;        ImageButton btn;    }}`</code></pre><p>which loads some arbitrary data array on a list and sets some example icons too,I would like to be able to use users contacts on my list next to users name e.g. the list will be as many rows as contacts user has on his phone and in every contact that there is a photo load that photo next to contacts name else load a blank image, is this possible? and how?</p><p>regards maxsap.</p>","234898","","","","","2010-10-01 02:03:00","android load contact photos to a list","<android>","1","0","","",""
"3829635","1","3830622","","2010-09-30 10:17:52","2","2597","<p>HI there. This is my layout </p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ListView android:id=""@+id/lv""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:background=""@android:color/white"" /&gt;    &lt;Button android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_below=""@id/lv"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>When I run this the list view occupies full screen. What I want is list view to be full screen except button area without mentioning dp. Thanks</p>","368084","","180538","","2010-09-30 12:29:37","2010-09-30 14:26:47","Android fill_parent issue","<android>","4","0","","",""
"3829651","1","3843297","","2010-09-30 10:20:24","0","694","<p>I'm using Flash CS 5 and Flex 4, both to build an AIR application for android. I would like to know how to allow the user to move content(image or text) up and down(like a map,in this case only vertically).</p>","379779","","773263","","2012-05-14 00:48:14","2013-03-26 21:11:02","How can I able to move the content up and down in AIR-Android ?","<android><flash><flex><air><air-android>","1","2","","",""
"3829660","1","","","2010-09-30 10:22:03","0","169","<p>In my Layout there are some widgets are there in above to the list view. When i scroll through the list view i want to scroll my layout fully.Please any one can suggest the answer</p>","462716","","","","","2010-09-30 13:24:16","Android List View","<android>","1","0","","",""
"3829679","1","3829739","","2010-09-30 10:25:03","0","1360","<p>I want to show the progress of a media on a seekbar.Also I want to allow user to ""jump"" within a medium.</p><p>I have a MediaPlayer, and a SeekBar. And as far as I see there is no an easy way to merge them.</p>","186268","","","","","2010-09-30 10:32:26","How to connect Media Player to a SeekBar?","<android><media-player>","1","0","","",""
"3829682","1","3829754","","2010-09-30 10:25:18","0","2527","<p>I have found this example <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012"">http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012</a>  from Fedor which is absolutely great for what I need. </p><p>I have a question. if beside the Clear Cache button there would be a TextView how could I put in there how many images from total images had downloaded ? If I know that I will download a total of 20 images, the status as one image after another will download would be 1/20. 2/20... 20/20. </p>","379865","","379865","","2010-09-30 10:34:59","2011-07-05 09:30:36","Lazy List with images and progress display","<android><listview><lazy-loading>","1","0","1","",""
"3829978","1","3830158","","2010-09-30 11:09:31","0","1082","<p>Hallo everybody,</p><p>I'd like to use black color as default text color only in one activity. </p><p>I guess, I should use Theme and Styles, but I didn't find any good information relating to my question or to only one activity.</p><p>Is it possible to change default text color only for one activity?</p><p>If yes, could you give me an example please, how to do this?</p><p>Mur</p>","408780","","","","","2010-09-30 11:38:07","Android. Default text color","<android><android-layout>","1","0","","",""
"3830078","1","","","2010-09-30 11:23:01","-1","246","<p>Apparently my app needs 2.5 MB (maybe because my photos need 2MB...) and then virtual device can't work with that much MB. </p><p>How can I make my virtual device support more than 2.5 MB to get my application working?</p>","462055","","140185","","2010-09-30 11:27:03","2010-09-30 17:00:45","How I can make my virtual device support applications that require more than 2.5MB?","<android><virtual><device>","1","5","","",""
"3830149","1","","","2010-09-30 11:36:41","16","20080","<p>I am trying to develop an app which can display the schools and airports in the locality. I found that using Google Places API is the way to go...</p><p>I have seen the <a href=""http://code.google.com/apis/maps/documentation/places/"">documentation here</a>... But anyone could please simply the use of the API. Any tutorials or samples will be of great help... Plz help guys..</p>","303155","","","","","2013-10-28 10:58:57","Using Google Places API in Android","<android><api>","5","2","13","",""
"3830184","1","3830573","","2010-09-30 11:43:24","3","5564","<p>I am a beginner to android, i am building a application in which when the user presses a button, the contacts which is stored in the mobile are shown. When he selects a contact from that, i have to get the selected contact name and number. I tried using the code but only the name of the selected contact is shown and not the phone number. </p><pre><code>public void readcontact(){    try {        Intent intent = new Intent(Intent.ACTION_PICK, Uri.parse(""content://contacts/people""));        startActivityForResult(intent, PICK_CONTACT);    } catch (Exception e) {            e.printStackTrace();      }}public void onActivityResult(int reqCode, int resultCode, Intent data) {      super.onActivityResult(reqCode, resultCode, data);      switch (reqCode) {        case (PICK_CONTACT) :          if (resultCode == Activity.RESULT_OK) {              Uri contactData = data.getData();                Cursor c =  managedQuery(contactData, null, null, null, null);                startManagingCursor(c);                if (c.moveToFirst()) {                  String name = c.getString(c.getColumnIndexOrThrow(People.NAME));                    String number = c.getString(c.getColumnIndexOrThrow(People.NUMBER));                  perrsonname.setText(name);                  Toast.makeText(this,  name + "" has number "" + number, Toast.LENGTH_LONG).show();                 }           }         break;      }  }</code></pre><p>I even need the additional number(home,office etc.,)of the selected contacts,  Can anyone help me out with this. Suggestions on this is appreciable.</p>","431655","","","","","2013-11-07 14:48:30","In Android, how to pick a contact and display it on my app?","<android><contacts>","5","1","0","",""
"3830198","1","","","2010-09-30 11:44:55","1","364","<p>I have a task to send an email by using intent without using xml layout,it works fine but here my issue is to change the keypad appears with enter option  by default but here i need it to replace done option.How can i get it?</p><p>Here my code:</p><pre><code> Intent sendIntent = new Intent(Intent.ACTION_SEND);            sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            sendIntent.putExtra(Intent.EXTRA_SUBJECT, ""Brown University: ""                    + gTitle_val);            sendIntent.putExtra(Intent.EXTRA_TEXT, Html                    .fromHtml(""&lt;p&gt;&lt;a href=\"""" + gLink_web_url_val + ""\""&gt;""                            + gTitle_val + ""&lt;/a&gt;&lt;/p&gt;&lt;br&gt;&lt;p&gt;"" + gContent_val                            + ""&lt;/p&gt;""));            sendIntent.setType(""vnd.android.cursor.dir/email"");            startActivity(Intent.createChooser(sendIntent, ""Email:""                    + gTitle_val));</code></pre>","393953","","119895","","2010-09-30 13:08:39","2010-09-30 13:08:39","how to change default virtual keyboard of device","<android>","0","2","1","",""
"3830248","1","3830283","","2010-09-30 11:53:19","0","4102","<p>I found something weired in my application. I created a table with a column named <code>type</code> which should store integers:</p><pre><code>db.execSQL(""CREATE TABLE "" + CellColumns.TABLE + "" (""    + CellColumns._ID + "" INTEGER PRIMARY KEY,""
    + CellColumns.TYPE + "" INTEGER,"" // &lt;-- this    + CellColumns.CELL_ID + "" INTEGER,""
    + CellColumns.CITY_ID + "" INTEGER,""
    + CellColumns.LOAD + "" INTEGER,""
    + CellColumns.ORIENTATION + "" INTEGER);"");</code></pre><p>Reading:</p><pre><code>String type = c.getString(c.getColumnIndex(CellColumns.TYPE));</code></pre><p>But somehow I always store strings into it without any problems (seems I forgot that this column was meant for integers). Also reading the strings with a query works. Is this dynamic ""type cast"" of a column a feature of sqlite? </p>","180538","","","","","2013-12-31 07:55:22","SQLite table with integer column stores string","<android><database><sqlite><types>","1","0","0","",""
"3830273","1","3961855","","2010-09-30 11:55:46","2","1313","<p>I have been trying to figure this out and know that overriding the volume keys is not the most ideal thing but its the one real buttons on every Android device which is needed for my application.  Currently I am overriding the volume keys with <code>dispatchKeyEvent</code> because <code>onKeyUp</code> and <code>onKeyDown</code> were not working.  Throughout the application there are little dialogs or context menus that pop up.  The problem is when those take focus I lose control of the volume buttons and it adjusts the main volume instead of acting like my button.  Is there any way to completely take over the volume buttons?  Any help would be appreciated.</p><p>-mlove</p>","441017","","","","","2010-10-18 17:49:25","Override volume key in Android in pop up menus/notifications","<android><volume>","1","0","1","",""
"3830372","1","","","2010-09-30 12:14:50","32","35221","<p>Can anyone please tell me the LIST OF DATATYPES in SQLITE supporting ANDROID.</p><p>I want to confirm about TIME and DATE datatypes.</p>","458787","","","","","2013-10-28 12:16:44","what are Datatypes in SQLite supporting android","<android><sqlite><types>","3","0","2","",""
"3830458","1","","","2010-09-30 12:28:15","0","873","<p>I have an ExpandableListActivity with a CursorTreeAdapter and CheckedTextView displayed.It's working fine on click (I have to toggle the CheckedTextView by hand but that's because this is an ExpandableListView) but when the adapter call requery on the cursor, items that are checked are not the right one (as equal as before).</p><p>Do you have any clue on what the problem is ?</p>","179872","","","","","2011-05-31 05:09:15","ExpandableListView and CheckedTextView strange behavior","<android><cursor><expandablelistview>","2","1","","",""
"3830549","1","3831194","","2010-09-30 12:41:18","0","377","<p>I have setup my default android Preferences with the necessary options. The prime reason of the Preferences are to allow users to manage their resources. In the context of my app, they are ""Contacts"", ""Types of projects"" and ""Currency"".</p><p>The ""Currency"" section works fine. The display just yet, not the programming. But what I really want to do is, when either of the ""Contacts"" or ""Type of projects"" is clicked, they should open another custom activity to let the user manage his contacts. These are by the way, not the android contacts. It is an activity connected to a database table allowing users to manage his contacts and his type of projects.</p><p>Any advise on this please? Perhaps, I shouldn't be using the default android preferences at all?</p><p>This is my XML code for the Preferences:</p><pre><code>&lt;PreferenceScreenxmlns:android=""http://schemas.android.com/apk/res/android""    &gt;&lt;PreferenceCategory    android:title=""Manage your resources""    &gt;        &lt;ListPreference             android:key=""contacts""            android:title=""Manage your Contacts""             android:summary=""Click here to ADD, EDIT and DELETE Contacts""    &gt;        &lt;/ListPreference&gt;        &lt;ListPreference            android:key=""projects""            android:title=""Types of Projects""            android:summary=""Click here to maintain a list of Types of Projects that match your profession""    &gt;        &lt;/ListPreference&gt;        &lt;ListPreference            android:key=""currency""            android:title=""Select currency""            android:summary=""Set a default currency that you wish to use"" android:entryValues=""@array/entryvalues_list_preference"" android:entries=""@array/entries_list_preference""&gt;        &lt;/ListPreference&gt;&lt;/PreferenceCategory&gt;</code></pre><p></p><p>Thanks in advance....</p>","450534","","","","","2010-09-30 13:53:07","New activity from default preferences","<android><android-intent><listactivity><android-preferences>","1","0","","",""
"3830735","1","3831471","","2010-09-30 13:05:35","2","731","<p>I'm attempting to replicate on android an iphone app my company had developed externally. </p><p>My need is simple but it seems hard to achieve under android. I have three numeric edittext inputs. Each should take only decimal numeric values. So numbers 0-9 and ""."" or "","". On the iphone this was achieved by a slide in calculator style keypad with one of the buttons a ""GO"" button that when pressed hides the keypad and, if all the inputs have valid values triggers a calculation that displays values on the screen. </p><p>I've tried the android phone input type and this is very close to what I want but I have no idea how to replicate the go button. I have put a calculate button on the main interface itself but I can't get the keyboard to go again once it is opened.</p><p>So can I either </p><p>A. Modify the layout of the phone keypad in some way to change one of the buttons to be    GO  (Calculate) and intercept the keypress or</p><p>B. Do I have to create my own keypad in which case how do I go about sliding it in and out    over the top of the current view?</p><p>thanks guys</p>","458872","","49246","","2010-11-13 10:38:38","2010-11-13 10:38:38","Android:I need a slide in calculator type soft keypad a la iphone","<android><calculator><ime><android-input-method><numeric-keypad>","1","0","","",""
"3830767","1","3831488","","2010-09-30 13:08:31","0","850","<p>I am looking for the solution to get contact details (Phone, Email, Zip) from the device. I have implemented code for OS 1.6 as well as for 2.2. I am building an application with API level 4 (1.6), but when I run the build in 2.2 device I am getting email and phone string null. </p><p><strong>CODE - for OS 1.6</strong> </p><pre><code>public void ImportCustomers(Context context) {  StringBuilder sFirstname = new StringBuilder();  StringBuilder sLastname = new StringBuilder();  StringBuilder sEmail = new StringBuilder();  StringBuilder sZip = new StringBuilder();  StringBuilder sCell = new StringBuilder();  String name, phoneNumber, email, emailid, contactDetails[];  contactDetails = new String[] { People._ID, People.NAME, People.NUMBER,    People.PRIMARY_EMAIL_ID };  Cursor contactCursor = context.getContentResolver().query(    People.CONTENT_URI, contactDetails, null, null, People.NAME);  while (contactCursor.moveToNext()) {   name = contactCursor.getString(contactCursor     .getColumnIndex(People.NAME));   phoneNumber = contactCursor.getString(contactCursor     .getColumnIndex(People.NUMBER));   emailid = contactCursor.getString(contactCursor     .getColumnIndex(People.PRIMARY_EMAIL_ID));   if (name.contains("" "")) {    sFirstname.append(""|"" + name.split(""\\ "")[0].trim());    sLastname.append(""|"" + name.split(""\\ "")[1].trim());   } else if (name.contains(""."")) {    sFirstname.append(""|"" + name.split(""\\."")[0].trim());    sLastname.append(""|"" + name.split(""\\."")[1].trim());   } else if (name.contains("","")) {    sFirstname.append(""|"" + name.split(""\\,"")[1].trim());    sLastname.append(""|"" + name.split(""\\,"")[0].trim());   } else {    sFirstname.append(""|"" + name);    sLastname.append(""|Unknown"");   }   if (emailid != null) {    Cursor emailCur = context.getContentResolver().query(      Contacts.ContactMethods.CONTENT_EMAIL_URI, null,      People.PRIMARY_EMAIL_ID + "" = ?"",      new String[] { emailid }, null);    while (emailCur.moveToNext()) {     email = emailCur.getString(emailCur       .getColumnIndex(Contacts.ContactMethods.DATA));     sEmail.append(""|"" + email);     break;    }    emailCur.close();    emailCur = null;   } else    sEmail.append(""|"");   sCell.append(""|"" + (phoneNumber == null ? """" : phoneNumber));   sZip.append(""|"");  }  contactCursor.close();  contactCursor = null;  if (sFirstname.toString().length() == 0) {   sFirstname.append(""|"");   sLastname.append(""|"");   sCell.append(""|"");   sEmail.append(""|"");   sZip.append(""|"");  }</code></pre><p><strong>CODE - for OS 2.2</strong> </p><pre><code>private void populateContacts() {  ContentResolver cr = getContentResolver();  Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null,    null, null, null);  if (cur.getCount() &gt; 0) {   while (cur.moveToNext()) {    // ID AND NAME FROM CONTACTS CONTRACTS    String id = cur.getString(cur      .getColumnIndex(ContactsContract.Contacts._ID));    String name = cur      .getString(cur        .getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));    Log.i(""Pratik"", ""ID :"" + id);    Log.i(""Pratik"", ""NAME :"" + name);    // GET PHONE NUMBERS WITH QUERY STRING    if (Integer      .parseInt(cur        .getString(cur          .getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))) &gt; 0) {     Cursor pCur = cr.query(       ContactsContract.CommonDataKinds.Phone.CONTENT_URI,       null,       ContactsContract.CommonDataKinds.Phone.CONTACT_ID         + "" = ?"", new String[] { id }, null);     // WHILE WE HAVE CURSOR GET THE PHONE NUMERS     while (pCur.moveToNext()) {      // Do something with phones      String phone = pCur        .getString(pCur          .getColumnIndex(ContactsContract.CommonDataKinds.Phone.DATA));      String phoneType = pCur        .getString(pCur          .getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));      Log.i(""Pratik"", ""PHONE :"" + phone);      Log.i(""Pratik"", ""PHONE TYPE :"" + phoneType);     }     pCur.close();    }    //WHILE WE HAVE CURSOR GET THE EMAIL     Cursor emailCur = cr.query(      ContactsContract.CommonDataKinds.Email.CONTENT_URI,      null, ContactsContract.CommonDataKinds.Email.CONTACT_ID        + "" = ?"", new String[] { id }, null);    while (emailCur.moveToNext()) {     // This would allow you get several email addresses     // if the email addresses were stored in an array     String email = emailCur       .getString(emailCur         .getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA));     String emailType = emailCur       .getString(emailCur         .getColumnIndex(ContactsContract.CommonDataKinds.Email.TYPE));     Log.i(""Pratik"", ""EMAIL :"" + email);     Log.i(""Pratik"", ""EMAIL TYPE :"" + emailType);    }    emailCur.close();    //FOR GETTTING ZIP &amp; POSTAL    String addrWhere = ContactsContract.Data.CONTACT_ID + "" = ? AND "" + ContactsContract.Data.MIMETYPE + "" = ?"";     String[] addrWhereParams = new String[]{id,      ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE};     Cursor addrCur = cr.query(ContactsContract.Data.CONTENT_URI,                    null, addrWhere, addrWhereParams, null);     while(addrCur.moveToNext()) {     String poBox = addrCur.getString(                        addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.POBOX));      String street = addrCur.getString(                        addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.STREET));      String city = addrCur.getString(                        addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.CITY));      String state = addrCur.getString(                        addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.REGION));      String postalCode = addrCur.getString(                        addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE));      String country = addrCur.getString(                        addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.COUNTRY));      String type = addrCur.getString(                        addrCur.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.TYPE));      Log.i(""Pratik"", ""POBOX :"" + poBox);     Log.i(""Pratik"", ""STREET :"" + street);     Log.i(""Pratik"", ""CITY :"" + city);     Log.i(""Pratik"", ""STATE :"" + state);     Log.i(""Pratik"", ""POSTALCODE :"" + postalCode);     Log.i(""Pratik"", ""COUNTRY :"" + country);     Log.i(""Pratik"", ""TYPE :"" + type);     }      addrCur.close();   }  } }</code></pre><p><strong>Here is the code snippet I have found</strong> </p><pre><code>public void ImportCustomer(Context context) {  int sdk = new Integer(Build.VERSION.SDK).intValue();  if (sdk &gt;= 5) {   try {    Class clazz = Class.forName(""android.provider.ContactsContract$Contacts"");    CONTENT_URI = (Uri) clazz.getField(""CONTENT_URI"").get(clazz);   } catch (Throwable t) {    Log.e(""PickDemo"", ""Exception when determining CONTENT_URI"", t);   }  } else {   CONTENT_URI = Contacts.People.CONTENT_URI;  }}</code></pre><p>Do anyone have suggestion how can I get contacts' information with help of this code snippet?</p><p>ThanksPratik Goswami </p>","309120","","","","","2011-06-29 16:48:25","Contact API problem for 1.6 & 2.2","<android><sdk><contacts>","1","0","","",""
"3830789","1","3831504","","2010-09-30 13:10:44","1","1438","<p>My question is, when you are in  a webView, and you have gone through several pages. </p><p>You want to go back. Is the last page you have been to cached, so that you would not need internet connection to go back?</p>","346583","","","","","2010-09-30 14:24:23","Android: when in web view: Does the browser cache the previous page?","<android><caching><webview>","1","0","","",""
"3830791","1","6916631","","2010-09-30 13:10:48","3","1019","<p>I want to add rows to a tablelayout dynamically. This is my code.</p><pre><code> TableRow tableRow = null; TextView textView = null; ImageView imageView = null; TableLayout tableLayout = (TableLayout)findViewById(R.id.tableLayout); RelativeLayout relativeLayout = null;         for (String string: listOfStrings) {                            tableRow = new TableRow(this);                            relativeLayout = (RelativeLayout) View.inflate(this,                                    R.layout.row, null);                            textView = (TextView) relativeLayout.getChildAt(0);                            textView.setText(string);                            imageView= (ImageView) relativeLayout.getChildAt(1);                            imageView.setBackgroundColor(R.color.blue);                            tableRow.addView(relativeLayout);                            tableLayout.addView(tableRow);                        }</code></pre><p>I have created a row layout with width fill_parent, with textView on left most side and an imageView on right most side. However when I run this program the row width appears wrap_content instead of fill_parent with image overlapping text. Please help. Thanks</p>","368084","","368084","","2010-09-30 13:25:21","2011-08-02 18:16:53","Dynamic creation of tablelayout android","<android>","1","0","","",""
"3830854","1","3830887","","2010-09-30 13:16:56","5","597","<p>I'm using Google Code to host my application code, its conveniant and the SVN repository means I don't have to worry about backups</p><p>When you create a project on there you need to select a license, I chose GNU GPL v3.</p><p>By doing so, does that prevent me from selling my application on the Android market place?</p>","155695","","","","","2011-08-19 15:43:55","If I license my app with GNU GPL3, does that prevent me from selling it on android market?","<android><licensing><android-2.2-froyo>","5","0","","",""
"3831019","1","3831066","","2010-09-30 13:36:17","8","31276","<p>I want to read a PDF file in android.I placed my PDF files in the assets folder.</p><p>How can i read the PDF file from there?</p><p><a href=""http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android/"">PDF Reader Link</a></p><p>I have checked the above link but it does not work for me. It gives me an error saying that the Activity was not found.</p><p>And I also want to open a PDF file in WebView. So is it possible to read PDF in WebView?</p>","385343","","114066","","2010-10-11 11:46:32","2014-03-08 05:19:23","How to read a pdf in android","<android>","4","4","6","",""
"3831593","1","3831636","","2010-09-30 14:32:42","0","561","<p>Can I be notified of the following events for an Activity:</p><ul><li>screenSizeWillChange</li><li>screenSizeDidChange</li></ul><p>I realize that I can probably override the main View's <code>onSizeChanged()</code> and be notified when the View has changed, but how can I be notified when it's about to change?</p>","238849","","","","","2010-09-30 14:36:24","Be notified when an Activity's size is going to change, and when it has changed","<android>","1","0","0","",""
"3831740","1","3833283","","2010-09-30 14:48:31","0","1410","<p>I am trying to launch a new intent after I have loaded data.  I am using a handler that calls a method when the thread is complete and then in this method I am trying to launch a new Intent but my app is crashing every time.  I have narrowed it down to the Context variable in the Intent constructor.  Here is my code:</p><pre><code>/** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        pDialog = new ProgressDialog(this);        pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);        pDialog.setMessage(""Loading..."");        pDialog.setCancelable(false);        pDialog.show();        mHandler = new Handler();        checkUpdate.start();    }    private Thread checkUpdate = new Thread()    {     public void run()     {      try      {                        //Do some stuff          mHandler.post(showUpdate);      }      catch(Exception e)      {       //Error case      }     }    };    private final Context context = this;            private Runnable showUpdate = new Runnable()    {     public void run()     {      //Do post process      pDialog.dismiss();                    //This is the line it crashes on      Intent intent = new Intent(context, com.example.example1.TestListActivity.class);         startActivityForResult(intent, 0);     }    };</code></pre>","284757","","284757","","2010-09-30 14:54:46","2010-09-30 17:40:10","Cannot figure out the context when launching an Intent from within a thread completion method","<android><android-intent><context><runnable>","1","5","","",""
"3832001","1","3834071","","2010-09-30 15:14:44","0","2470","<p>I am working on horizontal menu that will open on top of the screen.Layout is something like following,</p><p>|| &lt; || Menu Item1 || Menu Item2 || Menu Item3 || > ||</p><p>I want to put this on top of the screen. It can have more than 3 menuitem and it can traverse through previous and next arrow.I started with like this,</p><ul><li><p>RelativeLayout ( width - fill_parent)</p><ul><li>Gallery View ( Here i appended adapter )</li></ul></li></ul><p>There is two problem,- Gallery view contains the space before and after- While scrolling its item gets selected</p><p>Though its not ideal solution for this. How can i build customcomponent like this ?Any help appreciated.</p><p>Thanks</p>","266097","","","","","2011-01-04 10:34:02","How to create horizontal menu in android?","<android><user-interface><custom-controls><android-widget>","3","0","","",""
"3832150","1","","","2010-09-30 15:30:14","0","231","<p>Is it possible to place an imageView in a class that extends View in android?If possible please give me a sample code.Thanks.</p>","655814","","","","","2010-09-30 16:51:49","Is it possible to place an imageView in a class that extends View?","<android>","1","1","","",""
"3832254","1","3832467","","2010-09-30 15:40:51","7","7119","<p>Here is my ArrayAdapter. I would like to make this more efficient by following the ViewHolder pattern: </p><p><a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html</a></p><p>but am not sure how to accomplish this.    </p><p><strong>UPDATE: ViewHolder Pattern</strong></p><pre><code>private class QuoteAdapter extends ArrayAdapter&lt;Quote&gt; {    private ArrayList&lt;Quote&gt; items;    // used to keep selected position in ListView    private int selectedPos = -1; // init value for not-selected    public QuoteAdapter(Context context, int textViewResourceId, ArrayList&lt;Quote&gt; items) {        super(context, textViewResourceId, items);        this.items = items;    }    public void setSelectedPosition(int pos) {        selectedPos = pos;        // inform the view of this change        notifyDataSetChanged();    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View v = convertView;        ViewHolder holder; // to reference the child views for later actions        if (v == null) {            LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);            v = vi.inflate(R.layout.mainrow, null);            // cache view fields into the holder            holder = new ViewHolder();            holder.nameText = (TextView) v.findViewById(R.id.nameText);            holder.priceText = (TextView) v.findViewById(R.id.priceText);            holder.changeText = (TextView) v.findViewById(R.id.changeText);            // associate the holder with the view for later lookup            v.setTag(holder);        }        else {            // view already exists, get the holder instance from the view            holder = (ViewHolder)v.getTag();        }        // change the row color based on selected state        if (selectedPos == position) {            v.setBackgroundResource(R.drawable.stocks_selected_gradient);            holder.nameText.setTextColor(Color.WHITE);            holder.priceText.setTextColor(Color.WHITE);            holder.changeText.setTextColor(Color.WHITE);        } else {            v.setBackgroundResource(R.drawable.stocks_gradient);            holder.nameText.setTextAppearance(getApplicationContext(), R.style.BlueText);            holder.priceText.setTextAppearance(getApplicationContext(), R.style.BlueText);            holder.changeText.setTextAppearance(getApplicationContext(), R.style.BlueText);        }        Quote q = items.get(position);        if (q != null) {            if (holder.nameText != null) {                holder.nameText.setText(q.getSymbol());            }            if (holder.priceText != null) {                holder.priceText.setText(q.getLastTradePriceOnly());            }            if (holder.changeText != null) {                try {                    float floatedChange = Float.valueOf(q.getChange());                    if (floatedChange &lt; 0) {                        if (selectedPos != position)                            holder.changeText.setTextAppearance(getApplicationContext(), R.style.RedText); // red                    } else {                        if (selectedPos != position)                            holder.changeText.setTextAppearance(getApplicationContext(), R.style.GreenText); // green                    }                } catch (NumberFormatException e) {                    System.out.println(""not a number"");                } catch (NullPointerException e) {                    System.out.println(""null number"");                }                holder.changeText.setText(q.getChange() + "" ("" + q.getPercentChange() + "")"");            }        }        return v;    }}</code></pre>","19875","","19875","","2010-09-30 16:31:01","2013-10-10 18:45:06","How can I make my ArrayAdapter follow the ViewHolder pattern?","<java><android><listview><android-arrayadapter>","1","1","4","",""
"3832367","1","3833144","","2010-09-30 15:51:14","0","2628","<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;PreferenceCategory android:title=""Notifications""&gt;    &lt;CheckBoxPreference             android:key=""vibration""            android:title=""Vibrate""             android:summary=""Vibrate phone for notifications"" /&gt;    &lt;CheckBoxPreference             android:key=""play_tone""            android:title=""Play Ringtone""             android:summary=""Play Ringtone for notifications"" /&gt;    &lt;RingtonePreference            android:key=""app_ringtone""            android:dependency=""play_tone""            android:title=""Select Ringtone""            android:ringtoneType=""notification""            android:showDefault=""true""            android:shouldDisableView=""true""            android:summary=""Pick a Ringtone"" /&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>This is my preference xml. But,</p><pre><code>SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);prefs.getString(""app_ringtone"", null);</code></pre><p>always returns null. I am debugging on a device (HTC Wildfire).</p>","421372","","","","","2012-05-18 06:18:30","RingtonePreference is always null :(","<android><sharedpreferences>","3","3","1","",""
"3832479","1","3833888","","2010-09-30 16:01:55","4","7208","<p>How can I build and signed (keystore) the .apk file using 'apkbuilder.bat' via windows command-line ?</p><p>I try to run the following line:</p><pre><code>apkbuilder.bat %APK_File_Name% -u -z %Project_Path%\bin\resources.ap_ -f %Project_Path%\bin\classes.dex -rf %Project_Path%</code></pre><p>but I'm getting the following exception:</p><pre><code>java.lang.ArrayIndexOutOfBoundsException: 1 at com.android.sdklib.build.ApkBuilderMain.main&lt;ApkBuilderMain.java:61&gt;</code></pre><p>Please help. Thanks</p>","769647","","","","","2010-09-30 18:58:16","How to build .apk file from Windows command-line?","<android><apk>","2","4","","",""
"3832600","1","","","2010-09-30 16:15:10","0","212","<p>I am using the following snippet for screen orientation in android..</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //setContentView(R.layout.main);    // ---change to landscape mode---    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);    // ---change to portrait mode---    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);}</code></pre><p>}</p><p>This snippet is working with in application..and its not working in SDK 1.5..</p><p>My question is is there anyway to do screen orientation out side the application..ie for example if i use the timer and came out of my application i cannot see any orientation...but when i am clicking on my application again then i can see screen orientation..Is there any way to do screen Orientation out side the application through program..</p>","458295","","","","","2010-09-30 17:26:34","Orientation in android","<android>","1","0","","",""
"3832619","1","","","2010-09-30 16:17:23","10","30813","<p>I'm on a new android project - just a simple one.I have three ""tabs"" (activity1,2,3) with different tasks.</p><p>Anyways, how do I add these 3 activities do the AndroidManifest?</p><p>my manifest;</p><p>                                                                            </p><pre><code>&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""4"" /&gt;</code></pre><p> </p><p>Yeah, so where do i put it in?</p>","447595","","","","","2014-03-02 15:15:33","Add a new activity to the AndroidManifest?","<eclipse><android>","2","0","4","",""
"3832629","1","3839350","","2010-09-30 16:18:17","0","234","<p>I use in the getView()-Method of <a href=""http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/"" rel=""nofollow"">this example</a> a static function to download the source of an ImageView. Later there will be threading included. However, I like to know in general how save the use of static function is in this case.</p><p>Because I experienced, that in some cases (when I scroll really fast) the Images get mixed up. </p><pre><code>    /**    * Is called, when the ListAdapter requests a new ListItem, when scrolling. Returns a listItem (row)    */        public View getView(int position, View convertView, ViewGroup parent) {                        View v = convertView;                        if (v == null) {                            LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);                            v = vi.inflate(R.layout.row, null);                        }                        Order o = items.get(position);                        if (o != null) {                                TextView tt = (TextView) v.findViewById(R.id.toptext);                                if (tt != null) {                                      tt.setText(""Name: ""+o.getOrderName());                            }//At this point I use a static function to download the bitmap to set it as source of an ImageView                        }                        return v;                }</code></pre>","433718","","241590","","2010-09-30 16:26:17","2010-10-01 12:58:48","What are the pitfalls when using static functions? Like in this Android code","<java><android><listadapter><expandablelistadapter><static-function>","3","1","2","",""
"3832653","1","3861280","","2010-09-30 16:20:32","1","521","<p>is there any Java validator libraries i can use to validate text input from an android app?</p><p>i know that in spring there are validators for various different types such as checking if a value is a int, if a value is a valid email, etc etc.</p><p>Anything similar in core java or even android?</p><p>cheers in advance. i dont want to re-invent the wheel if its already been implemented. i could always sue java reg expressions to construct my own ones but was wondering if their was one done specifically for email formats.</p>","444668","","","","","2012-11-02 06:05:12","Java validators?","<java><android>","4","2","","",""
"3832697","1","","","2010-09-30 16:25:53","1","1158","<p>I've downloaded the source for both google's default home screen and adw.  I created a project in Eclipse and used those sources.  However, I can not compile the code as there are quite a few errors.  Does anyone know how to do this correctly?  Do I need to add all of the google code to my project?(I asked the same question in another thread, <a href=""http://stackoverflow.com/questions/3666771/how-to-create-a-custom-home-screen-replacement-application-on-android"">link text</a> )</p><p>Thanks</p>","43712","","","","","2010-09-30 16:29:48","How to create custom home screen","<android><eclipse>","1","0","","",""
"3832834","1","","","2010-09-30 16:43:52","1","140","<p>I have an app that allows you to record short voice memos. Some users aren't able to record any audio(LG Ally being one device) at all. I'm using the MediaRecorder in android and am curious if there might be a ""better"" standard way to handle audio recording?</p>","361582","","","","","2010-09-30 16:43:52","Standard for recording audio on android phones?","<java><android>","0","2","","",""
"3832893","1","","","2010-09-30 16:50:23","17","8413","<p>I have the following hierarchy: <code>Activity</code> -> <code>PopupWindow</code> -> <code>CustomView</code></p><p>My the <code>PopupWindow</code> itself is a square, but transparent, so you can see the Activity sitting in the background. The <code>CustomView</code> is a circle embedded inside the PopupWindow.<img src=""http://i.stack.imgur.com/zFutR.png"" alt=""alt text""></p><p>What I have achieved so far is</p><ol><li>User clicks on green circle and I invoke ""some stuff""</li><li>User clicks outside of the <code>PopupWindow</code> and the touch event gets dispatched to the Activity.</li></ol><p>The missing part is now, to dispatch any touch event that happens inside the <code>PopupWindow</code> but outside the <code>CustomView</code> (circle) to the Activity. </p><p>I already know how to sense when the touch is outside of my circle. I just have problems delegating it to the Activity.</p><p>In my <code>CustomView</code> I have the following in <code>onTouch</code></p><pre><code>if (radiusTouch &gt; maxRadius) {    return false;}</code></pre><p>In my <code>PopupWindow</code> I already setup the following, but it gets never called:</p><pre><code>popup.setTouchInterceptor(new OnTouchListener() {    @Override    public boolean onTouch(View v, MotionEvent event) {        Log.i(TAG, ""PopupWindow :: onTouch()"");        return false;    }});</code></pre><p>Anything else I have to do to delegate the touch event all the way to the Activity?</p>","184367","","421372","","2013-04-02 05:54:15","2013-04-02 05:54:15","Android: delegate touch event to underlaying view","<android><events><touch>","3","3","6","",""
"3832927","1","","","2010-09-30 16:54:27","0","740","<p>I open a new thread to talk about my problem :-) , I have problems with communication between ""service"" to the ""Activity""</p><p>what I have:I have a FTP download of a file that is downloaded in the background as a service! In the end I had a time X in a variable.furthermore it is checked whether the file is also fully load , I make it with  a simple comparison of the data size.</p><p>So I have a time 0s ""<strong>start time</strong>"" <code>12:22:00 up as 20sec</code> is ""<strong>end time</strong>"" <code>12:22:20</code>and a download size of 0Kb goes to 5000kb.</p><p>These values are defined in the service.</p><p>Project:</p><p>I want to show this graphically or via text  in the GUI of the activity .</p><p>like this: </p><p>File Download time: X secondsX seconds, will be scanned progressively and dynamically displayed. 1. sec, 2 sec ...... 20 sec</p><p>Download traffic: X kb of 5000 kb</p><p>Download rate is to be displayed: 0kb, 250 kb, 500 kb ..... 5000 kb.</p><p>Now my question:</p><p>how do I do that, which transfers the service these values to the activity!and how can I display in the activity ""dynamically and automatically.""</p><p>I thank  you all for your efforts</p>","463068","","750613","","2012-06-25 11:16:54","2013-03-05 16:06:04","how does communication between service and activity works?","<android>","2","0","1","",""
"3832959","1","","","2010-09-30 16:58:00","2","1800","<p>I have a setting in my app that allows user to select different localization (language), ie <code>Chinese, German, etc</code>. </p><p>What i would like to do is that once the user makes their choice, to immediately update the  layout with strings in the currently selected language. Of course, i want the lang change propagated to ALL current activities, without reloading the app.</p><p>I found this (havent tried yet), but was wondering if there is a cleaner way of doing it.</p><p><a href=""http://www.tutorialforandroid.com/2009/01/force-localize-application-on-android.html"" rel=""nofollow"">http://www.tutorialforandroid.com/2009/01/force-localize-application-on-android.html</a></p><p>Gracias</p>","450741","","750613","","2012-06-25 11:16:06","2013-06-07 10:48:23","android: reflect UI language change on the on-the-fly without reload/restarting app","<android><user-interface><layout><localization>","1","1","","",""
"3833057","1","3833281","","2010-09-30 17:10:22","0","220","<p>I am creating an Android application which will have some embedded music inside of it ( ~ 80 MB ). I was planning on putting it in the res/raw folder.</p><p>Since android stores that all in it's internal memory, is this way too large? What are my options? I have come up with the following:</p><ol><li>Copy resources out of internal storage and onto the SD card when application first starts. Afterwards remove from internal storage (is this possible?)</li><li>Download music from the web when the application first starts.</li></ol><p>I would really prefer not to have to go with option 2 since I want the app to be entirely offline and the static music is not going to change (except between releases).</p><p>Any other ideas?</p>","80617","","","","","2012-06-25 11:15:30","Android App Static Storage","<android><mp3><music><android-sdcard><static-resource>","2","0","","",""
"3833108","1","","","2010-09-30 17:16:09","1","5717","<p>I know this question has been asked and answered before, but after following all the instructions, I'm still having the same problem: I have a MapView in my Android application but the view is only showing the underlying grid (and overlays), but not the map itself.</p><p>I am building the project in Eclipse, if that makes a difference.</p><p>I have the following AndroidManifest.xml file:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""com.example.myapplication""      android:versionCode=""1""      android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".MyApplication""              android:label=""@string/app_name"" android:theme=""@android:style/Theme.NoTitleBar""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.LAUNCHER"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt; &lt;uses-library android:name=""com.google.android.maps""&gt;&lt;/uses-library&gt;</code></pre><p>     </p><p>Then in my shell, I ran the following command:<code>$ keytool -list -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android -keypass android</code></p><p>and got the following output:<code>androiddebugkey, Sep 23, 2010, PrivateKeyEntry, Certificate fingerprint (MD5): DF:69:80:83:16:1A:F0:E9:B9:07:B9:BD:F7:BC:DB:61</code></p><p>I went to <a href=""http://code.google.com/android/maps-api-signup.html"" rel=""nofollow"">http://code.google.com/android/maps-api-signup.html</a> and plugged the value <code>DF:69:80:83:16:1A:F0:E9:B9:07:B9:BD:F7:BC:DB:61</code> into the form, and got the following API key: <code>0peT6kQ21Tpd1Rs61gBHHtquJwDcNeKkqedT08g</code>.</p><p>My res/layout/main.xml file looks like this:</p><pre><code>&lt;com.google.android.maps.MapView xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/mapview"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:clickable=""true"" android:apiKey=""0peT6kQ21Tpd1Rs61gBHHtquJwDcNeKkqedT08g"" /&gt;</code></pre><p>And my MyApplication.java file looks like:    package com.example.myapplication;</p><pre><code>import android.os.Bundle;import com.google.android.maps.MapActivity;public class MyApplication extends MapActivity {    @Override public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    @Override protected boolean isRouteDisplayed( ) {        return false;    }}</code></pre><p>I deployed the project using Eclipse, and my AVD is compatible with the Google API 2.1-update1. I checked to make sure that project is signed, and the command <code>$ jarsigner -verify -verbose ~/workspace/MyApplication/bin/MyApplication.apk</code> returns the following output:</p><pre>sm      2200 Thu Sep 30 12:42:16 EDT 2010 res/drawable/icon.pngsm       676 Thu Sep 30 12:42:16 EDT 2010 res/layout/main.xmlsm      1796 Thu Sep 30 12:42:16 EDT 2010 AndroidManifest.xmlsm      1968 Thu Sep 30 12:42:16 EDT 2010 resources.arscsm      7816 Thu Sep 30 12:42:16 EDT 2010 classes.dex         646 Thu Sep 30 12:42:16 EDT 2010 META-INF/MANIFEST.MF         699 Thu Sep 30 12:42:16 EDT 2010 META-INF/CERT.SF         776 Thu Sep 30 12:42:16 EDT 2010 META-INF/CERT.RSA  s = signature was verified   m = entry is listed in manifest  k = at least one certificate was found in keystore  i = at least one certificate was found in identity scope</pre><p>I've given the application on the AVD about ten minutes now to load the map images and I'm not getting anything. The <code>adb logcat</code> isn't reporting any exceptions:</p><pre>I/ActivityManager(   56): Starting activity: Intent { cmp=com.example.myapplication/.MyApplication }E/ActivityThread(  259): Failed to find provider info for com.google.settingsE/ActivityThread(  259): Failed to find provider info for com.google.settingsW/MapActivity(  259): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher@43d1e3b8V/MapActivity(  259): Recycling map object.I/ActivityManager(   56): Displayed activity com.example.myapplication/.MyApplication: 376 ms (total 376 ms)</pre><p>Can anyone figure out what I'm doing wrong here? Any advice would be appreciated. Thanks.</p>","459550","","459550","","2010-09-30 17:21:37","2011-12-07 09:58:48","Android Google Maps not displaying","<android><google-maps>","4","2","","",""
"3833224","1","3833270","","2010-09-30 17:31:11","1","331","<p>I'm trying to read which ROM the user is using from my app.</p><p>It seems that this info can be seen in the phone's settings, in the About Phone setting under ""Build Number"".</p><p>How can I read this info with code?</p><p>Couldn't see it with <code>android.os.Build class</code>..</p><p>Thanks.</p>","445114","","750613","","2012-06-25 11:14:59","2012-06-25 11:14:59","How to read ""Builder Number"" from ""About Phone"" settings in android?","<android>","1","0","","",""
"3833226","1","","","2010-09-30 17:31:44","0","808","<p>I have a webview in my program. I loaded a string into this webview that contains javascript function. When i loaded it in the emulator it's not workingi.e if I write a simple alert the webView won't display the alert.I have enabled the javascript. But then also its not working.what may be the reason?Please helpThankyou</p>","655814","","750613","","2012-06-25 11:13:43","2012-06-25 11:13:43","javascript not working in android","<javascript><android><webview>","1","1","","",""
"3833503","1","","","2010-09-30 18:09:19","1","1312","<p>straight from <a href=""http://code.google.com/android/add-ons/google-apis/mapkey.html"" rel=""nofollow"">http://code.google.com/android/add-ons/google-apis/mapkey.html</a> it says:</p><p>To register for a Maps API Key, you need to provide an MD5 fingerprint of the certificate that you will use to sign your application. Before you visit the registration page, use Keytool to generate the fingerprint of the appropriate certificate.First, determine which key you will use to sign your application at release and make sure of the path to the keystore that contains it.Next, run Keytool with the -list option, against the target keystore and key alias. The table below lists the options you should use.</p><p>I dont understand the directions to do this.  I tried on the terminal using:</p><pre><code>keytool -genkey -v -keystore microjobs.keystore -alias mjkey -keyalg RSA</code></pre><p>and entered name, and city state then:</p><p>keytool -list</p><p>but it returns:</p><p>keytool error: java.lang.Exception: Keystore file exists, but is empty:</p><p>What should i do?</p><p>Thanks.</p>","463144","","750613","","2012-06-25 11:12:28","2012-06-25 11:12:28","android development, implementing google maps","<android><maps><keystore><keytool>","2","0","","",""
"3833542","1","","","2010-09-30 18:14:05","2","395","<p>I want to add syntax highlighting to my application.I'll be using syntax highlighting with PHP, HTML, CSS, XML and JavaScript.</p><p>How can I do this?I have a TextChanger set up on my EditText, which I want to use so that the syntax highlighting process occurs when the EditText gets changed.</p><p>I'm new to Android development and only know the basics.Thank you for reading.</p>","427234","","","","","2011-10-17 14:52:29","Android Development: How Can I Add Syntax Highlighting Features","<android><syntax-highlighting>","0","2","1","",""
"3833654","1","3900860","","2010-09-30 18:27:31","10","2223","<p>I guess you have all tried ""Google Places"" in Maps.This is a list of POI close to you.</p><p>I really would like to do the same feature in my application with a list of GPS coordinates, but that seem really complicated.</p><p>Making the listview with the distance and the little arrow is very easy, but I cannot understand how to update this list and the arrow everytime the user move his phone.</p><p>For now I have a static listview.</p><p><img src=""http://i.stack.imgur.com/XVfR1.jpg"" alt=""alt text""></p><p>I would like to know if someone succeed to create such a listview.</p><p>Thank a lot for any information.</p>","327402","","327402","","2010-10-16 15:52:50","2013-06-24 08:38:08","Android: compass + distance in a listview","<java><android><listview><gps><distance>","1","0","12","",""
"3833732","1","","","2010-09-30 18:38:43","0","719","<p>i try to build a ExpandableListView with a own ExpandableListAdapter but the ExpandableListView is not visible in my activity :-(</p><p>Below you find my Source-Code. </p><p>Thanks for your help :-)</p><p>Greetings,Kangee</p><p>Here the Code from the activity:</p><pre><code>    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.group_main);    onCreateDBAndDBTabled();    mAddGroupButton = (Button) findViewById(R.id.Button_Add_Group);    mAddGroupButton.setOnClickListener(this);    mExpandableList = (ExpandableListView) findViewById(R.id.ExpandableListView01);    ArrayList&lt;ExpandableListItem&gt; valueTree = new ArrayList&lt;ExpandableListItem&gt;();    ExpandableListItem gp1 = new ExpandableListItem();    gp1.putProperty(""name"", ""e"");    ExpandableListItem gp11 = new ExpandableListItem();    gp11.putProperty(""name"", ""l"");    gp1.addChild(gp11);    ExpandableListItem gp2 = new ExpandableListItem();    gp2.putProperty(""name"", ""A"");    ExpandableListItem gp22 = new ExpandableListItem();    gp22.putProperty(""name"", ""B"");      ExpandableListItem gp23 = new ExpandableListItem();    gp23.putProperty(""name"", ""A1"");    ExpandableListItem gp24 = new ExpandableListItem();    gp24.putProperty(""name"", ""A3"");    ExpandableListItem gp25 = new ExpandableListItem();    gp25.putProperty(""name"", ""A4"");    gp2.addChild(gp22);    gp2.addChild(gp23);    gp2.addChild(gp24);    gp2.addChild(gp25);    valueTree.add(gp1);    valueTree.add(gp2);    Log.d(""onCreate"", ""hasChild "" + gp1.hasChilds());    Log.d(""onCreate"", ""hasChild "" + gp2.hasChilds());    MyColoredExpandableListAdapter adapter = new MyColoredExpandableListAdapter(this, valueTree);    mExpandableList.setAdapter(adapter);}</code></pre><p>Code MyColoredExpandableListAdapter:</p><pre><code>private class MyColoredExpandableListAdapter extends MyExpandableListAdapter{    public MyColoredExpandableListAdapter(Context context,            ArrayList&lt;ExpandableListItem&gt; valueTree) {        super(context, valueTree);        Log.d(""MyColoredExpandableListAdapter"", ""Group Count"" + this.getGroupCount());        for(int i = 0; i &lt; this.getGroupCount(); i++)            Log.d(""MyColoredExpandableListAdapter"", ""Child Count"" + this.getChildrenCount(i));        // TODO Auto-generated constructor stub    }    public View getChildView(int groupPosition, int childPosition,            boolean isLastChild, View convertView, ViewGroup parent) {        // TODO Auto-generated method stub        Log.d(""getChildView"", ""GO INTO"");        if(convertView == null){            LayoutInflater inflater = LayoutInflater.from(mContext);            convertView = inflater.inflate(R.layout.group_exp_childs, null);        }            TextView text = (TextView) convertView.findViewById(R.id.TextView_Group_EXP_Childs);            text.setText(""&gt;&gt;"" + this.mValueTree.get(groupPosition).getChild(childPosition).getProperty(""name""));        return convertView;    }    public View getGroupView(int groupPosition, boolean isExpanded,            View convertView, ViewGroup parent) {        // TODO Auto-generated method stub            Log.d(""getGroupView"", ""GO INTO"");            if(convertView == null){                LayoutInflater inflater = LayoutInflater.from(mContext);                convertView = inflater.inflate(R.layout.group_exp_childs, null);            }            TextView text = (TextView) convertView.findViewById(R.id.TextView_Group_EXP_Childs);            text.setText(""&gt;"" + this.mValueTree.get(groupPosition).getProperty(""name""));        return convertView;    }}</code></pre><p>Code MyExpandableListAdapter:</p><pre><code>public abstract class MyExpandableListAdapter extends BaseExpandableListAdapter {protected Context mContext;protected ArrayList&lt;ExpandableListItem&gt; mValueTree;public MyExpandableListAdapter(Context context,         ArrayList&lt;ExpandableListItem&gt; valueTree){    mContext = context;    mValueTree = valueTree;}public Object getChild(int groupPosition, int childPosition) {    // TODO Auto-generated method stub    if(mValueTree.get(groupPosition).hasChilds())        return mValueTree.get(groupPosition).getChild(childPosition);    return null;}public long getChildId(int groupPosition, int childPosition) {    // TODO Auto-generated method stub    return childPosition; // WE NEED NO SPECIAL ID }public int getChildrenCount(int groupPosition) {    // TODO Auto-generated method stub    if(mValueTree.get(groupPosition).hasChilds())        return mValueTree.get(groupPosition).sizeOfChilds();    return 0;}public Object getGroup(int groupPosition) {    // TODO Auto-generated method stub    return mValueTree.get(groupPosition);}public int getGroupCount() {    // TODO Auto-generated method stub    return mValueTree.size();}public long getGroupId(int groupPosition) {    // TODO Auto-generated method stub    return groupPosition; // WE NEED NO SPECIAL ID }public boolean hasStableIds() {    // TODO Auto-generated method stub    return false;}public boolean isChildSelectable(int groupPosition, int childPosition) {    // TODO Auto-generated method stub    return true;}</code></pre><p>}</p><p>Code ExpandableListItem:</p><pre><code>public class ExpandableListItem {private HashMap&lt;String,String&gt; properties = new HashMap&lt;String,String&gt;();public void clearProperties() {    properties.clear();}public boolean containsPropertyKey(String key) {    return properties.containsKey(key);}public boolean containsPropertyValue(String value) {    return properties.containsValue(value);}public String getProperty(String key) {    return properties.get(key);}public boolean hasProperties() {    return !properties.isEmpty();}public String putProperty(String key, String value) {    return properties.put(key, value);}public String removeProperty(String key) {    return properties.remove(key);}public int sizeOfProperties() {    return properties.size();}public String[] propertiesKeys(){    int count = 0;    String[] result = new String[sizeOfProperties()];    for(String key : this.properties.keySet())        result[count++] = key;    return result;}private ArrayList&lt;ExpandableListItem&gt; childs = new ArrayList&lt;ExpandableListItem&gt;();public boolean addChild(ExpandableListItem object) {    return childs.add(object);}public void clearChilds() {    childs.clear();}public ExpandableListItem getChild(int index) {    return childs.get(index);}public boolean hasChilds() {    return !childs.isEmpty();}public ExpandableListItem removeChild(int index) {    return childs.remove(index);}public int sizeOfChilds() {    return childs.size();}</code></pre><p>}</p>","463169","","463169","","2010-09-30 18:44:21","2012-06-25 10:55:05","Android ExpandableListView does not work (Black/Empty Screen)","<android><screen><adapter><expandablelistview>","1","0","1","",""
"3833857","1","3834952","","2010-09-30 18:54:31","3","4350","<p>I have a ListView inside of a ViewFlipper which I am flipping when the user swipes across the screen. Clicking on a ListView will open the browser. Sometimes when I am swiping, it gets detected as a touch on the ListView and will open the browser. This can be annoying. How can I prevent this from happening?</p><pre><code>class MyGestureDetector extends SimpleOnGestureListener {        @Override        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {            try {                if (Math.abs(e1.getY() - e2.getY()) &gt; SWIPE_MAX_OFF_PATH)                    return false;                // right to left swipe                if (e1.getX() - e2.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                    viewFlipper.setInAnimation(slideLeftIn);                    viewFlipper.setOutAnimation(slideLeftOut);                    viewFlipper.showNext();                } else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                    viewFlipper.setInAnimation(slideRightIn);                    viewFlipper.setOutAnimation(slideRightOut);                    viewFlipper.showPrevious();                }                if (viewFlipper.getDisplayedChild() == 0) {                    // TODO: light up left                    flipperPosition = 0;                } else if (viewFlipper.getDisplayedChild() == 1) {                    // TODO: light up middle                    flipperPosition = 1;                } else if (viewFlipper.getDisplayedChild() == 2) {                    // TODO: light up right                    flipperPosition = 2;                }            } catch (Exception e) {                System.out.println(e);            }            return false;        }    }protected MotionEvent downStart = null;          public boolean onInterceptTouchEvent(MotionEvent event) {              switch(event.getAction()) {              case MotionEvent.ACTION_DOWN:                  // keep track of the starting down-event                  downStart = MotionEvent.obtain(event);                  break;              case MotionEvent.ACTION_MOVE:                  // if moved horizontally more than slop*2, capture the event for ourselves                  float deltaX = event.getX() - downStart.getX();                  if(Math.abs(deltaX) &gt; ViewConfiguration.getTouchSlop() * 2)                      return true;                  break;              }              // otherwise let the event slip through to children              return false;          }  </code></pre>","19875","","19875","","2010-09-30 22:47:06","2010-09-30 22:47:06","How to differentiate between a fling and a touch?","<java><android><listview><gesture-recognition><viewflipper>","2","2","6","",""
"3833892","1","3834232","","2010-09-30 18:58:33","0","1604","<p>I have an interesting problem and I was looking for a solution; Hoping that someone here can help me out.</p><p>(I did read through related questions on this topic but they have solutions which are not relevant to my situation).</p><p>Details are:</p><p>I have two activities. One is a simple list view to list available audio tracks. Another is a complex audio toolbar with controls to play/pause, ffd, and rewing the currently playing audio.</p><p>The audio toolbar uses a wrapper class that wraps the Android MediaPlayer object and this wrapper class is a singleton object. Which means that I eventually wish to use the audio toolbar anywhere in my app and control the singleton instance of my MediaPlayer wrapper.</p><p>For this reason, I cannot have the audio toolbar and the audio listview in the same activity since I want the toolbar to be a seperate entity altogether that pops up whenever the user wants to control the music, without having to see the listview.</p><p>Now, since the user would pop up the toolbar from anywhere in the app, I would love to know of a way to combine the current activity and the toolbar activity into one screen.</p><p>I do know that one option available to me is dialogs. I was looking for a more elegant solution where I could have the audio toolbar pop up at the bottom of the screen the user is on, without exiting the activity he is currently doing.</p><p>Anyone know of a way to do this? I didn't come across anything for this in the docs but if someone does know, even pointing me to the correct docs would be extremely useful :)</p><p>Thanks!</p>","392178","","","","","2010-09-30 19:43:44","Showing multiple activities on one screen?","<android><activity><android-intent>","2","0","","",""
"3833939","1","3834028","","2010-09-30 19:04:00","0","209","<p><img src=""http://i.stack.imgur.com/wCx4Q.png"" alt=""alt text""></p><p>Right-most textview is causing some alignment issues. I'm not sure how I can alleviate this?</p>","19875","","","","","2010-09-30 19:33:15","How can I improve the alignment of my TextView?","<android><layout><alignment><textview>","2","0","","",""
"3833989","1","","","2010-09-30 19:11:58","1","570","<p>Hello i have app which ask every 5second for GPS position but it allways returns same position. I have tried substitite position in DDMS or by telnet (geo fix ... ...)But allway it return initial postion. <strong>Whats wrong?</strong></p><pre><code>public class App09_GPS_RepeatedAsking extends Activity {TextView tv1;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tv1 = (TextView) findViewById(R.id.textview);    Timer timer = new Timer();    timer.scheduleAtFixedRate(new TimerTask() {        Handler mHandler = new Handler();        @Override        public void run() {              try{                mHandler.post(new Runnable(){                    @Override                    public void run() {                        LocationManager lm = (LocationManager)getSystemService(LOCATION_SERVICE);                        Criteria criteria = new Criteria();                        criteria.setAccuracy(Criteria.ACCURACY_FINE);                        criteria.setAltitudeRequired(false);                        criteria.setBearingRequired(false);                        criteria.setCostAllowed(true);                        criteria.setPowerRequirement(Criteria.POWER_LOW);                        String provider =lm.getBestProvider(criteria, false);                        //Location loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);                        Location loc = lm.getLastKnownLocation(provider);                        String Text = ""My current location is: "" + ""Latitud = "" + loc.getLatitude() + "" Longitud = "" + loc.getLongitude();                         Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_SHORT).show();                                         Log.v(""LOG"",Text);                }                );            }catch(Exception e){                Log.v(""LOG"",e.toString());            }        }    }, 0, 5000);       }}</code></pre>","461790","","246246","","2013-10-16 17:15:05","2013-10-16 17:15:05","Android Emulator substituting GPS position","<android><gps><emulator>","2","0","","",""
"3834104","1","","","2010-09-30 19:26:56","0","863","<p>I want to change the lower half of the screen when the user wipes with the finger, but got no idea how to start. The upper half with sone TextViews should stay fixed.Do I need more then one activity, or can I just change the layout portion on the lower half?</p><p>Thanks for any hint!</p>","458904","","","","","2010-09-30 19:46:16","Android: change display content when wipe on the screen","<android>","1","0","","",""
"3834129","1","3834235","","2010-09-30 19:32:04","3","2357","<p>I have an Android app where I've extended the base Application class in order to set up some global variables.</p><pre><code>public class MyApplication extends Application { private ArrayList&lt;ModelClass&gt; master_list; // global variable 1 private DataBaseHelper db_helper; // global variable 2 @Override public void onCreate() {  super.onCreate();  //do database work that will take about 5 seconds }}</code></pre><p>I'd like to show a splash screen to the user while the Application class is working (i.e. before my Main Activity is created).  Is there a way to do this?</p>","141146","","","","","2012-10-10 16:09:16","Android Splash screen for ""Application"" class","<android><activity><splash-screen>","4","0","","",""
"3834227","1","","","2010-09-30 19:43:26","4","1119","<p>I want to create a speech balloon type shape, where there is a rectangle or ellipse with a triangular shape jutting out of it.</p><p>How I'm attempting to do this is to create a Path object that combines the triangle with the other shape (round rect).</p><p>I'm doing it as follows:</p><pre><code>Path path = new Path();// Create triangular segmentPoint drawOffset = getAttributes().getDrawOffset();int leaderGap = getAttributes().getLeaderGapWidth();// Recall that we have a coordinate system where (0,0) is the// bottom midpoint of the annotation rectangle.// the point to left of gapint x1 = -leaderGap/2;int y1 = 0;// the point to right of gapint x2 = leaderGap/2;int y2 = 0;// The point where we're drawing to; the end of the pointy segment of triangleint x3 = -drawOffset.x;int y3 = drawOffset.y;path.moveTo(x2, y2);path.lineTo(x3, y3);path.lineTo(x1, y1);// path.close();// Add the rectangular portion to the pathpath.addRoundRect(backgroundShape, 5, 5, Path.Direction.CW);</code></pre><p>The problem is that the roundRect is a closed path, so its edge shows through underneath the triangular section.</p><p>A picture's worth a thousand words, so here you go:</p><p><img src=""http://i.stack.imgur.com/yLcYq.png"" alt=""Rounded balloon""></p><p>What I want is for the line segment between those two endpoints of the triangle to disappear, so that it looks like one seamless path.</p><p>If all I were doing were a straight rectangle, I could create the whole path myself from scratch.  But I'd like to do the rounded corners, and it'd be a bit of a paint to do that with the Path (yes I know you can do quad to and arcTo but it's still not as clean a solution as I'd like).</p><p>So in general, is it possible to combine two paths and create a single union object that traces the perimeter of both?</p>","155392","","","","","2011-08-03 02:14:13","Android: how to combine the paths of two shapes and remove overlap?","<android><graphics><path>","1","0","3","",""
"3834548","1","4392663","","2010-09-30 20:23:22","11","7261","<p>The following code works fine on Android 2.1update1 - </p><pre><code>package com.troubadorian.android.teststreaming;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.ViewGroup;import android.view.Window;import android.view.animation.AnimationUtils;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.Button;import android.widget.Gallery;import android.widget.ImageButton;import android.widget.ProgressBar;import android.widget.TextView;import android.widget.Toast;import android.widget.Gallery.LayoutParams;import android.widget.ImageSwitcher;import android.widget.ImageView;import android.widget.ViewSwitcher;public class TestStreaming extends Activity { private Button streamButton; private ImageButton playButton; private TextView textStreamed; private boolean isPlaying; private StreamingMediaPlayer audioStreamer; @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  // requestWindowFeature(Window.FEATURE_NO_TITLE);  setContentView(R.layout.main);  initControls(); } protected void onDestroy() {  super.onDestroy();  Toast.makeText(TestStreaming.this, ""...exiting application..."" ,Toast.LENGTH_SHORT).show();  if ( audioStreamer != null)   {   audioStreamer.interrupt();  } } private void initControls() {  textStreamed = (TextView) findViewById(R.id.text_kb_streamed);  streamButton = (Button) findViewById(R.id.button_stream);  streamButton.setOnClickListener(new View.OnClickListener()  {   public void onClick(View view)   {    String urlstring2 = ""url to a shoutcase stream"";    Toast    .makeText(      TestStreaming.this,       ""The following stream is about to start"" + urlstring2,         Toast.LENGTH_LONG).show();    startStreamingAudio(urlstring2);   }  });  playButton = (ImageButton) findViewById(R.id.button_play);  playButton.setEnabled(false);  playButton.setOnClickListener(new View.OnClickListener()  {   public void onClick(View view)   {    if (audioStreamer.getMediaPlayer().isPlaying())    {     audioStreamer.getMediaPlayer().pause();     playButton.setImageResource(R.drawable.button_play);    } else    {     audioStreamer.getMediaPlayer().start();     audioStreamer.startPlayProgressUpdater();     playButton.setImageResource(R.drawable.button_pause);    }    isPlaying = !isPlaying;   }  }); } private void startStreamingAudio(String urlstring) {  try {    final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progress_bar);   if ( audioStreamer != null) {    audioStreamer.interrupt();   }   audioStreamer = new StreamingMediaPlayer(this,textStreamed, playButton, streamButton,progressBar);   audioStreamer.startStreaming(urlstring,5208, 216);   streamButton.setEnabled(false);  } catch (Exception e)   {   Log.e(getClass().getName(), ""Error starting to stream audio."", e);                    } } public void onItemSelected(AdapterView parent, View v, int position, long id) {  mSwitcher.setImageResource(mImageIds[position]); } public void onNothingSelected(AdapterView parent) { } public View makeView() {  ImageView i = new ImageView(this);  i.setBackgroundColor(0xFF000000);  i.setScaleType(ImageView.ScaleType.FIT_CENTER);  i.setLayoutParams(new ImageSwitcher.LayoutParams(    LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));  return i; } private ImageSwitcher mSwitcher; public class ImageAdapter extends BaseAdapter {  public ImageAdapter(Context c)  {   mContext = c;  }  public int getCount()  {   return mThumbIds.length;  }  public Object getItem(int position)  {   return position;  }  public long getItemId(int position)  {   return position;  }  public View getView(int position, View convertView, ViewGroup parent)  {   ImageView i = new ImageView(mContext);   i.setImageResource(mThumbIds[position]);   i.setAdjustViewBounds(true);   i.setLayoutParams(new Gallery.LayoutParams(     LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));   i.setBackgroundResource(R.drawable.picture_frame);   return i;  }  private Context mContext; } private Integer[] mThumbIds = { R.drawable.calculator, R.drawable.calendar, R.drawable.camera }; private Integer[] mImageIds = { R.drawable.calculator, R.drawable.calendar, R.drawable.camera };}</code></pre><p>with the StreamingMediaPlayer class as follows - </p><pre><code>package com.troubadorian.android.teststreaming;import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.URL;import java.net.URLConnection;import android.content.Context;import android.media.AudioManager;import android.media.MediaPlayer;import android.os.Handler;import android.util.Log;import android.widget.Button;import android.widget.ImageButton;import android.widget.ProgressBar;import android.widget.TextView;/** * MediaPlayer does not yet support streaming from external URLs so this class * provides a pseudo-streaming function by downloading the content incrementally * &amp; playing as soon as we get enough audio in our temporary storage. */public class StreamingMediaPlayer{ private static final int INTIAL_KB_BUFFER = 96 * 10 / 8;// assume               // 96kbps*10secs/8bits               // per byte private TextView textStreamed; private ImageButton playButton; private ProgressBar progressBar; // Track for display by progressBar private long mediaLengthInKb, mediaLengthInSeconds; private int totalKbRead = 0; // Create Handler to call View updates on the main UI thread. private final Handler handler = new Handler(); private MediaPlayer mediaPlayer; private File downloadingMediaFile; private boolean isInterrupted; private Context context; private int counter = 0; public StreamingMediaPlayer(Context context, TextView textStreamed,   ImageButton playButton, Button streamButton, ProgressBar progressBar) {  this.context = context;  this.textStreamed = textStreamed;  this.playButton = playButton;  this.progressBar = progressBar; } /**  * Progressivly download the media to a temporary location and update the  * MediaPlayer as new content becomes available.  */ public void startStreaming(final String mediaUrl, long mediaLengthInKb,   long mediaLengthInSeconds) throws IOException {  this.mediaLengthInKb = mediaLengthInKb;  this.mediaLengthInSeconds = mediaLengthInSeconds;  Runnable r = new Runnable()  {   public void run()   {    try    {     downloadAudioIncrement(mediaUrl);    } catch (IOException e)    {     Log.e(getClass().getName(),       ""Unable to initialize the MediaPlayer for fileUrl=""         + mediaUrl, e);     return;    }   }  };  new Thread(r).start(); } /**  * Download the url stream to a temporary location and then call the  * setDataSource for that local file  */ public void downloadAudioIncrement(String mediaUrl) throws IOException {  URLConnection cn = new URL(mediaUrl).openConnection();  cn.connect();  InputStream stream = cn.getInputStream();  if (stream == null)  {   Log.e(getClass().getName(),     ""Unable to create InputStream for mediaUrl:"" + mediaUrl);  }  downloadingMediaFile = new File(context.getCacheDir(),    ""downloadingMedia.dat"");  // Just in case a prior deletion failed because our code crashed or  // something, we also delete any previously  // downloaded file to ensure we start fresh. If you use this code,  // always delete  // no longer used downloads else you'll quickly fill up your hard disk  // memory. Of course, you can also  // store any previously downloaded file in a separate data cache for  // instant replay if you wanted as well.  if (downloadingMediaFile.exists())  {   downloadingMediaFile.delete();  }  FileOutputStream out = new FileOutputStream(downloadingMediaFile);  byte buf[] = new byte[16384];  int totalBytesRead = 0, incrementalBytesRead = 0;  do  {   int numread = stream.read(buf);   if (numread &lt;= 0)    break;   out.write(buf, 0, numread);   totalBytesRead += numread;   incrementalBytesRead += numread;   totalKbRead = totalBytesRead / 1000;   testMediaBuffer();   fireDataLoadUpdate();  } while (validateNotInterrupted());  stream.close();  if (validateNotInterrupted())  {   fireDataFullyLoaded();  } } private boolean validateNotInterrupted() {  if (isInterrupted)  {   if (mediaPlayer != null)   {    mediaPlayer.pause();    // mediaPlayer.release();   }   return false;  } else  {   return true;  } } /**  * Test whether we need to transfer buffered data to the MediaPlayer.  * Interacting with MediaPlayer on non-main UI thread can causes crashes to  * so perform this using a Handler.  */ private void testMediaBuffer() {  Runnable updater = new Runnable()  {   public void run()   {    if (mediaPlayer == null)    {     // Only create the MediaPlayer once we have the minimum     // buffered data     if (totalKbRead &gt;= INTIAL_KB_BUFFER)     {      try      {       startMediaPlayer();      } catch (Exception e)      {       Log.e(getClass().getName(),         ""Error copying buffered conent."", e);      }     }    } else if (mediaPlayer.getDuration()      - mediaPlayer.getCurrentPosition() &lt;= 1000)    {     // NOTE: The media player has stopped at the end so transfer     // any existing buffered data     // We test for &lt; 1second of data because the media player     // can stop when there is still     // a few milliseconds of data left to play     transferBufferToMediaPlayer();    }   }  };  handler.post(updater); } private void startMediaPlayer() {  try  {   File bufferedFile = new File(context.getCacheDir(), ""playingMedia""     + (counter++) + "".dat"");   // We double buffer the data to avoid potential read/write errors   // that could happen if the   // download thread attempted to write at the same time the   // MediaPlayer was trying to read.   // For example, we can't guarantee that the MediaPlayer won't open a   // file for playing and leave it locked while   // the media is playing. This would permanently deadlock the file   // download. To avoid such a deadloack,   // we move the currently loaded data to a temporary buffer file that   // we start playing while the remaining   // data downloads.   moveFile(downloadingMediaFile, bufferedFile);   Log.e(getClass().getName(),     ""Buffered File path: "" + bufferedFile.getAbsolutePath());   Log.e(getClass().getName(),     ""Buffered File length: "" + bufferedFile.length() + """");   mediaPlayer = createMediaPlayer(bufferedFile);   // We have pre-loaded enough content and started the MediaPlayer so   // update the buttons &amp; progress meters.   mediaPlayer.start();   startPlayProgressUpdater();   playButton.setEnabled(true);  } catch (IOException e)  {   Log.e(getClass().getName(), ""Error initializing the MediaPlayer."",     e);   return;  } } private MediaPlayer createMediaPlayer(File mediaFile) throws IOException {  MediaPlayer mPlayer = new MediaPlayer();  mPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener()  {   public boolean onError(MediaPlayer mp, int what, int extra)   {    Log.e(getClass().getName(), ""Error in MediaPlayer: ("" + what      + "") with extra ("" + extra + "")"");    return false;   }  });  // It appears that for security/permission reasons, it is better to pass  // a FileDescriptor rather than a direct path to the File.  // Also I have seen errors such as ""PVMFErrNotSupported"" and  // ""Prepare failed.: status=0x1"" if a file path String is passed to  // setDataSource(). So unless otherwise noted, we use a FileDescriptor  // here.  FileInputStream fis = new FileInputStream(mediaFile);  mPlayer.setDataSource(fis.getFD());  mPlayer.prepare();  return mPlayer; } /**  * Transfer buffered data to the MediaPlayer. NOTE: Interacting with a  * MediaPlayer on a non-main UI thread can cause thread-lock and crashes so  * this method should always be called using a Handler.  */ private void transferBufferToMediaPlayer() {  try  {   // First determine if we need to restart the player after   // transferring data...e.g. perhaps the user pressed pause   boolean wasPlaying = mediaPlayer.isPlaying();   int curPosition = mediaPlayer.getCurrentPosition();   // Copy the currently downloaded content to a new buffered File.   // Store the old File for deleting later.   File oldBufferedFile = new File(context.getCacheDir(),     ""playingMedia"" + counter + "".dat"");   File bufferedFile = new File(context.getCacheDir(), ""playingMedia""     + (counter++) + "".dat"");   // This may be the last buffered File so ask that it be delete on   // exit. If it's already deleted, then this won't mean anything. If   // you want to   // keep and track fully downloaded files for later use, write   // caching code and please send me a copy.   bufferedFile.deleteOnExit();   moveFile(downloadingMediaFile, bufferedFile);   // Pause the current player now as we are about to create and start   // a new one. So far (Android v1.5),   // this always happens so quickly that the user never realized we've   // stopped the player and started a new one   mediaPlayer.pause();   // Create a new MediaPlayer rather than try to re-prepare the prior   // one.   mediaPlayer = createMediaPlayer(bufferedFile);   mediaPlayer.seekTo(curPosition);   // Restart if at end of prior buffered content or mediaPlayer was   // previously playing.   // NOTE: We test for &lt; 1second of data because the media player can   // stop when there is still   // a few milliseconds of data left to play   boolean atEndOfFile = mediaPlayer.getDuration()     - mediaPlayer.getCurrentPosition() &lt;= 1000;   if (wasPlaying || atEndOfFile)   {    mediaPlayer.start();   }   // Lastly delete the previously playing buffered File as it's no   // longer needed.   oldBufferedFile.delete();  } catch (Exception e)  {   Log.e(getClass().getName(),     ""Error updating to newly loaded content."", e);  } } private void fireDataLoadUpdate() {  Runnable updater = new Runnable()  {   public void run()   {    textStreamed.setText((totalKbRead + "" Kb read""));    float loadProgress = ((float) totalKbRead / (float) mediaLengthInKb);    progressBar.setSecondaryProgress((int) (loadProgress * 100));   }  };  handler.post(updater); } private void fireDataFullyLoaded() {  Runnable updater = new Runnable()  {   public void run()   {    transferBufferToMediaPlayer();    // Delete the downloaded File as it's now been transferred to    // the currently playing buffer file.    downloadingMediaFile.delete();    textStreamed      .setText((""Audio full loaded: "" + totalKbRead + "" Kb read""));   }  };  handler.post(updater); } public MediaPlayer getMediaPlayer() {  return mediaPlayer; } public void startPlayProgressUpdater() {  float progress = (((float) mediaPlayer.getCurrentPosition() / 1000) / mediaLengthInSeconds);  progressBar.setProgress((int) (progress * 100));  if (mediaPlayer.isPlaying())  {   Runnable notification = new Runnable()   {    public void run()    {     startPlayProgressUpdater();    }   };   handler.postDelayed(notification, 1000);  } } public void interrupt() {  playButton.setEnabled(false);  isInterrupted = true;  validateNotInterrupted(); } /**  * Move the file in oldLocation to newLocation.  */ public void moveFile(File oldLocation, File newLocation) throws IOException {  if (oldLocation.exists())  {   BufferedInputStream reader = new BufferedInputStream(     new FileInputStream(oldLocation));   BufferedOutputStream writer = new BufferedOutputStream(     new FileOutputStream(newLocation, false));   try   {    // byte[] buff = new byte[8192];    /* changing the size of the buffer */    byte[] buff = new byte[16384];    int numChars;    while ((numChars = reader.read(buff, 0, buff.length)) != -1)    {     writer.write(buff, 0, numChars);    }   } catch (IOException ex)   {    throw new IOException(""IOException when transferring ""      + oldLocation.getPath() + "" to ""      + newLocation.getPath());   } finally   {    try    {     if (reader != null)     {      writer.close();      reader.close();     }    } catch (IOException ex)    {     Log.e(getClass().getName(),       ""Error closing files when transferring ""         + oldLocation.getPath() + "" to ""         + newLocation.getPath());    }   }  } else  {   throw new IOException(     ""Old location does not exist when transferring ""       + oldLocation.getPath() + "" to ""       + newLocation.getPath());  } }}</code></pre><p>and the layout file as follows - </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;  &lt;LinearLayout android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:id=""@+id/Logo"" android:orientation=""vertical""&gt; &lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""10px""&gt; &lt;TextView   android:id=""@+id/text_kb_streamed""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:textStyle=""bold""    android:text=""...streaming audio...""/&gt;  &lt;Button android:id=""@+id/button_stream""   android:layout_width=""wrap_content""    android:layout_height=""wrap_content""   android:layout_marginTop=""10px""   style=""?android:attr/buttonStyleSmall""    android:text=""Start Streaming""/&gt; &lt;ProgressBar android:id=""@+id/progress_bar""      android:layout_width=""200px""    android:layout_height=""wrap_content""    android:layout_alignParentLeft=""true""    style=""?android:attr/progressBarStyleHorizontal""/&gt; &lt;ImageButton android:id=""@+id/button_play""     android:layout_width=""wrap_content""      android:layout_height=""wrap_content""     android:layout_marginTop=""5px""     style=""?android:attr/buttonStyleSmall""      android:src=""@drawable/button_pause""/&gt;&lt;/LinearLayout&gt;  &lt;/LinearLayout&gt;  &lt;ViewFlipper android:id=""@+id/MainFlipper"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:layout_below=""@+id/Logo"" android:layout_marginBottom=""37dip""&gt;  &lt;/ViewFlipper&gt;  &lt;FrameLayout android:id=""@+id/MediaPlayer"" android:layout_width=""fill_parent"" android:layout_height=""130dip"" android:layout_alignParentBottom=""true"" android:layout_centerHorizontal=""true""&gt;  &lt;/FrameLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>But the same code does not work in Android 2.2. Can it be fixed up to run on 2.2 ? </p><p>Here's the error I am getting -</p><pre><code>E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423): Error initializing the MediaPlayer.E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423): java.io.IOException: setDataSourceFD failed.: status=0x80000000E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.media.MediaPlayer.setDataSource(Native Method)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.media.MediaPlayer.setDataSource(MediaPlayer.java:749)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.troubadorian.android.teststreaming.StreamingMediaPlayer.createMediaPlayer(StreamingMediaPlayer.java:272)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.troubadorian.android.teststreaming.StreamingMediaPlayer.startMediaPlayer(StreamingMediaPlayer.java:237)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.troubadorian.android.teststreaming.StreamingMediaPlayer.access$2(StreamingMediaPlayer.java:212)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.troubadorian.android.teststreaming.StreamingMediaPlayer$2.run(StreamingMediaPlayer.java:190)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.os.Handler.handleCallback(Handler.java:587)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.os.Handler.dispatchMessage(Handler.java:92)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.os.Looper.loop(Looper.java:123)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.app.ActivityThread.main(ActivityThread.java:4627)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at java.lang.reflect.Method.invokeNative(Native Method)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at java.lang.reflect.Method.invoke(Method.java:521)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at dalvik.system.NativeStart.main(Native Method)I/global  ( 1423): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.I/global  ( 1423): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423): Buffered File path: /data/data/com.troubadorian.android.teststreaming/cache/playingMedia34.datE/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423): Buffered File length: 193188E/MediaPlayer( 1423): Unable to to create media playerE/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423): Error initializing the MediaPlayer.E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423): java.io.IOException: setDataSourceFD failed.: status=0x80000000E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.media.MediaPlayer.setDataSource(Native Method)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.media.MediaPlayer.setDataSource(MediaPlayer.java:749)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.troubadorian.android.teststreaming.StreamingMediaPlayer.createMediaPlayer(StreamingMediaPlayer.java:272)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.troubadorian.android.teststreaming.StreamingMediaPlayer.startMediaPlayer(StreamingMediaPlayer.java:237)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.troubadorian.android.teststreaming.StreamingMediaPlayer.access$2(StreamingMediaPlayer.java:212)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.troubadorian.android.teststreaming.StreamingMediaPlayer$2.run(StreamingMediaPlayer.java:190)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.os.Handler.handleCallback(Handler.java:587)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.os.Handler.dispatchMessage(Handler.java:92)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.os.Looper.loop(Looper.java:123)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at android.app.ActivityThread.main(ActivityThread.java:4627)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at java.lang.reflect.Method.invokeNative(Native Method)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at java.lang.reflect.Method.invoke(Method.java:521)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423):       at dalvik.system.NativeStart.main(Native Method)I/global  ( 1423): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.I/global  ( 1423): Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required.E/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423): Buffered File path: /data/data/com.troubadorian.android.teststreaming/cache/playingMedia35.datE/com.troubadorian.android.teststreaming.StreamingMediaPlayer( 1423): Buffered File length: 194588E/MediaPlayer( 1423): Unable to to create media player</code></pre><p>Please help.</p>","303347","","345717","","2011-01-22 01:22:37","2011-12-28 04:28:19","android code for streaming shoutcast stream breaks in 2.2","<android><audio-streaming><shoutcast>","2","5","11","",""
"3834562","1","3834673","","2010-09-30 20:25:51","0","2375","<p>How large should be the image in pixels to fit all resolutions?480x800 or 480x854?</p><p>I need to do different image resolutions for all folders:drawable-hdpi , drawable-ldpi, drawable-mdpi?and if so, which resolutions are used?</p><p>Thanks</p>","432848","","","","","2013-05-02 11:26:18","How to work with android different resolutions?","<android>","3","2","","",""
"3834610","1","","","2010-09-30 20:32:55","2","998","<p>How do you add a SurfaceView showing the camera preview as the background of the BaseGameActivity of AndEngine (Physics Example).</p><pre><code>@Override        public Scene onLoadScene() {                mBackgroundView = new PreviewView(this);                addContentView(mBackgroundView, new LayoutParams(                                LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));    // Does not work                addContentView(mBackgroundView.getOverlay(), new LayoutParams(                                    LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));   // Works. getOverlay() returns an ImageView.                final Scene scene = new Scene(1);                //scene.setBackground(new ColorBackground(0.0f, 0.0f, 0.0f, 0.0f));</code></pre>","356580","","310001","","2010-12-29 19:55:10","2010-12-29 19:55:10","AndEngine & SurfaceView (CameraPreview)","<android><game-engine><surfaceview><andengine>","0","0","1","",""
"3834741","1","3841150","","2010-09-30 20:50:00","8","18335","<p>I made an Android Hello world app and I'm trying to load it onto my HTC Incredible.  I believe it has 2.2 (how do I confirm that?)</p><p>Anyway, Eclipse gives me this message and then brings up the window in the screenshot below.</p><blockquote>  <p>Automatic Target Mode: Unable to  detect device compatibility. Please  select a target device.</p></blockquote><p>I'm on Ubuntu 64bit if that matters.  I did turn on USB debugging on the phone.  I told the phone to connect as a disk drive.</p><p>Any ideas how to get my app onto the phone?</p><p><strong>Update:</strong> Do I need to perform <a href=""http://developer.android.com/guide/developing/device.html"">these steps</a> since I'm on Ubuntu?  I doesn't mention what to do for Ubuntu 8.10 though.</p><p><img src=""http://i.stack.imgur.com/6L21F.png"" alt=""alt text""></p>","13009","","13009","","2010-09-30 23:56:57","2013-09-16 01:47:05","Android - How to load HelloWorld app onto my Phone?","<android><eclipse>","7","1","0","",""
"3834869","1","","","2010-09-30 21:09:22","0","2015","<p>I am using HTML5  element to play a sample.mp4. It plays fine if using HTTP protocol. If I change the URL to use HTTPS, it will give error ""Sorry, this video cannot be played."" The SSL certificate is valid. I have tried on both IIS and Apache server.</p><pre><code>&lt;video src=""sample.mp4"" id=""myvideo"" /&gt;&lt;a href=""javascript:void(0)"" onclick=""document.getElementById('myvideo').play();""&gt;Play&lt;/a&gt;</code></pre>","358537","","","","","2013-01-31 14:12:20","Android not playing HTML5 video on HTTPS","<android><video><html5><https>","3","3","","",""
"3834938","1","3835381","","2010-09-30 21:20:14","5","4454","<p>I wanted a numeric keypad that had a go or done button that closed and executed a calculation class. Thanks to a tip from commonware on where to start I got this working beautifully on the emulator. Then I came to load it on to my HTC desire for testing and it doesn't work at all. I'm sure it must be because of HTC sense having it's own ime but there must surely be a way to make this work on HTC phones? Anyone else managed to get around this issue?</p>","458872","","387076","","2012-05-12 20:19:09","2014-02-01 16:48:07","Android: softkeyboard control on HTC desire","<keyboard><htcsense><android>","3","0","0","",""
"3834950","1","3835235","","2010-09-30 21:23:12","1","911","<p>I'm looking for a way have some way of communication between an AIR application that runs on a desktop and an Android application (that obviously runs on a phone). Basically, I plan to make the desktop application controllable via an application on an Android phone.</p><p>Grant Skinner did a similar thing with his <a href=""http://www.gskinner.com/blog/archives/2010/06/androideroids.html"" rel=""nofollow"">Androideroids</a> game, which is playable via multiple Android devices on a central computer. Sadly he didn't tell anything about how he managed to do this.</p><p>What I would like to achieve is a communication via bluetooth and/or wifi; when the application is running, the phone will be in the same network as the desktop computer. Preferably I'm looking for a solution that allows running a native Android application on the phone, but if it works much easier with an AIR on Android app, I'm fine going that way too.</p><p>If required I am also willing to set up some service on the desktop computer that the Android app is communicating with which then relays the commands to the AIR application. But given that Flash supports p2p connections, I guess there is an easier way.</p><p>With this question I'm not looking for any code or examples. Instead I would like you to give me some hints on how this could work, what techniques are appropriate for this and how it would roughly work on the particular platform, so I can research on that more detailed. Thank you.</p>","216074","","","","","2010-09-30 22:32:59","AIR <-> Android communication","<android><air><bluetooth><communication><wifi>","1","0","","",""
"3834955","1","3835384","","2010-09-30 21:25:23","0","1448","<p>I have set the IME options for my <code>AutoCompleteTextView</code> object like this:  </p><pre><code>inputSearch.setImeOptions(EditorInfo.IME_ACTION_NEXT);</code></pre><p>and also in another area, at a certain point i set the IME Options to:</p><pre><code>inputSearch.setImeOptions(EditorInfo.IME_ACTION_GO);</code></pre><p>why is it that on the HTC Incredible, there is no action <code>next</code> or <code>go</code> showing up on my soft keyboard?  it works as expected on the <code>g1</code> and <code>Samsung Galaxy S</code></p><p>HTC Incredible running Android 2.2<br>G1 running Android 1.6<br>Samsung Galaxy S running Android 2.1 update-1</p>","416412","","416412","","2010-09-30 21:40:27","2013-03-20 13:32:20","HTC Incredible not showing Ime Options on soft keyboard","<android>","2","0","","2013-03-22 00:01:26",""
"3834971","1","","","2010-09-30 21:28:16","1","3340","<p>How do I create a top bar menu for Android as I would for another phone?</p><p>I already created a menu for the bottom, but I couldn't find anything to create a fixed visible menu on top (a bar menu). Am I missing something? How can I do it?</p>","169034","","","","","2012-12-06 05:59:23","Android: Fixed top menu","<android><android-menu>","2","0","1","",""
"3834973","1","","","2010-09-30 21:28:24","2","125","<p>My activity is interacting with other activities by sending intent to them. The requirements I have is :<BR>- to be notified when the activity launched is finished<BR>- know the result code.<BR></p><p>On most of the use cases this is working with a startActivityForResult as my activity is set to singleTask.</p><p>But when I'm interacting with activities that are also declared as singleTask this method doesn't work. This is because the new activity is creating its own task and the OnActivityResult of my activity is immediately called once the new activity is launched.</p><p>Unfortunately I can't change the properties for those activities as these are 3rd party ones.</p><p>Is there a way for my activity to be notified in case I call a singleTask activity ?</p>","455607","","","","","2011-07-27 20:16:37","Can I be notified of an activity result that is declared as singleTask?","<android>","0","0","1","",""
"3835031","1","3835394","","2010-09-30 21:39:10","1","354","<p>I managed to create a secondary Activity, but now I wonder how I can close it again.</p><pre><code>public void button_onClick(View v){   finish();}</code></pre><p>works when I'm dealing with just one Activity at a time, but how do I let the secondary Activity close the entire application?</p>","387405","","","","","2011-07-06 18:01:58","How do I close a secondary Activity gracefully?","<android>","2","0","","",""
"3835151","1","","","2010-09-30 22:01:30","0","1034","<p>I've gotten HTTP POST to send strings to the server side PHP script. My log is showing the correct return values. The script runs fine manually from the browser and inserts a new db table row. But can't get the script to run by having the apk call it... though, again, it returns all script page content including strings.</p><p>How can I get the script to run?</p><p>ThanksAllen</p>","462883","","","","","2010-09-30 22:43:56","Getting server side PHP script to run from android apk call","<php><android>","1","2","","",""
"3835160","1","3835524","","2010-09-30 22:03:40","2","6043","<p>Ideally, I do not want to start an activity to do this. When the WiFi connection is lost, my app needs to close because this is a fatal error for us. I want to display an error message and have the user press an Ok button and then exit the app. What is the best way to go about this?</p><p>Thanks!</p>","442903","","","","","2010-09-30 23:29:04","How can I display a dialog from an Android broadcast receiver?","<android><broadcastreceiver>","1","0","","",""
"3835272","1","","","2010-09-30 22:29:24","-4","3126","<p>Hi   I  just got an android phone Htc Tattoo  and  he had android 1.6 OS installed ,  I am trying to do some upgrade to some newer Android OS ,<br>My  question  :  Can  someone give me exact steps  what and how  can I do that ?</p><p>(I watch some youtube tut. and  some other sites  but there are some terms rooter,  rom , flashed  some  tools  etc. It is confusing  )  </p><p>I need  help  from someone  who did  this , just  to tell me a  steps :)</p>","365860","","","","","2010-09-30 22:36:11","ANDROID HTC TATTOO UPGRADE 1.6 to 2.1 OR 2.2?","<android><upgrade><htc>","1","1","1","2010-09-30 22:40:14",""
"3835287","1","3839063","","2010-09-30 22:32:10","2","1644","<p>I'm getting hung up on how to handle the data for an app I'm designing.  I want to pull a list of items from the net.  The data is updated routinely, and I think it would be good to store all the data on the device so the app can load quickly and refresh the data in a background thread rather than have to wait for the network on every start-up.</p><p>I think I should make the data available in an XML and have a thread parse and save into a SQLite DB, but I'm not sure if that's the ""best practice.""  Are there other ways that people go about handling this?</p>","463355","","","","","2010-10-01 12:20:02","Best way to get online data and store it in Android","<android><xml>","2","0","2","",""
"3835297","1","","","2010-09-30 22:34:17","1","863","<p>I originally asked this question as a possible bug in Eclipse Helios :<a href=""http://stackoverflow.com/questions/3738526/possible-bug-in-eclipse-ddms-emulator-control"">link text</a></p><p>I accepted that it was bug in Helios but I now find that I'm now getting the same error under Eclipse 3.5</p><p>When I send a location from the DDMS perspective using the emulator control tab. I have a standard listener:</p><p>onLocationChanged(Location location){...}</p><p>If I break on the first line of this, having sent the lat/lon pair of 53.5/-3.0 from the DDMS tab, then the mLatitude/mLongitude in the location argument have changed to 53.508833/-3.005000 (6 dec places only shown). </p><p>The Android SDK is 2.2 in both and the target is Google APIs level 7.Does anybody else experience this or could offer a possible explanation? (It amounts to quite a big error in terms of metres on the map.)</p>","440010","","","","","2010-12-07 16:04:21","Bug in Eclipse Emulator DDMS?","<android>","1","1","","",""
"3835367","1","","","2010-09-30 22:48:42","0","1119","<p>This is primarily a design question. I've implemented SimpleOnGestureListener on an ItemizedOverlay because I wanted to catch the onLongPress event as well as the onDown and onTap events. Everything is working okay but now I need to transition to a new activity on a specific onLongPress event. In this particular case an alert dialog is insufficient for my needs. Problem is transitioning from the overlay to an activity and back to the overlay. Usually, its from one activity to another and maybe back again. In addition, the code in my overlay class is getting quite long (about 450 lines) so it needs refactored and a bit more SRP. I can't see any way to attach the SimpleOnGestureListener to the Overlay from within the activity which references it, nor the MapView. Most examples I've looked at are noddy 'make a Toast' examples.</p>","367698","","","","","2011-01-04 13:33:49","How to implement SimpleOnGestureListener in Activity","<android><gestures><itemizedoverlay>","1","0","","",""
"3835466","1","","","2010-09-30 23:16:11","0","2930","<p>Is there a way to determine location via CellID on a CDMA network? I can get a network ID, base station ID, and system ID programatically, but is there an api somewhere to convert these to lat, long coordinates? The CdmaCellLocation.getBaseStationLatitude() and CdmaCellLocation.getBaseStationLongitude() methods return some junk number. Can I convert the cdma dating I'm getting to CID and LAC somehow?</p><p>I'm getting a system ID of 40, a network ID of 3, and a base station ID of 4672, and that appears to be exactly worthless.</p>","457805","","","","","2012-04-02 14:32:22","CellID location with CDMA","<android><location><cellid><cdma>","3","2","","",""
"3835480","1","3835777","","2010-09-30 23:19:20","4","6076","<p>I am trying to create a desktop shortcut to one of my Activity in Android.I use the code that work in every tuto example i have read:</p><pre><code>    final Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);    ComponentName name = new ComponentName(getPackageName(), "".MyActivity"");    shortcutIntent.setComponent(name);    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);    final Intent intent = new Intent();    intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);    intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, ""blabla"");    intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, icon);    intent.setAction(""com.android.launcher.action.INSTALL_SHORTCUT"");    sendBroadcast(intent);    finish();</code></pre><p>And I added the MAIN action to my activity:</p><pre><code>    &lt;activity android:label=""@string/app_name"" android:name="".MyActivity""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>The result is that the application does not want to launch!</p><p>In the Logcat everything seem fine:</p><pre><code>10-01 01:17:51.591: INFO/ActivityManager(2424): Starting activity: Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=my.package.name/.MyActivity bnds=[125,384][235,522] (has extras) }</code></pre><p>And the Home tell me that the application is not Installed.</p><p>Please help me, I am totally lost and spend a few hours trying to solve the issue and read all info I can get.</p><p>Thank a lot!</p>","327402","","","","","2011-12-28 05:26:01","Failed to launch shortcut: Application is not installed on your phone","<android><android-intent><launcher>","3","0","","",""
"3835560","1","","","2010-09-30 23:37:03","5","376","<p>If I create a standalone alertdialog with the builder (not connected to the activity/view) how can I keep the search button from causing the alertdialog to close?</p><p>Thanks.</p>","463383","","","","","2012-08-01 19:41:23","How to keep search button from closing an AlertDialog?","<android>","2","4","1","",""
"3835663","1","3836700","","2010-10-01 00:01:52","3","2283","<p>Is it possible to run a .swf on Android running Froyo 2.2? If so, how do I do it? I am basically trying to do a cool animation and it is done in Flash but I have no idea how to show that animation on the Android.</p>","188727","","","","","2011-02-06 12:26:19","Android Programming - How to display .swf","<java><android><swf>","2","0","2","",""
"3835794","1","3836016","","2010-10-01 00:44:33","0","135","<p>I have an audio player toolbar activity that has a corresponding layout file.</p><p>I need this player to show up at the bottom of another activity. I use a ViewStub and inflate the audio toolbar's layout file in the stub.</p><p>How do I access the buttons, etc on this inflated view and how do I set their behavior?</p><p>The docs on ViewStub did not mention anything about this (or maybe I totally overlooked something).</p><p>I may be doing something fundamentally wrong here so I would appreciate any help I can get :)</p>","392178","","","","","2010-10-01 02:22:48","How do I set the behavior for an inflated view?","<android><activity><behavior><viewstub>","1","0","","",""
"3835814","1","","","2010-10-01 00:49:54","0","4709","<p>I'm trying to get xml from server via https connection. If i do it with curl command</p><pre><code>curl -k -A ""Mozilla/4.0"" https://username:password@server.com/test/infoxml.ashx</code></pre><p>connection is successfull, but when i try it in java on android, it doesn't work. I'm using this code:</p><pre><code>URL url = new URL(""https://user:password@server.com"");HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();conn.setRequestMethod(""GET"");conn.setRequestProperty(""Authorization"", ""Basic MDcwODQyODcyOnRlY2hhZG1pbg=="");conn.setRequestProperty(""User-Agent"", ""Mozilla/4.0"");conn.setRequestProperty(""Host"", ""server.com"");conn.setRequestProperty(""Accept"", ""*/*"");InputStream content = conn.getInputStream();</code></pre><p>As you can see, I set up headers based on verbose output of working curl command, which is as follows:</p><pre><code>* About to connect() to server.com port 443 (#0)*   Trying (server ip)... connected* Connected to server.com (server ip) port 443 (#0)* SSLv3, TLS handshake, Client hello (1):* SSLv3, TLS handshake, Server hello (2):* SSLv3, TLS handshake, CERT (11):* SSLv3, TLS handshake, Server finished (14):* SSLv3, TLS handshake, Client key exchange (16):* SSLv3, TLS change cipher, Client hello (1):* SSLv3, TLS handshake, Finished (20):* SSLv3, TLS change cipher, Client hello (1):* SSLv3, TLS handshake, Finished (20):* SSL connection using AES256-SHA* Server certificate:*   subject: C=SI; ST=City; L=City; O=Company d.d; OU=ES; CN=server.com*   start date: 2010-02-05 00:00:00 GMT*   expire date: 2011-02-02 23:59:59 GMT*   common name: server.com (matched)*   issuer: C=ZA; ST=Western Cape; L=Cape Town; O=Thawte Consulting cc; OU=Certification Services Division; CN=Thawte Premium Server CA; emailAddress=censored*   SSL certificate verify ok.* Server auth using Basic with user 'username'&gt; GET /test/infoxml.ashx HTTP/1.1&gt; Authorization: Basic MDcwODQyODcyOnRlY2hhZG1pbg==&gt; User-Agent: Mozilla/4.0&gt; Host: server.com&gt; Accept: */*&gt; &lt; HTTP/1.1 200 OK&lt; Connection: Keep-Alive&lt; X-Powered-By: ASP.NET&lt; X-AspNet-Version: 2.0.50727&lt; Keep-Alive: timeout=5, max=100&lt; Server: Microsoft-IIS/6.0&lt; Cache-Control: private&lt; Set-Cookie: JSESSIONID=abcs8ebwPsf-A-biM7KTs; path=/&lt; Content-Type: text/xml; charset=utf-8&lt; Content-Length: 1688&lt; Date: Thu, 30 Sep 2010 23:16:06 GMT&lt; * Connection #0 to host server.com left intact* Closing connection #0* SSLv3, TLS alert, Client hello (1):&lt;?xml version=""1.0""...</code></pre><p>I'm new to this secure connection stuff, so go easy on me :)</p><p>p.s. sorry for my bad English.</p>","463419","","223590","","2010-10-01 00:53:49","2014-04-10 06:39:55","Android java.net.UnknownHostException: Host is unresolved: server_address:443","<java><android><ssl><tls>","1","0","","",""
"3835875","1","3835988","","2010-10-01 01:06:33","0","2867","<p>Trying to solve my <a href=""http://stackoverflow.com/questions/3795834/moving-icons-on-a-android-mapview"">current problem</a> of drawing an image on an Android MapView and then animate it to represent a moving object, I decided to try to just draw a raw ImageView at a GeoPoint on the map and then try and animate it from there. </p><p>This is the code I put in my map activity (extends MapActivity)'s onCreate method:</p><pre><code>GeoPoint point = new GeoPoint(19240000, -99120000);ImageView iv = new ImageView(this);iv.setImageResource(R.drawable.icon);LayoutParams lp = new LayoutParams(iv.getWidth(), iv.getHeight(), point, LayoutParams.BOTTOM);mapView.addView(iv, lp);</code></pre><p>Again, I'm just trying to draw the static icon and animate it from there. I can already do this with an ItemizedOverlay, but as far as I can tell, I can't animate the elements of an AnimatedOverlay the way that I can animate a view. Thus, using ImageView.</p><p>But the icon doesn't show up. Any thoughts or suggestions?</p>","28001","","28001","","2010-10-01 01:14:07","2010-10-01 01:40:09","Draw an ImageView at specific GeoPoint on a MapView (Android)","<android><android-mapview><imageview>","1","0","3","",""
"3836043","1","3843964","","2010-10-01 01:57:35","2","554","<p>I'm trying to get the source added to the 1.6 Android SDK in order to be able to step through and see what Android is doing, and I'm getting weird misalignments when Eclipse actually runs and I step through the debugger.</p><p>This is not a problem if I use the 2.2 SDK - then, say, Activity.onCreate() lands perfectly when the debugger enters Activity.java.</p><p>However, in the case of 1.6, it lands about 10 lines lower, and for other functions, it's even more off. I downloaded the source code from <a href=""http://mobilebytes.wordpress.com/2010/06/30/classes-source-for-eclipse/#comment-915"" rel=""nofollow"">here</a> and realize it may not match what the current SDK has.</p><p>OK sure, SDK says Pkg.Desc=Android SDK Platform 1.6_r2 and even though the source that I downloaded says the same, maybe something is off there and it doesn't match exactly. So I went and dug up <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/java/android/app;h=e1270e74d9ec832dd53e286c43ddfcbba1b4e69f;hb=01889503c47aadc9faacf727371f1d23e3a99d97"" rel=""nofollow"">the source for this in the git repo</a> - it's exactly the same!</p><p>What am I doing wrong? Is Eclipse not reading the line numbers correctly? Did Google compile off a branch that was changed when it was merged into the public git repo?</p><p>Here, check this out - Eclipse thinks onCreate is on line 801 while it's in reality on line 790:</p><p><img src=""http://i.stack.imgur.com/cMgbj.jpg"" alt=""alt text""></p><p>What am I doing wrong?</p><p>Thank you!</p><p><strong>Edit:</strong> Hrm, so I see the lines actually align with the 2.2 SDK source code. Continuing to poke at it.</p>","47680","","1225413","","2013-02-06 12:39:31","2013-02-06 12:39:31","Android 1.6 SDK source code misaligned?","<android><eclipse><sdk><source>","1","0","","",""
"3836215","1","4108730","","2010-10-01 02:42:18","17","19011","<p>for some specific requirementI am required to change Android Default Home applicationwith my customized Home application ( a setting inside my app that will toggle default home = my application or previous home)</p><p>I don't want the user to travel android settings that are very complicated.</p><p>Can any one help me out like where it registers launcher.apk for defaulthome application or how to change that</p><p>The only thing I could find was that old question: <a href=""http://stackoverflow.com/questions/3204369/how-to-change-default-android-desktop-application"">How to change default Android&#39;s Desktop application?</a></p><p>but no answers at all.</p><p>I have seen HomeSwitcher in the Market that do the trick, but no answer for the developer that might certainly be busy.</p><p><strong>EDIT</strong></p><p>I found this on the web <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg74167.html"">http://www.mail-archive.com/android-developers@googlegroups.com/msg74167.html</a></p><p>But I got the same issue:</p><p>this is my code:</p><pre><code>    private void makePreferred() {            PackageManager pm = getPackageManager();            IntentFilter f = new IntentFilter(""android.intent.action.MAIN"");            f.addCategory(""android.intent.category.HOME"");            f.addCategory(""android.intent.category.DEFAULT"");            ComponentName cn = new ComponentName(""com.example.android.home"", ""com.example.android.home.Home"");            pm.addPreferredActivity(f, IntentFilter.MATCH_CATEGORY_EMPTY, null, cn);</code></pre><p>I have the <code>android.permission.SET_PREFERRED_APPLICATIONS</code> set in themanifest. After executing the code above, the logs claim things havebeen added like expected (same logs as when I tick off ""Make default""from IntentResolver's list). However, when I proceed by clicking home,the list still shows up and the logs say:</p><pre><code>INFO/PackageManager(52): Result set changed, dropping preferredactivity for Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 } type null</code></pre><p>So it seems the resolver deletes the default entry. Am I doingsomething wrong, or is this a security measure? What are the ideasbehind this?</p>","327402","","1431239","","2012-09-22 00:45:38","2013-09-18 04:57:31","Android: change default Home Application","<android><default><home>","3","2","11","",""
"3836556","1","","","2010-10-01 04:33:12","5","2890","<p>here is the xml code i used</p><p>but no use even if try increasing the minheight....</p><p>please help</p><p><img src=""http://i.stack.imgur.com/iE4YI.png"" alt=""alt text"">         </p><pre><code>  &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""fill_parent""&gt;    &lt;!-- Here you put the rest of your current view--&gt;&lt;LinearLayout     android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""  &gt;    &lt;TextView      android:text=""ID:""    android:textSize=""15dp""    android:textStyle=""bold""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;      &lt;TextView    android:id=""@+id/cid""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    /&gt;   &lt;TextView      android:text=""Name:""    android:textSize=""15dp""    android:textStyle=""bold""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;   &lt;TextView    android:id=""@+id/con""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    /&gt;   &lt;TextView      android:text=""Posted By:""    android:textSize=""15dp""    android:textStyle=""bold""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;   &lt;TextView    android:id=""@+id/poby""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    /&gt;   &lt;TextView      android:text=""Posted Time:""    android:textSize=""15dp""    android:textStyle=""bold""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;  &lt;TextView   android:id=""@+id/poti""   android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;    &lt;TextView      android:text=""Annotation ID:""    android:textSize=""15dp""    android:textStyle=""bold""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;      &lt;TextView    android:id=""@+id/aid""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    /&gt;   &lt;TextView      android:text=""Comment:""    android:textSize=""15dp""    android:textStyle=""bold""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;   &lt;TextView    android:id=""@+id/comm""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    /&gt;   &lt;TextView      android:text=""Image-path:""    android:textSize=""15dp""    android:textStyle=""bold""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;  &lt;TextView   android:id=""@+id/imgpath""   android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    /&gt;   &lt;TextView      android:text=""Solutions:""    android:textSize=""15dp""    android:textStyle=""bold""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    /&gt;    &lt;ListView           android:id=""@+id/listviewid""           android:layout_marginBottom=""10dp""           android:paddingBottom=""10dp""           android:minHeight=""1000dp""           android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            /&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>The java code related to it is:</p><pre><code>if(s8.length()!=0){                String[] sidarray = s8.split(""@"");                String[] replyarray = s9.split(""@"");                String[] replybyarray = s10.split(""@"");                for(int p=0;p&lt;sidarray.length;p++)                {                    if(solutionsList!=null){                    solutionsList.add(""\nSolutionsID:"" + sidarray[p] );                    solutionsList.add(""\nReply:"" + replyarray[p]);                    solutionsList.add(""\nReply-by:"" + replybyarray[p]);                }}                solutionlist=(ListView)findViewById(R.id.listviewid);                solutionadapter = new ArrayAdapter&lt;String&gt;(this, R.layout.solutiondisplay, solutionsList);                solutionlist.setAdapter(solutionadapter);             }</code></pre><p><a href=""http://www.compliantbox.com/XmlParsingcompliant.zip"" rel=""nofollow"">Here is my source code.................</a></p>","438864","","438864","","2011-01-12 09:25:58","2011-01-12 09:25:58","How do i increase the view size of my list view?","<android><listview>","7","2","2","",""
"3836571","1","","","2010-10-01 04:37:48","-5","8668","<p>I googled for 5 mins. I also searched for '5037' in all files in android sdk directory. I am a budding android developer and if there is no easy way of configuring adb to run on another port then I am ***king quitting android app development.</p>","448760","","","","","2012-06-02 18:52:52","Changing default port (i.e. 5037) on which adb server runs","<android><default><port><adb>","1","4","","",""
"3836672","1","","","2010-10-01 05:06:01","1","685","<p>I have an apk of Calendar application. I have installed the apk on android 2.1 API level 7 emulator successfully. But the problem is I can not run the application. When I click on the app icon it shows the following message.Sorry! The appliaction Calendar(process com.android.calendar) has stopped unexpectedly. Please try again. (It is a Force close message)</p><p>if anyone knows the solution pls tell me.</p><p>BR,gsmaker</p>","424854","","","","","2011-02-27 05:55:26","Calendar.apk running problem?","<android>","2","2","","",""
"3836721","1","3838911","","2010-10-01 05:23:14","0","86","<p>I'm creating a note application that notifies you at a certain time &amp; date and I'm using a Timer object to schedule that notification. Basically, the user will input the note, time and date to be notified, and then will hit a submit button. Once that button is hit, a TimerTask is scheduled using the Timer class and this note will reflect on a ListActivity. </p><p>The problem I'm running into is this...</p><p>If the user decides to edit the note by changing the time and date to be notified, since the TimerTask was already scheduled, once the user hits submit, another TimerTask will be scheduled. Hence, there will be two notifications for the same note! I want to store the timer object somewhere so that when the note is to be edited, I can simply edit the timer object. This is my current approach but if you guys have any suggestions on how I can do this better that would be great!</p>","450243","","","","","2010-10-01 12:00:13","How can I store a Timer object so that it can later be retrieved?","<android>","1","0","","",""
"3836763","1","","","2010-10-01 05:30:48","0","12241","<p>In my android application i am trying to create a music file using  create temp and trying to read that.Now i am able to create but its giving an error saying video cannot be played.</p><pre><code>    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);     //File newfile=new File(""/data/data/com.ayansys.samplevideo/Music.3gp"");    //String xyz=newfile.getAbsolutePath();    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); // Sets the window in full screen    setContentView(R.layout.main);   // path.g   // Log.i(""Raw folder path:"", R.raw.music);   String path= musicFile();    try{    Thread.sleep(5000);    }    catch(InterruptedException e)    {        e.printStackTrace();        Log.i(""exception raised"",e.toString());    }    mVideoView = (VideoView) findViewById(R.id.surface_view);    // mVideoView.setVideoURI(Uri.parse(""android.resource://com.ayansys.samplevideo/""+R.raw.music));   // File infile=new File(""/data/data/com.ayansys.samplevideo/Video.3gp"");    mVideoView.setVideoPath(path);    mVideoView.requestFocus();    mVideoView.start();}public   String  musicFile(){    String temPath = null;    try{        File outFile=File.createTempFile(""music"", "".3gp"", getDir(temPath, MODE_PRIVATE));        temPath=outFile.getAbsolutePath();        FileOutputStream f=new FileOutputStream(outFile);        //FileOutputStream fos = openFileOutput(""music.3gp"", Context.MODE_PRIVATE);        URL u = new URL(""http://59.162.166.211/aptv-web/VODAFONE/STARONE/SarabhaivsSarabhai/J2ME/SarabhaivsSarabhai_05.3gp"");    HttpURLConnection c = (HttpURLConnection) u.openConnection();    c.setRequestMethod(""GET"");    c.setDoOutput(true);    c.connect();    //FileOutputStream f = new FileOutputStream(new File(""/sdcard/videooutput.mp4""));    InputStream in = c.getInputStream();    byte[] buffer = new byte[1024];    int len1 = 0;    while ( (len1 = in.read(buffer))!= -1 ) {         f.write(buffer,0,len1);    }    f.close();    String str=outFile.getAbsolutePath();    //outFile..close();    in.close();}    catch(Exception e)    {        e.printStackTrace();        System.out.println(""Exception raised in creating a file: ""+e.toString());    }    return temPath;}</code></pre><p>}</p><p>I would like to play this.Please share your valuable suggestions.</p><p>Thanks in advance</p>","420261","","420261","","2010-10-01 08:00:20","2010-10-01 08:00:20","create temp file in android","<android>","1","1","0","",""
"3836901","1","3837140","","2010-10-01 06:07:40","1","335","<p>How do i define a following layout in my xml file:</p><p><img src=""http://i.stack.imgur.com/SId8H.png"" alt=""alt text""></p><p>I hope you got it from image that i want to display TextView1 on 1st Row, and in 2nd Row, TextView2 on Left and TextView3 on Right side.</p><p>How do i define this layout?</p><p>i know the layout_gravity attribute but not getting success, so pls share your code</p>","379693","","","","","2010-10-15 10:08:02","Android XML Layout","<android><android-layout><android-sdk-2.1>","4","0","1","",""
"3836953","1","3837010","","2010-10-01 06:20:58","0","354","<p>When I use the following code in Android 1.6 it displays both phone numbers andcontacts but when I use Android 2.2 it does not display phone numbers, it onlydisplays names.</p><pre><code>String columns[] = new String[] { People.NAME, People.NUMBER, People._ID };int tocols[] = new int[] {android.R.id.text1, android.R.id.text2};Cursor c = managedQuery(People.CONTENT_URI, columns, null, null, null);SimpleCursorAdapter sca = new SimpleCursorAdapter(this,       android.R.layout.simple_list_item_2, c, columns, tocols);setListAdapter(sca);</code></pre>","461503","","251122","","2010-10-01 06:39:05","2010-11-30 02:20:49","Android emulator does not display phone numbers","<android>","1","0","","",""
"3836974","1","3859473","","2010-10-01 06:26:17","0","506","<p>I am using Titanium appcelerator for developing my android application, more over i am newbie to handle both of this together, even though i have made some digging to find some  resources to start up with this, i am finding some difficulties in my first try.if anybody have resources that helps me move on further, please let me know...</p><p>Other one.. is it possible to run my android application that i have done using  Titanium appcelerator in iPhone..if so please provide some resources...for doing the same...</p><p>Please let me know....</p><p>Thanks in advance...</p>","384193","","","","","2010-10-04 22:00:06","Working with Titanium Appcelerator","<iphone><android><titanium>","1","0","","","2010-10-01 06:26:51"
"3837172","1","3839882","","2010-10-01 07:16:13","1","247","<p>Hi all I was wandering if there was a easy way to do the following without android layoutplace an image central topplace a button center centerplace a button left bottomplace a button right bottom</p><p>it doesn't sound that difficult no ? </p><p>well I can't figure out a way to place the elements as I want using stupid xml layout</p><p>can somebody help me out here ? </p><p>cheers </p><p>Jason</p>","440336","","","","","2010-10-01 14:03:37","Android Layout: Can't place the elements where I want","<android><layout>","1","2","","",""
"3837202","1","6373628","","2010-10-01 07:23:50","0","652","<p>I read that in froyo if you change vibrate settings with setVibrateSettings() it doesn´t sync with SO vibrate settings. Then I found this workaround that people use with some of the functions in this link:</p><p><a href=""http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;a=blob;f=src/com/android/settings/SoundSettings.java;h=a735268b119dda3f91b4f3e987df054eead99f5c;hb=HEAD"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;a=blob;f=src/com/android/settings/SoundSettings.java;h=a735268b119dda3f91b4f3e987df054eead99f5c;hb=HEAD</a></p><p>However, that source code there are two calls to:</p><p>173        boolean vibeInSilent = (Settings.System.getInt( 174             getContentResolver(), 175             Settings.System.VIBRATE_IN_SILENT, 176             1) == 1);</p><p>227        Settings.System.putInt(getContentResolver(), 228             Settings.System.VIBRATE_IN_SILENT, 229             vibeInSilent ? 1 : 0);</p><p>That are the only difference with what I try to do in my code to change vibrate setttings. But Settings.System.VIBRATE_IN_SILENT seems to be removed in 2.2, so when I change vibrate settings ""normal, off, only in silent"", then I go to SO audio settings and vib value is different, and if i go back to my app, vib settings are also different to what i selected before. Any idea?Thanks!!!!!</p>","463597","","995926","","2012-05-05 13:55:37","2012-05-05 13:55:37","Vibrate settings in froyo","<android><silent><vibrate><audiomanager><android-2.2-froyo>","1","0","","",""
"3837230","1","","","2010-10-01 07:29:16","1","411","<p>I have been trying to work with a Library Project, just like it's mentioned in the documentation :<a href=""http://developer.android.com/guide/developing/eclipse-adt.html"" rel=""nofollow"">http://developer.android.com/guide/developing/eclipse-adt.html</a></p><p>I have created my Library Project as a Android 1.6 Project and now I have been trying to reference to it out of my second project (also an Android 1.6 project) and I am getting the following error :""Target 'Android 1.6' does not support building project with libraries.""""ERROR: Unknown option '--auto-add-overlay'""</p><p>The documentation states that supported platfroms are the 1.5 onwards (with exception for the 2.0 &amp; 2.0.1) and that the second project should have the same platform or higher (in my case the same)...</p><p>So any idea what's ahppening here ? And most importantly : any idea how to solve this ?Thx in advance !</p>","162147","","162147","","2010-10-01 08:16:29","2010-12-18 00:09:28","Library Projects support?","<android><project><libraries>","3","0","","",""
"3837277","1","3838225","","2010-10-01 07:38:15","2","1558","<p>I have found this example <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012"">http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012</a>  from Fedor which is absolutely great for what I need. </p><p>I have a question. if beside the Clear Cache button there would be a button with Cancel. How could I in onClick cancel the image download thread from the UI ?</p><p>Thank you.</p><p>Edit:I think that it already has this method implemented:</p><pre><code>public void stopThread()    {        photoLoaderThread.interrupt();    }</code></pre><p>But I don't know how to access it from the UI Thread. In UI Thread I only do this:</p><pre><code>adapter=new LazyAdapter(ctx, someString);setListAdapter(adapter);</code></pre><p>in LazyAdapter:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {... imageLoader.DisplayImage(imagePath, activity, holder.image);        return vi;}</code></pre><p>and in ImageLoader</p><pre><code>public void DisplayImage(String url, Activity activity, ImageView imageView)    {        if(cache.containsKey(url))            imageView.setImageBitmap(cache.get(url));        else        {            queuePhoto(url, activity, imageView);            imageView.setImageResource(stub_id);        }        }private void queuePhoto(String url, Activity activity, ImageView imageView)    {        //This ImageView may be used for other images before. So there may be some old tasks in the queue. We need to discard them.         photosQueue.Clean(imageView);        PhotoToLoad p=new PhotoToLoad(url, imageView);        synchronized(photosQueue.photosToLoad){            photosQueue.photosToLoad.push(p);            photosQueue.photosToLoad.notifyAll();        }        //start thread if it's not started yet        if(photoLoaderThread.getState()==Thread.State.NEW)            photoLoaderThread.start();    }</code></pre><p>But I think an clear way is to download the sources from <a href=""http://open-pim.com/tmp/LazyList.zip"" rel=""nofollow"">link text</a></p><p>Thank you for your help.</p>","379865","","379865","","2010-10-01 08:57:27","2011-01-29 17:48:19","Lazy List with Images. How to cancel thread?","<android><listview><lazy-loading>","2","0","","",""
"3837445","1","3838346","","2010-10-01 08:08:27","1","697","<p>I have an AsyncTask that get info from the web. Sometimes the connection fails  and the AsyncTask processdialog is running forever.</p><p>In the doInBackground I have a check in the end if my catched info are empty and if this is the case, it should appear Positive button/Negative button, but this is not happening. The dialog is just running.</p><p>How can I check if an AsyncTask is taking too long time (Maybe 5 seconds) and dismiss the dialog?</p><p>Code snippet (doInBackground): </p><pre><code> //orders is my ArrayList&lt;Order&gt; object, from my own Order class. if(orders==null) {                pdia.dismiss();                AlertDialog.Builder alt_bld = new AlertDialog.Builder(ctx);                alt_bld.setMessage(""Try agin?"")                .setCancelable(false)                .setPositiveButton(""Try again"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    button_refresh.setVisibility(View.GONE);                     new ListTask().execute(null, null , null);                }                })                .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                dialog.cancel();                }                });                AlertDialog alert = alt_bld.create();                alert.setTitle(""Connection failed!"");                alert.show();            }            else {                return orders;            }</code></pre><p>Thanks in advance and tell me if you need more info!</p>","386562","","","","","2013-03-06 06:21:24","Check if AsyncTask is taking too long","<android>","2","2","","",""
"3837454","1","","","2010-10-01 08:09:41","2","954","<p>I'm trying to display a RatingBar View that is only capable of showing a one star rating, or no stars.  This seems so trivial...</p><p>My ratingbar is defined like so:</p><p>My view implements OnRatingBarChangeListener and OnTouchListener</p><p>My OnRatingBarChange handler has no code.My OnTouch handler looks like so:</p><pre><code>@Overridepublic boolean onTouch(View v, MotionEvent event){    if(event.getAction() == MotionEvent.ACTION_DOWN)    {        if(this.mRating.getRating() == 0)        {            this.mRating.setRating(1);        }        else        {            this.mRating.setRating(0);        }        return true;    }    return false;}</code></pre><p>No matter what, the onTouch event does not succeed at setting the rating back to zero.  This seems way too trivial.  What am I doing wrong?</p><p>Thanks!</p>","459102","","","","","2011-05-16 09:00:53","Single star RatingBar","<android>","1","0","","",""
"3837569","1","","","2010-10-01 08:28:54","0","1012","<p>My program will show data based on selection from two spinners (month and year). Based on month and year, it will query DB and displays the content in listview.</p><p>I created two spinners and populate with array string. Then I created two spinner views, two arrayadapters and set onItemSelected listeners and set adapter to the views. Then I use cursor to get query from DB, then put the result into simple cursor adapter and put them into list adapter. Finally I use list view to add this listadapter. Result shows properly. It is OK when the queries is not too much. But when there are lots of queries, it is difficult to see. So I want to implement paging for my program. For example: I get 100 queries, and I want to show them like 10 or 20 queries per page. I can control how many records per page via another spinner.</p><p>But the main problem is that I don't know how to get subset data or subview from return queries (listview).</p><p>Are there any methods in listadapter or android can do that ? I'm still new in android. I also read some documents about getView(), I don't understand and not sure whether it can help on my purpose.</p><p>Thanks for advise or suggestion !!</p><p>Tom</p>","463451","","21234","","2010-10-01 08:49:50","2010-10-01 12:29:23","How to obtain subviews from listview in android?","<android><listview>","1","0","","",""
"3837579","1","","","2010-10-01 08:30:29","14","14839","<p>I got this message in the DDMS:</p><blockquote>  <p>Sending jdwp tracking request failed!</p></blockquote><p>I didn't understand the reasons.</p><p>Is there a problem using a stream to get the image from the Internet and use the TabBar cause the use of them in different application didn't launch this errors?</p>","462023","","213269","","2010-11-02 13:33:43","2014-03-27 17:22:55","Sending jdwp tracking request failed!","<android><ddms>","5","0","1","",""
"3837657","1","5041015","","2010-10-01 08:44:47","1","1001","<p>I want to automate functional testing of my code which works with SMS. I know, that I can use <code>send sms</code> command and sms will be sent to emulator instance. </p><p>The question is how can I execute <code>send sms</code> command programmatically from my test case, so I can run test without manual intervention?</p>","216764","","","","","2011-04-07 06:52:48","Use SMS Emulator from Android Test Case","<android><unit-testing><continuous-integration><sms><emulator>","1","0","","",""
"3837685","1","3933617","","2010-10-01 08:48:33","2","2063","<p>I am modifying the Android Home (Launcher) application and configured an eclipse project from the Android source checkout. Eclipse project shows number of errors which are about unresolved imports and unavailable flags. Upon checking in the internet at <a href=""http://forum.xda-developers.com/showthread.php?p=8402045"" rel=""nofollow"">http://forum.xda-developers.com/showthread.php?p=8402045</a> , I found that the home application will not compile with the public SDK, but as part of the OS compilation, it is generated.</p><p>My question is how can I resolve the compilation errors in my eclipse project? Have anyone faced this public SDK and home application compilation issue? </p><p>I want to be able to build my Launcher.apk right from eclipse and run it.</p>","314256","","","","","2010-10-14 13:27:45","Android Launcher application compilation on Eclipse","<android><eclipse><homescreen><launcher>","2","1","","",""
"3837840","1","","","2010-10-01 09:15:28","0","366","<p>my current project requires to download data in a zip file wich i would like to unzip and store on the sd-card because it might be pretty big.however my client want this data to not be accessable to the user.What kind of encryption could i use, given that the zip contains images and textfiles?Thanks for sharing your ideas.</p>","457378","","","","","2010-10-01 09:15:28","Encrypting Data on the external Storage in Android","<java><android><encryption>","0","3","","",""
"3837895","1","","","2010-10-01 09:22:31","0","1064","<p>I have used all the contact examples in my Android emulator, but it is not displaying the phone numbers.It only displays names, so can anyone give me an example of the Android contacts API which imports names and numbers from the phonebook?</p>","441224","","899344","","2012-08-20 00:14:32","2012-08-20 00:14:32","Android Contact API","<android>","1","1","","",""
"3837920","1","3956779","","2010-10-01 09:25:44","5","2368","<p>I get an exception every time I launch the application. Here is the stacktrace for the exception</p><pre><code>10-01 14:49:35.321: WARN/WindowManager(61): Exception when adding starting window10-01 14:49:35.321: WARN/WindowManager(61): java.lang.RuntimeException: Binary XML file line #25: You must supply a layout_height attribute.10-01 14:49:35.321: WARN/WindowManager(61):     at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:438)10-01 14:49:35.321: WARN/WindowManager(61):     at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3468)10-01 14:49:35.321: WARN/WindowManager(61):     at android.view.ViewGroup$MarginLayoutParams.&lt;init&gt;(ViewGroup.java:3547)10-01 14:49:35.321: WARN/WindowManager(61):     at android.widget.LinearLayout$LayoutParams.&lt;init&gt;(LinearLayout.java:1265)10-01 14:49:35.321: WARN/WindowManager(61):     at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1191)10-01 14:49:35.321: WARN/WindowManager(61):     at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:45)10-01 14:49:35.321: WARN/WindowManager(61):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:620)10-01 14:49:35.321: WARN/WindowManager(61):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)10-01 14:49:35.321: WARN/WindowManager(61):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)10-01 14:49:35.321: WARN/WindowManager(61):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)10-01 14:49:35.321: WARN/WindowManager(61):     at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2153)10-01 14:49:35.321: WARN/WindowManager(61):     at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2207)10-01 14:49:35.321: WARN/WindowManager(61):     at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1395)10-01 14:49:35.321: WARN/WindowManager(61):     at com.android.internal.policy.impl.PhoneWindowManager.addStartingWindow(PhoneWindowManager.java:818)10-01 14:49:35.321: WARN/WindowManager(61):     at com.android.server.WindowManagerService$H.handleMessage(WindowManagerService.java:8794)10-01 14:49:35.321: WARN/WindowManager(61):     at android.os.Handler.dispatchMessage(Handler.java:99)10-01 14:49:35.321: WARN/WindowManager(61):     at android.os.Looper.loop(Looper.java:123)10-01 14:49:35.321: WARN/WindowManager(61):     at com.android.server.WindowManagerService$WMThread.run(WindowManagerService.java:531)</code></pre><p>I am also posting the XML file I'm using.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/arw_layout"" android:orientation=""horizontal""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""&gt;    &lt;ImageView android:id=""@+id/arw_logo"" android:layout_width=""30px""        android:layout_height=""40px"" android:layout_alignParentRight=""true"" /&gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:orientation=""horizontal"" android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" android:gravity=""center""        android:layout_alignParentLeft=""true""&gt;        &lt;TextView android:id=""@+id/arw_left"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""@string/arw_left""            android:textSize=""25sp"" android:paddingLeft=""10dp""            android:paddingRight=""10dp"" android:gravity=""center_vertical"" /&gt;        &lt;TextView android:id=""@+id/arw_title"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:minEms=""10""            android:text=""@string/arw_title"" android:paddingLeft=""10dp""            android:paddingRight=""10dp"" android:gravity=""center"" /&gt;        &lt;TextView android:id=""@+id/arw_right"" android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" android:text=""@string/arw_right""            android:textSize=""25sp"" android:paddingLeft=""10dp""            android:paddingRight=""10dp"" android:gravity=""center_vertical"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""    android:shape=""rectangle""&gt;  &lt;gradient      android:startColor=""#FF493538""      android:centerColor=""#FF000000""      android:endColor=""#FF000000""      android:angle=""270"" /&gt;&lt;/shape&gt;&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;/LinearLayout&gt;&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;&lt;declare-styleable name=""Gallery1""&gt;        &lt;attr name=""android:galleryItemBackground"" /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;resources&gt;        &lt;style name=""WindowTitleBackground"" parent=""android:WindowTitleBackground""&gt;            &lt;item name=""android:background""&gt;@drawable/gradient&lt;/item&gt;        &lt;/style&gt;    &lt;/resources&gt;&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;resources&gt;    &lt;style name=""titletheme""&gt;        &lt;item name=""android:windowTitleBackgroundStyle""&gt;@style/WindowTitleBackground        &lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt; </code></pre>","266272","","266272","","2010-10-08 13:54:30","2011-03-16 00:58:58","Exception in Android XML","<android><layout>","1","5","","",""
"3837930","1","","","2010-10-01 09:27:09","0","38","<pre><code>10-01 14:10:28.269: ERROR/audio_input(31): unsupported parameter: x-pvmf/media-input-node/cap-config-interface;valtype=key_specific_value10-01 14:10:28.269: ERROR/audio_input(31): VerifyAndSetParameter failed10-01 12:45:47.989: ERROR/PVOMXEncNode(31): PVMFOMXEncNode-Audio_AMRNB::DoPrepare(): Got Component OMX.PV.amrencnb handle </code></pre><p>Please help me out. I need to complete this task as soon as possible.</p>","452744","","1128737","","2012-01-14 15:18:03","2012-01-14 15:18:03","Android:Biginner::: AudioRecording Errors","<android>","0","2","","",""
"3838239","1","3838869","","2010-10-01 10:12:25","1","645","<p>Is it possible to have a list with dynamic amount of items in app widget?</p>","120574","","","","","2011-09-08 19:23:05","List in app widget","<android><list><dynamic><appwidget>","2","2","","",""
"3838317","1","3839008","","2010-10-01 10:22:42","0","644","<p>I founded this class with the function: setBackgroundDataSetting, on <a href=""http://www.kiwidoc.com/java/l/x/android/android/8/p/android.net/c/IConnectivityManager"" rel=""nofollow"">kiwidoc.com</a>.</p><p>I just need this function for my application.</p><p>But like the site say's: <code>""This class is not part of the public API.""</code>. I can not use it in my IDE.So i googled around looking for this iConnectivityManager, but i just can not find it only more documents. </p><p>Should i just forget about it ( I don't want too ) or is there a way to get this class?</p><p>Thanks,</p><p>DeDanny.</p>","463724","","463724","","2010-10-01 12:49:56","2013-03-07 10:59:43","Looking for the android.net.iConnectivityManager","<android>","2","0","","",""
"3838325","1","","","2010-10-01 10:24:20","0","781","<p>I'm porting an app that I've already going working on Windows to Android. The premmis is the same, the server is continually sreaming out data packets and the client reads them in.</p><p>The problem I have is that whilst the orginal app works just fine, the Android App connectes okay, but looses loads of packets - is there something I can simply change to fix this? </p><p>This is the crux of the code (just v simply read bytes from the stream):</p><blockquote>  <p>private InputStream m_RDSInputStream;</p>    <p>...</p>    <p>for (int lBytesToRead = 0; lBytesToRead &lt; (lNetworkCarrierSize + lBytesSentFromServer); >lBytesToRead++)  {     int lDataByte = m_RDSInputStream.read();     m_RDSInputDataBuffer[lBytesToRead] = (byte)lDataByte;</p>    <p>}</p></blockquote><p>I've tried reading x bytes in one hit - but wind up with the same problem. I know the server and link are not the problem</p><p>Thanks for any advise</p><p>Mark</p>","463757","","","","","2010-10-02 00:05:02","TCP/IP Streaming in Android App","<android>","1","0","2","",""
"3838354","1","","","2010-10-01 10:28:54","0","710","<p>I just start developping on <strong>android</strong> and i'm missing the <strong>EventHandler</strong> from c#. As a learning process, I started to write an EventHandler in java. It's almost good execept the method:<br><strong>getSlider_WantedValueChangedMethod()</strong><br>I need to get it through reflection, and the name is a String. So when you refactor, It will not change.What do you think about it? Is there a better way?</p><p>Manu</p><p><strong>EventHandler.java</strong></p><pre><code>import java.lang.reflect.InvocationTargetException;  import java.lang.reflect.Method;  import java.util.Vector;  public class EventHandler&lt;T extends EventArgs&gt; {    Vector&lt;EventHandlerItem&gt; subscribers = new Vector&lt;EventHandlerItem&gt;();    public void Invoke(Object sender,T eventArgs) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {        for (int i = 0, size = subscribers.size(); i &lt; size; i++)        {            EventHandlerItem item = subscribers.get(i);            item.Method.invoke(item.Subscriber,sender, eventArgs);        }    }    public void add(Object subscriber,Method method) {        subscribers.add(new EventHandlerItem(subscriber,method));    }    public void remove(Object subscriber) {        subscribers.remove(subscriber);    }}</code></pre><p><strong>EventArgs</strong></p><pre><code>import java.util.EventObject;public class EventArgs extends EventObject{    private static final long serialVersionUID = 9202854783245818504L;    public EventArgs(Object source) {        super(source);    }}</code></pre><p><strong>EventArgs1</strong></p><pre><code>public class EventArgs1&lt;T&gt; extends EventArgs{    private static final long serialVersionUID = -1694366721997799870L;    private T property;    public T getProp()    {     return property;    }    public EventArgs1(Object source,T property) {        super(source);        this.property = property;    }}</code></pre><p><strong>EventHandlerItem</strong></p><pre><code>import java.lang.reflect.Method;final class EventHandlerItem {    public Object Subscriber;    public Method Method;    public EventHandlerItem(Object subscriber,Method method)    {        this.Subscriber =subscriber;        this.Method = method;    }}</code></pre><p><strong>slider</strong></p><pre><code>public EventHandler&lt;EventArgs1&lt;Double&gt;&gt; onWantedValueChanged = new EventHandler&lt;EventArgs1&lt;Double&gt;&gt;();    private void InvokeWantedValueChanged(double value) throws Exception    {        onWantedValueChanged.Invoke(this,new EventArgs1&lt;Double&gt;(this,value));    }    public double getWantedValue()    {        return wantedValuePercent;    }    public void setWantedValue(double value)    {        if (wantedValuePercent == value) return;        wantedValuePercent = value;        try {                InvokeWantedValueChanged(value);        }        catch (Exception ex){}    }</code></pre><p><strong>Implementation</strong></p><pre><code>slider.onWantedValueChanged.add(this,getSlider_WantedValueChangedMethod());private static Method slider_WantedValueChangedMethod;    public Method getSlider_WantedValueChangedMethod() {        if (slider_WantedValueChangedMethod != null)            return slider_WantedValueChangedMethod;        try {            slider_WantedValueChangedMethod = getClass().getDeclaredMethod(                    ""slider_WantedValueChanged"",Object.class, EventArgs1.class);        } catch (Exception e) {        }        return slider_WantedValueChangedMethod;    }    public void slider_WantedValueChanged(Object sender,EventArgs1&lt;Double&gt; wantedValue) {}</code></pre>","446066","","","","","2010-10-01 10:28:54","android Eventhandler like in c#","<c#><android><event-handling>","0","3","","",""
"3838416","1","3838479","","2010-10-01 10:41:06","0","1081","<p>I want to do a sample bluetooth program in android,please suggest me good sample program</p>","461972","","265167","","2011-12-17 13:50:54","2011-12-17 13:50:54","Need tutorial about Android Bluetooth ","<android><bluetooth>","1","0","1","2013-11-05 22:01:36",""
"3838484","1","3838625","","2010-10-01 10:52:59","0","844","<p>I have a widget which looks like this:</p><p><img src=""http://i.stack.imgur.com/ZG9w1.png"" alt=""alt text""></p><p>Every cone is a ""touchable element"". Now I want to put a bitmap texture above each cone. However, bitmap images are all rectangular, so a bitmap texture above one cone would interfere with the bitmap texture above another cone.</p><p>I'm wondering what is the best solution to this approach. Should I just create an image which fits (as a rectangle) exactly above the cone and make the non used areas transparent?</p><p>A second question is, how do bitmap textures work with stretching? Because this whole circle draws itself to fit the whole screen size, while bitmap textures are pretty much one size. </p>","184367","","","","","2010-10-01 11:43:11","Android: adding a bitmap texture to a non rectangular item","<android><bitmap><2d><textures>","1","0","","",""
"3838527","1","3838661","","2010-10-01 10:59:33","20","34978","<p>I am getting the current date (in format 12/31/1999 i.e. mm/dd/yyyy) as using the below code:</p><pre><code>Textview txtViewData;txtViewDate.setText(""Today is "" +        android.text.format.DateFormat.getDateFormat(this).format(new Date()));</code></pre><p>and I am having another date in format as: 2010-08-25 (i.e. yyyy/mm/dd) ,</p><p>so I want to find the difference between date in number of days, how do I find difference in days? </p><p>(In other words, I want to find the difference between <strong>CURRENT DATE - yyyy/mm/dd formatted date</strong>)</p>","379693","","379693","","2013-10-11 10:21:31","2013-10-19 05:44:54","Android/Java - Date Difference in days","<java><android><date>","10","0","16","",""
"3838536","1","3838719","","2010-10-01 11:01:29","0","1974","<pre><code>      I have this menu example But in this example new activity is not called,      please give me the solution      package Com.ContactProject;      import android.app.Activity;      import android.content.Intent;      import android.os.Bundle;      import android.view.MenuInflater;      import android.view.Menu;      import android.view.MenuItem;     public class Contact extends Activity {      /** Called when the activity is first created. */       private static final int MENU_NEW_GAME = 0;       private static final int MENU_QUIT = 1;       private static final int MENU_COUNTRIES = 2;       @Override        public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         setContentView(R.layout.main);}public boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.options_menu, menu);    return true;}</code></pre><p>public boolean onOptionsItemSelected(MenuItem item) {</p><pre><code>    switch (item.getItemId()) {    case MENU_NEW_GAME:        Intent cityMap = new Intent(Contact.this, Add.class);        startActivity(cityMap);        //newGame();        return true;    case MENU_QUIT:        Intent cityMap1 = new Intent(Contact.this, Sms.class);        startActivity(cityMap1);        //quit();        return true;    case MENU_COUNTRIES:        Intent cityMap2 = new Intent(Contact.this, Update.class);        startActivity(cityMap2);        return true;    default:    }    return false;}</code></pre><p>}</p>","461503","","","","","2011-04-29 10:26:29","Menu Intent in android","<android>","1","0","","",""
"3838556","1","","","2010-10-01 11:04:04","2","348","<p>I need to authenticate to use a rest web service.</p><p>I make a </p><pre><code>HttpClient httpclient = new DefaultHttpClient();</code></pre><p>an there must be a way to use <code>UsernamePasswordCredentials</code> on that client.</p><p>Can somebody please point me to a relevant example? </p><p>I have found some source code uding the HttpClient class in the org.apache.commons.SOMETHING_HTTP, but that doesn't exist on Android.</p><p>Cheers</p>","428433","","","","","2010-10-01 11:12:16","how do i do authentification on android","<android><http><authentication><rest>","1","1","","",""
"3838561","1","3851503","","2010-10-01 11:04:58","0","205","<p>i'm  tryng to create my first widget. To make a experiment i'm tryng to visualize a Toast every update but it doesn't appaire.</p><p>This is my manifest:</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""  package=""com.skatephone.smokecounter""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;receiver android:name="".SmokeCounter"" &gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;            &lt;action android:name=""com.skatephone.smokecounter.SmokeCounter.ACTION_WIDGET_RECEIVER""/&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.appwidget.provider""                   android:resource=""@xml/smoke_widget_info"" /&gt;    &lt;/receiver&gt;&lt;/application&gt;&lt;uses-sdk android:minSdkVersion=""4"" /&gt;</code></pre><p> </p><p>And in the onUpdate metodh of my AppWidgetProvider class i inserted:</p><pre><code>Toast.makeText(context, ""onUpdate"", Toast.LENGTH_SHORT).show();appWidgetManager.updateAppWidget(appWidgetIds, views);</code></pre><p>It seems that it doesn't update, should do it every 5 seconds!</p><p>Any idea?</p><p>ThanksValerio</p>","314554","","","","","2010-10-03 20:35:21","Tryng to update my widget with no result","<android><widget>","1","0","","",""
"3838602","1","3838947","","2010-10-01 11:09:46","29","14864","<p>How can I find out carrier's name in Android?</p>","243225","","","","","2011-06-15 22:15:01","How to find out carrier's name in Android","<android>","2","0","8","",""
"3838640","1","3953239","","2010-10-01 11:15:39","10","18969","<p>i have a simple activity program in android.basically the class just extends Activity.But when i start it i get a ClassCastException in the constructor of my class.i dont even have a constructor defined, so it must be in the constructor of the superclass which is Activity.</p><p>unfortunately the debugger doesnt give any detailed information on what class it is trying to cast.</p><p>here is the stacktrace:</p><pre><code>Thread [&lt;1&gt; main] (Suspended (exception RuntimeException))      ActivityThread$PackageInfo.makeApplication(boolean, Instrumentation) line: 649      ActivityThread.handleBindApplication(ActivityThread$AppBindData) line: 4232     ActivityThread.access$3000(ActivityThread, ActivityThread$AppBindData) line: 125        ActivityThread$H.handleMessage(Message) line: 2071      ActivityThread$H(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 4627        Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]      Method.invoke(Object, Object...) line: 521      ZygoteInit$MethodAndArgsCaller.run() line: 868      ZygoteInit.main(String[]) line: 626     NativeStart.main(String[]) line: not available [native method]  </code></pre><p>and when i look into this runtimeexception i get:</p><p>detailMessage   ""Unable to instantiate application com.test.MyApp: java.lang.ClassCastException: com.test.MyApp"" (id=830067694464)  </p><p>the only code is</p><pre><code>package com.test;import android.app.Activity;public class MyApp extends Activity {}</code></pre>","97688","","97688","","2010-11-14 22:36:43","2014-01-07 15:37:44","android classcastexception on activity startup","<android><activity><startup><classcastexception>","8","7","4","",""
"3838794","1","3839261","","2010-10-01 11:39:16","3","2104","<p>I am trying to make an app that opens android market page of selected app &amp; lets user download it.I have used below intent to open market.</p><pre><code>  Intent intent = new Intent (Intent.ACTION_VIEW);    intent.setData (Uri.parse (""market://details?id="" + PackageName ));    intent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK);    startActivityForResult (intent, 13);</code></pre><p>but I always get resultcode 0 in onActivityResult.StackTrace says:</p><pre><code>I/ActivityManager(   79): Starting activity: Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.apps.unveil flg=0x10000000 cmp=com.android.vending/.AssetInfoActivity }W/ActivityManager(   79): Activity is launching as a new task, so cancelling activity result.</code></pre><p>What I want is that market returns me some response that user downloaded the app or just cancelled.</p><p><strong>EDIT:</strong> @CommonsWare I am trying to access added package here But cant figure what should be key to get packagename from extras of ACTION_PACKAGE_ADDED</p><pre><code>public class ServiceReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {    //Do this when the system sends the intent    Bundle b = intent.getExtras();    String packagename = b.get(?);   //cant figure what should be key to get packagename //from extras    }}</code></pre>","437703","","1288","","2011-05-26 15:27:38","2011-05-26 15:31:47","android: response from market activity","<android><activity><broadcastreceiver><google-play>","2","1","1","",""
"3838874","1","3841368","","2010-10-01 11:54:15","1","1580","<p>I would like to access the public method of an Activity run by a TabActivity using:</p><pre><code>TabHost tabHost = getTabHost();Intent intentMsgsView = new Intent().setClass(this, TeamHuddleScreenMsgsView.class);tabHost.addTab(tabHost.newTabSpec(""msgs"").setIndicator(""Messages"").setContent(intentMsgsView));</code></pre><p>Basically, what I what is to let the parent Activity call a method in child Activity in order to do something. Is this possible?</p><p>I did try this:</p><pre><code>((TeamHuddleScreenMsgsView)getTabHost().getCurrentTabView().getContext()).refreshModel();</code></pre><p>but I'm encountering a ClassCastException. It seems that the getContext() still gives the TabActivity. Any help on how to get the child Activity? </p><p>Thanks.</p>","273259","","","","","2010-10-01 16:57:12","How to access a method of an Activity inside TabActivity","<android>","2","0","1","",""
"3838972","1","3845050","","2010-10-01 12:08:09","1","708","<p>hi i am new to android.What i did is i am creating a xml file with some data.Now i need to add some additional data to existing xml file dynamically.How can i done this.Pls help me.Thank u in advance. </p>","699226","","699226","","2010-10-02 08:51:39","2010-10-02 09:02:53","how to add data to xml file dynamically","<android>","1","1","1","",""
"3839114","1","5161415","","2010-10-01 12:26:38","1","1800","<p>I have a ListPreference which I populate dynamically when clicking on the list to display it.The population works fine, but the values I populate is not displayed until the next time i click to open the list, but instead the values from the xml-file is displayed the first time. It feels like the list has already been populated before the onPreferenceClick is called. How can I refresh the list probably? I want to populate the list before every click in the list.</p><pre><code>     /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  addPreferencesFromResource(R.xml.preferences);  // Get preferences.  prefs = PreferenceManager.getDefaultSharedPreferences(this);  screen = getPreferenceScreen();  // Install on-click listener for calendars.  screen.findPreference(""googleCalendars"").setOnPreferenceClickListener(onSelectCalendarsClick); } /**  * We had a click on select calendars.  */ public OnPreferenceClickListener onSelectCalendarsClick = new OnPreferenceClickListener() {  public boolean onPreferenceClick(Preference pref) {   final String username;   final String password;   final String list;   if (pref == findPreference(""googleCalendars"")) {    username = prefs.getString(""googleUsername"", """");    password = prefs.getString(""googlePassword"", """");    list = ""googleCalendars"";   }   else {    Log.d(TAG, ""onSelectCalendarsClick.run(),unknown list clicked: "" + pref.getTitle());    return false;   }   // Show process dialog while updating.      final ProgressDialog dialog = ProgressDialog.show(Preferences.this, """", ""Fetching calendars, please wait..."", true);      // Show dialog, non cancelable.      dialog.setCancelable(false);       dialog.show();   // Create new updater thread.   new Thread(){    public void run() {     Log.d(TAG, ""onSelectCalendarsClick.run(), new thread. Fetching calendars..."");     // Get calendars     // Create API.     CalendarApi calendarApi = new CalendarApi(prefs.getBoolean(""debugFakeCalendar"", false));     GetCalendarsResponse response = calendarApi.GetCalendars(username, password);     Log.d(TAG, ""onSelectCalendarsClick.run(), new thread. Done!"");     // Create new message and send it.     Message msg = new Message();     Bundle bundle = new Bundle();     bundle.putString(""list"", list);     msg.setData(bundle);     msg.obj = response;     getCalendarsHandler.sendMessage(msg);     // cancel dialog.     dialog.cancel();    }   }.start();   return false;  } }; /**  * Handler for processing response from getCalendars.  */    Handler getCalendarsHandler = new Handler() {      @Override      public void handleMessage(Message msg) {        super.handleMessage(msg);        // We have a new message.        GetCalendarsResponse response = (GetCalendarsResponse)msg.obj;        Bundle bundle = msg.getData();        // Null?        if (response == null || response.calendars == null) {          Log.d(TAG, ""getCalendarsHandler.handleMessage(): response is null."");          return;        }         // Fetch.        ListPreferenceMultiSelect list = (ListPreferenceMultiSelect)screen.findPreference(bundle.getString(""list""));        if (list != null) {          // Ok response.          list.setEntries(response.getEntries());          list.setEntryValues(response.getEntryValues());        }        // Display list preference.        list.getDialog().show();       }    };}</code></pre>","351640","","","","","2011-03-01 22:54:11","Refresh a ListPreference","<android>","1","1","","",""
"3839117","1","3844746","","2010-10-01 12:27:14","19","31417","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3912849/implement-page-curl-on-android"">Implement page curl on android?</a>  </p></blockquote><p>How to do page flipping/turning or curl animation in android ? Is is possible with cocos2d. Please provide any links or example if you know.</p>","363503","","201863","","2011-10-15 22:18:20","2012-02-14 08:59:38","How to do page flip/turn/curl effect in android","<android><flip><cocos2d-android>","2","0","10","2012-11-16 09:14:06",""
"3839308","1","3839929","","2010-10-01 12:54:27","0","1726","<p>I think I should know this, but my mind has gone blank. I'm making an app that has a few hundred small sound files and I want it to play a certain file dependent on a String I pass to the function. Where I hit the brick wall is getting the resId of the sound file.</p><p>I am using this code:</p><pre><code>MediaPlayer mp = MediaPlayer.create(context, R.raw.sound_file_1);mp.start();</code></pre><p>Gotten from here: <a href=""http://developer.android.com/guide/topics/media/index.html"" rel=""nofollow"">http://developer.android.com/guide/topics/media/index.html</a></p><p>All I need is some help passing in a variable resId. Can anyone give me a hand?</p>","348261","","","","","2011-03-14 13:51:48","Playing multiple audio files in Android","<android><audio><media-player>","1","2","0","",""
"3839372","1","3841974","","2010-10-01 13:01:11","3","5008","<p>I'm not a developer, I just dabble in programming. One area I never understand is XML parsing. Sadly, for my latest ""project"" I need to do this very thing for an android app. Its a prototype that I am doing for work.</p><p>I have this XML (a mock-up file):</p><pre><code>&lt;feed version=""201010011221"" &gt;   &lt;period from=""2010-10-01T10:08:34Z"" to=""2010-10-01T10:08:34Z""&gt;     &lt;lines&gt;       &lt;line id=""SKI"" name=""Ski"" shortname=""ski"" status=""1 calls queued""&gt;         &lt;calls&gt;           &lt;call id=""6584"" created=""2010-10-01T11:22:42Z""&gt;            &lt;booking&gt;1275243&lt;/booking&gt;          &lt;/call&gt;         &lt;/calls&gt;       &lt;/line&gt;       &lt;line id=""CRU"" name=""Cruise"" shortname=""cruise"" status=""0 calls queued""&gt;         &lt;calls /&gt;       &lt;/line&gt;       &lt;line id=""VIL"" name=""Villas"" shortname=""villas"" status=""2 calls queued""&gt;         &lt;calls&gt;           &lt;call id=""25878"" created=""2010-10-01T10:22:42Z""&gt;            &lt;booking&gt;1077244&lt;/booking&gt;          &lt;/call&gt;           &lt;call id=""25878"" created=""2010-10-01T10:22:42Z""&gt;            &lt;booking&gt;1077244&lt;/booking&gt;          &lt;/call&gt;         &lt;/calls&gt;       &lt;/line&gt;    &lt;/lines&gt;  &lt;/period&gt; &lt;/feed&gt;</code></pre><p>I have some code that gets me a NodeList of each :</p><pre><code>inputStream = OpenHttpConnection(URL);Document document = null;DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();DocumentBuilder documentBuilder;documentBuilder = documentBuilderFactory.newDocumentBuilder();document = documentBuilder.parse(inputStream);document.getDocumentElement().normalize();NodeList lineNodes = document.getElementsByTagName(""line"");</code></pre><p>I'm not sure what to do next. My code seems quite long for this. I've googled for better methods, but some cleaner code I found, I couldn't get to work.</p><p>Are there any good Android XML tutorials out there? Or can someone assist me with this code?</p><p>I need to get each  into a HashMap where String is the ID.</p><p>Line is class of all info shown.</p><p>ThanksNeil</p>","67419","","","","","2010-10-03 14:22:35","ANDROID: Parsing XML","<java><android>","1","0","2","",""
"3839561","1","3839616","","2010-10-01 13:24:23","-2","273","<pre><code> &lt;string name=""title_new""&gt;Yeni Kamera&lt;/string&gt;</code></pre><p>I have this string in string.xml,</p><pre><code>public void SetTitle(String _title) {    title.setText(_title);}</code></pre><p>And title is a TextView..</p><p>I want to take string for <code>_title</code>, how can I do?</p>","463888","","463888","","2010-10-01 14:00:28","2010-10-01 14:00:28","I can't use my string in Java code. Where is my fault?","<android>","1","1","","",""
"3839583","1","5874820","","2010-10-01 13:26:36","1","1439","<p>I have to write a compass app in Android. The only thing the user sees on the screen is a cube with a red wall which has to point north. This is not important. What's important is that I need to rotate that cube accordingly to the rotation of the device itself so that the red wall continues to point north no matter how the phone is being held. My code is simple and straightforward: </p><pre><code>@Overridepublic void onSensorChanged(SensorEvent event) {    synchronized (this) {        switch (event.sensor.getType()){        case Sensor.TYPE_ACCELEROMETER:            direction = event.values[2];            break;        case Sensor.TYPE_ORIENTATION:            if (direction &lt; 0) {                angleX = event.values[1];                angleY = -event.values[2];                angleZ = event.values[0];            } else {                angleX = -event.values[1];                angleY = -event.values[2];                angleZ = event.values[0];               }            break;        }    }}</code></pre><p>I have added this extra direction variable that simply stores whether the phone's display is pointing downwards or upwards. I don't know if I need it but it seems to fix some bugs. I am using the <a href=""http://code.google.com/p/openintents/wiki/SensorSimulator"" rel=""nofollow"">SensorSimulator</a> for android but whenever my pitch slider goes in the [-90, 90] interval the other variables get mixed up. It's like they get a 180 offset. But I can't detect when I am in this interval because the range of the pitch is from -90 to 90 so I can move that slider from left to write and I will always be in that interval.</p><p>This was all just to show you how far has my code advanced. I am not saying how this problem should be solved because I will only probably stir myself into a dead end. You see, I have been trying to write that app for 3 days now, and you can imagine how pissed my boss is. I have read all sorts of tutorials and tried every formula I could find or think of. So please help me. All I have to do is know how to rotate my cube, the rotation angles of which are EULER ANGLES in degrees.</p>","247927","","","","","2011-05-03 19:45:39","Convert values form Sensor.TYPE_ORIENTATION to Euler angles?","<android><orientation><rotation><cube><euler-angles>","1","0","","",""
"3839634","1","3840885","","2010-10-01 13:32:19","0","1150","<p>I am a beginner android developer and I am trying to have a button display on top of the bitmaps I am outputting.</p><p>Here is what I have:</p><p>my activity sets this:</p><pre><code>setContentView(new FrameView(this));</code></pre><p>FrameView is a class that extends View:</p><pre><code>public FrameView(Context context) {super(context);    setFocusable(false);</code></pre><p>Inside FrameView I have </p><pre><code>@Override protected void onDraw(Canvas canvas){...canvas.drawBitmap(image1.getBitmap(), 0, 0, null);...}</code></pre><p>main.xml is FrameLayout that I stuck a button on top of, that's it.</p><p>I guess my question is, how do I insert something into the main.xml as a ""canvas"" in order to paste my bitmaps to, but still have the button always on top regardless of how many bitmaps i draw?</p>","353674","","","","","2010-10-01 15:56:21","Android Button over Bitmap","<android><layout><button><bitmap>","1","0","","",""
"3839738","1","","","2010-10-01 13:43:21","2","417","<p>When defining keyboard in xml , we use <strong>android:keyIcon</strong> attribute to set the key icon.But when setting the <em>Drawable</em> property - <em>Key.icon</em>, the icon is not getting displayed <em>on</em> the key. Instead, the image is getting displayed in the popup that appears when tapping the key.Is there any other way to set key icon from code?</p>","463881","","946315","","2012-05-23 08:33:49","2012-05-23 08:33:49","Android - How to set key icon from code","<android><android-softkeyboard><android-keypad>","0","0","","",""
"3839739","1","3870599","","2010-10-01 13:43:25","0","325","<p>I have an Java class with a static final method getAll:</p><pre><code>public static final Vector&lt;Category&gt; getAll(Context context, ContentValues where) {    ArrayList&lt;Integer&gt; IDs = null;    if(where != null &amp;&amp; where.containsKey(DatabaseAdapter.KEY_PRODUCT)) {        IDs = OvertureItem.getAll(context, DatabaseAdapter.TABLE_PRODUCT_CATEGORY, new String[] { DatabaseAdapter.KEY_CATEGORY }, where);    } else {        IDs = OvertureItem.getAll(context, DatabaseAdapter.TABLE_CATEGORIES, where);    }    Vector&lt;Category&gt; categories = new Vector&lt;Category&gt;();    for(Integer id: IDs) {        categories.add(Category.get(context, id));    }    return categories;        }</code></pre><p>Now I want to hand in null as a value for the where statemant so that it will just be ignored later on in the code. Anyway in the testcase for this method I have:</p><pre><code>Vector&lt;Category&gt; categories = Category.getAll(context, null);</code></pre><p>Which then in turn gives me a <strong>NoSuchMethodError</strong>. I don't know exactly why it does that. The only thing I could imagine is that the null I hand in would not match the signature of the above method. But how can I overcome this? I already thought of overloading. But this would just end in rewriting most of the code. At least when I do it, how I think. </p><p>Any suggestions on that?</p><p>Phil</p><p>P.S. This is the stack trace I get:</p><pre><code>java.lang.NoSuchMethodError: com.sap.catalogue.model.Category.getAllat com.sap.overture.test.model.CategoryTest.testGetAll(CategoryTest.java:59)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)</code></pre>","463910","","463910","","2010-10-04 07:32:15","2010-10-18 10:38:26","How does Java generate signatures for Methods?","<java><android><junit><method-signature>","2","1","","",""
"3839771","1","","","2010-10-01 13:48:21","0","89","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3840095/aol-im-api-for-android"">AOL IM api for android</a>  </p></blockquote><p>Hi All,i want to develop AIM client application in android ,is there any AIM api for android released?...</p><p>Thanks in advance....</p>","461972","","","","","2010-10-01 13:48:21","AIM client on android","<android>","0","2","","2010-10-01 15:04:47",""
"3839795","1","","","2010-10-01 13:51:02","1","1231","<p>I am developing an Android app to connect to a simple device that supports the bluetooth serial port profile (SPP).  I am able to successfully connect and exchange data, but each time I connect the user is prompted to enter the PIN for the device.</p><p>In the bluetooth settings I can see that the device is 'paired by not connected'.  </p><p>The prompt is an issue because if the user is not quick enough in entering the PIN, the socket connect times out and the user must try again.</p><p>Relevant bits of code below...</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState){  super.onCreate(savedInstanceState);  setContentView(R.layout.scanlayout);  ...    _Context = this;  _ActivityCreated = true;  _ReceivedText = (TextView)findViewById(R.id._Scan_Results);  _BluetoothAdapter = BluetoothAdapter.getDefaultAdapter();  _BluetoothDevice = _BluetoothAdapter.getRemoteDevice(_DeviceAddress);  _BusySpinner = ProgressDialog.show(_Context, """", ""Connecting to scanner..."");  new ConnectToScannerTask().execute(_BluetoothDevice);}private final Handler scanReceivedHandler = new Handler() { @Override public void handleMessage(Message message)  {  String receivedText = (String)message.obj;  _ReceivedText.setText(receivedText); }};private class ConnectToScannerTask extends AsyncTask&lt;BluetoothDevice, Void, InputStream&gt;{ @Override protected InputStream doInBackground(BluetoothDevice... params) {  BluetoothDevice device = params[0];  try  {   _Socket = device.createRfcommSocketToServiceRecord(WELL_KNOWN_UUID);   _BluetoothAdapter.cancelDiscovery();   _Socket.connect();   return _Socket.getInputStream();  }  catch (IOException e)  {   Log.d(""ScanActivity.ConnectToScannerTask.doInBackground"", e.getMessage());  }  return null; } @Override protected void onPostExecute(final InputStream result) {  _BusySpinner.dismiss();  if (result == null)  {   _ReceivedText.setText(""Failed to connect to scanner."");   return;  }      Thread thread = new Thread()      {       @Override       public void run()        {        byte[] buffer = new byte[1024];     try     {      while (_ActivityCreated)      {       Arrays.fill(buffer, (byte) 0);       int bytesRead = result.read(buffer);       if (bytesRead &gt; 0)       {        Message message = scanReceivedHandler.obtainMessage(1, new String(buffer));        message.sendToTarget();        Log.e(""ScanActivity"", ""Received: "" + new String(buffer));       }       if (bytesRead &lt; 0)       {        break;       }      }      Message message = scanReceivedHandler.obtainMessage(1, ""End of Stream"");      message.sendToTarget();      Log.e(""ScanActivity"", ""End of Stream"");     }     catch (Exception e)     {      Message message = scanReceivedHandler.obtainMessage(1, ""Connection to scanner lost"");      message.sendToTarget();      Log.e(""ScanActivity"", e.getMessage());     }     try     {      _Socket.close();     }     catch (IOException e)     {      Log.e(""ScanActivity"", e.getMessage());     }       }      };      thread.start();  } }</code></pre><p>As long as the user is quick about entering the PIN, the connect succeeds and I can receive data.  My hunch is that I am missing a setup step.  I'm not that familiar with the specifics of BT, though, so I am not sure if this might be an issue where the device is forcing the PIN to be entered?</p>","73857","","","","","2011-03-17 19:37:38","Prompted for Bluetooth PIN when connecting to already paired device on Android","<java><android><bluetooth><serial-port>","1","0","","",""
"3839980","1","3840044","","2010-10-01 14:15:44","1","1198","<p>I want to import a project from <a href=""http://android.git.kernel.org/?p=platform/packages/apps/DeskClock.git;a=summary"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/DeskClock.git;a=summary</a> into Eclipse. What steps do I have to go through in addition to the downloading?</p>","25282","","","","","2010-10-01 14:21:37","Loading an Android project from git into Eclipse","<android><eclipse>","1","0","","",""
"3840034","1","5553056","","2010-10-01 14:20:49","2","3438","<p>From my activity I do startActivityForResult(MediaStore.ACTION_IMAGE_CAPTURE),<br>and then I land in the builtin camera activity (in this case in the emulator).</p><p>When I now do:<br>""solo.clickOnButton(0);""<br>in my testcase, it does not find ANY button (null is found for index=0).</p><p>How do I write a Solo/Robotium testcase that uses the builtin camera to take a picture ?</p>","77115","","","","","2013-12-05 15:16:32","How do I write a Solo/Robotium testcase that uses the builtin camera to take a picture?","<android><robotium>","3","0","1","",""
"3840041","1","3840069","","2010-10-01 14:21:20","1","923","<p>How do I ensure code is or is not executed on the UI thread in an Android MapActivity project?</p><p>I am developing an Android map-based application, but I have experienced some stability issues and my research has led me to believe I need to ensure that screen updates are carried out on the UI thread.</p><p>My app has data coming in from a GPS listener (which I would like to configure as a separate thread) and a UDP listener (which is already a separate thread), and it has the usual set of android software life cycle methods, but I must be inexperienced or something, because I have no idea where to put code that updates the map overlays</p><p>(a) on the UI thread,   (b) in a recurring manner.</p><p>I have no preference between a polling or an event-driven process (timer-based perhaps, or the arrival of incoming data), so suggestions of either type will be gratefully accepted.</p><p>Anyone got any ideas??</p><p>Thanks,R.</p>","453989","","","","","2010-10-01 15:43:05","Android MapActivity thread question","<android><multithreading><ui-thread>","3","0","","",""
"3840207","1","9479898","","2010-10-01 14:40:28","11","4455","<p>I have an xml file I wish to transform using an xsl-document, but I can't seem to make it work on even the latest available Android versions.</p><p>I tried adding a <code>&lt;?xml-stylesheet/&gt;</code> tag to the xml, but that didn't work in either the native browser or in Dolphin Browser.</p><p>E.g:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;?xml-stylesheet type=""text/xsl"" href=""style.xsl""?&gt;&lt;xmldata&gt;Hello world&lt;/xmldata&gt;</code></pre><p>and</p><pre><code>&lt;?xml version=""1.0""?&gt;&lt;xsl:stylesheet version=""1.0"" xmlns=""http://www.w3.org/1999/xhtml"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform""&gt;    &lt;xsl:template match=""/xmldata""&gt;        &lt;em&gt;&lt;xsl:value-of select=""/xmldata""/&gt;&lt;/em&gt;    &lt;/xsl:template&gt;&lt;/xsl:stylesheet&gt;</code></pre><p>is supposed to generate italic text, which it does in most desktop browsers (chrome has that annoying shared script root policy that ensures it only works when the files are not located on a local disc.)But it won't work in the mobile browser.</p><p>Is there a way to script the transform to happen client-side, or is the only option to do it server-side?</p>","297189","","","user357812","2010-11-25 15:35:55","2012-02-28 10:03:30","Is the Android Browser capable of performing an xsl transform?","<android><browser><xslt>","8","0","3","",""
"3840661","1","3840732","","2010-10-01 15:32:32","2","1833","<p>I am student and I want to develop a android unlock screen app. I want to know what android api can give me some helps and how can I set my app as the default unlock screen app. Thank you.</p>","464012","","","","","2013-07-25 14:22:12","How to develop a android unlock screen app","<android>","2","3","1","",""
"3840713","1","","","2010-10-01 15:36:48","0","377","<p>Using Mac OSX 10.6.4, device was recognized with the stock 2.1-update1 version.  Manually upgraded to 2.2 (FR91), and device is no longer recognized by adb.  Suggestions?</p><p>/Russ</p>","464024","","31161","","2011-08-04 15:03:44","2011-08-04 15:03:44","Nexus One not recognized after 2.2 upgrade","<android><adb>","2","1","","",""
"3840714","1","3849327","","2010-10-01 15:37:00","2","717","<p>The current method uses AES encrypted files.The goal is to exchange small amounts of private data using AES encrypted <a href=""http://stackoverflow.com/questions/2050263/using-zxing-to-create-an-android-barcode-scanning-app"">QR-codes</a>.</p>","398460","","398460","","2010-10-01 15:42:21","2010-10-03 10:07:12","Can ZXing be used in Android with encrypted QR-codes?","<android><aes><qr-code><zxing>","1","2","1","",""
"3840716","1","","","2010-10-01 15:37:23","0","1093","<p>I'm new to android. Recently I learn how to create Tabwidget. This function is useful. But I find that I cannot add the widgets I want in R.layout.xxxx. So I try to do it by java code. But unfortunately it failed.</p><p>By using XML, I do the following. The program works without problem.</p><pre><code>public class ShowBalanceActivity extends Activity implements AdapterView.OnItemSelectedListener{  private Spinner monthview;  private ArrayAdapter monthadapter;public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.balance);        monthadapter = ArrayAdapter.createFromResource(                this, R.array.months, android.R.layout.simple_spinner_item);        monthadapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);        monthview = (Spinner) findViewById(R.id.monthlist); monthview.setOnItemSelectedListener(this); monthview.setAdapter(monthadapter);    public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id)     {    }}</code></pre><p>For the Java code part, I use the following,</p><pre><code>public class BalanceLayout extends TabActivity implements TabHost.TabContentFactory{    private Activity activity;    private LayoutInflater inflaterHelper = null;      private Spinner monthview = null;    private LinearLayout layout;    private static final String Tab1 = ""By Date"";    private static final String Tab2 = ""By Categories"";    private ArrayAdapter &lt;String&gt; monthadapter = null;    public BalanceLayout (Activity a)     {             activity = a;             inflaterHelper = a.getLayoutInflater();      }public View addCustomView(String id)    {          layout = new LinearLayout(activity);          layout.setOrientation(LinearLayout.VERTICAL);          if(id.equals(Tab1))        {              Spinner monthview = new Spinner(activity);         ArrayAdapter &lt;String&gt; monthadapter = new ArrayAdapter &lt;String&gt; (this,                   android.R.layout.simple_dropdown_item_1line, MONTHS);            monthadapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);            monthview.setAdapter(monthadapter);            monthview.setOnItemSelectedListener(                    new AdapterView.OnItemSelectedListener()                     {                        public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id)                         {                        }                        public void onNothingSelected(AdapterView&lt;?&gt; parentView)                      {                     }                    });            layout.addView(monthview,                      new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));          }          else if(id.equals(Tab2))        {          }          return layout;      } }</code></pre><p>But it causes force close when I execute the program. It seems that I cannot use findViewById method to create the view like XML.</p><p>I read many documentations and search android docs and internet. I cannot find the solution. Hope that some of you know what happened to my code and solution to solve </p><p>Thanks !!</p><p>Tom</p>","463451","","21234","","2010-10-02 11:48:35","2010-10-02 11:48:35","Adding spinner via java code rather than XML in Tabwidget","<android><tabwidget>","1","0","","",""
"3841043","1","3841247","","2010-10-01 16:15:41","4","7476","<p>i seem to have a classic task, yet i can't find any examples on how to do it.</p><p>i want to download something. well i call a web service and get a response... but its pretty much the same.</p><p>in order to do this i have an activity that starts a service that spawns a thread that does the job.</p><p>now i would like to use the data i got in the activity that started the service.</p><p>(i assume that starting another activity to handle the job of displaying the result would be simple)</p><p>my problem is how does the service notify an activity (the one that started it or another one) of something.</p><p>any pointers to examples are much appreciated.</p><p>regards</p>","428433","","","","","2010-10-01 16:40:47","how does a service return result to an activity","<android><service><activity><notifications>","1","0","2","",""
"3841095","1","3841115","","2010-10-01 16:20:58","7","6338","<p>Is is possible for me to publish an android app on my own website and not use android market. The app is for use with our internet software services and is therefor only in the interest of our existing clients.</p><p>The second questions is, can I install updates to my app after it is installed or would I have to use the market to accomplish that task?</p>","463304","","","","","2014-04-08 07:31:13","Install (and update) android app from my own website and not market","<android>","2","1","2","",""
"3841119","1","3841224","","2010-10-01 16:24:05","2","1528","<p>I want to read a Open Office Document spreadsheet (.ods file) from my android application. I need to basically loop through the first two columns &amp; store them in a SQLite database. </p><p>I am able to do this by reading a regular <strong>text</strong> file stored in res/raw using the following code:</p><pre><code>    InputStream is = context.getResources().openRawResource(R.raw.my_text_file);</code></pre><p>But no clue how to do the same for an <strong>.ods</strong> file.</p><p>I searched through SOF &amp; found a reference to  <a href=""http://www.jopendocument.org/start_spreadsheet_2.html"" rel=""nofollow"">jOpenDocument</a> . But they talk about libraries that are not part of the android SDK &amp; I don't know what to do with these.</p><p>Any help is appreciated!</p>","289918","","","","","2013-10-29 05:41:43","How to read an OpenOffice document spreadsheet from an android application?","<android><openoffice-calc>","3","0","","",""
"3841122","1","5110406","","2010-10-01 16:24:18","53","26789","<p>I am using a Preview to display what the camera see's on the screen.</p><p>I can get everything working fine, surface created, surface set and the surface is displayed.</p><p>However it always displays the picture at an incorrect 90 degree angle in portrait mode.</p><p>Such as in the picture:</p><p><img src=""http://i.stack.imgur.com/PuWMu.jpg"" alt=""alt text""></p><p>I am aware that using the following code will set the picture straight:</p><pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);</code></pre><p>However I have the Preview within an Activity that has other elements in it and it does not make sense for my Activity to be displayed in landscape mode. (Its disabled by default)</p><p>So I was wondering is there anyway to just change the orientation of the Preview? And leave the rest of my Activity correctly displayed in Portrait mode?</p><p>Or anyway to rotate the preview so that it is displayed correctly?</p>","243999","","","","","2014-03-16 22:13:23","Android - Camera preview is sideways","<android><camera><orientation><preview><portrait>","5","1","39","",""
"3841231","1","3890800","","2010-10-01 16:39:30","7","4801","<p>I am trying to do something similar to <a href=""http://stackoverflow.com/questions/3682021/uislider-with-certain-possible-values"">this</a> but in Android.</p><p><img src=""http://i.stack.imgur.com/QjLXY.png"" alt=""alt text""></p><p>In Android I can extend the <code>ProgressBar</code> but I am doubting of how to add the <code>TextViews</code> on top. In iphone it was easy because I can use absolute positions, but not here.</p><p>Any ideas?</p><p>EDIT:I decided to use <code>SeekBar</code> instead of <code>ProgressBar</code> to add the thumb drawable. I commented below. Some points to notice:</p><ul><li>I am using hardcoded values, actually three but it can be more or less.</li><li>When the thumb is moved it moves to 50 but it should move to the different options.</li><li>I am using pixels instead of dpi. I should fix that.</li><li>I need to solve the lack of animation when the thumb moves.</li></ul><p>My progress so far:</p><pre><code>public class SliderFrameLayout extends FrameLayout implements OnSeekBarChangeListener {    private SeekBar mSlider;    private Context mContext;    private int mSize = 3;    private TextView[] mTextViews;    private String[] mTexts = {""Nafta"", ""Gas"", ""Gasoil""};    public SliderFrameLayout(Context context, AttributeSet attrs) {        super(context, attrs);        mContext = context;        setWillNotDraw(false);        mTextViews = new TextView[mSize];        addSlider();        addTextViews();    }    private void addTextViews() {        for ( int i=0 ; i &lt; mSize ; i++ ) {            TextView tv;            tv = new TextView(mContext);            tv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,                    LayoutParams.WRAP_CONTENT));            tv.setText(mTexts[i]);            mTextViews[i] = tv;            addView(tv);            }    }    private void addSlider() {        FrameLayout fl = new FrameLayout(mContext, null);        LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);        fl.setLayoutParams(params);        fl.setPadding(30, 30, 30, 0);        mSlider = new SeekBar(mContext, null);        LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);        //lp.setMargins(30, 30, 30, 0);        //mSlider.setPadding(30, 30, 30, 0);        mSlider.setLayoutParams(lp);        //mSlider.setMax(mSize-1);        mSlider.setThumbOffset(30);        //mSlider.setProgressDrawable(mContext.getResources().getDrawable(R.drawable.slider_track));        //mSlider.setThumb(mContext.getResources().getDrawable(R.drawable.slider_thumb));        mSlider.setOnSeekBarChangeListener(this);        //addView(mSlider);        fl.addView(mSlider);        addView(fl);    }    @Override    protected void onDraw(Canvas canvas) {        super.onDraw(canvas);        Rect rectf = new Rect();        mSlider.getLocalVisibleRect(rectf);    Log.d(""WIDTH        :"",String.valueOf(rectf.width()));    Log.d(""HEIGHT       :"",String.valueOf(rectf.height()));    Log.d(""left         :"",String.valueOf(rectf.left));    Log.d(""right        :"",String.valueOf(rectf.right));    Log.d(""top          :"",String.valueOf(rectf.top));    Log.d(""bottom       :"",String.valueOf(rectf.bottom));        int sliderWidth = mSlider.getWidth();        int padding = sliderWidth / (mSize-1);        for ( int i=0 ; i &lt; mSize ; i++ ) {            TextView tv = mTextViews[i];            tv.setPadding(i* padding, 0, 0, 0);        }    }    @Override    public void onProgressChanged(SeekBar seekBar, int progress,            boolean fromUser) {        // TODO Auto-generated method stub    }    @Override    public void onStartTrackingTouch(SeekBar seekBar) {        // TODO Auto-generated method stub    }    @Override    public void onStopTrackingTouch(SeekBar seekBar) {        Log.d(""SEEK"", ""value: "" + seekBar.getProgress());        seekBar.setProgress(50);    }}</code></pre>","119895","","119895","","2010-10-08 14:00:16","2010-10-08 14:00:16","Custom ProgressBar widget","<iphone><android><progress-bar>","4","2","8","",""
"3841315","1","3841468","","2010-10-01 16:50:35","3","3550","<p>I am writing an app that allows a user to set the phone's wallpaper from a list of pictures. By default it scrolls across the multiple home screens. I want the wallpaper on the home screen  to be a static non-scrolling image.</p><p>What can I do programmatically to achieve this? Is this even possible?</p><p>I am using <code>wallpaperManager.setResource(...);</code>  to set the wallpaper.</p><p>I've also tried <code>wallpaperManager.setWallpaperOffsetSteps(0,0);</code>  but that did not solve my problem.</p>","464076","","321366","","2012-01-09 09:39:23","2012-08-26 06:08:25","Can I programmatically set a wallpaper to not scroll?","<android>","4","0","1","",""
"3841317","1","3841407","","2010-10-01 16:51:11","65","53563","<p>I don't want my user to even try downloading something unless they have wifi connected.  However I can only seem to be able to tell if wifi is enabled, but they could still have a 3g connection.  </p><pre><code>android.net.wifi.WifiManager m = (WifiManager) getSystemService(WIFI_SERVICE);android.net.wifi.SupplicantState s = m.getConnectionInfo().getSupplicantState();NetworkInfo.DetailedState state = WifiInfo.getDetailedStateOf(s);if( state != NetworkInfo.DetailedState.CONNECTED ){            return false;        }</code></pre><p>However the state is not what I would expect, even though wifi is connected I am getting <code>OBTAINING_IPADDR</code> as the state.</p>","384306","","","","","2014-04-03 11:21:02","how to see if wifi is connected in android","<android><android-wifi><wifimanager>","7","0","30","",""
"3841381","1","3841703","","2010-10-01 16:58:30","0","950","<p>In my android app I call the voice recognition in my onCreate method of my startup activity.  I have made it a preference to start up with the voice control or not.  However, the app takes about 5-7 seconds to load when voice recognition is on.  When it is off, the app starts almost instantly. Below is sample code, I have added Free_Form, max_results 1, and a custom prompt to mine.</p><pre><code>Intent intent = new Intent(""android.speech.action.RECOGNIZE_SPEECH"");  startActivityForResult(intent, 0);</code></pre><p>So really I have 2 questions:</p><p>Isn't the startActivity(intent) run in a separate thread?</p><p>Why would calling the normal android speech recognition take sooo long to load in my OnCreate method?</p>","251849","","","","","2011-06-15 05:00:32","Android Voice Recognition activity called in 'onCreate' method causes app to load slowly","<android><performance><voice-recognition>","2","2","1","",""
"3841516","1","","","2010-10-01 17:16:14","1","539","<p>Given that AIDL contain interface definitions, it is important to incorporate them into our javadoc. By default ""Generate Javadoc"" option in Eclipse only parse files with extension *.java. Is there a javadoc extension for AIDL?</p>","440093","","","","","2014-04-15 16:38:51","Android: How to provide AIDL files as source to javadoc?","<android><javadoc>","1","0","1","",""
"3841758","1","3842589","","2010-10-01 17:47:38","1","949","<p>My current WCF REST Method is defined as:</p><pre><code>[OperationContract][WebGet(UriTemplate = ""{username}/{password}"", ResponseFormat =                                                                           WebMessageFormat.Json)]string Login(string username, string password);</code></pre><p>An android client app is going to connect to the service, let's say it is <a href=""http://service.com/login.svc/login"" rel=""nofollow"">http://service.com/login.svc/login</a>...</p><p>But I don't want the username and password to be passed in the url like I have specified in the UriTemplate.  How can I receive the username and password from the android app into my service, or better yet, how can I change my login method to retrieve the username and password in some POST parameters that I can process in my login function and validate the user against a sql membership database.</p>","33690","","","","","2010-10-04 12:39:48","Reading username and password sent from and Android app into my WCF REST Service?","<c#><android><wcf><rest>","1","0","","",""
"3841786","1","","","2010-10-01 17:50:50","3","1630","<p>I would like to play frame by frame with the videoview.I have this:</p><blockquote>  <p>mVideoView.seekTo(mVideoView.getCurrentPosition()+1);</p></blockquote><p>But after this I do not see the frame until I click play... I do not want that, I just want to see the next frame.</p><p>Also - can I do the same for previous frame?</p><p>Thanks in advance.</p>","380490","","","","","2013-07-23 10:42:19","VideoView and step play (frame by frame)","<android><videoview>","2","0","3","",""
"3841960","1","3842379","","2010-10-01 18:16:14","0","150","<p>Is it possible to install an update an android app without the user even knowing or caring about it? I am looking to do what Google Chrome has done.</p><p>I am planning to upload my app to my own website instead of the market.</p><p>Thanks!</p>","463304","","463304","","2010-10-01 19:59:30","2013-09-08 14:50:43","Sending unnoticed updates to an android app","<android>","5","2","","",""
"3842150","1","3842281","","2010-10-01 18:46:53","2","3924","<p>I have a few dozen activities: 1-Main, 1-Animation, 10-Other's and it's sub-sets of more activities (couple of dozen).</p><p>From the Main, you can go to any of the <em>Others</em> via buttons.  </p><p>The <em>Others</em> call <em>sub-set</em> activities and they call the Animation activity.  </p><p>Each of the activities, including sub-sets and Animation, has a button to return to the Main activity.</p><p>All buttons take user to correct activity.</p><p><strong>The issue</strong>: From the Main activity, I want to quit via using the device's Back key. But, what happens is that it steps backward through all the previous activities.  </p><p>The ""return to main"" buttons (in each activity) has <em>finish</em> and <em>onDestroy</em> in it. So, I'm not sure why those screen/activities aren't destroyed...?</p><p>Any comments/suggestions/clarifications is appreciated - thanks</p><p>[adding code snippet]  </p><p>Note: I moved/added/deleted the finish, onDestroy, onStop... tried many ways so what shows in the snippet is only one way I tried...</p><pre><code>    //  ---------------------------------------------------------mainMenu.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        // do something        Intent Maincode = new Intent();          Maincode.setClassName(                              ""com.bt.test"",                              ""com.bt.test.Maincode"");        //  startActivity(Maincode); // go to maincode            finish();          onStop();        onDestroy();        startActivity(Maincode); // go to maincode      }}); // end -----------------------------------------------</code></pre>","382200","","382200","","2010-10-01 19:35:58","2012-07-18 02:17:23","Android: Multiple Activities and OnDestroy Question","<android><activity><destroy>","3","0","","",""
"3842375","1","3843396","","2010-10-01 19:22:24","7","4264","<p>So I can inflate a ViewStub at runtime. Let's say I want to make it disappear and then maybe inflate again depending on some event occurring (for example, a toolbar that inflates and deflates according to what the user selects on screen).</p><p>I can use View.setVisibility(View.GONE).... is there any other way?</p><p>Or am I doing something wrong here?  </p><p>Thanks! :)</p>","392178","","392178","","2011-10-21 19:27:45","2012-06-03 16:39:52","How to ""deflate"" a ViewStub?","<android><deflate><inflate><viewstub>","2","4","1","",""
"3842509","1","","","2010-10-01 19:42:51","3","5370","<p>Long time reader, first time poster.</p><p>In Android, capturing date from datepicker and storing as string in sqlite.  Sorting by date doesn't work because they're strings (unless I'm doing it wrong.</p><p>I've googled this issue for ~5 days, and it looks like there should be a way to capture the date from the date picker, convert it to a Long, store it in sqlite as a Long, select and sort on the Long date value, then convert the Long back to a ""mm/dd/yyyy"" string for display.  I've tried various combinations of parse statements, Date, FormatDate, etc. with no luck at all.</p><p>My actual application flow would be:On activity start, get today's date and display it in button which calls the datepicker.Capture new date from datepicker (if one is entered), save it as a long to sqlite.On opening an activity showing a listview of records, select from sqlite with orderby on date (Long), convert Long to ""mm/dd/yyyy"" string for display in ListView.</p><p>If someone could point me at a code sample, it would be greatly appreciated - thanks!</p><p>Evan</p>","464194","","","","","2010-10-02 03:53:10","Android java datetime values from String to Long to String issue","<java><android><string><parsing><datetime>","3","0","","",""
"3842525","1","3847064","","2010-10-01 19:45:01","0","701","<p>I have a button that says ""Sort"" and when a user normal/short presses the button, I want a menu to appear with the various sort options.  Looking around online there doesn't seem to be a straight forward answer to which route is considered best practice.  I'm looking to have a menu that looks similar to this: <a href=""http://farm3.static.flickr.com/2770/4439466826_d3ecfdae5c_z.jpg"" rel=""nofollow"">http://farm3.static.flickr.com/2770/4439466826_d3ecfdae5c_z.jpg</a> with icons and text.</p><p>For an example, click the Layers button in the Google Maps app.  It opens a list of options on a single short click.  It has a title at the top and icons for each option.  (The icons aren't super crucial)</p><p>Should I use a Context Menu?  If so, how do I do it without a long press.  Should it be a Spinner?  If so how do I change the appearance to use a button instead of the normal drop down box.</p><p>Thanks</p>","445348","","","","","2010-10-02 18:40:05","What is the best practice for opening a context-menu-like menu from a short button click?","<android><button><menu><context><spinner>","2","0","","",""
"3842713","1","","","2010-10-01 20:10:26","1","444","<p>I have am developing an android app for V2.2 onwards.</p><p>The app is for numeric data input for the elderly </p><p>To keep things nice and simple, I am using the phone style input method.  This also has the advantage of using nice big keys for them.</p><p>In landscape mode, I would like to move the virtual keyboard and position it on the right hand side of the view.  The content itself has much more height than width and it would be perfect to have the screen split down the middle horizontally with the content on the left and the virtual keyboard on the right.</p><p>Does anyone know if this is possible?</p><p>Thanks</p>","464179","","","","","2010-10-01 20:10:26","Reposition android virtual keyboard to right of screen in landscape mode","<android>","0","2","0","",""
"3842940","1","4796303","","2010-10-01 20:47:46","3","187","<p>Here is what I want to develop</p><p>Let's say there is an application called 'A'.When 'A' is running, 'A' checks if it is available on the Market.If it is in the Market, 'A' launches Market and is redirected to the market detail page.If it is not in the market, 'A' keeps running without launching the Market</p><p>I know an application can launch/search Market by sending ACTION_VIEW Intent. But what I want to do is to get if an application exists on the market or not without launching the market.Is it possible?</p>","419893","","","","","2011-01-25 16:44:01","Searching applications without launching Market","<android><google-play>","1","0","2","",""
"3843093","1","","","2010-10-01 21:15:32","6","5969","<p>Google is suggesting that developers might want to obfuscate byte code:</p><p><a href=""http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html"">http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html</a></p><p>I followed Google's instructions to get an obfuscated Android app that, at first glance, seemed to work. But there were some strange bugs introduced that are not in the un-obfuscated app. I kept turning off ProGuard options to get to this configuration:</p><p>-dontoptimize-dontshrink-dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontpreverify-verbose</p><p>Still the bugs are there. Is there anything else I can turn off to get only pure obfuscation? Obfuscation would be nice, but I am willing to turn off ProGuard's other features.</p>","464256","","","","","2010-11-18 12:27:46","How to turn off all Android ProGuard features except obfuscation?","<android><obfuscation><proguard>","1","0","4","",""
"3843242","1","3891693","","2010-10-01 21:46:45","1","1028","<p>I have a query in my android app that pulls all image paths from a custom table and displays them to a gallery.  The problem is with my database I cant seem to get a row of the database to a String[]. I can easily get the results to a listArray but I need the image path in a string or string array.  I want to be able to click on an image in the gallery and have it pull up full screen to be able to zoom in on it or delete it etc.  This is the basic query i use</p><pre><code>public void listimages() {    SimpleCursorAdapter adapter;    String[] columns = {""Image"", ""ImageDate"", ""_id""};    query = new TableImages(this);    queryString = query.getData(""images"", columns, null, null, null, null, ""ImageDate"", ""DESC"");    int to[] = {R.id._id1, R.id._id2};    adapter = new SimpleCursorAdapter(this, R.layout.imagelist, queryString, columns, to);    Gallery g = (Gallery) findViewById(R.id.gallery);    g.setAdapter(adapter);    g.setOnItemClickListener(this);    try {        query.destroy();    } catch (Throwable e) {        e.printStackTrace();    }}public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {    Intent i = new Intent(ViewAllImages.this, ImageViewer.class);    Bundle b = new Bundle();    //I want to be able to use this -&gt; b.putString(""image_path"", Image);    b.putlong(""id"", id);    i.putExtras(b);    startActivity(i);}</code></pre><p>This passes the ID to my next activity and the next activity queries the DB pulling that one image path.  I still have to use a listview to display the image which makes the app crash on the phone due to memory usage (image is too large).</p><p>I can compress the image but I need the path as a string and I cant figure out how to do that without creating a custom content provider or adding a textview and using gettext.toString and thats just getto.  My head is killing me as it is with all the reading and coding I have done lol.  I have searched all over Google and different forums but I am having problems finding an answer.</p><p>Is there a way to use the existing query and get a string or a string array as the result?</p><p>Thanks.</p>","447560","","447560","","2010-10-02 02:08:03","2010-10-08 14:47:13","Android: Cursor results to String[]","<android><string><cursor>","1","0","","",""
"3843368","1","","","2010-10-01 22:12:27","1","339","<p>could you please have a look at this</p><pre><code>if(current.getTimeInMillis() &lt; cal.getTimeInMillis()){      //current.add(Calendar.MINUTE, 15);      alarms.setRepeating(AlarmManager.RTC_WAKEUP, current.getTimeInMillis(), AlarmManager.INTERVAL_FIFTEEN_MINUTES, alarmIntent);      Toast.makeText(this, ""Alarm will go of 15mins from now"", Toast.LENGTH_SHORT).show();     }else {       alarms.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), alarmIntent);       Toast.makeText(this, ""Alarm set in "" + cal.getTimeInMillis() + "" seconds"",         Toast.LENGTH_LONG).show();     }</code></pre><p>current.getTimeInMillis() is the system time and cal.getTimeInMillis() is a set time that i want an event to occur. i am trying to make an alarm every 15 mins as long as the system time is not greater than the designated set time and when the set time has reached, the alarm should go off. but my problem is, it keeps repeating every 15 minutes even after the past set time and it completely ignores the code in the else block.Am i doing the logic incorrectly?.. Any ideas will be greatly appreciated. Thank you.</p>","316843","","316843","","2010-10-01 22:25:11","2010-10-01 22:25:11","Alarm keeps triggering after set time","<android>","0","4","","",""
"3843510","1","","","2010-10-01 22:49:38","0","272","<p>If I call a requestLayout() on a View, shouldn't it call invalidate() on the same View, forcing the view to be drawn after the layout recalculations are done?</p>","450201","","","","","2010-12-17 00:41:47","Layout and Draw architecture on android","<android>","1","0","","",""
"3843704","1","","","2010-10-01 23:39:57","1","1571","<p>My Android app is experiencing this crash randomly during operation, and I think it is due to a pending MotionEvent that is dispatched to a null object, but not sure.</p><p>here is the crash output:</p><pre><code>java.lang.NullPointerExceptionat android.webkit.BrowserFrame.getRequestInterceptor(BrowserFrame.java:1108)at android.webkit.FrameLoader.handleRequestIntercept(FrameLoader.java:426)at android.webkit.FrameLoader.handleHTTPLoad(FrameLoader.java:226)at android.webkit.WebViewWorker.handleMessage(WebViewWorker.java:124)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.os.HandlerThread.run(HandlerThread.java:60)</code></pre><p>My Android app manually creates a custom WebView and adds it to the ViewGroup in the Activity.onCreate() method like this:</p><pre><code>ViewGroup groupA = (ViewGroup)findViewById(R.id.frame_layout_rowA);webViewRowA = new MyWebView(this);groupA.addView(webViewRowA);</code></pre><p>The reason for doing it this way was to be able to get to the constructor for the WebView in order to pass <em>getApplicationContext()</em> instead of <em>this</em> to the constructor, which was a workaround for a memory leak in 2.1.</p><p>The issue, I think, is that this Activity is restarted frequently.  This causes the normal chain of onStop(), onDestroy(), onCreate(), etc... to happen often. </p><p>So my question is, could the crashes be due to a MotionEvent being dispatched to an instance of MyWebView that was attached to an old Activity that has been garbage collected?  Such as if the user clicked something in a webview right before this actvity was recycled?</p><p>Another thing to note is I'm seeing these messages following a call to onDestroy()</p><pre><code>/webviewglue(  436): nativeDestroy view: 0xd738d0</code></pre><p>Any help or insight anyone might have, would be greatly appreciated.  I've been banging away at this issue for a while now.</p><p>Oh, one other thing to note....this started happening in Android OS 2.2.  I've submitted a bug to Google, but not sure it is their issue.</p><p>Thanks in advance.</p>","83370","","83370","","2010-10-01 23:48:49","2010-10-15 19:10:13","How to fix Android WebView crash due to pending MotionEvent","<android><nullpointerexception><android-webview>","1","0","2","",""
"3843772","1","3843877","","2010-10-02 00:02:23","0","354","<p>Can someone please tell me where I'm going wrong with this piece of code? Basically I want the app to download a .png file, display it to the user and also save it to the sd card for future reference. It seems to be all going fine until the <code>while ((len = webstream.read(buffer)) &gt; 0)</code> part; as the debugger doesn't reach the breakpoint I've put in here, and I have a directory of empty .png files. I have the <code>WRITE_EXTERNAL_STORAGE</code> permission declared in my Manifest. </p><pre><code>protected class DownloadTask extends AsyncTask&lt;String, Integer, Bitmap&gt; {    @Override    protected Bitmap doInBackground(String... string) {        Bitmap d = null;        try {            DefaultHttpClient dhc = new DefaultHttpClient();            HttpGet request = new HttpGet(HTTP_BASE + string[0] + "".png"");            HttpResponse response = dhc.execute(request);            BufferedInputStream webstream = new BufferedInputStream(response.getEntity().getContent());            d = BitmapFactory.decodeStream(webstream);            writeToSd(string[0], webstream, d);        }        catch (Exception ex) { ex.printStackTrace(); }        return d;    }    private void writeToSd(String string, BufferedInputStream webstream, Bitmap d) {        try {            webstream.mark(3);            webstream.reset();            File f = new File(Environment.getExternalStorageDirectory() + SD_DIR);            f.mkdirs();            File f2 = new File(f, string + "".png"");            f2.createNewFile();            BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(f2));            int len;            byte[] buffer = new byte[1024];            while ((len = webstream.read(buffer)) &gt; 0) {                fos.write(buffer, 0, len);            }            webstream.close();            //fos.flush();            fos.close();        }        catch (Exception ex) {            ex.printStackTrace();        }    }    protected void onPostExecute(Bitmap result) {        if (result != null) {            iv.setImageBitmap(result);            vs.setDisplayedChild(1);        }    }};</code></pre>","428665","","","","","2010-10-02 01:20:28","SD card writing fails?","<java><android><inputstream><sd-card>","2","0","","",""
"3843782","1","3843825","","2010-10-02 00:06:02","2","276","<p>I want to be able to have two projects, one that contains production code and one that contains test code.  </p><p>This shouldn't necessarily be an Android-specific question, but I'm want to write some unit tests for some non-platform-specific Android code on the host PC.  </p><p>I created a new Java project so I can run the unit tests on the PC and only include the non-platform-specific classes from the Android project.  Both projects are opened in the same Eclipse workspace. </p><p>I assume I need to somehow include these Android-project sources explicitly in the new project where I'll run the Junit tests, but I can't figure out how to do this.</p><p>Thanks! </p>","403455","","","","","2010-10-02 00:43:55","How can I write tests in one Eclipse project for classes from another Eclipse project?","<java><android><eclipse><unit-testing>","3","0","","",""
"3843814","1","4915160","","2010-10-02 00:19:05","1","855","<p>when the orientation changes, the seekbar drawing is messed up. See voice call and alarm below:<img src=""http://i.stack.imgur.com/2RcDf.png"" alt=""alt text""></p>","398148","","","","","2011-06-24 17:59:36","android seekbar drawing problem on orientation change","<android><android-widget><seekbar>","2","4","","",""
"3843841","1","","","2010-10-02 00:27:27","0","430","<p>I'm developing an Android application, but I want to restrict my application to only be accessible by hardware that is not running a rooted/custom ROM. I know about Android's Forward Locking content protection, but would like to double check this protection from within my app. Is there any way to get the signature of the device along with a trusted signature of the ROM using android API's so that I lock my app out from Custom ROMs?</p>","464337","","","","","2013-07-02 13:16:13","How to determine if OS is a custom ROM from an App?","<android><digital-signature><rom>","3","0","1","",""
"3843853","1","3844376","","2010-10-02 00:30:31","4","5260","<p>I have a GLSurfaceView with a drawable as background, however only the background is visible when rendered without surfaceView.setZOrderOnTop(true)</p><p>I need to avoid using setZOrderOnTop(true) because there are static TextView's being used on top of the GLSurfaceView.</p><p>Any suggestions for getting this to work?</p>","199966","","190309","","2014-03-11 03:22:46","2014-03-11 03:22:46","Android GLSurfaceView with drawable background","<android><opengl-es><background><drawable><glsurfaceview>","4","0","1","",""
"3843966","1","4309815","","2010-10-02 01:22:13","3","1851","<p>I created an NTLM authenticating SOAP client based on KSOAP-Android and JCIFS. The implementation looks something like this:</p><pre><code>public class NtlmServiceConnection implements ServiceConnection {    public NtlmServiceConnection(final SoapConnectionInfo connectionInfo, String path)          {        httpclient = new DefaultHttpClient();        httpclient.getAuthSchemes().register(AuthPolicy.NTLM, new NTLMSchemeFactory());    //...    @Override    public InputStream openInputStream() throws IOException {        ByteArrayEntity re = new ByteArrayEntity(bufferStream.toByteArray());        post.removeHeaders(""CONTENT-LENGTH"");        post.setEntity(re);        HttpResponse rep = httpclient.execute(post);        InputStream stream = rep.getEntity().getContent();        return stream;    }    //....}</code></pre><p>From the looks of it KSOAP is generating the correct message because <code>bufferStream</code> is populated with the SOAP envelope as expected. JCIFS seems to be doing its job as well as I can see the NTLM challenge response taking place via Wireshark. The issue is that the message body is missing. It is simply null. Due to this the web service encounters a 501 and the <code>InputStream</code> returned is null. </p><p>Anyone have a clue why this would happen? </p><p><em>Note: I'm removing the CONTENT-LENGTH header below because <code>setEntity</code> apparently tries to set this but KSOAP has already set it. I simply remove it and allow <code>setEntity</code> to reset it.</em></p>","13688","","","","","2010-11-30 01:44:05","KSoap-Android\JCIFS sends empty HTTP post","<android><http><ntlm><ksoap2><jcifs>","1","0","","",""
"3843972","1","3844807","","2010-10-02 01:24:33","2","1263","<p>I'm working on an Android class that extends MapActivity. I have set the OnTouchListener and everything works okay for the first MotionEvent. After the first MotionEvent, the system stops either generating MotionEvents or receiving them or both. Does anybody know what I have to do to keep receiving MotionEvents? Thanks.</p><pre><code>@Override public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    MapView mapView = (MapView) findViewById(R.id.mapview);    mapView.setBuiltInZoomControls(true);    mapView.setOnTouchListener(new View.OnTouchListener( ) {            @Override public boolean onTouch(View v, MotionEvent event) {            Log.i(TAG, ""onTouch called"");            switch(event.getAction()) {            case MotionEvent.ACTION_DOWN:                Log.i(TAG, ""ACTION_DOWN: x = "" + event.getX() + "", y = "" + event.getY());                break;            case MotionEvent.ACTION_UP:                Log.i(TAG, ""ACTION_UP: x = "" + event.getX() + "", y = "" + event.getY());                break;            case MotionEvent.ACTION_CANCEL:                Log.i(TAG, ""ACTION_CANCEL: x = "" + event.getX() + "", y = "" + event.getY());                break;            case MotionEvent.ACTION_OUTSIDE:                Log.i(TAG, ""ACTION_OUTSIDE: x = "" + event.getX() + "", y = "" + event.getY());                break;            case MotionEvent.ACTION_MOVE:                Log.i(TAG, ""ACTION_MOVE: x = "" + event.getX() + "", y = "" + event.getY());                break;            }            v.onTouchEvent(event);            return true;   // I also tried return false here, that didn't fix anything        }    });</code></pre>","459550","","","","","2010-10-02 07:34:02","Android MapView stops generating (or receiving?) events","<android><events>","1","0","","",""
"3844231","1","","","2010-10-02 03:23:20","1","2040","<p>I am writing a teleprompter app for the Android and i am trying to get the script to automatically scroll at a definable rate. I have attempted to do so by extending Scrollview and writing a new SmoothScrollBy function. Here is my code.</p><p>Custom ScrollView:</p><pre><code>import android.content.Context;import android.util.AttributeSet;import android.util.Log;import android.view.ViewConfiguration;import android.view.animation.AnimationUtils;import android.widget.ScrollView;import android.widget.Scroller;public class myScrollView extends ScrollView {static final int ANIMATED_SCROLL_GAP = 250;private long mLastScroll;static final float MAX_SCROLL_FACTOR = 0.5f;private Scroller mScroller;public myScrollView(Context context) {    super(context);    initScrollView();}public myScrollView(Context context, AttributeSet attrs){    super(context,attrs);    initScrollView();}public myScrollView(Context context, AttributeSet attrs, int defStyle){    super(context,attrs, defStyle);    initScrollView();}private void initScrollView(){    mScroller = new Scroller(getContext());    setFocusable(true);    setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);    setWillNotDraw(false);}public final void smoothScrollBy(int dx, int dy, int dur) {    if (getChildCount() == 0) {        // Nothing to do.        return;    }    long duration = AnimationUtils.currentAnimationTimeMillis() - mLastScroll;    if (duration &gt; ANIMATED_SCROLL_GAP) {        final int height = getHeight() - getPaddingBottom() - getPaddingTop();        final int bottom = getChildAt(0).getHeight();        final int maxY = Math.max(0, bottom - height);        final int scrollY = getScrollY();        dy = Math.max(0, Math.min(scrollY + dy, maxY)) - scrollY;        Log.d(""scroll dy"", ""from"" +  Integer.toString(getScrollY()) + ""to"" + Integer.toString(dy));        mScroller.startScroll(getScrollX(), getScrollY(), 0, dy, dur);        invalidate();    } else {        if (!mScroller.isFinished()) {            mScroller.abortAnimation();        }        Log.d(""scroller"", ""fallback"");        scrollBy(dx, dy);    }    mLastScroll = AnimationUtils.currentAnimationTimeMillis();}}</code></pre><p>Calling function:</p><pre><code>    ((myScrollView)findViewById(R.id.ScrollView01)).setOnTouchListener(new OnTouchListener() {        @Override        public boolean onTouch(View v, MotionEvent event) {            long delta = event.getEventTime() - event.getDownTime();             if(event.getAction() == MotionEvent.ACTION_UP &amp;&amp; delta &lt; 200){                ((myScrollView)v).smoothScrollBy(0, v.getHeight(), 30000);            }            return false;        }    });</code></pre><p>Am I doing something wrong? When I do a single tap. Nothing happens.</p><p>Thanks.</p>","464396","","","","","2010-10-02 03:23:20","Android - How can i get a scrollView to scroll automatically at a definable rate?","<java><android><eclipse><scrollview><scroller>","0","2","","",""
"3844363","1","","","2010-10-02 04:15:24","1","1403","<p>I've seemingly tried every setting in various articles on the internet including excluding all of my classes through <code>-keep public class</code>.</p><p>What settings should be used to not force close?  At this point if I could get obfuscation with nothing else would be fine.</p><p>Below are sample configurations I've tried and my app still force closes.  Any ideas?<br>I followed this article as well as others: <a href=""http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html"" rel=""nofollow"">http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html</a></p><p>Still no luck.  Any help would be appreciated.Thanks</p><pre>-optimizationpasses 5-dontusemixedcaseclassnames-dontskipnonpubliclibraryclasses-dontpreverify-verbose-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*-keep public class * extends android.app.Activity-keep public class * extends android.app.Application-keep public class * extends android.app.Service-keep public class * extends android.content.BroadcastReceiver-keep public class * extends android.content.ContentProvider-keep public class com.android.vending.licensing.ILicensingService-keepclasseswithmembernames class * {    native ;}-keepclasseswithmembernames class * {    public (android.content.Context, android.util.AttributeSet); }-keepclasseswithmembernames class * {    public (android.content.Context, android.util.AttributeSet, int); }-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}</pre><hr><p>Similar options:</p><pre>-target 1.6 -optimizationpasses 5 -allowaccessmodification -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -dump class_files.txt -printseeds seeds.txt -printusage unused.txt -printmapping mapping.txt # The -optimizations option disables some arithmetic# simplifications that Dalvik 1.0 and 1.5 can't handle. -optimizations !code/simplification/arithmetic -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends View { public (android.content.Context); public (android.content.Context, android.util.AttributeSet); public (android.content.Context, android.util.AttributeSet, int); public void set*(...); } -keep public class com.android.vending.licensing.ILicensingService-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}-keep interface com.android.vending.licensing.*-keep public interface com.android.vending.licensing.ILicenseResultListener-keep public interface com.android.vending.licensing.ILicensingService-keepclassmembers enum * {public static **[] values();public static ** valueOf(java.lang.String);} </pre>","460091","","234938","","2010-10-03 11:17:50","2012-11-07 18:07:15","Android ProGuard settings to use with app that uses licensing server to not force close?","<android>","2","0","1","",""
